diff --git a/code/WorkInProgress/cloning.dm b/code/WorkInProgress/cloning.dm
index 56de52dbb5b..5f9bc0258d3 100644
--- a/code/WorkInProgress/cloning.dm
+++ b/code/WorkInProgress/cloning.dm
@@ -653,6 +653,10 @@
src.go_out()
return
+/obj/machinery/clonepod/emp_act(severity)
+ if(prob(100/severity)) malfunction()
+ ..()
+
/obj/machinery/clonepod/ex_act(severity)
switch(severity)
if(1.0)
diff --git a/code/datums/spells/disable_tech.dm b/code/datums/spells/disable_tech.dm
index 59cd62e6e94..9f58f7c509e 100644
--- a/code/datums/spells/disable_tech.dm
+++ b/code/datums/spells/disable_tech.dm
@@ -1 +1,19 @@
-//not gonna happen until muskets makes his emp_act() proc. we have enough copies of that proc
\ No newline at end of file
+/obj/spell/disable_tech
+ name = "Disable Tech"
+ desc = "This spell disables all weapons, cameras and most other technology in range and doesn't require wizard garb."
+ recharge = 400
+ clothes_req = 0
+ invocation = "NEC CANTIO"
+ invocation_type = "whisper"
+ range = 7
+
+/obj/spell/disable_tech/Click()
+ ..()
+
+ if(!cast_check())
+ return
+
+ invocation()
+
+ empulse(src, (range-2), range)
+ return
\ No newline at end of file
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index a93746d48c0..e7d2846d738 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -560,6 +560,10 @@
/obj/machinery/firealarm/attack_paw(mob/user as mob)
return src.attack_hand(user)
+/obj/machinery/firealarm/emp_act(severity)
+ if(prob(50/severity)) alarm()
+ ..()
+
/obj/machinery/firealarm/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/wirecutters))
src.detecting = !( src.detecting )
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index b8b10baf3f2..097b3170857 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -139,7 +139,6 @@
healthcheck()
return
-
/obj/machinery/portable_atmospherics/canister/meteorhit(var/obj/O as obj)
src.health = 0
healthcheck()
diff --git a/code/game/machinery/camera.dm b/code/game/machinery/camera.dm
index 70465ad642f..0b5f4792747 100644
--- a/code/game/machinery/camera.dm
+++ b/code/game/machinery/camera.dm
@@ -230,6 +230,26 @@
return
+/obj/machinery/camera/emp_act(severity)
+ icon_state = "cameraemp"
+ network = null //Not the best way but it will do. I think.
+ spawn(900)
+ network = initial(network)
+ icon_state = initial(icon_state)
+ for(var/mob/living/silicon/ai/O in world)
+ if (O.current == src)
+ O.cancel_camera()
+ O << "Your connection to the camera has been lost."
+ for(var/mob/O in world)
+ if (istype(O.machine, /obj/machinery/computer/security))
+ var/obj/machinery/computer/security/S = O.machine
+ if (S.current == src)
+ O.machine = null
+ S.current = null
+ O.reset_view(null)
+ O << "The screen bursts into static."
+ ..()
+
/obj/machinery/camera/ex_act(severity)
if(src.invuln)
return
diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm
index 9fa03643d1d..a8257643133 100644
--- a/code/game/machinery/computer/computer.dm
+++ b/code/game/machinery/computer/computer.dm
@@ -16,6 +16,10 @@ Pod/Blast Doors computer
smoke.start()
return
+/obj/machinery/computer/emp_act(severity)
+ if(prob(20/severity)) set_broken()
+ ..()
+
/obj/machinery/computer/ex_act(severity)
switch(severity)
if(1.0)
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 4b1adf9c4f6..5f7f9a58317 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -143,6 +143,16 @@
if(prob(40))
del(src)
+/obj/machinery/door/emp_act(severity)
+ if(prob(20/severity) && (istype(src,/obj/machinery/door/airlock) || istype(src,/obj/machinery/door/window)) )
+ open()
+ if(prob(40/severity))
+ if(secondsElectrified == 0)
+ secondsElectrified = -1
+ spawn(300)
+ secondsElectrified = 0
+ ..()
+
/obj/machinery/door/ex_act(severity)
switch(severity)
if(1.0)
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 5ac3c7a18b9..5f65916aac6 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -9,6 +9,21 @@
/obj/machinery/proc/process()
return
+/obj/machinery/emp_act(severity)
+ if(use_power && stat == 0)
+ use_power(7500/severity)
+
+ var/obj/overlay/pulse2 = new/obj/overlay ( src.loc )
+ pulse2.icon = 'effects.dmi'
+ pulse2.icon_state = "empdisable"
+ pulse2.name = "emp sparks"
+ pulse2.anchored = 1
+ pulse2.dir = pick(cardinal)
+
+ spawn(10)
+ del(pulse2)
+ ..()
+
/obj/machinery/ex_act(severity)
switch(severity)
if(1.0)
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index 3fd4e5a2b34..8dcc863f184 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -287,6 +287,13 @@
src.die()
return
+/obj/machinery/turret/emp_act(severity)
+ switch(severity)
+ if(1)
+ enabled = 0
+ lasers = 0
+ power_change()
+ ..()
/obj/machinery/turret/ex_act(severity)
if(severity < 3)
diff --git a/code/game/magic/cultist/runes.dm b/code/game/magic/cultist/runes.dm
index 11b7c5e9ecb..b974a7c1f5a 100644
--- a/code/game/magic/cultist/runes.dm
+++ b/code/game/magic/cultist/runes.dm
@@ -152,181 +152,7 @@ var/list/sacrificed = list()
T.hotspot_expose(700,125)
var/rune = src // detaching the proc - in theory
- src = null
-
- var/obj/overlay/pulse = new/obj/overlay ( T )
- pulse.icon = 'effects.dmi'
- pulse.icon_state = "emppulse"
- pulse.name = "emp pulse"
- pulse.anchored = 1
- spawn(20)
- del(pulse)
-
- for(var/obj/item/weapon/W in range(world.view-range_red, T))
-
- if (istype(W, /obj/item/assembly/m_i_ptank) || istype(W, /obj/item/assembly/r_i_ptank) || istype(W, /obj/item/assembly/t_i_ptank))
-
- var/fuckthis
- if(istype(W:part1,/obj/item/weapon/tank/plasma))
- fuckthis = W:part1
- fuckthis:ignite()
- if(istype(W:part2,/obj/item/weapon/tank/plasma))
- fuckthis = W:part2
- fuckthis:ignite()
- if(istype(W:part3,/obj/item/weapon/tank/plasma))
- fuckthis = W:part3
- fuckthis:ignite()
-
-
- for(var/mob/living/M in viewers(world.view-range_red, T))
-
- if(!istype(M, /mob/living)) continue
-
- if (istype(M, /mob/living/silicon))
- M.fireloss += 25
- flick("noise", M:flash)
- M << "\red *BZZZT*"
- M << "\red Warning: Electromagnetic pulse detected."
- if(istype(M, /mob/living/silicon/ai))
- if (prob(30))
- switch(pick(1,2,3)) //Add Random laws.
- if(1)
- M:cancel_camera()
- if(2)
- M:lockdown()
- if(3)
- M:ai_call_shuttle()
- continue
-
-
- M << "\red Your equipment malfunctions." //Yeah, i realise that this WILL
- //show if theyre not carrying anything
- //that is affected. lazy.
- if (locate(/obj/item/weapon/cloaking_device, M))
- for(var/obj/item/weapon/cloaking_device/S in M)
- S.active = 0
- S.icon_state = "shield0"
-
- if (locate(/obj/item/weapon/gun/energy, M))
- for(var/obj/item/weapon/gun/energy/G in M)
- G.charges = 0
- G.update_icon()
-
- if ((istype(M, /mob/living/carbon/human)) && (istype(M:glasses, /obj/item/clothing/glasses/thermal)))
- M << "\red Your thermals malfunction."
- M.eye_blind = 3
- M.eye_blurry = 5
- M.disabilities |= 1
- spawn(100)
- M.disabilities &= ~1
-
- if (locate(/obj/item/device/radio, M))
- for(var/obj/item/device/radio/R in M) //Add something for the intercoms.
- R.broadcasting = 0
- R.listening = 0
-
- if (locate(/obj/item/device/flash, M))
- for(var/obj/item/device/flash/F in M) //Add something for the intercoms.
- F.attack_self()
-
- if (locate(/obj/item/weapon/baton, M))
- for(var/obj/item/weapon/baton/B in M) //Add something for the intercoms.
- B.charges = 0
-
- if(locate(/obj/item/clothing/under/chameleon, M))
- for(var/obj/item/clothing/under/chameleon/C in M) //Add something for the intercoms.
- M << "\red Your jumpsuit malfunctions"
- C.name = "psychedelic"
- C.desc = "Groovy!"
- C.icon_state = "psyche"
- C.color = "psyche"
- spawn(200)
- C.name = "Black Jumpsuit"
- C.icon_state = "bl_suit"
- C.color = "black"
- C.desc = null
-
- M << "\red BZZZT"
-
-
- for(var/obj/machinery/A in range(world.view-range_red, T))
- A.use_power(7500)
-
- var/obj/overlay/pulse2 = new/obj/overlay ( A.loc )
- pulse2.icon = 'effects.dmi'
- pulse2.icon_state = "empdisable"
- pulse2.name = "emp sparks"
- pulse2.anchored = 1
- pulse2.dir = pick(cardinal)
-
- spawn(10)
- del(pulse2)
-
- if(istype(A, /obj/machinery/turret))
- A:enabled = 0
- A:lasers = 0
- A:power_change()
-
- if(istype(A, /obj/machinery/computer) && prob(20))
- A:set_broken()
-
- if(istype(A, /obj/machinery/firealarm) && prob(50))
- A:alarm()
-
- if(istype(A, /obj/machinery/power/smes))
- A:online = 0
- A:charging = 0
- A:output = 0
- A:charge -= 1e6
- if (A:charge < 0)
- A:charge = 0
- spawn(100)
- A:output = initial(A:output)
- A:charging = initial(A:charging)
- A:online = initial(A:online)
-
- if(istype(A, /obj/machinery/door))
- if(prob(20) && (istype(A,/obj/machinery/door/airlock) || istype(A,/obj/machinery/door/window)) )
- A:open()
- if(prob(40))
- if(A:secondsElectrified != 0) continue
- A:secondsElectrified = -1
- spawn(300)
- A:secondsElectrified = 0
-
- if(istype(A, /obj/machinery/power/apc))
- if(A:cell)
- A:cell:charge -= 1000
- if (A:cell:charge < 0)
- A:cell:charge = 0
- A:lighting = 0
- A:equipment = 0
- A:environ = 0
- spawn(600)
- A:equipment = 3
- A:environ = 3
-
- if(istype(A, /obj/machinery/camera))
- A.icon_state = "cameraemp"
- A:network = null //Not the best way but it will do. I think.
- spawn(900)
- A:network = initial(A:network)
- A:icon_state = initial(A:icon_state)
- for(var/mob/living/silicon/ai/O in world)
- if (O.current == A)
- O.cancel_camera()
- O << "Your connection to the camera has been lost."
- for(var/mob/O in world)
- if (istype(O.machine, /obj/machinery/computer/security))
- var/obj/machinery/computer/security/S = O.machine
- if (S.current == A)
- O.machine = null
- S.current = null
- O.reset_view(null)
- O << "The screen bursts into static."
-
- if(istype(A, /obj/machinery/clonepod))
- A:malfunction()
+ empulse(src, (range_red - 2), range_red)
del(rune)
return
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index d38caa39a6f..32064cfb13d 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -354,6 +354,10 @@
M.gib()
return
+/obj/mecha/emp_act(severity)
+ cell.charge = 0
+ health -= 100 / severity
+ update_health()
/obj/mecha/ex_act(severity)
src.log_message("Affected by explosion of severity: [severity].",1)
if(prob(src.deflect_chance))
diff --git a/code/game/objects/devices/flash.dm b/code/game/objects/devices/flash.dm
index 2001b3bbffc..58756bcd88b 100644
--- a/code/game/objects/devices/flash.dm
+++ b/code/game/objects/devices/flash.dm
@@ -105,3 +105,7 @@
safety = 1
if (!( safety ))
flick("flash", M.flash)
+
+/obj/item/device/flash/emp_act(severity)
+ src.attack_self()
+ ..()
diff --git a/code/game/objects/devices/shields.dm b/code/game/objects/devices/shields.dm
index 7cff7f9823f..736c82c3a7d 100644
--- a/code/game/objects/devices/shields.dm
+++ b/code/game/objects/devices/shields.dm
@@ -19,4 +19,9 @@
user << "\blue The cloaking device is now inactive."
src.icon_state = "shield0"
src.add_fingerprint(user)
- return
\ No newline at end of file
+ return
+
+/obj/item/weapon/cloaking_device/emp_act(severity)
+ active = 0
+ icon_state = "shield0"
+ ..()
\ No newline at end of file
diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm
new file mode 100644
index 00000000000..1e97f0640f5
--- /dev/null
+++ b/code/game/objects/empulse.dm
@@ -0,0 +1,34 @@
+proc/empulse(turf/epicenter, heavy_range, light_range)
+ if(!epicenter) return
+ message_admins("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
+
+ if (!istype(epicenter, /turf))
+ epicenter = epicenter.loc
+ return empulse(epicenter, heavy_range, light_range)
+
+ if(heavy_range > 1)
+ var/obj/overlay/pulse = new/obj/overlay ( epicenter )
+ pulse.icon = 'effects.dmi'
+ pulse.icon_state = "emppulse"
+ pulse.name = "emp pulse"
+ pulse.anchored = 1
+ spawn(20)
+ del(pulse)
+
+ if(heavy_range > light_range)
+ light_range = heavy_range
+
+ for(var/atom/T in range(light_range, epicenter))
+ var/distance = get_dist(epicenter, T)
+ if(distance < 0)
+ distance = 0
+ if(distance < heavy_range)
+ T.emp_act(1)
+ else if(distance == heavy_range)
+ if(prob(50))
+ T.emp_act(1)
+ else
+ T.emp_act(2)
+ else if(distance <= light_range)
+ T.emp_act(2)
+ return 1
\ No newline at end of file
diff --git a/code/game/objects/items/clothing.dm b/code/game/objects/items/clothing.dm
index ec30e0f3273..b3c472e8c52 100644
--- a/code/game/objects/items/clothing.dm
+++ b/code/game/objects/items/clothing.dm
@@ -7,6 +7,7 @@ SUNGLASSES
SWAT SUIT
CHAMELEON JUMPSUIT
DEATH COMMANDO GAS MASK
+THERMAL GLASSES
*/
@@ -159,6 +160,18 @@ DEATH COMMANDO GAS MASK
item_state = A.item_state
color = A.color
+/obj/item/clothing/under/chameleon/emp_act(severity)
+ name = "psychedelic"
+ desc = "Groovy!"
+ icon_state = "psyche"
+ color = "psyche"
+ spawn(200)
+ name = "Black Jumpsuit"
+ icon_state = "bl_suit"
+ color = "black"
+ desc = null
+ ..()
+
/obj/item/clothing/suit/swat_suit/death_commando
name = "Death Commando Suit"
icon_state = "death_commando_suit"
@@ -241,4 +254,17 @@ DEATH COMMANDO GAS MASK
else
src.icon_state = "ushankadown"
src.item_state = "ushankadown"
- user << "You lower the ear flaps on the ushanka."
\ No newline at end of file
+ user << "You lower the ear flaps on the ushanka."
+
+
+/obj/item/clothing/glasses/thermal/emp_act(severity)
+ if(istype(src.loc, /mob/living/carbon/human))
+ var/mob/living/carbon/human/M = src.loc
+ M << "\red The Optical Thermal Scanner overloads and blinds you!"
+ if(M.glasses == src)
+ M.eye_blind = 3
+ M.eye_blurry = 5
+ M.disabilities |= 1
+ spawn(100)
+ M.disabilities &= ~1
+ ..()
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/grenades.dm b/code/game/objects/items/weapons/grenades.dm
index 0a9ae6f25af..bba81c2088b 100644
--- a/code/game/objects/items/weapons/grenades.dm
+++ b/code/game/objects/items/weapons/grenades.dm
@@ -37,186 +37,7 @@ FLASHBANG
T.hotspot_expose(700,125)
var/grenade = src // detaching the proc - in theory
- src = null
-
- var/obj/overlay/pulse = new/obj/overlay ( T )
- pulse.icon = 'effects.dmi'
- pulse.icon_state = "emppulse"
- pulse.name = "emp pulse"
- pulse.anchored = 1
- spawn(20)
- del(pulse)
-
- for(var/obj/item/weapon/W in range(world.view-1, T))
-
- if (istype(W, /obj/item/assembly/m_i_ptank) || istype(W, /obj/item/assembly/r_i_ptank) || istype(W, /obj/item/assembly/t_i_ptank))
-
- var/fuckthis
- if(istype(W:part1,/obj/item/weapon/tank/plasma))
- fuckthis = W:part1
- fuckthis:ignite()
- if(istype(W:part2,/obj/item/weapon/tank/plasma))
- fuckthis = W:part2
- fuckthis:ignite()
- if(istype(W:part3,/obj/item/weapon/tank/plasma))
- fuckthis = W:part3
- fuckthis:ignite()
-
-
- for(var/mob/living/M in viewers(world.view-1, T))
-
- if(!istype(M, /mob/living)) continue
-
- if (istype(M, /mob/living/silicon))
- M.fireloss += 25
- flick("noise", M:flash)
- M << "\red *BZZZT*"
- M << "\red Warning: Electromagnetic pulse detected."
- if(istype(M, /mob/living/silicon/ai))
- if (prob(30))
- switch(pick(1,2,3)) //Add Random laws.
- if(1)
- M:cancel_camera()
- if(2)
- M:lockdown()
- if(3)
- M:ai_call_shuttle()
- continue
-
-
- M << "\red Your equipment malfunctions." //Yeah, i realise that this WILL
- //show if theyre not carrying anything
- //that is affected. lazy.
- if (locate(/obj/item/weapon/cloaking_device, M))
- for(var/obj/item/weapon/cloaking_device/S in M)
- S.active = 0
- S.icon_state = "shield0"
-
- if (locate(/obj/item/weapon/gun/energy, M))
- for(var/obj/item/weapon/gun/energy/G in M)
- G.charges = 0
- G.update_icon()
-
- if ((istype(M, /mob/living/carbon/human)) && (istype(M:glasses, /obj/item/clothing/glasses/thermal)))
- M << "\red Your thermals malfunction."
- M.eye_blind = 3
- M.eye_blurry = 5
- M.disabilities |= 1
- spawn(100)
- M.disabilities &= ~1
-
- if (locate(/obj/item/device/radio, M))
- for(var/obj/item/device/radio/R in M) //Add something for the intercoms.
- R.broadcasting = 0
- R.listening = 0
-
- if (locate(/obj/item/device/flash, M))
- for(var/obj/item/device/flash/F in M) //Add something for the intercoms.
- F.attack_self()
-
- if (locate(/obj/item/weapon/baton, M))
- for(var/obj/item/weapon/baton/B in M) //Add something for the intercoms.
- B.charges = 0
-
- if(locate(/obj/item/clothing/under/chameleon, M))
- for(var/obj/item/clothing/under/chameleon/C in M) //Add something for the intercoms.
- M << "\red Your jumpsuit malfunctions"
- C.name = "psychedelic"
- C.desc = "Groovy!"
- C.icon_state = "psyche"
- C.color = "psyche"
- spawn(200)
- C.name = "Black Jumpsuit"
- C.icon_state = "bl_suit"
- C.color = "black"
- C.desc = null
-
- M << "\red BZZZT"
-
-
- for(var/obj/machinery/A in range(world.view-1, T))
- A.use_power(7500)
-
- var/obj/overlay/pulse2 = new/obj/overlay ( A.loc )
- pulse2.icon = 'effects.dmi'
- pulse2.icon_state = "empdisable"
- pulse2.name = "emp sparks"
- pulse2.anchored = 1
- pulse2.dir = pick(cardinal)
-
- spawn(10)
- del(pulse2)
-
- if(istype(A, /obj/machinery/turret))
- A:enabled = 0
- A:lasers = 0
- A:power_change()
-
- if(istype(A, /obj/machinery/computer) && prob(20))
- A:set_broken()
-
- if(istype(A, /obj/machinery/firealarm) && prob(50))
- A:alarm()
-
- if(istype(A, /obj/machinery/power/smes))
- A:online = 0
- A:charging = 0
- A:output = 0
- A:charge -= 1e6
- if (A:charge < 0)
- A:charge = 0
- spawn(100)
- A:output = initial(A:output)
- A:charging = initial(A:charging)
- A:online = initial(A:online)
-
- if(istype(A, /obj/machinery/door))
- if(prob(20) && (istype(A,/obj/machinery/door/airlock) || istype(A,/obj/machinery/door/window)) )
- A:open()
- if(prob(40))
- if(A:secondsElectrified != 0) continue
- A:secondsElectrified = -1
- spawn(300)
- A:secondsElectrified = 0
-
- if(istype(A, /obj/machinery/power/apc))
- if(A:cell)
- A:cell:charge -= 1000
- if (A:cell:charge < 0)
- A:cell:charge = 0
- A:lighting = 0
- A:equipment = 0
- A:environ = 0
- spawn(600)
- A:equipment = 3
- A:environ = 3
-
- if(istype(A, /obj/machinery/camera))
- A.icon_state = "cameraemp"
- A:network = null //Not the best way but it will do. I think.
- spawn(900)
- A:network = initial(A:network)
- A:icon_state = initial(A:icon_state)
- for(var/mob/living/silicon/ai/O in world)
- if (O.current == A)
- O.cancel_camera()
- O << "Your connection to the camera has been lost."
- for(var/mob/O in world)
- if (istype(O.machine, /obj/machinery/computer/security))
- var/obj/machinery/computer/security/S = O.machine
- if (S.current == A)
- O.machine = null
- S.current = null
- O.reset_view(null)
- O << "The screen bursts into static."
-
- if(istype(A, /obj/machinery/clonepod))
- A:malfunction()
-
- for(var/obj/mecha/M in range(world.view-1, T))
- M.cell.charge = 0
- M.health -= 100
- M.update_health()
+ empulse(src, 5, 7)
del(grenade)
diff --git a/code/game/objects/items/weapons/guns_ammo.dm b/code/game/objects/items/weapons/guns_ammo.dm
index fe1e9fff41a..a10f32cb17f 100644
--- a/code/game/objects/items/weapons/guns_ammo.dm
+++ b/code/game/objects/items/weapons/guns_ammo.dm
@@ -548,7 +548,10 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/us
src.icon_state = text("gun[]", ratio)
return
-
+/obj/item/weapon/gun/energy/emp_act(severity)
+ charges = 0
+ update_icon()
+ ..()
// LASER GUN
diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm
index ced3958009a..ca9be4e1732 100644
--- a/code/game/objects/items/weapons/swords_axes_etc.dm
+++ b/code/game/objects/items/weapons/swords_axes_etc.dm
@@ -177,6 +177,13 @@ STUN BATON
for(var/mob/O in viewers(M))
if (O.client) O.show_message("\red [M] has been stunned with the stun baton by [user]!", 1, "\red You hear someone fall", 2)
+/obj/item/weapon/baton/emp_act(severity)
+ switch(severity)
+ if(1)
+ src.charges = 0
+ if(2)
+ charges -= 5
+
/obj/item/weapon/classic_baton/attack(mob/M as mob, mob/user as mob)
if ((usr.mutations & 16) && prob(50))
usr << "\red You club yourself over the head."
diff --git a/code/game/objects/radio/radio.dm b/code/game/objects/radio/radio.dm
index b1349ab4f54..f078495762d 100644
--- a/code/game/objects/radio/radio.dm
+++ b/code/game/objects/radio/radio.dm
@@ -285,3 +285,8 @@ Frequency:
//Foreach goto(83)
src.add_fingerprint(user)
return
+
+/obj/item/device/radio/emp_act(severity)
+ broadcasting = 0
+ listening = 0
+ ..()
diff --git a/code/game/objects/weapons.dm b/code/game/objects/weapons.dm
index 290c2bbb7ae..c7a77289300 100644
--- a/code/game/objects/weapons.dm
+++ b/code/game/objects/weapons.dm
@@ -705,6 +705,12 @@
return
+/obj/item/assembly/m_i_ptank/emp_act(severity)
+
+ if(istype(part3,/obj/item/weapon/tank/plasma) && prob(100/severity))
+ part3.ignite()
+ ..()
+
//*****RM
/obj/item/assembly/t_i_ptank/c_state(n)
@@ -800,6 +806,11 @@
src.part3.release()
return
+/obj/item/assembly/t_i_ptank/emp_act(severity)
+ if(istype(part3,/obj/item/weapon/tank/plasma) && prob(100/severity))
+ part3.ignite()
+ ..()
+
/obj/item/assembly/r_i_ptank/examine()
..()
src.part3.examine()
@@ -864,6 +875,13 @@
src.add_fingerprint(user)
return
+/obj/item/assembly/r_i_ptank/emp_act(severity)
+ if(istype(part3,/obj/item/weapon/tank/plasma) && prob(100/severity))
+ part3.ignite()
+ ..()
+
+//*****RM
+
/obj/item/clothing/suit/armor/a_i_a_ptank/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/device/analyzer))
src.part4.attackby(W, user)
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 852a3a5e6b9..3621ca01c8c 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -130,6 +130,7 @@
src.verbs += /client/proc/cmd_admin_gib
src.verbs += /client/proc/cmd_admin_gib_self
src.verbs += /client/proc/cmd_admin_explosion
+ src.verbs += /client/proc/cmd_admin_emp
src.verbs += /client/proc/cmd_admin_delete
src.verbs += /client/proc/cmd_admin_drop_everything
src.verbs += /client/proc/cmd_admin_prison
@@ -257,6 +258,7 @@
src.verbs += /client/proc/cmd_admin_gib
src.verbs += /client/proc/cmd_admin_gib_self
src.verbs += /client/proc/cmd_admin_explosion
+ src.verbs += /client/proc/cmd_admin_emp
src.verbs += /client/proc/cmd_admin_delete
src.verbs += /client/proc/cmd_admin_drop_everything
src.verbs += /client/proc/cmd_admin_prison
@@ -382,6 +384,7 @@
src.verbs += /client/proc/cmd_admin_gib
src.verbs += /client/proc/cmd_admin_gib_self
//src.verbs += /client/proc/cmd_admin_explosion
+ //src.verbs += /client/proc/cmd_admin_emp
src.verbs += /client/proc/cmd_admin_delete
src.verbs += /client/proc/cmd_admin_drop_everything
src.verbs += /client/proc/cmd_admin_prison
@@ -535,6 +538,7 @@
//src.verbs += /client/proc/cmd_admin_gib
src.verbs += /client/proc/cmd_admin_gib_self
//src.verbs += /client/proc/cmd_admin_explosion
+ //src.verbs += /client/proc/cmd_admin_emp
//src.verbs += /client/proc/cmd_admin_delete
//src.verbs += /client/proc/cmd_admin_drop_everything
src.verbs += /client/proc/cmd_admin_prison
@@ -678,6 +682,7 @@
//src.verbs += /client/proc/cmd_admin_gib
src.verbs += /client/proc/cmd_admin_gib_self
//src.verbs += /client/proc/cmd_admin_explosion
+ //src.verbs += /client/proc/cmd_admin_emp
//src.verbs += /client/proc/cmd_admin_delete
//src.verbs += /client/proc/cmd_admin_drop_everything
src.verbs += /client/proc/cmd_admin_prison
@@ -816,6 +821,7 @@
//src.verbs += /client/proc/cmd_admin_gib
src.verbs += /client/proc/cmd_admin_gib_self
//src.verbs += /client/proc/cmd_admin_explosion
+ //src.verbs += /client/proc/cmd_admin_emp
//src.verbs += /client/proc/cmd_admin_delete
//src.verbs += /client/proc/cmd_admin_drop_everything
src.verbs += /client/proc/cmd_admin_prison
@@ -938,6 +944,7 @@
//src.verbs += /client/proc/cmd_admin_gib
src.verbs += /client/proc/cmd_admin_gib_self
//src.verbs += /client/proc/cmd_admin_explosion
+ //src.verbs += /client/proc/cmd_admin_emp
//src.verbs += /client/proc/cmd_admin_delete
//src.verbs += /client/proc/cmd_admin_drop_everything
src.verbs += /client/proc/cmd_admin_prison
@@ -1093,6 +1100,7 @@
src.verbs -= /client/proc/cmd_admin_gib
src.verbs -= /client/proc/cmd_admin_gib_self
src.verbs -= /client/proc/cmd_admin_explosion
+ src.verbs -= /client/proc/cmd_admin_emp
src.verbs -= /client/proc/cmd_admin_delete
src.verbs -= /client/proc/cmd_admin_drop_everything
src.verbs -= /client/proc/cmd_admin_prison
diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm
index 2285bcebced..154135026c6 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -525,6 +525,27 @@ TO DO: actually integrate random appearance and player preference save.
else
return
+/client/proc/cmd_admin_emp(atom/O as obj|mob|turf in world)
+ set category = "Special Verbs"
+ set name = "EM Pulse"
+
+ if (!src.authenticated || !src.holder)
+ src << "Only administrators may use this command."
+ return
+
+ var/heavy = input("Range of heavy pulse.", text("Input")) as num
+ var/light = input("Range of light pulse.", text("Input")) as num
+
+ if (heavy || light)
+
+ empulse(O, heavy, light)
+ log_admin("[key_name(usr)] created an EM Pulse ([heavy],[light]) at ([O.x],[O.y],[O.z])")
+ message_admins("[key_name_admin(usr)] created an EM PUlse ([heavy],[light]) at ([O.x],[O.y],[O.z])", 1)
+
+ return
+ else
+ return
+
/client/proc/cmd_admin_gib(mob/M as mob in world)
set category = "Special Verbs"
set name = "Gib"
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index d577e4c9a5c..a471282ee59 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -158,6 +158,13 @@
src.drowsyness += 5
return
+/mob/living/carbon/alien/humanoid/emp_act(severity)
+ if(wear_suit) wear_suit.emp_act(severity)
+ if(head) head.emp_act(severity)
+ if(r_store) r_store.emp_act(severity)
+ if(l_store) l_store.emp_act(severity)
+ ..()
+
/mob/living/carbon/alien/humanoid/ex_act(severity)
flick("flash", src.flash)
diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm
index 84e7a5796df..81245367d8e 100644
--- a/code/modules/mob/living/carbon/alien/larva/larva.dm
+++ b/code/modules/mob/living/carbon/alien/larva/larva.dm
@@ -122,6 +122,10 @@
src.drowsyness += 5
return
+/mob/living/carbon/alien/larva/emp_act(severity)
+ ..()
+
+
/mob/living/carbon/alien/larva/ex_act(severity)
flick("flash", src.flash)
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index e69d6539649..70882448cc2 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -419,6 +419,22 @@
return
return
+/mob/living/carbon/human/emp_act(severity)
+ if(wear_suit) wear_suit.emp_act(severity)
+ if(w_uniform) w_uniform.emp_act(severity)
+ if(shoes) shoes.emp_act(severity)
+ if(belt) belt.emp_act(severity)
+ if(gloves) gloves.emp_act(severity)
+ if(glasses) glasses.emp_act(severity)
+ if(head) head.emp_act(severity)
+ if(ears) ears.emp_act(severity)
+ if(wear_id) wear_id.emp_act(severity)
+ if(r_store) r_store.emp_act(severity)
+ if(l_store) l_store.emp_act(severity)
+ if(s_store) s_store.emp_act(severity)
+ if(h_store) h_store.emp_act(severity)
+ ..()
+
/mob/living/carbon/human/ex_act(severity)
flick("flash", src.flash)
diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm
index e7c4fc0a29d..0a5ddbc7c5e 100644
--- a/code/modules/mob/living/carbon/monkey/monkey.dm
+++ b/code/modules/mob/living/carbon/monkey/monkey.dm
@@ -493,6 +493,10 @@
/mob/living/carbon/monkey/var/co2overloadtime = null
/mob/living/carbon/monkey/var/temperature_resistance = T0C+75
+/mob/living/carbon/monkey/emp_act(severity)
+ if(wear_id) wear_id.emp_act(severity)
+ ..()
+
/mob/living/carbon/monkey/ex_act(severity)
flick("flash", src.flash)
switch(severity)
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 20f7cf9b137..e0067d4002b 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -136,6 +136,17 @@
/mob/living/silicon/ai/restrained()
return 0
+/mob/living/silicon/ai/emp_act(severity)
+ if (prob(30))
+ switch(pick(1,2,3)) //Add Random laws.
+ if(1)
+ src.cancel_camera()
+ if(2)
+ src.lockdown()
+ if(3)
+ src.ai_call_shuttle()
+ ..()
+
/mob/living/silicon/ai/ex_act(severity)
flick("flash", src.flash)
diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm
index f6a00fdef60..3534642f8cf 100644
--- a/code/modules/mob/living/silicon/robot/robot_modules.dm
+++ b/code/modules/mob/living/silicon/robot/robot_modules.dm
@@ -8,6 +8,14 @@
var/list/modules = list()
var/obj/item/emag
+ emp_act(severity)
+ if(modules)
+ for(var/obj/O in modules)
+ O.emp_act(severity)
+ if(emag)
+ emag.emp_act(severity)
+ ..()
+
/obj/item/weapon/robot_module/standard
name = "standard robot module"
/*
diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm
index e9f70ab043f..c639aa272a5 100644
--- a/code/modules/mob/living/silicon/silicon.dm
+++ b/code/modules/mob/living/silicon/silicon.dm
@@ -7,5 +7,12 @@
/mob/living/silicon/proc/show_laws()
return
+/mob/living/silicon/emp_act(severity)
+ src.fireloss += 25
+ flick("noise", src:flash)
+ src << "\red *BZZZT*"
+ src << "\red Warning: Electromagnetic pulse detected."
+ ..()
+
/mob/living/silicon/proc/damage_mob(var/brute = 0, var/fire = 0, var/tox = 0)
return
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 52c9ea8ec16..d5244ea3d35 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -2204,4 +2204,10 @@ note dizziness decrements automatically in the mob's Life() proc.
boom.icon_state = "loss_general"
/mob/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0)
- return 0 //only carbon liveforms has this proc
\ No newline at end of file
+ return 0 //only carbon liveforms has this proc
+
+/mob/emp_act(severity)
+ var/list/L = src.get_contents()
+ for(var/obj/O in L)
+ O.emp_act(severity)
+ ..()
\ No newline at end of file
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 23885ce0d7c..c45af7a71ea 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -1023,6 +1023,17 @@
set_broken()
return
+/obj/machinery/power/apc/emp_act(severity)
+ if(cell)
+ cell.emp_act(severity)
+ lighting = 0
+ equipment = 0
+ environ = 0
+ spawn(600)
+ equipment = 3
+ environ = 3
+ ..()
+
/obj/machinery/power/apc/ex_act(severity)
switch(severity)
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index dc02569db62..bbfbc0119d5 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -121,6 +121,14 @@
if (prob(10))
rigged = 1 //broken batterys are dangerous
+/obj/item/weapon/cell/emp_act(severity)
+ charge -= 1000 / severity
+ if (charge < 0)
+ charge = 0
+ if(reliability != 100 && prob(50/severity))
+ reliability -= 10 / severity
+ ..()
+
/obj/item/weapon/cell/ex_act(severity)
switch(severity)
diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm
index d49c30e6a75..74c100fa72e 100644
--- a/code/modules/power/singularity/singularity.dm
+++ b/code/modules/power/singularity/singularity.dm
@@ -376,16 +376,7 @@ var/global/list/uneatable = list(
emp_area()
- var/turf/myturf = get_turf(src)
- var/obj/overlay/pulse = new/obj/overlay ( myturf )
- pulse.icon = 'effects.dmi'
- pulse.icon_state = "emppulse"
- pulse.name = "emp pulse"
- pulse.anchored = 1
- spawn(20)
- del(pulse)
- for (var/atom/X in orange(8,src))
- X.emp_act()
+ empulse(src, 6, 8)
return
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 3b182f9aed0..459eac05c8e 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -316,6 +316,19 @@
return
+/obj/machinery/power/smes/emp_act(severity)
+ online = 0
+ charging = 0
+ output = 0
+ charge -= 1e6/severity
+ if (charge < 0)
+ charge = 0
+ spawn(100)
+ output = initial(output)
+ charging = initial(charging)
+ online = initial(online)
+ ..()
+
/proc/rate_control(var/S, var/V, var/C, var/Min=1, var/Max=5, var/Limit=null)
var/href = "-[href]=-[Min]'>- [(C?C : 0)] [href]=[Min]'>+[href]=[Max]'>+"
diff --git a/tgstation.dme b/tgstation.dme
index 30459917a98..db4d6991c04 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -445,6 +445,7 @@
#include "code\game\objects\displaycase.dm"
#include "code\game\objects\door_assembly.dm"
#include "code\game\objects\effect_system.dm"
+#include "code\game\objects\empulse.dm"
#include "code\game\objects\explosion.dm"
#include "code\game\objects\gibs.dm"
#include "code\game\objects\grille.dm"