Fix multiple form change held items not appearing
This commit is contained in:
parent
fedc044aed
commit
9179930249
|
@ -1090,9 +1090,12 @@ export function regenerateModifierPoolThresholds(party: Pokemon[], poolType: Mod
|
||||||
pool[t].reduce((total: integer, modifierType: WeightedModifierType) => {
|
pool[t].reduce((total: integer, modifierType: WeightedModifierType) => {
|
||||||
const weightedModifierType = modifierType as WeightedModifierType;
|
const weightedModifierType = modifierType as WeightedModifierType;
|
||||||
const existingModifiers = party[0].scene.findModifiers(m => (m.type.generatorId || m.type.id) === weightedModifierType.modifierType.id, player);
|
const existingModifiers = party[0].scene.findModifiers(m => (m.type.generatorId || m.type.id) === weightedModifierType.modifierType.id, player);
|
||||||
|
const itemModifierType = weightedModifierType.modifierType instanceof ModifierTypeGenerator
|
||||||
|
? weightedModifierType.modifierType.generateType(party)
|
||||||
|
: weightedModifierType;
|
||||||
const weight = !existingModifiers.length
|
const weight = !existingModifiers.length
|
||||||
|| weightedModifierType.modifierType instanceof PokemonHeldItemModifierType
|
|| itemModifierType instanceof PokemonHeldItemModifierType
|
||||||
|| (weightedModifierType.modifierType instanceof ModifierTypeGenerator && weightedModifierType.modifierType.generateType(party) instanceof PokemonHeldItemModifierType)
|
|| itemModifierType instanceof FormChangeItemModifierType
|
||||||
|| existingModifiers.find(m => m.stackCount < m.getMaxStackCount(party[0].scene, true))
|
|| existingModifiers.find(m => m.stackCount < m.getMaxStackCount(party[0].scene, true))
|
||||||
? weightedModifierType.weight instanceof Function
|
? weightedModifierType.weight instanceof Function
|
||||||
? (weightedModifierType.weight as Function)(party)
|
? (weightedModifierType.weight as Function)(party)
|
||||||
|
|
Loading…
Reference in New Issue