From 0534fe5aa3788132a3bb83c8b9301f2b0eb2570c Mon Sep 17 00:00:00 2001 From: gurfan <51427771+gurfan@users.noreply.github.com> Date: Sun, 4 Oct 2020 14:11:52 -0500 Subject: [PATCH] Malfunctioning AIs: Fix Overload Machine not working on some machines (#27848) * blcaklist, add intercom * fix * re-rework into a proc * add these --- code/ATMOSPHERICS/atmospherics.dm | 3 +++ code/game/gamemodes/malfunction/Malf_Modules.dm | 2 ++ code/game/machinery/OpTable.dm | 3 +++ code/game/machinery/bees_apiary.dm | 3 +++ code/game/machinery/doors/door.dm | 5 +++++ code/game/machinery/iv_drip.dm | 3 +++ code/game/machinery/machinery.dm | 2 +- code/game/machinery/shieldgen.dm | 3 +++ code/modules/power/apc.dm | 2 ++ code/modules/power/lighting/lighting.dm | 6 ++++++ code/modules/power/power.dm | 2 ++ .../research/xenoarchaeology/artifact/artifact_unknown.dm | 3 +++ 12 files changed, 36 insertions(+), 1 deletion(-) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index ec43886177f..c390fdb12d9 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -395,6 +395,9 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/is_airtight() //Technically, smoke would be able to pop up from a vent, but enabling ventcrawling mobs to do that still doesn't sound like a good idea return 1 +/obj/machinery/atmospherics/can_overload() + return 0 + // Tiny helper to see if the object is "exposed". // Basically whether it's partially covered up by a floor tile or not. /obj/machinery/atmospherics/proc/exposed() diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 58dac42010c..3e11a425cf4 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -125,6 +125,8 @@ rcd light flash thingy on matter drain override_base = "malf" /spell/targeted/overload_machine/is_valid_target(var/atom/target) + if(istype(target, /obj/item/device/radio/intercom)) + return 1 if (istype(target, /obj/machinery)) var/obj/machinery/M = target return M.can_overload() diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 33378a8f902..3e8122afc59 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -160,6 +160,9 @@ return //user.drop_item(W, src.loc) why? +/obj/machinery/optable/can_overload() + return 0 + /obj/machinery/optable/npc_tamper_act(mob/living/user) //Messages are overridden for this proc . = NPC_TAMPER_ACT_NOMSG diff --git a/code/game/machinery/bees_apiary.dm b/code/game/machinery/bees_apiary.dm index c9f4d42497f..a37744c5b9d 100644 --- a/code/game/machinery/bees_apiary.dm +++ b/code/game/machinery/bees_apiary.dm @@ -491,6 +491,9 @@ var/list/apiaries_list = list() consume.reagents.clear_reagents() +/obj/machinery/apiary/can_overload() + return 0 + ///////////////////////////WILD BEEHIVES//////////////////////////// /obj/structure/wild_apiary diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 804377e4f86..a106e99dfa8 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -445,6 +445,9 @@ var/list/all_doors = list() update_nearby_tiles() +/obj/machinery/door/can_overload() + return 0 + // Flash denied and such. /obj/machinery/door/proc/denied() playsound(loc, 'sound/machines/denied.ogg', 50, 1) @@ -455,3 +458,5 @@ var/list/all_doors = list() icon = 'icons/obj/doors/morgue.dmi' animation_delay = 15 penetration_dampening = 15 + + diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index de0ca717987..16c5e35327c 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -221,3 +221,6 @@ to_chat(user, "Attached is \an empty [beaker].") else to_chat(user, "No chemicals are attached.") + +/obj/machinery/iv_drip/can_overload() + return 0 diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 22930fbf2bc..4a4a74ee8c8 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -648,7 +648,7 @@ Class Procs: return 1 /obj/machinery/proc/can_overload(mob/user) //used for AI machine overload - return(src in machines) + return 1 /obj/machinery/proc/shock(mob/user, prb, var/siemenspassed = -1) if(stat & (BROKEN|NOPOWER)) // unpowered, no shock diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 993d9fc6092..0b81c207e68 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -541,6 +541,9 @@ /obj/machinery/shieldwall/acidable() return 0 +/obj/machinery/shieldwall/can_overload() + return 0 + /obj/machinery/shieldwall/New(var/obj/machinery/shieldwallgen/A, var/obj/machinery/shieldwallgen/B) ..() src.gen_primary = A diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 6baf50baa6e..71d37ce9b1d 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1043,6 +1043,8 @@ for(var/obj/item/weapon/pinpointer/point in pinpointer_list) point.target = null //the pinpointer will go back to pointing at the nuke disc. +/obj/machinery/power/apc/can_overload() + return 1 /obj/machinery/power/apc/proc/ion_act() //intended to be exactly the same as an AI malf attack diff --git a/code/modules/power/lighting/lighting.dm b/code/modules/power/lighting/lighting.dm index 26f6fdb7aca..92e7211adec 100644 --- a/code/modules/power/lighting/lighting.dm +++ b/code/modules/power/lighting/lighting.dm @@ -83,6 +83,9 @@ H.do_attack_animation(src, H) return SPECIAL_ATTACK_FAILED +/obj/machinery/light_construct/can_overload() + return 0 + /obj/machinery/light_construct/small name = "small light fixture frame" @@ -174,6 +177,9 @@ var/global/list/obj/machinery/light/alllights = list() H.apply_damage(rand(1,2), BRUTE, pick(LIMB_RIGHT_LEG, LIMB_LEFT_LEG, LIMB_RIGHT_FOOT, LIMB_LEFT_FOOT)) return SPECIAL_ATTACK_FAILED +/obj/machinery/light/can_overload() + return 0 + /obj/machinery/light/broken icon_state = "ltube-broken" //for the mapper spawn_with_bulb = /obj/item/weapon/light/tube/broken diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index a24bad7258a..29a62319aaa 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -172,6 +172,8 @@ return set_light(0) +/obj/machinery/power/can_overload() + return 0 // connect the machine to a powernet if a node cable is present on the turf /obj/machinery/power/proc/connect_to_network() diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm index 6af3e3e6146..d1bf4f6d9dc 100644 --- a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm +++ b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm @@ -245,3 +245,6 @@ var/list/razed_large_artifacts = list()//destroyed while still inside a rock wal if(prob(50)) M.Stun(5) M.apply_radiation(25, RAD_EXTERNAL) + +/obj/machinery/artifact/can_overload() + return 0 \ No newline at end of file