private LegalityCheck verifyEncounter() { if (!pk6.Gen6) { return new LegalityCheck { Judgement = Severity.NotImplemented } } ; if (pk6.WasLink) { // Should NOT be Fateful, and should be in Database return(pk6.FatefulEncounter || Legal.getLinkMoves(pk6).Length == 0 ? new LegalityCheck(Severity.Invalid, "Not a valid Link gift.") : new LegalityCheck(Severity.Valid, "Valid Link gift.")); } if (pk6.WasEvent || pk6.WasEventEgg) { return(MatchedWC6 != null // Matched in RelearnMoves check. ? new LegalityCheck(Severity.Valid, $"Matches #{MatchedWC6.CardID.ToString("0000")} ({MatchedWC6.CardTitle})") : new LegalityCheck(Severity.Invalid, "Not a valid Wonder Card gift.")); } if (pk6.WasEgg) { // Check Hatch Locations if (pk6.Met_Level != 1) { return(new LegalityCheck(Severity.Invalid, "Invalid met level, expected 1.")); } if (pk6.IsEgg) { return(pk6.Met_Location == 0 ? new LegalityCheck(Severity.Valid, "Valid un-hatched egg.") : new LegalityCheck(Severity.Invalid, "Invalid location for un-hatched egg (expected ID:0)")); } if (pk6.XY) { return(Legal.ValidMet_XY.Contains(pk6.Met_Location) ? new LegalityCheck(Severity.Valid, "Valid X/Y hatched egg.") : new LegalityCheck(Severity.Invalid, "Invalid X/Y location for hatched egg.")); } if (pk6.AO) { return(Legal.ValidMet_AO.Contains(pk6.Met_Location) ? new LegalityCheck(Severity.Valid, "Valid OR/AS hatched egg.") : new LegalityCheck(Severity.Invalid, "Invalid OR/AS location for hatched egg.")); } return(new LegalityCheck(Severity.Invalid, "Invalid location for hatched egg.")); } EncounterStatic z = Legal.getStaticEncounter(pk6); if (z != null) { return(new LegalityCheck(Severity.Valid, "Valid gift/static encounter.")); } if (Legal.getIsFossil(pk6)) { return(pk6.AbilityNumber != 4 ? new LegalityCheck(Severity.Valid, "Valid revived fossil.") : new LegalityCheck(Severity.Invalid, "Hidden ability on revived fossil.")); } int FriendSafari = Legal.getFriendSafariValid(pk6); if (FriendSafari > 0) { if (pk6.Species == 670 || pk6.Species == 671) // Floette { if (pk6.AltForm % 2 != 0) // 0/2/4 { return(new LegalityCheck(Severity.Invalid, "Friend Safari: Not valid color.")); } else if (pk6.Species == 710 || pk6.Species == 711) // Pumpkaboo { if (pk6.AltForm != 1) // Average { return(new LegalityCheck(Severity.Invalid, "Friend Safari: Not average sized.")); } else if (pk6.Species == 586) // Sawsbuck { if (pk6.AltForm != 0) { return(new LegalityCheck(Severity.Invalid, "Friend Safari: Not Spring form.")); } } } } return(new LegalityCheck(Severity.Valid, "Valid friend safari encounter.")); } if (Legal.getDexNavValid(pk6)) { return(new LegalityCheck(Severity.Valid, "Valid (DexNav) encounter at location.")); } if (Legal.getWildEncounterValid(pk6)) { return(pk6.AbilityNumber != 4 ? new LegalityCheck(Severity.Valid, "Valid encounter at location.") : new LegalityCheck(Severity.Invalid, "Hidden ability on valid encounter.")); } EncounterTrade t = Legal.getIngameTrade(pk6); if (t != null) { EncounterMatch = t; // Check in individual methods return(new LegalityCheck(Severity.Valid, "Valid ingame trade.")); } return(new LegalityCheck(Severity.Invalid, "Not a valid encounter.")); }