diff --git a/pk3DS.Core/Legality/Legal.cs b/pk3DS.Core/Legality/Legal.cs index b8d93f9..7038d90 100644 --- a/pk3DS.Core/Legality/Legal.cs +++ b/pk3DS.Core/Legality/Legal.cs @@ -193,9 +193,9 @@ public static partial class Legal 055, // Pokémon Trainer (Shauna) 056, // Pokémon Trainer (Tierno) 057, // Pokémon Trainer (Trevor) - 077, // Team Flare (Admin)* + 077, // Team Flare (Admin) 078, // Team Flare (Admin) - 079, // Team Flare (Grunt)* + 079, // Team Flare (Grunt) 080, // Team Flare (Grunt) 081, // Team Flare (Lysandre) 102, // Pokémon Trainer (AZ) @@ -203,7 +203,6 @@ public static partial class Legal 104, // Pokémon Trainer (Serena) 105, // Pokémon Profoessor (Sycamore) 175, // Team Flare Boss (Lysandre) - // * = Female }; public static readonly int[] Model_AO = { @@ -215,10 +214,14 @@ public static partial class Legal 219, // Pokémon Trainer (Steven) 221, // Lorekeeper (Zinnia) 267, // Pokémon Trainer (Zinnia) - 272, // Pokémon Trainer (Wally)* - 278, // Pokémon Trainer (Brendan)* - 279, // Pokémon Trainer (May)* - // * = has Mega Pendant/Bracelet + 272, // Pokémon Trainer (Wally) + }; + public static readonly int[] Ignore_AO = + { + 001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011, 012, 013, 014, 015, 016, 017, 018, 019, 020, 021, 022, 023, 024, 025, 026, 027, 028, 029, 030, 031, 032, 033, 034, 035, 036, 037, + 038, 039, 040, 041, 042, 043, 044, 045, 046, 047, 048, 049, 050, 051, 052, 053, 054, 055, 056, 057, 058, 059, 060, 061, 062, 063, 064, 065, 066, 067, 068, 069, 070, 071, 072, 073, 074, + 075, 076, 077, 078, 079, 080, 081, 082, 083, 084, 085, 086, 087, 088, 089, 090, 091, 092, 093, 094, 095, 096, 097, 098, 099, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126 }; public static readonly int[] Z_Moves = { diff --git a/pk3DS/Subforms/Gen6/RSTE.cs b/pk3DS/Subforms/Gen6/RSTE.cs index c0d30f3..db32d6f 100644 --- a/pk3DS/Subforms/Gen6/RSTE.cs +++ b/pk3DS/Subforms/Gen6/RSTE.cs @@ -23,6 +23,7 @@ public RSTE(byte[][] trc, byte[][] trd, byte[][] trp) Array.Resize(ref specieslist, Main.Config.MaxSpeciesID + 1); MegaDictionary = GiftEditor6.GetMegaDictionary(Main.Config); rModelRestricted = Main.Config.ORAS ? Legal.Model_AO : Legal.Model_XY; + rXYBlacklist = Legal.Ignore_AO; InitializeComponent(); // String Fetching @@ -533,6 +534,7 @@ private void Setup() public static int rDMGCount, rSTABCount; private int[] mEvoTypes; private static int[] rModelRestricted; + private static int[] rXYBlacklist; private string[] rImportant; private readonly List Tags = new List(); private readonly Dictionary TagTypes = new Dictionary(); @@ -726,7 +728,7 @@ private static void RandomizeTrainerAIClass(trdata6 t, string[] trClass) int randClass() => (int) (rnd32() % rModelRestricted.Length); t.Class = rModelRestricted[randClass()]; } - else + else if ( rClass // Classes selected to be randomized && (!rOnlySingles || t.BattleType == 0) // Nonsingles only get changed if rOnlySingles @@ -738,6 +740,12 @@ private static void RandomizeTrainerAIClass(trdata6 t, string[] trClass) // Ensure the Random Class isn't an exclusive class while (rIgnoreClass.Contains(rv) || trClass[rv].StartsWith("[~")); // don't allow disallowed classes t.Class = rv; + + if (Main.Config.ORAS && rXYBlacklist.Contains(t.Class)) // Classes 0-126 are leftover from XY and some can crash the game; skip all of them + { + for (int i = 127; i <= 279; i++) + t.Class = i; + } } } private static void RandomizeTrainerPrizeItem(trdata6 t)