Merge pull request #12493 from Shadowlight213/Banhancements

Adds alien jobbans and adds jobban and pref support to various events
This commit is contained in:
Jordie
2015-10-20 15:21:40 +11:00
9 changed files with 52 additions and 28 deletions
+8 -14
View File
@@ -771,20 +771,26 @@
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=revolutionary;jobban4=\ref[M]'>[replacetext("Revolutionary", " ", "&nbsp")]</a></td>"
jobs += "</tr><tr align='center'>" //Breaking it up so it fits nicer on the screen every 5 entries
//Gangster
if(jobban_isbanned(M, "gangster") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=gangster;jobban4=\ref[M]'><font color=red>[replacetext("Gangster", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=gangster;jobban4=\ref[M]'>[replacetext("Gangster", " ", "&nbsp")]</a></td>"
jobs += "</tr><tr align='center'>" //Breaking it up so it fits nicer on the screen every 5 entries
//Cultist
if(jobban_isbanned(M, "cultist") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=cultist;jobban4=\ref[M]'><font color=red>[replacetext("Cultist", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=cultist;jobban4=\ref[M]'>[replacetext("Cultist", " ", "&nbsp")]</a></td>"
//Shadowling
if(jobban_isbanned(M, "shadowling") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=shadowling;jobban4=\ref[M]'><font color=red>[replacetext("Shadowling", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=shadowling;jobban4=\ref[M]'>[replacetext("Shadowling", " ", "&nbsp")]</a></td>"
//Wizard
if(jobban_isbanned(M, "wizard") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=wizard;jobban4=\ref[M]'><font color=red>[replacetext("Wizard", " ", "&nbsp")]</font></a></td>"
@@ -797,24 +803,12 @@
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=abductor;jobban4=\ref[M]'>[replacetext("Abductor", " ", "&nbsp")]</a></td>"
/* //Malfunctioning AI //Removed Malf-bans because they're a pain to impliment
if(jobban_isbanned(M, "malf AI") || isbanned_dept)
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>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=infested monkey;jobban4=\ref[M]'>[replacetext("Infested Monkey", " ", "&nbsp")]</a></td>"
*/
jobs += "</tr></table>"
body = "<body>[jobs]</body>"
+7 -5
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)
@@ -575,6 +575,7 @@
else
return
//Shadowling
/datum/admins/proc/makeShadowling()
var/datum/game_mode/shadowling/temp = new
if(config.protect_roles_from_antagonist)
@@ -588,10 +589,11 @@
if(!applicant.stat)
if(applicant.mind)
if(!applicant.mind.special_role)
if(temp.age_check(applicant.client))
if(!(applicant.job in temp.restricted_jobs))
if(!(is_shadow_or_thrall(applicant)))
candidates += applicant
if(!jobban_isbanned(applicant, "shadowling") && !jobban_isbanned(applicant, "Syndicate"))
if(temp.age_check(applicant.client))
if(!(applicant.job in temp.restricted_jobs))
if(!(is_shadow_or_thrall(applicant)))
candidates += applicant
if(candidates.len)
H = pick(candidates)
+1 -1
View File
@@ -18,7 +18,7 @@
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
+25 -2
View File
@@ -26,6 +26,9 @@
/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,8 +38,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)
var/client/C = pick_n_take(candidates)
@@ -45,4 +55,17 @@
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()
+1 -1
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
@@ -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
@@ -77,7 +77,7 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
if(candidates.len)
C = pick(candidates)
else if(owner.client)
else if(owner.client && !(jobban_isbanned(owner, "alien candidate") || jobban_isbanned(owner, "Syndicate")))
C = owner.client
else
stage = 4 // Let's try again later.