Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle HOME Keldeo & Meltan; Revise WB7 #4446

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions PKHeX.Core/Legality/Verifiers/MiscVerifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,24 @@ private static void VerifyBelugaStats(LegalityAnalysis data, PB7 pb7)

private static void VerifyAbsoluteSizes(LegalityAnalysis data, IScaledSizeValue obj)
{
// ReSharper disable once CompareOfFloatsByEqualityOperator -- THESE MUST MATCH EXACTLY
if (data is { Entity: PB7 , EncounterMatch: WB7 { IsHeightWeightFixed: true } enc })
VerifyFixedSizes(data, obj, enc);
else
VerifyCalculatedSizes(data, obj);
}

private static void VerifyFixedSizes(LegalityAnalysis data, IScaledSizeValue obj, WB7 enc)
{
if (obj.HeightAbsolute != enc.GetHomeHeightAbsolute())
data.AddLine(GetInvalid(LStatIncorrectHeight, Encounter));
if (obj.WeightAbsolute != enc.GetHomeWeightAbsolute())
data.AddLine(GetInvalid(LStatIncorrectWeight, Encounter));
}

private static void VerifyCalculatedSizes(LegalityAnalysis data, IScaledSizeValue obj)
{
if (obj.HeightAbsolute != obj.CalcHeightAbsolute)
data.AddLine(GetInvalid(LStatIncorrectHeight, Encounter));
// ReSharper disable once CompareOfFloatsByEqualityOperator -- THESE MUST MATCH EXACTLY
if (obj.WeightAbsolute != obj.CalcWeightAbsolute)
data.AddLine(GetInvalid(LStatIncorrectWeight, Encounter));
}
Expand Down
Loading