mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-24 23:57:12 -05:00
parent
52bfa50641
commit
9b8b8f784a
|
|
@ -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
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user