[Balance] Check previous level moves for redundancy when spawning TMs (#4996)
This commit is contained in:
parent
ba28511046
commit
1953e8dbe9
|
@ -1093,7 +1093,10 @@ class TmModifierTypeGenerator extends ModifierTypeGenerator {
|
|||
if (pregenArgs && (pregenArgs.length === 1) && (pregenArgs[0] in Moves)) {
|
||||
return new TmModifierType(pregenArgs[0] as Moves);
|
||||
}
|
||||
const partyMemberCompatibleTms = party.map(p => (p as PlayerPokemon).compatibleTms.filter(tm => !p.moveset.find(m => m?.moveId === tm)));
|
||||
const partyMemberCompatibleTms = party.map(p => {
|
||||
const previousLevelMoves = p.getLearnableLevelMoves();
|
||||
return (p as PlayerPokemon).compatibleTms.filter(tm => !p.moveset.find(m => m?.moveId === tm) && !previousLevelMoves.find(lm=>lm === 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;
|
||||
|
|
Loading…
Reference in New Issue