EMP Refactor & Multi Z-level EMPs (#17781)

* sdfasf

* sdfas

* dsf
This commit is contained in:
Fluffy
2023-12-04 19:37:49 +00:00
committed by GitHub
parent 8f1a282756
commit d8d063edc6
143 changed files with 744 additions and 272 deletions
+9 -4
View File
@@ -533,6 +533,8 @@
return TRUE
/obj/item/shockpaddles/emp_act(severity)
. = ..()
var/new_safety = rand(0, 1)
if(safety != new_safety)
safety = new_safety
@@ -543,7 +545,6 @@
make_announcement("beeps, \"Safety protocols disabled!\"", "warning")
playsound(get_turf(src), 'sound/machines/defib_safetyoff.ogg', 50, 0)
update_icon()
..()
/obj/item/shockpaddles/robot
name = "defibrillator paddles"
@@ -669,13 +670,17 @@
STOP_PROCESSING(SSprocessing, src)
/obj/item/shockpaddles/standalone/emp_act(severity)
..()
. = ..()
var/new_fail = 0
switch(severity)
if(3)
if(EMP_HEAVY)
new_fail = max(fail_counter, 20)
visible_message("\The [src]'s reactor overloads!")
if(2)
if(EMP_LIGHT)
new_fail = max(fail_counter, 8)
if(ismob(loc))
to_chat(loc, SPAN_WARNING("\The [src] feel pleasantly warm."))
@@ -252,6 +252,8 @@
..()
/obj/item/auto_cpr/emp_act(severity)
. = ..()
epp_off()
cpr_mode = FALSE
if(battery)
+2 -1
View File
@@ -152,12 +152,13 @@
L.disable_cloaking_device()
/obj/item/device/flash/emp_act(severity)
. = ..()
var/mob/living/L = loc
if(!istype(L) || broken || burnout_check(L, intensity = 15 / severity))
return
to_chat(L, SPAN_WARNING("Your [src] goes off!"))
flash(L)
..()
/obj/item/device/flash/synthetic
name = "synthetic flash"
@@ -87,7 +87,7 @@
var/obj/machinery/camera/C = target
if(prob(25))
C.emp_act(28)
C.emp_act(EMP_LIGHT)
selfmsg = "<span class='notice'>You hit the lens of \the [C] with \the [src], temporarily disabling the camera!</span>"
admin_attack_log(user, src,"hits the camera with a laser pointer", "EMPd a camera with a laser pointer")
@@ -215,9 +215,10 @@
update_light()
/obj/item/device/flashlight/emp_act(severity)
. = ..()
for(var/obj/O in contents)
O.emp_act(severity)
..()
/obj/item/device/flashlight/attack(mob/living/M as mob, mob/living/user as mob)
add_fingerprint(user)
@@ -429,6 +429,8 @@
M.show_message(SPAN_NOTICE("\The [src] flashes a message across its screen, \"Additional personalities available for download.\""), 3, SPAN_NOTICE("\The [src] bleeps electronically."), 2)
/obj/item/device/paicard/emp_act(severity)
. = ..()
for(var/mob/M in src)
M.emp_act(severity)
+2 -2
View File
@@ -171,10 +171,10 @@
else
AP.flicker_all()
else if (T.master)
T.master.emp_act(dist)
T.master.emp_act(EMP_LIGHT)
var/atom/aa = A
aa.emp_act(dist)
aa.emp_act(EMP_LIGHT)
if (prob(15 * dist))
explosion(aa.loc, 0, 0, 3, 4)
@@ -66,4 +66,6 @@ var/global/list/teleportbeacons = list()
return
/obj/item/device/radio/beacon/fixed/emp_act(severity)
. = ..()
return
@@ -541,11 +541,12 @@ var/global/list/default_interrogation_channels = list(
else return
/obj/item/device/radio/emp_act(severity)
. = ..()
set_broadcasting(FALSE)
set_listening(FALSE)
for (var/ch_name in channels)
channels[ch_name] = 0
..()
//
// Vesselbound Synthetic Radio
@@ -64,7 +64,9 @@ var/list/active_radio_jammers = list()
update_icon()
. = TRUE
/obj/item/device/radiojammer/emp_act()
/obj/item/device/radiojammer/emp_act(severity)
. = ..()
toggle()
/obj/item/device/radiojammer/proc/toggle(var/mob/user)
+3 -1
View File
@@ -29,7 +29,9 @@
/obj/item/device/t_scanner/update_icon()
icon_state = "t-ray[on]"
/obj/item/device/t_scanner/emp_act()
/obj/item/device/t_scanner/emp_act(severity)
. = ..()
audible_message(src, SPAN_NOTICE("\The [src] buzzes oddly."))
set_active(FALSE)
+2
View File
@@ -269,6 +269,8 @@
fried = TRUE
/obj/item/nralakktag/emp_act(severity)
. = ..()
unclamp()
/obj/item/nralakktag/emag_act(var/remaining_charges, var/mob/user)
@@ -92,10 +92,11 @@
STOP_PROCESSING(SSprocessing, src)
/obj/item/cloaking_device/emp_act(severity)
. = ..()
deactivate()
if (cell)
cell.emp_act(severity)
..()
/obj/item/cloaking_device/proc/register_owner(var/mob/user)
if (!owner || owner != user)
@@ -45,12 +45,14 @@
return TRUE
/obj/item/implant/aggression/emp_act(severity)
. = ..()
if(malfunction)
return
malfunction = MALFUNCTION_TEMPORARY
activate("emp")
if(severity == 1)
if(severity == EMP_HEAVY)
if(prob(50))
meltdown()
else if(prob(50))
@@ -23,16 +23,15 @@
return TRUE
/obj/item/implant/anti_augment/emp_act(severity)
. = ..()
switch(severity)
if(1.0)
if(EMP_HEAVY)
if (prob(75))
qdel(src)
if(2.0)
if(EMP_LIGHT)
if (prob(50))
qdel(src)
if(3.0)
if (prob(25))
qdel(src)
return
/obj/item/implantcase/anti_augment
@@ -62,15 +62,18 @@ the implant may become unstable and either pre-maturely inject the subject or si
..()
/obj/item/implant/chem/emp_act(severity)
. = ..()
if (malfunction)
return
malfunction = MALFUNCTION_TEMPORARY
switch(severity)
if(1)
if(EMP_HEAVY)
if(prob(60))
activate(20)
if(2)
if(EMP_LIGHT)
if(prob(30))
activate(5)
@@ -34,6 +34,8 @@
return dat
/obj/item/implant/integrated_circuit/emp_act(severity)
. = ..()
IC.emp_act(severity)
/obj/item/implant/integrated_circuit/examine(mob/user, distance, is_adjacent)
@@ -55,12 +55,15 @@
global_announcer.autosay(death_message, "[mobname]'s Death Alarm", channel)
/obj/item/implant/death_alarm/emp_act(severity) //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
return
malfunction = MALFUNCTION_TEMPORARY
activate("emp") //let's shout that this dude is dead
if(severity == 1)
if(severity == EMP_HEAVY)
if(prob(40)) //small chance of obvious meltdown
meltdown()
else if (prob(60)) //but more likely it will just quietly die
@@ -197,6 +197,8 @@
return TRUE
/obj/item/implant/explosive/emp_act(severity)
. = ..()
if(malfunction)
return
malfunction = MALFUNCTION_TEMPORARY
@@ -280,21 +282,19 @@
return TRUE
/obj/item/implant/explosive/deadman/emp_act(severity)
. = ..()
if(malfunction)
return
malfunction = MALFUNCTION_TEMPORARY
switch (severity)
if(3.0)
if(prob(1))
small_countdown()
else if(prob(5))
meltdown()
if(2.0)
if(EMP_LIGHT)
if(prob(5))
small_countdown()
else if (prob(10))
meltdown()
if(1.0)
if(EMP_HEAVY)
if(prob(10))
small_countdown()
else if (prob(30))
@@ -39,12 +39,15 @@
return TRUE
/obj/item/implant/mindshield/emp_act(severity)
. = ..()
if (malfunction)
return
malfunction = MALFUNCTION_TEMPORARY
activate("emp")
if(severity == 1)
if(severity == EMP_HEAVY)
if(prob(50))
meltdown()
else if (prob(50))
@@ -48,16 +48,18 @@ Implant Specifics:<BR>"}
return TRUE
/obj/item/implant/tracking/emp_act(severity)
. = ..()
if (malfunction) //no, dawg, you can't malfunction while you are malfunctioning
return
malfunction = MALFUNCTION_TEMPORARY
var/delay = 20
switch(severity)
if(1)
if(EMP_HEAVY)
if(prob(60))
meltdown()
if(2)
if(EMP_LIGHT)
delay = rand(5*60*10,15*60*10) //from 5 to 15 minutes of free time
spawn(delay)
@@ -749,10 +749,11 @@
max_storage_space = max(total_storage_space,max_storage_space) //prevents spawned containers from being too small for their contents
/obj/item/storage/emp_act(severity)
. = ..()
if(!istype(src.loc, /mob/living))
for(var/obj/O in contents)
O.emp_act(severity)
..()
/obj/item/storage/attack_self(mob/user as mob)
//Clicking on itself will empty it, if it has the verb to do that.
+2 -1
View File
@@ -198,9 +198,10 @@
return 1
/obj/item/melee/baton/emp_act(severity)
. = ..()
if(bcell)
bcell.emp_act(severity) //let's not duplicate code everywhere if we don't have to please.
..()
//secborg stun baton module
+3 -1
View File
@@ -52,7 +52,9 @@ var/list/global/all_tethers = list()
continue
tether(TD)
/obj/item/tethering_device/emp_act()
/obj/item/tethering_device/emp_act(severity)
. = ..()
deactivate()
/obj/item/tethering_device/proc/activate()