Skip to content

Commit

Permalink
Probably cursed but multi game master vent support
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Nov 5, 2023
1 parent 3b503b7 commit e37380f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@

// from /proc/update_living_queens() : /mob/living/carbon/xenomorph/queen
#define COMSIG_HIVE_NEW_QUEEN "hive_new_queen"

/// From /datum/game_master_submenu/vents/proc/setup_ambush()
#define COMSIG_GAME_MASTER_AMBUSH_SET "game_master_ambush_set"
19 changes: 18 additions & 1 deletion code/modules/admin/game_master/game_master_submenu/vents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
/// Are we currently ambushing?
var/ambushing = FALSE

/// Are we the primary spawner for all menus looking at this vent?
var/primary = FALSE

/datum/game_master_submenu/vents/New(client/using_client)
. = ..()
current_ambush = list()
Expand All @@ -36,6 +39,8 @@
for(var/turf/cycled_turf as anything in ambush_turfs)
RegisterSignal(cycled_turf, COMSIG_TURF_ENTERED, PROC_REF(ambush_turf_movement))

RegisterSignal(referenced_atom, COMSIG_GAME_MASTER_AMBUSH_SET, PROC_REF(other_ambush_set))

/datum/game_master_submenu/vents/Destroy(force, ...)
. = ..()
current_ambush = null
Expand Down Expand Up @@ -94,7 +99,7 @@
/datum/game_master_submenu/vents/proc/ambush_turf_movement(turf/crossed_turf, atom/movable/entering_movable)
SIGNAL_HANDLER

if(length(current_ambush) && !ambushing && ishuman(entering_movable))
if(length(current_ambush) && !ambushing && primary && ishuman(entering_movable))
ambushing = TRUE
handle_vent_spawn(TRUE)

Expand All @@ -110,6 +115,18 @@

ambush_info = temp_string

SEND_SIGNAL(referenced_atom, COMSIG_GAME_MASTER_AMBUSH_SET, current_ambush.Copy(), ambush_info)

primary = TRUE

/datum/game_master_submenu/vents/proc/other_ambush_set(atom/movable/other_parent, new_ambush, new_ambush_info)
SIGNAL_HANDLER

primary = FALSE

current_ambush = new_ambush
ambush_info = new_ambush_info

#define VENT_ESCAPE_INCREMENT_TIME (1 SECONDS)

/// Shakes the vent and creates timers to spawn multiple xenos in succession
Expand Down

0 comments on commit e37380f

Please sign in to comment.