9e1ef0ffe2
* Add the system for managed global variables * Travis ban old globals * So you CAN inline proccall, that's neat * Fix that * master.dm * Remove the hack procs * Move InitGlobals to the proper spot * configuration.dm * Fix the missing pre-slash * clockcult.dm * This is probably for the best * Doy * Fix shit * Rest of the DEFINES tree * Fix * Use global. for access * Update find_references_in_globals Always hated that proc Whoever made it must've bee a r e a l idiot... * __HELPERS tree * Move global initialization to master. Fix the declaration * database.dm * Dat newline * I said DECLARATIVE order! * Here's something you can chew on @Iamgoofball * game_modes.dm * Fix this * genetics.dm * flavor_misc.dm * More stuff * Do it mso's way. Keep the controllers as global * Make master actually see it * Fix * Finish _globalvars/lists * Finish the rest of the _globalvars tree * This is weird * Migrate the controllers * SLOTH -> GLOB * Lighting globals * round_start_time -> ticker * PAI card list -> pai SS * record_id_num -> static * Diseases list -> SSdisease * More disease globals to the SS * More disease stuff * Emote list * Better and better * Bluh * So much stuff * Ahh * Wires * dview * station_areas * Teleportlocs * blood_splatter_icons * Stuff and such * More stuff * RAD IO * More stuff and such * Blob shit * Changeling stuff * Add "Balance" to changelogs * Balance for changelog compiler + Auto Tagging * Update the PR template * hivemind_bank * Bip * sacrificed * Good shit * Better define * More cult shit * Devil shit * Gang shit * > borers Fix shit * Rename the define * Nuke * Objectives * Sandbox * Multiverse sword * Announce systems * Stuff and such * TC con * Airlock * doppllllerrrrrr * holopads * Shut up byond you inconsistent fuck * Sneaky fuck * Burp * Bip * Fixnshit * Port without regard * askdlfjs; * asdfjasoidojfi * Protected globals and more * SO MANY * ajsimkvahsaoisd * akfdsiaopwimfeoiwafaw * gsdfigjosidjfgiosdg * AHHHHHHHHHHHHHHHHHHHHHHH!!!!! * facerolll * ASDFASDFASDF * Removes the unused parts of dmm_suite * WIP * Fix quote * asdfjauwfnkjs * afwlunhskjfda * asfjlaiwuefhaf * SO CLOSE * wwwweeeeeewwwww * agdgmoewranwg * HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!? * Fix syntax errors * 100 errors * Another 100 * So many... * Ugh * More shit * kilme * Stuuuuuufffff * ajrgmrlshio;djfa;sdkl * jkbhkhjbmjvjmh * soi soi soi * butt * TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING * lllllllllllllllllllllllllllllllllllllllllll * afsdijfiawhnflnjhnwsdfs * yugykihlugk,kj * time to go * STUFFF!!! * AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!! * ngoaijdjlfkamsdlkf * Break time * aufjsdklfalsjfi * CONTROL KAY AND PRAY * IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * Goteem * Fix testing mode * This does not belong in this PR * Convert it to a controller * Eh, fuck this option * Revert controllerization Ill do it some other time * Fix * Working controllerization * FOR THE LOVE OF CHRIST PROTECT THE LOGS * Protect admins and deadmins * Use the inbuilt proc
76 lines
2.3 KiB
Plaintext
76 lines
2.3 KiB
Plaintext
/datum/round_event_control/alien_infestation
|
|
name = "Alien Infestation"
|
|
typepath = /datum/round_event/ghost_role/alien_infestation
|
|
weight = 5
|
|
|
|
min_players = 10
|
|
max_occurrences = 1
|
|
|
|
/datum/round_event/ghost_role/alien_infestation
|
|
announceWhen = 400
|
|
|
|
minimum_required = 1
|
|
role_name = "alien larva"
|
|
|
|
// 50% chance of being incremented by one
|
|
var/spawncount = 1
|
|
var/successSpawn = 0 //So we don't make a command report if nothing gets spawned.
|
|
|
|
|
|
/datum/round_event/ghost_role/alien_infestation/setup()
|
|
announceWhen = rand(announceWhen, announceWhen + 50)
|
|
if(prob(50))
|
|
spawncount++
|
|
|
|
/datum/round_event/ghost_role/alien_infestation/kill()
|
|
if(!successSpawn && control)
|
|
// This never happened, so let's not deny the future of this round
|
|
// some xenolovin
|
|
control.occurrences--
|
|
return ..()
|
|
|
|
/datum/round_event/ghost_role/alien_infestation/announce()
|
|
if(successSpawn)
|
|
priority_announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", 'sound/AI/aliens.ogg')
|
|
|
|
|
|
/datum/round_event/ghost_role/alien_infestation/spawn_role()
|
|
var/list/vents = list()
|
|
for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in GLOB.machines)
|
|
if(QDELETED(temp_vent))
|
|
continue
|
|
if(temp_vent.loc.z == ZLEVEL_STATION && !temp_vent.welded)
|
|
var/datum/pipeline/temp_vent_parent = temp_vent.PARENT1
|
|
//Stops Aliens getting stuck in small networks.
|
|
//See: Security, Virology
|
|
if(temp_vent_parent.other_atmosmch.len > 20)
|
|
vents += temp_vent
|
|
|
|
if(!vents.len)
|
|
message_admins("An event attempted to spawn an alien but no suitable vents were found. Shutting down.")
|
|
return MAP_ERROR
|
|
|
|
var/list/candidates = get_candidates("alien", null, ROLE_ALIEN)
|
|
|
|
if(!candidates.len)
|
|
return NOT_ENOUGH_PLAYERS
|
|
|
|
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 = TRUE
|
|
message_admins("[key_name_admin(new_xeno)] has been made into an alien by an event.")
|
|
log_game("[key_name(new_xeno)] was spawned as an alien by an event.")
|
|
spawned_mobs += new_xeno
|
|
|
|
if(successSpawn)
|
|
return SUCCESSFUL_SPAWN
|
|
else
|
|
// Like how did we get here?
|
|
return FALSE
|