private static IEnumerable <int> getValidMoves(PKM pkm, GameVersion Version, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false, bool MoveReminder = true) { List <int> r = new List <int> { 0 }; int species = pkm.Species; int lvl = pkm.CurrentLevel; // Special Type Tutors Availability bool moveTutor = Tutor || MoveReminder; // Usually true, except when called for move suggestions (no tutored moves) if (FormChangeMoves.Contains(species)) // Deoxys & Shaymin & Giratina (others don't have extra but whatever) { int formcount = pkm.PersonalInfo.FormeCount; for (int i = 0; i < formcount; i++) { r.AddRange(getMoves(pkm, species, lvl, i, moveTutor, Version, LVL, Tutor, Machine, MoveReminder)); } if (Relearn) { r.AddRange(pkm.RelearnMoves); } return(r.Distinct().ToArray()); } r.AddRange(getMoves(pkm, species, lvl, pkm.AltForm, moveTutor, Version, LVL, Tutor, Machine, MoveReminder)); IEnumerable <DexLevel> vs = getValidPreEvolutions(pkm); foreach (DexLevel evo in vs) { r.AddRange(getMoves(pkm, evo.Species, evo.Level, pkm.AltForm, moveTutor, Version, LVL, Tutor, Machine, MoveReminder)); } if (species == 479) // Rotom { r.Add(RotomMoves[pkm.AltForm]); } if (species == 25 && pkm.Format == 6 && pkm.GenNumber == 6) // Pikachu { r.Add(PikachuMoves[pkm.AltForm]); } if (species == 718 && pkm.GenNumber == 7) // Zygarde { r.AddRange(ZygardeMoves); } if (species == 25 || species == 26 && pkm.Format == 7) // Pikachu/Raichu Tutor { r.Add(344); // Volt Tackle } if (Relearn) { r.AddRange(pkm.RelearnMoves); } return(r.Distinct().ToArray()); }
private static IEnumerable <int> getValidMoves(PKM pkm, GameVersion Version, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false) { List <int> r = new List <int> { 0 }; int species = pkm.Species; int lvl = pkm.CurrentLevel; if (pkm.Format >= 7) { lvl = 100; // Move reminder can teach any level in movepool now! } // Special Type Tutors Availability const bool moveTutor = true; if (FormChangeMoves.Contains(species)) // Deoxys & Shaymin & Giratina (others don't have extra but whatever) { int formcount = pkm.PersonalInfo.FormeCount; for (int i = 0; i < formcount; i++) { r.AddRange(getMoves(pkm, species, lvl, i, moveTutor, Version, LVL, Tutor, Machine)); } if (Relearn) { r.AddRange(pkm.RelearnMoves); } return(r.Distinct().ToArray()); } r.AddRange(getMoves(pkm, species, lvl, pkm.AltForm, moveTutor, Version, LVL, Tutor, Machine)); IEnumerable <DexLevel> vs = getValidPreEvolutions(pkm); foreach (DexLevel evo in vs) { r.AddRange(getMoves(pkm, evo.Species, evo.Level, pkm.AltForm, moveTutor, Version, LVL, Tutor, Machine)); } if (species == 479) // Rotom { r.Add(RotomMoves[pkm.AltForm]); } if (species == 25 && pkm.Format == 6 && pkm.GenNumber == 6) // Pikachu { r.Add(PikachuMoves[pkm.AltForm]); } if (species == 718 && pkm.GenNumber == 7) // Zygarde { r.AddRange(ZygardeMoves); } if (Relearn) { r.AddRange(pkm.RelearnMoves); } return(r.Distinct().ToArray()); }
private static IEnumerable <int> getValidMoves(PKM pkm, int Version, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false) { List <int> r = new List <int> { 0 }; int species = pkm.Species; int lvl = pkm.CurrentLevel; // Special (non Type) Tutor Availability bool moveTutor = Version == -1 || pkm.Format != pkm.GenNumber; // Add extra cases where tutors moveTutor |= pkm.AO; moveTutor |= pkm.XY && !pkm.IsUntraded; moveTutor |= pkm.Format < 6; if (FormChangeMoves.Contains(species)) // Deoxys & Shaymin & Giratina (others don't have extra but whatever) { int formcount = pkm.PersonalInfo.FormeCount; for (int i = 0; i < formcount; i++) { r.AddRange(getMoves(pkm, species, lvl, i, moveTutor, Version, LVL, Tutor, Machine)); } if (Relearn) { r.AddRange(pkm.RelearnMoves); } return(r.Distinct().ToArray()); } r.AddRange(getMoves(pkm, species, lvl, pkm.AltForm, moveTutor, Version, LVL, Tutor, Machine)); IEnumerable <DexLevel> vs = getValidPreEvolutions(pkm); foreach (DexLevel evo in vs) { r.AddRange(getMoves(pkm, evo.Species, evo.Level, pkm.AltForm, moveTutor, Version, LVL, Tutor, Machine)); } if (species == 479) // Rotom { r.Add(RotomMoves[pkm.AltForm]); } if (species == 25 && pkm.Format == 6) // Pikachu { r.Add(PikachuMoves[pkm.AltForm]); } if (Relearn) { r.AddRange(pkm.RelearnMoves); } return(r.Distinct().ToArray()); }
private static IEnumerable <int> getValidMoves(PK6 pk6, int Version, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false) { List <int> r = new List <int> { 0 }; int species = pk6.Species; int lvl = pk6.CurrentLevel; bool ORASTutors = Version == -1 || pk6.AO || !pk6.IsUntraded; if (FormChangeMoves.Contains(species)) // Deoxys & Shaymin & Giratina (others don't have extra but whatever) { int formcount = PersonalTable.AO[species].FormeCount; for (int i = 0; i < formcount; i++) { r.AddRange(getMoves(species, lvl, i, ORASTutors, Version, LVL, Tutor, Machine)); } if (Relearn) { r.AddRange(pk6.RelearnMoves); } return(r.Distinct().ToArray()); } r.AddRange(getMoves(species, lvl, pk6.AltForm, ORASTutors, Version, LVL, Tutor, Machine)); IEnumerable <DexLevel> vs = getValidPreEvolutions(pk6); foreach (DexLevel evo in vs) { r.AddRange(getMoves(evo.Species, evo.Level, pk6.AltForm, ORASTutors, Version, LVL, Tutor, Machine)); } if (species == 479) // Rotom { r.Add(RotomMoves[pk6.AltForm]); } if (species == 25) // Pikachu { r.Add(PikachuMoves[pk6.AltForm]); } if (Relearn) { r.AddRange(pk6.RelearnMoves); } return(r.Distinct().ToArray()); }
internal static IEnumerable <int> getValidMoves(PK6 pk6) { List <int> r = new List <int> { 0 }; int species = pk6.Species; if (FormChangeMoves.Contains(species)) // Deoxys & Shaymin & Giratina (others don't have extra but whatever) { int formcount = PersonalAO[species].FormeCount; for (int i = 0; i < formcount; i++) { // Check all Forms r.AddRange(getLVLMoves(species, pk6.CurrentLevel, i)); r.AddRange(getTutorMoves(species, i)); r.AddRange(getMachineMoves(species, i)); } return(r.Distinct().ToArray()); } r.AddRange(getLVLMoves(species, pk6.CurrentLevel, pk6.AltForm)); r.AddRange(getTutorMoves(species, pk6.AltForm)); r.AddRange(getMachineMoves(species, pk6.AltForm)); IEnumerable <DexLevel> vs = getValidPreEvolutions(pk6); foreach (DexLevel evo in vs) { r.AddRange(getLVLMoves(evo.Species, evo.Level, pk6.AltForm)); r.AddRange(getTutorMoves(evo.Species, pk6.AltForm)); r.AddRange(getMachineMoves(evo.Species, pk6.AltForm)); } if (species == 479) // Rotom { r.Add(RotomMoves[pk6.AltForm]); } if (species == 25) // Pikachu { r.Add(PikachuMoves[pk6.AltForm]); } return(r.Distinct().ToArray()); }
private static IEnumerable <int> GetValidMoves(PKM pkm, GameVersion Version, IReadOnlyList <EvoCriteria> vs, int Generation, int minLvLG1 = 1, int minLvLG2 = 1, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false, bool MoveReminder = true, bool RemoveTransferHM = true) { List <int> r = new List <int> { 0 }; if (vs.Count == 0) { return(r); } int species = pkm.Species; // Special Type Tutors Availability bool moveTutor = Tutor || MoveReminder; // Usually true, except when called for move suggestions (no tutored moves) if (FormChangeMoves.Contains(species)) // Deoxys & Shaymin & Giratina (others don't have extra but whatever) { int formcount = pkm.PersonalInfo.FormeCount; // In gen 3 deoxys has different forms depending on the current game, in personal info there is no alter form info if (species == 386 && pkm.Format == 3) { formcount = 4; } for (int i = 0; i < formcount; i++) { r.AddRange(GetMoves(pkm, species, minLvLG1, minLvLG2, vs[0].Level, i, Tutor, Version, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM, Generation)); } if (Relearn) { r.AddRange(pkm.RelearnMoves); } return(r.Distinct()); } for (var i = 0; i < vs.Count; i++) { var evo = vs[i]; var moves = GetEvoMoves(pkm, Version, vs, Generation, minLvLG1, minLvLG2, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM, moveTutor, i, evo); r.AddRange(moves); } if (pkm.Format <= 3) { return(r.Distinct()); } if (LVL) { MoveTutor.AddSpecialFormChangeMoves(r, pkm, Generation, species); } if (Tutor) { MoveTutor.AddSpecialTutorMoves(r, pkm, Generation, species); } if (Relearn && Generation >= 6) { r.AddRange(pkm.RelearnMoves); } return(r.Distinct()); }