mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-24 23:57:12 -05:00
AbilityVerifier: gen5 ability patch for genies
and giratina extract to a single location abilityverifier is still needing a rewrite to clean up all the branched logic, but it's still "functional"
This commit is contained in:
parent
ca03311d21
commit
b303ea90ef
|
|
@ -185,18 +185,22 @@ public static bool IsAbilityPatchRevertPossible(EvolutionHistory evosAll, int ab
|
|||
}
|
||||
|
||||
// Some species have a distinct hidden ability only on another form, and can change between that form and its current form.
|
||||
var first = evos[0];
|
||||
return first.Form != 0 && first.Species switch
|
||||
{
|
||||
(int)Species.Giratina => true, // Form-0 is a/a/h
|
||||
(int)Species.Tornadus => true, // Form-0 is a/a/h
|
||||
(int)Species.Thundurus => true, // Form-0 is a/a/h
|
||||
(int)Species.Landorus => true, // Form-0 is a/a/h
|
||||
(int)Species.Enamorus => true, // Form-0 is a/a/h
|
||||
_ => false,
|
||||
};
|
||||
return IsFormChangeDifferentHidden(evos[0]);
|
||||
}
|
||||
|
||||
public static bool IsFormChangeDifferentHidden<TEvo>(TEvo first) where TEvo : ISpeciesForm =>
|
||||
first.Form != 0 && IsFormChangeDifferentHidden(first.Species);
|
||||
|
||||
public static bool IsFormChangeDifferentHidden(ushort species) => species switch
|
||||
{
|
||||
(int)Species.Giratina => true, // Form-0 is a/a/h
|
||||
(int)Species.Tornadus => true, // Form-0 is a/a/h
|
||||
(int)Species.Thundurus=> true, // Form-0 is a/a/h
|
||||
(int)Species.Landorus => true, // Form-0 is a/a/h
|
||||
(int)Species.Enamorus => true, // Form-0 is a/a/h
|
||||
_ => false,
|
||||
};
|
||||
|
||||
private static bool IsRevertPossible<TTable, TInfo, TDex>(ReadOnlySpan<TDex> evos, TTable table, int abilityIndex)
|
||||
where TTable : IPersonalTable<TInfo>
|
||||
where TInfo : class, IPersonalInfo, IPersonalAbility12H
|
||||
|
|
@ -215,6 +219,8 @@ public static bool IsAbilityPatchRevertPossible(EvolutionHistory evosAll, int ab
|
|||
return true;
|
||||
revert = true;
|
||||
}
|
||||
return false;
|
||||
|
||||
// Some species have a distinct hidden ability only on another form, and can change between that form and its current form.
|
||||
return abilityIndex == 1 && IsFormChangeDifferentHidden(evos[0]); // can't change to second index
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -455,14 +455,6 @@ public static bool CanAbilityPatch(byte format, IPersonalAbility12H abilities, u
|
|||
return true;
|
||||
|
||||
// Some species have a distinct hidden ability only on another form, and can change between that form and its current form.
|
||||
return species switch
|
||||
{
|
||||
(int)Species.Giratina => true, // Form-0 is a/a/h
|
||||
(int)Species.Tornadus => true, // Form-0 is a/a/h
|
||||
(int)Species.Thundurus => true, // Form-0 is a/a/h
|
||||
(int)Species.Landorus => true, // Form-0 is a/a/h
|
||||
(int)Species.Enamorus => true, // Form-0 is a/a/h
|
||||
_ => false,
|
||||
};
|
||||
return AbilityChangeRules.IsFormChangeDifferentHidden(species);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user