merge base

This commit is contained in:
phyzical
2022-04-14 21:27:08 +08:00
104 changed files with 1826 additions and 1276 deletions
+2 -1
View File
@@ -62,7 +62,8 @@ export function hasAugmentationPrereqs(aug: Augmentation): boolean {
console.error(`Invalid prereq Augmentation ${aug.prereqs[i]}`);
continue;
}
if (prereqAug.owned === false) {
if (Player.hasAugmentation(prereqAug, true) === false) {
hasPrereqs = false;
// Check if the aug is purchased
+40 -7
View File
@@ -1,6 +1,8 @@
import React from "react";
import { IMap } from "../types";
import { FactionNames } from "./data/FactionNames";
import { use } from "../ui/Context";
import { Option } from "./ui/Option";
interface FactionInfoParams {
infoText?: JSX.Element;
@@ -10,6 +12,7 @@ interface FactionInfoParams {
offerSecurityWork?: boolean;
special?: boolean;
keepOnInstall?: boolean;
assignment?: () => React.ReactElement;
}
/**
@@ -51,6 +54,11 @@ export class FactionInfo {
*/
special: boolean;
/**
* The data to display on the faction screen.
*/
assignment?: () => React.ReactElement;
constructor(params: FactionInfoParams) {
this.infoText = params.infoText ?? <></>;
this.enemies = params.enemies ?? [];
@@ -60,6 +68,7 @@ export class FactionInfo {
this.keep = params.keepOnInstall ?? false;
this.special = params.special ?? false;
this.assignment = params.assignment;
}
offersWork(): boolean {
@@ -438,11 +447,21 @@ export const FactionInfos: IMap<FactionInfo> = {
),
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({
infoText:(<>
// prettier-ignore
infoText:(<>
{" `` "}<br />
{" -odmmNmds: "}<br />
{" `hNmo:..-omNh. "}<br />
@@ -472,11 +491,25 @@ export const FactionInfos: IMap<FactionInfo> = {
{" -smNNNNmdo- "}<br />
{" `..` "}<br /><br />
Many cultures predict an end to humanity in the near future, a final
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.</>),
special: true,
keepOnInstall: true,
Armageddon that will end the world; but we disagree.</>),
offerHackingWork: false,
offerFieldWork: false,
offerSecurityWork: false,
special: 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()}
/>
);
},
}),
// prettier-ignore
[FactionNames.Infiltrators]: new FactionInfo({
+14 -12
View File
@@ -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 {
const setRerender = useState(false)[1];
function rerender(): void {
@@ -44,6 +55,8 @@ export function Info(props: IProps): React.ReactElement {
const classes = useStyles();
const Assignment = props.factionInfo.assignment ?? DefaultAssignment;
const favorGain = props.faction.getFavorGain();
const offersWork =
props.factionInfo.offerFieldWork || props.factionInfo.offerSecurityWork || props.factionInfo.offerHackingWork;
@@ -97,18 +110,7 @@ export function Info(props: IProps): React.ReactElement {
</Box>
<Typography>-------------------------</Typography>
<Typography>
{offersWork ? (
<>
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>
<Assignment />
</>
);
}