From 3793fd4fd373d89fe3a9f1c9b3f7bd8e5191c955 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 5 Feb 2022 10:23:00 -0800 Subject: [PATCH] Landmark Alphas do not have Alpha Moves nice omission gamefreak --- .../Legality/Encounters/EncounterSlot/EncounterSlot8a.cs | 8 ++++++-- PKHeX.Core/Legality/Verifiers/LegendsArceusVerifier.cs | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8a.cs b/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8a.cs index 28c877fb0..dbb0c9c27 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8a.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8a.cs @@ -9,6 +9,7 @@ namespace PKHeX.Core; public sealed record EncounterSlot8a : EncounterSlot, IAlpha { public override int Generation => 8; + public SlotType Type => Area.Type; public bool IsAlpha { get => AlphaType is not 0; set => throw new InvalidOperationException("Do not mutate this field."); } public byte FlawlessIVCount { get; } @@ -35,7 +36,7 @@ public sealed record EncounterSlot8a : EncounterSlot, IAlpha a.IsAlpha = true; if (pk is IScaledSize s) s.HeightScalar = s.WeightScalar = byte.MaxValue; - if (pk is PA8 pa) + if (Type is not SlotType.Landmark && pk is PA8 pa) pa.SetMasteryFlagMove(pa.AlphaMove = pa.GetRandomAlphaMove()); } if (pk is IScaledSizeValue v) @@ -75,8 +76,11 @@ public sealed record EncounterSlot8a : EncounterSlot, IAlpha return EncounterMatchRating.Match; var alphaMove = pa.AlphaMove; + bool hasAlphaMove = alphaMove != 0; if (!pa.IsAlpha) - return alphaMove == 0 ? EncounterMatchRating.Match : EncounterMatchRating.DeferredErrors; + return !hasAlphaMove ? EncounterMatchRating.Match : EncounterMatchRating.DeferredErrors; + if (Type is SlotType.Landmark == hasAlphaMove) + return EncounterMatchRating.DeferredErrors; var pi = PersonalTable.LA.GetFormEntry(Species, Form); var tutors = pi.SpecialTutors[0]; diff --git a/PKHeX.Core/Legality/Verifiers/LegendsArceusVerifier.cs b/PKHeX.Core/Legality/Verifiers/LegendsArceusVerifier.cs index 2c03d1a57..78af5f10c 100644 --- a/PKHeX.Core/Legality/Verifiers/LegendsArceusVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/LegendsArceusVerifier.cs @@ -195,7 +195,7 @@ public sealed class LegendsArceusVerifier : Verifier private void VerifyAlphaMove(LegalityAnalysis data, PA8 pa, int alphaMove, ReadOnlySpan moves, ReadOnlySpan bits) { - if (!pa.IsAlpha) + if (!pa.IsAlpha || data.EncounterMatch is EncounterSlot8a { Type: SlotType.Landmark }) { data.AddLine(GetInvalid(LMoveShopAlphaMoveShouldBeZero)); return; @@ -219,6 +219,9 @@ public sealed class LegendsArceusVerifier : Verifier if (enc is not IAlpha { IsAlpha: true }) return; // okay + if (enc is EncounterSlot8a { Type: SlotType.Landmark }) + return; // okay + var pi = PersonalTable.LA.GetFormEntry(enc.Species, enc.Form); var tutors = pi.SpecialTutors[0]; bool hasAnyTutor = Array.IndexOf(tutors, true) >= 0;