mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
STANEK: Re-apply stanek boosts when applying entropy (#816)
This commit is contained in:
@@ -58,7 +58,7 @@ export class StaneksGift extends BaseGift {
|
|||||||
this.storedCycles = Math.max(0, this.storedCycles - usedCycles);
|
this.storedCycles = Math.max(0, this.storedCycles - usedCycles);
|
||||||
// Only update multipliers (slow) if there was charging done since last process tick.
|
// Only update multipliers (slow) if there was charging done since last process tick.
|
||||||
if (this.justCharged) {
|
if (this.justCharged) {
|
||||||
this.updateMults();
|
Player.applyEntropy(Player.entropy);
|
||||||
this.justCharged = false;
|
this.justCharged = false;
|
||||||
}
|
}
|
||||||
StaneksGiftEvents.emit();
|
StaneksGiftEvents.emit();
|
||||||
@@ -210,9 +210,6 @@ export class StaneksGift extends BaseGift {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateMults(): void {
|
updateMults(): void {
|
||||||
// applyEntropy also reapplies all augmentations and source files
|
|
||||||
// This wraps up the reset nicely
|
|
||||||
Player.applyEntropy(Player.entropy);
|
|
||||||
const mults = this.calculateMults();
|
const mults = this.calculateMults();
|
||||||
Player.mults = mergeMultipliers(Player.mults, mults);
|
Player.mults = mergeMultipliers(Player.mults, mults);
|
||||||
Player.updateSkillLevels();
|
Player.updateSkillLevels();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { staneksGift } from "../../CotMG/Helper";
|
import { staneksGift } from "../../CotMG/Helper";
|
||||||
|
import { Player } from "@player";
|
||||||
|
|
||||||
import Accordion from "@mui/material/Accordion";
|
import Accordion from "@mui/material/Accordion";
|
||||||
import AccordionSummary from "@mui/material/AccordionSummary";
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||||
@@ -29,12 +30,14 @@ export function StanekDev(): React.ReactElement {
|
|||||||
staneksGift.fragments.forEach((f) => {
|
staneksGift.fragments.forEach((f) => {
|
||||||
f.highestCharge = 1e21;
|
f.highestCharge = 1e21;
|
||||||
f.numCharge = 1e21;
|
f.numCharge = 1e21;
|
||||||
|
Player.applyEntropy(Player.entropy);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function modCharge(modify: number): (x: number) => void {
|
function modCharge(modify: number): (x: number) => void {
|
||||||
return function (cycles: number): void {
|
return function (cycles: number): void {
|
||||||
staneksGift.fragments.forEach((f) => (f.highestCharge += cycles * modify));
|
staneksGift.fragments.forEach((f) => (f.highestCharge += cycles * modify));
|
||||||
|
Player.applyEntropy(Player.entropy);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/** Augmentation-related methods for the Player class (PlayerObject) */
|
/** Augmentation-related methods for the Player class (PlayerObject) */
|
||||||
import { calculateEntropy } from "../Grafting/EntropyAccumulation";
|
import { calculateEntropy } from "../Grafting/EntropyAccumulation";
|
||||||
|
import { staneksGift } from "../../CotMG/Helper";
|
||||||
|
|
||||||
import type { PlayerObject } from "./PlayerObject";
|
import type { PlayerObject } from "./PlayerObject";
|
||||||
|
|
||||||
@@ -9,4 +10,5 @@ export function applyEntropy(this: PlayerObject, stacks = 1): void {
|
|||||||
this.reapplyAllSourceFiles();
|
this.reapplyAllSourceFiles();
|
||||||
|
|
||||||
this.mults = calculateEntropy(stacks);
|
this.mults = calculateEntropy(stacks);
|
||||||
|
staneksGift.updateMults();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,8 +229,6 @@ const Engine: {
|
|||||||
if (loadGame(saveString)) {
|
if (loadGame(saveString)) {
|
||||||
FormatsNeedToChange.emit();
|
FormatsNeedToChange.emit();
|
||||||
initBitNodeMultipliers();
|
initBitNodeMultipliers();
|
||||||
Player.reapplyAllAugmentations();
|
|
||||||
Player.reapplyAllSourceFiles();
|
|
||||||
if (Player.hasWseAccount) {
|
if (Player.hasWseAccount) {
|
||||||
initSymbolToStockMap();
|
initSymbolToStockMap();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user