Add gen3 unown form-pid check

This commit is contained in:
Kurt 2022-09-26 07:27:51 -07:00
parent 05d43cef7c
commit 83d6402fd4
3 changed files with 4 additions and 1 deletions

View file

@ -203,6 +203,7 @@ public static class LegalityCheckStrings
public static string LFormPikachuCosplay { get; set; } = "Only Cosplay Pikachu can have this form.";
public static string LFormPikachuCosplayInvalid { get; set; } = "Cosplay Pikachu cannot have the default form.";
public static string LFormPikachuEventInvalid { get; set; } = "Event Pikachu cannot have the default form.";
public static string LFormInvalidExpect_0 { get; set; } = "Form is invalid, expected form index {0}.";
public static string LFormValid { get; set; } = "Form is Valid.";
public static string LFormVivillon { get; set; } = "Valid Vivillon pattern.";
public static string LFormVivillonEventPre { get; set; } = "Event Vivillon pattern on pre-evolution.";

View file

@ -66,6 +66,8 @@ public sealed class FormVerifier : Verifier
break;
case Unown when Info.Generation == 2 && form >= 26:
return GetInvalid(string.Format(LFormInvalidRange, "Z", form == 26 ? "!" : "?"));
case Unown when Info.Generation == 3 && form != EntityPID.GetUnownForm3(pk.EncryptionConstant):
return GetInvalid(string.Format(LFormInvalidExpect_0, EntityPID.GetUnownForm3(pk.EncryptionConstant)));
case Dialga or Palkia or Giratina or Arceus when form > 0 && pk is PA8: // can change forms with key items
break;
case Giratina when form == 1 ^ pk.HeldItem == 112: // Giratina, Origin form only with Griseous Orb

View file

@ -140,7 +140,7 @@ public abstract class SaveFile : ITrainerInfo, IGameValueLimit, IBoxDetailWallpa
#region Player Info
public virtual int Gender { get; set; }
public virtual int Language { get => -1; set { } }
public virtual int Game { get => -1; set { } }
public virtual int Game { get => (int)GameVersion.Any; set { } }
public virtual int TID { get; set; }
public virtual int SID { get; set; }
public virtual string OT { get; set; } = "PKHeX";