2018-06-09 03:10:41 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
using static PKHeX.Core.Legal;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
|
|
|
|
public static class MoveTutor
|
|
|
|
|
{
|
|
|
|
|
public static GameVersion GetIsTutorMove(PKM pkm, int species, int form, int generation, int move, bool specialTutors = true)
|
|
|
|
|
{
|
2019-10-08 01:40:09 +00:00
|
|
|
|
return generation switch
|
2018-06-09 03:10:41 +00:00
|
|
|
|
{
|
2019-10-08 01:40:09 +00:00
|
|
|
|
1 => GetIsTutor1(pkm, species, move),
|
|
|
|
|
2 => GetIsTutor2(pkm, species, move),
|
|
|
|
|
3 => GetIsTutor3(species, move),
|
|
|
|
|
4 => GetIsTutor4(species, form, move),
|
|
|
|
|
5 => GetIsTutor5(pkm, species, form, specialTutors, move),
|
|
|
|
|
6 => GetIsTutor6(pkm, species, form, specialTutors, move),
|
|
|
|
|
7 => GetIsTutor7(pkm, species, form, specialTutors, move),
|
|
|
|
|
8 => GetIsTutor8(pkm, species, form, specialTutors, move),
|
|
|
|
|
_ => NONE
|
|
|
|
|
};
|
2018-06-09 03:10:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static GameVersion GetIsTutor1(PKM pkm, int species, int move)
|
|
|
|
|
{
|
|
|
|
|
// Surf Pikachu via Stadium
|
2018-10-06 02:58:30 +00:00
|
|
|
|
if (move != 57 || ParseSettings.AllowGBCartEra)
|
2018-06-09 03:10:41 +00:00
|
|
|
|
return NONE;
|
2019-12-09 01:39:19 +00:00
|
|
|
|
if (pkm.Format < 3 && (species == (int)Species.Pikachu || species == (int)Species.Raichu))
|
2018-06-09 03:10:41 +00:00
|
|
|
|
return GameVersion.Stadium;
|
|
|
|
|
return NONE;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static GameVersion GetIsTutor2(PKM pkm, int species, int move)
|
|
|
|
|
{
|
2018-10-06 02:58:30 +00:00
|
|
|
|
if (!ParseSettings.AllowGen2Crystal(pkm))
|
2018-06-09 03:10:41 +00:00
|
|
|
|
return NONE;
|
|
|
|
|
var info = PersonalTable.C[species];
|
|
|
|
|
for (int i = 0; i < Tutors_GSC.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (Tutors_GSC[i] == move)
|
|
|
|
|
return info.TMHM[57 + i] ? GameVersion.C : NONE;
|
|
|
|
|
}
|
|
|
|
|
return GetIsTutor1(pkm, species, move);
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static GameVersion GetIsTutor3(int species, int move)
|
|
|
|
|
{
|
|
|
|
|
// E Tutors (Free)
|
|
|
|
|
// E Tutors (BP)
|
|
|
|
|
var info = PersonalTable.E[species];
|
|
|
|
|
for (int i = 0; i < Tutor_E.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2018-06-09 03:10:41 +00:00
|
|
|
|
if (Tutor_E[i] == move && info.TypeTutors[i])
|
|
|
|
|
return GameVersion.E;
|
2018-08-03 03:11:42 +00:00
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
|
|
|
|
|
// FRLG Tutors
|
|
|
|
|
// Only special tutor moves, normal tutor moves are already included in Emerald data
|
|
|
|
|
for (int i = 0; i < SpecialTutors_FRLG.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (Tutor_FRLG[i] == move && species == SpecialTutors_Compatibility_FRLG[i])
|
|
|
|
|
return GameVersion.FRLG;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// XD
|
|
|
|
|
for (int i = 0; i < SpecialTutors_XD_Exclusive.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (SpecialTutors_XD_Exclusive[i] == move && SpecialTutors_Compatibility_XD_Exclusive[i].Any(e => e == species))
|
|
|
|
|
return GameVersion.XD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// XD (Mew)
|
2019-12-09 01:39:19 +00:00
|
|
|
|
if (species == (int)Species.Mew && Tutor_3Mew.Contains(move))
|
2018-06-09 03:10:41 +00:00
|
|
|
|
return GameVersion.XD;
|
|
|
|
|
|
|
|
|
|
return NONE;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static GameVersion GetIsTutor4(int species, int form, int move)
|
|
|
|
|
{
|
|
|
|
|
var pi = PersonalTable.HGSS.GetFormeEntry(species, form);
|
|
|
|
|
for (int i = 0; i < Tutors_4.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2018-06-09 03:10:41 +00:00
|
|
|
|
if (Tutors_4[i] == move && pi.TypeTutors[i])
|
|
|
|
|
return GameVersion.Gen4;
|
2018-08-03 03:11:42 +00:00
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
|
|
|
|
|
for (int i = 0; i < SpecialTutors_4.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2018-06-09 03:10:41 +00:00
|
|
|
|
if (SpecialTutors_4[i] == move && SpecialTutors_Compatibility_4[i].Any(e => e == species))
|
|
|
|
|
return GameVersion.HGSS;
|
2018-08-03 03:11:42 +00:00
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
|
|
|
|
|
return NONE;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static GameVersion GetIsTutor5(PKM pkm, int species, int form, bool specialTutors, int move)
|
|
|
|
|
{
|
|
|
|
|
var pi = PersonalTable.B2W2.GetFormeEntry(species, form);
|
2019-11-17 19:13:52 +00:00
|
|
|
|
var arr = TypeTutor6;
|
|
|
|
|
for (int i = 0; i < arr.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
if (arr[i] == move && pi.TypeTutors[i])
|
2018-06-09 03:10:41 +00:00
|
|
|
|
return GameVersion.Gen5;
|
2018-08-03 03:11:42 +00:00
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
|
2020-06-27 19:04:28 +00:00
|
|
|
|
if (specialTutors && pkm.HasVisitedB2W2(species))
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
var tutors = Tutors_B2W2;
|
|
|
|
|
for (int i = 0; i < tutors.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
for (int j = 0; j < tutors[i].Length; j++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
if (tutors[i][j] == move && pi.SpecialTutors[i][j])
|
2018-08-03 03:11:42 +00:00
|
|
|
|
return GameVersion.B2W2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
|
|
|
|
|
return NONE;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static GameVersion GetIsTutor6(PKM pkm, int species, int form, bool specialTutors, int move)
|
|
|
|
|
{
|
|
|
|
|
var pi = PersonalTable.AO.GetFormeEntry(species, form);
|
2019-11-17 19:13:52 +00:00
|
|
|
|
var arr = TypeTutor6;
|
|
|
|
|
for (int i = 0; i < arr.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
if (arr[i] == move && pi.TypeTutors[i])
|
2018-06-09 03:10:41 +00:00
|
|
|
|
return GameVersion.Gen6;
|
2018-08-03 03:11:42 +00:00
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
|
2020-06-27 19:04:28 +00:00
|
|
|
|
if (specialTutors && pkm.HasVisitedORAS(species))
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
var tutors = Tutors_AO;
|
|
|
|
|
for (int i = 0; i < tutors.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
for (int j = 0; j < tutors[i].Length; j++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
if (tutors[i][j] == move && pi.SpecialTutors[i][j])
|
2018-08-03 03:11:42 +00:00
|
|
|
|
return GameVersion.ORAS;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
|
|
|
|
|
return NONE;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static GameVersion GetIsTutor7(PKM pkm, int species, int form, bool specialTutors, int move)
|
|
|
|
|
{
|
|
|
|
|
var pi = PersonalTable.USUM.GetFormeEntry(species, form);
|
2019-11-17 19:13:52 +00:00
|
|
|
|
var arr = TypeTutor6;
|
|
|
|
|
for (int i = 0; i < arr.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
if (arr[i] == move && pi.TypeTutors[i])
|
2018-06-09 03:10:41 +00:00
|
|
|
|
return GameVersion.Gen7;
|
2018-08-03 03:11:42 +00:00
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
|
2020-06-27 19:04:28 +00:00
|
|
|
|
if (specialTutors && pkm.HasVisitedUSUM(species))
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
var tutors = Tutors_USUM;
|
|
|
|
|
for (int i = 0; i < tutors.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
if (tutors[i] == move && pi.SpecialTutors[0][i])
|
2018-06-09 03:10:41 +00:00
|
|
|
|
return GameVersion.USUM;
|
2018-08-03 03:11:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
|
|
|
|
|
return NONE;
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-23 23:56:47 +00:00
|
|
|
|
private static GameVersion GetIsTutor8(PKM pkm, int species, int form, bool specialTutors, int move)
|
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
var pi = (PersonalInfoSWSH)PersonalTable.SWSH.GetFormeEntry(species, form);
|
|
|
|
|
var arr = TypeTutor8;
|
|
|
|
|
for (int i = 0; i < arr.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (arr[i] == move && pi.TypeTutors[i])
|
|
|
|
|
return GameVersion.Gen8;
|
|
|
|
|
}
|
2020-06-19 23:51:15 +00:00
|
|
|
|
var tutors = Tutors_SWSH_1;
|
|
|
|
|
for (int i = 0; i < tutors.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (tutors[i] == move && pi.SpecialTutors[0][i])
|
|
|
|
|
return GameVersion.USUM;
|
|
|
|
|
}
|
2019-11-17 19:13:52 +00:00
|
|
|
|
|
2019-09-23 23:56:47 +00:00
|
|
|
|
return NONE;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
public static IEnumerable<int> GetTutorMoves(PKM pkm, int species, int form, bool specialTutors, int generation)
|
|
|
|
|
{
|
|
|
|
|
List<int> moves = new List<int>();
|
|
|
|
|
switch (generation)
|
|
|
|
|
{
|
|
|
|
|
case 1: AddMovesTutor1(moves, species, pkm.Format); break;
|
|
|
|
|
case 2: AddMovesTutor2(moves, species, pkm.Format, pkm.Korean); break;
|
|
|
|
|
case 3: AddMovesTutor3(moves, species); break;
|
|
|
|
|
case 4: AddMovesTutor4(moves, species, form); break;
|
|
|
|
|
case 5: AddMovesTutor5(moves, species, form, pkm, specialTutors); break;
|
|
|
|
|
case 6: AddMovesTutor6(moves, species, form, pkm, specialTutors); break;
|
|
|
|
|
case 7: AddMovesTutor7(moves, species, form, pkm, specialTutors); break;
|
2019-09-23 23:56:47 +00:00
|
|
|
|
case 8: AddMovesTutor8(moves, species, form, pkm, specialTutors); break;
|
2018-06-09 03:10:41 +00:00
|
|
|
|
}
|
|
|
|
|
return moves.Distinct();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void AddMovesTutor1(List<int> moves, int species, int format)
|
|
|
|
|
{
|
2019-12-09 01:39:19 +00:00
|
|
|
|
if (ParseSettings.AllowGBCartEra && format < 3 && (species == (int)Species.Pikachu || species == (int)Species.Raichu)) // Surf Pikachu via Stadium
|
2018-06-09 03:10:41 +00:00
|
|
|
|
moves.Add(57);
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static void AddMovesTutor2(List<int> moves, int species, int format, bool korean = false)
|
|
|
|
|
{
|
|
|
|
|
if (korean)
|
|
|
|
|
return;
|
|
|
|
|
var pi = PersonalTable.C[species];
|
|
|
|
|
moves.AddRange(Tutors_GSC.Where((_, i) => pi.TMHM[57 + i]));
|
|
|
|
|
AddMovesTutor1(moves, species, format);
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static void AddMovesTutor3(List<int> moves, int species)
|
|
|
|
|
{
|
|
|
|
|
// E Tutors (Free)
|
|
|
|
|
// E Tutors (BP)
|
|
|
|
|
var pi = PersonalTable.E[species];
|
|
|
|
|
moves.AddRange(Tutor_E.Where((_, i) => pi.TypeTutors[i]));
|
|
|
|
|
// FRLG Tutors
|
|
|
|
|
// Only special tutor moves, normal tutor moves are already included in Emerald data
|
|
|
|
|
moves.AddRange(SpecialTutors_FRLG.Where((_, i) => SpecialTutors_Compatibility_FRLG[i] == species));
|
|
|
|
|
// XD
|
|
|
|
|
moves.AddRange(SpecialTutors_XD_Exclusive.Where((_, i) => SpecialTutors_Compatibility_XD_Exclusive[i].Any(e => e == species)));
|
|
|
|
|
// XD (Mew)
|
2019-12-09 01:39:19 +00:00
|
|
|
|
if (species == (int)Species.Mew)
|
2018-06-09 03:10:41 +00:00
|
|
|
|
moves.AddRange(Tutor_3Mew);
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static void AddMovesTutor4(List<int> moves, int species, int form)
|
|
|
|
|
{
|
|
|
|
|
var pi = PersonalTable.HGSS.GetFormeEntry(species, form);
|
|
|
|
|
moves.AddRange(Tutors_4.Where((_, i) => pi.TypeTutors[i]));
|
|
|
|
|
moves.AddRange(SpecialTutors_4.Where((_, i) => SpecialTutors_Compatibility_4[i].Any(e => e == species)));
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static void AddMovesTutor5(List<int> moves, int species, int form, PKM pkm, bool specialTutors)
|
|
|
|
|
{
|
|
|
|
|
var pi = PersonalTable.B2W2[species];
|
|
|
|
|
moves.AddRange(TypeTutor6.Where((_, i) => pi.TypeTutors[i]));
|
|
|
|
|
if (pkm.InhabitedGeneration(5) && specialTutors)
|
|
|
|
|
moves.AddRange(GetTutors(PersonalTable.B2W2.GetFormeEntry(species, form), Tutors_B2W2));
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static void AddMovesTutor6(List<int> moves, int species, int form, PKM pkm, bool specialTutors)
|
|
|
|
|
{
|
|
|
|
|
var pi = PersonalTable.AO[species];
|
|
|
|
|
moves.AddRange(TypeTutor6.Where((_, i) => pi.TypeTutors[i]));
|
2020-06-27 19:04:28 +00:00
|
|
|
|
if (specialTutors && pkm.HasVisitedORAS(species))
|
2018-06-09 03:10:41 +00:00
|
|
|
|
moves.AddRange(GetTutors(PersonalTable.AO.GetFormeEntry(species, form), Tutors_AO));
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static void AddMovesTutor7(List<int> moves, int species, int form, PKM pkm, bool specialTutors)
|
|
|
|
|
{
|
2018-11-11 05:04:48 +00:00
|
|
|
|
if (pkm.GG)
|
|
|
|
|
return;
|
2018-06-09 03:10:41 +00:00
|
|
|
|
var pi = PersonalTable.USUM.GetFormeEntry(species, form);
|
|
|
|
|
moves.AddRange(TypeTutor6.Where((_, i) => pi.TypeTutors[i]));
|
2020-06-27 19:04:28 +00:00
|
|
|
|
if (specialTutors && pkm.HasVisitedUSUM(species))
|
2019-11-17 19:13:52 +00:00
|
|
|
|
moves.AddRange(GetTutors(pi, Tutors_USUM));
|
2018-06-09 03:10:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-09-23 23:56:47 +00:00
|
|
|
|
private static void AddMovesTutor8(List<int> moves, int species, int form, PKM pkm, bool specialTutors)
|
|
|
|
|
{
|
2019-11-17 19:13:52 +00:00
|
|
|
|
var pi = (PersonalInfoSWSH)PersonalTable.SWSH.GetFormeEntry(species, form);
|
|
|
|
|
if (!pi.IsPresentInGame)
|
|
|
|
|
return;
|
|
|
|
|
moves.AddRange(TypeTutor8.Where((_, i) => pi.TypeTutors[i]));
|
2020-06-19 23:51:15 +00:00
|
|
|
|
if (specialTutors)
|
|
|
|
|
moves.AddRange(GetTutors(pi, Tutors_SWSH_1));
|
2019-09-23 23:56:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-09 03:10:41 +00:00
|
|
|
|
private static IEnumerable<int> GetTutors(PersonalInfo pi, params int[][] tutors)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < tutors.Length; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
|
|
|
|
for (int b = 0; b < tutors[i].Length; b++)
|
|
|
|
|
{
|
|
|
|
|
if (pi.SpecialTutors[i][b])
|
|
|
|
|
yield return tutors[i][b];
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
}
|
2018-06-09 23:04:06 +00:00
|
|
|
|
|
|
|
|
|
internal static void AddSpecialTutorMoves(List<int> r, PKM pkm, int Generation, int species)
|
|
|
|
|
{
|
|
|
|
|
switch (species)
|
|
|
|
|
{
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Keldeo: // Keldeo
|
2018-06-09 23:04:06 +00:00
|
|
|
|
r.Add(548); // Secret Sword
|
|
|
|
|
break;
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Meloetta:
|
2018-06-09 23:04:06 +00:00
|
|
|
|
r.Add(547); // Relic Song
|
|
|
|
|
break;
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Pikachu when Generation == 6 && pkm.Format == 6:
|
2018-06-09 23:04:06 +00:00
|
|
|
|
int index = pkm.AltForm - 1;
|
2020-11-02 03:59:26 +00:00
|
|
|
|
if ((uint)index < CosplayPikachuMoves.Length)
|
2018-06-09 23:04:06 +00:00
|
|
|
|
r.Add(CosplayPikachuMoves[index]);
|
|
|
|
|
break;
|
2018-11-11 05:04:48 +00:00
|
|
|
|
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Pikachu when Generation == 7 && pkm.AltForm == 8:
|
2018-11-11 05:04:48 +00:00
|
|
|
|
r.AddRange(Tutor_StarterPikachu);
|
|
|
|
|
break;
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Eevee when Generation == 7 && pkm.AltForm == 1:
|
2018-11-11 05:04:48 +00:00
|
|
|
|
r.AddRange(Tutor_StarterEevee);
|
|
|
|
|
break;
|
|
|
|
|
|
2020-11-02 03:59:26 +00:00
|
|
|
|
case (int)Species.Pikachu when Generation == 7 && !pkm.GG:
|
|
|
|
|
case (int)Species.Raichu when Generation == 7 && !pkm.GG:
|
2018-06-09 23:04:06 +00:00
|
|
|
|
r.Add(344); // Volt Tackle
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-02 21:11:51 +00:00
|
|
|
|
/// <summary> Rotom Moves that correspond to a specific form (form-0 ignored). </summary>
|
|
|
|
|
private static readonly int[] RotomMoves = { 315, 056, 059, 403, 437 };
|
|
|
|
|
|
2018-06-09 23:04:06 +00:00
|
|
|
|
internal static void AddSpecialFormChangeMoves(List<int> r, PKM pkm, int Generation, int species)
|
|
|
|
|
{
|
|
|
|
|
switch (species)
|
|
|
|
|
{
|
2020-10-24 18:16:01 +00:00
|
|
|
|
case (int)Species.Rotom when Generation >= 4:
|
|
|
|
|
var formMoves = RotomMoves;
|
|
|
|
|
var form = pkm.AltForm - 1;
|
|
|
|
|
if ((uint)form < formMoves.Length)
|
|
|
|
|
r.Add(RotomMoves[form]);
|
2018-06-09 23:04:06 +00:00
|
|
|
|
break;
|
2020-10-24 18:16:01 +00:00
|
|
|
|
case (int)Species.Zygarde when Generation == 7:
|
2018-06-09 23:04:06 +00:00
|
|
|
|
r.AddRange(ZygardeMoves);
|
|
|
|
|
break;
|
2020-10-24 18:16:01 +00:00
|
|
|
|
case (int)Species.Necrozma when pkm.AltForm == 1: // Sun
|
2018-06-09 23:04:06 +00:00
|
|
|
|
r.Add(713);
|
|
|
|
|
break;
|
2020-10-24 18:16:01 +00:00
|
|
|
|
case (int)Species.Necrozma when pkm.AltForm == 2: // Moon
|
2018-06-09 23:04:06 +00:00
|
|
|
|
r.Add(714);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-09 03:10:41 +00:00
|
|
|
|
}
|
|
|
|
|
}
|