Files
Paradise/code/modules/events/spider_terror.dm
T
e135c2326b Terror Princess Rework (#13657)
* rework queen eggs, princess caste

* add trailing newlines for travis

* refactor for code standards

* Remove old/incorrect comment from queen.dm

* refactor purple.dm, add notification for which area queen is in

* princesses no longer lose ventcrawl or gain wallsmash when nesting, deletes MassFlicker()

* add status tab info for purples about where their queen is

* Simplified princess code: removed NestMode(), NestMode2().

* makes terrors use 'bite' animation when attacking something

* status tab spider regeneration helptext

* converts queen spit from TOX to BURN, empress single-fire

* fixes terror gender, double-examine text. add terrors closing airlocks, remove queen wrap

* newline for travis

* alter terror spider event balance depending on server pop

* white infection sequence: gray, red, brown, green, green

* moves #define isterrorspider(A) to __DEFINES\mobs.dm

* remove typoed comment

* fix: prevent exploit with spam-clicking egglay action button

* fix: prevent AI trying to move spiders after a player takes control of them

* fix bug where terrors bumping an airlock repeatedly could make it both open and close

* clarify comment on event odds

* increase queen spit burn damage from 30 to 40

* add: queen webs are now airtight, instead of dealing damage/hallucination

* remove spider alert for already-controlled spiders

* queen spit naming fix

* travis newline

* encourage princesses to remain outside vents

* fixes calls to CountSpidersDetailed not using list()

* makes it easier to debug away mission AI

* code quality: more typeless loops

* add: killing a queen, also kills most of her offspring

* remove walk fix, for splitting into another PR

* remove events\spider_terror.dm changes, move to another PR

* makes it compile - will still require merge conflict resolving later.

* fix: purple webs cause purples to lose sign of queen and die

* visible-> near for purples

* fix wrong gender on spiders

* queen spit now damages structures (like mechs) and other spiders

* ghost spacing

* show queen living time on examine

* Fixes #12969 - terrors getting stuck in web

* revert all changes to purple.dm

* farie requests 1

* farie refactoring II

* var/list/spider_array

* var/list/spider_totals

* more farie

* queen examine laycount, initial eggcount

* terror heat vulnerability, refactoring 1/0 vars

Co-authored-by: Kyep <Kyep@users.noreply.github.com>
2020-09-17 18:29:32 -04: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/queen/princess
spawncount = 3
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