Files
Bubberstation/code/modules/events/processor_overload.dm
Watermelon914 375a20e49b Refactors most spans into span procs (#59645)
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs.
Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines.

Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing.
Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc.

(Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
2021-06-14 13:03:53 -07:00

40 lines
1.4 KiB
Plaintext

/datum/round_event_control/processor_overload
name = "Processor Overload"
typepath = /datum/round_event/processor_overload
weight = 15
min_players = 20
/datum/round_event/processor_overload
announceWhen = 1
/datum/round_event/processor_overload/announce(fake)
var/alert = pick( "Exospheric bubble inbound. Processor overload is likely. Please contact you*%xp25)`6cq-BZZT", \
"Exospheric bubble inbound. Processor overload is likel*1eta;c5;'1v¬-BZZZT", \
"Exospheric bubble inbound. Processor ov#MCi46:5.;@63-BZZZZT", \
"Exospheric bubble inbo'Fz\\k55_@-BZZZZZT", \
"Exospheri:%£ QCbyj^j</.3-BZZZZZZT", \
"!!hy%;f3l7e,<$^-BZZZZZZZT")
for(var/mob/living/silicon/ai/A in GLOB.ai_list)
//AIs are always aware of processor overload
to_chat(A, "<br>[span_warning("<b>[alert]</b>")]<br>")
// Announce most of the time, but leave a little gap so people don't know
// whether it's, say, a tesla zapping tcomms, or some selective
// modification of the tcomms bus
if(prob(80) || fake)
priority_announce(alert)
/datum/round_event/processor_overload/start()
for(var/obj/machinery/telecomms/processor/P in GLOB.telecomms_list)
if(prob(10))
announce_to_ghosts(P)
// Damage the surrounding area to indicate that it popped
explosion(P, light_impact_range = 2)
// Only a level 1 explosion actually damages the machine
// at all
SSexplosions.high_mov_atom += P
else
P.emp_act(EMP_HEAVY)