Files
Aurora.3/code/modules/events/infestation.dm
fernerr 5e02e38437 Hivebots: The Second Wave (#7002)
Changed the spawning mechanics of hivebots and expanded their roster with three new types, Bomber, Guardian and Harvester.
    Tweaked the slime infestation event to be a bit more colorful and spawn a couple more slimes than currently.
    Made it so infestation events no longer trigger outside the station at shuttle docks,, inside xenobiology cells, substations, at centcomm or outside etc.
    Fixed the prison break event from not working correctly with virology, added a chance for it to happen at the bridge.
    Fixed some announcements missing their custom titles. Particularly those used by random events. Tweaked their font and size.
2019-10-20 00:18:23 +03:00

121 lines
3.7 KiB
Plaintext

#define INFESTATION_RATS "rats"
#define INFESTATION_LIZARDS "lizards"
#define INFESTATION_SPACE_BATS "space bats"
#define INFESTATION_SPIDERLINGS "spiderlings"
#define INFESTATION_HIVEBOTS "hivebots"
#define INFESTATION_SLIMES "slimes"
/datum/event/infestation
startWhen = 1
announceWhen = 10
endWhen = 11
no_fake = 1
var/area/chosen_area
var/event_name = "Slime Leak"
var/chosen_mob = INFESTATION_SLIMES
var/chosen_verb = "have leaked into"
var/list/chosen_mob_types = list()
var/chosen_scan_type = "Bioscans"
var/list/possible_mobs = list(
INFESTATION_RATS = 1,
INFESTATION_LIZARDS = 1
)
/datum/event/infestation/moderate
possible_mobs = list(
INFESTATION_SPACE_BATS = 1,
INFESTATION_SPIDERLINGS = 1
)
/datum/event/infestation/major
possible_mobs = list(
INFESTATION_HIVEBOTS = 1,
INFESTATION_SLIMES = 1
)
/datum/event/infestation/setup()
choose_area()
choose_mobs()
/datum/event/infestation/start()
spawn_mobs()
/datum/event/infestation/proc/choose_area()
chosen_area = random_station_area(TRUE)
/datum/event/infestation/proc/choose_mobs()
chosen_mob = pickweight(possible_mobs)
switch(chosen_mob)
if(INFESTATION_HIVEBOTS)
event_name = "Hivebot Invasion"
chosen_verb = "have invaded"
chosen_scan_type = "Bluespace readings"
var/list/beacon_types = list(
/mob/living/simple_animal/hostile/hivebotbeacon = 1,
/mob/living/simple_animal/hostile/hivebotbeacon/toxic = 1,
/mob/living/simple_animal/hostile/hivebotbeacon/incendiary = 1
)
chosen_mob_types += pickweight(beacon_types)
if(INFESTATION_SPACE_BATS)
event_name = "Space Bat Nest"
chosen_verb = "have been breeding in"
for(var/i = 1, i < rand(3,5),i++)
chosen_mob_types += /mob/living/simple_animal/hostile/scarybat
if(INFESTATION_LIZARDS)
event_name = "Lizard Nest"
chosen_verb = "have been breeding in"
for(var/i = 1, i < rand(6,8),i++)
chosen_mob_types += /mob/living/simple_animal/lizard
if(INFESTATION_RATS)
event_name = "Rat Nest"
chosen_verb = "have been breeding in"
var/list/rat_breeds = list(
/mob/living/simple_animal/rat/gray = 4,
/mob/living/simple_animal/rat/brown = 2,
/mob/living/simple_animal/rat/white = 3,
/mob/living/simple_animal/rat/hooded = 1,
/mob/living/simple_animal/rat/irish = 2,
)
for(var/i = 1, i < rand(8,24),i++)
chosen_mob_types += pickweight(rat_breeds)
if(INFESTATION_SLIMES)
event_name = "Xenobiology Containment Breach"
chosen_verb = "have leaked into"
var/list/slime_types = list(
/mob/living/carbon/slime,
/mob/living/carbon/slime/purple,
/mob/living/carbon/slime/metal,
/mob/living/carbon/slime/orange,
/mob/living/carbon/slime/blue,
/mob/living/carbon/slime/dark_blue,
/mob/living/carbon/slime/dark_purple,
/mob/living/carbon/slime/yellow,
/mob/living/carbon/slime/silver,
/mob/living/carbon/slime/pink,
/mob/living/carbon/slime/red,
/mob/living/carbon/slime/green,
/mob/living/carbon/slime/oil
)
var/chosen_slime_type = pick(slime_types)
for(var/i = 1, i < rand(5,8),i++)
chosen_mob_types += chosen_slime_type
if(INFESTATION_SPIDERLINGS)
event_name = "Spiderling Infestation"
chosen_verb = "have burrowed into"
for(var/i = 1, i < rand(3,6),i++)
chosen_mob_types += /obj/effect/spider/spiderling
chosen_mob_types += /obj/effect/spider/eggcluster
/datum/event/infestation/proc/spawn_mobs()
for(var/spawned_mob in chosen_mob_types)
new spawned_mob(chosen_area.random_space())
/datum/event/infestation/announce()
command_announcement.Announce("[chosen_scan_type] indicate that [chosen_mob] [chosen_verb] [chosen_area]. Clear them out before this starts to affect productivity.", event_name, new_sound = 'sound/AI/vermin.ogg')