prestige stuff with sg

This commit is contained in:
Olivier Gagnon 2021-10-16 21:38:03 -04:00
parent a0a698e0af
commit fdf2e72896
2 changed files with 13 additions and 1 deletions

@ -12,6 +12,7 @@ import { CONSTANTS } from "../Constants";
import { StanekConstants } from "./data/Constants";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
import { Player } from "../Player";
import { AugmentationNames } from "../Augmentation/data/AugmentationNames";
export class StaneksGift implements IStaneksGift {
storedCycles = 0;
@ -45,6 +46,7 @@ export class StaneksGift implements IStaneksGift {
}
process(p: IPlayer, numCycles = 1): void {
if (!p.hasAugmentation(AugmentationNames.StaneksGift1)) return;
this.storedCycles += numCycles;
this.storedCycles -= 5;
this.storedCycles = Math.max(0, this.storedCycles);
@ -121,6 +123,10 @@ export class StaneksGift implements IStaneksGift {
this.fragments = [];
}
clearCharge(): void {
this.fragments.forEach((f) => (f.charge = 0));
}
updateMults(p: IPlayer): void {
p.reapplyAllAugmentations(true);
p.reapplyAllSourceFiles();
@ -198,11 +204,12 @@ export class StaneksGift implements IStaneksGift {
}
prestigeAugmentation(): void {
this.clear();
this.clearCharge();
}
prestigeSourceFile(): void {
this.clear();
this.storedCycles = 0;
}
/**

@ -27,6 +27,7 @@ import { Terminal } from "./Terminal";
import { dialogBoxCreate } from "./ui/React/DialogBox";
import Decimal from "decimal.js";
import { staneksGift } from "./CotMG/Helper";
const BitNode8StartingMoney = 250e6;
@ -143,6 +144,8 @@ function prestigeAugmentation(): void {
joinFaction(Factions["Church of the Machine God"]);
}
staneksGift.prestigeAugmentation();
resetPidCounter();
}
@ -270,6 +273,8 @@ function prestigeSourceFile(flume: boolean): void {
updateHashManagerCapacity(Player);
}
staneksGift.prestigeSourceFile();
// Gain int exp
if (SourceFileFlags[5] !== 0 && !flume) Player.gainIntelligenceExp(300);