-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathgrid_check.dm
29 lines (26 loc) · 1.2 KB
/
grid_check.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/datum/round_event_control/grid_check
name = "Grid Check"
typepath = /datum/round_event/grid_check
weight = 10
max_occurrences = 3
description = "Turns off all APCs for a while, or until they are manually rebooted."
min_wizard_trigger_potency = 0
max_wizard_trigger_potency = 4
/// Cooldown for the announement associated with this event.
/// Necessary due to the fact that this event is player triggerable.
COOLDOWN_DECLARE(announcement_spam_protection)
track = EVENT_TRACK_MODERATE
tags = list(TAG_COMMUNAL, TAG_SPOOKY)
event_group = /datum/event_group/bsod
/datum/round_event/grid_check
announce_when = 1
start_when = 1
/datum/round_event/grid_check/announce(fake)
var/datum/round_event_control/grid_check/controller = control
if(!COOLDOWN_FINISHED(controller, announcement_spam_protection) && !fake)
return
priority_announce("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure", ANNOUNCER_POWEROFF)
if(!fake) // Only start the CD if we're real
COOLDOWN_START(controller, announcement_spam_protection, 30 SECONDS)
/datum/round_event/grid_check/start()
power_fail(30, 120)