From 9bd611848c6cb85f6890fae8c1e9bbdeae2c606b Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:14:53 +0300 Subject: [PATCH] [MIRROR] Minor Spy fixes, plus some bonus logging and feedback (#2259) * Minor Spy fixes, plus some bonus logging and feedback * Update spy_bounty.dm * Update spy_bounty.dm * Update spy_uplink.dm --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Iajret --- code/modules/antagonists/spy/spy_bounty.dm | 21 ++++++++++++++++++++- code/modules/antagonists/spy/spy_uplink.dm | 4 +++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/code/modules/antagonists/spy/spy_bounty.dm b/code/modules/antagonists/spy/spy_bounty.dm index 035ebba3405..aa80230603a 100644 --- a/code/modules/antagonists/spy/spy_bounty.dm +++ b/code/modules/antagonists/spy/spy_bounty.dm @@ -141,7 +141,15 @@ if(isitem(stealing) && ((stealing.resistance_flags & INDESTRUCTIBLE) || prob(black_market_prob))) addtimer(CALLBACK(src, PROC_REF(send_to_black_market), stealing), 0.5 SECONDS) else - QDEL_IN(stealing, 0.5 SECONDS) + addtimer(CALLBACK(src, PROC_REF(finish_cleanup), stealing), 0.5 SECONDS) + +/** + * Called when cleaning up a stolen atom that was NOT sent to the black market. + * + * * stealing - The item that was stolen. + */ +/datum/spy_bounty/proc/finish_cleanup(atom/movable/stealing) + qdel(stealing) /** * Handles putting the passed movable up on the black market. @@ -311,6 +319,10 @@ return TRUE +/datum/spy_bounty/machine/finish_cleanup(obj/machinery/stealing) + stealing.dump_inventory_contents() + return ..() + /datum/spy_bounty/machine/init_bounty(datum/spy_bounty_handler/handler) if(isnull(target_type)) return FALSE @@ -626,6 +638,13 @@ /datum/spy_bounty/some_bot/get_dupe_protection_key(atom/movable/stealing) return bot_type +/datum/spy_bounty/some_bot/finish_cleanup(mob/living/simple_animal/bot/stealing) + if(stealing.client) + to_chat(stealing, span_deadsay("You've been stolen! You are shipped off to the black market and taken apart for spare parts...")) + stealing.investigate_log("stole by a spy (and deleted)", INVESTIGATE_DEATHS) + stealing.ghostize() + return ..() + /datum/spy_bounty/some_bot/init_bounty(datum/spy_bounty_handler/handler) for(var/datum/spy_bounty/some_bot/existing_bounty in handler.get_all_bounties()) var/mob/living/simple_animal/bot/existing_bot_type = existing_bounty.bot_type diff --git a/code/modules/antagonists/spy/spy_uplink.dm b/code/modules/antagonists/spy/spy_uplink.dm index ea6f39fc92d..2a9d9b9b14e 100644 --- a/code/modules/antagonists/spy/spy_uplink.dm +++ b/code/modules/antagonists/spy/spy_uplink.dm @@ -97,6 +97,7 @@ to_chat(spy, span_warning("Your uplinks blinks red: [stealing] cannot be extracted from there.")) return FALSE + log_combat(spy, stealing, "started stealing", parent, "(spy bounty)") playsound(stealing, 'sound/items/pshoom.ogg', 33, vary = TRUE, extrarange = SILENCED_SOUND_EXTRARANGE, frequency = 0.33, ignore_walls = FALSE) var/obj/effect/scan_effect/active_scan_effect = new(stealing.loc) @@ -160,7 +161,8 @@ playsound(parent, 'sound/machines/wewewew.ogg', 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - log_spy("[key_name(spy)] completed the bounty [bounty.name] of difficulty [bounty.difficulty] for \a [reward].") + log_combat(spy, stealing, "stole", parent, "(spy bounty)") + log_spy("[key_name(spy)] completed the bounty [bounty.name] of difficulty [bounty.difficulty] by stealing [stealing] for \a [reward].") SSblackbox.record_feedback("nested tally", "spy_bounty", 1, list("[stealing.type]", "[bounty.type]", "[bounty.difficulty]", "[bounty.reward_item.type]")) var/datum/antagonist/spy/spy_datum = spy_ref?.resolve()