From 3aaf318035021c6bfac7151d671693bab1060a7c Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 14 Mar 2020 14:22:45 -0700 Subject: [PATCH] Update event database, handle HOME gifts horribly --- PKHeX.Core/Game/GameStrings/GameStrings.cs | 5 +++++ PKHeX.Core/Legality/Verifiers/PIDVerifier.cs | 11 ++++++++++- PKHeX.Core/MysteryGifts/WC8.cs | 18 ++++++++++++++++-- PKHeX.Core/Resources/byte/pgf.pkl | Bin 144636 -> 144636 bytes PKHeX.Core/Resources/byte/wc4.pkl | Bin 500760 -> 500760 bytes PKHeX.Core/Resources/byte/wc8.pkl | Bin 37440 -> 79920 bytes 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/Game/GameStrings/GameStrings.cs b/PKHeX.Core/Game/GameStrings/GameStrings.cs index d4af5d904..609d9c921 100644 --- a/PKHeX.Core/Game/GameStrings/GameStrings.cs +++ b/PKHeX.Core/Game/GameStrings/GameStrings.cs @@ -356,6 +356,11 @@ private void SanitizeMetG8SWSH() metSWSH_40000[i] += " (-)"; metSWSH_40000[29] += " (-)"; // a Video game Event (in spanish etc) -- duplicate with line 39 metSWSH_40000[52] += " (-)"; // a Pokémon event -- duplicate with line 37 + + // metSWSH_40000[80] += " (-)"; // Pokémon GO -- duplicate with 30000's entry + // metSWSH_40000[85] += " (-)"; // Pokémon HOME -- duplicate with 30000's entry + metSWSH_30000[11] += " (-)"; // Pokémon GO -- duplicate with 40000's entry + metSWSH_30000[17] += " (-)"; // Pokémon HOME -- duplicate with 40000's entry } public IReadOnlyList GetItemStrings(int generation, GameVersion game = GameVersion.Any) diff --git a/PKHeX.Core/Legality/Verifiers/PIDVerifier.cs b/PKHeX.Core/Legality/Verifiers/PIDVerifier.cs index 5cdbaad90..d00065fb0 100644 --- a/PKHeX.Core/Legality/Verifiers/PIDVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/PIDVerifier.cs @@ -26,7 +26,16 @@ public override void Verify(LegalityAnalysis data) var Info = data.Info; if ((Info.Generation >= 6 || (Info.Generation < 3 && pkm.Format >= 7)) && pkm.PID == pkm.EncryptionConstant) - data.AddLine(GetInvalid(LPIDEqualsEC)); // better to flag than 1:2^32 odds since RNG is not feasible to yield match + { + if (Info.EncounterMatch is WC8 wc8 && wc8.PID == 0 &&wc8.EncryptionConstant == 0) + { + // We'll allow this to pass. + } + else + { + data.AddLine(GetInvalid(LPIDEqualsEC)); // better to flag than 1:2^32 odds since RNG is not feasible to yield match + } + } VerifyShiny(data); } diff --git a/PKHeX.Core/MysteryGifts/WC8.cs b/PKHeX.Core/MysteryGifts/WC8.cs index 28f3f96ee..62a5c8581 100644 --- a/PKHeX.Core/MysteryGifts/WC8.cs +++ b/PKHeX.Core/MysteryGifts/WC8.cs @@ -294,6 +294,8 @@ private static int GetOTOffset(int language) return 0x12C + (index * 0x1C); } + private bool IsHOMEGift => PIDType == Shiny.FixedValue && PID == 0 && EncryptionConstant == 0; + public override PKM ConvertToPKM(ITrainerInfo SAV, EncounterCriteria criteria) { if (!IsPokémon) @@ -306,7 +308,7 @@ public override PKM ConvertToPKM(ITrainerInfo SAV, EncounterCriteria criteria) var pk = new PK8 { - EncryptionConstant = EncryptionConstant != 0 ? EncryptionConstant : Util.Rand32(), + EncryptionConstant = EncryptionConstant != 0 || IsHOMEGift ? EncryptionConstant : Util.Rand32(), TID = TID, SID = SID, Species = Species, @@ -502,7 +504,19 @@ protected override bool IsMatchExact(PKM pkm) var OT = GetOT(pkm.Language); // May not be guaranteed to work. if (!string.IsNullOrEmpty(OT) && OT != pkm.OT_Name) return false; if (OriginGame != 0 && OriginGame != pkm.Version) return false; - if (EncryptionConstant != 0 && EncryptionConstant != pkm.EncryptionConstant) return false; + if (EncryptionConstant != 0) + { + if (EncryptionConstant != pkm.EncryptionConstant) + return false; + } + else if (IsHOMEGift)// 0 + { + // HOME gifts -- PID and EC are zeroes... + if (EncryptionConstant != pkm.EncryptionConstant) + return false; + if (IsShiny) + return false; + } } if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species)) diff --git a/PKHeX.Core/Resources/byte/pgf.pkl b/PKHeX.Core/Resources/byte/pgf.pkl index f88b4a171c9dc2af2b364325587935270ffa1b8c..e077dd27dcb832fb54952ae0cffec1127055fbce 100644 GIT binary patch delta 21 dcmezKlH<=yjty4+ObQImHvZdf{232C1psaH2`m5r delta 21 dcmezKlH<=yjty4+O#lBk+xTy{@n<~n6aayK3km=L diff --git a/PKHeX.Core/Resources/byte/wc4.pkl b/PKHeX.Core/Resources/byte/wc4.pkl index e9115a5798bbf7939bc8e347196cbe79701b17d9..58008a9faf733f31e5d472c9a927d355aaf91773 100644 GIT binary patch delta 71 zcmbPnLT<(hxrP?T7N#xCX~&qt{ikOfV=kK>_mZt{ddzWV&&j&$*{AEgV&mGr?Ktx{ a#_2AfS%lj6on!`L79eKbzV9Sk)GYu(a38Dy delta 65 zcmbPnLT<(hxrP?T7N#xCX~&rOqo-#aV=iN1VEDp4Icr_j^qAw!o{T)(mmOzjV`7}& UzV;+D5VHU=>-M!L*|Ki|075((ng9R* diff --git a/PKHeX.Core/Resources/byte/wc8.pkl b/PKHeX.Core/Resources/byte/wc8.pkl index f6946075ffa5a5a2823bc53f35bd55101f6cdbbf..4e0f02f97dcaec4047e0a8a35126e4c2aa988248 100644 GIT binary patch delta 2295 zcmd6me@IQVz3$Hk2$Z0{u#^)HYyk*>yHVRLI3nuB^xUuyX$%1bB=YN{PmaAEuaS z7{f0@1JuC|+sb=D+ef`eBkga2gX%Nnn$LEEpAm8&jcx5;^K72NR&LY??)p6f8T^9M z%w~;UEw;LqyZUQbSxx)Cbvg0LIkF?!cqx(ZkbZm$;LKxqQ6^;_m0a$H#GqckeB7G> zhI?Ev8JxD*))R)@#1htFDr?!vTQ7oTAEzxNG4IS!lJv@~NXWL9oF%OgQ5X5fF{-hh zA>$T_St?(aZ-$oTJN-^uNS3p`c8p5DeQD+E8q!?-O4kzB2vNf}r()m3&)82!L}Y(%CIaFKLik2Un0GLG ziRk=&F>}CV1%gU*lNfr#IN{&F!H=9LPt5p8hbKr(p zIK(~B>-qF~G4Ynny`Fzmi0-$|C=z0Ura@}okBCnHF6uj_3ahDIuL-luG`NXquXURLk^D%$#8^|M}9tG0_|%*Suvm#2EJEjka<)wpcDov>f(Z8z_s4ULmwyxeBC>^zEv@x6$Y527|;rX wr76XLTn3kSD+a8)4BG!x49I2h>Q2RgdU#JE63!J;xEC2ui delta 41 xcmdn+f#tvwrp*mvH<&ihQ2D~NIYtY}y`VosWwS;20@lqHNfT5yujt{h1^|$s5;6b)