Misc fixes for FormInfo (#4678)

This commit is contained in:
Parnassius 2025-12-31 08:21:44 +01:00 committed by GitHub
parent af98a5b5e9
commit 4ee9e4ad31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,6 +54,7 @@ public static bool IsMegaForm(ushort species, byte form)
// Only continue checking if the species is in the list of Battle Only forms.
// Some species have battle only forms as well as out-of-battle forms (other than base form).
(ushort)Darmanitan => (form & 1) == 1, // Zen
(ushort)Greninja => form == 2, // Ash
(ushort)Zygarde => form == 4, // Zygarde Complete
(ushort)Minior => form < 7, // Minior Shields-Down
(ushort)Mimikyu => (form & 1) == 1, // Busted
@ -69,8 +70,8 @@ public static bool IsMegaForm(ushort species, byte form)
(ushort)Zygarde => form == 5,
(ushort)Floette => form == 6,
(ushort)Greninja => form == 3,
(ushort)Meowstic => form == 2,
(ushort)Magearna => form == 2,
(ushort)Meowstic => form is (2 or 3),
(ushort)Magearna => form is (2 or 3),
(ushort)Tatsugiri => form is (3 or 4 or 5),
_ => form != 0,
@ -87,6 +88,7 @@ public static bool IsMegaForm(ushort species, byte form)
public static byte GetOutOfBattleForm(ushort species, byte form, byte format) => species switch
{
(ushort)Darmanitan => (byte)(form & 2),
(ushort)Greninja when form == 2 => 1, // Ash
(ushort)Zygarde when format > 6 => 3,
(ushort)Minior => (byte)(form + 7),
(ushort)Mimikyu => (byte)(form & 2),
@ -210,6 +212,7 @@ public static bool IsFormChangeable(ushort species, byte oldForm, byte newForm,
(int)Darmanitan,
(int)Meloetta,
(int)Greninja,
(int)Aegislash,
(int)Xerneas,
(int)Zygarde,
@ -277,6 +280,7 @@ public static bool IsFormChangeable(ushort species, byte oldForm, byte newForm,
(int)Chandelure,
(int)Chesnaught,
(int)Delphox,
(int)Greninja,
(int)Pyroar,
(int)Malamar,
(int)Barbaracle,