mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-03 17:29:13 +00:00
Landmark Alphas do not have Alpha Moves
nice omission gamefreak
This commit is contained in:
parent
cd19d1d700
commit
3793fd4fd3
2 changed files with 10 additions and 3 deletions
|
@ -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];
|
||||
|
|
|
@ -195,7 +195,7 @@ public sealed class LegendsArceusVerifier : Verifier
|
|||
|
||||
private void VerifyAlphaMove(LegalityAnalysis data, PA8 pa, int alphaMove, ReadOnlySpan<int> moves, ReadOnlySpan<bool> 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;
|
||||
|
|
Loading…
Reference in a new issue