mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Allow battleversion-ambiguous relearn move
This commit is contained in:
parent
6e9f230dee
commit
3a8947cc59
1 changed files with 15 additions and 0 deletions
|
@ -111,6 +111,14 @@ namespace PKHeX.Core
|
|||
if (enc is IRelearn r && r.Relearn.Contains(move))
|
||||
return true;
|
||||
|
||||
// Relearns can be wiped via Battle Version. Check for eggs too.
|
||||
if (IsSpecialEncounterMoveEggDeleted(pkm, enc))
|
||||
{
|
||||
var em = MoveEgg.GetEggMoves(enc.Generation, enc.Species, enc.Form, enc.Version);
|
||||
if (em.Contains(move))
|
||||
return true;
|
||||
}
|
||||
|
||||
if (battleOnly)
|
||||
{
|
||||
// Some moves can only be known in battle; outside of battle they aren't obtainable as a memory parameter.
|
||||
|
@ -125,6 +133,13 @@ namespace PKHeX.Core
|
|||
return false;
|
||||
}
|
||||
|
||||
private static bool IsSpecialEncounterMoveEggDeleted(PKM pkm, IEncounterable enc)
|
||||
{
|
||||
if (pkm is IBattleVersion { BattleVersion: not 0 }) // can hide Relearn moves (Gen6+ Eggs, or DexNav)
|
||||
return enc is EncounterEgg { Generation: >= 6 } or EncounterSlot6AO { CanDexNav: true };
|
||||
return enc is EncounterEgg { Generation: < 6 }; // egg moves that are no longer in the movepool
|
||||
}
|
||||
|
||||
public static bool GetCanRelearnMove(PKM pkm, int move, int generation, IReadOnlyList<EvoCriteria> evos, GameVersion version = GameVersion.Any)
|
||||
{
|
||||
if (IsOtherFormMove(pkm, evos, move, generation, version, types: MoveSourceType.Reminder))
|
||||
|
|
Loading…
Reference in a new issue