Fix SWSH trainer dump

After saving and exiting the trainer editor, their trclasses will get changed from 250/251 to 219/220, but they're valid classes used by them so no big deal.
This commit is contained in:
sora10pls
2020-06-18 01:55:37 -04:00
parent cafbced047
commit 19095bc4ba
3 changed files with 8 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ public static int GetRandomForme(int species, bool mega, bool alola, bool galar,
if (stats.TableLength == 980 && (species == (int)Species.Pikachu || species == (int)Species.Eevee)) // gg tableB -- no starters, they crash trainer battles.
return 0;
if (stats.TableLength == 1180 && species == (int)Species.Pikachu) // SWSH -- disallow Partner Pikachu from LGPE, but allow World Cap
if (stats.TableLength == 1181 && species == (int)Species.Pikachu) // SWSH -- disallow Partner Pikachu from LGPE, but allow World Cap
{
int form = Util.Rand.Next(9);
if (form == 8)

View File

@@ -159,6 +159,10 @@ public void DumpTrainers()
{
var t = tr[i];
// some battles with Avery and Klara have out of bounds trclasses -- set back to "Pokémon Trainer"
if (t.Self.Class == 250 || t.Self.Class == 251)
t.Self.Class = 219;
result.Add($"{i:000} - {trc[t.Self.Class]}: {trn[i]}");
const int MoneyScalar = 80;
result.Add($"AI: {t.Self.AI} | Mode: {t.Self.Mode} | Money: {t.Self.Money * MoneyScalar}");

View File

@@ -390,6 +390,9 @@ private TrainerPoke PreparePKM()
private void PopulateFieldsTrainer(TrainerData tr)
{
if (tr.Class > CB_Trainer_Class.Items.Count)
return;
// Load Trainer Data
CB_Trainer_Class.SelectedIndex = tr.Class;
CB_Item_1.SelectedIndex = tr.Item1;