PKHeX/PKHeX.Core/Legality/Verifiers/HyperTrainingVerifier.cs
Kurt 91c37ab573 Update legality check message string style
V### names weren't enjoyable to work with; use similar verbose style as
the program message strings.

updating the translation files with the remapped variable names shortly

remap list: https://pastebin.com/jybkVDAK
2018-09-01 14:11:12 -07:00

43 lines
1.2 KiB
C#

using static PKHeX.Core.LegalityCheckStrings;
namespace PKHeX.Core
{
/// <summary>
/// Verifies the <see cref="IHyperTrain"/> values.
/// </summary>
public sealed class HyperTrainingVerifier : Verifier
{
protected override CheckIdentifier Identifier => CheckIdentifier.Training;
public override void Verify(LegalityAnalysis data)
{
var pkm = data.pkm;
if (!(pkm is IHyperTrain t))
return; // No Hyper Training before Gen7
if (!t.IsHyperTrained())
return;
if (pkm.CurrentLevel != 100)
{
data.AddLine(GetInvalid(LHyperBelow100));
return;
}
int max = pkm.MaxIV;
if (pkm.IVTotal == max * 6)
{
data.AddLine(GetInvalid(LHyperPerfectAll));
return;
}
for (int i = 0; i < 6; i++) // Check individual IVs
{
if (pkm.GetIV(i) != max || !t.IsHyperTrained(i))
continue;
data.AddLine(GetInvalid(LHyperPerfectOne));
break;
}
}
}
}