Exclude learned moves from compatible TMs

pull/18/head
Flashfyre 2024-03-27 10:43:00 -04:00
parent 3d8edb8e9b
commit 28ff6f5638
1 changed files with 1 additions and 1 deletions

View File

@ -590,7 +590,7 @@ class AttackTypeBoosterModifierTypeGenerator extends ModifierTypeGenerator {
class TmModifierTypeGenerator extends ModifierTypeGenerator {
constructor(tier: ModifierTier) {
super((party: Pokemon[]) => {
const partyMemberCompatibleTms = party.map(p => (p as PlayerPokemon).compatibleTms);
const partyMemberCompatibleTms = party.map(p => (p as PlayerPokemon).compatibleTms.filter(tm => !p.moveset.find(m => m.moveId === tm)));
const tierUniqueCompatibleTms = partyMemberCompatibleTms.flat().filter(tm => tmPoolTiers[tm] === tier).filter(tm => !allMoves[tm].name.endsWith(' (N)')).filter((tm, i, array) => array.indexOf(tm) === i);
if (!tierUniqueCompatibleTms.length)
return null;