From 6ae0d3018dadd0c3389b64d26013dd885f9a4e69 Mon Sep 17 00:00:00 2001 From: "VivianFoxfoot@gmail.com" Date: Thu, 1 Mar 2012 23:30:24 +0000 Subject: [PATCH] Adds a option to config.txt called PROTECT_ROLES_FROM_ANTAGONIST. If PROTECT_ROLES_FROM_ANTAGONIST is set, sec/hos/captain/AI cannot be antagonists in most modes If it is not set, only jobs that are mutually exclusive to the role (sec/head during rev, etc) are immune from being antagonist git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3225 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/configuration.dm | 4 ++++ code/game/gamemodes/changeling/changeling.dm | 4 ++++ code/game/gamemodes/changeling/traitor_chan.dm | 4 ++++ code/game/gamemodes/cult/cult.dm | 6 +++++- code/game/gamemodes/game_mode.dm | 3 ++- code/game/gamemodes/nuclear/nuclear.dm | 1 + code/game/gamemodes/revolution/revolution.dm | 4 ++++ code/game/gamemodes/traitor/traitor.dm | 7 ++++++- config/config.txt | 3 +++ 9 files changed, 33 insertions(+), 3 deletions(-) diff --git a/code/datums/configuration.dm b/code/datums/configuration.dm index f6cd6d90821..c2440c04079 100644 --- a/code/datums/configuration.dm +++ b/code/datums/configuration.dm @@ -31,6 +31,7 @@ var/del_new_on_log = 1 // del's new players if they log before they spawn in var/feature_object_spell_system = 0 //spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard var/traitor_scaling = 0 //if amount of traitors scales based on amount of players + var/protect_roles_from_antagonist = 0// If security and such can be tratior/cult/other var/list/mode_names = list() var/list/modes = list() // allowed modes @@ -231,6 +232,9 @@ if ("traitor_scaling") config.traitor_scaling = 1 + if("protect_roles_from_antagonist") + config.protect_roles_from_antagonist = 1 + if ("probability") var/prob_pos = findtext(value, " ") var/prob_name = null diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 6d8154098ba..7ca42d8ac3f 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -43,6 +43,10 @@ world << "There are alien changelings on the station. Do not let the changelings succeed!" /datum/game_mode/changeling/pre_setup() + + if(config.protect_roles_from_antagonist) + restricted_jobs += protected_jobs + var/list/datum/mind/possible_changelings = get_players_for_role(BE_CHANGELING) for(var/datum/mind/player in possible_changelings) diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm index f6fde205a10..ca077575a00 100644 --- a/code/game/gamemodes/changeling/traitor_chan.dm +++ b/code/game/gamemodes/changeling/traitor_chan.dm @@ -2,6 +2,7 @@ name = "traitor+changeling" config_tag = "traitorchan" traitors_possible = 3 //hard limit on traitors if scaling is turned off + restricted_jobs = list("AI", "Cyborg") required_players = 20 required_enemies = 2 recommended_enemies = 3 @@ -12,6 +13,9 @@ /datum/game_mode/traitor/changeling/pre_setup() + if(config.protect_roles_from_antagonist) + restricted_jobs += protected_jobs + var/list/datum/mind/possible_changelings = get_players_for_role(BE_CHANGELING) for(var/datum/mind/player in possible_changelings) diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 1b93538b354..f2ce05ef650 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -19,7 +19,8 @@ /datum/game_mode/cult name = "cult" config_tag = "cult" - restricted_jobs = list("Chaplain", "Security Officer", "Warden", "Detective", "AI", "Cyborg", "Captain", "Head of Security") + restricted_jobs = list("Chaplain","AI", "Cyborg") + protected_jobs = list("Security Officer", "Warden", "Detective", "Captain", "Head of Security") required_players = 15 required_enemies = 3 recommended_enemies = 4 @@ -57,6 +58,9 @@ objectives += "eldergod" objectives += "sacrifice" + if(config.protect_roles_from_antagonist) + restricted_jobs += protected_jobs + var/list/cultists_possible = get_players_for_role(BE_CULTIST) for(var/datum/mind/player in cultists_possible) for(var/job in restricted_jobs)//Removing heads and such from the list diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 9681cbe81af..c20e89fd269 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -20,7 +20,8 @@ station_was_nuked = 0 //see nuclearbomb.dm and malfunction.dm explosion_in_progress = 0 //sit back and relax list/datum/mind/modePlayer = new - list/restricted_jobs = list() + list/restricted_jobs = list() // Jobs it doesn't make sense to be. I.E chaplain or AI cultist + list/protected_jobs = list() // Jobs that can't be tratiors because required_players = 0 required_enemies = 0 recommended_enemies = 0 diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index ce8321492c6..785a9f1bb46 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -30,6 +30,7 @@ /datum/game_mode/nuclear/can_start()//This could be better, will likely have to recode it later if(!..()) return 0 + var/list/possible_syndicates = get_players_for_role(BE_OPERATIVE) var/agent_number = 0 diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 2e8ab17976d..e4bfccddd7b 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -40,6 +40,10 @@ //Gets the round setup, cancelling if there's not enough players at the start// /////////////////////////////////////////////////////////////////////////////// /datum/game_mode/revolution/pre_setup() + + if(config.protect_roles_from_antagonist) + restricted_jobs += protected_jobs + var/list/datum/mind/possible_headrevs = get_players_for_role(BE_REV) var/head_check = 0 diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index ad7d575d090..bbf684eca36 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -5,7 +5,8 @@ /datum/game_mode/traitor name = "traitor" config_tag = "traitor" - restricted_jobs = list("Cyborg", "AI", "Security Officer", "Warden", "Detective", "Head of Security", "Captain") + restricted_jobs = list() + protected_jobs = list("Cyborg", "AI", "Security Officer", "Warden", "Detective", "Head of Security", "Captain") required_players = 0 required_enemies = 1 recommended_enemies = 4 @@ -27,6 +28,10 @@ /datum/game_mode/traitor/pre_setup() + + if(config.protect_roles_from_antagonist) + restricted_jobs += protected_jobs + var/list/possible_traitors = get_players_for_role(BE_TRAITOR) // stop setup if no possible traitors diff --git a/config/config.txt b/config/config.txt index d3798186d4e..d030859426d 100644 --- a/config/config.txt +++ b/config/config.txt @@ -71,6 +71,9 @@ ALLOW_RANDOM_EVENTS ## if amount of traitors scales or not #TRAITOR_SCALING +## If security is prohibited from being most antagonists +#PROTECT_ROLES_FROM_ANTAGONIST + ## allow players to initiate a restart vote ALLOW_VOTE_RESTART