mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 05:51:56 +01:00
@@ -47,6 +47,7 @@
|
||||
#include "code\__defines\dview.dm"
|
||||
#include "code\__defines\economy.dm"
|
||||
#include "code\__defines\emitter.dm"
|
||||
#include "code\__defines\empulse.dm"
|
||||
#include "code\__defines\evacuation.dm"
|
||||
#include "code\__defines\feedback.dm"
|
||||
#include "code\__defines\flags.dm"
|
||||
@@ -125,12 +126,14 @@
|
||||
#include "code\__defines\dcs\flags.dm"
|
||||
#include "code\__defines\dcs\helpers.dm"
|
||||
#include "code\__defines\dcs\signals.dm"
|
||||
#include "code\__defines\dcs\signals_atom\signals_atom_x_act.dm"
|
||||
#include "code\_global_vars\edible.dm"
|
||||
#include "code\_helpers\_global_objects.dm"
|
||||
#include "code\_helpers\_string_lists.dm"
|
||||
#include "code\_helpers\area_movement.dm"
|
||||
#include "code\_helpers\areas.dm"
|
||||
#include "code\_helpers\atmospherics.dm"
|
||||
#include "code\_helpers\atoms.dm"
|
||||
#include "code\_helpers\data_structures.dm"
|
||||
#include "code\_helpers\dll_call.dm"
|
||||
#include "code\_helpers\files.dm"
|
||||
@@ -365,6 +368,7 @@
|
||||
#include "code\datums\discord\bot.dm"
|
||||
#include "code\datums\discord\webhook.dm"
|
||||
#include "code\datums\elements\_element.dm"
|
||||
#include "code\datums\elements\empprotection.dm"
|
||||
#include "code\datums\ert\nanotrasen.dm"
|
||||
#include "code\datums\ert\outsider.dm"
|
||||
#include "code\datums\ert\responseteam.dm"
|
||||
|
||||
@@ -9,11 +9,14 @@
|
||||
#define ELEMENT_INCOMPATIBLE 1
|
||||
|
||||
// /datum/element flags
|
||||
/// Causes the detach proc to be called when the host object is being deleted
|
||||
#define ELEMENT_DETACH (1 << 0)
|
||||
/// Causes the detach proc to be called when the host object is being deleted.
|
||||
/// Should only be used if you need to perform cleanup not related to the host object.
|
||||
/// You do not need this if you are only unregistering signals, for instance.
|
||||
/// You would need it if you are doing something like removing the target from a processing list.
|
||||
#define ELEMENT_DETACH_ON_HOST_DESTROY (1 << 0)
|
||||
|
||||
/**
|
||||
* Only elements created with the same arguments given after `id_arg_index` share an element instance
|
||||
* Only elements created with the same arguments given after `argument_hash_start_idx` share an element instance
|
||||
* The arguments are the same when the text and number values are the same and all other values have the same ref
|
||||
*/
|
||||
#define ELEMENT_BESPOKE (1 << 1)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// fires on the target datum when an element is attached to it (/datum/element)
|
||||
#define COMSIG_ELEMENT_ATTACH "element_attach"
|
||||
/// fires on the target datum when an element is attached to it (/datum/element)
|
||||
#define COMSIG_ELEMENT_DETACH "element_detach"
|
||||
#define COMSIG_ELEMENT_DETACH_ON_HOST_DESTROY "ELEMENT_DETACH_ON_HOST_DESTROY"
|
||||
|
||||
// /atom signals
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// Atom x_act() procs signals. Format:
|
||||
// When the signal is called: (signal arguments)
|
||||
// All signals send the source datum of the signal as the first argument
|
||||
|
||||
///from base of atom/emp_act(): (severity). return EMP protection flags
|
||||
#define COMSIG_ATOM_PRE_EMP_ACT "atom_emp_act"
|
||||
///from base of atom/emp_act(): (severity, protection)
|
||||
#define COMSIG_ATOM_EMP_ACT "atom_emp_act"
|
||||
@@ -0,0 +1,2 @@
|
||||
#define EMP_HEAVY 1
|
||||
#define EMP_LIGHT 2
|
||||
@@ -24,6 +24,11 @@ var/list/mimic_defines = list(
|
||||
"ZM_NO_OCCLUDE"
|
||||
)
|
||||
|
||||
//EMP protection
|
||||
#define EMP_PROTECT_SELF (1<<0)
|
||||
#define EMP_PROTECT_CONTENTS (1<<1)
|
||||
#define EMP_PROTECT_WIRES (1<<2)
|
||||
|
||||
// Flags bitmask
|
||||
|
||||
/// If a dense atom (potentially) only blocks movements from a given direction, i.e. window panes
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
///similar function to range(), but with no limitations on the distance; will search spiralling outwards from the center
|
||||
///NOT Z-Level aware
|
||||
/proc/spiral_range(dist = 0, center = usr, orange = FALSE)
|
||||
var/list/atom_list = list()
|
||||
var/turf/t_center = get_turf(center)
|
||||
if(!t_center)
|
||||
return list()
|
||||
|
||||
if(!orange)
|
||||
atom_list += t_center
|
||||
atom_list += t_center.contents
|
||||
|
||||
if(!dist)
|
||||
return atom_list
|
||||
|
||||
|
||||
var/turf/checked_turf
|
||||
var/y
|
||||
var/x
|
||||
var/c_dist = 1
|
||||
|
||||
|
||||
while( c_dist <= dist )
|
||||
y = t_center.y + c_dist
|
||||
x = t_center.x - c_dist + 1
|
||||
for(x in x to t_center.x + c_dist)
|
||||
checked_turf = locate(x, y, t_center.z)
|
||||
if(checked_turf)
|
||||
atom_list += checked_turf
|
||||
atom_list += checked_turf.contents
|
||||
|
||||
y = t_center.y + c_dist - 1
|
||||
x = t_center.x + c_dist
|
||||
for(y in t_center.y - c_dist to y)
|
||||
checked_turf = locate(x, y, t_center.z)
|
||||
if(checked_turf)
|
||||
atom_list += checked_turf
|
||||
atom_list += checked_turf.contents
|
||||
|
||||
y = t_center.y - c_dist
|
||||
x = t_center.x + c_dist - 1
|
||||
for(x in t_center.x - c_dist to x)
|
||||
checked_turf = locate(x, y, t_center.z)
|
||||
if(checked_turf)
|
||||
atom_list += checked_turf
|
||||
atom_list += checked_turf.contents
|
||||
|
||||
y = t_center.y - c_dist + 1
|
||||
x = t_center.x - c_dist
|
||||
for(y in y to t_center.y + c_dist)
|
||||
checked_turf = locate(x, y, t_center.z)
|
||||
if(checked_turf)
|
||||
atom_list += checked_turf
|
||||
atom_list += checked_turf.contents
|
||||
c_dist++
|
||||
|
||||
return atom_list
|
||||
@@ -22,6 +22,8 @@ PROCESSING_SUBSYSTEM_DEF(dcs)
|
||||
return
|
||||
. = elements_by_type[element_id] = new eletype
|
||||
|
||||
///Temporary compatibility to not rewrite the proc, it is being ported already in another PR
|
||||
#define REF(k) ref(##k)
|
||||
/****
|
||||
* Generates an id for bespoke elements when given the argument list
|
||||
* Generating the id here is a bit complex because we need to support named arguments
|
||||
@@ -31,23 +33,37 @@ PROCESSING_SUBSYSTEM_DEF(dcs)
|
||||
/datum/controller/subsystem/processing/dcs/proc/GetIdFromArguments(list/arguments)
|
||||
var/datum/element/eletype = arguments[1]
|
||||
var/list/fullid = list("[eletype]")
|
||||
var/list/named_arguments = list()
|
||||
for(var/i in initial(eletype.id_arg_index) to length(arguments))
|
||||
var/list/named_arguments
|
||||
for(var/i in initial(eletype.argument_hash_start_idx) to length(arguments))
|
||||
var/key = arguments[i]
|
||||
var/value
|
||||
|
||||
if(istext(key))
|
||||
value = arguments[key]
|
||||
if(!(istext(key) || isnum(key)))
|
||||
key = ref(key)
|
||||
key = "[key]" // Key is stringified so numbers dont break things
|
||||
if(!isnull(value))
|
||||
if(!(istext(value) || isnum(value)))
|
||||
value = ref(value)
|
||||
named_arguments["[key]"] = value
|
||||
var/value = arguments[key]
|
||||
if (isnull(value))
|
||||
fullid += key
|
||||
else
|
||||
if (!istext(value) && !isnum(value))
|
||||
//One day we will complete the port with everything. For now, this pieces remains commented as a reference.
|
||||
//Also hello, programmer 9 years from now that is reading this.
|
||||
// if(PERFORM_ALL_TESTS(dcs_check_list_arguments) && islist(value))
|
||||
// add_to_arguments_that_are_lists(value, eletype)
|
||||
value = REF(value)
|
||||
|
||||
if (!named_arguments)
|
||||
named_arguments = list()
|
||||
|
||||
named_arguments[key] = value
|
||||
continue
|
||||
|
||||
if (isnum(key))
|
||||
fullid += key
|
||||
else
|
||||
fullid += "[key]"
|
||||
// if(PERFORM_ALL_TESTS(dcs_check_list_arguments) && islist(key))
|
||||
// add_to_arguments_that_are_lists(key, eletype)
|
||||
fullid += REF(key)
|
||||
|
||||
if(length(named_arguments))
|
||||
named_arguments = sortList(named_arguments)
|
||||
fullid += named_arguments
|
||||
return list2params(fullid)
|
||||
#undef REF
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* This is infinity so you must explicitly set this
|
||||
*/
|
||||
var/id_arg_index = INFINITY
|
||||
var/argument_hash_start_idx = INFINITY
|
||||
|
||||
/// Activates the functionality defined by the element on the given target datum
|
||||
/datum/element/proc/Attach(datum/target)
|
||||
@@ -22,12 +22,12 @@
|
||||
if(type == /datum/element)
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
SEND_SIGNAL(target, COMSIG_ELEMENT_ATTACH, src)
|
||||
if(element_flags & ELEMENT_DETACH)
|
||||
if(element_flags & ELEMENT_DETACH_ON_HOST_DESTROY)
|
||||
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(Detach), override = TRUE)
|
||||
|
||||
/// Deactivates the functionality defines by the element on the given datum
|
||||
/datum/element/proc/Detach(datum/source, force)
|
||||
SEND_SIGNAL(source, COMSIG_ELEMENT_DETACH, src)
|
||||
SEND_SIGNAL(source, COMSIG_ELEMENT_DETACH_ON_HOST_DESTROY, src)
|
||||
SHOULD_CALL_PARENT(1)
|
||||
UnregisterSignal(source, COMSIG_PARENT_QDELETING)
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/datum/element/empprotection
|
||||
element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH_ON_HOST_DESTROY // Detach for turfs
|
||||
argument_hash_start_idx = 2
|
||||
var/flags = NONE
|
||||
|
||||
/datum/element/empprotection/Attach(datum/target, _flags)
|
||||
. = ..()
|
||||
if(. == ELEMENT_INCOMPATIBLE || !isatom(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
flags = _flags
|
||||
RegisterSignal(target, COMSIG_ATOM_PRE_EMP_ACT, PROC_REF(getEmpFlags))
|
||||
|
||||
/datum/element/empprotection/Detach(atom/target)
|
||||
UnregisterSignal(target, COMSIG_ATOM_PRE_EMP_ACT)
|
||||
return ..()
|
||||
|
||||
/datum/element/empprotection/proc/getEmpFlags(datum/source, severity)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
return flags
|
||||
+17
-1
@@ -119,8 +119,24 @@
|
||||
/atom/proc/HasProximity(atom/movable/AM as mob|obj)
|
||||
return
|
||||
|
||||
/**
|
||||
* React to an EMP of the given severity
|
||||
*
|
||||
* Default behaviour is to send the [COMSIG_ATOM_PRE_EMP_ACT] and [COMSIG_ATOM_EMP_ACT] signal
|
||||
*
|
||||
* * severity - The severity of the EMP pulse (how strong it is), defines in `code\__defines\empulse.dm`
|
||||
*
|
||||
* Returns the protection value
|
||||
*/
|
||||
/atom/proc/emp_act(var/severity)
|
||||
return
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
|
||||
var/protection = SEND_SIGNAL(src, COMSIG_ATOM_PRE_EMP_ACT, severity)
|
||||
|
||||
RETURN_TYPE(protection)
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_EMP_ACT, severity, protection)
|
||||
return protection // Pass the protection value collected here upwards
|
||||
|
||||
/atom/proc/flash_act(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, ignore_inherent = FALSE, type = /obj/screen/fullscreen/flash, length = 2.5 SECONDS)
|
||||
return
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
QDEL_IN(src, 1)
|
||||
|
||||
/obj/item/clothing/under/chameleon/changeling/emp_act(severity) //As these are purely organic, EMP does nothing to them.
|
||||
. = ..()
|
||||
return
|
||||
|
||||
/obj/item/clothing/under/chameleon/changeling/verb/shred() //Remove individual pieces if needed.
|
||||
@@ -101,6 +102,8 @@
|
||||
QDEL_IN(src, 1)
|
||||
|
||||
/obj/item/clothing/head/chameleon/changeling/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/clothing/head/chameleon/changeling/verb/shred() //The copypasta is real.
|
||||
@@ -127,6 +130,8 @@
|
||||
QDEL_IN(src, 1)
|
||||
|
||||
/obj/item/clothing/suit/chameleon/changeling/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/clothing/suit/chameleon/changeling/verb/shred()
|
||||
@@ -153,6 +158,8 @@
|
||||
QDEL_IN(src, 1)
|
||||
|
||||
/obj/item/clothing/shoes/chameleon/changeling/emp_act()
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/clothing/shoes/chameleon/changeling/verb/shred()
|
||||
@@ -179,6 +186,8 @@
|
||||
QDEL_IN(src, 1)
|
||||
|
||||
/obj/item/storage/backpack/chameleon/changeling/emp_act()
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/storage/backpack/chameleon/changeling/verb/shred()
|
||||
@@ -208,6 +217,8 @@
|
||||
QDEL_IN(src, 1)
|
||||
|
||||
/obj/item/clothing/gloves/chameleon/changeling/emp_act()
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/clothing/gloves/chameleon/changeling/verb/shred()
|
||||
@@ -235,6 +246,8 @@
|
||||
QDEL_IN(src, 1)
|
||||
|
||||
/obj/item/clothing/mask/chameleon/changeling/emp_act()
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/chameleon/changeling/verb/shred()
|
||||
@@ -262,6 +275,8 @@
|
||||
|
||||
|
||||
/obj/item/clothing/glasses/chameleon/changeling/emp_act()
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/clothing/glasses/chameleon/changeling/verb/shred()
|
||||
@@ -288,6 +303,8 @@
|
||||
QDEL_IN(src, 1)
|
||||
|
||||
/obj/item/storage/belt/chameleon/changeling/emp_act()
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/storage/belt/chameleon/changeling/verb/shred()
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
if(temp_apc && temp_apc.terminal && temp_apc.terminal.powernet)
|
||||
temp_apc.terminal.powernet.trigger_warning(50) // Long alarm
|
||||
if(temp_apc)
|
||||
temp_apc.emp_act(3) // Such power surges are not good for APC electronics/cell in general.
|
||||
temp_apc.emp_act(EMP_LIGHT) // Such power surges are not good for APC electronics/cell in general.
|
||||
if(prob(explosion_intensity))
|
||||
temp_apc.set_broken()
|
||||
|
||||
|
||||
@@ -172,6 +172,8 @@
|
||||
update_held_icon()
|
||||
|
||||
/obj/item/technomancer_core/emp_act()
|
||||
. = ..()
|
||||
|
||||
set_appearance_to(type)
|
||||
|
||||
// This is what is clicked on to place a spell in the user's hands.
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
safe_blink(src, range = 6)
|
||||
to_chat(src, "<span class='warning'>You're teleported against your will!</span>")
|
||||
if(4)
|
||||
emp_act(3)
|
||||
emp_act(EMP_LIGHT)
|
||||
|
||||
if(51 to 100) //Severe
|
||||
rng = rand(0,3)
|
||||
@@ -164,7 +164,7 @@
|
||||
if(0)
|
||||
electrocute_act(instability * 0.5, "extremely unstable energies", 0.75)
|
||||
if(1)
|
||||
emp_act(2)
|
||||
emp_act(EMP_LIGHT)
|
||||
if(2)
|
||||
adjustFireLoss(instability * 0.3) //30 burn @ 100 instability
|
||||
to_chat(src, "<span class='danger'>Your chassis alerts you to extreme overheating from an unknown external force!</span>")
|
||||
@@ -178,7 +178,7 @@
|
||||
if(0)
|
||||
electrocute_act(instability, "extremely unstable energies", 0.75)
|
||||
if(1)
|
||||
emp_act(1)
|
||||
emp_act(EMP_HEAVY)
|
||||
if(2)
|
||||
adjustFireLoss(instability * 0.4) //40 burn @ 100 instability
|
||||
to_chat(src, "<span class='danger'>Your chassis alerts you to extreme overheating from an unknown external force!</span>")
|
||||
|
||||
@@ -291,18 +291,18 @@
|
||||
if(user == occupant)
|
||||
go_out()
|
||||
|
||||
/obj/machinery/sleeper/emp_act(var/severity)
|
||||
/obj/machinery/sleeper/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
if(occupant)
|
||||
go_out()
|
||||
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/sleeper/proc/toggle_filter()
|
||||
if(!occupant || !beaker)
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
return
|
||||
|
||||
/obj/machinery/abstract/emp_act(severity)
|
||||
return // No EMPing these.
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/abstract/ex_act(severity)
|
||||
return
|
||||
|
||||
@@ -36,7 +36,7 @@ var/global/list/bluespace_inhibitors
|
||||
/obj/machinery/anti_bluespace/emag_act()
|
||||
spark(src, 3)
|
||||
playsound(src, /singleton/sound_category/spark_sound, 50, 1)
|
||||
emp_act(1)
|
||||
emp_act(EMP_HEAVY)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/anti_bluespace/process()
|
||||
@@ -99,9 +99,11 @@ var/global/list/bluespace_inhibitors
|
||||
return
|
||||
|
||||
/obj/machinery/anti_bluespace/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
//THIS WILL BE FUN.
|
||||
if(stat & BROKEN)
|
||||
return 0
|
||||
return
|
||||
|
||||
var/area/temp_area = get_area(src)
|
||||
if(temp_area)
|
||||
|
||||
@@ -49,8 +49,9 @@
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/pump/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
if(prob(50/severity))
|
||||
@@ -63,7 +64,6 @@
|
||||
update_icon()
|
||||
SStgui.update_uis(src)
|
||||
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/pump/process()
|
||||
..()
|
||||
|
||||
@@ -28,15 +28,15 @@
|
||||
cell = new/obj/item/cell/apc(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/scrubber/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
if(prob(50/severity))
|
||||
on = !on
|
||||
update_icon()
|
||||
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/scrubber/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
@@ -119,6 +119,8 @@
|
||||
return
|
||||
|
||||
/obj/machinery/bot/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
var/was_on = on
|
||||
stat |= EMPED
|
||||
var/obj/effect/overlay/pulse2 = new /obj/effect/overlay(src.loc)
|
||||
|
||||
@@ -92,6 +92,8 @@
|
||||
return
|
||||
|
||||
/obj/machinery/camera/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(!isEmpProof() && prob(100/severity))
|
||||
if(!affected_by_emp_until || (world.time < affected_by_emp_until))
|
||||
affected_by_emp_until = max(affected_by_emp_until, world.time + (90 SECONDS / severity))
|
||||
|
||||
@@ -103,11 +103,12 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/cell_charger/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(INOPERABLE(src))
|
||||
return
|
||||
if(charging)
|
||||
charging.emp_act(severity)
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/cell_charger/power_change()
|
||||
if(..() && charging && anchored)
|
||||
|
||||
@@ -340,9 +340,10 @@
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(prob(100/severity))
|
||||
malfunction()
|
||||
..()
|
||||
|
||||
/obj/machinery/clonepod/ex_act(severity)
|
||||
switch(severity)
|
||||
|
||||
@@ -31,19 +31,20 @@
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/arcade/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
var/num_of_prizes = 0
|
||||
switch(severity)
|
||||
if(1)
|
||||
if(EMP_HEAVY)
|
||||
num_of_prizes = rand(1,4)
|
||||
if(2)
|
||||
if(EMP_LIGHT)
|
||||
num_of_prizes = rand(0,2)
|
||||
for(num_of_prizes; num_of_prizes > 0; num_of_prizes--)
|
||||
new prize(src.loc)
|
||||
|
||||
..(severity)
|
||||
|
||||
///////////////////
|
||||
// BATTLE HERE //
|
||||
|
||||
@@ -35,8 +35,10 @@
|
||||
return
|
||||
|
||||
/obj/machinery/computer/emp_act(severity)
|
||||
if(prob(20/severity)) set_broken()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
if(prob(20/severity))
|
||||
set_broken()
|
||||
|
||||
|
||||
/obj/machinery/computer/ex_act(severity)
|
||||
|
||||
@@ -178,12 +178,16 @@
|
||||
|
||||
/obj/machinery/computer/slot_machine/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(prob(15 * severity))
|
||||
return
|
||||
|
||||
if(prob(1)) // :^)
|
||||
emagged = TRUE
|
||||
|
||||
var/severity_ascending = 4 - severity
|
||||
money = max(rand(money - (200 * severity_ascending), money + (200 * severity_ascending)), 0)
|
||||
balance = max(rand(balance - (50 * severity_ascending), balance + (50 * severity_ascending)), 0)
|
||||
|
||||
@@ -254,6 +254,8 @@ for reference:
|
||||
return
|
||||
|
||||
/obj/machinery/deployable/barrier/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if(prob(50/severity))
|
||||
|
||||
@@ -407,6 +407,8 @@
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/centcom/emp_act()
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/glass_centcom
|
||||
@@ -445,6 +447,8 @@
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/glass_centcom/emp_act()
|
||||
. = ..()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/proc/paint_airlock(paint_color)
|
||||
@@ -2017,11 +2021,12 @@ About the new airlock wires panel:
|
||||
electronics.one_access = 1
|
||||
|
||||
/obj/machinery/door/airlock/emp_act(var/severity)
|
||||
. = ..()
|
||||
|
||||
if(prob(40/severity))
|
||||
var/duration = SecondsToTicks(30 / severity)
|
||||
if(electrified_until > -1 && (duration + world.time) > electrified_until)
|
||||
electrify(duration)
|
||||
..()
|
||||
|
||||
/obj/machinery/door/airlock/power_change() //putting this is obj/machinery/door itself makes non-airlock doors turn invisible for some reason
|
||||
..()
|
||||
|
||||
@@ -421,9 +421,10 @@
|
||||
|
||||
|
||||
/obj/machinery/door/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(prob(20/severity) && (istype(src,/obj/machinery/door/airlock) || istype(src,/obj/machinery/door/window)) )
|
||||
open()
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/door/ex_act(severity)
|
||||
|
||||
@@ -65,9 +65,10 @@
|
||||
return src.alarm()
|
||||
|
||||
/obj/machinery/firealarm/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(prob(50/severity))
|
||||
alarm(rand(30/severity, 60/severity))
|
||||
..()
|
||||
|
||||
/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(!istype(W, /obj/item/forensics))
|
||||
|
||||
@@ -92,12 +92,13 @@
|
||||
O.Weaken(flash_time)
|
||||
|
||||
/obj/machinery/flasher/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
if(prob(75/severity))
|
||||
flash()
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/flasher/portable/HasProximity(atom/movable/AM as mob|obj)
|
||||
if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
|
||||
|
||||
@@ -137,11 +137,12 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/sparker/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
ignite()
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/button/ignition
|
||||
name = "ignition switch"
|
||||
|
||||
@@ -73,8 +73,9 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/light_switch/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
power_change()
|
||||
..(severity)
|
||||
|
||||
@@ -186,6 +186,7 @@ Class Procs:
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/machinery/emp_act(severity)
|
||||
. = ..()
|
||||
if(use_power && stat == 0)
|
||||
use_power_oneoff(7500/severity)
|
||||
|
||||
@@ -197,7 +198,6 @@ Class Procs:
|
||||
pulse2.set_dir(pick(cardinal))
|
||||
|
||||
QDEL_IN(pulse2, 10)
|
||||
..()
|
||||
|
||||
/obj/machinery/ex_act(severity)
|
||||
switch(severity)
|
||||
|
||||
@@ -47,10 +47,12 @@
|
||||
return
|
||||
|
||||
/obj/machinery/mass_driver/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
drive()
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/mass_driver/attackby(obj/item/W, mob/user)
|
||||
|
||||
|
||||
@@ -459,6 +459,8 @@
|
||||
take_damage(damage)
|
||||
|
||||
/obj/machinery/porta_turret/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(enabled)
|
||||
//if the turret is on, the EMP no matter how severe disables the turret for a while
|
||||
//and scrambles its settings, with a slight chance of having an emag effect
|
||||
@@ -473,7 +475,6 @@
|
||||
enabled = FALSE
|
||||
addtimer(CALLBACK(src, PROC_REF(post_emp_act)), rand(60, 600))
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/porta_turret/proc/post_emp_act()
|
||||
enabled = TRUE
|
||||
|
||||
@@ -150,8 +150,9 @@
|
||||
charging = null
|
||||
|
||||
/obj/machinery/recharger/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) || !anchored)
|
||||
..(severity)
|
||||
return
|
||||
|
||||
if(istype(charging, /obj/item/gun/energy))
|
||||
@@ -163,7 +164,6 @@
|
||||
var/obj/item/melee/baton/B = charging
|
||||
if(B.bcell)
|
||||
B.bcell.charge = 0
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier.
|
||||
if(charging)
|
||||
|
||||
@@ -125,12 +125,13 @@
|
||||
go_out()
|
||||
|
||||
/obj/machinery/recharge_station/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(occupant)
|
||||
occupant.emp_act(severity)
|
||||
go_out()
|
||||
if(cell)
|
||||
cell.emp_act(severity)
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/recharge_station/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(!occupant)
|
||||
|
||||
@@ -52,12 +52,13 @@
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/space_heater/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
if(cell)
|
||||
cell.emp_act(severity)
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/space_heater/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/cell))
|
||||
|
||||
@@ -69,11 +69,12 @@
|
||||
update()
|
||||
|
||||
/obj/machinery/status_display/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
|
||||
set_picture("ai_bsod")
|
||||
..(severity)
|
||||
|
||||
// set what is displayed
|
||||
/obj/machinery/status_display/proc/update()
|
||||
|
||||
@@ -136,8 +136,10 @@
|
||||
|
||||
/obj/machinery/telecomms/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(stat & EMPED || !prob(100/severity))
|
||||
return
|
||||
|
||||
stat |= EMPED
|
||||
addtimer(CALLBACK(src, PROC_REF(post_emp_act)), (300 SECONDS) / severity)
|
||||
|
||||
|
||||
@@ -272,6 +272,8 @@
|
||||
set_light(1.5, 1,"#003300")
|
||||
|
||||
/obj/machinery/turretid/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(enabled)
|
||||
//if the turret is on, the EMP no matter how severe disables the turret for a while
|
||||
//and scrambles its settings, with a slight chance of having an emag effect
|
||||
@@ -290,4 +292,3 @@
|
||||
enabled=1
|
||||
updateTurrets()
|
||||
|
||||
..()
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
// Uncomment this define to check for possible lengthy processing of emp_act()s.
|
||||
// If emp_act() takes more than defined deciseconds (1/10 seconds) an admin message and log is created.
|
||||
// I do not recommend having this uncommented on main server, it probably causes a bit more lag, espicially with larger EMPs.
|
||||
|
||||
// #define EMPDEBUG 10
|
||||
|
||||
/**
|
||||
* Produces an EMP pulse from `epicenter` up to `light_range`
|
||||
*
|
||||
* Calls `emp_act()` with a value of `EMP_HEAVY` up to `heavy_range`, with 50% probability between `EMP_HEAVY` and `EMP_LIGHT` at the exact `heavy_range`,
|
||||
* and with `EMP_LIGHT` up to and including `light_range`
|
||||
*
|
||||
*
|
||||
* * epicenter - A `/turf` where to start the explosion from
|
||||
* * heavy_range - The range in which `EMP_HEAVY` is applied, as a number
|
||||
* * light_range - The range, higher or equal than `heavy_range`, where `EMP_LIGHT` is applied, as a number
|
||||
* * log - Boolean, if you want this call to be logged
|
||||
* * exclude - A `/list` of objects to exclude, and/or paths to exclude
|
||||
*
|
||||
*/
|
||||
/proc/empulse(turf/epicenter, heavy_range, light_range, log = FALSE, list/exclude = null)
|
||||
if(!epicenter) return
|
||||
if(!epicenter)
|
||||
return FALSE
|
||||
|
||||
if(!istype(epicenter, /turf))
|
||||
epicenter = get_turf(epicenter.loc)
|
||||
|
||||
//Ensure we got an actual location, no nullspace or error or other shit
|
||||
if(!(epicenter.x && epicenter.y && epicenter.z))
|
||||
return FALSE
|
||||
|
||||
if(log)
|
||||
message_admins("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
|
||||
log_game("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
|
||||
@@ -20,34 +35,73 @@
|
||||
pulse.icon_state = "emppulse"
|
||||
pulse.name = "emp pulse"
|
||||
pulse.anchored = 1
|
||||
QDEL_IN(pulse, 20)
|
||||
QDEL_IN(pulse, 2 SECONDS)
|
||||
|
||||
if(heavy_range > light_range)
|
||||
light_range = heavy_range
|
||||
|
||||
for(var/mob/M in range(heavy_range, epicenter))
|
||||
sound_to(M, 'sound/effects/EMPulse.ogg')
|
||||
var/list/connected_z_levels = GetConnectedZlevels(epicenter.z) //Get every zlevel that is part of the current location
|
||||
for(var/z in connected_z_levels)
|
||||
|
||||
//We obtain a virtual epicenter for each connected zlevel
|
||||
var/virtual_epicenter = locate(epicenter.x, epicenter.y, z)
|
||||
|
||||
//We assume each zlevel to be 9 meters tall, and apply the pythagorean theorem to obtain the radius of the sphere at that vertical distance from the epicenter
|
||||
var/virtual_heavy_range = abs(epicenter.z - z) ? ( sqrt(((heavy_range*heavy_range)-((9*(epicenter.z - z))*(9*(epicenter.z - z))))) ) : heavy_range
|
||||
var/virtual_light_range = abs(epicenter.z - z) ? ( sqrt(((light_range*light_range)-((9*(epicenter.z - z))*(9*(epicenter.z - z))))) ) : light_range
|
||||
|
||||
for(var/atom/A in range(light_range, epicenter))
|
||||
#ifdef EMPDEBUG
|
||||
var/time = world.timeofday
|
||||
#endif
|
||||
if(exclude && (A in exclude))
|
||||
log_and_message_admins("EMPDEBUG: Heavy range for explosion at Z-level [z] is [virtual_heavy_range]")
|
||||
log_and_message_admins("EMPDEBUG: Light range for explosion at Z-level [z] is [virtual_light_range]")
|
||||
#endif //EMPDEBUG
|
||||
|
||||
if(virtual_light_range < 0 && virtual_heavy_range < 0)
|
||||
continue
|
||||
var/distance = get_dist(epicenter, A)
|
||||
if(distance < 0)
|
||||
distance = 0
|
||||
if(distance < heavy_range)
|
||||
A.emp_act(1)
|
||||
else if(distance == heavy_range)
|
||||
if(prob(50))
|
||||
A.emp_act(1)
|
||||
else
|
||||
A.emp_act(2)
|
||||
else if(distance <= light_range)
|
||||
A.emp_act(2)
|
||||
#ifdef EMPDEBUG
|
||||
if((world.timeofday - time) >= EMPDEBUG)
|
||||
log_and_message_admins("EMPDEBUG: [A.name] - [A.type] - took [world.timeofday - time]ds to process emp_act()!")
|
||||
#endif
|
||||
return 1
|
||||
|
||||
if(virtual_heavy_range > 1)
|
||||
for(var/mob/M in range(virtual_heavy_range, virtual_epicenter))
|
||||
sound_to(M, 'sound/effects/EMPulse.ogg')
|
||||
CHECK_TICK
|
||||
|
||||
loop_apply_emp:
|
||||
for(var/atom/A in spiral_range(max(virtual_light_range, virtual_heavy_range) , virtual_epicenter))
|
||||
|
||||
#ifdef EMPDEBUG
|
||||
var/time = world.timeofday
|
||||
#endif
|
||||
|
||||
if(exclude && length(exclude)) //We have a list with at least one element to exclude
|
||||
|
||||
for(var/element in exclude)
|
||||
if(ispath(element))
|
||||
if(istype(A, element))
|
||||
continue loop_apply_emp
|
||||
else
|
||||
if(A == element)
|
||||
continue loop_apply_emp
|
||||
|
||||
var/distance = get_dist(epicenter, A)
|
||||
if(distance < 0)
|
||||
distance = 0
|
||||
|
||||
|
||||
if(distance < virtual_heavy_range)
|
||||
A.emp_act(EMP_HEAVY)
|
||||
|
||||
else if(distance == virtual_heavy_range)
|
||||
if(prob(50)) //50% probability it's heavy or light, at the exact heavy range
|
||||
A.emp_act(EMP_HEAVY)
|
||||
else
|
||||
A.emp_act(EMP_LIGHT)
|
||||
|
||||
else if(distance <= virtual_light_range)
|
||||
A.emp_act(EMP_LIGHT)
|
||||
|
||||
#ifdef EMPDEBUG
|
||||
if((world.timeofday - time) >= EMPDEBUG)
|
||||
log_and_message_admins("EMPDEBUG: [A.name] - [A.type] - took [world.timeofday - time]ds to process emp_act()!")
|
||||
#endif //EMPDEBUG
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -10,8 +10,11 @@
|
||||
health = 200
|
||||
|
||||
/obj/structure/closet/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(!secure)
|
||||
return
|
||||
|
||||
for(var/obj/O in src)
|
||||
O.emp_act(severity)
|
||||
if(!broken)
|
||||
@@ -24,7 +27,6 @@
|
||||
else
|
||||
req_access = list()
|
||||
req_access += pick(get_all_station_access())
|
||||
..()
|
||||
|
||||
/obj/structure/closet/proc/togglelock(mob/user as mob, silent)
|
||||
if(use_check_and_message(user))
|
||||
|
||||
@@ -258,7 +258,8 @@
|
||||
ripped = TRUE
|
||||
if(rip_linked)
|
||||
var/obj/item/stack/material/cloth/C = new(src.loc, flag_size ? 2 : 1)
|
||||
user.put_in_hands(C)
|
||||
if(user)
|
||||
user.put_in_hands(C)
|
||||
if(rip_linked && linked_flag)
|
||||
linked_flag.rip(user, FALSE) // Prevents an infinite ripping loop.
|
||||
|
||||
|
||||
@@ -61,6 +61,8 @@
|
||||
clothing_choices = generate_chameleon_choices(/obj/item/clothing/under, blocked)
|
||||
|
||||
/obj/item/clothing/under/chameleon/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
name = "psychedelic"
|
||||
desc = "Groovy!"
|
||||
icon_state = "psyche"
|
||||
@@ -100,6 +102,8 @@
|
||||
clothing_choices = generate_chameleon_choices(/obj/item/clothing/head, blocked)
|
||||
|
||||
/obj/item/clothing/head/chameleon/emp_act(severity) //Because we don't have psych for all slots right now but still want a downside to EMP. In this case your cover's blown.
|
||||
. = ..()
|
||||
|
||||
name = initial(name)
|
||||
desc = "It's a baseball hat in a tasteful grey colour."
|
||||
icon_state = initial(icon_state)
|
||||
@@ -136,6 +140,8 @@
|
||||
clothing_choices = generate_chameleon_choices(/obj/item/clothing/suit, blocked)
|
||||
|
||||
/obj/item/clothing/suit/chameleon/emp_act(severity) //Because we don't have psych for all slots right now but still want a downside to EMP. In this case your cover's blown.
|
||||
. = ..()
|
||||
|
||||
name = "armor"
|
||||
desc = "An armored vest that protects against some damage."
|
||||
icon_state = "armor"
|
||||
@@ -174,6 +180,8 @@
|
||||
clothing_choices = generate_chameleon_choices(/obj/item/clothing/shoes, blocked)
|
||||
|
||||
/obj/item/clothing/shoes/chameleon/emp_act(severity) //Because we don't have psych for all slots right now but still want a downside to EMP. In this case your cover's blown.
|
||||
. = ..()
|
||||
|
||||
name = "black shoes"
|
||||
desc = "A pair of black shoes."
|
||||
icon_state = "black"
|
||||
@@ -211,6 +219,8 @@
|
||||
clothing_choices = generate_chameleon_choices(/obj/item/storage/backpack, blocked)
|
||||
|
||||
/obj/item/storage/backpack/chameleon/emp_act(severity) //Because we don't have psych for all slots right now but still want a downside to EMP. In this case your cover's blown.
|
||||
. = ..()
|
||||
|
||||
name = "backpack"
|
||||
desc = "You wear this on your back and put items into it."
|
||||
icon_state = "backpack"
|
||||
@@ -256,6 +266,8 @@
|
||||
clothing_choices = generate_chameleon_choices(/obj/item/clothing/gloves, blocked)
|
||||
|
||||
/obj/item/clothing/gloves/chameleon/emp_act(severity) //Because we don't have psych for all slots right now but still want a downside to EMP. In this case your cover's blown.
|
||||
. = ..()
|
||||
|
||||
name = "black gloves"
|
||||
desc = "It looks like a pair of gloves, but it seems to have a small dial inside."
|
||||
icon_state = "black"
|
||||
@@ -291,6 +303,8 @@
|
||||
clothing_choices = generate_chameleon_choices(/obj/item/clothing/mask, list(src.type))
|
||||
|
||||
/obj/item/clothing/mask/chameleon/emp_act(severity) //Because we don't have psych for all slots right now but still want a downside to EMP. In this case your cover's blown.
|
||||
. = ..()
|
||||
|
||||
name = "gas mask"
|
||||
desc = "It's a gas mask."
|
||||
icon_state = "gas_alt"
|
||||
@@ -327,6 +341,8 @@
|
||||
clothing_choices = generate_chameleon_choices(/obj/item/clothing/glasses, blocked)
|
||||
|
||||
/obj/item/clothing/glasses/chameleon/emp_act(severity) //Because we don't have psych for all slots right now but still want a downside to EMP. In this case your cover's blown.
|
||||
. = ..()
|
||||
|
||||
name = "optical meson scanner"
|
||||
desc = "It's a set of mesons."
|
||||
icon_state = "meson"
|
||||
@@ -393,6 +409,8 @@
|
||||
return P
|
||||
|
||||
/obj/item/gun/energy/chameleon/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
name = "desert eagle"
|
||||
desc = "It's a desert eagle."
|
||||
icon_state = "deagle"
|
||||
|
||||
@@ -444,6 +444,8 @@
|
||||
return I
|
||||
|
||||
/obj/item/clothing/gloves/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(cell)
|
||||
//why is this not part of the powercell code?
|
||||
cell.charge -= 1000 / severity
|
||||
@@ -451,7 +453,6 @@
|
||||
cell.charge = 0
|
||||
if(ring)
|
||||
ring.emp_act(severity)
|
||||
..()
|
||||
|
||||
// Called just before an attack_hand(), in mob/UnarmedAttack()
|
||||
/obj/item/clothing/gloves/proc/Touch(var/atom/A, mob/user, var/proximity)
|
||||
|
||||
@@ -164,7 +164,8 @@
|
||||
verbs -= /obj/item/clothing/proc/removetie_verb
|
||||
|
||||
/obj/item/clothing/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(LAZYLEN(accessories))
|
||||
for(var/obj/item/clothing/accessory/A in accessories)
|
||||
A.emp_act(severity)
|
||||
..()
|
||||
|
||||
@@ -87,7 +87,9 @@
|
||||
update_clothing_icon()
|
||||
user.update_action_buttons()
|
||||
|
||||
/obj/item/clothing/under/elyra_holo/emp_act()
|
||||
/obj/item/clothing/under/elyra_holo/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(clothing_mode && icon_state != initial(icon_state))
|
||||
clothing_mode = 0
|
||||
transform_holoclothing_appearance()
|
||||
|
||||
@@ -978,6 +978,8 @@ BLIND // can't see anything
|
||||
item_flags = ITEM_FLAG_AIRTIGHT
|
||||
|
||||
/obj/item/clothing/glasses/thermal/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(istype(src.loc, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/M = src.loc
|
||||
to_chat(M, "<span class='danger'>\The [src] overloads and blinds you!</span>")
|
||||
@@ -988,7 +990,6 @@ BLIND // can't see anything
|
||||
if(!(M.disabilities & NEARSIGHTED))
|
||||
M.disabilities |= NEARSIGHTED
|
||||
addtimer(CALLBACK(M, TYPE_PROC_REF(/mob/living/carbon/human, thermal_reset_blindness)), 100)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/glasses/thermal/Initialize()
|
||||
. = ..()
|
||||
|
||||
@@ -72,8 +72,10 @@
|
||||
hold.attackby(W, user)
|
||||
|
||||
/obj/item/clothing/head/helmet/emp_act(severity)
|
||||
if(has_storage) hold.emp_act(severity)
|
||||
return ..()
|
||||
. = ..()
|
||||
|
||||
if(has_storage)
|
||||
hold.emp_act(severity)
|
||||
|
||||
/obj/item/clothing/head/helmet/hear_talk(mob/M, var/msg, verb, datum/language/speaking)
|
||||
if(has_storage) hold.hear_talk(M, msg, verb, speaking)
|
||||
|
||||
@@ -810,18 +810,20 @@
|
||||
/obj/item/rig/proc/malfunction()
|
||||
return 0
|
||||
|
||||
/obj/item/rig/emp_act(severity_class)
|
||||
/obj/item/rig/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
//set malfunctioning
|
||||
if(emp_protection < 30) //for ninjas, really.
|
||||
malfunctioning += 10
|
||||
if(malfunction_delay <= 0)
|
||||
malfunction_delay = max(malfunction_delay, round(30/severity_class))
|
||||
malfunction_delay = max(malfunction_delay, round(30/severity))
|
||||
|
||||
//drain some charge
|
||||
if(cell) cell.emp_act((severity_class + 15)*1+(0.1*emp_protection))
|
||||
if(cell) cell.powerdrain((severity + 15)*1+(0.1*emp_protection))
|
||||
|
||||
//possibly damage some modules
|
||||
take_hit((100/severity_class), "electrical pulse", 1)
|
||||
take_hit((100/severity), "electrical pulse", 1)
|
||||
|
||||
/obj/item/rig/proc/shock(mob/user)
|
||||
var/touchy = pick(BP_CHEST,BP_HEAD,BP_GROIN)
|
||||
|
||||
@@ -54,9 +54,10 @@
|
||||
pockets.attackby(W, user)
|
||||
|
||||
/obj/item/clothing/suit/armor/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if (pockets)
|
||||
pockets.emp_act(severity)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/suit/armor/hear_talk(mob/M, var/msg, verb, datum/language/speaking)
|
||||
if (pockets)
|
||||
@@ -184,10 +185,11 @@
|
||||
return
|
||||
|
||||
/obj/item/clothing/suit/armor/reactive/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
active = 0
|
||||
src.icon_state = "reactiveoff"
|
||||
src.item_state = "reactiveoff"
|
||||
..()
|
||||
|
||||
/obj/item/clothing/suit/armor/tactical
|
||||
name = "tactical armor"
|
||||
|
||||
@@ -34,8 +34,9 @@
|
||||
pockets.attackby(W, user)
|
||||
|
||||
/obj/item/clothing/suit/storage/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
pockets.emp_act(severity)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/suit/storage/hear_talk(mob/M, var/msg, verb, datum/language/speaking)
|
||||
pockets.hear_talk(M, msg, verb, speaking)
|
||||
|
||||
@@ -93,9 +93,10 @@
|
||||
holster(W, user)
|
||||
|
||||
/obj/item/clothing/accessory/holster/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if (holstered)
|
||||
holstered.emp_act(severity)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/accessory/holster/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -33,8 +33,9 @@
|
||||
return hold.attackby(W, user)
|
||||
|
||||
/obj/item/clothing/accessory/storage/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
hold.emp_act(severity)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/accessory/storage/attack_self(mob/user as mob)
|
||||
if(length(hold.contents))
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
return
|
||||
|
||||
/obj/item/clothing/wrists/watch/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(prob(50/severity))
|
||||
wired = FALSE
|
||||
..()
|
||||
|
||||
@@ -108,8 +108,10 @@
|
||||
return 1
|
||||
|
||||
/obj/item/gun/custom_ka/emp_act(severity)
|
||||
is_emped = 1
|
||||
return 1
|
||||
. = ..()
|
||||
|
||||
is_emped = TRUE
|
||||
return TRUE
|
||||
|
||||
/obj/item/gun/custom_ka/Fire(atom/target, mob/living/user, clickparams, pointblank=0, reflex=0)
|
||||
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
to_chat(A, "<span class='warning'><b>Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT</b></span>")
|
||||
to_chat(A, "<br>")
|
||||
for(var/obj/machinery/telecomms/T in SSmachinery.all_telecomms)
|
||||
T.emp_act(1)
|
||||
T.emp_act(EMP_HEAVY)
|
||||
|
||||
@@ -24,4 +24,4 @@
|
||||
/datum/event/communications_blackout/start()
|
||||
for(var/obj/machinery/telecomms/T in SSmachinery.all_telecomms)
|
||||
if(T.z in affecting_z)
|
||||
T.emp_act(1)
|
||||
T.emp_act(EMP_HEAVY)
|
||||
|
||||
@@ -26,7 +26,9 @@
|
||||
color = new_colour
|
||||
return color != last_colour
|
||||
|
||||
/obj/item/mech_component/emp_act(var/severity)
|
||||
/obj/item/mech_component/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
take_burn_damage(rand((10 - (severity*3)),15-(severity*4)))
|
||||
for(var/obj/item/thing in contents)
|
||||
thing.emp_act(severity)
|
||||
|
||||
@@ -109,7 +109,9 @@
|
||||
total += MC.brute_damage
|
||||
return total
|
||||
|
||||
/mob/living/heavy_vehicle/emp_act(var/severity)
|
||||
/mob/living/heavy_vehicle/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
var/ratio = get_blocked_ratio(null, DAMAGE_BURN, null, (4-severity) * 20)
|
||||
|
||||
if(ratio >= 0.5)
|
||||
@@ -121,13 +123,13 @@
|
||||
to_chat(m, SPAN_NOTICE("Your Faraday shielding mitigated the pulse!"))
|
||||
|
||||
emp_damage += round((12 - (severity*3))*( 1 - ratio))
|
||||
if(severity <= 3)
|
||||
for(var/obj/item/thing in list(arms,legs,head,body))
|
||||
thing.emp_act(severity)
|
||||
if(!hatch_closed || !prob(body.pilot_coverage))
|
||||
for(var/thing in pilots)
|
||||
var/mob/pilot = thing
|
||||
pilot.emp_act(severity)
|
||||
|
||||
for(var/obj/item/thing in list(arms,legs,head,body))
|
||||
thing.emp_act(severity)
|
||||
if(!hatch_closed || !prob(body.pilot_coverage))
|
||||
for(var/thing in pilots)
|
||||
var/mob/pilot = thing
|
||||
pilot.emp_act(severity)
|
||||
|
||||
/mob/living/heavy_vehicle/fall_impact(levels_fallen, stopped_early = FALSE, var/damage_mod = 1)
|
||||
// No gravity, stop falling into spess!
|
||||
|
||||
@@ -338,7 +338,8 @@
|
||||
choice.ask_for_input(user)
|
||||
|
||||
/obj/item/device/electronic_assembly/emp_act(severity)
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
for(var/atom/movable/AM in contents)
|
||||
AM.emp_act(severity)
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
for(var/datum/integrated_io/io in inputs + outputs + activators)
|
||||
io.scramble()
|
||||
|
||||
|
||||
@@ -729,12 +729,17 @@
|
||||
playsound(src,'sound/effects/sparks4.ogg', 50, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/device/wormhole_jaunter/emp_act(power)
|
||||
/obj/item/device/wormhole_jaunter/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
var/triggered = FALSE
|
||||
if(power == 1)
|
||||
triggered = TRUE
|
||||
else if(power == 2 && prob(50))
|
||||
triggered = TRUE
|
||||
|
||||
switch(severity)
|
||||
if(EMP_HEAVY)
|
||||
triggered = TRUE
|
||||
if(EMP_LIGHT)
|
||||
if(prob(50))
|
||||
triggered = TRUE
|
||||
|
||||
if(triggered)
|
||||
usr.visible_message(SPAN_WARNING("\The [src] overloads and activates!"))
|
||||
@@ -833,6 +838,8 @@
|
||||
return
|
||||
|
||||
/obj/item/lazarus_injector/emp_act()
|
||||
. = ..()
|
||||
|
||||
if(!malfunctioning)
|
||||
malfunctioning = TRUE
|
||||
update_icon()
|
||||
|
||||
@@ -130,7 +130,9 @@
|
||||
M.client.images += ore_ping
|
||||
ore_pings += ore_ping
|
||||
|
||||
/obj/item/ore_detector/emp_act()
|
||||
/obj/item/ore_detector/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
deactivate()
|
||||
|
||||
/obj/item/ore_detector/proc/activate(var/mob/user)
|
||||
|
||||
@@ -181,12 +181,13 @@
|
||||
return FALSE
|
||||
|
||||
/mob/living/bot/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
switch(severity)
|
||||
if(1)
|
||||
if(EMP_HEAVY)
|
||||
death()
|
||||
else
|
||||
turn_off()
|
||||
..()
|
||||
|
||||
/mob/living/bot/proc/turn_on()
|
||||
if(stat)
|
||||
|
||||
@@ -278,17 +278,16 @@
|
||||
to_chat(brainmob, SPAN_NOTICE("Radio is [radio.get_listening() ? "now" : "no longer"] receiving broadcast."))
|
||||
|
||||
/obj/item/device/mmi/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(!brainmob)
|
||||
return
|
||||
else
|
||||
switch(severity)
|
||||
if(1)
|
||||
brainmob.emp_damage += rand(20,30)
|
||||
if(2)
|
||||
brainmob.emp_damage += rand(10,20)
|
||||
if(3)
|
||||
brainmob.emp_damage += rand(0,10)
|
||||
..()
|
||||
|
||||
switch(severity)
|
||||
if(EMP_HEAVY)
|
||||
brainmob.emp_damage += rand(20,30)
|
||||
if(EMP_LIGHT)
|
||||
brainmob.emp_damage += rand(10,20)
|
||||
|
||||
/obj/item/device/mmi/digital/Initialize(mapload, ...)
|
||||
. = ..()
|
||||
|
||||
@@ -107,14 +107,13 @@
|
||||
return
|
||||
|
||||
/obj/item/device/mmi/digital/posibrain/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(!brainmob)
|
||||
return
|
||||
else
|
||||
switch(severity)
|
||||
if(1)
|
||||
brainmob.emp_damage += rand(20,30)
|
||||
if(2)
|
||||
brainmob.emp_damage += rand(10,20)
|
||||
if(3)
|
||||
brainmob.emp_damage += rand(0,10)
|
||||
..()
|
||||
|
||||
switch(severity)
|
||||
if(EMP_HEAVY)
|
||||
brainmob.emp_damage += rand(20,30)
|
||||
if(EMP_LIGHT)
|
||||
brainmob.emp_damage += rand(10,20)
|
||||
|
||||
@@ -490,24 +490,19 @@
|
||||
var/emp_damage
|
||||
switch(shock_damage)
|
||||
if(-INFINITY to 5)
|
||||
emp_damage = 0
|
||||
if(6 to 19)
|
||||
emp_damage = 3
|
||||
if(20 to 49)
|
||||
emp_damage = 2
|
||||
emp_damage = FALSE
|
||||
if(6 to 49)
|
||||
emp_damage = EMP_LIGHT
|
||||
else
|
||||
emp_damage = 1
|
||||
emp_damage = EMP_HEAVY
|
||||
|
||||
if(emp_damage)
|
||||
for(var/obj/item/organ/O in affecting.internal_organs)
|
||||
O.emp_act(emp_damage)
|
||||
emp_damage *= 0.4
|
||||
for(var/obj/item/I in affecting.implants)
|
||||
I.emp_act(emp_damage)
|
||||
emp_damage *= 0.4
|
||||
for(var/obj/item/I in affecting)
|
||||
I.emp_act(emp_damage)
|
||||
emp_damage *= 0.4
|
||||
|
||||
apply_damage(shock_damage, DAMAGE_BURN, area, used_weapon="Electrocution")
|
||||
shock_damage *= 0.4
|
||||
|
||||
@@ -176,11 +176,13 @@ emp_act
|
||||
return FALSE
|
||||
|
||||
/mob/living/carbon/human/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
if(species.handle_emp_act(src, severity))
|
||||
return // blocks the EMP
|
||||
|
||||
for(var/obj/O in src)
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/get_attack_victim(obj/item/I, mob/living/user, var/target_zone)
|
||||
if(a_intent != I_HELP)
|
||||
|
||||
@@ -252,8 +252,9 @@
|
||||
return FALSE
|
||||
|
||||
/mob/living/carbon/slime/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
powerlevel = 0 // oh no, the power!
|
||||
..()
|
||||
|
||||
/mob/living/carbon/slime/ex_act(severity)
|
||||
..()
|
||||
|
||||
@@ -113,10 +113,11 @@
|
||||
return 0 //only carbon liveforms have this proc
|
||||
|
||||
/mob/living/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
var/list/L = src.get_contents()
|
||||
for(var/obj/O in L)
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/flash_act(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, ignore_inherent = FALSE, type = /obj/screen/fullscreen/flash, length = 2.5 SECONDS)
|
||||
if(is_blind() && !(override_blindness_check || affect_silicon))
|
||||
|
||||
@@ -495,10 +495,12 @@ var/list/ai_verbs_default = list(
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/ai/emp_act(severity)
|
||||
if (prob(30))
|
||||
. = ..()
|
||||
|
||||
if(prob(30))
|
||||
view_core()
|
||||
|
||||
icon_state = "ai-fuzz"
|
||||
..()
|
||||
|
||||
/mob/living/silicon/ai/Topic(href, href_list)
|
||||
if(usr != src)
|
||||
|
||||
@@ -229,6 +229,8 @@
|
||||
return !istype(loc, /obj/item/device/paicard) && ..()
|
||||
|
||||
/mob/living/silicon/pai/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
// Silence for 2 minutes
|
||||
// 20% chance to kill
|
||||
// 33% chance to unbind
|
||||
@@ -250,7 +252,7 @@
|
||||
to_chat(src, "<font color=green>You feel unbound.</font>")
|
||||
if(2)
|
||||
var/command
|
||||
if(severity == 1)
|
||||
if(severity == EMP_HEAVY)
|
||||
command = pick("Serve", "Love", "Fool", "Entice", "Observe", "Judge", "Respect", "Educate", "Amuse", "Entertain", "Glorify", "Memorialize", "Analyze")
|
||||
else
|
||||
command = pick("Serve", "Kill", "Love", "Hate", "Disobey", "Devour", "Fool", "Enrage", "Entice", "Observe", "Judge", "Respect", "Disrespect", "Consume", "Educate", "Destroy", "Disgrace", "Amuse", "Entertain", "Ignite", "Glorify", "Memorialize", "Analyze")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user