Fix bug with logic for ether and elixir modifier

pull/1/head
Flashfyre 2023-04-12 21:52:23 -04:00
parent 53d62056d2
commit e3f7603f22
1 changed files with 4 additions and 4 deletions

View File

@ -228,11 +228,11 @@ const modifierPool = {
return Math.ceil(thresholdPartyMemberCount / 3); return Math.ceil(thresholdPartyMemberCount / 3);
}), }),
new WeightedModifierType(new PokemonPpRestoreModifierType('ETHER', 10), (party: PlayerPokemon[]) => { new WeightedModifierType(new PokemonPpRestoreModifierType('ETHER', 10), (party: PlayerPokemon[]) => {
const thresholdPartyMemberCount = party.filter(p => p.moveset.filter(m => m.ppUsed >= 5)).length; const thresholdPartyMemberCount = party.filter(p => p.moveset.filter(m => m.ppUsed >= 5).length).length;
return thresholdPartyMemberCount; return thresholdPartyMemberCount;
}), }),
new WeightedModifierType(new PokemonPpRestoreModifierType('MAX ETHER', -1), (party: PlayerPokemon[]) => { new WeightedModifierType(new PokemonPpRestoreModifierType('MAX ETHER', -1), (party: PlayerPokemon[]) => {
const thresholdPartyMemberCount = party.filter(p => p.moveset.filter(m => m.ppUsed > 10)).length; const thresholdPartyMemberCount = party.filter(p => p.moveset.filter(m => m.ppUsed > 10).length).length;
return Math.ceil(thresholdPartyMemberCount / 3); return Math.ceil(thresholdPartyMemberCount / 3);
}) })
].map(m => { m.setTier(ModifierTier.COMMON); return m; }), ].map(m => { m.setTier(ModifierTier.COMMON); return m; }),
@ -255,11 +255,11 @@ const modifierPool = {
return Math.ceil(thresholdPartyMemberCount / 3); return Math.ceil(thresholdPartyMemberCount / 3);
}), }),
new WeightedModifierType(new PokemonAllMovePpRestoreModifierType('ELIXIR', 10), (party: PlayerPokemon[]) => { new WeightedModifierType(new PokemonAllMovePpRestoreModifierType('ELIXIR', 10), (party: PlayerPokemon[]) => {
const thresholdPartyMemberCount = party.filter(p => p.moveset.filter(m => m.ppUsed >= 5)).length; const thresholdPartyMemberCount = party.filter(p => p.moveset.filter(m => m.ppUsed >= 5).length).length;
return thresholdPartyMemberCount; return thresholdPartyMemberCount;
}), }),
new WeightedModifierType(new PokemonAllMovePpRestoreModifierType('MAX ELIXIR', -1), (party: PlayerPokemon[]) => { new WeightedModifierType(new PokemonAllMovePpRestoreModifierType('MAX ELIXIR', -1), (party: PlayerPokemon[]) => {
const thresholdPartyMemberCount = party.filter(p => p.moveset.filter(m => m.ppUsed > 10)).length; const thresholdPartyMemberCount = party.filter(p => p.moveset.filter(m => m.ppUsed > 10).length).length;
return Math.ceil(thresholdPartyMemberCount / 3); return Math.ceil(thresholdPartyMemberCount / 3);
}), }),
new WeightedModifierType(new ModifierTypeGenerator((party: PlayerPokemon[]) => { new WeightedModifierType(new ModifierTypeGenerator((party: PlayerPokemon[]) => {