mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Minor touch-ups to the shiny new job-ban interface
Antag job-bans should now work correctly for the role assigner thingy at the start of a round. Removed the Malf-AI job-ban option, as it was a pain to implement and wasn't really worth it. Tensioner doesn't recognise job-bans to the best of my knowledge. This may change in the future. -- Nodrak & Carnwennan git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3295 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -237,10 +237,20 @@ Whitespace:Seperator;"}
|
||||
var/list/drafted = list()
|
||||
var/datum/mind/applicant = null
|
||||
|
||||
var/roletext
|
||||
switch(role)
|
||||
if(BE_CHANGELING) roletext="changeling"
|
||||
if(BE_TRAITOR) roletext="traitor"
|
||||
if(BE_OPERATIVE) roletext="operative"
|
||||
if(BE_WIZARD) roletext="wizard"
|
||||
if(BE_REV) roletext="revolutionary"
|
||||
if(BE_CULTIST) roletext="cultist"
|
||||
|
||||
|
||||
for(var/mob/new_player/player in world)
|
||||
if(player.client && player.ready)
|
||||
if(player.preferences.be_special & role)
|
||||
if(!jobban_isbanned(player, "Syndicate"))
|
||||
if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans
|
||||
candidates += player.mind // Get a list of all the people who want to be the antagonist for this round
|
||||
|
||||
if(restricted_jobs)
|
||||
@@ -253,7 +263,7 @@ Whitespace:Seperator;"}
|
||||
for(var/mob/new_player/player in world)
|
||||
if (player.client && player.ready)
|
||||
if(!(player.preferences.be_special & role)) // We don't have enough people who want to be antagonist, make a seperate list of people who don't want to be one
|
||||
if(!jobban_isbanned(player, "Syndicate"))
|
||||
if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans
|
||||
drafted += player.mind
|
||||
|
||||
if(restricted_jobs)
|
||||
@@ -275,7 +285,7 @@ Whitespace:Seperator;"}
|
||||
if(candidates.len < recommended_enemies && override_jobbans) //If we still don't have enough people, we're going to start drafting banned people.
|
||||
for(var/mob/new_player/player in world)
|
||||
if (player.client && player.ready)
|
||||
if(jobban_isbanned(player, "Syndicate"))
|
||||
if(jobban_isbanned(player, "Syndicate") || jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans
|
||||
drafted += player.mind
|
||||
|
||||
if(restricted_jobs)
|
||||
|
||||
@@ -323,25 +323,25 @@
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=revolutionary;jobban4=\ref[M]'>[dd_replacetext("Revolutionary", " ", " ")]</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>[dd_replacetext("Cultist", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=cultist;jobban4=\ref[M]'>[dd_replacetext("Cultist", " ", " ")]</a></td>"
|
||||
|
||||
jobs += "</tr><tr align='center'>" //Breaking it up so it fits nicer on the screen every 5 entries
|
||||
|
||||
//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>[dd_replacetext("Wizard", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=wizard;jobban4=\ref[M]'>[dd_replacetext("Wizard", " ", " ")]</a></td>"
|
||||
|
||||
//Malfunctioning AI
|
||||
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>[dd_replacetext("Malf AI", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'>[dd_replacetext("Malf AI", " ", " ")]</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>[dd_replacetext("Malf AI", " ", " ")]</font></a></td>"
|
||||
// else
|
||||
// jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'>[dd_replacetext("Malf AI", " ", " ")]</a></td>"
|
||||
|
||||
//Alien
|
||||
if(jobban_isbanned(M, "alien candidate") || isbanned_dept)
|
||||
@@ -458,7 +458,7 @@
|
||||
for(var/job in joblist)
|
||||
var/reason = jobban_isbanned(M, job)
|
||||
if(!reason) continue //skip if it isn't jobbanned anyway
|
||||
switch(alert("Job: [job] Reason: '[reason]'. Are you sure you want to un-jobban?","Please Confirm","Yes","No"))
|
||||
switch(alert("Job: '[job]' Reason: '[reason]' Un-jobban?","Please Confirm","Yes","No"))
|
||||
if("Yes")
|
||||
ban_unban_log_save("[key_name(usr)] unjobbanned [key_name(M)] from [job]")
|
||||
log_admin("[key_name(usr)] unbanned [key_name(M)] from [job]")
|
||||
|
||||
@@ -12,14 +12,15 @@ var
|
||||
jobban_keylist.Add(text("[ckey] - [rank]"))
|
||||
jobban_savebanfile()
|
||||
|
||||
//returns a reason if M is banned from rank, returns 0 otherwise
|
||||
/proc/jobban_isbanned(mob/M, rank)
|
||||
if(_jobban_isbanned(M, rank)) return 1//for old jobban
|
||||
if(_jobban_isbanned(M, rank)) return "Reason Unspecified" //for old jobban
|
||||
if(M)
|
||||
if (guest_jobbans(rank))
|
||||
if(config.guest_jobban && IsGuestKey(M.key))
|
||||
return 1
|
||||
return "Guest Job-ban"
|
||||
if(config.usewhitelist && !check_whitelist(M))
|
||||
return 1
|
||||
return "Whitelisted Job"
|
||||
|
||||
for (var/s in jobban_keylist)
|
||||
if( findtext(s,"[M.ckey] - [rank]") )
|
||||
@@ -28,8 +29,8 @@ var
|
||||
var/text = copytext(s, startpos, 0)
|
||||
if(text)
|
||||
return text
|
||||
return "unknown"
|
||||
return 0
|
||||
return "Reason Unspecified"
|
||||
return 0
|
||||
|
||||
/*
|
||||
DEBUG
|
||||
|
||||
Reference in New Issue
Block a user