diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 516f57dfd..b4a49d830 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -61,14 +61,7 @@ import { NetscriptCorporation } from "./NetscriptFunctions/Corporation"; import { NetscriptFormulas } from "./NetscriptFunctions/Formulas"; import { NetscriptStockMarket } from "./NetscriptFunctions/StockMarket"; import { NetscriptGrafting } from "./NetscriptFunctions/Grafting"; -import { - NS, - RecentScript as IRecentScript, - BasicHGWOptions, - ProcessInfo, - MoneySource as IMoneySource, - MoneySources as IMoneySources, -} from "./ScriptEditor/NetscriptDefinitions"; +import { NS, RecentScript as IRecentScript, BasicHGWOptions, ProcessInfo } from "./ScriptEditor/NetscriptDefinitions"; import { NetscriptSingularity } from "./NetscriptFunctions/Singularity"; import { dialogBoxCreate } from "./ui/React/DialogBox"; diff --git a/src/PersonObjects/PersonMethods.ts b/src/PersonObjects/PersonMethods.ts index 2866c7da4..9f2388075 100644 --- a/src/PersonObjects/PersonMethods.ts +++ b/src/PersonObjects/PersonMethods.ts @@ -51,8 +51,10 @@ export function gainDefenseExp(this: Person, exp: number): void { this.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier, ); const ratio = this.hp.current / this.hp.max; - this.hp.max = Math.floor(10 + this.skills.defense / 10); - this.hp.current = Math.round(this.hp.max * ratio); + this.hp = { + max: Math.floor(10 + this.skills.defense / 10), + current: Math.round(this.hp.max * ratio), + }; } export function gainDexterityExp(this: Person, exp: number): void { @@ -194,8 +196,10 @@ export function updateSkillLevels(this: Person): void { ); const ratio: number = this.hp.current / this.hp.max; - this.hp.max = Math.floor(10 + this.skills.defense / 10); - this.hp.current = Math.round(this.hp.max * ratio); + this.hp = { + max: Math.floor(10 + this.skills.defense / 10), + current: Math.round(this.hp.max * ratio), + }; } export function hasAugmentation(this: Person, augName: string, ignoreQueued = false) {