public static GameVersion GetIsMachineMove(PKM pkm, int species, int form, int generation, int move, GameVersion ver = GameVersion.Any, bool RemoveTransfer = false) { if (pkm.IsMovesetRestricted(generation)) { ver = (GameVersion)pkm.Version; } switch (generation) { case 1: return(GetIsMachine1(species, move)); case 2: if (pkm.VC1 && move > Legal.MaxMoveID_1) { return(Legal.NONE); } return(GetIsMachine2(species, move)); case 3: return(GetIsMachine3(species, move, pkm.Format, RemoveTransfer)); case 4: return(GetIsMachine4(species, move, pkm.Format, RemoveTransfer, form)); case 5: return(GetIsMachine5(species, move, form)); case 6: return(GetIsMachine6(species, move, form, ver)); case 7: return(GetIsMachine7(species, move, form, ver)); case 8: return(GetIsMachine8(species, move, form, ver)); default: return(Legal.NONE); } }
public static LearnVersion GetIsLevelUpMove(PKM pkm, int species, int form, int lvl, int generation, int move, int minlvlG1, int minlvlG2, GameVersion version = Any) { if (pkm.IsMovesetRestricted(generation)) { version = (GameVersion)pkm.Version; } switch (generation) { case 1: return(GetIsLevelUp1(species, move, lvl, form, minlvlG1, version)); case 2 when move > MaxMoveID_1 && pkm.LearnMovesNew2Disallowed(): return(LearnNONE); case 2: return(GetIsLevelUp2(species, move, lvl, form, minlvlG2, pkm.Korean, version)); case 3: return(GetIsLevelUp3(species, move, lvl, form, version)); case 4: return(GetIsLevelUp4(species, move, lvl, form, version)); case 5: return(GetIsLevelUp5(species, move, lvl, form, version)); case 6: return(GetIsLevelUp6(species, move, lvl, form, version)); case 7: return(GetIsLevelUp7(species, move, form, version)); // move reminder can give any move 1-100 case 8: return(GetIsLevelUp8(species, move, lvl, form, version)); } return(LearnNONE); }
internal static IEnumerable <int> GetTMHM(PKM pkm, int species, int form, int generation, GameVersion ver = GameVersion.Any, bool RemoveTransfer = true) { var r = new List <int>(); if (pkm.IsMovesetRestricted()) { ver = (GameVersion)pkm.Version; } switch (generation) { case 1: AddMachine1(r, species); break; case 2: AddMachine2(r, species); if (pkm.Format >= 7 && pkm.VC1) { r.RemoveAll(z => z > Legal.MaxMoveID_1); } break; case 3: AddMachine3(r, species, pkm.Format, RemoveTransfer); break; case 4: AddMachine4(r, species, pkm.Format, RemoveTransfer, form); break; case 5: AddMachine5(r, species, form); break; case 6: AddMachine6(r, species, form, ver); break; case 7: AddMachine7(r, species, form, ver); break; case 8: AddMachine8(r, species, form, ver); break; } return(r.Distinct()); }
private static IEnumerable <int> GetValidMoves(PKM pkm, IReadOnlyList <IReadOnlyList <EvoCriteria> > evoChains, MoveSourceType types = MoveSourceType.ExternalSources, bool RemoveTransferHM = true) { GameVersion version = (GameVersion)pkm.Version; if (!pkm.IsMovesetRestricted()) { version = GameVersion.Any; } return(GetValidMoves(pkm, version, evoChains, types: types, RemoveTransferHM: RemoveTransferHM)); }
public static GameVersion GetIsRecordMove(PKM pkm, int species, int form, int generation, int move, GameVersion ver = GameVersion.Any, bool allowBit = false) { if (pkm.IsMovesetRestricted(generation)) { ver = (GameVersion)pkm.Version; } return(generation switch { 8 => GetIsRecord8(pkm, species, move, form, ver, allowBit), _ => Legal.NONE, });
public static LearnVersion GetIsLevelUpMove(PKM pkm, int species, int form, int maxLevel, int generation, int move, int minlvlG1, int minlvlG2, GameVersion version = Any) { if (pkm.IsMovesetRestricted(generation)) { version = (GameVersion)pkm.Version; } return(generation switch { 1 => GetIsLevelUp1(species, form, move, maxLevel, minlvlG1, version), 2 when move > MaxMoveID_1 && pkm.LearnMovesNew2Disallowed() => LearnNONE, 2 => GetIsLevelUp2(species, form, move, maxLevel, minlvlG2, version, pkm.Korean), 3 => GetIsLevelUp3(species, form, move, maxLevel, version), 4 => GetIsLevelUp4(species, form, move, maxLevel, version), 5 => GetIsLevelUp5(species, form, move, maxLevel, version), 6 => GetIsLevelUp6(species, form, move, maxLevel, version), 7 => GetIsLevelUp7(species, form, move, version), // move reminder can give any move 1-100 8 => GetIsLevelUp8(species, form, move, maxLevel, version), _ => LearnNONE, });
public static IEnumerable <int> GetMovesLevelUp(PKM pkm, int species, int minlvlG1, int minlvlG2, int lvl, int form, GameVersion version, bool MoveReminder, int Generation) { if (pkm.IsMovesetRestricted()) { version = (GameVersion)pkm.Version; } switch (Generation) { case 1: return(GetMovesLevelUp1(species, form, lvl, minlvlG1, version)); case 2: return(GetMovesLevelUp2(species, form, lvl, minlvlG2, pkm.Korean, pkm.LearnMovesNew2Disallowed(), version)); case 3: return(GetMovesLevelUp3(species, form, lvl, version)); case 4: return(GetMovesLevelUp4(species, form, lvl, version)); case 5: return(GetMovesLevelUp5(species, form, lvl, version)); case 6: return(GetMovesLevelUp6(species, form, lvl, version)); case 7: return(GetMovesLevelUp7(species, form, lvl, MoveReminder, version)); } return(Array.Empty <int>()); }