From 41930dd2bdcab7cf2244d3ef42a572a6b60558a2 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 16 Dec 2022 22:34:01 -0800 Subject: [PATCH] Handle crossover flying dragonite Update pkl from pkNX --- .../EncounterStatic/EncounterFixed9.cs | 17 +++++++++-------- .../wild/Gen9/encounter_fixed_paldea.pkl | Bin 8960 -> 9100 bytes .../Saves/Access/SaveBlockAccessor9SV.cs | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterFixed9.cs b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterFixed9.cs index cf4549f67..a2400e876 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterFixed9.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterFixed9.cs @@ -1,5 +1,5 @@ using System; -using System.Buffers.Binary; +using static System.Buffers.Binary.BinaryPrimitives; namespace PKHeX.Core; @@ -15,6 +15,7 @@ public sealed record EncounterFixed9 : EncounterStatic, IGemType private byte Location0 { get; init; } private byte Location1 { get; init; } private byte Location2 { get; init; } + private byte Location3 { get; init; } private const int MinScaleStrongTera = 200; // [200,255] @@ -32,7 +33,7 @@ public static EncounterFixed9[] GetArray(ReadOnlySpan data) private static EncounterFixed9 ReadEncounter(ReadOnlySpan data) => new() { - Species = BinaryPrimitives.ReadUInt16LittleEndian(data), + Species = ReadUInt16LittleEndian(data), Form = data[0x02], Level = data[0x03], FlawlessIVCount = data[0x04], @@ -40,14 +41,14 @@ private static EncounterFixed9 ReadEncounter(ReadOnlySpan data) => new() Gender = (sbyte)data[0x06], // 1 byte reserved Moves = new Moveset( - BinaryPrimitives.ReadUInt16LittleEndian(data[0x08..]), - BinaryPrimitives.ReadUInt16LittleEndian(data[0x0A..]), - BinaryPrimitives.ReadUInt16LittleEndian(data[0x0C..]), - BinaryPrimitives.ReadUInt16LittleEndian(data[0x0E..])), + ReadUInt16LittleEndian(data[0x08..]), + ReadUInt16LittleEndian(data[0x0A..]), + ReadUInt16LittleEndian(data[0x0C..]), + ReadUInt16LittleEndian(data[0x0E..])), Location0 = data[0x10], Location1 = data[0x11], Location2 = data[0x12], - // 1 byte reserved + Location3 = data[0x13], }; protected override bool IsMatchLocation(PKM pk) @@ -55,7 +56,7 @@ protected override bool IsMatchLocation(PKM pk) if (!pk.HasOriginalMetLocation) return true; var loc = pk.Met_Location; - return loc == Location0 || loc == Location1 || loc == Location2; + return loc == Location0 || loc == Location1 || loc == Location2 || loc == Location3; } protected override bool IsMatchForm(PKM pk, EvoCriteria evo) diff --git a/PKHeX.Core/Resources/legality/wild/Gen9/encounter_fixed_paldea.pkl b/PKHeX.Core/Resources/legality/wild/Gen9/encounter_fixed_paldea.pkl index 6fec4c9f40dbf73e4ad3eed804cdb709f12c7676..cf9d6a5634ca2a4e640df41187379c1410dbaf5a 100644 GIT binary patch delta 479 zcmZvYu}eZx6vofF@A(W-;_34#C|b+&4HlA1P>49ZY>CT5u(5cEgG15M+R)h4A-9%V zBZBLc5e-38e?eP>ZMoH0ryzJ~ce$7E`_9Mjo&)b_?dnDoj!U_61on69eVMDgwLIjz3|OstJirb(lCqzDl!g(UEW>CcwOZG=`nZ)xD`% zk3Y>hJ&eN|4b2w4nh87J`tfJNe!Qg$$rph=8e1FaQ!V|#J2C7rQ@`6Q{9ekqwuHVm z!O2W&H?yvD;yO3r`JH@8>%oA`Y>F=O%ir4^<;#eYQiV6%BvEv@2jEVFLYTnrs9NzH Ox#4+EqOYp+kN5>KKwdQf delta 382 zcmeBiZ*beNhnY!3ZSp>5waFhCSth?=E)`{9U|7e%z|O$%AIO3LHipSXEJ2fRup}}v zOtxaR0g~mcbAcK+i?KN|PR?Oh(_ml_V`Pv<)}#Z}E5XRXhAhU$uz45zG^WidTzX7E zLniawp4`MMG`WG-o{?em0p3N7Kq{F(oXM7fVJZ^?Gm2I>EMg9BAayJ#>KxoA%L|3@ zb07=yFl?SC^n_`0pQts^+Eb#(f#f8y_dv2q93-+&Ttl3JVHz`<)Cs{?fO