From 2adaabde71404e64ad8d7df874089e56a34655f4 Mon Sep 17 00:00:00 2001
From: Leland Kemble <70413276+lelandkemble@users.noreply.github.com>
Date: Fri, 5 Dec 2025 19:37:08 -0500
Subject: [PATCH] Fixes malf AI destroy rcds power not fully exploding Mech
RCDs (#94164)
## About The Pull Request
Malf AI blow rcds didnt work right on mech rcd module, because the
module isn't an RCD and simply holds an internal real rcd. This led to
the rcd "blowing" but remaining intact, just useless as its internal rcd
was gone. This modifies the exosuit variant internal RCD's detonation
proc such that it properly destroys the fake rcd shell.
## Why It's Good For The Game
fixes #93921
## Changelog
:cl:
fix: Malf AI "Destroy RCDs" power now properly destroys mech RCDs
/:cl:
---
code/game/objects/items/rcd/RCD.dm | 17 +++++++++++++++++
.../antagonists/malf_ai/malf_ai_modules.dm | 9 +++++----
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/code/game/objects/items/rcd/RCD.dm b/code/game/objects/items/rcd/RCD.dm
index 951580514a4..1e531a2ddcc 100644
--- a/code/game/objects/items/rcd/RCD.dm
+++ b/code/game/objects/items/rcd/RCD.dm
@@ -610,6 +610,23 @@
return gundam.use_energy(amount * MASS_TO_ENERGY)
return TRUE
+/obj/item/construction/rcd/exosuit/detonate_pulse()
+ var/obj/item/mecha_parts/mecha_equipment/rcd/ourshell = loc
+ if(!istype(ourshell))
+ return
+ ourshell.audible_message(span_danger("[ourshell] begins to vibrate and buzz loudly!"), \
+ span_danger("[ourshell] begins vibrating violently!"))
+ // 5 seconds to get rid of it
+ addtimer(CALLBACK(src, PROC_REF(detonate_pulse_explode)), 5 SECONDS)
+
+/obj/item/construction/rcd/exosuit/detonate_pulse_explode()
+ var/obj/item/mecha_parts/mecha_equipment/rcd/ourshell = loc
+ explosion(ourshell, light_impact_range = 3, flame_range = 1, flash_range = 1)
+ if(owner)
+ ourshell.detach()
+ qdel(ourshell)
+
+
#undef MASS_TO_ENERGY
#undef FREQUENT_USE_DEBUFF_MULTIPLIER
diff --git a/code/modules/antagonists/malf_ai/malf_ai_modules.dm b/code/modules/antagonists/malf_ai/malf_ai_modules.dm
index 377caebf7ea..f2c6eb49eda 100644
--- a/code/modules/antagonists/malf_ai/malf_ai_modules.dm
+++ b/code/modules/antagonists/malf_ai/malf_ai_modules.dm
@@ -505,10 +505,11 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module/malf))
cooldown_period = 10 SECONDS
/datum/action/innate/ai/destroy_rcds/Activate()
- for(var/I in GLOB.rcd_list)
- if(!istype(I, /obj/item/construction/rcd/borg)) //Ensures that cyborg RCDs are spared.
- var/obj/item/construction/rcd/RCD = I
- RCD.detonate_pulse()
+ for(var/potential_rcd in GLOB.rcd_list)
+ if(istype(potential_rcd, /obj/item/construction/rcd/borg)) //Ensures that cyborg RCDs are spared.
+ continue
+ var/obj/item/construction/rcd/definite_rcd = potential_rcd
+ definite_rcd.detonate_pulse()
to_chat(owner, span_danger("RCD detonation pulse emitted."))
owner.playsound_local(owner, 'sound/machines/beep/twobeep.ogg', 50, 0)