From b1dfbdd41908f3abc1345c499d21cb7bd686c194 Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Sun, 6 Mar 2016 11:19:09 -0800 Subject: [PATCH] Add Bank event checking --- Legality/Analysis.cs | 8 ++++++++ Legality/Core.cs | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Legality/Analysis.cs b/Legality/Analysis.cs index c87a3b67c..16699a2eb 100644 --- a/Legality/Analysis.cs +++ b/Legality/Analysis.cs @@ -45,6 +45,14 @@ public bool[] getRelearnValidity(int[] Moves) if (Moves.Length != 4) return new bool[4]; + bool link = pk6.Met_Location == 30011; + if (link) + { + if (pk6.FatefulEncounter) // Should NOT be Fateful + return new bool[4]; // False + int[] moves = Legal.getLinkMoves(pk6); + return moves.SequenceEqual(Moves) ? res : new bool[4]; + } bool egg = Legal.EggLocations.Contains(pk6.Egg_Location) && pk6.Met_Level == 1; bool evnt = pk6.FatefulEncounter && pk6.Met_Location > 40000; bool eventEgg = pk6.FatefulEncounter && (pk6.Egg_Location > 40000 || pk6.Egg_Location == 30002) && pk6.Met_Level == 1; diff --git a/Legality/Core.cs b/Legality/Core.cs index 80c9dc7de..44981d8b9 100644 --- a/Legality/Core.cs +++ b/Legality/Core.cs @@ -65,6 +65,24 @@ internal static int[] getValidRelearn(PK6 pk6, int skipOption) r.AddRange(getLVLMoves(species, 100)); return r.Distinct().ToArray(); } + internal static int[] getLinkMoves(PK6 pk6) + { + if (pk6.Species == 251 && pk6.Met_Level == 10) // Celebi + return new[] {610, 0, 0, 0}; + if (pk6.Species == 154 && pk6.Met_Level == 50 && pk6.AbilityNumber == 4) // Meganium Hidden + return new[] {0, 0, 0, 0}; + if (pk6.Species == 157 && pk6.Met_Level == 50 && pk6.AbilityNumber == 4) // Typhlosion Hidden + return new[] {0, 0, 0, 0}; + if (pk6.Species == 160 && pk6.Met_Level == 50 && pk6.AbilityNumber == 4) // Feraligatr Hidden + return new[] {0, 0, 0, 0}; + if (pk6.Species == 377 && pk6.Met_Level == 50 && pk6.AbilityNumber == 4) // Regirock Hidden + return new[] {153, 8, 444, 359}; + if (pk6.Species == 378 && pk6.Met_Level == 50 && pk6.AbilityNumber == 4) // Regice Hidden + return new[] {85, 133, 58, 258}; + if (pk6.Species == 379 && pk6.Met_Level == 50 && pk6.AbilityNumber == 4) // Registeel Hidden + return new[] {442, 157, 356, 334}; + return new int[0]; + } internal static IEnumerable getValidWC6s(PK6 pk6) { IEnumerable vs = getValidPreEvolutions(pk6);