Fix misc legality issues

Closes #1273
not noted anywhere was encounterstatic pikachu on gen6 (pokewalker->6)
would get flagged.
This commit is contained in:
Kurt 2017-06-24 17:24:32 -07:00
parent ac16492daa
commit 4b1e91677e
3 changed files with 5 additions and 5 deletions

View File

@ -345,7 +345,7 @@ private void VerifyEVs()
if (evs.Any(ev => ev > 100)) // EVs can only be increased by vitamins to a max of 100.
AddLine(Severity.Invalid, V367, CheckIdentifier.EVs);
}
else if (pkm.Format < 6)
else if (pkm.Format < 5)
{
var maxEV = pkm.Format <= 2 ? 25600 : 100; // Vitamin Max
// Cannot EV train above 100 without increasing EXP
@ -2008,13 +2008,13 @@ private void VerifyForm()
switch (pkm.Species)
{
case 25: // Pikachu
if (pkm.Format == 6 && pkm.AltForm != 0 ^ Type == typeof(EncounterStatic))
if (pkm.GenNumber == 6 && pkm.AltForm != 0 ^ Type == typeof(EncounterStatic))
{
string msg = Type == typeof(EncounterStatic) ? V305 : V306;
AddLine(Severity.Invalid, msg, CheckIdentifier.Form);
return;
}
if (pkm.Format == 7 && pkm.AltForm != 0 ^ Type == typeof(MysteryGift))
if (pkm.GenNumber == 7 && pkm.AltForm != 0 ^ Type == typeof(MysteryGift))
{
if (EncounterMatch is WC7 gift && gift.Form != pkm.AltForm)
{

View File

@ -355,7 +355,7 @@ public int OppositeFriendship
}
public override int SuperTrainingMedalCount(int maxCount = 30)
{
uint value = BitConverter.ToUInt16(Data, 0x2C);
uint value = BitConverter.ToUInt32(Data, 0x2C);
int TrainCount = 0;
value >>= 2;
for (int i = 0; i < maxCount; i++)

View File

@ -369,7 +369,7 @@ public int OppositeFriendship
}
public override int SuperTrainingMedalCount(int maxCount = 30)
{
uint value = BitConverter.ToUInt16(Data, 0x2C);
uint value = BitConverter.ToUInt32(Data, 0x2C);
int TrainCount = 0;
value >>= 2;
for (int i = 0; i < maxCount; i++)