From 78cc0098b3b7f7cd6dc7ab371c25fcdfa2e71a89 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 2 Feb 2021 10:41:28 -0800 Subject: [PATCH] Update EncounterStatic2.cs --- .../EncounterStatic/EncounterStatic2.cs | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic2.cs b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic2.cs index 2a20b83db..0bf035275 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic2.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic2.cs @@ -18,6 +18,13 @@ namespace PKHeX.Core Level = level; } + public override bool IsMatchExact(PKM pkm, DexLevel evo) + { + if (Shiny == Shiny.Always && !pkm.IsShiny) + return false; + return base.IsMatchExact(pkm, evo); + } + protected override bool IsMatchEggLocation(PKM pkm) { if (pkm.Format > 2) @@ -50,16 +57,6 @@ namespace PKHeX.Core return true; } - protected override void SetMetData(PKM pk, int level, DateTime today) - { - if (Version != GameVersion.C) - return; - var pk2 = (PK2)pk; - pk2.Met_Location = Location; - pk2.Met_Level = level; - pk2.Met_TimeOfDay = EncounterTime.Any.RandomValidTime(); - } - protected override bool IsMatchLevel(PKM pkm, DexLevel evo) { if (pkm is ICaughtData2 {CaughtData: not 0}) @@ -80,6 +77,24 @@ namespace PKHeX.Core } protected override bool IsMatchPartial(PKM pkm) => false; + + protected override void ApplyDetails(ITrainerInfo sav, EncounterCriteria criteria, PKM pk) + { + base.ApplyDetails(sav, criteria, pk); + var pk2 = (PK2)pk; + if (Shiny == Shiny.Always) + pk2.SetShiny(); + } + + protected override void SetMetData(PKM pk, int level, DateTime today) + { + if (Version != GameVersion.C && pk.OT_Gender != 1) + return; + var pk2 = (PK2)pk; + pk2.Met_Location = Location; + pk2.Met_Level = level; + pk2.Met_TimeOfDay = EncounterTime.Any.RandomValidTime(); + } } public sealed record EncounterStatic2Odd : EncounterStatic2