mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-15 03:27:46 +00:00
For example, it will try to find players that are afk for 5 minutes or lower, if it fails it'll add a minute to the 5 minutes until it finds a candidate or until it reaches 10 minutes. I changed the get_candidate for aliens so that their 5 minute bracket is instead 45 seconds. This is because a lot of the time larva need to be active ASAP to avoid danger (such as being spawned in dangerous areas) There was a cases of an AFK larva that was very easily killed of, making it fraustrating for the observers watching.
46 lines
1.5 KiB
Plaintext
46 lines
1.5 KiB
Plaintext
/datum/round_event_control/alien_infestation
|
|
name = "Alien Infestation"
|
|
typepath = /datum/round_event/alien_infestation
|
|
weight = 5
|
|
max_occurrences = 1
|
|
|
|
/datum/round_event/alien_infestation
|
|
announceWhen = 400
|
|
|
|
var/spawncount = 1
|
|
var/successSpawn = 0 //So we don't make a command report if nothing gets spawned.
|
|
|
|
|
|
/datum/round_event/alien_infestation/setup()
|
|
announceWhen = rand(announceWhen, announceWhen + 50)
|
|
spawncount = rand(1, 2)
|
|
|
|
/datum/round_event/alien_infestation/kill()
|
|
if(!successSpawn && control)
|
|
control.occurrences--
|
|
return ..()
|
|
|
|
/datum/round_event/alien_infestation/announce()
|
|
if(successSpawn)
|
|
command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")
|
|
world << sound('sound/AI/aliens.ogg')
|
|
|
|
|
|
/datum/round_event/alien_infestation/start()
|
|
var/list/vents = list()
|
|
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
|
|
if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network)
|
|
if(temp_vent.network.normal_members.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
|
|
vents += temp_vent
|
|
|
|
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
|
|
|
|
while(spawncount > 0 && vents.len && candidates.len)
|
|
var/obj/vent = pick_n_take(vents)
|
|
var/client/C = pick_n_take(candidates)
|
|
|
|
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
|
|
new_xeno.key = C.key
|
|
|
|
spawncount--
|
|
successSpawn = 1 |