From c61c93a5f3f3bf9d89a773c1eabc1bfda50b98a2 Mon Sep 17 00:00:00 2001 From: xxalpha Date: Sun, 28 Feb 2016 15:31:03 +0000 Subject: [PATCH] Scrubber clog event now has a chance to spawn cockroaches. --- code/modules/events/vent_clog.dm | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/code/modules/events/vent_clog.dm b/code/modules/events/vent_clog.dm index 79b38a2d5e8..48d8a55758a 100644 --- a/code/modules/events/vent_clog.dm +++ b/code/modules/events/vent_clog.dm @@ -9,6 +9,8 @@ endWhen = 35 var/interval = 2 var/list/vents = list() + var/list/gunk = list("water","carbon","flour","radium","toxin","cleaner","nutriment","condensedcapsaicin","mushroomhallucinogen","lube", + "plantbgone","banana","charcoal","space_drugs","morphine","holywater","ethanol","hot_coco","facid") /datum/round_event/vent_clog/announce() priority_announce("The scrubbers network is experiencing a backpressure surge. Some ejection of contents may occur.", "Atmospherics alert") @@ -26,10 +28,11 @@ /datum/round_event/vent_clog/tick() if(activeFor % interval == 0) - var/obj/vent = pick_n_take(vents) + var/obj/machinery/atmospherics/components/unary/vent = pick_n_take(vents) + while(vent && vent.welded) + vent = pick_n_take(vents) + if(vent && vent.loc) - var/list/gunk = list("water","carbon","flour","radium","toxin","cleaner","nutriment","condensedcapsaicin","mushroomhallucinogen","lube", - "plantbgone","banana","charcoal","space_drugs","morphine","holywater","ethanol","hot_coco","facid") var/datum/reagents/R = new/datum/reagents(50) R.my_atom = vent R.add_reagent(pick(gunk), 50) @@ -38,4 +41,14 @@ smoke.set_up(R, 1, vent, silent = 1) playsound(vent.loc, 'sound/effects/smoke.ogg', 50, 1, -3) smoke.start() - qdel(R) \ No newline at end of file + qdel(R) + + var/cockroaches = prob(20) ? 2 : 0 + cockroaches += prob(10) ? 1 : 0 + cockroaches += prob(10) ? 1 : 0 + if(!cockroaches) + if(prob(1) && prob(1)) + cockroaches = 10 + while(cockroaches) + new /mob/living/simple_animal/cockroach(get_turf(vent)) + cockroaches--