From f2dca7d7574bf76bf27f6219970b208d7516f807 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 23 Nov 2021 14:56:18 +0000 Subject: [PATCH] [MIRROR] Lavaland ash storms once again replenish ash on the ground. [MDB IGNORE] (#9639) * Lavaland ash storms once again replenish ash on the ground. (#62954) * Lavaland ash storms once again replenish ash on the ground. Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- .../datums/weather/weather_types/ash_storm.dm | 11 +++++++++ .../game/turfs/open/floor/plating/asteroid.dm | 23 +++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/code/datums/weather/weather_types/ash_storm.dm b/code/datums/weather/weather_types/ash_storm.dm index 0350ed5ab29..8350e01604d 100644 --- a/code/datums/weather/weather_types/ash_storm.dm +++ b/code/datums/weather/weather_types/ash_storm.dm @@ -72,6 +72,17 @@ /datum/weather/ash_storm/weather_act(mob/living/victim) victim.adjustFireLoss(4) +/datum/weather/ash_storm/end() + . = ..() + for(var/turf/open/floor/plating/asteroid/basalt/basalt as anything in GLOB.dug_up_basalt) + if(!(basalt.loc in impacted_areas) || !(basalt.z in impacted_z_levels)) + continue + GLOB.dug_up_basalt -= basalt + basalt.dug = FALSE + basalt.icon_state = "[basalt.base_icon_state]" + if(prob(basalt.floor_variance)) + basalt.icon_state += "[rand(0,12)]" + //Emberfalls are the result of an ash storm passing by close to the playable area of lavaland. They have a 10% chance to trigger in place of an ash storm. /datum/weather/ash_storm/emberfall name = "emberfall" diff --git a/code/game/turfs/open/floor/plating/asteroid.dm b/code/game/turfs/open/floor/plating/asteroid.dm index f55b44b0a25..add00eb5212 100644 --- a/code/game/turfs/open/floor/plating/asteroid.dm +++ b/code/game/turfs/open/floor/plating/asteroid.dm @@ -20,9 +20,7 @@ /// Itemstack to drop when dug by a shovel var/obj/item/stack/digResult = /obj/item/stack/ore/glass/basalt /// Whether the turf has been dug or not - var/dug - /// Whether to change the turf's icon_state to "[base_icon_state]_dug" when its dugged up - var/postdig_icon_change = TRUE + var/dug = FALSE /turf/open/floor/plating/asteroid/setup_broken_states() return list("asteroid_dug") @@ -38,8 +36,7 @@ /turf/open/floor/plating/asteroid/proc/getDug() dug = TRUE new digResult(src, 5) - if(postdig_icon_change) - icon_state = "[base_icon_state]_dug" + icon_state = "[base_icon_state]_dug" /// If the user can dig the turf /turf/open/floor/plating/asteroid/proc/can_dig(mob/user) @@ -93,6 +90,9 @@ /turf/open/floor/plating/lavaland_baseturf baseturfs = /turf/open/floor/plating/asteroid/basalt/lava_land_surface +/// Used by ashstorms to replenish basalt tiles that have been dug up without going through all of them. +GLOBAL_LIST_EMPTY(dug_up_basalt) + /turf/open/floor/plating/asteroid/basalt name = "volcanic floor" baseturfs = /turf/open/floor/plating/asteroid/basalt @@ -102,6 +102,15 @@ floor_variance = 15 digResult = /obj/item/stack/ore/glass/basalt +/turf/open/floor/plating/asteroid/basalt/getDug() + set_light(0) + GLOB.dug_up_basalt |= src + return ..() + +/turf/open/floor/plating/asteroid/basalt/Destroy() + GLOB.dug_up_basalt -= src + return ..() + /turf/open/floor/plating/asteroid/basalt/setup_broken_states() return list("basalt_dug") @@ -115,10 +124,6 @@ . = ..() set_basalt_light(src) -/turf/open/floor/plating/asteroid/getDug() - set_light(0) - return ..() - /proc/set_basalt_light(turf/open/floor/B) switch(B.icon_state) if("basalt1", "basalt2", "basalt3")