[MIRROR] Non-random events now provide a cause in their deadchat broadcast [MDB IGNORE] (#20757)

* Non-random events now provide a cause in their deadchat broadcast

* Update _event.dm

* change proc

* Update _event.dm

---------

Co-authored-by: Rhials <Datguy33456@gmail.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-04-26 02:44:12 +01:00
committed by GitHub
parent f251a80a36
commit 1f56d7a7df
20 changed files with 62 additions and 75 deletions
+1 -1
View File
@@ -95,6 +95,6 @@
return
var/always_announce_chance = 100
var/no_announce_chance = 0
event.runEvent(announce_chance_override = announce_event ? always_announce_chance : no_announce_chance, admin_forced = TRUE)
event.run_event(announce_chance_override = announce_event ? always_announce_chance : no_announce_chance, admin_forced = TRUE)
message_admins("[key_name_admin(usr)] has triggered an event. ([event.name])")
log_admin("[key_name(usr)] has triggered an event. ([event.name])")
+2 -3
View File
@@ -207,12 +207,11 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
if("Make Your Own")
AdminCreateVirus(holder)
if("Random")
var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control
E = DC.runEvent()
force_event(/datum/round_event_control/disease_outbreak)
if("Choose")
var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in sort_list(typesof(/datum/disease), GLOBAL_PROC_REF(cmp_typepaths_asc))
var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control
var/datum/round_event/disease_outbreak/DO = DC.runEvent()
var/datum/round_event/disease_outbreak/DO = DC.run_event()
DO.virus_type = virus
E = DO
if("allspecies")
+16 -31
View File
@@ -1039,52 +1039,37 @@ structure_check() searches for nearby cultist structures required for the invoca
var/outcome = rand(1,100)
switch(outcome)
if(1 to 10)
var/datum/round_event_control/disease_outbreak/covid_2562_event = locate() in SSevents.control
INVOKE_ASYNC(covid_2562_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
var/datum/round_event_control/mice_migration/stuart_big_event = locate() in SSevents.control
INVOKE_ASYNC(stuart_big_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
force_event_async(/datum/round_event_control/disease_outbreak, "an apocalypse rune")
force_event_async(/datum/round_event_control/mice_migration, "an apocalypse rune")
if(11 to 20)
var/datum/round_event_control/radiation_storm/my_skin_feels_funny_event = locate() in SSevents.control
INVOKE_ASYNC(my_skin_feels_funny_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
force_event_async(/datum/round_event_control/radiation_storm, "an apocalypse rune")
if(21 to 30)
var/datum/round_event_control/brand_intelligence/product_placement_gone_rogue_event = locate() in SSevents.control
INVOKE_ASYNC(product_placement_gone_rogue_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
force_event_async(/datum/round_event_control/brand_intelligence, "an apocalypse rune")
if(31 to 40)
var/datum/round_event_control/immovable_rod/huge_rod_event = locate() in SSevents.control //you've
INVOKE_ASYNC(huge_rod_event, TYPE_PROC_REF(/datum/round_event_control, runEvent)) //got
INVOKE_ASYNC(huge_rod_event, TYPE_PROC_REF(/datum/round_event_control, runEvent)) //a
INVOKE_ASYNC(huge_rod_event, TYPE_PROC_REF(/datum/round_event_control, runEvent)) //huge...
force_event_async(/datum/round_event_control/immovable_rod, "an apocalypse rune")
force_event_async(/datum/round_event_control/immovable_rod, "an apocalypse rune")
force_event_async(/datum/round_event_control/immovable_rod, "an apocalypse rune")
if(41 to 50)
var/datum/round_event_control/meteor_wave/dinosaur_purge_event = locate() in SSevents.control
INVOKE_ASYNC(dinosaur_purge_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
force_event_async(/datum/round_event_control/meteor_wave, "an apocalypse rune")
if(51 to 60)
var/datum/round_event_control/spider_infestation/creepy_crawly_event = locate() in SSevents.control
INVOKE_ASYNC(creepy_crawly_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
force_event_async(/datum/round_event_control/spider_infestation, "an apocalypse rune")
if(61 to 70)
var/datum/round_event_control/anomaly/anomaly_flux/flux_event = locate() in SSevents.control
INVOKE_ASYNC(flux_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
var/datum/round_event_control/anomaly/anomaly_grav/grav_event = locate() in SSevents.control
INVOKE_ASYNC(grav_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
var/datum/round_event_control/anomaly/anomaly_pyro/pyro_event = locate() in SSevents.control
INVOKE_ASYNC(pyro_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
var/datum/round_event_control/anomaly/anomaly_vortex/vortex_event = locate() in SSevents.control
INVOKE_ASYNC(vortex_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
force_event_async(/datum/round_event_control/anomaly/anomaly_flux, "an apocalypse rune")
force_event_async(/datum/round_event_control/anomaly/anomaly_grav, "an apocalypse rune")
force_event_async(/datum/round_event_control/anomaly/anomaly_pyro, "an apocalypse rune")
force_event_async(/datum/round_event_control/anomaly/anomaly_vortex, "an apocalypse rune")
if(71 to 80)
var/datum/round_event_control/spacevine/ivy_event = locate() in SSevents.control
INVOKE_ASYNC(ivy_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
var/datum/round_event_control/grey_tide/grey_tide_nation_wide = locate() in SSevents.control
INVOKE_ASYNC(grey_tide_nation_wide, TYPE_PROC_REF(/datum/round_event_control, runEvent))
force_event_async(/datum/round_event_control/spacevine, "an apocalypse rune")
force_event_async(/datum/round_event_control/grey_tide, "an apocalypse rune")
if(81 to 100)
var/datum/round_event_control/portal_storm_narsie/total_not_a_xen_storm_event = locate() in SSevents.control
INVOKE_ASYNC(total_not_a_xen_storm_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
force_event_async(/datum/round_event_control/portal_storm_narsie, "an apocalypse rune")
qdel(src)
@@ -70,7 +70,7 @@
//if it's always hooked in it'll override admin choices
RegisterSignal(overflow_control, COMSIG_CREATED_ROUND_EVENT, PROC_REF(on_created_round_event))
disarm_nuke()
overflow_control.runEvent()
overflow_control.run_event(event_cause = "a beer nuke")
/// signal sent from overflow control when it fires an event
/obj/machinery/nuclearbomb/beer/proc/on_created_round_event(datum/round_event_control/source_event_control, datum/round_event/scrubber_overflow/every_vent/created_event)
@@ -11,8 +11,7 @@
/datum/traitor_objective/ultimate/space_dragon/on_objective_taken(mob/user)
. = ..()
var/datum/round_event_control/carp_migration/carp_event = locate(/datum/round_event_control/carp_migration) in SSevents.control
carp_event.runEvent()
force_event(/datum/round_event_control/carp_migration, "[handler.owner]'s final objective")
/datum/traitor_objective/ultimate/space_dragon/generate_objective(datum/mind/generating_for, list/possible_duplicates)
var/list/possible_areas = GLOB.the_station_areas.Copy()
@@ -181,7 +181,7 @@
return
var/datum/round_event_control/final_event = pick (possible_events)
final_event.runEvent()
final_event.run_event(event_cause = "a Grand Ritual Rune")
to_chat(user, span_notice("Your released magic afflicts the crew: [final_event.name]!"))
/// Applies some local side effects to the area
+5 -5
View File
@@ -103,7 +103,7 @@
triggering = TRUE
// We sleep HERE, in pre-event setup (because there's no sense doing it in runEvent() since the event is already running!) for the given amount of time to make an admin has enough time to cancel an event un-fitting of the present round.
// We sleep HERE, in pre-event setup (because there's no sense doing it in run_event() since the event is already running!) for the given amount of time to make an admin has enough time to cancel an event un-fitting of the present round.
// SKYRAT EDIT REMOVAL BEGIN - Event notification
/**
if(alert_observers)
@@ -164,7 +164,7 @@ Runs the event
* - random: shows if the event was triggered randomly, or by on purpose by an admin or an item
* - announce_chance_override: if the value is not null, overrides the announcement chance when an admin calls an event
*/
/datum/round_event_control/proc/runEvent(random = FALSE, announce_chance_override = null, admin_forced = FALSE)
/datum/round_event_control/proc/run_event(random = FALSE, announce_chance_override = null, admin_forced = FALSE, event_cause)
/*
* We clear our signals first so we dont cancel a wanted event by accident,
* the majority of time the admin will probably want to cancel a single midround spawned random events
@@ -199,7 +199,7 @@ Runs the event
log_game("[random ? "Random" : "Forced"] Event triggering: [name] ([typepath]).")
if(alert_observers)
round_event.announce_deadchat(random)
round_event.announce_deadchat(random, event_cause)
SSblackbox.record_feedback("tally", "event_ran", 1, "[round_event]")
return round_event
@@ -246,8 +246,8 @@ Runs the event
return
///Annouces the event name to deadchat, override this if what an event should show to deadchat is different to its event name.
/datum/round_event/proc/announce_deadchat(random)
deadchat_broadcast(" has just been[random ? " randomly" : ""] triggered!", "<b>[control.name]</b>", message_type=DEADCHAT_ANNOUNCEMENT) //STOP ASSUMING IT'S BADMINS!
/datum/round_event/proc/announce_deadchat(random, cause)
deadchat_broadcast(" has just been[random ? " randomly" : ""] triggered[cause ? " by [cause]" : ""]!", "<b>[control.name]</b>", message_type=DEADCHAT_ANNOUNCEMENT) //STOP ASSUMING IT'S BADMINS!
//Called when the tick is equal to the start_when variable.
//Allows you to start before announcing or vice versa.
+2 -2
View File
@@ -60,11 +60,11 @@
)
//needs to be chemid unit checked at some point
/datum/round_event/scrubber_overflow/announce_deadchat(random)
/datum/round_event/scrubber_overflow/announce_deadchat(random, cause)
if(!forced_reagent_type)
//nothing out of the ordinary, so default announcement
return ..()
deadchat_broadcast(" has just been[random ? " randomly" : ""] triggered!", "<b>Scrubber Overflow: [initial(forced_reagent_type.name)]</b>", message_type=DEADCHAT_ANNOUNCEMENT)
deadchat_broadcast(" has just been[random ? " randomly" : ""] triggered[cause ? " by [cause]" : ""]!", "<b>Scrubber Overflow: [initial(forced_reagent_type.name)]</b>", message_type=DEADCHAT_ANNOUNCEMENT)
/datum/round_event/scrubber_overflow/announce(fake)
priority_announce("The scrubbers network is experiencing a backpressure surge. Some ejection of contents may occur.", "Atmospherics alert")
@@ -168,7 +168,7 @@ GLOBAL_LIST_INIT(summoned_magic_objectives, list(
else
message_admins("Summon Ghosts was triggered!")
log_game("Summon Ghosts was triggered!")
ghost_event.runEvent()
ghost_event.run_event(event_cause = "a wizard's incantation")
else
stack_trace("Unable to run summon ghosts, due to being unable to locate the associated event.")
if(user)
+1 -4
View File
@@ -159,10 +159,7 @@
priority_announce("Warning. Tampering of meteor satellites puts the station at risk of exotic, deadly meteor collisions. Please intervene by checking your GPS devices for strange signals, and dismantling the tampered meteor shields.", "Strange Meteor Signal Warning")
if(EMAGGED_METEOR_SHIELD_THRESHOLD_FOUR)
say("Warning. Warning. Dark Matt-eor on course for station.")
var/datum/round_event_control/dark_matteor/dark_matteor_event = locate() in SSevents.control
if(!dark_matteor_event)
CRASH("meteor shields tried to spawn a dark matteor, but there was no dark matteor event in SSevents.control?")
INVOKE_ASYNC(dark_matteor_event, TYPE_PROC_REF(/datum/round_event_control, runEvent))
force_event_async(/datum/round_event_control/dark_matteor, "an array of tampered meteor satellites")
/obj/machinery/satellite/meteor_shield/proc/change_meteor_chance(mod)
// Update the weight of all meteor events
@@ -104,8 +104,7 @@
purchasable_from = ~(UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS)
/datum/uplink_item/stealthy_tools/telecomm_blackout/spawn_item(spawn_path, mob/user, datum/uplink_handler/uplink_handler, atom/movable/source)
var/datum/round_event_control/event = locate(/datum/round_event_control/communications_blackout) in SSevents.control
event.runEvent()
force_event(/datum/round_event_control/communications_blackout, "a syndicate virus")
return source //For log icon
/datum/uplink_item/stealthy_tools/blackout
@@ -120,6 +119,5 @@
purchasable_from = ~(UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS)
/datum/uplink_item/stealthy_tools/blackout/spawn_item(spawn_path, mob/user, datum/uplink_handler/uplink_handler, atom/movable/source)
var/datum/round_event_control/event = locate(/datum/round_event_control/grid_check) in SSevents.control
event.runEvent()
force_event(/datum/round_event_control/grid_check, "a syndicate virus")
return source //For log icon