public LegalityAnalysis(PKM pk) { for (int i = 0; i < 4; i++) { vMoves[i] = new CheckResult(CheckIdentifier.Move); vRelearn[i] = new CheckResult(CheckIdentifier.RelearnMove); } try { switch (pk.GenNumber) { case 6: parsePK6(pk); break; case 7: parsePK7(pk); break; default: return; } if (pkm.Format == 7) // Temp G7 Bank Checks { verifyG7PreBank(); } Valid = Parsed = Parse.Any(); if (Parsed) { if (Parse.Any(chk => !chk.Valid)) { Valid = false; } if (vMoves.Any(m => m.Valid != true)) { Valid = false; } else if (vRelearn.Any(m => m.Valid != true)) { Valid = false; } if (pkm.FatefulEncounter && vRelearn.Any(chk => !chk.Valid) && EncounterMatch == null) { AddLine(Severity.Indeterminate, "Fateful Encounter with no matching Encounter. Has the Mystery Gift data been contributed?", CheckIdentifier.Fateful); } } } catch { Valid = false; } getLegalityReport(); AllSuggestedMoves = !pkm.IsOriginValid() ? new int[4] : getSuggestedMoves(true, true, true); AllSuggestedRelearnMoves = !pkm.IsOriginValid() ? new int[4] : Legal.getValidRelearn(pkm, -1).ToArray(); AllSuggestedMovesAndRelearn = AllSuggestedMoves.Concat(AllSuggestedRelearnMoves).ToArray(); }
private void parsePK6(PKM pk) { pkm = pk; if (!pkm.IsOriginValid()) { AddLine(Severity.Invalid, "Species does not exist in origin game.", CheckIdentifier.None); return; } updateRelearnLegality(); updateEncounterChain(); updateMoveLegality(); updateChecks(); }
private void parsePK6(PKM pk) { pkm = pk; if (!pkm.IsOriginValid()) { AddLine(Severity.Invalid, "Species does not exist in origin game.", CheckIdentifier.None); return; } updateRelearnLegality(); updateEncounterChain(); updateMoveLegality(); updateChecks(); }