From 7d1b9b232f8f1b3883c10fbe5df1ebe5d63fa02f Mon Sep 17 00:00:00 2001 From: innerthunder Date: Sun, 6 Oct 2024 22:23:00 -0700 Subject: [PATCH] Prevent SMPhase copies from updating the seed --- src/phases/select-modifier-phase.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/phases/select-modifier-phase.ts b/src/phases/select-modifier-phase.ts index dc86f0330d1..b041f187260 100644 --- a/src/phases/select-modifier-phase.ts +++ b/src/phases/select-modifier-phase.ts @@ -16,23 +16,25 @@ export class SelectModifierPhase extends BattlePhase { private rerollCount: integer; private modifierTiers?: ModifierTier[]; private customModifierSettings?: CustomModifierSettings; + private isCopy: boolean; private typeOptions: ModifierTypeOption[]; - constructor(scene: BattleScene, rerollCount: integer = 0, modifierTiers?: ModifierTier[], customModifierSettings?: CustomModifierSettings) { + constructor(scene: BattleScene, rerollCount: integer = 0, modifierTiers?: ModifierTier[], customModifierSettings?: CustomModifierSettings, isCopy: boolean = false) { super(scene); this.rerollCount = rerollCount; this.modifierTiers = modifierTiers; this.customModifierSettings = customModifierSettings; + this.isCopy = isCopy; } start() { super.start(); - if (!this.rerollCount) { + if (!this.rerollCount && !this.isCopy) { this.updateSeed(); - } else { + } else if (this.rerollCount) { this.scene.reroll = false; } @@ -282,7 +284,7 @@ export class SelectModifierPhase extends BattlePhase { } copy(): SelectModifierPhase { - return new SelectModifierPhase(this.scene, this.rerollCount, this.modifierTiers, { guaranteedModifierTypeOptions: this.typeOptions, allowLuckUpgrades: false }); + return new SelectModifierPhase(this.scene, this.rerollCount, this.modifierTiers, { guaranteedModifierTypeOptions: this.typeOptions, allowLuckUpgrades: false }, true); } addModifier(modifier: Modifier): Promise {