Files
Bubberstation/code/modules/admin/smites/retcon.dm
Roxy f3848f1ef2 Renames flatten_list proc to assoc_to_values (#93453)
## About The Pull Request

`/proc/flatten_list()` -> `/proc/assoc_to_values()`, also changes the
code doc to mirror the language of `assoc_to_keys()`'s code doc

## Why It's Good For The Game

Having a proc called `assoc_to_keys` that takes an associative list and
returns a list of the keys, and also having a proc that takes an
associative list and returns a list of the values, and the latter not
being called `assoc_to_values` is very funny

## Changelog
🆑
code: renamed flatten_list proc to assoc_to_values
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2025-10-14 21:01:09 +00:00

40 lines
1.2 KiB
Plaintext

/datum/smite/retcon
name = "Retcon"
/// how long until the thing attacked by this smite gets deleted
var/timer
/// the time it takes to actually do the fade out animation, the victim will always have some time still fully visible
var/fade_out_timer
/datum/smite/retcon/configure(client/user)
timer = tgui_input_number(user, "How long should it take before the target disappears, in seconds?", "Retcon", 5)
if (isnull(timer))
return FALSE
fade_out_timer = timer*3*0.2
/datum/smite/retcon/effect(client/user, mob/living/target)
. = ..()
target.fade_into_nothing(timer SECONDS,fade_out_timer SECONDS)
if(ishuman(target))
delete_record(target)
delete_bank_account(target)
reopen_job_slot(target)
/datum/smite/retcon/proc/delete_record(mob/living/target)
var/name = target.real_name
GLOB.manifest.remove(name)
/datum/smite/retcon/proc/delete_bank_account(mob/living/target)
var/name = target.real_name
var/account_list = assoc_to_values(SSeconomy.bank_accounts_by_id)
for(var/datum/bank_account/account in account_list)
if(account.account_holder == name)
qdel(account)
return
/datum/smite/retcon/proc/reopen_job_slot(mob/living/target)
var/datum/job/target_job = target.mind?.assigned_role
if(target_job)
target_job.total_positions += 1