mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-06-03 01:14:13 -05:00
Add param to getMoves for reminder bypass
Move suggestions should now only be current level up moves Closes #510
This commit is contained in:
parent
488455e268
commit
20f2a0fc61
|
|
@ -66,7 +66,7 @@ public LegalityAnalysis(PKM pk)
|
|||
}
|
||||
catch { Valid = false; }
|
||||
getLegalityReport();
|
||||
AllSuggestedMoves = !isOriginValid(pkm) ? new int[4] : getSuggestedMoves(true, true);
|
||||
AllSuggestedMoves = !isOriginValid(pkm) ? new int[4] : getSuggestedMoves(true, true, true);
|
||||
AllSuggestedRelearnMoves = !isOriginValid(pkm) ? new int[4] : Legal.getValidRelearn(pkm, -1).ToArray();
|
||||
AllSuggestedMovesAndRelearn = AllSuggestedMoves.Concat(AllSuggestedRelearnMoves).ToArray();
|
||||
}
|
||||
|
|
@ -226,11 +226,11 @@ public int[] getSuggestedRelearn()
|
|||
window.AddRange(new int[4 - window.Count]);
|
||||
return window.Skip(window.Count - 4).Take(4).ToArray();
|
||||
}
|
||||
public int[] getSuggestedMoves(bool tm, bool tutor)
|
||||
public int[] getSuggestedMoves(bool tm, bool tutor, bool reminder)
|
||||
{
|
||||
if (pkm == null || pkm.GenNumber < 6 || !isOriginValid(pkm))
|
||||
return null;
|
||||
return Legal.getValidMoves(pkm, Tutor: tutor, Machine: tm).Skip(1).ToArray(); // skip move 0
|
||||
return Legal.getValidMoves(pkm, Tutor: tutor, Machine: tm, MoveReminder: reminder).Skip(1).ToArray(); // skip move 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,12 +167,12 @@ private static void MarkG7SMSlots(ref EncounterArea[] Areas)
|
|||
}
|
||||
|
||||
// Moves
|
||||
internal static IEnumerable<int> getValidMoves(PKM pkm, bool Tutor = true, bool Machine = true)
|
||||
internal static IEnumerable<int> getValidMoves(PKM pkm, bool Tutor = true, bool Machine = true, bool MoveReminder = true)
|
||||
{
|
||||
GameVersion version = (GameVersion)pkm.Version;
|
||||
if (!pkm.IsUntraded)
|
||||
version = GameVersion.Any;
|
||||
return getValidMoves(pkm, version, LVL: true, Relearn: false, Tutor: Tutor, Machine: Machine);
|
||||
return getValidMoves(pkm, version, LVL: true, Relearn: false, Tutor: Tutor, Machine: Machine, MoveReminder: MoveReminder);
|
||||
}
|
||||
internal static IEnumerable<int> getValidRelearn(PKM pkm, int skipOption)
|
||||
{
|
||||
|
|
@ -786,29 +786,29 @@ private static IEnumerable<EncounterStatic> getStatic(PKM pkm, IEnumerable<Encou
|
|||
IEnumerable<DexLevel> dl = getValidPreEvolutions(pkm);
|
||||
return table.Where(e => dl.Any(d => d.Species == e.Species));
|
||||
}
|
||||
private static IEnumerable<int> getValidMoves(PKM pkm, GameVersion Version, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false)
|
||||
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
|
||||
const bool moveTutor = true;
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
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]);
|
||||
|
|
@ -822,14 +822,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 specialTutors, 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, bool MoveReminder)
|
||||
{
|
||||
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, specialTutors, Machine, gen));
|
||||
r.AddRange(getMoves(pkm, species, lvl, form, moveTutor, Version, LVL, specialTutors, Machine, gen, MoveReminder));
|
||||
return r.Distinct();
|
||||
}
|
||||
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)
|
||||
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, bool MoveReminder)
|
||||
{
|
||||
List<int> r = new List<int>();
|
||||
|
||||
|
|
@ -874,7 +874,8 @@ private static IEnumerable<int> getMoves(PKM pkm, int species, int lvl, int form
|
|||
{
|
||||
int index = PersonalTable.SM.getFormeIndex(species, form);
|
||||
PersonalInfo pi = PersonalTable.SM.getFormeEntry(species, form);
|
||||
lvl = 100; // Move reminder can teach any level in movepool now!
|
||||
if (MoveReminder)
|
||||
lvl = 100; // Move reminder can teach any level in movepool now!
|
||||
|
||||
if (LVL) r.AddRange(LevelUpSM[index].getMoves(lvl));
|
||||
if (moveTutor) r.AddRange(getTutorMoves(pkm, species, form, specialTutors));
|
||||
|
|
|
|||
|
|
@ -1800,7 +1800,7 @@ private void clickMoves(object sender, EventArgs e)
|
|||
if (sender == GB_CurrentMoves)
|
||||
{
|
||||
bool random = ModifierKeys == Keys.Control;
|
||||
int[] m = Legality.getSuggestedMoves(tm: random, tutor: random);
|
||||
int[] m = Legality.getSuggestedMoves(tm: random, tutor: random, reminder: random);
|
||||
if (m == null)
|
||||
{ Util.Alert("Suggestions are not enabled for this PKM format."); return; }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user