diff --git a/code/modules/maps/planet_types/jungle.dm b/code/modules/maps/planet_types/jungle.dm index 02ad3cbec15..b50e69d86a6 100644 --- a/code/modules/maps/planet_types/jungle.dm +++ b/code/modules/maps/planet_types/jungle.dm @@ -10,6 +10,7 @@ flora_diversity = 7 has_trees = TRUE possible_themes = list(/datum/exoplanet_theme/jungle) + initial_weather_state = /singleton/state/weather/rain/storm/jungle_planet ruin_planet_type = PLANET_GROVE ruin_allowed_tags = RUIN_LOWPOP|RUIN_SCIENCE|RUIN_HOSTILE|RUIN_WRECK|RUIN_NATURAL diff --git a/code/modules/maps/planet_types/lava.dm b/code/modules/maps/planet_types/lava.dm index 51b7cf3b5cc..fc7119cbb02 100644 --- a/code/modules/maps/planet_types/lava.dm +++ b/code/modules/maps/planet_types/lava.dm @@ -7,6 +7,7 @@ weather = "Global sub-atmospheric volcanic ambient weather system. Exercise extreme caution with unpredictable volcanic eruption" surfacewater = "Majority superheated methane, silicon and metallic substances, 7% liquid surface area." planetary_area = /area/exoplanet/lava + initial_weather_state = /singleton/state/weather/calm/lava_planet rock_colors = list(COLOR_DARK_GRAY) possible_themes = list(/datum/exoplanet_theme/volcanic) features_budget = 4 diff --git a/code/modules/maps/planet_types/lore/konyang.dm b/code/modules/maps/planet_types/lore/konyang.dm index ca68fda333e..ec90f9b2831 100644 --- a/code/modules/maps/planet_types/lore/konyang.dm +++ b/code/modules/maps/planet_types/lore/konyang.dm @@ -7,6 +7,7 @@ icon_state = "globe2" color = "#68e968" planetary_area = /area/exoplanet/grass/konyang + initial_weather_state = /singleton/state/weather/rain/storm/jungle_planet scanimage = "konyang.png" massvolume = "0.89/0.99" surfacegravity = "0.93" diff --git a/code/modules/maps/planet_types/lore/srandmarr.dm b/code/modules/maps/planet_types/lore/srandmarr.dm index 983779ebc1c..977a5e68972 100644 --- a/code/modules/maps/planet_types/lore/srandmarr.dm +++ b/code/modules/maps/planet_types/lore/srandmarr.dm @@ -128,6 +128,7 @@ icon_state = "globe2" color = "#b5dfeb" planetary_area = /area/exoplanet/adhomai + initial_weather_state = /singleton/state/weather/calm/snow_planet scanimage = "adhomai.png" massvolume = "0.86/0.98" surfacegravity = "0.80" @@ -186,6 +187,7 @@ features_budget = 1 possible_themes = list(/datum/exoplanet_theme/snow/tundra/adhomai) ruin_type_whitelist = list (/datum/map_template/ruin/exoplanet/north_pole_monolith, /datum/map_template/ruin/exoplanet/north_pole_nka_expedition, /datum/map_template/ruin/exoplanet/north_pole_worm) + initial_weather_state = /singleton/state/weather/calm/arctic_planet desc += " The landing sites are located at the [landing_faction]'s territory." diff --git a/code/modules/maps/planet_types/snow.dm b/code/modules/maps/planet_types/snow.dm index 0f76c2924f9..922506e2a14 100644 --- a/code/modules/maps/planet_types/snow.dm +++ b/code/modules/maps/planet_types/snow.dm @@ -6,6 +6,7 @@ geology = "Non-existent tectonic activity, minimal geothermal signature" weather = "Global full-atmosphere hydrological weather system. Barely-habitable ambient low temperatures. Frequently dangerous, unpredictable meteorological upsets" surfacewater = "Majority frozen, 70% surface water" + initial_weather_state = /singleton/state/weather/calm/snow_planet planetary_area = /area/exoplanet/snow flora_diversity = 4 has_trees = TRUE diff --git a/code/modules/overmap/exoplanets/exoplanet.dm b/code/modules/overmap/exoplanets/exoplanet.dm index c5bee382626..96696b091c1 100644 --- a/code/modules/overmap/exoplanets/exoplanet.dm +++ b/code/modules/overmap/exoplanets/exoplanet.dm @@ -539,16 +539,14 @@ /obj/effect/landmark/exoplanet_spawn/proc/do_spawn(obj/effect/overmap/visitable/sector/exoplanet/planet) return -///Resets the given weather state to our planet replacing the old one, and trigger updates. Can be a type path or instance. -/obj/effect/overmap/visitable/sector/exoplanet/proc/reset_weather(var/singleton/state/weather/W) +///Sets the given weather state to our planet replacing the old one, and trigger updates. Can be a type path or instance. +/obj/effect/overmap/visitable/sector/exoplanet/proc/set_weather(var/singleton/state/weather/W) initial_weather_state = W - if(!(z in map_z)) - return //It's entire possible the levels weren't initialized yet, so don't bother. //Tells all our levels exposed to the sky to force change the weather. - SSweather.setup_weather_system(z, initial_weather_state) + SSweather.setup_weather_system(map_z[length(map_z)], initial_weather_state) ///Setup the initial weather state for the planet. Doesn't apply it to our z levels however. /obj/effect/overmap/visitable/sector/exoplanet/proc/generate_weather() if(ispath(initial_weather_state)) initial_weather_state = GET_SINGLETON(initial_weather_state) - reset_weather(initial_weather_state) + set_weather(initial_weather_state) diff --git a/code/modules/weather/weather_fsm_state_transitions.dm b/code/modules/weather/weather_fsm_state_transitions.dm index 14ac0ad8b15..08a82d192e6 100644 --- a/code/modules/weather/weather_fsm_state_transitions.dm +++ b/code/modules/weather/weather_fsm_state_transitions.dm @@ -29,3 +29,46 @@ /singleton/state_transition/weather/hail target = /singleton/state/weather/rain/hail likelihood_weighting = 20 + +//weather for planets + +//snow planets + +/singleton/state_transition/weather/calm/snow_planet + target = /singleton/state/weather/calm/snow_planet + +/singleton/state_transition/weather/snow/snow_planet + target = /singleton/state/weather/snow/snow_planet + +/singleton/state_transition/weather/snow_medium/snow_planet + target = /singleton/state/weather/snow/medium/snow_planet + +/singleton/state_transition/weather/snow_heavy/snow_planet + target = /singleton/state/weather/snow/heavy/snow_planet + +//jungle planets planets + +/singleton/state_transition/weather/calm/jungle_planet + target = /singleton/state/weather/calm/jungle_planet + +/singleton/state_transition/weather/rain/jungle_planet + target = /singleton/state/weather/rain/jungle_planet + +/singleton/state_transition/weather/storm/jungle_planet + target = /singleton/state/weather/rain/storm/jungle_planet + +//lava planets + +/singleton/state_transition/weather/calm/lava_planet + target = /singleton/state/weather/calm/lava_planet + +/singleton/state_transition/weather/ash/lava_planet + target = /singleton/state/weather/ash/lava_planet + +//arctic planets + +/singleton/state_transition/weather/calm/arctic_planet + target = /singleton/state/weather/calm/lava_planet + +/singleton/state_transition/weather/hail/arctic_planet + target = /singleton/state/weather/rain/hail/arctic_planet diff --git a/code/modules/weather/weather_fsm_states.dm b/code/modules/weather/weather_fsm_states.dm index 2ee5ffc177f..d6dcbe98ed6 100644 --- a/code/modules/weather/weather_fsm_states.dm +++ b/code/modules/weather/weather_fsm_states.dm @@ -189,3 +189,56 @@ descriptor = "A rain of ash falls from the sky." cosmetic_span_class = "warning" cosmetic_messages = list("Drifts of ash fall from the sky.") + + +//planet weathers + +//snow planet - only snow or calm + +/singleton/state/weather/calm/snow_planet + transitions = list(/singleton/state_transition/weather/snow/snow_planet) + +/singleton/state/weather/snow/snow_planet + transitions = list( + /singleton/state_transition/weather/calm/snow_planet, + /singleton/state_transition/weather/snow_medium/snow_planet + ) + +/singleton/state/weather/snow/medium/snow_planet + transitions = list( + /singleton/state_transition/weather/snow/snow_planet, + /singleton/state_transition/weather/snow_heavy/snow_planet + ) + +/singleton/state/weather/snow/heavy/snow_planet + transitions = list(/singleton/state_transition/weather/snow_medium/snow_planet) + +//jungle planets - only calm or rain + +/singleton/state/weather/calm/jungle_planet + transitions = list(/singleton/state_transition/weather/rain/jungle_planet) + +/singleton/state/weather/rain/jungle_planet + transitions = list( + /singleton/state_transition/weather/calm/jungle_planet, + /singleton/state_transition/weather/storm/jungle_planet + ) + +/singleton/state/weather/rain/storm/jungle_planet + transitions = list(/singleton/state_transition/weather/rain/jungle_planet) + +//lava planets - only calm or ash + +/singleton/state/weather/calm/lava_planet + transitions = list(/singleton/state_transition/weather/ash/lava_planet) + +/singleton/state/weather/ash/lava_planet + transitions = list(/singleton/state_transition/weather/calm/lava_planet) + +//arctic planet - only calm or hail + +/singleton/state/weather/calm/arctic_planet + transitions = list(/singleton/state_transition/weather/hail/arctic_planet) + +/singleton/state/weather/rain/hail/arctic_planet + transitions = list(/singleton/state_transition/weather/calm/arctic_planet) diff --git a/html/changelogs/alberyk-weather.yml b/html/changelogs/alberyk-weather.yml new file mode 100644 index 00000000000..460474dc3df --- /dev/null +++ b/html/changelogs/alberyk-weather.yml @@ -0,0 +1,6 @@ +author: Alberyk + +delete-after: True + +changes: + - rscadd: "Added weather to jungle, lava, snow, and some lore planets."