Revert "Add another vc nature checks"

This reverts commit b51bdc9230.
This commit is contained in:
Kurt 2019-05-20 17:05:53 -07:00
parent 52bfa50641
commit 9b8b8f784a
6 changed files with 4 additions and 23 deletions

View File

@ -31,38 +31,19 @@ private void VerifyTransferVCNatureEXP(LegalityAnalysis data)
var nature = Experience.GetNatureVC(pkm.EXP);
if (nature != pkm.Nature)
data.AddLine(GetInvalid(LTransferNature));
return;
}
else
if (met <= 2) // Not enough EXP to have every nature -- check for exclusions!
{
var pi = pkm.PersonalInfo;
var growth = pi.EXPGrowth;
var nature = pkm.Nature;
if (met <= 2) // Not enough EXP to have every nature -- check for exclusions!
{
bool valid = VerifyVCNature(growth, nature);
if (!valid)
data.AddLine(GetInvalid(LTransferNature));
}
var currentEXP = pkm.EXP;
var thresholdEXP = Experience.GetEXP(met, growth);
var delta = currentEXP - thresholdEXP;
if (delta < 25 && !VerifyVCNature(currentEXP, thresholdEXP, nature)) // check for precise match with current level thresholds
bool valid = VerifyVCNature(growth, nature);
if (!valid)
data.AddLine(GetInvalid(LTransferNature));
}
}
private static bool VerifyVCNature(uint currentEXP, uint thresholdEXP, int nature)
{
// exp % 25 with a limited amount of EXP does not allow for every nature
do
{
var vcnature = Experience.GetNatureVC(currentEXP);
if (vcnature == nature)
return true;
} while (currentEXP-- != thresholdEXP);
return false;
}
private static bool VerifyVCNature(int growth, int nature)
{
// exp % 25 with a limited amount of EXP does not allow for every nature