Prevent SMPhase copies from updating the seed

This commit is contained in:
innerthunder 2024-10-06 22:23:00 -07:00
parent a515b9bfca
commit 7d1b9b232f

View File

@ -16,23 +16,25 @@ export class SelectModifierPhase extends BattlePhase {
private rerollCount: integer; private rerollCount: integer;
private modifierTiers?: ModifierTier[]; private modifierTiers?: ModifierTier[];
private customModifierSettings?: CustomModifierSettings; private customModifierSettings?: CustomModifierSettings;
private isCopy: boolean;
private typeOptions: ModifierTypeOption[]; 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); super(scene);
this.rerollCount = rerollCount; this.rerollCount = rerollCount;
this.modifierTiers = modifierTiers; this.modifierTiers = modifierTiers;
this.customModifierSettings = customModifierSettings; this.customModifierSettings = customModifierSettings;
this.isCopy = isCopy;
} }
start() { start() {
super.start(); super.start();
if (!this.rerollCount) { if (!this.rerollCount && !this.isCopy) {
this.updateSeed(); this.updateSeed();
} else { } else if (this.rerollCount) {
this.scene.reroll = false; this.scene.reroll = false;
} }
@ -282,7 +284,7 @@ export class SelectModifierPhase extends BattlePhase {
} }
copy(): SelectModifierPhase { 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<boolean> { addModifier(modifier: Modifier): Promise<boolean> {