Merge pull request #2487 from TheMas3212/fix-2127

update hp on gaining defense experience
This commit is contained in:
hydroflame 2022-01-09 13:01:24 -05:00 committed by GitHub
commit eb57149a3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -415,6 +415,9 @@ export function gainDefenseExp(this: IPlayer, exp: number): void {
} }
this.defense = calculateSkillF(this.defense_exp, this.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier); 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 { export function gainDexterityExp(this: IPlayer, exp: number): void {