From b085c1976b9f734530c889e57bf2ef6574b5b400 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 1 Dec 2018 14:35:26 -0800 Subject: [PATCH] Misc fixes fix: double-trainer battles forced to 3 fix: high powered trainer rand moves no longer errors --- pkNX.Randomization/Randomizers/LearnsetRandomizer.cs | 2 +- pkNX.Randomization/Randomizers/TrainerRandomizer.cs | 8 ++++++-- pkNX.WinForms/Subforms/BTTE.cs | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkNX.Randomization/Randomizers/LearnsetRandomizer.cs b/pkNX.Randomization/Randomizers/LearnsetRandomizer.cs index 1ba33b70..da0f8425 100644 --- a/pkNX.Randomization/Randomizers/LearnsetRandomizer.cs +++ b/pkNX.Randomization/Randomizers/LearnsetRandomizer.cs @@ -14,7 +14,7 @@ public class LearnsetRandomizer : Randomizer private readonly GameInfo Game; private readonly PersonalTable Personal; private MoveRandomizer moverand; - private Move[] Moves; + public Move[] Moves { private get; set; } public LearnSettings Settings { get; private set; } public IList BannedMoves { set => moverand.Settings.BannedMoves = value; } diff --git a/pkNX.Randomization/Randomizers/TrainerRandomizer.cs b/pkNX.Randomization/Randomizers/TrainerRandomizer.cs index fbe84c74..96e6da2b 100644 --- a/pkNX.Randomization/Randomizers/TrainerRandomizer.cs +++ b/pkNX.Randomization/Randomizers/TrainerRandomizer.cs @@ -239,7 +239,11 @@ private static int[] GetRandomMega(Dictionary megas, out int species private static readonly int[] royal = { 081, 082, 083, 084, 185 }; // 3 poke max - private static readonly int[] meowth = { 007, 008, 020, 021, 024, 025, 028, 029, 032, 033, 050, 051 }; + private static readonly int[] doubleTrainer = + { + 007, 008, 020, 021, 024, 025, 028, 029, 032, 033, 050, 051, // jesse&james + 30, 31, // rival vs archer + }; private static Dictionary GetFixedCountIndexes(GameVersion game) { @@ -252,7 +256,7 @@ private static int[] GetRandomMega(Dictionary megas, out int species if (GameVersion.USUM.Contains(game)) return Legal.ImportantTrainers_USUM.Concat(royal).ToDictionary(z => z, index => royal.Contains(index) ? 1 : 6); if (GameVersion.GG.Contains(game)) - return Legal.ImportantTrainers_GG.ToDictionary(z => z, index => meowth.Contains(index) ? 3 : 6); + return Legal.ImportantTrainers_GG.ToDictionary(z => z, index => doubleTrainer.Contains(index) ? 3 : 6); return new Dictionary(); } diff --git a/pkNX.WinForms/Subforms/BTTE.cs b/pkNX.WinForms/Subforms/BTTE.cs index f2d581b0..700db425 100644 --- a/pkNX.WinForms/Subforms/BTTE.cs +++ b/pkNX.WinForms/Subforms/BTTE.cs @@ -538,6 +538,7 @@ private void B_Randomize_Click(object sender, EventArgs e) rmove.Initialize((MovesetRandSettings)PG_Moves.SelectedObject, banned); var rspec = new SpeciesRandomizer(Game.Info, Personal); rspec.Initialize((SpeciesSettings)PG_Species.SelectedObject); + learn.Moves = moves; var trand = new TrainerRandomizer(Game.Info, Personal, Trainers.LoadAll()) { ClassCount = CB_Trainer_Class.Items.Count,