Files
Bubberstation/code/modules/events/false_alarm.dm
T
8add735177 [MIRROR] Return of the scrubber overflow event [MDB IGNORE] (#15998)
* Return of the scrubber overflow event (#68378)

About The Pull Request

Brings back the scrubber overflow event, previously removed in #53549
This version has nerfed numbers because foam changes made it stupidly powerful.

Also snake_cases some event variables.
Why It's Good For The Game

More dangerous but not station-damaging events. Bonus: janitor content.
Changelog

cl
add: Re-adds the scrubber overflow event as a random event
/cl

* Return of the scrubber overflow event

* update modular and fix missing non modular edit

* update stray meteor event

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2022-09-04 19:27:59 +01:00

63 lines
1.8 KiB
Plaintext

/datum/round_event_control/falsealarm
name = "False Alarm"
typepath = /datum/round_event/falsealarm
weight = 20
max_occurrences = 5
var/forced_type //Admin abuse
category = EVENT_CATEGORY_BUREAUCRATIC
description = "Fakes an event announcement."
/datum/round_event_control/falsealarm/admin_setup()
if(!check_rights(R_FUN))
return
var/list/possible_types = list()
for(var/datum/round_event_control/E in SSevents.control)
var/datum/round_event/event = E.typepath
if(!initial(event.fakeable))
continue
possible_types += E
forced_type = input(usr, "Select the scare.","False event") as null|anything in sort_names(possible_types)
/datum/round_event_control/falsealarm/canSpawnEvent(players_amt)
return ..() && length(gather_false_events())
/datum/round_event/falsealarm
announce_when = 0
end_when = 1
fakeable = FALSE
/datum/round_event/falsealarm/announce(fake)
if(fake) //What are you doing
return
var/players_amt = get_active_player_count(alive_check = 1, afk_check = 1, human_check = 1)
var/events_list = gather_false_events(players_amt)
var/datum/round_event_control/event_control
var/datum/round_event_control/falsealarm/C = control
if(C.forced_type)
event_control = C.forced_type
C.forced_type = null
else
event_control = pick(events_list)
if(event_control)
var/datum/round_event/Event = new event_control.typepath()
message_admins("False Alarm: [Event]")
Event.kill() //do not process this event - no starts, no ticks, no ends
Event.announce(TRUE) //just announce it like it's happening
/proc/gather_false_events(players_amt)
. = list()
for(var/datum/round_event_control/E in SSevents.control)
if(istype(E, /datum/round_event_control/falsealarm))
continue
if(!E.canSpawnEvent(players_amt))
continue
var/datum/round_event/event = E.typepath
if(!initial(event.fakeable))
continue
. += E