Merge pull request #5754 from Citadel-Station-13/upstream-merge-35485

[MIRROR] Antagonist reputation system
This commit is contained in:
LetterJay
2018-03-04 00:31:41 -06:00
committed by GitHub
29 changed files with 246 additions and 20 deletions

View File

@@ -44,6 +44,15 @@
body += "<br><br><b>Show related accounts by:</b> "
body += "\[ <a href='?_src_=holder;[HrefToken()];showrelatedacc=cid;client=[REF(M.client)]'>CID</a> | "
body += "<a href='?_src_=holder;[HrefToken()];showrelatedacc=ip;client=[REF(M.client)]'>IP</a> \]"
var/rep = 0
rep += SSpersistence.antag_rep[M.ckey]
body += "<br><br>Antagonist reputation: [rep]"
body += "<br><a href='?_src_=holder;[HrefToken()];modantagrep=add;mob=[REF(M)]'>\[increase\]</a> "
body += "<a href='?_src_=holder;[HrefToken()];modantagrep=subtract;mob=[REF(M)]'>\[decrease\]</a> "
body += "<a href='?_src_=holder;[HrefToken()];modantagrep=set;mob=[REF(M)]'>\[set\]</a> "
body += "<a href='?_src_=holder;[HrefToken()];modantagrep=zero;mob=[REF(M)]'>\[zero\]</a>"
body += "<br><br>"
body += "<A href='?_src_=holder;[HrefToken()];makementor=[M.ckey]'>Make mentor</A> | "
body += "<A href='?_src_=holder;[HrefToken()];removementor=[M.ckey]'>Remove mentor</A>"

View File

@@ -2413,6 +2413,15 @@
usr << browse(dat.Join("<br>"), "window=related_[C];size=420x300")
else if(href_list["modantagrep"])
if(!check_rights(R_ADMIN))
return
var/mob/M = locate(href_list["mob"]) in GLOB.mob_list
var/client/C = M.client
usr.client.cmd_admin_mod_antag_rep(C, href_list["modantagrep"])
show_player_panel(M)
/datum/admins/proc/HandleCMode()
if(!check_rights(R_ADMIN))
return

View File

@@ -47,6 +47,52 @@
admin_ticket_log(M, msg)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Subtle Message") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_mod_antag_rep(client/C in GLOB.clients, var/operation)
set category = "Special Verbs"
set name = "Modify Antagonist Reputation"
if(!check_rights(R_ADMIN))
return
var/msg = ""
var/log_text = ""
if(operation == "zero")
log_text = "Set to 0"
SSpersistence.antag_rep -= C.ckey
else
var/prompt = "Please enter the amount of reputation to [operation]:"
if(operation == "set")
prompt = "Please enter the new reputation value:"
msg = input("Message:", prompt) as num
if (!msg)
return
var/ANTAG_REP_MAXIMUM = CONFIG_GET(number/antag_rep_maximum)
if(operation == "set")
log_text = "Set to [num2text(msg)]"
SSpersistence.antag_rep[C.ckey] = max(0, min(msg, ANTAG_REP_MAXIMUM))
else if(operation == "add")
log_text = "Added [num2text(msg)]"
SSpersistence.antag_rep[C.ckey] = min(SSpersistence.antag_rep[C.ckey]+msg, ANTAG_REP_MAXIMUM)
else if(operation == "subtract")
log_text = "Subtracted [num2text(msg)]"
SSpersistence.antag_rep[C.ckey] = max(SSpersistence.antag_rep[C.ckey]-msg, 0)
else
to_chat(src, "Invalid operation for antag rep modification: [operation] by user [key_name(usr)]")
return
if(SSpersistence.antag_rep[C.ckey] <= 0)
SSpersistence.antag_rep -= C.ckey
log_admin("[key_name(usr)]: Modified [key_name(C)]'s antagonist reputation [log_text]")
message_admins("<span class='adminnotice'>[key_name_admin(usr)]: Modified [key_name(C)]'s antagonist reputation ([log_text])</span>")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Modify Antagonist Reputation") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_world_narrate()
set category = "Special Verbs"
set name = "Global Narrate"

