Skip to content

Commit

Permalink
Blood Brother storyteller tweaks (#2559)
Browse files Browse the repository at this point in the history
* Blood Brother storyteller tweaks

* refactor to use a `extra_spawned_events` system

* Update monkestation/code/modules/storytellers/converted_events/solo/brother.dm

Co-authored-by: F-e-r-n <[email protected]>

---------

Co-authored-by: F-e-r-n <[email protected]>
  • Loading branch information
Absolucy and F-e-r-n authored Jul 21, 2024
1 parent 307e927 commit 9424d57
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@
var/antag_datum
/// Prompt players for consent to turn them into antags before doing so. Dont allow this for roundstart.
var/prompted_picking = FALSE
/// A list of extra events to force whenever this one is chosen by the storyteller.
/// Can either be normal list or a weighted list.
var/list/extra_spawned_events

/datum/round_event_control/antagonist/solo/from_ghosts/get_candidates()
var/round_started = SSticker.HasRoundStarted()
Expand Down Expand Up @@ -199,6 +202,15 @@
var/list/setup_minds = list()
/// Whether we prompt the players before picking them.
var/prompted_picking = FALSE //TODO: Implement this
/// DO NOT SET THIS MANUALLY, THIS IS INHERITED FROM THE EVENT CONTROLLER ON NEW
var/list/extra_spawned_events

/datum/round_event/antagonist/solo/New(my_processing, datum/round_event_control/event_controller)
. = ..()
if(istype(event_controller, /datum/round_event_control/antagonist/solo))
var/datum/round_event_control/antagonist/solo/antag_event_controller = event_controller
if(antag_event_controller?.extra_spawned_events)
extra_spawned_events = fill_with_ones(antag_event_controller.extra_spawned_events)

/datum/round_event/antagonist/solo/setup()
var/datum/round_event_control/antagonist/solo/cast_control = control
Expand Down Expand Up @@ -267,6 +279,18 @@
candidate.mind.restricted_roles = restricted_roles

setup = TRUE
if(LAZYLEN(extra_spawned_events))
var/event_type = pick_weight(extra_spawned_events)
if(!event_type)
return
var/datum/round_event_control/triggered_event = locate(event_type) in SSgamemode.control
addtimer(CALLBACK(triggered_event, TYPE_PROC_REF(/datum/round_event_control, run_event), FALSE, null, FALSE, "storyteller"), 1 SECONDS) // wait a second to avoid any potential omnitraitor bs

/datum/round_event/antagonist/solo/proc/spawn_extra_events()
if(!LAZYLEN(extra_spawned_events))
return
var/datum/round_event_control/event = pick_weight(extra_spawned_events)
event?.run_event(random = FALSE, event_cause = "storyteller")


/datum/round_event/antagonist/solo/ghost/setup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
JOB_SECURITY_ASSISTANT,
)
required_enemies = 1
// BBs should be less common/abundant than normal traitors, albeit not overly so.
weight = 16
weight = 12
maximum_antags = 2
denominator = 30
cost = 0.45 // so it doesn't eat up threat for a relatively low-threat antag
Expand All @@ -40,6 +39,11 @@
name = "Blood Brothers"
roundstart = TRUE
earliest_start = 0 SECONDS
extra_spawned_events = list(
/datum/round_event_control/antagonist/solo/traitor/roundstart = 12,
/datum/round_event_control/antagonist/solo/bloodsucker/roundstart = 4,
/datum/round_event_control/antagonist/solo/heretic/roundstart = 2,
)

/datum/round_event_control/antagonist/solo/brother/midround
name = "Sleeper Agents (Blood Brothers)"
Expand Down

0 comments on commit 9424d57

Please sign in to comment.