private void RandomizeSpecFormItem(IPokeData pk, int Type) { if (pk is TrainerPoke7b p7b) { RandomizeSpecForm(p7b, Type); return; } // replaces Megas with another Mega (Dexio and Lysandre in USUM) if (MegaDictionary.Any(z => z.Value.Contains(pk.HeldItem))) { int[] mega = GetRandomMega(MegaDictionary, out int species); pk.Species = species; int index = Util.Random.Next(mega.Length); pk.HeldItem = mega[index]; pk.Form = 0; // allow it to Mega Evolve naturally } else // every other pkm { pk.Species = RandSpec.GetRandomSpeciesType(pk.Species, Type); TryForceEvolve(pk); pk.HeldItem = PossibleHeldItems[Util.Random.Next(PossibleHeldItems.Length)]; pk.Form = Legal.GetRandomForme(pk.Species, Settings.AllowRandomMegaForms, true, Personal); } }
private void DetermineSpecies(IPokeData pk) { if (Settings.RandomizeTeam) { int Type = Settings.TeamTypeThemed ? Util.Random.Next(17) : -1; RandomizeSpecFormItem(pk, Type); pk.Gender = 0; // random pk.Nature = Util.Random.Next(25); // random } }
private void TryForceEvolve(IPokeData pk) { if (!Settings.ForceFullyEvolved || pk.Level < Settings.ForceFullyEvolvedAtLevel) { return; } var evos = Evos; int species = pk.Species; int form = pk.Form; int timesEvolved = TryForceEvolve(evos, ref species, ref form); if (timesEvolved == 0) { return; } pk.Species = species; pk.Form = form; }
private void DetermineSpecies(IPokeData pk) { if (Settings.RandomizeTeam) { int Type = Settings.TeamTypeThemed ? Util.Random.Next(17) : -1; // replaces Megas with another Mega (Dexio and Lysandre in USUM) if (MegaDictionary.Any(z => z.Value.Contains(pk.HeldItem))) { int[] mega = GetRandomMega(MegaDictionary, out int species); pk.Species = species; pk.HeldItem = mega[Util.Random.Next(mega.Length)]; pk.Form = 0; // allow it to Mega Evolve naturally } // every other pkm else { pk.Species = RandSpec.GetRandomSpeciesType(pk.Species, Type); pk.HeldItem = PossibleHeldItems[Util.Random.Next(PossibleHeldItems.Length)]; pk.Form = Legal.GetRandomForme(pk.Species, Settings.AllowRandomMegaForms, true, Personal); } pk.Gender = 0; // random pk.Nature = Util.Random.Next(25); // random } if (Settings.ForceFullyEvolved && pk.Level >= Settings.ForceFullyEvolvedAtLevel && !FinalEvo.Contains(pk.Species)) { int randFinalEvo() => Util.Random.Next(FinalEvo.Count); if (FinalEvo.Count != 0) { pk.Species = FinalEvo[randFinalEvo()]; } pk.Form = Legal.GetRandomForme(pk.Species, Settings.AllowRandomMegaForms, true, Personal); } }
public static void BoostLevel(IPokeData pk, decimal ratio) { pk.Level = Legal.GetModifiedLevel(pk.Level, ratio); }