Validate Pokemon abilities in GTS and Battle Tower. (to test)

This commit is contained in:
Greg Edwards 2022-08-22 03:08:50 -04:00
parent 2ecdf25b64
commit 7709b956a4
3 changed files with 15 additions and 0 deletions

View File

@ -99,5 +99,15 @@ namespace PkmnFoundations.Pokedex
}
}
public Ability[] HiddenAbilities
{
get
{
if (HiddenAbility1 != null)
return new Ability[] { HiddenAbility1 };
else
return new Ability[] { };
}
}
}
}

View File

@ -350,6 +350,8 @@ namespace PkmnFoundations.Structures
if (thePokemon.AbilityID <= 0) return new ValidationSummary() { IsValid = false };
if (thePokemon.AbilityID > 123) return new ValidationSummary() { IsValid = false };
if (!thePokemon.Form.Abilities(Generations.Generation4).Abilities.Contains(thePokemon.Ability))
return new ValidationSummary() { IsValid = false };
foreach (MoveSlot move in thePokemon.Moves)
{

View File

@ -341,6 +341,9 @@ namespace PkmnFoundations.Structures
if (thePokemon.AbilityID <= 0) return new ValidationSummary() { IsValid = false };
if (thePokemon.AbilityID > 164) return new ValidationSummary() { IsValid = false };
if (!thePokemon.Form.Abilities(Generations.Generation4).Abilities.Contains(thePokemon.Ability) &&
!thePokemon.Form.Abilities(Generations.Generation4).HiddenAbilities.Contains(thePokemon.Ability))
return new ValidationSummary() { IsValid = false };
foreach (MoveSlot move in thePokemon.Moves)
{