From 8169db62ef82740e54afbb659887788814b3c16f Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 5 Apr 2024 01:00:11 -0400 Subject: [PATCH] Make token changes compatible with old saves --- src/modifier/modifier.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 2b7ed5562..1b5ab159e 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1903,11 +1903,12 @@ abstract class EnemyDamageMultiplierModifier extends EnemyPersistentModifier { export class EnemyDamageBoosterModifier extends EnemyDamageMultiplierModifier { constructor(type: ModifierType, boostPercent: number, stackCount?: integer) { - super(type, 1 + ((boostPercent || 10) * 0.01), stackCount); + //super(type, 1 + ((boostPercent || 10) * 0.01), stackCount); + super(type, 1.1, stackCount); // Hardcode multiplier temporarily } match(modifier: Modifier): boolean { - return modifier instanceof EnemyDamageBoosterModifier && modifier.damageMultiplier === this.damageMultiplier; + return modifier instanceof EnemyDamageBoosterModifier; } clone(): EnemyDamageBoosterModifier { @@ -1925,18 +1926,19 @@ export class EnemyDamageBoosterModifier extends EnemyDamageMultiplierModifier { export class EnemyDamageReducerModifier extends EnemyDamageMultiplierModifier { constructor(type: ModifierType, reductionPercent: number, stackCount?: integer) { - super(type, 1 - ((reductionPercent || 5) * 0.01), stackCount); + //super(type, 1 - ((reductionPercent || 5) * 0.01), stackCount); + super(type, 0.95, stackCount); // Hardcode multiplier temporarily } match(modifier: Modifier): boolean { - return modifier instanceof EnemyDamageReducerModifier && modifier.damageMultiplier === this.damageMultiplier; + return modifier instanceof EnemyDamageReducerModifier; } clone(): EnemyDamageReducerModifier { return new EnemyDamageReducerModifier(this.type, (1 - this.damageMultiplier) * 100, this.stackCount); } - getArgs(): any[] { + getArgs(): any[] { return [ (1 - this.damageMultiplier) * 100 ]; } } @@ -1947,11 +1949,12 @@ export class EnemyTurnHealModifier extends EnemyPersistentModifier { constructor(type: ModifierType, healPercent: number, stackCount?: integer) { super(type, stackCount); - this.healPercent = healPercent || 3; + // Hardcode temporarily + this.healPercent = 3; } match(modifier: Modifier): boolean { - return modifier instanceof EnemyTurnHealModifier && modifier.healPercent === this.healPercent; + return modifier instanceof EnemyTurnHealModifier; } clone(): EnemyTurnHealModifier {