mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +01:00
Change faction info display
This commit is contained in:
parent
957c07d9d2
commit
c8df4fff00
@ -1,6 +1,8 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { IMap } from "../types";
|
import { IMap } from "../types";
|
||||||
import { FactionNames } from "./data/FactionNames";
|
import { FactionNames } from "./data/FactionNames";
|
||||||
|
import { use } from "../ui/Context";
|
||||||
|
import { Option } from "./ui/Option";
|
||||||
|
|
||||||
interface FactionInfoParams {
|
interface FactionInfoParams {
|
||||||
infoText?: JSX.Element;
|
infoText?: JSX.Element;
|
||||||
@ -10,6 +12,7 @@ interface FactionInfoParams {
|
|||||||
offerSecurityWork?: boolean;
|
offerSecurityWork?: boolean;
|
||||||
special?: boolean;
|
special?: boolean;
|
||||||
keepOnInstall?: boolean;
|
keepOnInstall?: boolean;
|
||||||
|
assignment?: () => React.ReactElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,6 +54,11 @@ export class FactionInfo {
|
|||||||
*/
|
*/
|
||||||
special: boolean;
|
special: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The data to display on the faction screen.
|
||||||
|
*/
|
||||||
|
assignment?: () => React.ReactElement;
|
||||||
|
|
||||||
constructor(params: FactionInfoParams) {
|
constructor(params: FactionInfoParams) {
|
||||||
this.infoText = params.infoText ?? <></>;
|
this.infoText = params.infoText ?? <></>;
|
||||||
this.enemies = params.enemies ?? [];
|
this.enemies = params.enemies ?? [];
|
||||||
@ -60,6 +68,7 @@ export class FactionInfo {
|
|||||||
|
|
||||||
this.keep = params.keepOnInstall ?? false;
|
this.keep = params.keepOnInstall ?? false;
|
||||||
this.special = params.special ?? false;
|
this.special = params.special ?? false;
|
||||||
|
this.assignment = params.assignment;
|
||||||
}
|
}
|
||||||
|
|
||||||
offersWork(): boolean {
|
offersWork(): boolean {
|
||||||
@ -438,10 +447,20 @@ export const FactionInfos: IMap<FactionInfo> = {
|
|||||||
),
|
),
|
||||||
|
|
||||||
special: true,
|
special: true,
|
||||||
|
assignment: (): React.ReactElement => {
|
||||||
|
const router = use.Router();
|
||||||
|
return (
|
||||||
|
<Option
|
||||||
|
buttonText={"Open Bladeburner headquarters"}
|
||||||
|
infoText={"You can gain reputation with bladeburner by completing contracts and operations."}
|
||||||
|
onClick={() => router.toBladeburner()}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// prettier-ignore
|
|
||||||
[FactionNames.ChurchOfTheMachineGod]: new FactionInfo({
|
[FactionNames.ChurchOfTheMachineGod]: new FactionInfo({
|
||||||
|
// prettier-ignore
|
||||||
infoText:(<>
|
infoText:(<>
|
||||||
{" `` "}<br />
|
{" `` "}<br />
|
||||||
{" -odmmNmds: "}<br />
|
{" -odmmNmds: "}<br />
|
||||||
@ -472,13 +491,24 @@ export const FactionInfos: IMap<FactionInfo> = {
|
|||||||
{" -smNNNNmdo- "}<br />
|
{" -smNNNNmdo- "}<br />
|
||||||
{" `..` "}<br /><br />
|
{" `..` "}<br /><br />
|
||||||
Many cultures predict an end to humanity in the near future, a final
|
Many cultures predict an end to humanity in the near future, a final
|
||||||
Armageddon that will end the world; but we disagree.
|
Armageddon that will end the world; but we disagree.</>),
|
||||||
<br /><br />Note that for this faction, reputation can
|
|
||||||
only be gained by charging Stanek's gift.</>),
|
|
||||||
offerHackingWork: false,
|
offerHackingWork: false,
|
||||||
offerFieldWork: false,
|
offerFieldWork: false,
|
||||||
offerSecurityWork: false,
|
offerSecurityWork: false,
|
||||||
special: true,
|
special: true,
|
||||||
keepOnInstall: true,
|
keepOnInstall: true,
|
||||||
|
assignment: (): React.ReactElement => {
|
||||||
|
const router = use.Router();
|
||||||
|
return (
|
||||||
|
<Option
|
||||||
|
buttonText={"Open Staneks Gift"}
|
||||||
|
infoText={
|
||||||
|
"Stanek's Gift is a powerful augmentation that powers up the stat you chose to boost." +
|
||||||
|
"Gaining reputation with the Church of the Machine God can only be done by charging the gift."
|
||||||
|
}
|
||||||
|
onClick={() => router.toStaneksGift()}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
@ -31,6 +31,17 @@ const useStyles = makeStyles(() =>
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function DefaultAssignment(): React.ReactElement {
|
||||||
|
return (
|
||||||
|
<Typography>
|
||||||
|
Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn
|
||||||
|
reputation for your faction. You will also gain reputation passively over time, although at a very slow rate.
|
||||||
|
Earning reputation will allow you to purchase Augmentations through this faction, which are powerful upgrades that
|
||||||
|
enhance your abilities.
|
||||||
|
</Typography>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function Info(props: IProps): React.ReactElement {
|
export function Info(props: IProps): React.ReactElement {
|
||||||
const setRerender = useState(false)[1];
|
const setRerender = useState(false)[1];
|
||||||
function rerender(): void {
|
function rerender(): void {
|
||||||
@ -44,6 +55,8 @@ export function Info(props: IProps): React.ReactElement {
|
|||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
|
const Assignment = props.factionInfo.assignment ?? DefaultAssignment;
|
||||||
|
|
||||||
const favorGain = props.faction.getFavorGain();
|
const favorGain = props.faction.getFavorGain();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -94,12 +107,7 @@ export function Info(props: IProps): React.ReactElement {
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Typography>-------------------------</Typography>
|
<Typography>-------------------------</Typography>
|
||||||
<Typography>
|
<Assignment />
|
||||||
Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn
|
|
||||||
reputation for your faction. You will also gain reputation passively over time, although at a very slow rate.
|
|
||||||
Earning reputation will allow you to purchase Augmentations through this faction, which are powerful upgrades
|
|
||||||
that enhance your abilities.
|
|
||||||
</Typography>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user