Files
Bubberstation/code/modules/events/spider_infestation.dm
T
phil235 a55e6a70be Fixes malf AI lockdown affecting doors on z levels other than station and mining.
Replaces a lot of z level numbers in code by their respective defines.
Adding a define for the Mining asteroid z level.
2015-01-11 15:39:32 +01:00

34 lines
1.1 KiB
Plaintext

/datum/round_event_control/spider_infestation
name = "Spider Infestation"
typepath = /datum/round_event/spider_infestation
weight = 5
max_occurrences = 1
/datum/round_event/spider_infestation
announceWhen = 400
var/spawncount = 1
/datum/round_event/spider_infestation/setup()
announceWhen = rand(announceWhen, announceWhen + 50)
spawncount = rand(5, 8)
/datum/round_event/spider_infestation/announce()
priority_announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", 'sound/AI/aliens.ogg')
/datum/round_event/spider_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if(temp_vent.loc.z == ZLEVEL_STATION && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 20)
vents += temp_vent
while((spawncount >= 1) && vents.len)
var/obj/vent = pick(vents)
var/obj/effect/spider/spiderling/S = new(vent.loc)
if(prob(66))
S.grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/nurse
vents -= vent
spawncount--