From 0741c8c035b21f5cb4f4db3cd4944b6fe225df6f Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 24 Oct 2020 11:12:25 -0700 Subject: [PATCH] Handle Calyrex TR bug Co-Authored-By: ReignOfComputer <2667537+ReignOfComputer@users.noreply.github.com> --- PKHeX.Core/Legality/Moves/MoveTechnicalMachine.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Legality/Moves/MoveTechnicalMachine.cs b/PKHeX.Core/Legality/Moves/MoveTechnicalMachine.cs index 0e1d8dfd1..9dde52f9e 100644 --- a/PKHeX.Core/Legality/Moves/MoveTechnicalMachine.cs +++ b/PKHeX.Core/Legality/Moves/MoveTechnicalMachine.cs @@ -241,6 +241,8 @@ private static GameVersion GetIsMachine8(PKM pkm, int species, int move, int for return GameVersion.SWSH; if (((PK8) pkm).GetMoveRecordFlag(i)) return GameVersion.SWSH; + if (i == 12 && species == (int)Species.Calyrex && form == 0) // TR12 + return GameVersion.SWSH; // Agility Calyrex without TR glitch. break; } } @@ -446,7 +448,18 @@ private static void AddMachineSWSH(List r, int species, int form, PKM pkm) if (!tmhm[i + 100]) continue; if (!pk8.GetMoveRecordFlag(i)) - continue; + { + if (i == 12 && species == (int) Species.Calyrex && form == 0) // TR12 + { + // Unfuse logic does not check if the currently known TR move has the flag or not. + // Agility can be learned via Level Up while fused, but only via TR when Unfused. + // We'll let Agility be a legal TR move without the flag, only for Calyrex! + } + else + { + continue; + } + } r.Add(Legal.TMHM_SWSH[i + 100]); } }