From e784389ad23fe84efd5805d789bea52166503bfb Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Sun, 19 Jun 2016 21:29:38 -0700 Subject: [PATCH] Manually merge latest pull requests Should have forked to begin with. Thanks @chenzw95 && @Eskuero --- Legality/Checks.cs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Legality/Checks.cs b/Legality/Checks.cs index 08500ec93..4f8cd46e9 100644 --- a/Legality/Checks.cs +++ b/Legality/Checks.cs @@ -560,6 +560,8 @@ private LegalityCheck verifyBall() { if (Legal.Ban_Gen3Ball.Contains(pk6.Species)) return new LegalityCheck(Severity.Invalid, "Unobtainable capture for Gen4 Ball."); + if (pk6.AbilityNumber == 4 && 152 <= pk6.Species && pk6.Species <= 160) + return new LegalityCheck(Severity.Invalid, "Ball not possible for species with hidden ability."); return new LegalityCheck(Severity.Valid, "Obtainable capture for Gen4 Ball."); } @@ -570,7 +572,7 @@ private LegalityCheck verifyBall() private LegalityCheck verifyHistory() { if (!Encounter.Valid) - return new LegalityCheck(Severity.Valid, "Skipped Memory check due to other check being invalid."); + return new LegalityCheck(Severity.Valid, "Skipped History check due to other check being invalid."); WC6 MatchedWC6 = EncounterMatch as WC6; if (MatchedWC6?.OT.Length > 0) // Has Event OT -- null propagation yields false if MatchedWC6=null @@ -581,14 +583,6 @@ private LegalityCheck verifyHistory() return new LegalityCheck(Severity.Invalid, "Event OT Affection should be zero."); if (pk6.CurrentHandler != 1) return new LegalityCheck(Severity.Invalid, "Current handler should not be Event OT."); - if (pk6.OT_Memory != MatchedWC6.OT_Memory) - return new LegalityCheck(Severity.Invalid, "Event " + (MatchedWC6.OT_Memory == 0 ? "should not have an OT Memory" : "OT Memory should be index " + MatchedWC6.OT_Memory) + "."); - if (pk6.OT_Intensity != MatchedWC6.OT_Intensity) - return new LegalityCheck(Severity.Invalid, "Event " + (MatchedWC6.OT_Intensity == 0 ? "should not have an OT Memory Intensity value" : "OT Memory Intensity should be index " + MatchedWC6.OT_Intensity) + "."); - if (pk6.OT_TextVar != MatchedWC6.OT_TextVar) - return new LegalityCheck(Severity.Invalid, "Event " + (MatchedWC6.OT_TextVar == 0 ? "should not have an OT Memory TextVar value" : "OT Memory TextVar should be index " + MatchedWC6.OT_TextVar) + "."); - if (pk6.OT_Feeling != MatchedWC6.OT_Feeling) - return new LegalityCheck(Severity.Invalid, "Event " + (MatchedWC6.OT_Feeling == 0 ? "should not have an OT Memory Feeling value" : "OT Memory Feeling should be index " + MatchedWC6.OT_Feeling) + "."); } if (!pk6.WasEvent && !(pk6.WasLink && (EncounterMatch as EncounterLink)?.OT == false) && (pk6.HT_Name.Length == 0 || pk6.Geo1_Country == 0)) // Is not Traded { @@ -696,10 +690,15 @@ private LegalityCheck verifyOTMemory() } if (EncounterType == typeof(WC6)) { - if (pk6.OT_Memory != 0) - return new LegalityCheck(Severity.Invalid, "Event Pokémon should not have an OT memory."); - - return new LegalityCheck(Severity.Valid, "OT Memory (Event) is valid."); + WC6 MatchedWC6 = EncounterMatch as WC6; + if (pk6.OT_Memory != MatchedWC6.OT_Memory) + return new LegalityCheck(Severity.Invalid, "Event " + (MatchedWC6.OT_Memory == 0 ? "should not have an OT Memory" : "OT Memory should be index " + MatchedWC6.OT_Memory) + "."); + if (pk6.OT_Intensity != MatchedWC6.OT_Intensity) + return new LegalityCheck(Severity.Invalid, "Event " + (MatchedWC6.OT_Intensity == 0 ? "should not have an OT Memory Intensity value" : "OT Memory Intensity should be index " + MatchedWC6.OT_Intensity) + "."); + if (pk6.OT_TextVar != MatchedWC6.OT_TextVar) + return new LegalityCheck(Severity.Invalid, "Event " + (MatchedWC6.OT_TextVar == 0 ? "should not have an OT Memory TextVar value" : "OT Memory TextVar should be index " + MatchedWC6.OT_TextVar) + "."); + if (pk6.OT_Feeling != MatchedWC6.OT_Feeling) + return new LegalityCheck(Severity.Invalid, "Event " + (MatchedWC6.OT_Feeling == 0 ? "should not have an OT Memory Feeling value" : "OT Memory Feeling should be index " + MatchedWC6.OT_Feeling) + "."); } switch (pk6.OT_Memory) {