Skip to content

Commit

Permalink
pushes check_enemies back to parent of events so that we can have cer…
Browse files Browse the repository at this point in the history
…tain events check for roles before triggering
  • Loading branch information
dwasint committed Oct 22, 2023
1 parent 970b855 commit 2c898df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions code/modules/events/_event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
if(checks_antag_cap)
if(!roundstart && !SSgamemode.can_inject_antags())
return FALSE
if(!check_enemies())
return FALSE
//monkestation edit end - STORYTELLERS

var/datum/game_mode/dynamic/dynamic = SSticker.mode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/datum/round_event_control
///do we check against the antag cap before attempting a spawn?
var/checks_antag_cap = FALSE
/// List of enemy roles, will check if x amount of these exist exist
var/list/enemy_roles
///required number of enemies in roles to exist
var/required_enemies = 0

/datum/round_event_control/proc/return_failure_string(players_amt)
var/string
Expand Down Expand Up @@ -66,10 +70,6 @@
var/list/protected_roles
/// Restricted roles from the antag roll
var/list/restricted_roles
/// List of enemy roles, will check if x amount of these exist exist
var/list/enemy_roles
///required number of enemies in roles to exist
var/required_enemies = 0

/datum/round_event_control/antagonist/proc/check_required()
if(!length(exclusive_roles))
Expand All @@ -83,7 +83,7 @@
/datum/round_event_control/antagonist/proc/trim_candidates(list/candidates)
return candidates

/datum/round_event_control/antagonist/proc/check_enemies()
/datum/round_event_control/proc/check_enemies()
if(!length(enemy_roles))
return TRUE
var/job_check = 0
Expand Down

0 comments on commit 2c898df

Please sign in to comment.