From 6da5d9d6aaa0f00846c110b955c903ae320a4061 Mon Sep 17 00:00:00 2001 From: Amani H <109637146+xsn34kzx@users.noreply.github.com> Date: Tue, 2 Jul 2024 10:31:28 -0400 Subject: [PATCH] [Bug] Thief Interaction with Species Stat Boosters (#2747) --- src/modifier/modifier-type.ts | 10 ++++------ src/system/modifier-data.ts | 3 --- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 151758da246..d8ec0072bd4 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -45,7 +45,6 @@ type NewModifierFunc = (type: ModifierType, args: any[]) => Modifier; export class ModifierType { public id: string; - public generatorId: string; public localeKey: string; public iconImage: string; public group: string; @@ -102,7 +101,7 @@ export class ModifierType { if (!pool.hasOwnProperty(tier)) { continue; } - if (pool[tier].find(m => (m as WeightedModifierType).modifierType.id === (this.generatorId || this.id))) { + if (pool[tier].find(m => (m as WeightedModifierType).modifierType.id === this.id)) { return (this.tier = tier); } } @@ -133,7 +132,6 @@ export class ModifierTypeGenerator extends ModifierType { generateType(party: Pokemon[], pregenArgs?: any[]) { const ret = this.genTypeFunc(party, pregenArgs); if (ret) { - ret.generatorId = ret.id; ret.id = this.id; ret.setTier(this.tier); } @@ -554,7 +552,7 @@ export class SpeciesStatBoosterModifierType extends PokemonHeldItemModifierType const item = SpeciesStatBoosterModifierTypeGenerator.items[key]; super(`modifierType:SpeciesBoosterItem.${key}`, key.toLowerCase(), (type, args) => new Modifiers.SpeciesStatBoosterModifier(type, (args[0] as Pokemon).id, item.stats, item.multiplier, item.species)); - this.id = this.key = key; + this.key = key; } getPregenArgs(): any[] { @@ -1742,7 +1740,7 @@ export function regenerateModifierPoolThresholds(party: Pokemon[], poolType: Mod let i = 0; pool[t].reduce((total: integer, modifierType: WeightedModifierType) => { const weightedModifierType = modifierType as WeightedModifierType; - const existingModifiers = party[0].scene.findModifiers(m => (m.type.generatorId || m.type.id) === weightedModifierType.modifierType.id, poolType === ModifierPoolType.PLAYER); + const existingModifiers = party[0].scene.findModifiers(m => m.type.id === weightedModifierType.modifierType.id, poolType === ModifierPoolType.PLAYER); const itemModifierType = weightedModifierType.modifierType instanceof ModifierTypeGenerator ? weightedModifierType.modifierType.generateType(party) : weightedModifierType.modifierType; @@ -1755,7 +1753,7 @@ export function regenerateModifierPoolThresholds(party: Pokemon[], poolType: Mod : weightedModifierType.weight as integer : 0; if (weightedModifierType.maxWeight) { - const modifierId = weightedModifierType.modifierType.generatorId || weightedModifierType.modifierType.id; + const modifierId = weightedModifierType.modifierType.id; tierModifierIds.push(modifierId); const outputWeight = useMaxWeightForOutput ? weightedModifierType.maxWeight : weight; modifierTableData[modifierId] = { weight: outputWeight, tier: parseInt(t), tierPercent: 0, totalPercent: 0 }; diff --git a/src/system/modifier-data.ts b/src/system/modifier-data.ts index d79206d89df..6f169280da1 100644 --- a/src/system/modifier-data.ts +++ b/src/system/modifier-data.ts @@ -5,7 +5,6 @@ import { GeneratedPersistentModifierType, ModifierTypeGenerator, getModifierType export default class ModifierData { private player: boolean; private typeId: string; - private typeGeneratorId: string; private typePregenArgs: any[]; private args: any[]; private stackCount: integer; @@ -16,7 +15,6 @@ export default class ModifierData { const sourceModifier = source instanceof PersistentModifier ? source as PersistentModifier : null; this.player = player; this.typeId = sourceModifier ? sourceModifier.type.id : source.typeId; - this.typeGeneratorId = sourceModifier ? sourceModifier.type.generatorId : source.typeGeneratorId; if (sourceModifier) { if ("getPregenArgs" in source.type) { this.typePregenArgs = (source.type as GeneratedPersistentModifierType).getPregenArgs(); @@ -38,7 +36,6 @@ export default class ModifierData { try { let type = typeFunc(); type.id = this.typeId; - type.generatorId = this.typeGeneratorId; if (type instanceof ModifierTypeGenerator) { type = (type as ModifierTypeGenerator).generateType(this.player ? scene.getParty() : scene.getEnemyField(), this.typePregenArgs);