Skip to content

Commit

Permalink
Add TM Type
Browse files Browse the repository at this point in the history
  • Loading branch information
xsn34kzx committed Jul 9, 2024
1 parent 2bd2152 commit c278061
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modifier/modifier-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,10 @@ class SpeciesStatBoosterModifierTypeGenerator extends ModifierTypeGenerator {

class TmModifierTypeGenerator extends ModifierTypeGenerator {
constructor(tier: ModifierTier) {
super((party: Pokemon[]) => {
super((party: Pokemon[], pregenArgs?: any[]) => {
if (pregenArgs) {
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 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) {
Expand Down Expand Up @@ -2192,6 +2195,7 @@ type GeneratorModifierOverride = {
}
| {
name: "TM_COMMON" | "TM_GREAT" | "TM_ULTRA";
type?: Moves;
}
);

Expand Down

0 comments on commit c278061

Please sign in to comment.