View File

@@ -15,6 +15,7 @@ Captain
minimal_player_age = 14
exp_requirements = 180
exp_type = EXP_TYPE_CREW
antag_rep = 20
outfit = /datum/outfit/job/captain
@@ -69,6 +70,7 @@ Head of Personnel
exp_requirements = 180
exp_type = EXP_TYPE_CREW
// exp_type_department = EXP_TYPE_SUPPLY - CITADEL CHANGE
antag_rep = 16
outfit = /datum/outfit/job/hop

View File

@@ -11,6 +11,7 @@ Quartermaster
spawn_positions = 1
supervisors = "the head of personnel"
selection_color = "#d7b088"
antag_rep = 12
outfit = /datum/outfit/job/quartermaster
@@ -41,6 +42,7 @@ Cargo Technician
spawn_positions = 2
supervisors = "the quartermaster and the head of personnel"
selection_color = "#dcba97"
antag_rep = 4
outfit = /datum/outfit/job/cargo_tech
@@ -69,6 +71,7 @@ Shaft Miner
spawn_positions = 3
supervisors = "the quartermaster and the head of personnel"
selection_color = "#dcba97"
antag_rep = 8
outfit = /datum/outfit/job/miner
@@ -147,6 +150,7 @@ Bartender
spawn_positions = 1
supervisors = "the head of personnel"
selection_color = "#bbe291"
antag_rep = 4
outfit = /datum/outfit/job/bartender
@@ -180,6 +184,7 @@ Cook
supervisors = "the head of personnel"
selection_color = "#bbe291"
var/cooks = 0 //Counts cooks amount
antag_rep = 8
outfit = /datum/outfit/job/cook
@@ -232,6 +237,7 @@ Botanist
spawn_positions = 2
supervisors = "the head of personnel"
selection_color = "#bbe291"
antag_rep = 8
outfit = /datum/outfit/job/botanist
@@ -271,6 +277,7 @@ Janitor
supervisors = "the head of personnel"
selection_color = "#bbe291"
var/global/janitors = 0
antag_rep = 8
outfit = /datum/outfit/job/janitor

View File

@@ -11,6 +11,7 @@ Clown
spawn_positions = 1
supervisors = "the head of personnel"
selection_color = "#dddddd"
antag_rep = 4
outfit = /datum/outfit/job/clown
@@ -72,6 +73,7 @@ Mime
spawn_positions = 1
supervisors = "the head of personnel"
selection_color = "#dddddd"
antag_rep = 4
outfit = /datum/outfit/job/mime
@@ -122,6 +124,7 @@ Curator
spawn_positions = 1
supervisors = "the head of personnel"
selection_color = "#dddddd"
antag_rep = 4
outfit = /datum/outfit/job/curator
@@ -167,6 +170,7 @@ Lawyer
supervisors = "the head of personnel"
selection_color = "#dddddd"
var/lawyers = 0 //Counts lawyer amount
antag_rep = 8
outfit = /datum/outfit/job/lawyer

View File

@@ -12,6 +12,7 @@ Chaplain
spawn_positions = 1
supervisors = "the head of personnel"
selection_color = "#dddddd"
antag_rep = 4
outfit = /datum/outfit/job/chaplain

View File

@@ -17,6 +17,7 @@ Chief Engineer
exp_requirements = 180
exp_type = EXP_TYPE_CREW
exp_type_department = EXP_TYPE_ENGINEERING
antag_rep = 16
outfit = /datum/outfit/job/ce
@@ -76,6 +77,7 @@ Station Engineer
selection_color = "#fff5cc"
exp_requirements = 60
exp_type = EXP_TYPE_CREW
antag_rep = 8
outfit = /datum/outfit/job/engineer
@@ -132,6 +134,7 @@ Atmospheric Technician
selection_color = "#fff5cc"
exp_requirements = 60
exp_type = EXP_TYPE_CREW
antag_rep = 8
outfit = /datum/outfit/job/atmos

