mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-26 01:22:03 +00:00
* Some crime and citations fixes (#85733) ## About The Pull Request 1. Silicons now able to invalidate crimes, because... they have armory access too. 2. After citation being paid off there will be no more broken 0 in sec records 3. After citation being paid off it will be invalidated automticaly 4. Crime authors can invalidate crimes, issued by them. 5. In case of invalidation, crime now shows who voided it 6. Also fixing bug with editing crime description <details> <summary>Screenshots</summary>    </details> ## Why It's Good For The Game Thats few fixes and QoLs features. If someone want to argue about: 1. Synths: man they was able to issue crimes which is more impactfull + now voiding is recorded 2. Authors: they had ability to edit name and description, why can't delete? 3. Voiders: how offen do you use invalidate button? How many of those uses you wanna hide from sec? ## Changelog 🆑 fix: Strange zeros in paid off citations on sec records fix: Now invalidating citations works fix: You can change crimes description fix: Synths have 'armory access' for sec records logic qol: Paying off citation now automaticaly voiding it qol: Crime issuer can void the crime without armory access qol: In case of invalidation crime shows who voided it /🆑 * Some crime and citations fixes --------- Co-authored-by: Archemagus <32466328+Archemagus@users.noreply.github.com>
69 lines
1.7 KiB
Plaintext
69 lines
1.7 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
|
|
/// Player that marked the crime as invalid
|
|
var/voider
|
|
|
|
/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)
|
|
if(amount <= 0)
|
|
return FALSE
|
|
|
|
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/messenger_ref in GLOB.pda_messengers)
|
|
var/datum/computer_file/program/messenger/messenger = GLOB.pda_messengers[messenger_ref]
|
|
if(messenger.computer.saved_identification != target_name)
|
|
continue
|
|
|
|
var/datum/signal/subspace/messaging/tablet_message/signal = new(source, list(
|
|
"fakename" = "Security Citation",
|
|
"fakejob" = "Citation Server",
|
|
"message" = message,
|
|
"targets" = list(messenger),
|
|
"automated" = TRUE
|
|
))
|
|
signal.send_to_receivers()
|
|
sender.log_message("(PDA: Citation Server) sent \"[message]\" to [signal.format_target()]", LOG_PDA)
|
|
break
|
|
|
|
return TRUE
|