Merge pull request #5754 from Citadel-Station-13/upstream-merge-35485
[MIRROR] Antagonist reputation system
This commit is contained in:
@@ -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>"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user