Files
Paradise/code/modules/events/spider_terror.dm
Kyep f29114f3d6 Terror spider event types now depend on server pop (#13874)
* Terror spider events now depend on server pop

* split off from PR 13657

* farie suggestion

* convert var/highpop_trigger to #define TS_HIGHPOP_TRIGGER

* newline

* re-run mapdiffbot

Co-authored-by: Kyep <Kyep@users.noreply.github.com>
2020-07-21 14:45:35 -06:00

76 lines
2.4 KiB
Plaintext

#define TS_HIGHPOP_TRIGGER 80
/datum/event/spider_terror
announceWhen = 240
var/spawncount = 1
/datum/event/spider_terror/setup()
announceWhen = rand(announceWhen, announceWhen + 30)
spawncount = 1
/datum/event/spider_terror/announce()
GLOB.command_announcement.Announce("Confirmed outbreak of level 3 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/effects/siren-spooky.ogg')
/datum/event/spider_terror/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.all_vent_pumps)
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(!temp_vent.parent)
// Issue happening more often with vents. Log and continue. Delete once solved
log_debug("spider_terror/start(), vent has no parent: [temp_vent], qdeled: [QDELETED(temp_vent)], loc: [temp_vent.loc]")
continue
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
var/spider_type
var/infestation_type
if((length(GLOB.clients)) < TS_HIGHPOP_TRIGGER)
infestation_type = pick(1, 2, 3, 4)
else
infestation_type = pick(2, 3, 4, 5)
switch(infestation_type)
if(1)
// Weakest, only used during lowpop.
spider_type = /mob/living/simple_animal/hostile/poison/terror_spider/green
spawncount = 5
if(2)
// Fairly weak. Dangerous in single combat but has little staying power. Always gets whittled down.
spider_type = /mob/living/simple_animal/hostile/poison/terror_spider/prince
spawncount = 1
if(3)
// Variable. Depends how many they infect.
spider_type = /mob/living/simple_animal/hostile/poison/terror_spider/white
spawncount = 2
if(4)
// Pretty strong.
spider_type = /mob/living/simple_animal/hostile/poison/terror_spider/princess
spawncount = 2
if(5)
// Strongest, only used during highpop.
spider_type = /mob/living/simple_animal/hostile/poison/terror_spider/queen
spawncount = 1
while(spawncount >= 1 && vents.len)
var/obj/machinery/atmospherics/unary/vent_pump/vent = pick(vents)
if(vent.welded)
vents -= vent
continue
// If the vent we picked has any living mob nearby, just remove it from the list, loop again, and pick something else.
var/turf/T = get_turf(vent)
var/hostiles_present = FALSE
for(var/mob/living/L in viewers(T))
if(L.stat != DEAD)
hostiles_present = TRUE
break
vents -= vent
if(!hostiles_present)
new spider_type(vent.loc)
spawncount--
#undef TS_HIGHPOP_TRIGGER