private static CheckResult VerifyWildEncounterCrystalHeadbutt(PKM pkm, EncounterSlot1 encounter) { var Area = Legal.GetCrystalTreeArea(encounter); if (Area == null) // Failsafe, every area with headbutt encounters have a tree area { return(new CheckResult(Severity.Invalid, V605, CheckIdentifier.Encounter)); } var trainerpivot = pkm.TID % 10; var availabletree = encounter.Type == SlotType.Headbutt ? Area.TrainerModerateEncounterTree[trainerpivot] : Area.TrainerLowEncounterTree[trainerpivot]; switch (availabletree) { case TreeEncounterAvailable.ValidTree: return(new CheckResult(Severity.Valid, V604, CheckIdentifier.Encounter)); case TreeEncounterAvailable.InvalidTree: return(new CheckResult(Severity.Invalid, V604, CheckIdentifier.Encounter)); default: //reeEncounterAvailable.Impossible return(new CheckResult(Severity.Invalid, V605, CheckIdentifier.Encounter)); } }
private static CheckResult VerifyWildEncounterCrystalHeadbutt(PKM pkm, EncounterSlot1 encounter) { var Area = Legal.GetCrystalTreeArea(encounter); if (Area == null) // Failsafe, every area with headbutt encounters has a tree area { return(new CheckResult(Severity.Invalid, V605, CheckIdentifier.Encounter)); } var table = Area.GetTrees(encounter.Type); var trainerpivot = pkm.TID % 10; switch (table[trainerpivot]) { case TreeEncounterAvailable.ValidTree: return(new CheckResult(Severity.Valid, V604, CheckIdentifier.Encounter)); case TreeEncounterAvailable.InvalidTree: return(new CheckResult(Severity.Invalid, V605, CheckIdentifier.Encounter)); default: // Impossible return(new CheckResult(Severity.Invalid, V606, CheckIdentifier.Encounter)); } }