Skip to content

Commit

Permalink
[MIRROR] Minor Spy fixes, plus some bonus logging and feedback (#2259)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: Bloop <[email protected]>
Co-authored-by: Iajret <[email protected]>
  • Loading branch information
5 people authored Mar 5, 2024
1 parent 14f98d5 commit 9bd6118
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 20 additions & 1 deletion code/modules/antagonists/spy/spy_bounty.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion code/modules/antagonists/spy/spy_uplink.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 9bd6118

Please sign in to comment.