Ports the weather system from Nebula. (#18706)

* part 1

* compiles?

* IT WORKS

* vis contents

* fixes

* umbrelloid

* umbrella 2

* dsasdd

* stuff

* lmao

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2024-03-24 14:05:00 +00:00
committed by GitHub
co-authored by Matt Atlas
parent 82beece3db
commit 57067892d8
73 changed files with 1368 additions and 31 deletions
@@ -3,6 +3,7 @@
ambience = list('sound/effects/wind/wind_2_1.ogg','sound/effects/wind/wind_2_2.ogg','sound/effects/wind/wind_3_1.ogg','sound/effects/wind/wind_4_1.ogg','sound/effects/wind/wind_4_2.ogg','sound/effects/wind/wind_5_1.ogg')
always_unpowered = 1
area_flags = AREA_FLAG_INDESTRUCTIBLE_TURFS
is_outside = OUTSIDE_YES
/area/exoplanet/adhomai
name = "Adhomian Wilderness"
@@ -4,6 +4,8 @@
anchored = TRUE
density = TRUE
var/cutting
/// Whether or not you can shelter under this.
var/protects_against_weather = FALSE
/obj/structure/flora/proc/dig_up(mob/user)
user.visible_message(SPAN_NOTICE("\The [user] begins digging up \the [src]..."))
@@ -4,6 +4,7 @@
density = TRUE
layer = 9
pixel_x = -16
protects_against_weather = TRUE
var/max_chop_health = 180
var/chop_health = 180 //15 hits with steel hatchet, 5 with wielded fireaxe
var/fall_force = 60
@@ -54,6 +54,9 @@
var/list/possible_themes = list(/datum/exoplanet_theme)
var/datum/exoplanet_theme/theme
///What weather state to use for this planet initially. If null, will not initialize any weather system. Must be a typepath rather than an instance.
var/singleton/state/weather/initial_weather_state = /singleton/state/weather/calm
var/features_budget = 4
var/list/possible_features = list()
var/list/spawned_features
@@ -197,6 +200,8 @@
/obj/effect/overmap/visitable/sector/exoplanet/proc/build_level()
generate_habitability()
generate_atmosphere()
if(ispath(initial_weather_state))
generate_weather()
generate_flora()
generate_map()
generate_features()
@@ -533,3 +538,17 @@
/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)
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)
///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)