private static bool IsPermittedWeather(byte locID, SWSHEncounterType weather, byte slotType) { // Only keep fishing slots for any encounters that are FishingOnly. if (slotType == (byte)OnlyFishing) { return(weather == SWSHEncounterType.Fishing); } // Otherwise, keep all fishing and shaking tree encounters. if (weather is SWSHEncounterType.Shaking_Trees or SWSHEncounterType.Fishing) { return(true); } // If we didn't find the weather in the general table, only allow Normal. if (!WeatherbyArea.TryGetValue(locID, out var permit)) { permit = SWSHEncounterType.Normal; } if (permit.HasFlag(weather)) { return(true); } // Check bleed conditions otherwise. return(IsWeatherBleedPossible((SWSHSlotType)slotType, permit, locID)); }
private static bool IsWeatherBleedPossible(SWSHSlotType type, SWSHEncounterType permit, int location) => type switch {