From ce84ae2f69a1cb6acf3c596c0bd8560efac0700e Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 28 Oct 2023 18:55:07 -0400 Subject: [PATCH] Lower max Shiny Charm stack count to 4 --- src/modifier/modifier.ts | 2 +- src/system/modifier-data.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index f39df21a4..2925f7945 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1067,7 +1067,7 @@ export class ShinyRateBoosterModifier extends PersistentModifier { } getMaxStackCount(): integer { - return 5; + return 4; } } diff --git a/src/system/modifier-data.ts b/src/system/modifier-data.ts index 84badd15e..772c61026 100644 --- a/src/system/modifier-data.ts +++ b/src/system/modifier-data.ts @@ -39,7 +39,10 @@ export default class ModifierData { if (type instanceof ModifierTypeGenerator) type = (type as ModifierTypeGenerator).generateType(this.player ? scene.getParty() : scene.getEnemyField(), this.typePregenArgs); - const ret = Reflect.construct(constructor, ([ type ] as any[]).concat(this.args).concat(this.stackCount)) as PersistentModifier + const ret = Reflect.construct(constructor, ([ type ] as any[]).concat(this.args).concat(this.stackCount)) as PersistentModifier; + + if (ret.stackCount > ret.getMaxStackCount()) + ret.stackCount = ret.getMaxStackCount(); return ret; }