mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Misc fixes
Fix volt tackle tutor for pikachu in gen6 (missing parenthesis) fix rb fishing table species list stop performing gen7 checks on pk1s add special move check (do future games have encounters with 2+ special moves)? properly handle amnesiaduck/surfchu still missing ingame trades lol
This commit is contained in:
parent
a5e09bfe31
commit
8c78afe499
5 changed files with 29 additions and 31 deletions
|
@ -43,6 +43,8 @@ namespace PKHeX.Core
|
|||
{
|
||||
case 1: parsePK1(pk); break;
|
||||
}
|
||||
|
||||
if (!Parse.Any())
|
||||
switch (pk.GenNumber)
|
||||
{
|
||||
case 6: parsePK6(pk); break;
|
||||
|
@ -249,7 +251,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
if (pkm == null || !pkm.IsOriginValid())
|
||||
return null;
|
||||
if (pkm.GenNumber < 6 && pkm.Format != 1)
|
||||
if (!Parsed)
|
||||
return new int[4];
|
||||
return Legal.getValidMoves(pkm, EvoChain, Tutor: tutor, Machine: tm, MoveReminder: reminder).Skip(1).ToArray(); // skip move 0
|
||||
}
|
||||
|
|
|
@ -414,7 +414,6 @@ namespace PKHeX.Core
|
|||
? new CheckResult(Severity.Invalid, "Invalid Link Gift: should not be Fateful Encounter.", CheckIdentifier.Encounter)
|
||||
: new CheckResult(Severity.Valid, "Valid Link gift.", CheckIdentifier.Encounter);
|
||||
}
|
||||
|
||||
private CheckResult verifyEncounterEvent()
|
||||
{
|
||||
MysteryGift MatchedGift = EncounterMatch as MysteryGift;
|
||||
|
@ -477,7 +476,6 @@ namespace PKHeX.Core
|
|||
|
||||
return new CheckResult(Severity.Valid, "Valid Friend Safari encounter.", CheckIdentifier.Encounter);
|
||||
}
|
||||
|
||||
private CheckResult verifyEncounterWild()
|
||||
{
|
||||
EncounterSlot[] enc = (EncounterSlot[])EncounterMatch;
|
||||
|
@ -508,9 +506,6 @@ namespace PKHeX.Core
|
|||
{
|
||||
var s = (EncounterStatic)EncounterMatch;
|
||||
|
||||
// Re-parse moves
|
||||
parseMoves(s.Moves);
|
||||
|
||||
// Re-parse relearn moves
|
||||
if (s.EggLocation != 60002 || vRelearn.Any(rl => !rl.Valid))
|
||||
{
|
||||
|
@ -524,21 +519,8 @@ namespace PKHeX.Core
|
|||
}
|
||||
private CheckResult verifyEncounterTrade()
|
||||
{
|
||||
var t = (EncounterTrade) EncounterMatch;
|
||||
parseMoves(t.Moves);
|
||||
return new CheckResult(Severity.Valid, "Valid ingame trade.", CheckIdentifier.Encounter);
|
||||
}
|
||||
private void parseMoves(int[] specialMoves)
|
||||
{
|
||||
if (specialMoves == null || specialMoves.Length == 0)
|
||||
return;
|
||||
|
||||
int[] moves = pkm.Moves;
|
||||
for (int i = 0; i < 4; i++)
|
||||
if (!vMoves[i].Valid && specialMoves.Contains(moves[i]))
|
||||
vMoves[i] = new CheckResult(Severity.Valid, "Special encounter move.", CheckIdentifier.Move);
|
||||
}
|
||||
|
||||
private CheckResult verifyEncounterG1()
|
||||
{
|
||||
// Since encounter matching is super weak due to limited stored data in the structure
|
||||
|
@ -556,6 +538,11 @@ namespace PKHeX.Core
|
|||
if (sm + em + tm == 3*invalid)
|
||||
return new CheckResult(Severity.Invalid, "Unknown encounter.", CheckIdentifier.Encounter);
|
||||
|
||||
if (s != null && s.Moves[0] != 0 && pkm.Moves.Contains(s.Moves[0]))
|
||||
{
|
||||
EncounterMatch = s;
|
||||
return verifyEncounterStatic();
|
||||
}
|
||||
if (em <= sm && em <= tm)
|
||||
{
|
||||
EncounterMatch = e;
|
||||
|
@ -662,6 +649,7 @@ namespace PKHeX.Core
|
|||
|
||||
return new CheckResult(CheckIdentifier.Encounter);
|
||||
}
|
||||
|
||||
private void verifyLevel()
|
||||
{
|
||||
MysteryGift MatchedGift = EncounterMatch as MysteryGift;
|
||||
|
@ -1155,7 +1143,6 @@ namespace PKHeX.Core
|
|||
? "Ball unobtainable in origin generation."
|
||||
: "No ball check satisfied, assuming illegal.", CheckIdentifier.Ball);
|
||||
}
|
||||
|
||||
private void verifyEggBallGen7()
|
||||
{
|
||||
var Lineage = Legal.getLineage(pkm).ToArray();
|
||||
|
@ -1255,6 +1242,7 @@ namespace PKHeX.Core
|
|||
? "Ball unobtainable in origin generation."
|
||||
: "No ball check satisfied, assuming illegal.", CheckIdentifier.Ball);
|
||||
}
|
||||
|
||||
private CheckResult verifyHistory()
|
||||
{
|
||||
if (!Encounter.Valid)
|
||||
|
@ -1914,8 +1902,8 @@ namespace PKHeX.Core
|
|||
int[] RelearnMoves = pkm.RelearnMoves;
|
||||
foreach (MysteryGift mg in EventGiftMatch)
|
||||
{
|
||||
int[] GiftMoves = mg.Moves;
|
||||
res = parseMoves(Moves, validMoves, RelearnMoves, validTMHM, validTutor, GiftMoves);
|
||||
int[] SpecialMoves = mg.Moves;
|
||||
res = parseMoves(Moves, validMoves, RelearnMoves, validTMHM, validTutor, SpecialMoves);
|
||||
if (res.Any(r => !r.Valid))
|
||||
continue;
|
||||
|
||||
|
@ -1927,8 +1915,12 @@ namespace PKHeX.Core
|
|||
else
|
||||
{
|
||||
int[] RelearnMoves = pkm.RelearnMoves;
|
||||
int[] GiftMoves = (EncounterMatch as MysteryGift)?.Moves ?? new int[0];
|
||||
res = parseMoves(Moves, validMoves, RelearnMoves, validTMHM, validTutor, GiftMoves);
|
||||
int[] SpecialMoves = (EncounterMatch as MysteryGift)?.Moves ??
|
||||
(EncounterMatch as EncounterStatic)?.Moves ??
|
||||
(EncounterMatch as EncounterTrade)?.Moves ??
|
||||
new int[0];
|
||||
|
||||
res = parseMoves(Moves, validMoves, RelearnMoves, validTMHM, validTutor, SpecialMoves);
|
||||
}
|
||||
if (Moves[0] == 0) // None
|
||||
res[0] = new CheckResult(Severity.Invalid, "Invalid Move.", CheckIdentifier.Move);
|
||||
|
@ -1944,7 +1936,7 @@ namespace PKHeX.Core
|
|||
|
||||
return res;
|
||||
}
|
||||
private CheckResult[] parseMoves(int[] moves, int[] learn, int[] relearn, int[] tmhm, int[] tutor, int[] giftmoves)
|
||||
private static CheckResult[] parseMoves(int[] moves, int[] learn, int[] relearn, int[] tmhm, int[] tutor, int[] special)
|
||||
{
|
||||
CheckResult[] res = new CheckResult[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
@ -1959,8 +1951,8 @@ namespace PKHeX.Core
|
|||
res[i] = new CheckResult(Severity.Valid, "TM/HM.", CheckIdentifier.Move);
|
||||
else if (tutor.Contains(moves[i]))
|
||||
res[i] = new CheckResult(Severity.Valid, "Tutor.", CheckIdentifier.Move);
|
||||
else if (giftmoves.Contains(moves[i]))
|
||||
res[i] = new CheckResult(Severity.Valid, "Mystery Gift Non-Relearn Move.", CheckIdentifier.Move);
|
||||
else if (special.Contains(moves[i]))
|
||||
res[i] = new CheckResult(Severity.Valid, "Special Non-Relearn Move.", CheckIdentifier.Move);
|
||||
else
|
||||
res[i] = new CheckResult(Severity.Invalid, "Invalid Move.", CheckIdentifier.Move);
|
||||
}
|
||||
|
|
|
@ -1005,6 +1005,9 @@ namespace PKHeX.Core
|
|||
foreach (DexLevel evo in vs)
|
||||
r.AddRange(getMoves(pkm, evo.Species, evo.Level, pkm.AltForm, moveTutor, Version, LVL, Tutor, Machine, MoveReminder));
|
||||
|
||||
if (pkm.Format <= 3)
|
||||
return r.Distinct().ToArray();
|
||||
|
||||
if (species == 479) // Rotom
|
||||
r.Add(RotomMoves[pkm.AltForm]);
|
||||
if (species == 648) // Meloetta
|
||||
|
@ -1015,7 +1018,7 @@ namespace PKHeX.Core
|
|||
|
||||
if (species == 718 && pkm.GenNumber == 7) // Zygarde
|
||||
r.AddRange(ZygardeMoves);
|
||||
if (species == 25 || species == 26 && pkm.Format == 7) // Pikachu/Raichu Tutor
|
||||
if ((species == 25 || species == 26) && pkm.Format == 7) // Pikachu/Raichu Tutor
|
||||
r.Add(344); // Volt Tackle
|
||||
|
||||
if (Relearn) r.AddRange(pkm.RelearnMoves);
|
||||
|
@ -1055,6 +1058,8 @@ namespace PKHeX.Core
|
|||
r.AddRange(TMHM_RBY.Where((t, m) => pi_rb.TMHM[m]));
|
||||
r.AddRange(TMHM_RBY.Where((t, m) => pi_y.TMHM[m]));
|
||||
}
|
||||
if (moveTutor)
|
||||
r.AddRange(getTutorMoves(pkm, species, form, specialTutors));
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
|
@ -1130,15 +1135,14 @@ namespace PKHeX.Core
|
|||
}
|
||||
private static IEnumerable<int> getTutorMoves(PKM pkm, int species, int form, bool specialTutors)
|
||||
{
|
||||
PersonalInfo info = pkm.PersonalInfo;
|
||||
List<int> moves = new List<int>();
|
||||
|
||||
if (pkm.Format < 3)
|
||||
{
|
||||
if (pkm.Species == 25 || pkm.Species == 26) // Surf Pikachu via Stadium
|
||||
moves.Add(57);
|
||||
return moves;
|
||||
}
|
||||
PersonalInfo info = pkm.PersonalInfo;
|
||||
|
||||
// Type Tutors -- Pledge moves and High BP moves switched places in G7+
|
||||
if (pkm.Format <= 6)
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace PKHeX.Core
|
|||
// new EncounterStatic { Species = 004, Level = 10, Version = GameVersion.YW }, // Charmander (Route 24)
|
||||
// new EncounterStatic { Species = 007, Level = 10, Version = GameVersion.YW }, // Squirtle (Vermillion City)
|
||||
|
||||
new EncounterStatic {Species = 054, Level = 15, Moves = new [] { 10, 133 }, Version = GameVersion.SPECIAL }, // Stadium Psyduck (Amnesia)
|
||||
new EncounterStatic { Species = 054, Level = 15, Moves = new [] { 133, 10 }, Version = GameVersion.SPECIAL }, // Stadium Psyduck (Amnesia)
|
||||
};
|
||||
internal static readonly EncounterTrade[] TradeGift_RBY =
|
||||
{
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue