mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
Eventually notifies you where the remaining live ones are
This commit is contained in:
@@ -1,19 +1,16 @@
|
|||||||
/datum/event/grub_infestation
|
/datum/event/grub_infestation
|
||||||
announceWhen = 90
|
announceWhen = 90
|
||||||
|
endWhen = 200
|
||||||
var/spawncount = 1
|
var/spawncount = 1
|
||||||
|
var/list/vents = list()
|
||||||
|
var/list/grubs = list()
|
||||||
|
var/give_positions = 0
|
||||||
|
|
||||||
/datum/event/grub_infestation/setup()
|
/datum/event/grub_infestation/setup()
|
||||||
announceWhen = rand(announceWhen, announceWhen + 60)
|
announceWhen = rand(announceWhen, announceWhen + 60)
|
||||||
|
|
||||||
spawncount = rand(4 * severity, 6 * severity) //grub larva only have a 50% chance to grow big and strong
|
spawncount = rand(4 * severity, 6 * severity) //grub larva only have a 50% chance to grow big and strong
|
||||||
sent_spiders_to_station = 0
|
|
||||||
|
|
||||||
/datum/event/grub_infestation/announce()
|
|
||||||
command_announcement.Announce("Solargrubs detected coming aboard [station_name()]. Please clear them out before this starts to affect productivity. All crew efforts are appreciated and encouraged.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
|
||||||
|
|
||||||
|
|
||||||
/datum/event/grub_infestation/start()
|
|
||||||
var/list/vents = list()
|
|
||||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
|
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
|
||||||
if(istype(get_area(temp_vent), /area/crew_quarters/sleep))
|
if(istype(get_area(temp_vent), /area/crew_quarters/sleep))
|
||||||
continue
|
continue
|
||||||
@@ -21,8 +18,30 @@
|
|||||||
if(temp_vent.network.normal_members.len > 50)
|
if(temp_vent.network.normal_members.len > 50)
|
||||||
vents += temp_vent
|
vents += temp_vent
|
||||||
|
|
||||||
|
/datum/event/grub_infestation/announce()
|
||||||
|
command_announcement.Announce("Solargrubs detected coming aboard [station_name()]. Please clear them out before this starts to affect productivity. All crew efforts are appreciated and encouraged.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||||
|
|
||||||
|
/datum/event/grub_infestation/start()
|
||||||
while((spawncount >= 1) && vents.len)
|
while((spawncount >= 1) && vents.len)
|
||||||
var/obj/vent = pick(vents)
|
var/obj/vent = pick(vents)
|
||||||
new /mob/living/simple_animal/solargrub_larva(get_turf(vent))
|
new /mob/living/simple_animal/solargrub_larva(get_turf(vent))
|
||||||
vents -= vent
|
vents -= vent
|
||||||
spawncount--
|
spawncount--
|
||||||
|
vents.Cut()
|
||||||
|
|
||||||
|
/datum/event/grub_infestation/end()
|
||||||
|
var/list/area_names = list()
|
||||||
|
for(var/grub in grubs)
|
||||||
|
var/mob/living/G = grub
|
||||||
|
if(!G || G.stat == DEAD)
|
||||||
|
continue
|
||||||
|
var/area/grub_area = get_area(G)
|
||||||
|
if(!grub_area) //Huh, really?
|
||||||
|
if(!get_turf(G)) //No turf either?
|
||||||
|
qdel(G) //Must have been nullspaced
|
||||||
|
continue
|
||||||
|
area_names |= grub_area.name
|
||||||
|
if(area_names.len)
|
||||||
|
var/english_list = english_list(area_names)
|
||||||
|
command_announcement.Announce("Sensors have narrowed down remaining active solargrubs to the followng areas: [english_list]", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||||
|
grubs.Cut()
|
||||||
Reference in New Issue
Block a user