/// <summary> /// 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> public static void SetAltForm(this PKM pk, int form) { switch (pk.Format) { case 2: while (pk.AltForm != form) { pk.SetRandomIVs(); } break; case 3: pk.SetPIDUnown3(form); break; default: pk.AltForm = form; break; } }