Misc pika line fixes

Closes #1213
add default cosplay form at end, add range checks
prevent cosplay/spiky eared pichu from transferring up generations
set pkm to legal info on error (checking legality no longer continues
exceptions).
This commit is contained in:
Kurt 2017-06-09 21:43:46 -07:00
parent 6ca2cb16dc
commit 1e9f5261b7
4 changed files with 17 additions and 2 deletions

View file

@ -95,6 +95,7 @@ namespace PKHeX.Core
Console.WriteLine(e.Message); Console.WriteLine(e.Message);
Valid = false; Valid = false;
AddLine(Severity.Invalid, V190, CheckIdentifier.Misc); AddLine(Severity.Invalid, V190, CheckIdentifier.Misc);
pkm = pk;
Error = true; Error = true;
} }
Parsed = true; Parsed = true;

View file

@ -2484,7 +2484,11 @@ namespace PKHeX.Core
r.Add(547); // Relic Song r.Add(547); // Relic Song
if (species == 25 && pkm.Format == 6 && Generation == 6) // Pikachu if (species == 25 && pkm.Format == 6 && Generation == 6) // Pikachu
r.Add(PikachuMoves[pkm.AltForm]); {
int index = pkm.AltForm - 1;
if (index >= 0 && index < CosplayPikachuMoves.Length)
r.Add(CosplayPikachuMoves[index]);
}
if ((species == 25 || species == 26) && Generation == 7) // Pikachu/Raichu Tutor if ((species == 25 || species == 26) && Generation == 7) // Pikachu/Raichu Tutor
r.Add(344); // Volt Tackle r.Add(344); // Volt Tackle

View file

@ -264,7 +264,7 @@ namespace PKHeX.Core
082, 303, 597, 205, 227, 375, 600, 437, 530, 707, 082, 303, 597, 205, 227, 375, 600, 437, 530, 707,
098, 224, 400, 515, 008, 130, 195, 419, 061, 184, 657 098, 224, 400, 515, 008, 130, 195, 419, 061, 184, 657
}; };
internal static readonly int[] PikachuMoves = { 0, 309, 556, 577, 604, 560 }; internal static readonly int[] CosplayPikachuMoves = { 309, 556, 577, 604, 560, 0 };
internal static readonly int[] WildPokeballs6 = { 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; internal static readonly int[] WildPokeballs6 = { 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
internal static readonly string[][] TradeXY = internal static readonly string[][] TradeXY =
{ {

View file

@ -267,6 +267,11 @@ namespace PKHeX.Core
pkm = ((PK4)pkm).convertToBK4(); pkm = ((PK4)pkm).convertToBK4();
break; break;
} }
if (pkm.Species == 172 && pkm.AltForm != 0)
{
comment = "Cannot transfer Spiky-Eared Pichu forward.";
return null;
}
pkm = ((PK4)pkm).convertToPK5(); pkm = ((PK4)pkm).convertToPK5();
if (toFormat == 5) if (toFormat == 5)
break; break;
@ -277,6 +282,11 @@ namespace PKHeX.Core
break; break;
goto case nameof(PK6); goto case nameof(PK6);
case nameof(PK6): case nameof(PK6):
if (pkm.Species == 25 && pkm.AltForm != 0) // cosplay pikachu
{
comment = "Cannot transfer Cosplay Pikachu forward.";
return null;
}
pkm = ((PK6)pkm).convertToPK7(); pkm = ((PK6)pkm).convertToPK7();
if (toFormat == 7) if (toFormat == 7)
break; break;