mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 13:58:33 +00:00
Add Yamask-1 max hp calc for formArg compare
Closes #2632 ty @CanoeHope
This commit is contained in:
parent
d5948b9dbe
commit
a8c28369b6
1 changed files with 27 additions and 1 deletions
|
@ -285,6 +285,20 @@ namespace PKHeX.Core
|
||||||
return GetInvalid(LFormArgumentNotAllowed);
|
return GetInvalid(LFormArgumentNotAllowed);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case (int)Species.Yamask when pkm.AltForm == 1:
|
||||||
|
{
|
||||||
|
if (pkm.IsEgg)
|
||||||
|
{
|
||||||
|
if (f.FormArgument != 0)
|
||||||
|
return GetInvalid(LFormArgumentNotAllowed);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hp_max = GetYamask1MaxHP(pkm);
|
||||||
|
if (f.FormArgument > hp_max)
|
||||||
|
return GetInvalid(LFormArgumentHigh);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case (int)Species.Runerigus:
|
case (int)Species.Runerigus:
|
||||||
{
|
{
|
||||||
if (data.EncounterMatch.Species == (int)Species.Runerigus)
|
if (data.EncounterMatch.Species == (int)Species.Runerigus)
|
||||||
|
@ -296,7 +310,8 @@ namespace PKHeX.Core
|
||||||
{
|
{
|
||||||
if (f.FormArgument < 49)
|
if (f.FormArgument < 49)
|
||||||
return GetInvalid(LFormArgumentLow);
|
return GetInvalid(LFormArgumentLow);
|
||||||
if (f.FormArgument > 320) // calculate Yamask HP maximum? Arbitrary bound check.
|
var hp_max = GetYamask1MaxHP(pkm);
|
||||||
|
if (f.FormArgument > hp_max)
|
||||||
return GetInvalid(LFormArgumentHigh);
|
return GetInvalid(LFormArgumentHigh);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -320,5 +335,16 @@ namespace PKHeX.Core
|
||||||
|
|
||||||
return GetValid(LFormArgumentValid);
|
return GetValid(LFormArgumentValid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int GetYamask1MaxHP(PKM pkm)
|
||||||
|
{
|
||||||
|
var lvl = pkm.CurrentLevel; // assume it was evolved at the current level (no further level ups)
|
||||||
|
var iv_hp = pkm is IHyperTrain ht && ht.HT_HP ? 31 : pkm.IV_HP;
|
||||||
|
const int base_hp = 38;
|
||||||
|
const int ev_hp = 252; // account for full EVs then removed
|
||||||
|
|
||||||
|
// Manually calculate the stat of Galarian Yamask under the most favorable conditions
|
||||||
|
return ((iv_hp + (2 * base_hp) + (ev_hp / 4) + 100) * lvl / 100) + 10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue