Files
Paradise/code/modules/events/wallrot.dm
AffectedArc07 210f8badf4 Makes all global variables handled by the GLOB controller (#13152)
* Handlers converted, now to fix 3532 compile errors

* 3532 compile fixes later, got runtimes on startup

* Well the server loads now atleast

* Take 2

* Oops
2020-03-20 21:56:37 -06:00

32 lines
896 B
Plaintext

/datum/event/wallrot/setup()
announceWhen = rand(0, 300)
endWhen = announceWhen + 1
/datum/event/wallrot/announce()
GLOB.event_announcement.Announce("Harmful fungi detected on station. Station structures may be contaminated.", "Biohazard Alert")
/datum/event/wallrot/start()
spawn()
var/turf/simulated/wall/center = null
// 100 attempts
for(var/i=0, i<100, i++)
var/turf/candidate = locate(rand(1, world.maxx), rand(1, world.maxy), 1)
if(istype(candidate, /turf/simulated/wall))
center = candidate
if(center)
// Make sure at least one piece of wall rots!
center.rot()
// Have a chance to rot lots of other walls.
var/rotcount = 0
var/actual_severity = severity * rand(5, 10)
for(var/turf/simulated/wall/W in range(5, center)) if(prob(50))
W.rot()
rotcount++
// Only rot up to severity walls
if(rotcount >= actual_severity)
break