From 5316ad6b37bdc6410714ecb7249c877bbd0f8723 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 21 Dec 2023 19:04:58 -0800 Subject: [PATCH] Set affixed for encounters w/ Gen9 ribbon/mark Matches S/V 3.0.0 behavior, better to match --- .../Legality/Encounters/Templates/Gen9/EncounterStatic9.cs | 6 ++++++ .../Legality/Encounters/Templates/Gen9/EncounterTrade9.cs | 3 +++ PKHeX.Core/Legality/Verifiers/FormArgumentVerifier.cs | 3 ++- PKHeX.Core/MysteryGifts/WC9.cs | 6 ++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterStatic9.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterStatic9.cs index 376fe24a8..084698277 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterStatic9.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterStatic9.cs @@ -104,9 +104,15 @@ public sealed record EncounterStatic9(GameVersion Version) if (StarterBoxLegend) pk.FormArgument = 1; // Not Ride Form. if (IsTitan) + { pk.RibbonMarkTitan = true; + pk.AffixedRibbon = (sbyte)RibbonIndex.MarkTitan; + } else if (RibbonMarkCrafty) + { pk.RibbonMarkCrafty = true; + pk.AffixedRibbon = (sbyte)RibbonIndex.MarkCrafty; + } SetPINGA(pk, criteria, pi); if (Moves.HasMoves) diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterTrade9.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterTrade9.cs index b2106e75d..62501feea 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterTrade9.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterTrade9.cs @@ -112,7 +112,10 @@ public sealed record EncounterTrade9 if (EvolveOnTrade) pk.Species++; if (RibbonPartner) + { pk.RibbonPartner = true; + pk.AffixedRibbon = (sbyte)RibbonIndex.Partner; + } pk.ResetPartyStats(); diff --git a/PKHeX.Core/Legality/Verifiers/FormArgumentVerifier.cs b/PKHeX.Core/Legality/Verifiers/FormArgumentVerifier.cs index d5527ec4b..9fa874605 100644 --- a/PKHeX.Core/Legality/Verifiers/FormArgumentVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/FormArgumentVerifier.cs @@ -64,7 +64,8 @@ public sealed class FormArgumentVerifier : Verifier Overqwil => arg switch { > 9_999 => GetInvalid(LFormArgumentHigh), - < 20 when !data.Info.EvoChainsAllGens.HasVisitedGen9 || pk.CurrentLevel < 28 => GetInvalid(LFormArgumentLow), + 0 when enc.Species == (ushort)Overqwil => GetValid(LFormArgumentValid), + < 20 when !data.Info.EvoChainsAllGens.HasVisitedGen9 || pk.CurrentLevel < (pk is IHomeTrack { HasTracker: true } ? 15 : 28) => GetInvalid(LFormArgumentLow), >= 20 when !data.Info.EvoChainsAllGens.HasVisitedPLA || pk.CurrentLevel < 25 => GetInvalid(LFormArgumentLow), _ when pk is IHomeTrack { HasTracker: false } and PA8 { CurrentLevel: < 25 } => GetInvalid(LEvoInvalid), _ => GetValid(LFormArgumentValid), diff --git a/PKHeX.Core/MysteryGifts/WC9.cs b/PKHeX.Core/MysteryGifts/WC9.cs index 7424c944f..3cca56a1b 100644 --- a/PKHeX.Core/MysteryGifts/WC9.cs +++ b/PKHeX.Core/MysteryGifts/WC9.cs @@ -529,8 +529,10 @@ public sealed class WC9(byte[] Data) : DataMysteryGift(Data), ILangNick, INature for (var i = 0; i < RibbonBytesCount; i++) { var ribbon = GetRibbonAtIndex(i); - if (ribbon != RibbonByteNone) - pk.SetRibbon(ribbon); + if (ribbon == RibbonByteNone) + continue; + pk.SetRibbon(ribbon); + pk.AffixedRibbon = (sbyte)ribbon; } SetPINGA(pk, criteria);