From 553ac01552ff4dc37c38127101009652924335aa Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 4 Sep 2015 20:17:47 +0930 Subject: [PATCH] Autotraitor cleanup. --- code/game/antagonist/antagonist.dm | 2 +- code/game/antagonist/station/traitor.dm | 5 +---- code/game/gamemodes/game_mode.dm | 6 +++--- code/game/gamemodes/game_mode_latespawn.dm | 14 +++----------- code/game/gamemodes/traitor/traitor.dm | 8 +++++++- code/modules/admin/admin.dm | 17 ++++++----------- 6 files changed, 21 insertions(+), 31 deletions(-) diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm index 294292eabd4..45f62f1a860 100644 --- a/code/game/antagonist/antagonist.dm +++ b/code/game/antagonist/antagonist.dm @@ -100,7 +100,7 @@ if(istype(player.current, /mob/dead)) create_default(player.current) else - add_antagonist(player,0,1,0,1,1) + add_antagonist(player,0,0,0,1,1) return /datum/antagonist/proc/build_candidate_list(var/ghosts_only) diff --git a/code/game/antagonist/station/traitor.dm b/code/game/antagonist/station/traitor.dm index 825f615bea4..a68ca123d21 100644 --- a/code/game/antagonist/station/traitor.dm +++ b/code/game/antagonist/station/traitor.dm @@ -2,11 +2,8 @@ var/datum/antagonist/traitor/traitors /datum/antagonist/traitor id = MODE_TRAITOR - restricted_jobs = list("Cyborg")//They are part of the AI if he is traitor so are they, they use to get double chances - protected_jobs = list("Security Officer", "Warden", "Detective", "Internal Affairs Agent", "Head of Security", "Captain")//AI", Currently out of the list as malf does not work for shit + protected_jobs = list("Security Officer", "Warden", "Detective", "Internal Affairs Agent", "Head of Security", "Captain") flags = ANTAG_SUSPICIOUS | ANTAG_RANDSPAWN | ANTAG_VOTABLE - max_antags = 200 // No upper limit. - max_antags_round = 200 /datum/antagonist/traitor/New() ..() diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index a92f0725597..648a2dd07fd 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -139,18 +139,18 @@ var/global/list/additional_antag_types = list() shuttle_delay = choice if("antag_scaling") choice = input("Enter a new antagonist cap scaling coefficient.") as num - if(!choice || choice < 0 || choice > 100) + if(isnull(choice) || choice < 0 || choice > 100) return antag_scaling_coeff = choice if("event_modifier_moderate") choice = input("Enter a new moderate event time modifier.") as num - if(!choice || choice < 0 || choice > 100) + if(isnull(choice) || choice < 0 || choice > 100) return event_delay_mod_moderate = choice refresh_event_modifiers() if("event_modifier_severe") choice = input("Enter a new moderate event time modifier.") as num - if(!choice || choice < 0 || choice > 100) + if(isnull(choice) || choice < 0 || choice > 100) return event_delay_mod_major = choice refresh_event_modifiers() diff --git a/code/game/gamemodes/game_mode_latespawn.dm b/code/game/gamemodes/game_mode_latespawn.dm index 9af35241441..450c2435194 100644 --- a/code/game/gamemodes/game_mode_latespawn.dm +++ b/code/game/gamemodes/game_mode_latespawn.dm @@ -8,7 +8,8 @@ ///process() ///Called by the gameticker /datum/game_mode/proc/process() - try_latespawn() + if(prob(5)) + try_latespawn() /datum/game_mode/proc/latespawn(var/mob/living/carbon/human/character) if(!character.mind) @@ -21,9 +22,6 @@ if(emergency_shuttle.departed || !round_autoantag) return - if(!prob(get_antag_prob())) - return - var/list/usable_templates if(latejoin_only && latejoin_templates.len) usable_templates = get_usable_templates(latejoin_templates) @@ -31,13 +29,7 @@ usable_templates = get_usable_templates(antag_templates) else return + if(usable_templates.len) var/datum/antagonist/spawn_antag = pick(usable_templates) spawn_antag.attempt_late_spawn(player) - -/datum/game_mode/proc/get_antag_prob() - var/player_count = 0 - for(var/mob/living/M in mob_list) - if(M.client) - player_count += 1 - return min(100,max(0,(player_count - 5 * 10) * 5)) \ No newline at end of file diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 9d2865dea12..d4b93665ce4 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -7,5 +7,11 @@ required_enemies = 1 uplink_welcome = "AntagCorp Portable Teleportation Relay:" end_on_antag_death = 1 + antag_tags = list(MODE_TRAITOR) antag_scaling_coeff = 10 - antag_tags = list(MODE_TRAITOR) \ No newline at end of file + +/datum/game_mode/traitor/auto + name = "autotraitor" + config_tag = "autotraitor" + round_autoantag = 1 + antag_scaling_coeff = 1 \ No newline at end of file diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 8fba13b9f06..32b7ec927bc 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1166,26 +1166,21 @@ proc/admin_notice(var/message, var/rights) out += "[antag_tag].
" if(ticker.mode.round_autoantag) - out += "Autotraitor enabled ([ticker.mode.get_antag_prob()]% spawn chance)" - if(ticker.mode.antag_scaling_coeff) + out += "Autotraitor enabled." + if(ticker.mode.antag_scaling_coeff > 0) out += " (scaling with [ticker.mode.antag_scaling_coeff])" + else + out += " (not currently scaling, set a coefficient)" out += "
" else out += "Autotraitor disabled.
" out += "All antag ids:" if(ticker.mode.antag_templates && ticker.mode.antag_templates.len). - var/playercount = ticker.mode.num_players() for(var/datum/antagonist/antag in ticker.mode.antag_templates) - var/cur_max_antags - if(ticker.mode.antag_tags && (antag.id in ticker.mode.antag_tags)) - cur_max_antags = antag.max_antags_round - else - cur_max_antags = antag.max_antags - if(ticker.mode.antag_scaling_coeff) - cur_max_antags = Clamp((playercount/ticker.mode.antag_scaling_coeff), 1, cur_max_antags) + antag.update_current_antag_max() out += " [antag.id]" - out += " ([antag.get_antag_count()]/[cur_max_antags]) " + out += " ([antag.get_antag_count()]/[antag.cur_max]) " out += " \[-\]
" else out += " None."