Adds jobban support to syndicate borg

Adds jobban and pref checking to various events
Adds support for alien jobbans
Adds feedback to alien infestation event.
This commit is contained in:
Shadowlight213
2015-10-18 15:25:14 -07:00
parent a14ddb8ce2
commit 35ca96331e
8 changed files with 45 additions and 14 deletions
+4 -2
View File
@@ -290,7 +290,7 @@
// Will return a list of active candidates. It increases the buffer 5 times until it finds a candidate which is active within the buffer.
/proc/get_candidates(be_special_flag=0, afk_bracket=3000)
/proc/get_candidates(be_special_flag=0,afk_bracket=3000, var/jobbanType)
var/list/candidates = list()
// Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000))
while(!candidates.len && afk_bracket < 6000)
@@ -298,7 +298,9 @@
if(G.client != null)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
if(!G.client.is_afk(afk_bracket) && (G.client.prefs.be_special & be_special_flag))
candidates += G.client
if (jobbanType)
if(!(jobban_isbanned(G, jobbanType) || jobban_isbanned(G, "Syndicate")))
candidates += G.client
afk_bracket += 600 // Add a minute to the bracket, for every attempt
return candidates
+1 -1
View File
@@ -138,7 +138,7 @@
borg_to_spawn = input("What type?", "Cyborg Type", type) as null|anything in possible_types
if(!borg_to_spawn)
return
var/list/borg_candicates = get_candidates(BE_OPERATIVE)
var/list/borg_candicates = get_candidates(BE_OPERATIVE, 3000, "operative")
if(borg_candicates.len > 0)
used = 1
var/client/C = pick(borg_candicates)
+2 -2
View File
@@ -802,13 +802,13 @@
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'><font color=red>[replacetext("Malf AI", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'>[replacetext("Malf AI", " ", "&nbsp")]</a></td>"
*/
//Alien
if(jobban_isbanned(M, "alien candidate") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=alien candidate;jobban4=\ref[M]'><font color=red>[replacetext("Alien", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=alien candidate;jobban4=\ref[M]'>[replacetext("Alien", " ", "&nbsp")]</a></td>"
/*
//Infested Monkey
if(jobban_isbanned(M, "infested monkey") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=infested monkey;jobban4=\ref[M]'><font color=red>[replacetext("Infested Monkey", " ", "&nbsp")]</font></a></td>"
+1 -1
View File
@@ -412,7 +412,7 @@
/datum/admins/proc/makeOfficial()
var/mission = input("Assign a task for the official", "Assign Task", "Conduct a routine preformance review of [station_name()] and its Captain.")
var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered to be a Centcom Official?", "pAI")
var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered to be a Centcom Official?", "deathsquad")
if(candidates.len)
var/mob/dead/observer/chosen_candidate = pick(candidates)
+2 -2
View File
@@ -18,8 +18,8 @@
makeAbductorTeam()
/datum/round_event/abductor/proc/makeAbductorTeam()
var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for an Abductor Team?", "abductor", null)
var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for an Abductor Team?", "abductor", null, BE_ABDUCTOR )
if(candidates.len >= 2)
//Oh god why we can't have static functions
var/number = ticker.mode.abductor_teams + 1
+31 -2
View File
@@ -26,6 +26,13 @@
/datum/round_event/alien_infestation/start()
get_alien()
/datum/round_event/alien_infestation/proc/get_alien(end_if_fail = 0)
var/list/vents = list()
for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in machines)
if(qdeleted(temp_vent))
@@ -35,7 +42,15 @@
if(temp_vent_parent.other_atmosmch.len > 20) //Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
if(!vents.len)
message_admins("An event attempted to spawn an alien but no suitable vents were found. Shutting down.")
return kill()
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET, "alien candidate")
if(!candidates.len)
if(end_if_fail)
return 0
return find_alien()
while(spawncount > 0 && vents.len && candidates.len)
var/obj/vent = pick_n_take(vents)
@@ -45,4 +60,18 @@
new_xeno.key = C.key
spawncount--
successSpawn = 1
successSpawn = 1
message_admins("[new_xeno.key] has been made into an alien by an event.")
log_game("[new_xeno.key] was spawned as an alien by an event.")
if(successSpawn)
return 1
/datum/round_event/alien_infestation/proc/find_alien()
message_admins("Event attempted to spawn an alien but no candidates were available. Will try again momentarily...")
spawn(50)
if(get_alien(1))
message_admins("Situation has been resolved")
return 0
message_admins("Unfortunately, no candidates were available for becoming an alien. Shutting down.")
return kill()
+3 -3
View File
@@ -10,7 +10,7 @@
/datum/round_event/operative/proc/get_operative(end_if_fail = 0)
key_of_operative = null
if(!key_of_operative)
var/list/candidates = get_candidates(BE_OPERATIVE)
var/list/candidates = get_candidates(BE_OPERATIVE, 3000, "operative")
if(!candidates.len)
if(end_if_fail)
return 0
@@ -29,7 +29,7 @@
spawn_locs += L.loc
if(!spawn_locs.len)
return kill()
var/mob/living/carbon/human/operative = new(pick(spawn_locs))
var/datum/preferences/A = new
A.copy_to(operative)
@@ -45,7 +45,7 @@
var/obj/machinery/nuclearbomb/selfdestruct/nuke = locate() in machines
if(nuke)
var/nuke_code
var/nuke_code
if(!nuke.r_code || nuke.r_code == "ADMIN")
nuke_code = "[rand(10000, 99999)]"
nuke.r_code = nuke_code
@@ -67,7 +67,7 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
/obj/item/organ/internal/body_egg/alien_embryo/proc/AttemptGrow(gib_on_success = 1)
if(!owner) return
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET, "alien candidate")
var/client/C = null
// To stop clientless larva, we will check that our host has a client