2018-06-24 05:00:01 +00:00
|
|
|
|
using System;
|
2018-06-30 22:01:16 +00:00
|
|
|
|
using System.Collections.Generic;
|
2018-06-24 05:00:01 +00:00
|
|
|
|
using static PKHeX.Core.LegalityCheckStrings;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2018-07-02 02:17:37 +00:00
|
|
|
|
/// <summary>
|
2020-12-11 04:42:30 +00:00
|
|
|
|
/// Verifies the <see cref="PKM.Form"/> value.
|
2018-07-02 02:17:37 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class FormVerifier : Verifier
|
2018-06-24 05:00:01 +00:00
|
|
|
|
{
|
|
|
|
|
protected override CheckIdentifier Identifier => CheckIdentifier.Form;
|
|
|
|
|
|
|
|
|
|
public override void Verify(LegalityAnalysis data)
|
|
|
|
|
{
|
|
|
|
|
var pkm = data.pkm;
|
|
|
|
|
if (pkm.Format < 4)
|
|
|
|
|
return; // no forms exist
|
2018-06-30 22:01:16 +00:00
|
|
|
|
var result = VerifyForm(data);
|
|
|
|
|
data.AddLine(result);
|
2020-01-11 00:33:40 +00:00
|
|
|
|
|
|
|
|
|
if (pkm is IFormArgument f)
|
2020-01-13 00:49:12 +00:00
|
|
|
|
data.AddLine(VerifyFormArgument(data, f.FormArgument));
|
2018-06-30 22:01:16 +00:00
|
|
|
|
}
|
2018-06-24 05:00:01 +00:00
|
|
|
|
|
2018-09-01 21:11:12 +00:00
|
|
|
|
private CheckResult VALID => GetValid(LFormValid);
|
2018-07-27 02:34:27 +00:00
|
|
|
|
|
2018-06-30 22:01:16 +00:00
|
|
|
|
private CheckResult VerifyForm(LegalityAnalysis data)
|
|
|
|
|
{
|
|
|
|
|
var pkm = data.pkm;
|
2018-06-24 05:00:01 +00:00
|
|
|
|
var PersonalInfo = data.PersonalInfo;
|
|
|
|
|
|
2020-12-11 04:42:30 +00:00
|
|
|
|
int count = PersonalInfo.FormCount;
|
|
|
|
|
var form = pkm.Form;
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (count <= 1 && form == 0)
|
2018-06-30 22:01:16 +00:00
|
|
|
|
return VALID; // no forms to check
|
|
|
|
|
|
2020-01-17 03:23:29 +00:00
|
|
|
|
var species = pkm.Species;
|
2018-06-30 22:01:16 +00:00
|
|
|
|
var EncounterMatch = data.EncounterMatch;
|
|
|
|
|
var Info = data.Info;
|
2018-06-24 05:00:01 +00:00
|
|
|
|
|
2020-12-11 04:42:30 +00:00
|
|
|
|
if (!PersonalInfo.IsFormWithinRange(form) && !FormInfo.IsValidOutOfBoundsForm(species, form, Info.Generation))
|
2020-01-17 03:23:29 +00:00
|
|
|
|
return GetInvalid(string.Format(LFormInvalidRange, count - 1, form));
|
2018-06-24 05:00:01 +00:00
|
|
|
|
|
2020-08-30 17:23:22 +00:00
|
|
|
|
if (EncounterMatch is EncounterSlot w && w.Area.Type == SlotType.FriendSafari)
|
2018-07-27 02:34:27 +00:00
|
|
|
|
{
|
2018-06-24 05:00:01 +00:00
|
|
|
|
VerifyFormFriendSafari(data);
|
2018-07-27 02:34:27 +00:00
|
|
|
|
}
|
2018-06-24 05:00:01 +00:00
|
|
|
|
else if (EncounterMatch is EncounterEgg)
|
|
|
|
|
{
|
2020-12-11 04:42:30 +00:00
|
|
|
|
if (FormInfo.IsTotemForm(species, form, data.Info.Generation))
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LFormInvalidGame);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-01-17 03:23:29 +00:00
|
|
|
|
switch (species)
|
2018-06-24 05:00:01 +00:00
|
|
|
|
{
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Pikachu when Info.Generation == 6: // Cosplay
|
2018-06-24 05:00:01 +00:00
|
|
|
|
bool isStatic = EncounterMatch is EncounterStatic;
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (isStatic != (form != 0))
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(isStatic ? LFormPikachuCosplayInvalid : LFormPikachuCosplay);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
2018-06-30 22:01:16 +00:00
|
|
|
|
|
2020-02-12 04:36:10 +00:00
|
|
|
|
case (int)Species.Pikachu when Info.Generation >= 7: // Cap
|
2018-06-24 05:00:01 +00:00
|
|
|
|
bool IsValidPikachuCap()
|
|
|
|
|
{
|
2019-10-08 01:40:09 +00:00
|
|
|
|
return EncounterMatch switch
|
2018-06-24 05:00:01 +00:00
|
|
|
|
{
|
2020-01-17 03:23:29 +00:00
|
|
|
|
WC7 wc7 => (wc7.Form == form),
|
2020-02-12 04:36:10 +00:00
|
|
|
|
WC8 wc => (wc.Form == form),
|
2020-01-17 03:23:29 +00:00
|
|
|
|
EncounterStatic s => (s.Form == form),
|
|
|
|
|
_ => (form == 0)
|
2019-10-08 01:40:09 +00:00
|
|
|
|
};
|
2018-06-24 05:00:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!IsValidPikachuCap())
|
|
|
|
|
{
|
2020-02-12 04:36:10 +00:00
|
|
|
|
bool gift = EncounterMatch is MysteryGift g && g.Form != form;
|
2018-09-01 21:11:12 +00:00
|
|
|
|
var msg = gift ? LFormPikachuEventInvalid : LFormInvalidGame;
|
2018-06-30 22:01:16 +00:00
|
|
|
|
return GetInvalid(msg);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2020-01-17 03:23:29 +00:00
|
|
|
|
case (int)Species.Unown when Info.Generation == 2 && form >= 26:
|
|
|
|
|
return GetInvalid(string.Format(LFormInvalidRange, "Z", form == 26 ? "!" : "?"));
|
|
|
|
|
case (int)Species.Giratina when form == 1 ^ pkm.HeldItem == 112: // Giratina, Origin form only with Griseous Orb
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LFormItemInvalid);
|
2018-06-30 22:01:16 +00:00
|
|
|
|
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Arceus:
|
2018-06-24 05:00:01 +00:00
|
|
|
|
{
|
2020-01-17 03:23:29 +00:00
|
|
|
|
int arceus = GetArceusFormFromHeldItem(pkm.HeldItem, pkm.Format);
|
|
|
|
|
return arceus != form ? GetInvalid(LFormItemInvalid) : GetValid(LFormItem);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
}
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Keldeo:
|
2018-06-24 05:00:01 +00:00
|
|
|
|
{
|
2020-02-15 21:30:50 +00:00
|
|
|
|
// can mismatch in gen5 via BW tutor and transfer up
|
|
|
|
|
// can mismatch in gen8+ as the form activates in battle when knowing the move; outside of battle can be either state.
|
|
|
|
|
if (Info.Generation == 5 || pkm.Format >= 8)
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
|
|
|
|
int index = Array.IndexOf(pkm.Moves, 548); // Secret Sword
|
|
|
|
|
bool noSword = index < 0;
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (form == 0 ^ noSword) // mismatch
|
2018-09-01 21:11:12 +00:00
|
|
|
|
Info.Moves[noSword ? 0 : index] = new CheckMoveResult(Info.Moves[noSword ? 0 : index], Severity.Invalid, LMoveKeldeoMismatch, CheckIdentifier.Move);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Genesect:
|
2018-06-24 05:00:01 +00:00
|
|
|
|
{
|
2020-01-17 03:23:29 +00:00
|
|
|
|
int genesect = GetGenesectFormFromHeldItem(pkm.HeldItem);
|
|
|
|
|
return genesect != form ? GetInvalid(LFormItemInvalid) : GetValid(LFormItem);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
}
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Greninja:
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (form > 1) // Ash Battle Bond active
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LFormBattle);
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (form != 0 && !(EncounterMatch is MysteryGift)) // Formes are not breedable, MysteryGift already checked
|
|
|
|
|
return GetInvalid(string.Format(LFormInvalidRange, 0, form));
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
2018-06-30 22:01:16 +00:00
|
|
|
|
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Scatterbug:
|
|
|
|
|
case (int)Species.Spewpa:
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (form > 17) // Fancy & Pokéball
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LFormVivillonEventPre);
|
2020-10-04 21:15:13 +00:00
|
|
|
|
if (!(pkm is IRegionOrigin tr))
|
2020-07-31 18:17:31 +00:00
|
|
|
|
break;
|
2020-10-04 21:15:13 +00:00
|
|
|
|
if (!Vivillon3DS.IsPatternValid(form, (byte)tr.Country, (byte)tr.Region))
|
2018-09-01 21:11:12 +00:00
|
|
|
|
data.AddLine(Get(LFormVivillonInvalid, Severity.Fishy));
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Vivillon:
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (form > 17) // Fancy & Pokéball
|
2018-06-24 05:00:01 +00:00
|
|
|
|
{
|
|
|
|
|
if (!(EncounterMatch is MysteryGift))
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LFormVivillonInvalid);
|
|
|
|
|
return GetValid(LFormVivillon);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
}
|
2020-07-31 18:17:31 +00:00
|
|
|
|
if (!(pkm is IGeoTrack trv))
|
|
|
|
|
break;
|
2020-10-04 21:15:13 +00:00
|
|
|
|
if (!Vivillon3DS.IsPatternValid(form, (byte)trv.Country, (byte)trv.Region))
|
2018-09-01 21:11:12 +00:00
|
|
|
|
data.AddLine(Get(LFormVivillonInvalid, Severity.Fishy));
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2020-01-17 03:23:29 +00:00
|
|
|
|
case (int)Species.Floette when form == 5: // Floette Eternal Flower -- Never Released
|
2018-06-30 22:01:16 +00:00
|
|
|
|
if (!(EncounterMatch is MysteryGift))
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LFormEternalInvalid);
|
|
|
|
|
return GetValid(LFormEternal);
|
2020-01-17 03:23:29 +00:00
|
|
|
|
case (int)Species.Meowstic when form != pkm.Gender:
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LGenderInvalidNone);
|
2018-06-30 22:01:16 +00:00
|
|
|
|
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Silvally:
|
2018-06-30 22:01:16 +00:00
|
|
|
|
{
|
2020-01-17 03:23:29 +00:00
|
|
|
|
int silvally = GetSilvallyFormFromHeldItem(pkm.HeldItem);
|
|
|
|
|
return silvally != form ? GetInvalid(LFormItemInvalid) : GetValid(LFormItem);
|
2018-06-30 22:01:16 +00:00
|
|
|
|
}
|
2018-06-24 05:00:01 +00:00
|
|
|
|
|
2020-01-17 03:23:29 +00:00
|
|
|
|
case (int)Species.Lillipup when Info.EncounterMatch.EggEncounter && form == 1 && pkm.SM:
|
|
|
|
|
case (int)Species.Lycanroc when Info.EncounterMatch.EggEncounter && form == 2 && pkm.SM:
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LFormInvalidGame);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
|
2020-02-08 23:08:12 +00:00
|
|
|
|
// Toxel encounters have already been checked for the nature-specific evolution criteria.
|
|
|
|
|
case (int)Species.Toxtricity when Info.EncounterMatch.Species == (int)Species.Toxtricity:
|
|
|
|
|
{
|
|
|
|
|
// The game enforces the Nature for Toxtricity encounters too!
|
2020-12-11 04:42:30 +00:00
|
|
|
|
if (pkm.Form != EvolutionMethod.GetAmpLowKeyResult(pkm.Nature))
|
2020-02-08 23:08:12 +00:00
|
|
|
|
return GetInvalid(LFormInvalidNature);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-24 05:00:01 +00:00
|
|
|
|
// Impossible Egg forms
|
2020-01-17 03:23:29 +00:00
|
|
|
|
case (int)Species.Rotom when pkm.IsEgg && form != 0:
|
|
|
|
|
case (int)Species.Furfrou when pkm.IsEgg && form != 0:
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LEggSpecies);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
|
|
|
|
|
// Party Only Forms
|
2019-06-01 17:22:49 +00:00
|
|
|
|
case (int)Species.Shaymin:
|
|
|
|
|
case (int)Species.Furfrou:
|
|
|
|
|
case (int)Species.Hoopa:
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (form != 0 && pkm.Box > -1 && pkm.Format <= 6) // has form but stored in box
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LFormParty);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-25 16:15:16 +00:00
|
|
|
|
var format = pkm.Format;
|
2020-12-11 04:42:30 +00:00
|
|
|
|
if (FormInfo.IsBattleOnlyForm(species, form, format))
|
2020-10-25 16:15:16 +00:00
|
|
|
|
return GetInvalid(LFormBattle);
|
|
|
|
|
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (form == 0)
|
|
|
|
|
return VALID;
|
|
|
|
|
|
2020-12-11 04:42:30 +00:00
|
|
|
|
// everything below here is not Form 0, so it has a form.
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (format >= 7 && Info.Generation < 7)
|
2018-06-24 05:00:01 +00:00
|
|
|
|
{
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (species == 25 || Legal.AlolanOriginForms.Contains(species) || Legal.AlolanVariantEvolutions12.Contains(data.EncounterOriginal.Species))
|
2018-09-01 21:11:12 +00:00
|
|
|
|
return GetInvalid(LFormInvalidGame);
|
2018-06-24 05:00:01 +00:00
|
|
|
|
}
|
2020-01-17 03:23:29 +00:00
|
|
|
|
if (format >= 8 && Info.Generation < 8)
|
2019-09-23 23:56:47 +00:00
|
|
|
|
{
|
2020-02-14 04:00:41 +00:00
|
|
|
|
var orig = data.EncounterOriginal.Species;
|
|
|
|
|
if (Legal.GalarOriginForms.Contains(species) || Legal.GalarVariantFormEvolutions.Contains(orig))
|
2020-02-14 01:05:06 +00:00
|
|
|
|
{
|
|
|
|
|
if (species == (int)Species.Meowth && data.EncounterOriginal.Form != 2)
|
|
|
|
|
{
|
|
|
|
|
// We're okay here. There's also Alolan Meowth...
|
|
|
|
|
}
|
2020-02-14 04:00:41 +00:00
|
|
|
|
else if ((orig == (int) Species.MrMime || orig == (int)Species.MimeJr) && pkm.CurrentLevel > data.EncounterOriginal.LevelMin && Info.Generation >= 4)
|
|
|
|
|
{
|
|
|
|
|
// We're okay with a Mime Jr. that has evolved via level up.
|
|
|
|
|
}
|
2020-11-12 05:03:47 +00:00
|
|
|
|
else if (EncounterMatch.Version != GameVersion.GO)
|
2020-02-14 01:05:06 +00:00
|
|
|
|
{
|
|
|
|
|
return GetInvalid(LFormInvalidGame);
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-23 23:56:47 +00:00
|
|
|
|
}
|
2018-06-24 05:00:01 +00:00
|
|
|
|
|
2018-06-30 22:01:16 +00:00
|
|
|
|
return VALID;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-02 21:11:51 +00:00
|
|
|
|
private static readonly ushort[] Arceus_PlateIDs = { 303, 306, 304, 305, 309, 308, 310, 313, 298, 299, 301, 300, 307, 302, 311, 312, 644 };
|
|
|
|
|
private static readonly ushort[] Arceus_ZCrystal = { 782, 785, 783, 784, 788, 787, 789, 792, 777, 778, 780, 779, 786, 781, 790, 791, 793 };
|
|
|
|
|
|
2020-02-08 05:34:25 +00:00
|
|
|
|
public static int GetArceusFormFromHeldItem(int item, int format)
|
2018-06-30 22:01:16 +00:00
|
|
|
|
{
|
|
|
|
|
if (777 <= item && item <= 793)
|
2020-11-02 21:11:51 +00:00
|
|
|
|
return Array.IndexOf(Arceus_ZCrystal, (ushort)item) + 1;
|
2018-06-30 22:01:16 +00:00
|
|
|
|
|
|
|
|
|
int form = 0;
|
|
|
|
|
if ((298 <= item && item <= 313) || item == 644)
|
2020-11-02 21:11:51 +00:00
|
|
|
|
form = Array.IndexOf(Arceus_PlateIDs, (ushort)item) + 1;
|
2018-06-30 22:01:16 +00:00
|
|
|
|
if (format == 4 && form >= 9)
|
|
|
|
|
return form + 1; // ??? type Form shifts everything by 1
|
|
|
|
|
return form;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-08 05:34:25 +00:00
|
|
|
|
public static int GetSilvallyFormFromHeldItem(int item)
|
2018-06-30 22:01:16 +00:00
|
|
|
|
{
|
2020-03-27 19:15:22 +00:00
|
|
|
|
if (904 <= item && item <= 920)
|
2018-06-30 22:01:16 +00:00
|
|
|
|
return item - 903;
|
|
|
|
|
return 0;
|
2018-06-24 05:00:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-08 05:34:25 +00:00
|
|
|
|
public static int GetGenesectFormFromHeldItem(int item)
|
2018-06-30 22:01:16 +00:00
|
|
|
|
{
|
|
|
|
|
if (116 <= item && item <= 119)
|
|
|
|
|
return item - 115;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2018-06-24 05:00:01 +00:00
|
|
|
|
|
2019-11-19 06:48:03 +00:00
|
|
|
|
private static readonly HashSet<int> SafariFloette = new HashSet<int> { 0, 1, 3 }; // 0/1/3 - RBY
|
|
|
|
|
|
2018-06-24 05:00:01 +00:00
|
|
|
|
private void VerifyFormFriendSafari(LegalityAnalysis data)
|
|
|
|
|
{
|
|
|
|
|
var pkm = data.pkm;
|
|
|
|
|
switch (pkm.Species)
|
|
|
|
|
{
|
2020-12-11 04:42:30 +00:00
|
|
|
|
case (int)Species.Floette when !SafariFloette.Contains(pkm.Form): // Floette
|
|
|
|
|
case (int)Species.Florges when !SafariFloette.Contains(pkm.Form): // Florges
|
2018-09-01 21:11:12 +00:00
|
|
|
|
data.AddLine(GetInvalid(LFormSafariFlorgesColor));
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
2020-12-11 04:42:30 +00:00
|
|
|
|
case 710 when pkm.Form != 0: // Pumpkaboo
|
|
|
|
|
case (int)Species.Gourgeist when pkm.Form != 0: // Average
|
2018-09-01 21:11:12 +00:00
|
|
|
|
data.AddLine(GetInvalid(LFormSafariPumpkabooAverage));
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
2020-12-11 04:42:30 +00:00
|
|
|
|
case (int)Species.Gastrodon when pkm.Form != 0: // West
|
2018-09-01 21:11:12 +00:00
|
|
|
|
data.AddLine(GetInvalid(LFormSafariFlorgesColor));
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
2020-12-11 04:42:30 +00:00
|
|
|
|
case (int)Species.Sawsbuck when pkm.Form != 0: // Sawsbuck
|
2018-09-01 21:11:12 +00:00
|
|
|
|
data.AddLine(GetInvalid(LFormSafariSawsbuckSpring));
|
2018-06-24 05:00:01 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-01-11 00:33:40 +00:00
|
|
|
|
|
2020-01-13 00:49:12 +00:00
|
|
|
|
private CheckResult VerifyFormArgument(LegalityAnalysis data, in uint arg)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
{
|
|
|
|
|
var pkm = data.pkm;
|
|
|
|
|
switch (data.pkm.Species)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
{
|
2020-01-13 00:49:12 +00:00
|
|
|
|
if (arg != 0)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentNotAllowed);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case (int)Species.Furfrou:
|
|
|
|
|
{
|
2020-01-13 00:49:12 +00:00
|
|
|
|
if (arg > 5)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentHigh);
|
2020-12-11 04:42:30 +00:00
|
|
|
|
if (arg == 0 && pkm.Form != 0)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentNotAllowed);
|
2020-12-11 04:42:30 +00:00
|
|
|
|
if (arg != 0 && pkm.Form == 0)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentNotAllowed);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case (int)Species.Hoopa:
|
|
|
|
|
{
|
2020-01-13 00:49:12 +00:00
|
|
|
|
if (arg > 3)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentHigh);
|
2020-12-11 04:42:30 +00:00
|
|
|
|
if (arg == 0 && pkm.Form != 0)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentNotAllowed);
|
2020-12-11 04:42:30 +00:00
|
|
|
|
if (arg != 0 && pkm.Form == 0)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentNotAllowed);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2020-12-11 04:42:30 +00:00
|
|
|
|
case (int)Species.Yamask when pkm.Form == 1:
|
2020-01-13 00:22:56 +00:00
|
|
|
|
{
|
|
|
|
|
if (pkm.IsEgg)
|
|
|
|
|
{
|
2020-01-13 00:49:12 +00:00
|
|
|
|
if (arg != 0)
|
2020-01-13 00:22:56 +00:00
|
|
|
|
return GetInvalid(LFormArgumentNotAllowed);
|
|
|
|
|
}
|
2020-11-24 20:40:56 +00:00
|
|
|
|
if (arg > 9_999)
|
|
|
|
|
return GetInvalid(LFormArgumentHigh);
|
2020-01-13 00:22:56 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2020-01-11 00:33:40 +00:00
|
|
|
|
case (int)Species.Runerigus:
|
|
|
|
|
{
|
|
|
|
|
if (data.EncounterMatch.Species == (int)Species.Runerigus)
|
|
|
|
|
{
|
2020-01-13 00:49:12 +00:00
|
|
|
|
if (arg != 0)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentNotAllowed);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-01-13 00:49:12 +00:00
|
|
|
|
if (arg < 49)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentLow);
|
2020-11-24 20:40:56 +00:00
|
|
|
|
if (arg > 9_999)
|
|
|
|
|
return GetInvalid(LFormArgumentHigh);
|
2020-01-11 00:33:40 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case (int)Species.Alcremie:
|
|
|
|
|
{
|
|
|
|
|
if (data.EncounterMatch.Species == (int)Species.Alcremie)
|
|
|
|
|
{
|
2020-01-13 00:49:12 +00:00
|
|
|
|
if (arg != 0)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentNotAllowed);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-01-13 00:49:12 +00:00
|
|
|
|
if (arg > (uint)AlcremieDecoration.Ribbon)
|
2020-01-11 00:33:40 +00:00
|
|
|
|
return GetInvalid(LFormArgumentHigh);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return GetValid(LFormArgumentValid);
|
|
|
|
|
}
|
2018-06-24 05:00:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|