mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-24 07:02:26 +01:00
Merge pull request #375 from Tyasuh/Int-Shock-Recovery-Buff
MISC: Sleeve Int applies to active/passive shock recovery
This commit is contained in:
commit
3c7b0622a5
@ -38,6 +38,7 @@ import { SleeveBladeburnerWork } from "./Work/SleeveBladeburnerWork";
|
|||||||
import { SleeveCrimeWork } from "./Work/SleeveCrimeWork";
|
import { SleeveCrimeWork } from "./Work/SleeveCrimeWork";
|
||||||
import * as sleeveMethods from "./SleeveMethods";
|
import * as sleeveMethods from "./SleeveMethods";
|
||||||
import { SleevePerson } from "@nsdefs";
|
import { SleevePerson } from "@nsdefs";
|
||||||
|
import { calculateIntelligenceBonus } from "../formulas/intelligence";
|
||||||
|
|
||||||
export class Sleeve extends Person implements SleevePerson {
|
export class Sleeve extends Person implements SleevePerson {
|
||||||
currentWork: Work | null = null;
|
currentWork: Work | null = null;
|
||||||
@ -171,7 +172,10 @@ export class Sleeve extends Person implements SleevePerson {
|
|||||||
this.storedCycles += numCycles;
|
this.storedCycles += numCycles;
|
||||||
if (this.storedCycles < CyclesPerSecond || !this.currentWork) return;
|
if (this.storedCycles < CyclesPerSecond || !this.currentWork) return;
|
||||||
const cyclesUsed = Math.min(this.storedCycles, 15);
|
const cyclesUsed = Math.min(this.storedCycles, 15);
|
||||||
this.shock = Math.max(0, this.shock - 0.0001 * cyclesUsed);
|
this.shock = Math.max(
|
||||||
|
0,
|
||||||
|
this.shock - 0.0001 * calculateIntelligenceBonus(this.skills.intelligence, 0.75) * cyclesUsed,
|
||||||
|
);
|
||||||
this.currentWork.process(this, cyclesUsed);
|
this.currentWork.process(this, cyclesUsed);
|
||||||
this.storedCycles -= cyclesUsed;
|
this.storedCycles -= cyclesUsed;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../../../utils/JSONReviver";
|
import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../../../utils/JSONReviver";
|
||||||
import { Sleeve } from "../Sleeve";
|
import { Sleeve } from "../Sleeve";
|
||||||
import { Work, WorkType } from "./Work";
|
import { Work, WorkType } from "./Work";
|
||||||
|
import { calculateIntelligenceBonus } from "../../formulas/intelligence";
|
||||||
|
|
||||||
export const isSleeveRecoveryWork = (w: Work | null): w is SleeveRecoveryWork =>
|
export const isSleeveRecoveryWork = (w: Work | null): w is SleeveRecoveryWork =>
|
||||||
w !== null && w.type === WorkType.RECOVERY;
|
w !== null && w.type === WorkType.RECOVERY;
|
||||||
@ -11,7 +12,10 @@ export class SleeveRecoveryWork extends Work {
|
|||||||
}
|
}
|
||||||
|
|
||||||
process(sleeve: Sleeve, cycles: number) {
|
process(sleeve: Sleeve, cycles: number) {
|
||||||
sleeve.shock = Math.max(0, sleeve.shock - 0.0002 * cycles);
|
sleeve.shock = Math.max(
|
||||||
|
0,
|
||||||
|
sleeve.shock - 0.0002 * calculateIntelligenceBonus(sleeve.skills.intelligence, 0.75) * cycles,
|
||||||
|
);
|
||||||
if (sleeve.shock <= 0) sleeve.stopWork();
|
if (sleeve.shock <= 0) sleeve.stopWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user