Files
Bubberstation/code/datums/records/crime.dm
Jeremiah 3715cae41d Records: Clerical expansion (#73022)
## About The Pull Request
A few changes to sec records geared towards making it obvious how and
why someone is wanted.

- You can no longer set someone to arrest via console unless they have a
valid prior.
- Setting players to arrest via HUD creates a crime entry for that
person.
- Priors can be edited by the author and qualified personnel (armory
access).
- Priors can be invalidated by qualified personnel. This redacts the
info from huds and rapsheets.
- Invalidating the last crime sets a player to discharged
- Much like real life, you can no longer outright delete crimes. This
prevents gaming the arrest system by adding/deleting.
- Deleting an individual record in a sec console removes it from the
manifest (@JohnFulpWillard) this was previous behavior
- Purging records in sec requires higher access

## Why It's Good For The Game
Have you ever brought a wanted person into the brig only to find there's
no reasons listed and no one in sec will explain why they're wanted?
## Changelog
🆑
fix: Deleting a sec record removes it from the manifest again
qol: It's now easier to see security notes via HUD.
qol: It's now easier to see why someone is set to arrest.
qol: Crime authors and armory access can edit crimes.
balance: Setting players to arrest requires a valid crime.
balance: Armory access can invalidate priors.
balance: Setting players to arrest via HUD creates a crime for the
suspect.
/🆑

---------

Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: san7890 <the@san7890.com>
2023-02-02 09:51:15 +13:00

63 lines
1.5 KiB
Plaintext

/**
* Crime data. Used to store information about crimes.
*/
/datum/crime
/// Name of the crime
var/name
/// Details about the crime
var/details
/// Player that wrote the crime
var/author
/// Time of the crime
var/time
/// Whether the crime is active or not
var/valid = TRUE
/datum/crime/New(name = "Crime", details = "No details provided.", author = "Anonymous")
src.author = author
src.details = details
src.name = name
src.time = station_time_timestamp()
/datum/crime/citation
/// Fine for the crime
var/fine
/// Amount of money paid for the crime
var/paid
/datum/crime/citation/New(name = "Citation", details = "No details provided.", author = "Anonymous", fine = 0)
. = ..()
src.fine = fine
src.paid = 0
/// Pays off a fine and attempts to fix any weird values.
/datum/crime/citation/proc/pay_fine(amount)
paid += amount
if(paid > fine)
paid = fine
fine -= amount
if(fine < 0)
fine = 0
return TRUE
/// Sends a citation alert message to the target's PDA.
/datum/crime/citation/proc/alert_owner(mob/sender, atom/source, target_name, message)
for(var/obj/item/modular_computer/tablet in GLOB.TabletMessengers)
if(tablet.saved_identification != target_name)
continue
var/datum/signal/subspace/messaging/tablet_msg/signal = new(source, list(
name = "Security Citation",
job = "Citation Server",
message = message,
targets = list(tablet),
automated = TRUE
))
signal.send_to_receivers()
sender.log_message("(PDA: Citation Server) sent \"[message]\" to [signal.format_target()]", LOG_PDA)
break
return TRUE