View File

@@ -48,6 +48,9 @@
var/exp_type = ""
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
var/antag_rep = 0
//Only override this proc
//H is usually a human unless an /equip override transformed it
/datum/job/proc/after_spawn(mob/living/H, mob/M)

View File

@@ -17,6 +17,7 @@ Chief Medical Officer
exp_requirements = 180
exp_type = EXP_TYPE_CREW
exp_type_department = EXP_TYPE_MEDICAL
antag_rep = 16
outfit = /datum/outfit/job/cmo
@@ -59,6 +60,7 @@ Medical Doctor
spawn_positions = 3
supervisors = "the chief medical officer"
selection_color = "#ffeef0"
antag_rep = 8
outfit = /datum/outfit/job/doctor
@@ -96,6 +98,7 @@ Chemist
selection_color = "#ffeef0"
exp_type = EXP_TYPE_CREW
exp_requirements = 60
antag_rep = 8
outfit = /datum/outfit/job/chemist
@@ -131,6 +134,7 @@ Geneticist
selection_color = "#ffeef0"
exp_type = EXP_TYPE_CREW
exp_requirements = 60
antag_rep = 8
outfit = /datum/outfit/job/geneticist
@@ -167,6 +171,7 @@ Virologist
selection_color = "#ffeef0"
exp_type = EXP_TYPE_CREW
exp_requirements = 60
antag_rep = 8
outfit = /datum/outfit/job/virologist

View File

@@ -17,6 +17,7 @@ Research Director
exp_type_department = EXP_TYPE_SCIENCE
exp_requirements = 180
exp_type = EXP_TYPE_CREW
antag_rep = 16
outfit = /datum/outfit/job/rd
@@ -72,6 +73,7 @@ Scientist
selection_color = "#ffeeff"
exp_requirements = 60
exp_type = EXP_TYPE_CREW
antag_rep = 8
outfit = /datum/outfit/job/scientist
@@ -106,6 +108,7 @@ Roboticist
selection_color = "#ffeeff"
exp_requirements = 60
exp_type = EXP_TYPE_CREW
antag_rep = 8
outfit = /datum/outfit/job/roboticist

View File

@@ -23,6 +23,7 @@ Head of Security
exp_requirements = 300
exp_type = EXP_TYPE_CREW
exp_type_department = EXP_TYPE_SECURITY
antag_rep = 20
outfit = /datum/outfit/job/hos
@@ -76,6 +77,7 @@ Warden
minimal_player_age = 7
exp_requirements = 300
exp_type = EXP_TYPE_CREW
antag_rep = 16
outfit = /datum/outfit/job/warden
@@ -128,6 +130,7 @@ Detective
minimal_player_age = 7
exp_requirements = 300
exp_type = EXP_TYPE_CREW
antag_rep = 12
outfit = /datum/outfit/job/detective
@@ -178,6 +181,7 @@ Security Officer
minimal_player_age = 7
exp_requirements = 300
exp_type = EXP_TYPE_CREW
antag_rep = 12
outfit = /datum/outfit/job/security

View File

@@ -14,6 +14,7 @@ AI
minimal_player_age = 30
exp_requirements = 180
exp_type = EXP_TYPE_CREW
antag_rep = 12
/datum/job/ai/equip(mob/living/carbon/human/H)
return H.AIize(FALSE)
@@ -52,4 +53,4 @@ Cyborg
/datum/job/cyborg/after_spawn(mob/living/silicon/robot/R, mob/M)
if(CONFIG_GET(flag/rename_cyborg)) //name can't be set in robot/New without the client
R.rename_self("cyborg", M.client)
R.rename_self("cyborg", M.client)