From d060e4e9967bf7dd25f7d23e4ab27ed861cc620a Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 2 Jun 2018 19:48:19 -0400 Subject: [PATCH] Antag reputation rewards are now configurable (#38077) * Antag reputation rewards are now configurable * Use keyed_number_list for antag rep --- code/controllers/configuration/entries/game_options.dm | 2 ++ code/controllers/subsystem/job.dm | 2 +- code/modules/jobs/job_types/job.dm | 6 ++++++ config/antag_rep.txt | 5 +++++ config/config.txt | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 config/antag_rep.txt diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index f8f31348204..9f38aa762b7 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -288,6 +288,8 @@ /datum/config_entry/flag/shift_time_realtime +/datum/config_entry/keyed_number_list/antag_rep + /datum/config_entry/number/monkeycap config_entry_value = 64 min_val = 0 diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index a1f56bf9b04..2681821e1b8 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -420,7 +420,7 @@ SUBSYSTEM_DEF(job) else M = H - SSpersistence.antag_rep_change[M.client.ckey] += job.antag_rep + SSpersistence.antag_rep_change[M.client.ckey] += job.GetAntagRep() to_chat(M, "You are the [rank].") if(job) diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm index 87db3146e49..1cd7f59a273 100644 --- a/code/modules/jobs/job_types/job.dm +++ b/code/modules/jobs/job_types/job.dm @@ -49,6 +49,7 @@ var/exp_type_department = "" //The amount of good boy points playing this role will earn you towards a higher chance to roll antagonist next round + //can be overriden by antag_rep.txt config var/antag_rep = 10 //Only override this proc @@ -67,6 +68,11 @@ /datum/job/proc/special_check_latejoin(client/C) return TRUE +/datum/job/proc/GetAntagRep() + . = CONFIG_GET(keyed_number_list/antag_rep)[lowertext(title)] + if(. == null) + return antag_rep + //Don't override this unless the job transforms into a non-human (Silicons do this for example) /datum/job/proc/equip(mob/living/carbon/human/H, visualsOnly = FALSE, announce = TRUE, latejoin = FALSE) if(!H) diff --git a/config/antag_rep.txt b/config/antag_rep.txt new file mode 100644 index 00000000000..a26b157d5a8 --- /dev/null +++ b/config/antag_rep.txt @@ -0,0 +1,5 @@ +## Custom antag reputation values +## List of job titles followed by antag rep value, all prefixed with ANTAG_REP. See code/modules/jobs/job_types for titles +## e.g. +## ANTAG_REP Captain 10 +## ANTAG_REP Assistant 0 diff --git a/config/config.txt b/config/config.txt index da2cce93aa7..56f19ba8564 100644 --- a/config/config.txt +++ b/config/config.txt @@ -3,6 +3,7 @@ $include game_options.txt $include dbconfig.txt $include comms.txt +$include antag_rep.txt # You can use the @ character at the beginning of a config option to lock it from being edited in-game # Example usage: