fix expansion / forced type mega

8d85460
This commit is contained in:
Kurt 2017-10-09 10:44:13 -07:00
parent 4422bf7684
commit aaa96d66df

View File

@ -656,9 +656,8 @@ private static void RandomizeTeam(trdata6 t, MoveRandomizer move, ushort[] itemv
if (p == last && mevo)
{
int tries = 0;
while (!megaEvos.Contains(species) && tries++ < 0x10000)
species = rSpeciesRand.GetRandomSpeciesType(pk.Species, type);
stones = MegaDictionary[species];
do { stones = GetRandomMega(out species); }
while (Main.Config.Personal[species].Types.All(z => z != type) && tries++ < 100);
}
}
else if (p == last && mevo)
@ -701,10 +700,14 @@ private static void InitializeTrainerTeamInfo(trdata6 t, bool important)
int lastPKM = Math.Max(t.NumPokemon - 1, 0); // 0,1-6 => 0-5 (never is 0)
t.NumPokemon = 6;
Array.Resize(ref t.Team, t.NumPokemon);
for (int f = lastPKM + 1; f < t.NumPokemon; f++)
{
t.Team[f].Species = t.Team[lastPKM].Species;
t.Team[f].Level = (ushort)Math.Min(t.Team[f - 1].Level + 1, 100);
t.Team[f] = // clone last pkm then increment level by 1
new trdata6.Pokemon(t.Team[lastPKM].Write(t.Item, t.Moves), t.Item, t.Moves)
{
Level = (ushort) Math.Min(t.Team[f - 1].Level + 1, 100)
};
}
}
private static void RandomizeTrainerAIClass(trdata6 t, string[] trClass)