mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Merge pull request #8044 from Kyep/sec_status_execute
Adds 'Execute' status, sec status change logging
This commit is contained in:
@@ -197,6 +197,9 @@
|
||||
var/datum/data/record/R = find_record("name", perpname, data_core.security)
|
||||
if(R)
|
||||
switch(R.fields["criminal"])
|
||||
if("*Execute*")
|
||||
holder.icon_state = "hudexecute"
|
||||
return
|
||||
if("*Arrest*")
|
||||
holder.icon_state = "hudwanted"
|
||||
return
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/authenticated = null
|
||||
var/rank = null
|
||||
var/list/authcard_access = list()
|
||||
var/screen = null
|
||||
var/datum/data/record/active1 = null
|
||||
var/datum/data/record/active2 = null
|
||||
@@ -66,6 +67,8 @@
|
||||
break
|
||||
var/background = "''"
|
||||
switch(crimstat)
|
||||
if("*Execute*")
|
||||
background = "'background-color:#5E0A1A'"
|
||||
if("*Arrest*")
|
||||
background = "'background-color:#890E26'"
|
||||
if("Incarcerated")
|
||||
@@ -162,18 +165,33 @@
|
||||
screen = SEC_DATA_R_LIST
|
||||
if("criminal")
|
||||
if(active2)
|
||||
var/their_name = active2.fields["name"]
|
||||
var/their_rank = active2.fields["rank"]
|
||||
var/t1 = copytext(trim(sanitize(input("Enter Reason:", "Secure. records", null, null) as text)), 1, MAX_MESSAGE_LEN)
|
||||
if(!t1)
|
||||
t1 = "(none)"
|
||||
switch(temp_href[2])
|
||||
if("none")
|
||||
active2.fields["criminal"] = "None"
|
||||
if("arrest")
|
||||
active2.fields["criminal"] = "*Arrest*"
|
||||
if("execute")
|
||||
if((access_magistrate in authcard_access) || (access_armory in authcard_access))
|
||||
active2.fields["criminal"] = "*Execute*"
|
||||
message_admins("[key_name_admin(usr)] authorized execution for [their_rank] [their_name], with comment: [t1]")
|
||||
else
|
||||
setTemp("<h3 class='bad'>Error: permission denied.</h3>")
|
||||
//to_chat(usr, "<span class='notice'>Error: permission denied.</span>")
|
||||
return 1
|
||||
if("incarcerated")
|
||||
active2.fields["criminal"] = "Incarcerated"
|
||||
if("parolled")
|
||||
active2.fields["criminal"] = "Parolled"
|
||||
if("released")
|
||||
active2.fields["criminal"] = "Released"
|
||||
|
||||
var/newstatus = active2.fields["criminal"]
|
||||
log_admin("[key_name_admin(usr)] set secstatus of [their_rank] [their_name] to [newstatus], comment: [t1]")
|
||||
active2.fields["comments"] += "Set to [newstatus] by [usr.name] ([rank]) on [current_date_string] [worldtime2text()], comment: [t1]"
|
||||
update_all_mob_security_hud()
|
||||
if("rank")
|
||||
if(active1)
|
||||
@@ -206,6 +224,7 @@
|
||||
if(check_access(scan))
|
||||
authenticated = scan.registered_name
|
||||
rank = scan.assignment
|
||||
authcard_access = scan.access
|
||||
|
||||
if(authenticated)
|
||||
active1 = null
|
||||
@@ -218,6 +237,7 @@
|
||||
screen = null
|
||||
active1 = null
|
||||
active2 = null
|
||||
authcard_access = list()
|
||||
|
||||
else if(href_list["sort"])
|
||||
// Reverse the order if clicked twice
|
||||
@@ -458,6 +478,7 @@
|
||||
buttons[++buttons.len] = list("name" = "None", "icon" = "unlock", "href" = "criminal=none", "status" = (active2.fields["criminal"] == "None" ? "selected" : null))
|
||||
buttons[++buttons.len] = list("name" = "*Arrest*", "icon" = "lock", "href" = "criminal=arrest", "status" = (active2.fields["criminal"] == "*Arrest*" ? "selected" : null))
|
||||
buttons[++buttons.len] = list("name" = "Incarcerated", "icon" = "lock", "href" = "criminal=incarcerated", "status" = (active2.fields["criminal"] == "Incarcerated" ? "selected" : null))
|
||||
buttons[++buttons.len] = list("name" = "*Execute*", "icon" = "lock", "href" = "criminal=execute", "status" = (active2.fields["criminal"] == "*Execute*" ? "selected" : null))
|
||||
buttons[++buttons.len] = list("name" = "Parolled", "icon" = "unlock-alt", "href" = "criminal=parolled", "status" = (active2.fields["criminal"] == "Parolled" ? "selected" : null))
|
||||
buttons[++buttons.len] = list("name" = "Released", "icon" = "unlock", "href" = "criminal=released", "status" = (active2.fields["criminal"] == "Released" ? "selected" : null))
|
||||
setTemp("<h3>Criminal Status</h3>", buttons)
|
||||
|
||||
@@ -797,7 +797,7 @@
|
||||
if(href_list["criminal"])
|
||||
if(hasHUD(usr,"security"))
|
||||
|
||||
var/modified = 0
|
||||
var/found_record = 0
|
||||
var/perpname = "wot"
|
||||
if(wear_id)
|
||||
var/obj/item/weapon/card/id/I = wear_id.GetID()
|
||||
@@ -815,16 +815,33 @@
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
|
||||
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel")
|
||||
var/t1 = copytext(trim(sanitize(input("Enter Reason:", "Security HUD", null, null) as text)), 1, MAX_MESSAGE_LEN)
|
||||
if(!t1)
|
||||
t1 = "(none)"
|
||||
|
||||
if(hasHUD(usr, "security") && setcriminal != "Cancel")
|
||||
found_record = 1
|
||||
var/their_name = R.fields["name"]
|
||||
var/their_rank = R.fields["rank"]
|
||||
if(R.fields["criminal"] == "*Execute*")
|
||||
to_chat(usr, "<span class='warning'>Unable to modify the sec status of a person with an active Execution order. Use a security computer instead.</span>")
|
||||
else
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/U = usr
|
||||
R.fields["comments"] += "Set to [setcriminal] by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [worldtime2text()] with comment: [t1]<BR>"
|
||||
if(isrobot(usr))
|
||||
var/mob/living/silicon/robot/U = usr
|
||||
R.fields["comments"] += "Set to [setcriminal] by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [worldtime2text()] with comment: [t1]<BR>"
|
||||
if(isAI(usr))
|
||||
var/mob/living/silicon/ai/U = usr
|
||||
R.fields["comments"] += "Set to [setcriminal] by [U.name] (artificial intelligence) on [current_date_string] [worldtime2text()] with comment: [t1]<BR>"
|
||||
|
||||
if(hasHUD(usr, "security"))
|
||||
if(setcriminal != "Cancel")
|
||||
R.fields["criminal"] = setcriminal
|
||||
modified = 1
|
||||
|
||||
log_admin("[key_name_admin(usr)] set secstatus of [their_rank] [their_name] to [setcriminal], comment: [t1]")
|
||||
spawn()
|
||||
sec_hud_set_security_status()
|
||||
|
||||
if(!modified)
|
||||
if(!found_record)
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["secrecord"])
|
||||
@@ -1762,6 +1779,8 @@
|
||||
var/datum/data/record/R = find_record("name", perpname, data_core.security)
|
||||
if(R && R.fields["criminal"])
|
||||
switch(R.fields["criminal"])
|
||||
if("*Execute*")
|
||||
threatcount += 7
|
||||
if("*Arrest*")
|
||||
threatcount += 5
|
||||
if("Incarcerated")
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Reference in New Issue
Block a user