Fix LGPE MegaFormChoice randomization

0 for No Mega, 1 for Mega
If Charizard or Mewtwo, then 1 is Mega X and 2 is Mega Y
Also add more documentation for LGPE Trainer Classes
This commit is contained in:
sora10pls 2020-05-28 19:23:30 -04:00
parent ce9c121e48
commit f415b81312
2 changed files with 46 additions and 34 deletions

View File

@ -170,15 +170,16 @@ private void RandomizeSpecForm(TrainerPoke7b pk, int type)
{
int[] mega = GetRandomMega(MegaDictionary, out int species);
pk.Species = species;
pk.MegaFormChoice = Util.Random.Next(mega.Length);
pk.CanMegaEvolve = true;
pk.Form = Legal.GetRandomForme(pk.Species, Settings.AllowRandomMegaForms, true, false, Personal);
pk.MegaFormChoice = Util.Random.Next(mega.Length) + 1;
pk.Form = 0; // allow it to Mega Evolve naturally
return;
}
pk.MegaFormChoice = 0;
pk.Species = RandSpec.GetRandomSpeciesType(pk.Species, type);
pk.Form = Legal.GetRandomForme(pk.Species, Settings.AllowRandomMegaForms, true, false, Personal);
else
{
pk.Species = RandSpec.GetRandomSpeciesType(pk.Species, type);
pk.Form = Legal.GetRandomForme(pk.Species, Settings.AllowRandomMegaForms, true, false, Personal);
}
}
private void TryForceEvolve(IPokeData pk)
@ -359,7 +360,7 @@ private static int[] GetRandomMega(Dictionary<int, int[]> megas, out int species
return new Dictionary<int, int>();
}
private static readonly int[] CrashClasses_GG = Enumerable.Range(072, 382 - 072 + 1).ToArray(); // Master Trainer titles, not really trclasses
private static readonly int[] CrashClasses_GG = Legal.BlacklistedClasses_GG;
private static readonly int[] CrashClasses_SWSH = Legal.BlacklistedClasses_SWSH;
private static int[] GetSpecialClasses(GameVersion game)

View File

@ -308,36 +308,47 @@ public static partial class Legal
public static readonly int[] SpecialClasses_GG =
{
#region Classes
000, // Pokémon Trainer
001, // Gym Leader
002, // Gym Leader
003, // Gym Leader
004, // Gym Leader
005, // Gym Leader
006, // Gym Leader
007, // Gym Leader
008, // Pokémon Trainer
009, // Pokémon Trainer
010, // Pokémon Trainer
011, // Pokémon Trainer
012, // Team Rocket Boss
013, // Team Rocket Admin
014, // Team Rocket
017, // Elite Four
018, // Elite Four
019, // Elite Four
020, // Elite Four
027, // Team Rocket
028, // Gym Leader
032, // Pokémon Trainer
033, // Pokémon Trainer
057, // Gym Leader
058, // Pokémon Trainer
061, // Champion
383, // Pokémon Trainer
000, // Pokémon Trainer [Trace, Standard]
001, // Gym Leader [Brock]
002, // Gym Leader [Misty]
003, // Gym Leader [Lt. Surge]
004, // Gym Leader [Erika]
005, // Gym Leader [Sabrina]
006, // Gym Leader [Koga]
007, // Gym Leader [Blaine]
008, // Pokémon Trainer [Red]
009, // Pokémon Trainer [Blue]
010, // Pokémon Trainer [Green]
011, // Pokémon Trainer [Mina]
012, // Team Rocket Boss [Giovanni]
013, // Team Rocket Admin [Archer]
014, // Team Rocket [Jessie]
017, // Elite Four [Lorelei]
018, // Elite Four [Bruno]
019, // Elite Four [Agatha]
020, // Elite Four [Lance]
027, // Team Rocket [James]
028, // Gym Leader [Giovanni]
057, // Gym Leader [Blue]
058, // Pokémon Trainer [Archer]
061, // Champion [Trace]
383, // Pokémon Trainer [Trace, Champion Title Defense]
#endregion
};
// <summary>
// Unused Trainer Classes in Let's Go, Pikachu! and Let's Go, Eevee!.
// Assigning these Trainer Classes to a Trainer crashes the game.
// A majority of these are Master Trainer related, and only used for multiplayer. They are not to be assigned to NPCs.
// </summary>
public static readonly int[] BlacklistedClasses_GG = Enumerable.Range(072, 311).Concat(new int[]
{
#region CrashClasses
032, // Pokémon Trainer
033, // Pokémon Trainer
#endregion
}).ToArray();
public static readonly int[] SpecialClasses_SWSH =
{
#region Classes