mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-16 21:38:40 +00:00
Add tradeback wipe of Gen2 initial moves
This commit is contained in:
parent
e1b964ad64
commit
54525da20b
6 changed files with 22 additions and 3 deletions
|
@ -70,7 +70,7 @@ public static class EncounterDate
|
|||
/// </summary>
|
||||
public static bool IsValidDateSwitch(DateOnly date)
|
||||
{
|
||||
if (date.Year is < 2000 or > 2050)
|
||||
if (date.Year is < 2000 or > 2060)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,25 @@ public sealed class LearnGroup2 : ILearnGroup
|
|||
if (enc is EncounterEgg { Generation: Generation } egg)
|
||||
CheckEncounterMoves(result, current, egg);
|
||||
|
||||
return MoveResult.AllParsed(result);
|
||||
bool vc1 = pk.VC1;
|
||||
if (!vc1 && MoveResult.AllParsed(result))
|
||||
return true;
|
||||
|
||||
// Uh-oh, not all moves are verified yet.
|
||||
// To visit Gen1, we need to invalidate moves that can't be learned in Gen1 or re-learned in Gen2.
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
{
|
||||
if (current[i] <= Legal.MaxMoveID_1)
|
||||
continue;
|
||||
var move = result[i];
|
||||
if (!move.IsParsed)
|
||||
continue;
|
||||
var method = move.Info.Method;
|
||||
if ((vc1 && move.Generation == 2) || method is LearnMethod.Initial || method.IsEggSource())
|
||||
result[i] = MoveResult.Unobtainable();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void CheckEncounterMoves(PKM pk, Span<MoveResult> result, ReadOnlySpan<ushort> current, IEncounterTemplate enc)
|
||||
|
|
|
@ -32,7 +32,8 @@ internal static class LearnVerifierHistory
|
|||
MarkRelearnMoves(result, current, pk);
|
||||
|
||||
// Knock off initial moves if available.
|
||||
MarkSpecialMoves(result, current, enc, pk);
|
||||
if (enc.Generation != 2) // Handle trade-backs in Gen2 separately.
|
||||
MarkSpecialMoves(result, current, enc, pk);
|
||||
}
|
||||
|
||||
// Iterate games to identify move sources.
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue