mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-22 20:13:06 +00:00
Revise naive ability deferral logic for gen9
Closes #4221 HA->1->2 requires a 2-step check
This commit is contained in:
parent
ea63d90ac4
commit
9e7046564c
6 changed files with 48 additions and 6 deletions
|
@ -353,7 +353,14 @@ public sealed record EncounterDist9
|
|||
}
|
||||
else if (Ability.IsSingleValue(out int index) && 1 << index != num) // Fixed regular ability
|
||||
{
|
||||
if (Ability is OnlyFirst or OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
var a = Ability;
|
||||
if (a is OnlyHidden)
|
||||
{
|
||||
if (!AbilityVerifier.CanAbilityPatch(9, PersonalTable.SV.GetFormEntry(Species, Form), pk.Species))
|
||||
return DeferredErrors;
|
||||
a = num == 1 ? OnlyFirst : OnlySecond;
|
||||
}
|
||||
if (a is OnlyFirst or OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
return DeferredErrors;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,14 @@ public sealed record EncounterFixed9
|
|||
}
|
||||
else if (Ability.IsSingleValue(out int index) && 1 << index != num) // Fixed regular ability
|
||||
{
|
||||
if (Ability is OnlyFirst or OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
var a = Ability;
|
||||
if (a is OnlyHidden)
|
||||
{
|
||||
if (!AbilityVerifier.CanAbilityPatch(9, PersonalTable.SV.GetFormEntry(Species, Form), pk.Species))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
a = num == 1 ? OnlyFirst : OnlySecond;
|
||||
}
|
||||
if (a is OnlyFirst or OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -365,7 +365,14 @@ public sealed record EncounterMight9
|
|||
}
|
||||
else if (Ability.IsSingleValue(out int index) && 1 << index != num) // Fixed regular ability
|
||||
{
|
||||
if (Ability is AbilityPermission.OnlyFirst or AbilityPermission.OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
var a = Ability;
|
||||
if (a is AbilityPermission.OnlyHidden)
|
||||
{
|
||||
if (!AbilityVerifier.CanAbilityPatch(9, PersonalTable.SV.GetFormEntry(Species, Form), pk.Species))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
a = num == 1 ? AbilityPermission.OnlyFirst : AbilityPermission.OnlySecond;
|
||||
}
|
||||
if (a is AbilityPermission.OnlyFirst or AbilityPermission.OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -217,7 +217,14 @@ public sealed record EncounterOutbreak9
|
|||
}
|
||||
else if (Ability.IsSingleValue(out int index) && 1 << index != num) // Fixed regular ability
|
||||
{
|
||||
if (Ability is AbilityPermission.OnlyFirst or AbilityPermission.OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
var a = Ability;
|
||||
if (a is AbilityPermission.OnlyHidden)
|
||||
{
|
||||
if (!AbilityVerifier.CanAbilityPatch(9, PersonalTable.SV.GetFormEntry(Species, Form), pk.Species))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
a = num == 1 ? AbilityPermission.OnlyFirst : AbilityPermission.OnlySecond;
|
||||
}
|
||||
if (a is AbilityPermission.OnlyFirst or AbilityPermission.OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -258,7 +258,14 @@ public sealed record EncounterStatic9(GameVersion Version)
|
|||
}
|
||||
else if (Ability.IsSingleValue(out int index) && 1 << index != num) // Fixed regular ability
|
||||
{
|
||||
if (Ability is OnlyFirst or OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
var a = Ability;
|
||||
if (a is OnlyHidden)
|
||||
{
|
||||
if (!AbilityVerifier.CanAbilityPatch(9, PersonalTable.SV.GetFormEntry(Species, Form), pk.Species))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
a = num == 1 ? OnlyFirst : OnlySecond;
|
||||
}
|
||||
if (a is OnlyFirst or OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -289,7 +289,14 @@ public sealed record EncounterTera9
|
|||
}
|
||||
else if (Ability.IsSingleValue(out int index) && 1 << index != num) // Fixed regular ability
|
||||
{
|
||||
if (Ability is OnlyFirst or OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
var a = Ability;
|
||||
if (a is OnlyHidden)
|
||||
{
|
||||
if (!AbilityVerifier.CanAbilityPatch(9, PersonalTable.SV.GetFormEntry(Species, Form), pk.Species))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
a = num == 1 ? OnlyFirst : OnlySecond;
|
||||
}
|
||||
if (a is OnlyFirst or OnlySecond && !AbilityVerifier.CanAbilityCapsule(9, PersonalTable.SV.GetFormEntry(Species, Form)))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue