mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-24 13:05:20 -05:00
WC9: Permit 255-all hisuian zoroark size
HOME misapplying PLA's size fixing, fun. Seems it was fixed in 4.0.0 (after 3.2.1?) or server side. A last-minute redeem=>deposit was "fixed" to 255, so the full date range of the card is allowed to be mutated.
This commit is contained in:
@@ -725,21 +725,8 @@ public override bool IsMatchExact(PKM pk, EvoCriteria evo)
|
||||
|
||||
if (pk is IScaledSize s)
|
||||
{
|
||||
if (!Encounter9RNG.IsHeightMatchSV(pk, (byte)HeightValue))
|
||||
if (!IsMatchSize(pk, s))
|
||||
return false;
|
||||
if (s.WeightScalar != WeightValue)
|
||||
return false;
|
||||
|
||||
if (!IsBeforePatch120(CardID) || (pk.MetDate is { } valid && !IsBeforePatch120(valid)))
|
||||
{
|
||||
// S/V 1.2.0 added scale specification.
|
||||
if (Scale != 256)
|
||||
{
|
||||
var current = pk is IScaledSize3 s3 ? s3.Scale : s.HeightScalar;
|
||||
if (Scale != current)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PID Types 0 and 1 do not use the fixed PID value.
|
||||
@@ -751,6 +738,40 @@ public override bool IsMatchExact(PKM pk, EvoCriteria evo)
|
||||
return pk.PID == GetPID(pk, type);
|
||||
}
|
||||
|
||||
private bool IsMatchSize(PKM pk, IScaledSize s)
|
||||
{
|
||||
if (CardID == 1513 && s is { HeightScalar: 255, WeightScalar: 255 } and IHomeTrack { HasTracker: true })
|
||||
{
|
||||
// Hisiuan Zoroark was locked to 128 but could be bumped to 255 via HOME misapplying PLA's fix for Cavern alphas.
|
||||
// This is an OK case of mismatch.
|
||||
// This was fixed on HOME 4.0.0 update (2026, a few years after this event distribution ended), and samples could be deposited afterward (thus not requiring 255-all).
|
||||
if (pk is not IScaledSize3 { Scale: not 255 }) // if Scale is also present, should be 255.
|
||||
return true;
|
||||
// Otherwise, fall through and check via usual logic, which will return false if it doesn't match 128.
|
||||
}
|
||||
|
||||
// Check for strict match of Height/Weight.
|
||||
if (!Encounter9RNG.IsHeightMatchSV(pk, (byte)HeightValue))
|
||||
return false;
|
||||
if (s.WeightScalar != WeightValue)
|
||||
return false;
|
||||
|
||||
// S/V 1.2.0 added scale specification to all available (replaced) and future cards.
|
||||
// If it is a pre-patch card, double check that the date was possible to redeem before the patch.
|
||||
if (IsBeforePatch120(CardID) && (pk.MetDate is not { } valid || IsBeforePatch120(valid)))
|
||||
return true; // No scale to check, can be anything random triangular = rand(127) + rand(128);
|
||||
|
||||
if (Scale == 256) // Random
|
||||
return true; // Allowed to be random triangular.
|
||||
|
||||
// Check for strict match.
|
||||
var current = pk is IScaledSize3 s3 ? s3.Scale : s.HeightScalar;
|
||||
if (Scale != current)
|
||||
return false;
|
||||
|
||||
return true; // Everything matches.
|
||||
}
|
||||
|
||||
private bool IsMatchTrainerName(ReadOnlySpan<byte> trainerTrash, PKM pk)
|
||||
{
|
||||
Span<char> trainerName = stackalloc char[12];
|
||||
|
||||
Reference in New Issue
Block a user