mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-22 03:53:08 +00:00
Fix Sirfetch'd deferral, add Tera deferral
Marill and Azurill need deferral cases as they change primary type (normal-fairy => fairy || water-fairy => water)
This commit is contained in:
parent
e4e3d929a0
commit
947bbc7274
1 changed files with 6 additions and 2 deletions
|
@ -231,11 +231,15 @@ public sealed record EncounterSlot8GO(int StartDate, int EndDate, ushort Species
|
|||
return EncounterMatchRating.PartialMatch;
|
||||
if (Species is (int)Farfetchd && IsReallySirfetchd(pk))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
if (pk is ITeraType ro && IsTeraTypeMismatch(ro.TeraTypeOriginal, PersonalTable.SV[Species, Form]))
|
||||
return EncounterMatchRating.DeferredErrors;
|
||||
if (!this.GetIVsValid(pk))
|
||||
return EncounterMatchRating.Deferred;
|
||||
return EncounterMatchRating.Match;
|
||||
}
|
||||
|
||||
private static bool IsTeraTypeMismatch(MoveType original, PersonalInfo9SV pi) => original != TeraTypeUtil.GetTeraTypeImport(pi.Type1, pi.Type2);
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a Farfetch'd was originally a Sirfetch'd.
|
||||
/// </summary>
|
||||
|
@ -250,8 +254,8 @@ public sealed record EncounterSlot8GO(int StartDate, int EndDate, ushort Species
|
|||
return false; // can't tell if it was originally Farfetch'd
|
||||
|
||||
Span<char> name = stackalloc char[pk.TrashCharCountNickname];
|
||||
pk.LoadString(pk.NicknameTrash, name);
|
||||
return name is "Sirfetch'd"; // only way to get the bad apostrophe is to originate in HOME with it.
|
||||
int length = pk.LoadString(pk.NicknameTrash, name);
|
||||
return name[..length] is "Sirfetch'd"; // only way to get the bad apostrophe is to originate in HOME with it.
|
||||
}
|
||||
|
||||
public byte OriginalTrainerFriendship => Species switch
|
||||
|
|
Loading…
Reference in a new issue