[MIRROR] EMP & Wires refactor (#12658)

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-04-11 16:14:18 -04:00
committed by GitHub
co-authored by Guti Cameron Lennox
parent 494fc9bea9
commit b116cc450d
148 changed files with 665 additions and 384 deletions
@@ -235,6 +235,9 @@
// Parameters: None
// Description: Drops all calls when EMPed, so the holder can then get murdered by the antagonist.
/obj/item/communicator/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
close_connection(reason = "Hardware error de%#_^@%-BZZZZZZZT")
// Proc: add_to_EPv2()
+6 -2
View File
@@ -516,6 +516,9 @@
return 1
/obj/item/shockpaddles/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
var/new_safety = rand(0, 1)
if(safety != new_safety)
safety = new_safety
@@ -526,7 +529,6 @@
make_announcement("beeps, \"Safety protocols disabled!\"", "warning")
playsound(src, 'sound/machines/defib_safetyoff.ogg', 50, 0)
update_icon()
..()
/obj/item/shockpaddles/robot
name = "defibrillator paddles"
@@ -612,7 +614,9 @@
STOP_PROCESSING(SSobj, src)
/obj/item/shockpaddles/standalone/emp_act(severity, recursive)
..()
. = ..()
if (. & EMP_PROTECT_SELF)
return
var/new_fail = 0
switch(severity)
if(1)
+3 -1
View File
@@ -292,7 +292,9 @@
return
/obj/item/flash/emp_act(severity, recursive)
if(broken) return
. = ..()
if (. & EMP_PROTECT_SELF || broken)
return
flash_recharge()
if(!check_capacitor())
return
+2 -1
View File
@@ -167,7 +167,8 @@ GLOBAL_LIST_EMPTY(GPS_list)
update_icon()
/obj/item/gps/emp_act(severity, recursive)
if(emped) // Without a fancy callback system, this will have to do.
. = ..()
if (. & EMP_PROTECT_SELF || emped)
return
var/severity_modifier = severity ? severity : 4 // In case emp_act gets called without any arguments.
var/duration = 5 MINUTES / severity_modifier
+2 -2
View File
@@ -375,11 +375,11 @@
if(last_notify == 0 || (5 MINUTES <= world.time - last_notify))
audible_message(span_notice("\The [src] flashes a message across its screen, \"Additional personalities available for download.\""), hearing_distance = world.view, runemessage = "bleeps!")
last_notify = world.time
/*
/obj/item/paicard/emp_act(severity, recursive)
for(var/mob/M in src)
M.emp_act(severity, recursive)
*/
/obj/item/paicard/ex_act(severity)
if(pai)
pai.ex_act(severity)
@@ -112,6 +112,9 @@
*/
/obj/item/personal_shield_generator/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
if(bcell && shield_active)
switch(severity)
if(1) //Point blank EMP shots have a good chance of burning the cell charge.
@@ -14,7 +14,6 @@
var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies
var/canhear_range = 3 // the range which mobs can hear this radio from
var/loudspeaker = TRUE // Allows borgs to disable canhear_range.
var/datum/wires/radio/wires = null
var/b_stat = 0
var/broadcasting = FALSE
var/listening = TRUE
@@ -64,7 +63,7 @@
for (var/ch_name in channels)
secure_radio_connections[ch_name] = SSradio.add_object(src, GLOB.radiochannels[ch_name], RADIO_CHAT)
wires = new(src)
set_wires(new /datum/wires/radio(src))
internal_channels = GLOB.default_internal_channels.Copy()
GLOB.listening_objects += src
@@ -620,11 +619,13 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
else return
/obj/item/radio/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
broadcasting = FALSE
listening = FALSE
for (var/ch_name in channels)
channels[ch_name] = 0
..()
/obj/item/radio/start_off
listening = FALSE
+6 -6
View File
@@ -45,7 +45,7 @@
desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
icon_state = "chest"
part = list(BP_GROIN,BP_TORSO)
var/wires = 0.0
var/wires_const = 0.0
var/obj/item/cell/cell = null
/obj/item/robot_parts/head
@@ -139,13 +139,13 @@
if(istype(W, /obj/item/robot_parts/chest))
if(src.chest) return
if(W:wires && W:cell)
if(W:wires_const && W:cell)
user.drop_item()
W.loc = src
src.chest = W
src.update_icon()
else if(!W:wires)
to_chat(user, span_warning("You need to attach wires to it first!"))
else if(!W:wires_const)
to_chat(user, span_warning("You need to attach wires_const to it first!"))
else
to_chat(user, span_warning("You need to attach a cell to it first!"))
@@ -250,13 +250,13 @@
src.cell = W
to_chat(user, span_notice("You insert the cell!"))
if(istype(W, /obj/item/stack/cable_coil))
if(src.wires)
if(src.wires_const)
to_chat(user, span_warning("You have already inserted wire!"))
return
else
var/obj/item/stack/cable_coil/coil = W
coil.use(1)
src.wires = 1.0
src.wires_const = 1.0
to_chat(user, span_notice("You insert the wire!"))
return
@@ -23,6 +23,8 @@
energy = min(energy + amount, max_energy)
/datum/matter_synth/proc/emp_act(severity, recursive)
if (. & EMP_PROTECT_SELF)
return
use_charge(max_energy * 0.1 / severity)
/datum/matter_synth/medicine
@@ -8,7 +8,6 @@
flags = NOBLUDGEON
w_class = ITEMSIZE_SMALL
origin_tech = list(TECH_ILLEGAL = 2)
var/datum/wires/explosive/c4/wires = null
var/timer = 10
var/atom/target = null
var/open_panel = 0
@@ -20,7 +19,7 @@
/obj/item/plastique/Initialize(mapload)
. = ..()
wires = new(src)
set_wires(new /datum/wires/explosive/c4(src))
image_overlay = image('icons/obj/assemblies.dmi', "plastic-explosive2")
/obj/item/plastique/Destroy()
@@ -155,7 +155,8 @@ Implant Specifics:<BR>"}
return dat
/obj/item/implant/tracking/emp_act(severity, recursive)
if (malfunction) //no, dawg, you can't malfunction while you are malfunctioning
. = ..()
if (. & EMP_PROTECT_SELF || malfunction) //no, dawg, you can't malfunction while you are malfunctioning
return
malfunction = MALFUNCTION_TEMPORARY
@@ -295,7 +296,8 @@ Implant Specifics:<BR>"}
to_chat(usr, "The implanted explosive implant in [source] can be activated by saying something containing the phrase ''[src.phrase]'', <B>say [src.phrase]</B> to attempt to activate.")
/obj/item/implant/explosive/emp_act(severity, recursive)
if (malfunction)
. = ..()
if (. & EMP_PROTECT_SELF || malfunction)
return
malfunction = MALFUNCTION_TEMPORARY
switch (severity)
@@ -399,7 +401,8 @@ the implant may become unstable and either pre-maturely inject the subject or si
return
/obj/item/implant/chem/emp_act(severity, recursive)
if (malfunction)
. = ..()
if (. & EMP_PROTECT_SELF || malfunction)
return
malfunction = MALFUNCTION_TEMPORARY
@@ -565,7 +568,8 @@ the implant may become unstable and either pre-maturely inject the subject or si
STOP_PROCESSING(SSobj, src)
/obj/item/implant/death_alarm/emp_act(severity, recursive) //for some reason alarms stop going off in case they are emp'd, even without this
if (malfunction) //so I'm just going to add a meltdown chance here
. = ..()
if (. & EMP_PROTECT_SELF || malfunction) //so I'm just going to add a meltdown chance here
return
malfunction = MALFUNCTION_TEMPORARY
if(prob(40)) //CHOMPEDIT: Make the malfunction a probability because annoying
@@ -114,6 +114,9 @@
/obj/item/implant/sizecontrol/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
if(isliving(imp_in))
var/newsize = pick(RESIZE_HUGE,RESIZE_BIG,RESIZE_NORMAL,RESIZE_SMALL,RESIZE_TINY,RESIZE_A_HUGEBIG,RESIZE_A_BIGNORMAL,RESIZE_A_NORMALSMALL,RESIZE_A_SMALLTINY)
var/mob/living/H = imp_in
@@ -33,6 +33,9 @@
return dat
/obj/item/implant/integrated_circuit/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
IC.emp_act(severity, recursive)
/obj/item/implant/integrated_circuit/examine(mob/user)
@@ -51,9 +51,8 @@ Implant Specifics:<BR>"}
return dat
/obj/item/implant/neural/emp_act(severity, recursive)
if(!my_brain)
return
if(malfunction) //Don't malfunction while malfunctioning.
. = ..()
if (. & EMP_PROTECT_SELF || !my_brain || malfunction)
return
malfunction = MALFUNCTION_TEMPORARY
@@ -256,6 +256,8 @@
/obj/item/medigun_backpack/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
if(bcell)
bcell.emp_act(severity)
@@ -374,7 +374,7 @@
if(istype(AM, /obj) && proximity && active)
// EMP stuff.
var/obj/O = AM
O.emp_act(3) // A weaker severity is used because this has infinite uses.
O.emp_act(EMP_LIGHT) // A weaker severity is used because this has infinite uses.
playsound(O, 'sound/effects/EMPulse.ogg', 100, 1)
user.setClickCooldown(user.get_attack_speed(src)) // A lot of objects don't set click delay.
return ..()
@@ -383,7 +383,7 @@
. = ..()
if(target.isSynthetic() && active)
// Do some extra damage. Not a whole lot more since emp_act() is pretty nasty on FBPs already.
target.emp_act(3) // A weaker severity is used because this has infinite uses.
target.emp_act(EMP_LIGHT) // A weaker severity is used because this has infinite uses.
playsound(target, 'sound/effects/EMPulse.ogg', 100, 1)
target.adjustFireLoss(force * 3) // 15 Burn, for 20 total.
playsound(target, 'sound/weapons/blade1.ogg', 100, 1)
@@ -271,11 +271,12 @@
powercheck(hitcost)
/obj/item/melee/shock_maul/emp_act(severity, recursive)
if(status)
status = FALSE
visible_message(span_warning("\The [src]'s power field hisses and sputters out."))
update_held_icon()
..()
. = ..()
if (. & EMP_PROTECT_SELF || !status)
return
status = FALSE
visible_message(span_warning("\The [src]'s power field hisses and sputters out."))
update_held_icon()
/obj/item/melee/shock_maul/get_description_interaction()
var/list/results = list()
@@ -126,6 +126,9 @@
color = new_color
/obj/item/storage/wallet/poly/emp_act(severity, recursive)
. = ..()
if (. & EMP_PROTECT_SELF)
return
var/original_state = icon_state
icon_state = "wallet-emp"
update_icon()
@@ -134,7 +137,6 @@
if(src)
icon_state = original_state
update_icon()
..()
/obj/item/storage/wallet/womens
name = "women's wallet"