mirror of
https://github.com/kwsch/pkNX.git
synced 2026-08-27 12:54:17 -05:00
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:
@@ -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)
|
||||
|
||||
@@ -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}");
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user