diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 6e49c476ac4..0f61f0d4235 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -181,6 +181,8 @@ #define ZLEVEL_ABANDONNEDTSAT 3 #define ZLEVEL_CENTCOM 2 #define ZLEVEL_STATION 1 +#define ZLEVEL_LAVALAND 5 +#define ZLEVEL_UNDERGROUND 6 //ticker.current_state values #define GAME_STATE_STARTUP 0 diff --git a/code/modules/mining/lavaland/lavaland_areas.dm b/code/modules/mining/lavaland/lavaland_areas.dm new file mode 100644 index 00000000000..e3fa70aa43d --- /dev/null +++ b/code/modules/mining/lavaland/lavaland_areas.dm @@ -0,0 +1,28 @@ +/**********************Lavaland Areas**************************/ + +/area/lavaland + icon_state = "mining" + has_gravity = 1 + +/area/lavaland/surface + name = "Lavaland" + icon_state = "explored" + music = null + requires_power = 1 + ambientsounds = list('sound/ambience/ambimine.ogg') + +/area/lavaland/underground + name = "Lavaland Caves" + icon_state = "unexplored" + music = null + always_unpowered = 1 + requires_power = 1 + poweralm = 0 + power_environ = 0 + power_equip = 0 + power_light = 0 + ambientsounds = list('sound/ambience/ambimine.ogg') + + +/area/lavaland/surface/outdoors + name = "Lavaland Wastes" diff --git a/code/modules/mining/lavaland/weather.dm b/code/modules/mining/lavaland/weather.dm index 282f9ac8950..b65f177e802 100644 --- a/code/modules/mining/lavaland/weather.dm +++ b/code/modules/mining/lavaland/weather.dm @@ -10,6 +10,8 @@ var/global/datum/weather/activeWeather var/start_up_time = 300 //30 seconds var/start_up_message = "The wind begins to pick up." var/duration = 120 //2 minutes + var/duration_lower = 120 + var/duration_upper = 120 var/duration_message = "A storm has started!" var/wind_down = 300 // 30 seconds var/wind_down_message = "The storm is passing." @@ -22,9 +24,11 @@ var/global/datum/weather/activeWeather var/start_up_overlay = "lava" var/duration_overlay = "lava" + var/overlay_layer = 10 //This is the default area layer, and above everything else. 2 is floors/below walls and mobs. var/purely_aesthetic = FALSE //If we just want gentle rain that doesn't hurt people /datum/weather/proc/weather_start_up() + duration = rand(duration_lower,duration_upper) if(activeWeather) return activeWeather = src @@ -47,11 +51,11 @@ var/global/datum/weather/activeWeather sleep(duration*10) else //Storm effects for(var/i in 1 to duration-1) - for(var/mob/living/L in living_mob_list) . + for(var/mob/living/L in living_mob_list) var/turf/Z = get_turf(L) if(Z.weather == src) storm_act(L) - sleep(10) + sleep(10) stage = WIND_DOWN_STAGE weather_wind_down() @@ -78,19 +82,30 @@ var/global/datum/weather/activeWeather for(var/turf/T in get_area_turfs(area_type, target_z)) if(exclude_walls && T.density == 1) continue - switch(stage) - if(STARTUP_STAGE) - T.overlays += "[start_up_overlay]" - T.weather = src - if(MAIN_STAGE) - T.overlays -= "[duration_overlay]" - T.overlays += "[duration_overlay]" - T.weather = src - if(WIND_DOWN_STAGE) - T.overlays -= "[duration_overlay]" - T.overlays += "[start_up_overlay]" - T.weather = src - if(END_STAGE) - T.overlays -= start_up_overlay - T.weather = null - activeWeather = null \ No newline at end of file + if(stage == END_STAGE) + T.weather = null + else + T.weather = src + + for(var/area/N in get_areas(area_type)) + if(N.z == target_z) + N.layer = overlay_layer + N.icon = 'icons/effects/weather_effects.dmi' + N.invisibility = 0 + N.opacity = 1 + switch(stage) + if(STARTUP_STAGE) + N.icon_state = start_up_overlay + + if(MAIN_STAGE) + N.icon_state = duration_overlay + + if(WIND_DOWN_STAGE) + N.icon_state = start_up_overlay + + if(END_STAGE) + N.icon_state = initial(N.icon_state) + N.layer = 10 //Just default back to normal area stuff since I assume setting a var is faster than initial + N.invisibility = 100 + N.opacity = 0 + activeWeather = null \ No newline at end of file diff --git a/code/modules/mining/lavaland/weather_types.dm b/code/modules/mining/lavaland/weather_types.dm index 6d943ee9f58..e069271bdce 100644 --- a/code/modules/mining/lavaland/weather_types.dm +++ b/code/modules/mining/lavaland/weather_types.dm @@ -1,8 +1,11 @@ +///The floor is lava + /datum/weather/floor_is_lava name = "floor is lava" start_up_time = 30 //3 seconds start_up_message = "The ground begins to bubble." - duration = 60 //1 minute + duration_lower = 45 + duration_upper = 60 //1 minute duration_message = "The floor is lava!" wind_down = 30// 3 seconds wind_down_message = "The ground begins to cool." @@ -13,14 +16,50 @@ start_up_overlay = "lava" duration_overlay = "lava" + overlay_layer = 2 //Covers floors only /datum/weather/floor_is_lavaproc/storm_act(mob/living/L) - var/safe = 0 var/turf/F = get_turf(L) for(var/obj/structure/O in L.contents) if(O.level > F.level && !istype(O, /obj/structure/window)) // Something to stand on and it isn't under the floor! - safe = 1 - break - if(!safe) - L.adjustFireLoss(3) \ No newline at end of file + return + L.adjustFireLoss(3) + + + + +//Ash storms + +/datum/weather/ash_storm + name = "ash storm" + start_up_time = 300 //30 seconds + start_up_message = "The wind begins to pick up. Seek shelter." + duration_lower = 90 //1.5 minutes + duration_upper = 360 //3 minutes + duration_message = "An ash storm has started! Get inside!" + wind_down = 300 // 30 seconds + wind_down_message = "The storm begins to fade. Should be safe to go outside again." + + target_z = ZLEVEL_LAVALAND + area_type = /area/lavaland/surface/outdoors + + start_up_overlay = "light_ash" + duration_overlay = "ash_storm" + overlay_layer = 10 + + +/datum/weather/ash_storm/false_alarm //No storm, just light ember fall + purely_aesthetic = TRUE + duration_message = "An ash storm has started! Get inside!" + duration_overlay = "light_ash" + duration_message = "Looks like the storm just missed the mining area. False alarm." + wind_down_message = "The ash fall starts to trail off." + +/datum/weather/ash_storm/storm_act(mob/living/L) + if(ishuman(L)) + var/mob/living/carbon/human/H = L + var/thermal_protection = H.get_thermal_protection() + if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT) + return + L.adjustFireLoss(4) \ No newline at end of file diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 5958d0275ad..c8fdb135872 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -245,6 +245,7 @@ threshhold.toxins = 0 L.contents += threshhold threshhold.overlays.Cut() + threshhold.weather = null var/list/turfs = room["floors"] for(var/turf/simulated/floor/A in turfs) @@ -261,5 +262,5 @@ A.air.temperature = 293.15 SSair.add_to_active(A) A.overlays.Cut() - + A.weather = null L.contents += A diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 34803e4bff7..88a4581e713 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -106,14 +106,8 @@ if(!dna || !dna.species.handle_fire(src)) ..() if(on_fire) - var/thermal_protection = 0 //Simple check to estimate how protected we are against multiple temperatures - if(wear_suit) - if(wear_suit.max_heat_protection_temperature >= FIRE_SUIT_MAX_TEMP_PROTECT) - thermal_protection += (wear_suit.max_heat_protection_temperature*0.7) - if(head) - if(head.max_heat_protection_temperature >= FIRE_HELM_MAX_TEMP_PROTECT) - thermal_protection += (head.max_heat_protection_temperature*THERMAL_PROTECTION_HEAD) - thermal_protection = round(thermal_protection) + var/thermal_protection = get_thermal_protection() + if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT) return if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT) @@ -121,6 +115,16 @@ else bodytemperature += (BODYTEMP_HEATING_MAX + (fire_stacks * 12)) +/mob/living/carbon/human/proc/get_thermal_protection() + var/thermal_protection = 0 //Simple check to estimate how protected we are against multiple temperatures + if(wear_suit) + if(wear_suit.max_heat_protection_temperature >= FIRE_SUIT_MAX_TEMP_PROTECT) + thermal_protection += (wear_suit.max_heat_protection_temperature*0.7) + if(head) + if(head.max_heat_protection_temperature >= FIRE_HELM_MAX_TEMP_PROTECT) + thermal_protection += (head.max_heat_protection_temperature*THERMAL_PROTECTION_HEAD) + thermal_protection = round(thermal_protection) + return thermal_protection /mob/living/carbon/human/IgniteMob() if(!dna || !dna.species.IgniteMob(src)) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 8c3330b9045..193c1bb25f5 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -403,6 +403,7 @@ SSair.remove_from_active(T1) T1.CalculateAdjacentTurfs() SSair.add_to_active(T1,1) + T1.weather = null T0.ChangeTurf(turf_type) diff --git a/icons/effects/weather_effects.dmi b/icons/effects/weather_effects.dmi new file mode 100644 index 00000000000..92c50e1dea2 Binary files /dev/null and b/icons/effects/weather_effects.dmi differ diff --git a/tgstation.dme b/tgstation.dme index fef222165da..fcf424cf2ce 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1136,6 +1136,7 @@ #include "code\modules\mining\laborcamp\laborminerals.dm" #include "code\modules\mining\laborcamp\laborshuttle.dm" #include "code\modules\mining\laborcamp\laborstacker.dm" +#include "code\modules\mining\lavaland\lavaland_areas.dm" #include "code\modules\mining\lavaland\weather.dm" #include "code\modules\mining\lavaland\weather_types.dm" #include "code\modules\mob\death.dm"