Misc fixes

fix: double-trainer battles forced to 3
fix: high powered trainer rand moves no longer errors
This commit is contained in:
Kurt
2018-12-01 14:35:26 -08:00
parent 8590f9a461
commit b085c1976b
3 changed files with 8 additions and 3 deletions

View File

@@ -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<int> BannedMoves { set => moverand.Settings.BannedMoves = value; }

View File

@@ -239,7 +239,11 @@ private static int[] GetRandomMega(Dictionary<int, int[]> 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<int, int> GetFixedCountIndexes(GameVersion game)
{
@@ -252,7 +256,7 @@ private static int[] GetRandomMega(Dictionary<int, int[]> 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<int, int>();
}

View File

@@ -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,