Add forme randomization method

add alola option too
This commit is contained in:
Kurt 2016-12-08 19:15:11 -08:00
parent b71c19558a
commit d2211a6779
2 changed files with 33 additions and 0 deletions

View File

@ -220,5 +220,26 @@ class Legal
695, 696, 697, 698, 699, 700, 701, 702, 703,
719,
};
internal static readonly int[] AlolanOriginForms =
{
019, // Rattata
020, // Raticate
025, // Pikachu (Cosplay not transferrable)
026, // Raichu
027, // Sandshrew
028, // Sandslash
037, // Vulpix
038, // Ninetails
050, // Diglett
051, // Dugtrio
052, // Meowth
053, // Persian
074, // Geodude
075, // Graveler
076, // Golem
088, // Grimer
089, // Muk
};
}
}

View File

@ -72,6 +72,18 @@ internal static int[] getSpeciesList(bool G1, bool G2, bool G3, bool G4, bool G5
return sL.Length == 0 ? RandomSpeciesList : sL;
}
internal static int GetRandomForme(int species, bool mega, bool alola, PersonalInfo[] stats = null)
{
if (stats == null)
return 0;
if (stats[species].FormeCount <= 1)
return 0;
if (alola && Legal.AlolanOriginForms.Contains(species))
return (int)(Util.rnd32()%2);
if (!Legal.Mega_ORAS.Contains((ushort)species) || mega)
return (int)(Util.rnd32() % stats[species].FormeCount); // Slot-Random
return 0;
}
internal static int[] getRandomItemList()
{