/// Sets the <see cref="PKM.Nickname"/> to the provided value.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <param name="nick"><see cref="PKM.Nickname"/> to set. If no nickname is provided, the <see cref="PKM.Nickname"/> is set to the default value for its current language and format.</param>
/// Sets the <see cref="PKM.AltForm"/> value, with special consideration for <see cref="PKM.Format"/> values which derive the <see cref="PKM.AltForm"/> value.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <param name="form">Desired <see cref="PKM.AltForm"/> value to set.</param>
publicstaticvoidSetAltForm(thisPKMpk,intform)
{
switch(pk.Format)
{
case2:
while(pk.AltForm!=form)
pk.SetRandomIVs();
break;
case3:
pk.SetPIDUnown3(form);
break;
default:
pk.AltForm=form;
break;
}
}
/// <summary>
/// Sets the <see cref="PKM.Ability"/> value by sanity checking the provided <see cref="PKM.Ability"/> against the possible pool of abilities.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <param name="abil">Desired <see cref="PKM.Ability"/> to set.</param>
/// Sets a Random <see cref="PKM.EncryptionConstant"/> value. The <see cref="PKM.EncryptionConstant"/> is not updated if the value should match the <see cref="PKM.PID"/> instead.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
publicstaticvoidSetRandomEC(thisPKMpk)
{
intgen=pk.GenNumber;
if(gen<6&&gen>2)
pk.EncryptionConstant=pk.PID;
else
pk.EncryptionConstant=Util.Rand32();
}
/// <summary>
/// Sets the <see cref="PKM.IsShiny"/> derived value.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <param name="shiny">Desired <see cref="PKM.IsShiny"/> state to set.</param>
/// <returns>Returns <see cref="bool.True"/> if the <see cref="PKM"/> data was modified.</returns>
publicstaticboolSetShiny(thisPKMpk)
{
if(pk.IsShiny)
returnfalse;
if(pk.Format>2)
pk.SetShinyPID();
else
pk.SetShinyIVs();
returntrue;
}
/// <summary>
/// Makes a <see cref="PKM"/> not-shiny.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <returns>Returns <see cref="bool.True"/> if the <see cref="PKM"/> data was modified.</returns>
publicstaticboolSetUnshiny(thisPKMpk)
{
if(!pk.IsShiny)
returnfalse;
pk.SetPIDGender(pk.Gender);
returntrue;
}
/// <summary>
/// Sets the <see cref="PKM.Nature"/> value, with special consideration for the <see cref="PKM.Format"/> values which derive the <see cref="PKM.Nature"/> value.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <param name="nature">Desired <see cref="PKM.Nature"/> value to set.</param>
publicstaticvoidSetNature(thisPKMpk,intnature)
{
if(pk.Format<=4)
pk.SetPIDNature(Math.Max(0,nature));
else
pk.Nature=Math.Max(0,nature);
}
/// <summary>
/// Sets the <see cref="PKM.Nature"/> value, with special consideration for the <see cref="PKM.Format"/> values which derive the <see cref="PKM.Nature"/> value.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <param name="nature">Desired <see cref="PKM.Nature"/> value to set.</param>
/// Sets the <see cref="PKM.Gender"/> value, with special consideration for the <see cref="PKM.Format"/> values which derive the <see cref="PKM.Gender"/> value.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <param name="gender">Desired <see cref="PKM.Gender"/> value to set.</param>
/// Sets the <see cref="PKM.Gender"/> value, with special consideration for the <see cref="PKM.Format"/> values which derive the <see cref="PKM.Gender"/> value.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <param name="gender">Desired <see cref="PKM.Gender"/> value to set.</param>
publicstaticvoidSetGender(thisPKMpk,intgender)
{
gender=Math.Min(2,Math.Max(0,gender));
if(pk.Format<=2)
pk.SetATKIVGender(gender);
elseif(pk.Format<=4)
pk.SetPIDGender(gender);
else
pk.Gender=gender;
}
/// <summary>
/// Sets <see cref="PKM.HyperTrainFlags"/> to valid values which may best enhance the <see cref="PKM"/> stats.
/// </summary>
/// <param name="pkm"></param>
/// <param name="IVs"><see cref="PKM.IVs"/> to use (if already known). Will fetch the current <see cref="PKM.IVs"/> if not provided.</param>