Skip to content

Commit

Permalink
add: digged basalt now refilling after ash storm (ss220-space#4782)
Browse files Browse the repository at this point in the history
* ага

* увы!

* ээээ так?

* Update asteroid.dm

* Update code/game/turfs/simulated/floor/asteroid.dm

Co-authored-by: Zwei <[email protected]>

* IfElse

---------

Co-authored-by: Zwei <[email protected]>
  • Loading branch information
NightDawnFox and Gottfrei authored Apr 13, 2024
1 parent 188a0cd commit d155e38
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
6 changes: 5 additions & 1 deletion code/datums/weather/weather_types/ash_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@
update_audio()

/datum/weather/ash_storm/end()
. = ..()
for(var/turf/simulated/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
basalt.refill_dug()
update_audio()
return ..()

/datum/weather/ash_storm/proc/is_ash_immune(atom/L)
while(L && !isturf(L))
Expand Down
33 changes: 31 additions & 2 deletions code/game/turfs/simulated/floor/asteroid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,32 @@

/turf/simulated/floor/plating/asteroid/proc/getDug()
new digResult(src, 5)
icon_plating = "[environment_type]_dug"
icon_state = "[environment_type]_dug"
dug = TRUE
update_icon(UPDATE_ICON_STATE)

/turf/simulated/floor/plating/asteroid/proc/can_dig(mob/user)
if(!dug)
return TRUE
if(user)
to_chat(user, span_notice("Looks like someone has dug here already."))

///Refills the previously dug tile
/turf/simulated/floor/plating/asteroid/proc/refill_dug()
dug = FALSE
update_icon(UPDATE_ICON_STATE)

/turf/simulated/floor/plating/asteroid/update_icon_state()
if(dug)
icon_plating = "[environment_type]_dug"
icon_state = "[environment_type]_dug"
else
icon_plating = initial(icon_plating)
if(prob(floor_variance))
icon_state = "[environment_type][rand(0,12)]"
else
icon_state = initial(icon_state)


/turf/simulated/floor/plating/asteroid/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return

Expand Down Expand Up @@ -110,6 +126,9 @@
/turf/simulated/floor/plating/asteroid/welder_act(mob/user, obj/item/I)
return

/// 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/simulated/floor/plating/asteroid/basalt
name = "volcanic floor"
baseturf = /turf/simulated/floor/plating/asteroid/basalt
Expand All @@ -119,6 +138,15 @@
floor_variance = 15
digResult = /obj/item/stack/ore/glass/basalt

/turf/simulated/floor/plating/asteroid/basalt/refill_dug()
. = ..()
GLOB.dug_up_basalt -= src
set_basalt_light(src)

/turf/simulated/floor/plating/asteroid/basalt/Destroy()
GLOB.dug_up_basalt -= src
return ..()

/turf/simulated/floor/plating/asteroid/basalt/lava //lava underneath
baseturf = /turf/simulated/floor/plating/lava/smooth

Expand All @@ -142,6 +170,7 @@

/turf/simulated/floor/plating/asteroid/basalt/getDug()
set_light_on(FALSE)
GLOB.dug_up_basalt |= src
return ..()

/proc/set_basalt_light(turf/simulated/floor/B)
Expand Down

0 comments on commit d155e38

Please sign in to comment.