diff --git a/_maps/RandomRuins/SpaceRuins/derelict9.dmm b/_maps/RandomRuins/SpaceRuins/derelict9.dmm index d32075b3a9f..2fa948a60fa 100644 --- a/_maps/RandomRuins/SpaceRuins/derelict9.dmm +++ b/_maps/RandomRuins/SpaceRuins/derelict9.dmm @@ -38,7 +38,8 @@ /turf/open/misc/asteroid/airless, /area/ruin/space) "s" = ( -/turf/closed/indestructible/explodable/riveted, +/obj/effect/mapping_helpers/bombable_wall, +/turf/closed/indestructible/riveted, /area/ruin/space/has_grav) "t" = ( /obj/effect/gibspawner/human/bodypartless, diff --git a/code/datums/elements/bombable_turf.dm b/code/datums/elements/bombable_turf.dm new file mode 100644 index 00000000000..11a83c79340 --- /dev/null +++ b/code/datums/elements/bombable_turf.dm @@ -0,0 +1,45 @@ +/** + * Apply this to a turf (usually a wall) and it will be destroyed instantly by any explosion. + * Most walls can already be destroyed by explosions so this is largely for usually indestructible ones. + * For applying it in a map editor, use /obj/effect/mapping_helpers/bombable_wall + */ +/datum/element/bombable_turf + +/datum/element/bombable_turf/Attach(turf/target) + . = ..() + if(!isturf(target)) + return ELEMENT_INCOMPATIBLE + target.explosive_resistance = 1 + + RegisterSignal(target, COMSIG_ATOM_EX_ACT, PROC_REF(detonate)) + RegisterSignal(target, COMSIG_TURF_CHANGE, PROC_REF(turf_changed)) + RegisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(on_update_overlays)) + RegisterSignal(target, COMSIG_ATOM_EXAMINE, PROC_REF(on_examined)) + + target.update_appearance(UPDATE_OVERLAYS) + +/datum/element/bombable_turf/Detach(turf/source) + UnregisterSignal(source, list(COMSIG_ATOM_EX_ACT, COMSIG_TURF_CHANGE, COMSIG_ATOM_UPDATE_OVERLAYS, COMSIG_ATOM_EXAMINE)) + source.explosive_resistance = initial(source.explosive_resistance) + source.update_appearance(UPDATE_OVERLAYS) + return ..() + +/// If we get blowed up, move to the next turf +/datum/element/bombable_turf/proc/detonate(turf/source) + SIGNAL_HANDLER + source.ScrapeAway() + +/// If this turf becomes something else we either just went off or regardless don't want this any more +/datum/element/bombable_turf/proc/turf_changed(turf/source) + SIGNAL_HANDLER + Detach(source) + +/// Show a little crack on here +/datum/element/bombable_turf/proc/on_update_overlays(turf/source, list/overlays) + SIGNAL_HANDLER + overlays += mutable_appearance('icons/turf/overlays.dmi', "explodable", source.layer + 0.1) + +/// Show a little extra on examine +/datum/element/bombable_turf/proc/on_examined(turf/source, mob/user, list/examine_list) + SIGNAL_HANDLER + examine_list += span_notice("It seems to be slightly cracked...") diff --git a/code/game/turfs/closed/explodable.dm b/code/game/turfs/closed/explodable.dm deleted file mode 100644 index 223ff9bce91..00000000000 --- a/code/game/turfs/closed/explodable.dm +++ /dev/null @@ -1,22 +0,0 @@ -/turf/closed/indestructible/explodable // Child of indestructible as we want to be indestructible to anything that isn't explosions - name = "wall" - desc = "Effectively impervious to most conventional methods of destruction. It looks like an explosion might knock it down." - icon = 'icons/turf/walls.dmi' - baseturfs = /turf/open/floor/plating - explosive_resistance = 1 - -/turf/closed/indestructible/explodable/ex_act(severity, target) - ScrapeAway() - return TRUE - -/turf/closed/indestructible/explodable/Initialize(mapload) - . = ..() - add_overlay(mutable_appearance('icons/turf/overlays.dmi', "explodable", layer+0.1)) - -/turf/closed/indestructible/explodable/riveted - icon = 'icons/turf/walls/riveted.dmi' - icon_state = "riveted-0" - base_icon_state = "riveted" - smoothing_flags = SMOOTH_BITMASK - smoothing_groups = SMOOTH_GROUP_CLOSED_TURFS - canSmoothWith = SMOOTH_GROUP_CLOSED_TURFS diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm index d1fc4a79cf7..cec7932f4f5 100644 --- a/code/modules/mapping/mapping_helpers.dm +++ b/code/modules/mapping/mapping_helpers.dm @@ -1359,3 +1359,19 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) engraved_wall.AddComponent(/datum/component/engraved, engraving["story"], FALSE, engraving["story_value"]) qdel(src) + +/// Apply to a wall (or floor, technically) to ensure it is instantly destroyed by any explosion, even if usually invulnerable +/obj/effect/mapping_helpers/bombable_wall + name = "bombable wall helper" + icon = 'icons/turf/overlays.dmi' + icon_state = "explodable" + +/obj/effect/mapping_helpers/bombable_wall/Initialize(mapload) + . = ..() + if(!mapload) + log_mapping("[src] spawned outside of mapload!") + return + + var/turf/our_turf = get_turf(src) // In case a locker ate us or something + our_turf.AddElement(/datum/element/bombable_turf) + return INITIALIZE_HINT_QDEL diff --git a/tgstation.dme b/tgstation.dme index 9cc240da4cf..77f4c9d3f24 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1325,6 +1325,7 @@ #include "code\datums\elements\bed_tucking.dm" #include "code\datums\elements\befriend_petting.dm" #include "code\datums\elements\blocks_explosives.dm" +#include "code\datums\elements\bombable_turf.dm" #include "code\datums\elements\bonus_damage.dm" #include "code\datums\elements\bsa_blocker.dm" #include "code\datums\elements\bugkiller_reagent.dm" @@ -2525,7 +2526,6 @@ #include "code\game\turfs\change_turf.dm" #include "code\game\turfs\turf.dm" #include "code\game\turfs\closed\_closed.dm" -#include "code\game\turfs\closed\explodable.dm" #include "code\game\turfs\closed\indestructible.dm" #include "code\game\turfs\closed\minerals.dm" #include "code\game\turfs\closed\walls.dm" diff --git a/tools/UpdatePaths/Scripts/78365_explodable_walls.txt b/tools/UpdatePaths/Scripts/78365_explodable_walls.txt new file mode 100644 index 00000000000..ee7655699f1 --- /dev/null +++ b/tools/UpdatePaths/Scripts/78365_explodable_walls.txt @@ -0,0 +1 @@ +/turf/closed/indestructible/explodable/@SUBTYPES : /turf/closed/indestructible/@SUBTYPES, /obj/effect/mapping_helpers/bombable_wall