mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
Ghosts can see info about Wanted Status and Sec Records (#80692)
## About The Pull Request Ghosts can examine people to see Wanted Status and view their Sec Records which show crimes ## Why It's Good For The Game More fun observer experience. You can already see the "W" hud, so more info is nice  ## Changelog 🆑 qol: Ghosts can now view Wanted Status and Sec Records by examining people /🆑
This commit is contained in:
@@ -151,6 +151,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
|
||||
SSpoints_of_interest.make_point_of_interest(src)
|
||||
ADD_TRAIT(src, TRAIT_HEAR_THROUGH_DARKNESS, ref(src))
|
||||
ADD_TRAIT(src, TRAIT_SECURITY_HUD, ref(src))
|
||||
|
||||
/mob/dead/observer/get_photo_description(obj/item/camera/camera)
|
||||
if(!invisibility || camera.see_ghosts)
|
||||
|
||||
@@ -383,7 +383,7 @@
|
||||
. += "<a href='?src=[REF(src)];hud=m;quirk=1;examine_time=[world.time]'>\[See quirks\]</a>"
|
||||
|
||||
if(HAS_TRAIT(user, TRAIT_SECURITY_HUD))
|
||||
if(!user.stat && user != src)
|
||||
if((user.stat == CONSCIOUS || isobserver(user)) && user != src)
|
||||
//|| !user.canmove || user.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at.
|
||||
var/wanted_status = WANTED_NONE
|
||||
var/security_note = "None."
|
||||
@@ -393,13 +393,16 @@
|
||||
wanted_status = target_record.wanted_status
|
||||
if(target_record.security_note)
|
||||
security_note = target_record.security_note
|
||||
|
||||
. += "<span class='deptradio'>Criminal status:</span> <a href='?src=[REF(src)];hud=s;status=1;examine_time=[world.time]'>\[[wanted_status]\]</a>"
|
||||
if(ishuman(user))
|
||||
. += "<span class='deptradio'>Criminal status:</span> <a href='?src=[REF(src)];hud=s;status=1;examine_time=[world.time]'>\[[wanted_status]\]</a>"
|
||||
else
|
||||
. += "<span class='deptradio'>Criminal status:</span> [wanted_status]"
|
||||
. += "<span class='deptradio'>Important Notes: [security_note]"
|
||||
. += jointext(list("<span class='deptradio'>Security record:</span> <a href='?src=[REF(src)];hud=s;view=1;examine_time=[world.time]'>\[View\]</a>",
|
||||
"<a href='?src=[REF(src)];hud=s;add_citation=1;examine_time=[world.time]'>\[Add citation\]</a>",
|
||||
"<a href='?src=[REF(src)];hud=s;add_crime=1;examine_time=[world.time]'>\[Add crime\]</a>",
|
||||
"<a href='?src=[REF(src)];hud=s;add_note=1;examine_time=[world.time]'>\[Add note\]</a>"), "")
|
||||
. += "<span class='deptradio'>Security record:</span> <a href='?src=[REF(src)];hud=s;view=1;examine_time=[world.time]'>\[View\]</a>"
|
||||
if(ishuman(user))
|
||||
. += jointext(list("<a href='?src=[REF(src)];hud=s;add_citation=1;examine_time=[world.time]'>\[Add citation\]</a>",
|
||||
"<a href='?src=[REF(src)];hud=s;add_crime=1;examine_time=[world.time]'>\[Add crime\]</a>",
|
||||
"<a href='?src=[REF(src)];hud=s;add_note=1;examine_time=[world.time]'>\[Add note\]</a>"), "")
|
||||
else if(isobserver(user))
|
||||
. += span_info("<b>Quirks:</b> [get_quirk_string(FALSE, CAT_QUIRK_ALL)]")
|
||||
. += "</span>"
|
||||
|
||||
@@ -94,22 +94,24 @@
|
||||
|
||||
///////HUDs///////
|
||||
if(href_list["hud"])
|
||||
if(!ishuman(usr))
|
||||
if(!ishuman(usr) && !isobserver(usr))
|
||||
return
|
||||
var/mob/living/carbon/human/human_user = usr
|
||||
var/mob/human_or_ghost_user = usr
|
||||
var/perpname = get_face_name(get_id_name(""))
|
||||
if(!HAS_TRAIT(human_user, TRAIT_SECURITY_HUD) && !HAS_TRAIT(human_user, TRAIT_MEDICAL_HUD))
|
||||
if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD) && !HAS_TRAIT(human_or_ghost_user, TRAIT_MEDICAL_HUD))
|
||||
return
|
||||
if((text2num(href_list["examine_time"]) + 1 MINUTES) < world.time)
|
||||
to_chat(human_user, "[span_notice("It's too late to use this now!")]")
|
||||
to_chat(human_or_ghost_user, "[span_notice("It's too late to use this now!")]")
|
||||
return
|
||||
var/datum/record/crew/target_record = find_record(perpname)
|
||||
if(href_list["photo_front"] || href_list["photo_side"])
|
||||
if(!target_record)
|
||||
return
|
||||
if(!human_user.canUseHUD())
|
||||
return
|
||||
if(!HAS_TRAIT(human_user, TRAIT_SECURITY_HUD) && !HAS_TRAIT(human_user, TRAIT_MEDICAL_HUD))
|
||||
if(ishuman(human_or_ghost_user))
|
||||
var/mob/living/carbon/human/human_user = human_or_ghost_user
|
||||
if(!human_user.canUseHUD())
|
||||
return
|
||||
if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD) && !HAS_TRAIT(human_or_ghost_user, TRAIT_MEDICAL_HUD))
|
||||
return
|
||||
var/obj/item/photo/photo_from_record = null
|
||||
if(href_list["photo_front"])
|
||||
@@ -117,10 +119,11 @@
|
||||
else if(href_list["photo_side"])
|
||||
photo_from_record = target_record.get_side_photo()
|
||||
if(photo_from_record)
|
||||
photo_from_record.show(human_user)
|
||||
photo_from_record.show(human_or_ghost_user)
|
||||
return
|
||||
|
||||
if(href_list["hud"] == "m")
|
||||
if(ishuman(human_or_ghost_user) && href_list["hud"] == "m")
|
||||
var/mob/living/carbon/human/human_user = human_or_ghost_user
|
||||
if(!HAS_TRAIT(human_user, TRAIT_MEDICAL_HUD))
|
||||
return
|
||||
if(href_list["evaluation"])
|
||||
@@ -198,33 +201,36 @@
|
||||
return //Medical HUD ends here.
|
||||
|
||||
if(href_list["hud"] == "s")
|
||||
if(!HAS_TRAIT(human_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
if(human_user.stat || human_user == src) //|| !human_user.canmove || human_user.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at.
|
||||
return //Non-fluff: This allows sec to set people to arrest as they get disarmed or beaten
|
||||
// Checks the user has security clearence before allowing them to change arrest status via hud, comment out to enable all access
|
||||
var/allowed_access = null
|
||||
var/obj/item/clothing/glasses/hud/security/user_glasses = human_user.glasses
|
||||
if(istype(user_glasses) && (user_glasses.obj_flags & EMAGGED))
|
||||
allowed_access = "@%&ERROR_%$*"
|
||||
else //Implant and standard glasses check access
|
||||
if(human_user.wear_id)
|
||||
var/list/access = human_user.wear_id.GetAccess()
|
||||
if(ACCESS_SECURITY in access)
|
||||
allowed_access = human_user.get_authentification_name()
|
||||
|
||||
if(!allowed_access)
|
||||
to_chat(human_user, span_warning("ERROR: Invalid access."))
|
||||
if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
if(ishuman(human_or_ghost_user))
|
||||
var/mob/living/carbon/human/human_user = human_or_ghost_user
|
||||
if(human_user.stat || human_user == src) //|| !human_user.canmove || human_user.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at.
|
||||
return //Non-fluff: This allows sec to set people to arrest as they get disarmed or beaten
|
||||
// Checks the user has security clearence before allowing them to change arrest status via hud, comment out to enable all access
|
||||
var/obj/item/clothing/glasses/hud/security/user_glasses = human_user.glasses
|
||||
if(istype(user_glasses) && (user_glasses.obj_flags & EMAGGED))
|
||||
allowed_access = "@%&ERROR_%$*"
|
||||
else //Implant and standard glasses check access
|
||||
if(human_user.wear_id)
|
||||
var/list/access = human_user.wear_id.GetAccess()
|
||||
if(ACCESS_SECURITY in access)
|
||||
allowed_access = human_user.get_authentification_name()
|
||||
|
||||
if(!allowed_access)
|
||||
to_chat(human_user, span_warning("ERROR: Invalid access."))
|
||||
return
|
||||
|
||||
if(!perpname)
|
||||
to_chat(human_user, span_warning("ERROR: Can not identify target."))
|
||||
to_chat(human_or_ghost_user, span_warning("ERROR: Can not identify target."))
|
||||
return
|
||||
target_record = find_record(perpname)
|
||||
if(!target_record)
|
||||
to_chat(human_user, span_warning("ERROR: Unable to locate data core entry for target."))
|
||||
to_chat(human_or_ghost_user, span_warning("ERROR: Unable to locate data core entry for target."))
|
||||
return
|
||||
if(href_list["status"])
|
||||
if(ishuman(human_or_ghost_user) && href_list["status"])
|
||||
var/mob/living/carbon/human/human_user = human_or_ghost_user
|
||||
var/new_status = tgui_input_list(human_user, "Specify a new criminal status for this person.", "Security HUD", WANTED_STATUSES(), target_record.wanted_status)
|
||||
if(!new_status || !target_record || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
@@ -240,66 +246,69 @@
|
||||
return
|
||||
|
||||
if(href_list["view"])
|
||||
if(!human_user.canUseHUD())
|
||||
if(ishuman(human_or_ghost_user))
|
||||
var/mob/living/carbon/human/human_user = human_or_ghost_user
|
||||
if(!human_user.canUseHUD())
|
||||
return
|
||||
if(!HAS_TRAIT(human_or_ghost_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
if(!HAS_TRAIT(human_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
to_chat(human_user, "<b>Name:</b> [target_record.name]")
|
||||
to_chat(human_user, "<b>Criminal Status:</b> [target_record.wanted_status]")
|
||||
to_chat(human_user, "<b>Citations:</b> [length(target_record.citations)]")
|
||||
to_chat(human_user, "<b>Note:</b> [target_record.security_note || "None"]")
|
||||
to_chat(human_user, "<b>Rapsheet:</b> [length(target_record.crimes)] incidents")
|
||||
var/sec_record_message = ""
|
||||
sec_record_message += "<b>Name:</b> [target_record.name]"
|
||||
sec_record_message += "\n<b>Criminal Status:</b> [target_record.wanted_status]"
|
||||
sec_record_message += "\n<b>Citations:</b> [length(target_record.citations)]"
|
||||
sec_record_message += "\n<b>Note:</b> [target_record.security_note || "None"]"
|
||||
sec_record_message += "\n<b>Rapsheet:</b> [length(target_record.crimes)] incidents"
|
||||
if(length(target_record.crimes))
|
||||
for(var/datum/crime/crime in target_record.crimes)
|
||||
if(!crime.valid)
|
||||
to_chat(human_user, span_notice("-- REDACTED --"))
|
||||
sec_record_message += span_notice("\n-- REDACTED --")
|
||||
continue
|
||||
|
||||
to_chat(human_user, "<b>Crime:</b> [crime.name]")
|
||||
to_chat(human_user, "<b>Details:</b> [crime.details]")
|
||||
to_chat(human_user, "Added by [crime.author] at [crime.time]")
|
||||
to_chat(human_user, "----------")
|
||||
|
||||
sec_record_message += "\n<b>Crime:</b> [crime.name]"
|
||||
sec_record_message += "\n<b>Details:</b> [crime.details]"
|
||||
sec_record_message += "\nAdded by [crime.author] at [crime.time]"
|
||||
to_chat(human_or_ghost_user, examine_block(sec_record_message))
|
||||
return
|
||||
if(ishuman(human_or_ghost_user))
|
||||
var/mob/living/carbon/human/human_user = human_or_ghost_user
|
||||
if(href_list["add_citation"])
|
||||
var/max_fine = CONFIG_GET(number/maxfine)
|
||||
var/citation_name = tgui_input_text(human_user, "Citation crime", "Security HUD")
|
||||
var/fine = tgui_input_number(human_user, "Citation fine", "Security HUD", 50, max_fine, 5)
|
||||
if(!fine || !target_record || !citation_name || !allowed_access || !isnum(fine) || fine > max_fine || fine <= 0 || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
|
||||
var/datum/crime/citation/new_citation = new(name = citation_name, author = allowed_access, fine = fine)
|
||||
|
||||
target_record.citations += new_citation
|
||||
new_citation.alert_owner(usr, src, target_record.name, "You have been fined [fine] credits for '[citation_name]'. Fines may be paid at security.")
|
||||
investigate_log("New Citation: <strong>[citation_name]</strong> Fine: [fine] | Added to [target_record.name] by [key_name(human_user)]", INVESTIGATE_RECORDS)
|
||||
SSblackbox.ReportCitation(REF(new_citation), human_user.ckey, human_user.real_name, target_record.name, citation_name, fine)
|
||||
|
||||
if(href_list["add_citation"])
|
||||
var/max_fine = CONFIG_GET(number/maxfine)
|
||||
var/citation_name = tgui_input_text(human_user, "Citation crime", "Security HUD")
|
||||
var/fine = tgui_input_number(human_user, "Citation fine", "Security HUD", 50, max_fine, 5)
|
||||
if(!fine || !target_record || !citation_name || !allowed_access || !isnum(fine) || fine > max_fine || fine <= 0 || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
|
||||
var/datum/crime/citation/new_citation = new(name = citation_name, author = allowed_access, fine = fine)
|
||||
if(href_list["add_crime"])
|
||||
var/crime_name = tgui_input_text(human_user, "Crime name", "Security HUD")
|
||||
if(!target_record || !crime_name || !allowed_access || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
|
||||
target_record.citations += new_citation
|
||||
new_citation.alert_owner(usr, src, target_record.name, "You have been fined [fine] credits for '[citation_name]'. Fines may be paid at security.")
|
||||
investigate_log("New Citation: <strong>[citation_name]</strong> Fine: [fine] | Added to [target_record.name] by [key_name(human_user)]", INVESTIGATE_RECORDS)
|
||||
SSblackbox.ReportCitation(REF(new_citation), human_user.ckey, human_user.real_name, target_record.name, citation_name, fine)
|
||||
var/datum/crime/new_crime = new(name = crime_name, author = allowed_access)
|
||||
|
||||
return
|
||||
target_record.crimes += new_crime
|
||||
investigate_log("New Crime: <strong>[crime_name]</strong> | Added to [target_record.name] by [key_name(human_user)]", INVESTIGATE_RECORDS)
|
||||
to_chat(human_user, span_notice("Successfully added a crime."))
|
||||
|
||||
if(href_list["add_crime"])
|
||||
var/crime_name = tgui_input_text(human_user, "Crime name", "Security HUD")
|
||||
if(!target_record || !crime_name || !allowed_access || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
|
||||
var/datum/crime/new_crime = new(name = crime_name, author = allowed_access)
|
||||
if(href_list["add_note"])
|
||||
var/new_note = tgui_input_text(human_user, "Security note", "Security Records", multiline = TRUE)
|
||||
if(!target_record || !new_note || !allowed_access || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
|
||||
target_record.crimes += new_crime
|
||||
investigate_log("New Crime: <strong>[crime_name]</strong> | Added to [target_record.name] by [key_name(human_user)]", INVESTIGATE_RECORDS)
|
||||
to_chat(human_user, span_notice("Successfully added a crime."))
|
||||
target_record.security_note = new_note
|
||||
|
||||
return
|
||||
|
||||
if(href_list["add_note"])
|
||||
var/new_note = tgui_input_text(human_user, "Security note", "Security Records", multiline = TRUE)
|
||||
if(!target_record || !new_note || !allowed_access || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD))
|
||||
return
|
||||
|
||||
target_record.security_note = new_note
|
||||
|
||||
return
|
||||
|
||||
..() //end of this massive fucking chain. TODO: make the hud chain not spooky. - Yeah, great job doing that.
|
||||
|
||||
//called when something steps onto a human
|
||||
|
||||
Reference in New Issue
Block a user