mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-25 22:28:44 +01:00
[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:
co-authored by
Guti
Cameron Lennox
parent
494fc9bea9
commit
b116cc450d
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user