From 33e55a4168622dd04c79ee62fdd5dfda49de06c4 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Sat, 2 Dec 2023 01:43:00 +0000 Subject: [PATCH] signals --- code/__DEFINES/dcs/signals/signals_global.dm | 2 ++ code/_globalvars/lists/object_lists.dm | 5 ----- code/game/machinery/doors/windowdoor.dm | 10 +++++----- code/game/objects/structures/ladders.dm | 7 ++----- code/game/objects/structures/window.dm | 13 ++++--------- code/game/turfs/walls/wall_types.dm | 7 ++----- code/modules/shuttle/dropship_hijack.dm | 15 +-------------- code/modules/shuttles/marine_ferry.dm | 14 +------------- 8 files changed, 17 insertions(+), 56 deletions(-) diff --git a/code/__DEFINES/dcs/signals/signals_global.dm b/code/__DEFINES/dcs/signals/signals_global.dm index dc5e70fcd5ec..31e4c34e3016 100644 --- a/code/__DEFINES/dcs/signals/signals_global.dm +++ b/code/__DEFINES/dcs/signals/signals_global.dm @@ -68,3 +68,5 @@ /// From /obj/structure/machinery/power/fusion_engine/proc/set_overloading() : (set_overloading) #define COMSIG_GLOB_GENERATOR_SET_OVERLOADING "!generator_set_overloading" + +#define COMSIG_GLOB_HIJACK_IMPACTED "!hijack_impacted" diff --git a/code/_globalvars/lists/object_lists.dm b/code/_globalvars/lists/object_lists.dm index 310c0ff71e45..5cfd0653c24a 100644 --- a/code/_globalvars/lists/object_lists.dm +++ b/code/_globalvars/lists/object_lists.dm @@ -23,11 +23,6 @@ GLOBAL_LIST_EMPTY_TYPED(disposal_retrieval_list, /obj/structure/disposaloutlet/r GLOBAL_LIST_EMPTY_TYPED(disposalpipe_up_list, /obj/structure/disposalpipe/up/almayer) GLOBAL_LIST_EMPTY_TYPED(disposalpipe_down_list, /obj/structure/disposalpipe/down/almayer) -GLOBAL_LIST_EMPTY_TYPED(hijack_bustable_windows, /obj/structure/window) -GLOBAL_LIST_EMPTY_TYPED(hijack_deletable_windows, /obj/structure/machinery/door/window/ultra) -GLOBAL_LIST_EMPTY_TYPED(hijack_bustable_ladders, /obj/structure/ladder/fragile_almayer) -GLOBAL_LIST_EMPTY_TYPED(hijack_bustable_hull, /turf/closed/wall/almayer/reinforced/temphull) - GLOBAL_LIST_EMPTY_TYPED(all_multi_vehicles, /obj/vehicle/multitile) GLOBAL_LIST_EMPTY_TYPED(lifeboat_almayer_docks, /obj/docking_port/stationary/lifeboat_dock) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index bd544c5c3f5a..76a370061a2f 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -295,12 +295,12 @@ /obj/structure/machinery/door/window/ultra/Initialize(mapload, ...) . = ..() - GLOB.hijack_deletable_windows += src - -/obj/structure/machinery/door/window/ultra/Destroy() - GLOB.hijack_deletable_windows -= src - return ..() + if(is_mainship_level(z)) + RegisterSignal(SSdcs, COMSIG_GLOB_HIJACK_IMPACTED, PROC_REF(impact)) // No damage taken. /obj/structure/machinery/door/window/ultra/attackby(obj/item/I, mob/user) return try_to_activate_door(user) + +/obj/structure/machinery/door/window/ultra/proc/impact() + qdel(src) diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index da6d4f1a8254..0fda8c5d9631 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -262,11 +262,8 @@ /obj/structure/ladder/fragile_almayer/Initialize() . = ..() - GLOB.hijack_bustable_ladders += src - -/obj/structure/ladder/fragile_almayer/Destroy() - GLOB.hijack_bustable_ladders -= src - return ..() + if(is_mainship_level(z)) + RegisterSignal(SSdcs, COMSIG_GLOB_HIJACK_IMPACTED, PROC_REF(deconstruct)) /obj/structure/ladder/fragile_almayer/deconstruct() new /obj/structure/prop/broken_ladder(loc) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 61552896f6f1..6ab70b8266f4 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -455,11 +455,8 @@ /obj/structure/window/reinforced/ultra/Initialize() . = ..() - GLOB.hijack_bustable_windows += src - -/obj/structure/window/reinforced/ultra/Destroy() - GLOB.hijack_bustable_windows -= src - return ..() + if(is_mainship_level(z)) + RegisterSignal(SSdcs, COMSIG_GLOB_HIJACK_IMPACTED, PROC_REF(deconstruct)) /obj/structure/window/reinforced/full flags_atom = FPRINT @@ -585,11 +582,9 @@ /obj/structure/window/framed/almayer/hull/hijack_bustable/Initialize() . = ..() - GLOB.hijack_bustable_windows += src + if(is_mainship_level(z)) + RegisterSignal(SSdcs, COMSIG_GLOB_HIJACK_IMPACTED, PROC_REF(deconstruct)) -/obj/structure/window/framed/almayer/hull/hijack_bustable/Destroy() - GLOB.hijack_bustable_windows -= src - return ..() /obj/structure/window/framed/almayer/white icon_state = "white_rwindow0" basestate = "white_rwindow" diff --git a/code/game/turfs/walls/wall_types.dm b/code/game/turfs/walls/wall_types.dm index 305f44483024..1b4363251e9b 100644 --- a/code/game/turfs/walls/wall_types.dm +++ b/code/game/turfs/walls/wall_types.dm @@ -69,11 +69,8 @@ /turf/closed/wall/almayer/reinforced/temphull/Initialize() . = ..() - GLOB.hijack_bustable_hull += src - -/turf/closed/wall/almayer/reinforced/temphull/Destroy() - GLOB.hijack_bustable_hull -= src - return ..() + if(is_mainship_level(z)) + RegisterSignal(SSdcs, COMSIG_GLOB_HIJACK_IMPACTED, PROC_REF(de_hull)) /turf/closed/wall/almayer/reinforced/temphull/proc/de_hull() hull = FALSE diff --git a/code/modules/shuttle/dropship_hijack.dm b/code/modules/shuttle/dropship_hijack.dm index 521335daf290..c87dff348b3c 100644 --- a/code/modules/shuttle/dropship_hijack.dm +++ b/code/modules/shuttle/dropship_hijack.dm @@ -50,20 +50,7 @@ // Break the ultra-reinforced windows. // Break the briefing windows. - for(var/i in GLOB.hijack_bustable_windows) - var/obj/structure/window/H = i - H.deconstruct(FALSE) - - for(var/turf/closed/wall/almayer/reinforced/temphull/hull in GLOB.hijack_bustable_hull) - hull.de_hull() - - for(var/k in GLOB.hijack_bustable_ladders) - var/obj/structure/ladder/fragile_almayer/L = k - L.deconstruct() - - // Delete the briefing door(s). - for(var/D in GLOB.hijack_deletable_windows) - qdel(D) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HIJACK_IMPACTED) // Sleep while the explosions do their job var/explosion_alive = TRUE diff --git a/code/modules/shuttles/marine_ferry.dm b/code/modules/shuttles/marine_ferry.dm index adec3a565dc9..364d74824099 100644 --- a/code/modules/shuttles/marine_ferry.dm +++ b/code/modules/shuttles/marine_ferry.dm @@ -454,20 +454,8 @@ // Break the ultra-reinforced windows. // Break the briefing windows. - for(var/i in GLOB.hijack_bustable_windows) - var/obj/structure/window/H = i - H.deconstruct(FALSE) - for(var/turf/closed/wall/almayer/reinforced/temphull/hull in GLOB.hijack_bustable_hull) - hull.de_hull() - - for(var/k in GLOB.hijack_bustable_ladders) - var/obj/structure/ladder/fragile_almayer/L = k - L.deconstruct() - - // Delete the briefing door(s). - for(var/D in GLOB.hijack_deletable_windows) - qdel(D) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HIJACK_IMPACTED) // Sleep while the explosions do their job var/explosion_alive = TRUE