mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-30 22:16:46 -05:00
Fix type tutor availability
This commit is contained in:
@@ -719,12 +719,8 @@ private static IEnumerable<int> getValidMoves(PKM pkm, GameVersion Version, bool
|
||||
int species = pkm.Species;
|
||||
int lvl = pkm.CurrentLevel;
|
||||
|
||||
// Special (non Type) Tutor Availability
|
||||
bool moveTutor = Version == GameVersion.Any || pkm.Format != pkm.GenNumber;
|
||||
// Add extra cases where tutors
|
||||
moveTutor |= pkm.AO;
|
||||
moveTutor |= pkm.XY && !pkm.IsUntraded;
|
||||
moveTutor |= pkm.Format < 6;
|
||||
// Special Type Tutors Availability
|
||||
const bool moveTutor = true;
|
||||
|
||||
if (FormChangeMoves.Contains(species)) // Deoxys & Shaymin & Giratina (others don't have extra but whatever)
|
||||
{
|
||||
@@ -750,14 +746,14 @@ private static IEnumerable<int> getValidMoves(PKM pkm, GameVersion Version, bool
|
||||
if (Relearn) r.AddRange(pkm.RelearnMoves);
|
||||
return r.Distinct().ToArray();
|
||||
}
|
||||
private static IEnumerable<int> getMoves(PKM pkm, int species, int lvl, int form, bool moveTutor, GameVersion Version, bool LVL, bool Tutor, bool Machine)
|
||||
private static IEnumerable<int> getMoves(PKM pkm, int species, int lvl, int form, bool moveTutor, GameVersion Version, bool LVL, bool specialTutors, bool Machine)
|
||||
{
|
||||
List<int> r = new List<int> { 0 };
|
||||
for (int gen = pkm.GenNumber; gen <= pkm.Format; gen++)
|
||||
r.AddRange(getMoves(pkm, species, lvl, form, moveTutor, Version, LVL, Tutor, Machine, gen));
|
||||
r.AddRange(getMoves(pkm, species, lvl, form, moveTutor, Version, LVL, specialTutors, Machine, gen));
|
||||
return r.Distinct();
|
||||
}
|
||||
private static IEnumerable<int> getMoves(PKM pkm, int species, int lvl, int form, bool moveTutor, GameVersion Version, bool LVL, bool Tutor, bool Machine, int Generation)
|
||||
private static IEnumerable<int> getMoves(PKM pkm, int species, int lvl, int form, bool moveTutor, GameVersion Version, bool LVL, bool specialTutors, bool Machine, int Generation)
|
||||
{
|
||||
List<int> r = new List<int>();
|
||||
|
||||
@@ -774,7 +770,7 @@ private static IEnumerable<int> getMoves(PKM pkm, int species, int lvl, int form
|
||||
PersonalInfo pi = PersonalTable.XY.getFormeEntry(species, form);
|
||||
|
||||
if (LVL) r.AddRange(LevelUpXY[index].getMoves(lvl));
|
||||
if (moveTutor) r.AddRange(getTutorMoves(pkm, species, form, Tutor));
|
||||
if (moveTutor) r.AddRange(getTutorMoves(pkm, species, form, specialTutors));
|
||||
if (Machine) r.AddRange(TMHM_XY.Where((t, m) => pi.TMHM[m]));
|
||||
|
||||
if (ver == GameVersion.Any) // Fall Through
|
||||
@@ -788,7 +784,7 @@ private static IEnumerable<int> getMoves(PKM pkm, int species, int lvl, int form
|
||||
PersonalInfo pi = PersonalTable.AO.getFormeEntry(species, form);
|
||||
|
||||
if (LVL) r.AddRange(LevelUpAO[index].getMoves(lvl));
|
||||
if (moveTutor) r.AddRange(getTutorMoves(pkm, species, form, Tutor));
|
||||
if (moveTutor) r.AddRange(getTutorMoves(pkm, species, form, specialTutors));
|
||||
if (Machine) r.AddRange(TMHM_AO.Where((t, m) => pi.TMHM[m]));
|
||||
break;
|
||||
}
|
||||
@@ -804,7 +800,7 @@ private static IEnumerable<int> getMoves(PKM pkm, int species, int lvl, int form
|
||||
PersonalInfo pi = PersonalTable.SM.getFormeEntry(species, form);
|
||||
|
||||
if (LVL) r.AddRange(LevelUpSM[index].getMoves(lvl));
|
||||
if (moveTutor) r.AddRange(getTutorMoves(pkm, species, form, Tutor));
|
||||
if (moveTutor) r.AddRange(getTutorMoves(pkm, species, form, specialTutors));
|
||||
if (Machine) r.AddRange(TMHM_SM.Where((t, m) => pi.TMHM[m]));
|
||||
break;
|
||||
}
|
||||
@@ -835,10 +831,10 @@ private static IEnumerable<int> getEggMoves(PKM pkm, int species, int formnum)
|
||||
return new List<int>();
|
||||
}
|
||||
}
|
||||
private static IEnumerable<int> getTutorMoves(PKM pkm, int species, int form, bool Tutors)
|
||||
private static IEnumerable<int> getTutorMoves(PKM pkm, int species, int form, bool specialTutors)
|
||||
{
|
||||
PersonalInfo info = pkm.PersonalInfo;
|
||||
// Type Tutor
|
||||
// Type Tutors
|
||||
List<int> moves = TypeTutor.Where((t, i) => info.TypeTutors[i]).ToList();
|
||||
|
||||
// Varied Tutors
|
||||
@@ -850,7 +846,7 @@ private static IEnumerable<int> getTutorMoves(PKM pkm, int species, int form, bo
|
||||
// // if (pi.SpecialTutors[i][b])
|
||||
// // moves.Add(Tutors_B2W2[i][b]);
|
||||
//}
|
||||
if (pkm.InhabitedGeneration(6) && Tutors)
|
||||
if (pkm.InhabitedGeneration(6) && specialTutors && (pkm.AO || !pkm.IsUntraded))
|
||||
{
|
||||
PersonalInfo pi = PersonalTable.AO.getFormeEntry(species, form);
|
||||
for (int i = 0; i < Tutors_AO.Length; i++)
|
||||
|
||||
Reference in New Issue
Block a user