From ee181e1509783f7e985ec05d32835429c35c477b Mon Sep 17 00:00:00 2001 From: TheMas3212 Date: Sun, 9 Jan 2022 12:57:46 +1100 Subject: [PATCH] update hp on gaining defense experience --- src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index 3990540b0..d31a592ab 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -415,6 +415,9 @@ export function gainDefenseExp(this: IPlayer, exp: number): void { } this.defense = calculateSkillF(this.defense_exp, this.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier); + const ratio = this.hp / this.max_hp; + this.max_hp = Math.floor(10 + this.defense / 10); + this.hp = Math.round(this.max_hp * ratio); } export function gainDexterityExp(this: IPlayer, exp: number): void {