mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Fixed it + made a helper
This commit is contained in:
@@ -238,6 +238,32 @@ proc/age2agedescription(age)
|
||||
if(70 to INFINITY) return "elderly"
|
||||
else return "unknown"
|
||||
|
||||
proc/set_criminal_status(mob/living/user, datum/data/record/target_records , criminal_status, comment, user_rank, var/list/authcard_access = list())
|
||||
var/status = criminal_status
|
||||
var/their_name = target_records.fields["name"]
|
||||
var/their_rank = target_records.fields["rank"]
|
||||
switch(criminal_status)
|
||||
if("arrest")
|
||||
status = "*Arrest*"
|
||||
if("none")
|
||||
status = "None"
|
||||
if("execute")
|
||||
if((access_magistrate in authcard_access) || (access_armory in authcard_access))
|
||||
status = "*Execute*"
|
||||
message_admins("[ADMIN_FULLMONTY(usr)] authorized <span class='warning'>EXECUTION</span> for [their_rank] [their_name], with comment: [comment]")
|
||||
else
|
||||
return 0
|
||||
if("incarcerated")
|
||||
status = "Incarcerated"
|
||||
if("parolled")
|
||||
status = "Parolled"
|
||||
if("released")
|
||||
status = "Released"
|
||||
target_records.fields["criminal"] = status
|
||||
log_admin("[key_name_admin(user)] set secstatus of [their_rank] [their_name] to [status], comment: [comment]")
|
||||
target_records.fields["comments"] += "Set to [status] by [user.name] ([user_rank]) on [current_date_string] [station_time_timestamp()], comment: [comment]"
|
||||
update_all_mob_security_hud()
|
||||
return 1
|
||||
|
||||
/*
|
||||
Proc for attack log creation, because really why not
|
||||
|
||||
@@ -324,6 +324,7 @@ var/record_id_num = 1001
|
||||
S.fields["notes"] = H.sec_record
|
||||
else
|
||||
S.fields["notes"] = "No notes."
|
||||
S.fields["comments"] = list()
|
||||
security += S
|
||||
|
||||
//Locked Record
|
||||
|
||||
@@ -169,41 +169,16 @@
|
||||
screen = SEC_DATA_R_LIST
|
||||
if("criminal")
|
||||
if(active2)
|
||||
var/their_name = active2.fields["name"]
|
||||
var/their_rank = active2.fields["rank"]
|
||||
var/t1
|
||||
if(temp_href[2] == "execute")
|
||||
t1 = copytext(trim(sanitize(input("Explain why they are being executed. Include a list of their crimes, and victims.", "EXECUTION ORDER", null, null) as text)), 1, MAX_MESSAGE_LEN)
|
||||
else
|
||||
t1 = copytext(trim(sanitize(input("Enter Reason:", "Secure. records", null, null) as text)), 1, MAX_MESSAGE_LEN)
|
||||
var/visible_reason
|
||||
if(t1)
|
||||
visible_reason = t1
|
||||
else
|
||||
if(!t1)
|
||||
t1 = "(none)"
|
||||
visible_reason = "<span class='warning'>NO REASON PROVIDED</span>"
|
||||
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("[ADMIN_FULLMONTY(usr)] authorized <span class='warning'>EXECUTION</span> for [their_rank] [their_name], with comment: [visible_reason]")
|
||||
else
|
||||
setTemp("<h3 class='bad'>Error: permission denied.</h3>")
|
||||
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] [station_time_timestamp()], comment: [t1]"
|
||||
update_all_mob_security_hud()
|
||||
if(!set_criminal_status(usr, active2, temp_href[2], t1, rank, authcard_access))
|
||||
setTemp("<h3 class='bad'>Error: permission denied.</h3>")
|
||||
return 1
|
||||
if("rank")
|
||||
if(active1)
|
||||
active1.fields["rank"] = temp_href[2]
|
||||
|
||||
@@ -731,25 +731,22 @@
|
||||
|
||||
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
|
||||
else
|
||||
var/rank
|
||||
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] [station_time_timestamp()] with comment: [t1]<BR>"
|
||||
if(isrobot(usr))
|
||||
rank = U.get_assignment()
|
||||
else 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] [station_time_timestamp()] 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] [station_time_timestamp()] with comment: [t1]<BR>"
|
||||
|
||||
R.fields["criminal"] = setcriminal
|
||||
log_admin("[key_name_admin(usr)] set secstatus of [their_rank] [their_name] to [setcriminal], comment: [t1]")
|
||||
spawn()
|
||||
sec_hud_set_security_status()
|
||||
rank = "[U.modtype] [U.braintype]"
|
||||
else if(isAI(usr))
|
||||
rank = "AI"
|
||||
set_criminal_status(usr, R, setcriminal, t1, rank)
|
||||
break // Git out of the securiy records loop!
|
||||
if(found_record)
|
||||
break // Git out of the general records
|
||||
|
||||
if(!found_record)
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
Reference in New Issue
Block a user