Merge branch 'dev' into improvement/work-in-progress-ui

This commit is contained in:
nickofolas
2022-05-04 12:28:33 -05:00
72 changed files with 1325 additions and 820 deletions
+2 -2
View File
@@ -686,7 +686,7 @@ export class Sleeve extends Person {
}
tryBuyAugmentation(p: IPlayer, aug: Augmentation): boolean {
if (!p.canAfford(aug.startingCost)) {
if (!p.canAfford(aug.baseCost)) {
return false;
}
@@ -695,7 +695,7 @@ export class Sleeve extends Person {
return false;
}
p.loseMoney(aug.startingCost, "sleeves");
p.loseMoney(aug.baseCost, "sleeves");
this.installAugmentation(aug);
return true;
}
+6 -6
View File
@@ -4,7 +4,7 @@ import { Sleeve } from "./Sleeve";
import { IPlayer } from "../IPlayer";
import { Augmentation } from "../../Augmentation/Augmentation";
import { Augmentations } from "../../Augmentation/Augmentations";
import { StaticAugmentations } from "../../Augmentation/StaticAugmentations";
import { Faction } from "../../Faction/Faction";
import { Factions } from "../../Faction/Factions";
@@ -64,13 +64,13 @@ export function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentat
if (p.inGang()) {
const fac = p.getGangFaction();
for (const augName of Object.keys(Augmentations)) {
const aug = Augmentations[augName];
for (const augName of Object.keys(StaticAugmentations)) {
const aug = StaticAugmentations[augName];
if (!isAvailableForSleeve(aug)) {
continue;
}
if (fac.playerReputation > aug.baseRepRequirement) {
if (fac.playerReputation > aug.getCost(p).repCost) {
availableAugs.push(aug);
}
}
@@ -89,12 +89,12 @@ export function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentat
}
for (const augName of fac.augmentations) {
const aug: Augmentation = Augmentations[augName];
const aug: Augmentation = StaticAugmentations[augName];
if (!isAvailableForSleeve(aug)) {
continue;
}
if (fac.playerReputation > aug.baseRepRequirement) {
if (fac.playerReputation > aug.getCost(p).repCost) {
availableAugs.push(aug);
}
}
@@ -52,7 +52,7 @@ export function SleeveAugmentationsModal(props: IProps): React.ReactElement {
ownedAugNames={ownedAugNames}
player={player}
canPurchase={(player, aug) => {
return player.money > aug.startingCost;
return player.money > aug.baseCost;
}}
purchaseAugmentation={(player, aug, _showModal) => {
props.sleeve.tryBuyAugmentation(player, aug);
+3 -1
View File
@@ -77,7 +77,9 @@ function possibleFactions(player: IPlayer, sleeve: Sleeve): string[] {
}
return factions.filter((faction) => {
const facInfo = Factions[faction].getInfo();
const factionObj = Factions[faction];
if (!factionObj) return false;
const facInfo = factionObj.getInfo();
return facInfo.offerHackingWork || facInfo.offerFieldWork || facInfo.offerSecurityWork;
});
}