Skip to content

Commit

Permalink
signals
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Dec 2, 2023
1 parent a87a8ed commit 33e55a4
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 56 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 0 additions & 5 deletions code/_globalvars/lists/object_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 2 additions & 5 deletions code/game/objects/structures/ladders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 4 additions & 9 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 2 additions & 5 deletions code/game/turfs/walls/wall_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions code/modules/shuttle/dropship_hijack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 1 addition & 13 deletions code/modules/shuttles/marine_ferry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33e55a4

Please sign in to comment.