diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index fa53a7c6e0d..35c450a1e47 100644 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -313,12 +313,17 @@ layer = 4 /obj/screen/parallax_layer/planet - icon_state = "planet" + icon_state = "planet_lava" blend_mode = BLEND_OVERLAY absolute = TRUE //Status of seperation speed = 3 layer = 30 +/obj/screen/parallax_layer/planet/Initialize(mapload) + . = ..() + if(SSmapping.lavaland_theme?.planet_icon_state) + icon_state = SSmapping.lavaland_theme.planet_icon_state + /obj/screen/parallax_layer/planet/update_status(mob/M) var/turf/T = get_turf(M) if(is_station_level(T.z)) diff --git a/code/controllers/subsystem/non_firing/SSmapping.dm b/code/controllers/subsystem/non_firing/SSmapping.dm index fb1c09216ec..887b0495cc6 100644 --- a/code/controllers/subsystem/non_firing/SSmapping.dm +++ b/code/controllers/subsystem/non_firing/SSmapping.dm @@ -13,7 +13,7 @@ SUBSYSTEM_DEF(mapping) ///List of areas that exist on the station this shift var/list/existing_station_areas ///What do we have as the lavaland theme today? - var/turf/simulated/floor/lavaland_theme + var/datum/lavaland_theme/lavaland_theme ///What primary cave theme we have picked for cave generation today. var/cave_theme @@ -40,8 +40,11 @@ SUBSYSTEM_DEF(mapping) F << next_map.type /datum/controller/subsystem/mapping/Initialize() - lavaland_theme = pick(/turf/simulated/floor/lava/lava_land_surface, /turf/simulated/floor/lava/lava_land_surface/plasma, /turf/simulated/floor/chasm/straight_down/lava_land_surface) + var/datum/lavaland_theme/lavaland_theme_type = pick(subtypesof(/datum/lavaland_theme)) + ASSERT(lavaland_theme_type) + lavaland_theme = new lavaland_theme_type log_startup_progress("We're in the mood for [initial(lavaland_theme.name)] today...") //We load this first. In the event some nerd ever makes a surface map, and we don't have it in lavaland in the event lavaland is disabled. + cave_theme = pick(BLOCKED_BURROWS, CLASSIC_CAVES, DEADLY_DEEPROCK) log_startup_progress("We feel like [cave_theme] today...") // Load all Z level templates @@ -71,14 +74,8 @@ SUBSYSTEM_DEF(mapping) log_startup_progress("Populating lavaland...") var/lavaland_setup_timer = start_watch() seedRuins(list(level_name_to_num(MINING)), GLOB.configuration.ruins.lavaland_ruin_budget, /area/lavaland/surface/outdoors/unexplored, GLOB.lava_ruins_templates) - switch(lavaland_theme) - if(/turf/simulated/floor/lava/lava_land_surface) - spawn_rivers(level_name_to_num(MINING)) //Default spawn, no tweaks needed - if(/turf/simulated/floor/lava/lava_land_surface/plasma) //More rivers, smaller - spawn_rivers(level_name_to_num(MINING), nodes = 2) - spawn_rivers(level_name_to_num(MINING), nodes = 2) - if(/turf/simulated/floor/chasm/straight_down/lava_land_surface) //Thiner chasms, bridges, reaches to edge of map. - spawn_rivers(level_name_to_num(MINING), nodes = 6, turf_type = /turf/simulated/floor/lava/mapping_lava, whitelist_area = /area/lavaland/surface/outdoors, min_x = 50, min_y = 7, max_x = 250, max_y = 225, prob = 10, prob_loss = 5) + if(lavaland_theme) + lavaland_theme.setup() var/time_spent = stop_watch(lavaland_setup_timer) log_startup_progress("Successfully populated lavaland in [time_spent]s.") else diff --git a/code/game/turfs/simulated/floor/lava.dm b/code/game/turfs/simulated/floor/lava.dm index bdb1c3fb873..8040ca5df38 100644 --- a/code/game/turfs/simulated/floor/lava.dm +++ b/code/game/turfs/simulated/floor/lava.dm @@ -268,6 +268,5 @@ /turf/simulated/floor/lava/mapping_lava/LateInitialize() . = ..() - ChangeTurf(SSmapping.lavaland_theme, ignore_air = TRUE) - - + if(SSmapping.lavaland_theme?.primary_turf_type) + ChangeTurf(SSmapping.lavaland_theme.primary_turf_type, ignore_air = TRUE) diff --git a/code/modules/lavaland/lavaland_theme.dm b/code/modules/lavaland/lavaland_theme.dm new file mode 100644 index 00000000000..aa602634e99 --- /dev/null +++ b/code/modules/lavaland/lavaland_theme.dm @@ -0,0 +1,56 @@ +/datum/lavaland_theme + /// Name of lavaland theme + var/name = "Not Specified" + /// Typepath of turf the `/turf/simulated/floor/lava/mapping_lava` will be changed to on Late Initialization + var/turf/simulated/floor/primary_turf_type + /// Icon state of planet present on background of station Z-level + var/planet_icon_state + +/datum/lavaland_theme/New() + if(!primary_turf_type) + stack_trace("Turf type is `null` in `[type]` lavaland theme") + else if(!ispath(primary_turf_type)) + stack_trace("Wrong turf type `[initial(primary_turf_type.type)]` in `[type]` lavaland theme") + +/** + * This proc should do all theme specific thing. + * Now it only generates rivers, but it can do all stuff you desire. + */ +/datum/lavaland_theme/proc/setup() + return + +/datum/lavaland_theme/lava + name = "lava" + primary_turf_type = /turf/simulated/floor/lava/lava_land_surface + planet_icon_state = "planet_lava" + +/datum/lavaland_theme/lava/setup() + spawn_rivers(level_name_to_num(MINING)) + +/datum/lavaland_theme/plasma + name = "plasma" + primary_turf_type = /turf/simulated/floor/lava/lava_land_surface/plasma + planet_icon_state = "planet_plasma" + +/datum/lavaland_theme/plasma/setup() + spawn_rivers(level_name_to_num(MINING), nodes = 2) + spawn_rivers(level_name_to_num(MINING), nodes = 2) + +/datum/lavaland_theme/chasm + name = "chasm" + primary_turf_type = /turf/simulated/floor/chasm/straight_down/lava_land_surface + planet_icon_state = "planet_chasm" + +/datum/lavaland_theme/chasm/setup() + spawn_rivers( + level_name_to_num(MINING), + nodes = 6, + turf_type = /turf/simulated/floor/lava/mapping_lava, + whitelist_area = /area/lavaland/surface/outdoors, + min_x = 50, + min_y = 7, + max_x = 250, + max_y = 225, + prob = 10, + prob_loss = 5 + ) diff --git a/icons/effects/parallax.dmi b/icons/effects/parallax.dmi index 6f333416a23..e484c339547 100644 Binary files a/icons/effects/parallax.dmi and b/icons/effects/parallax.dmi differ diff --git a/paradise.dme b/paradise.dme index 3b81b98ef54..ea289e831f4 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1882,6 +1882,7 @@ #include "code\modules\instruments\songs\_song_ui.dm" #include "code\modules\instruments\songs\play_legacy.dm" #include "code\modules\instruments\songs\play_synthesized.dm" +#include "code\modules\lavaland\lavaland_theme.dm" #include "code\modules\library\book.dm" #include "code\modules\library\library_admin.dm" #include "code\modules\library\library_catalog.dm"