mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-11 16:14:08 +01:00
f893f72851
## About The Pull Request 1. Dock Pay smite now adds to audit and transaction log 2. Dock Pay smite now always notifies card holder regardless of bank alert preference 3. Adds better support for negative money (ie, giving money) ## Why It's Good For The Game 1. Allows for people to trace where money is going, even if it is vanishing 2. So people can actually know the smite hit them 3. Request ## Changelog 🆑 Melbert qol: If your pay gets docked by Central Command, it is noted in audit and transaction log qol: If your pay gets docked by Central Command, you will always be notified, regardless of bank alert preference admin: Dock Pay smite supports negatives better (for an easy way to give someone money) /🆑
32 lines
1.5 KiB
Plaintext
32 lines
1.5 KiB
Plaintext
/// Docks the target's pay
|
|
/datum/smite/dock_pay
|
|
name = "Dock Pay"
|
|
|
|
/datum/smite/dock_pay/effect(client/user, mob/living/target)
|
|
. = ..()
|
|
if (!iscarbon(target))
|
|
to_chat(user, span_warning("This must be used on a carbon mob."), confidential = TRUE)
|
|
return
|
|
var/mob/living/carbon/dude = target
|
|
var/obj/item/card/id/card = dude.get_idcard(TRUE)
|
|
if (!card)
|
|
to_chat(user, span_warning("[dude] does not have an ID card on!"), confidential = TRUE)
|
|
return
|
|
if (!card.registered_account)
|
|
to_chat(user, span_warning("[dude] does not have an ID card with an account!"), confidential = TRUE)
|
|
return
|
|
if (card.registered_account.account_balance == 0)
|
|
to_chat(user, span_warning("ID Card lacks any funds. No pay to dock."))
|
|
return
|
|
var/new_cost = input("How much pay are we docking? Negative = giving money. Current balance: [card.registered_account.account_balance] [MONEY_NAME].", "BUDGET CUTS") as num|null
|
|
if (!new_cost)
|
|
return
|
|
if(new_cost < 0)
|
|
card.registered_account.adjust_money(new_cost, "Central Command: Pay Bonus")
|
|
card.registered_account.bank_card_talk("[new_cost] [MONEY_NAME] added to your account based on performance review by Central Command.", force = TRUE)
|
|
else
|
|
SSeconomy.add_audit_entry(card.registered_account, new_cost, "Central Command")
|
|
card.registered_account.adjust_money(-new_cost, "Central Command: Pay Cut")
|
|
card.registered_account.bank_card_talk("[new_cost] [MONEY_NAME] deducted from your account based on performance review by Central Command.", force = TRUE)
|
|
SEND_SOUND(target, 'sound/machines/buzz/buzz-sigh.ogg')
|