mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Add battle-only known move memory bypass
This commit is contained in:
parent
ee5349ff98
commit
a4ccca7980
1 changed files with 13 additions and 2 deletions
|
@ -39,7 +39,7 @@ namespace PKHeX.Core
|
|||
case 21 when gen != 6 || !Legal.GetCanLearnMachineMove(new PK6 {Species = memory.Variable, EXP = Experience.GetEXP(100, PersonalTable.XY.GetFormIndex(memory.Variable, 0))}, 19, 6):
|
||||
return GetInvalid(string.Format(LMemoryArgBadMove, memory.Handler));
|
||||
|
||||
case 16 or 48 when !CanKnowMove(pkm, memory, gen, info):
|
||||
case 16 or 48 when !CanKnowMove(pkm, memory, gen, info, memory.MemoryID == 16):
|
||||
return GetInvalid(string.Format(LMemoryArgBadMove, memory.Handler));
|
||||
|
||||
case 49 when memory.Variable == 0 || !Legal.GetCanRelearnMove(pkm, memory.Variable, gen, info.EvoChainsAllGens[gen]):
|
||||
|
@ -85,7 +85,7 @@ namespace PKHeX.Core
|
|||
return GetValid(string.Format(LMemoryF_0_Valid, memory.Handler));
|
||||
}
|
||||
|
||||
private static bool CanKnowMove(PKM pkm, MemoryVariableSet memory, int gen, LegalInfo info)
|
||||
private static bool CanKnowMove(PKM pkm, MemoryVariableSet memory, int gen, LegalInfo info, bool battleOnly = false)
|
||||
{
|
||||
var move = memory.Variable;
|
||||
if (move == 0)
|
||||
|
@ -101,6 +101,17 @@ namespace PKHeX.Core
|
|||
if (enc is IMoveset ms && ms.Moves.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.
|
||||
switch (move)
|
||||
{
|
||||
case 781 when pkm.Species == (int)Species.Zacian: // Behemoth Blade
|
||||
case 782 when pkm.Species == (int)Species.Zamazenta: // Behemoth Blade
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue