emp rework

This commit is contained in:
Timothy Teakettle
2020-09-09 23:14:06 +01:00
parent 72cb1129db
commit f1cd94fc97
65 changed files with 109 additions and 212 deletions
@@ -28,6 +28,6 @@
/datum/reagent/blob/electromagnetic_web/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/O)
reac_volume = ..()
if(prob(reac_volume*2))
M.emp_act(EMP_LIGHT)
M.emp_act(50)
if(M)
M.apply_damage(reac_volume, BURN, wound_bonus=CANT_WOUND)
@@ -204,7 +204,7 @@
if(severity > 0)
if(overmind)
overmind.blobstrain.emp_reaction(src, severity)
if(prob(100 - severity * 30))
if(prob(severity/1.5))
new /obj/effect/temp_visual/emp(get_turf(src))
/obj/structure/blob/zap_act(power)
@@ -223,7 +223,7 @@
L.flash_act(1, 1)
if(issilicon(target))
var/mob/living/silicon/S = L
S.emp_act(EMP_HEAVY)
S.emp_act(80)
else //for Nar'sian weaklings
to_chat(L, "<span class='heavy_brass'>\"How does it feel to see the light, dog?\"</span>")
L.visible_message("<span class='warning'>[L]'s eyes flare with burning light!</span>", \
+2 -2
View File
@@ -451,7 +451,7 @@
L.flash_act(1,1)
if(issilicon(target))
var/mob/living/silicon/S = L
S.emp_act(EMP_HEAVY)
S.emp_act(80)
else if(iscarbon(target))
var/mob/living/carbon/C = L
C.silent += clamp(12 - C.silent, 0, 6)
@@ -610,7 +610,7 @@
var/prev_color = candidate.color
candidate.color = "black"
if(do_after(user, 90, target = candidate))
candidate.emp_act(EMP_HEAVY)
candidate.emp_act(80)
var/construct_class = alert(user, "Please choose which type of construct you wish to create.",,"Juggernaut","Wraith","Artificer")
user.visible_message("<span class='danger'>The dark cloud receedes from what was formerly [candidate], revealing a\n [construct_class]!</span>")
switch(construct_class)
@@ -300,7 +300,7 @@
continue
to_chat(human, "<span class='revenwarning'>You feel [pick("your sense of direction flicker out", "a stabbing pain in your head", "your mind fill with static")].</span>")
new /obj/effect/temp_visual/revenant(human.loc)
human.emp_act(EMP_HEAVY)
human.emp_act(80)
for(var/obj/thing in T)
if(istype(thing, /obj/machinery/power/apc) || istype(thing, /obj/machinery/power/smes)) //Doesn't work on SMES and APCs, to prevent kekkery
continue
@@ -310,12 +310,12 @@
thing.emag_act(null)
else
if(!istype(thing, /obj/machinery/clonepod)) //I hate everything but mostly the fact there's no better way to do this without just not affecting it at all
thing.emp_act(EMP_HEAVY)
thing.emp_act(80)
for(var/mob/living/silicon/robot/S in T) //Only works on cyborgs, not AI
playsound(S, 'sound/machines/warning-buzzer.ogg', 50, 1)
new /obj/effect/temp_visual/revenant(S.loc)
S.spark_system.start()
S.emp_act(EMP_HEAVY)
S.emp_act(80)
//Blight: Infects nearby humans and in general messes living stuff up.
/obj/effect/proc_holder/spell/aoe_turf/revenant/blight
@@ -63,9 +63,9 @@
if(. & EMP_PROTECT_SELF)
return
if(is_operational())
if(prob(50 / severity))
if(prob(severity/2))
on = !on
if(prob(100 / severity))
if(prob(severity))
direction = PUMP_OUT
pump.target_pressure = rand(0, 100 * ONE_ATMOSPHERE)
update_icon()
@@ -80,7 +80,6 @@
else if(on && holding && direction == PUMP_OUT)
investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS)
/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
@@ -58,7 +58,7 @@
if(. & EMP_PROTECT_SELF)
return
if(is_operational())
if(prob(50 / severity))
if(prob(severity/3))
on = !on
update_icon()
@@ -62,13 +62,12 @@
if(. & EMP_PROTECT_SELF)
return
var/mob/living/carbon/human/user = src.loc
switch(severity)
if(1)
if(activated && user && ishuman(user) && (user.wear_suit == src))
to_chat(user, "<span class='danger'>E:FATAL:RAM_READ_FAIL\nE:FATAL:STACK_EMPTY\nE:FATAL:READ_NULL_POINT\nE:FATAL:PWR_BUS_OVERLOAD</span>")
to_chat(user, "<span class='userdanger'>An electromagnetic pulse disrupts your [name] and violently tears you out of time-bluespace!</span>")
user.emote("scream")
deactivate(1, 1)
if(severity >= 70)
if(activated && user && ishuman(user) && (user.wear_suit == src))
to_chat(user, "<span class='danger'>E:FATAL:RAM_READ_FAIL\nE:FATAL:STACK_EMPTY\nE:FATAL:READ_NULL_POINT\nE:FATAL:PWR_BUS_OVERLOAD</span>")
to_chat(user, "<span class='userdanger'>An electromagnetic pulse disrupts your [name] and violently tears you out of time-bluespace!</span>")
user.emote("scream")
deactivate(1, 1)
/obj/item/clothing/suit/space/chronos/proc/finish_chronowalk(mob/living/carbon/human/user, turf/to_turf)
if(!user)
@@ -23,4 +23,4 @@
/datum/round_event/communications_blackout/start()
for(var/obj/machinery/telecomms/T in GLOB.telecomms_list)
T.emp_act(EMP_HEAVY)
T.emp_act(80)
+1 -1
View File
@@ -141,7 +141,7 @@
for(var/obj/machinery/rnd/server/S in GLOB.machines)
if(S.stat & (NOPOWER|BROKEN))
continue
S.emp_act(1)
S.emp_act(80)
new /obj/effect/temp_visual/emp(get_turf(S))
/obj/machinery/shuttle_scrambler/proc/dump_loot(mob/user)
+1 -1
View File
@@ -36,4 +36,4 @@
// at all
P.ex_act(EXPLODE_DEVASTATE)
else
P.emp_act(EMP_HEAVY)
P.emp_act(80)
@@ -61,7 +61,7 @@
playsound(src,'sound/effects/sparks4.ogg',50,1)
qdel(src)
/obj/item/wormhole_jaunter/emp_act(power)
/obj/item/wormhole_jaunter/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
return
@@ -70,10 +70,7 @@
if(istype(M))
var/triggered = FALSE
if(M.get_item_by_slot(SLOT_BELT) == src)
if(power == 1)
triggered = TRUE
else if(power == 2 && prob(50))
triggered = TRUE
if(prob(severity))
if(triggered)
M.visible_message("<span class='warning'>[src] overloads and activates!</span>")
+1 -7
View File
@@ -169,13 +169,7 @@
if(!brainmob || iscyborg(loc))
return
else
switch(severity)
if(1)
brainmob.emp_damage = min(brainmob.emp_damage + rand(20,30), 30)
if(2)
brainmob.emp_damage = min(brainmob.emp_damage + rand(10,20), 30)
if(3)
brainmob.emp_damage = min(brainmob.emp_damage + rand(0,10), 30)
brainmob.emp_damage = min(brainmob.emp_damage + rand(-5,5) + severity/3, 30)
brainmob.emote("alarm")
/obj/item/mmi/Destroy()
@@ -412,13 +412,9 @@
if(!informed)
to_chat(src, "<span class='userdanger'>You feel a sharp pain as your robotic limbs overload.</span>")
informed = TRUE
switch(severity)
if(1)
L.receive_damage(0,10)
Stun(200)
if(2)
L.receive_damage(0,5)
Stun(100)
if(1)
L.receive_damage(0,severity/10)
Stun(severity*2)
/mob/living/carbon/human/acid_act(acidpwr, acid_volume, bodyzone_hit)
var/list/damaged = list()
@@ -84,11 +84,7 @@
EMPeffect = TRUE
spec_updatehealth(H)
to_chat(H, "<span class='notice'>You feel the light of your body leave you.</span>")
switch(severity)
if(EMP_LIGHT)
addtimer(CALLBACK(src, .proc/stop_emp, H), 10 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE) //We're out for 10 seconds
if(EMP_HEAVY)
addtimer(CALLBACK(src, .proc/stop_emp, H), 20 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE) //We're out for 20 seconds
addtimer(CALLBACK(src, .proc/stop_emp, H), (severity/5) SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE) //lights out
/datum/species/ethereal/proc/on_emag_act(mob/living/carbon/human/H, mob/user)
if(emageffect)
@@ -184,7 +184,7 @@
else if(isliving(AM))
var/mob/living/L = AM
if(isethereal(AM))
AM.emp_act(EMP_LIGHT)
AM.emp_act(50)
if(iscyborg(AM))
var/mob/living/silicon/robot/borg = AM
if(borg.lamp_intensity)
@@ -19,13 +19,14 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
disconnect_shell()
if (prob(30))
switch(pick(1,2))
if(1)
view_core()
if(2)
SSshuttle.requestEvac(src,"ALERT: Energy surge detected in AI core! Station integrity may be compromised! Initiati--%m091#ar-BZZT")
if(severity >= 60)
disconnect_shell()
if(prob(30))
switch(pick(1,2))
if(1)
view_core()
if(2)
SSshuttle.requestEvac(src,"ALERT: Energy surge detected in AI core! Station integrity may be compromised! Initiati--%m091#ar-BZZT")
/mob/living/silicon/ai/ex_act(severity, target)
switch(severity)
@@ -7,8 +7,8 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
take_holo_damage(50/severity)
DefaultCombatKnockdown(400/severity)
take_holo_damage(severity/2)
DefaultCombatKnockdown(severity*4)
silent = max(silent, (PAI_EMP_SILENCE_DURATION) / SSmobs.wait / severity)
if(holoform)
fold_in(force = TRUE)
@@ -85,12 +85,7 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
Paralyze(160)
if(2)
Paralyze(60)
Paralyze(10 + severity/1.2)
/mob/living/silicon/robot/emag_act(mob/user)
if(user == src)//To prevent syndieborgs from emagging themselves
@@ -105,14 +105,10 @@
to_chat(src, "<span class='danger'>Warning: Electromagnetic pulse detected.</span>")
if(. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
src.take_bodypart_damage(20)
if(2)
src.take_bodypart_damage(10)
src.take_bodypart_damage(severity/5)
to_chat(src, "<span class='userdanger'>*BZZZT*</span>")
for(var/mob/living/M in buckled_mobs)
if(prob(severity*50))
if(prob(severity/2))
unbuckle_mob(M)
M.DefaultCombatKnockdown(40)
M.visible_message("<span class='boldwarning'>[M] is thrown off of [src]!</span>",
@@ -370,7 +370,7 @@
ejectpai(0)
if(on)
turn_off()
spawn(severity*300)
spawn(3 * severity)
stat &= ~EMPED
if(was_on)
turn_on()
@@ -1060,4 +1060,4 @@ Pass a positive integer as an argument to override a bot's default speed.
path.Cut(1, 2)
/mob/living/silicon/rust_heretic_act()
adjustBruteLoss(500)
adjustBruteLoss(500)
@@ -459,12 +459,10 @@ Auto Patrol[]"},
/mob/living/simple_animal/bot/ed209/emp_act(severity)
if(severity == 2 && prob(70))
severity = 1
. = ..()
if(. & EMP_PROTECT_SELF)
return
if (severity >= 2)
if (severity >= 65)
new /obj/effect/temp_visual/emp(loc)
var/list/mob/living/carbon/targets = new
for(var/mob/living/carbon/C in view(12,src))
@@ -719,7 +719,6 @@
if(load)
load.emp_act(severity)
/mob/living/simple_animal/bot/mulebot/explode()
visible_message("<span class='boldannounce'>[src] blows apart!</span>")
var/atom/Tsec = drop_location()
@@ -220,11 +220,10 @@
return
Stun(100)
to_chat(src, "<span class='danger'><b>ER@%R: MME^RY CO#RU9T!</b> R&$b@0tin)...</span>")
if(severity == 1)
if(severity >= 65)
adjustBruteLoss(heavy_emp_damage)
to_chat(src, "<span class='userdanger'>HeAV% DA%^MMA+G TO I/O CIR!%UUT!</span>")
/mob/living/simple_animal/drone/proc/triggerAlarm(class, area/A, O, obj/alarmsource)
if(alarmsource.z != z)
return
@@ -240,7 +239,6 @@
L[A.name] = list(A, list(alarmsource))
to_chat(src, "--- [class] alarm detected in [A.name]!")
/mob/living/simple_animal/drone/proc/cancelAlarm(class, area/A, obj/origin)
if(stat != DEAD)
var/list/L = alarms[class]
+3 -22
View File
@@ -30,7 +30,6 @@
var/stored_power = 0//Power to deploy per tick
/obj/machinery/power/am_control_unit/Initialize()
. = ..()
linked_shielding = list()
@@ -44,7 +43,6 @@
QDEL_NULL(fueljar)
return ..()
/obj/machinery/power/am_control_unit/process()
if(exploding)
explosion(get_turf(src),8,12,18,12)
@@ -72,7 +70,6 @@
return
/obj/machinery/power/am_control_unit/proc/produce_power()
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
var/core_power = reported_core_efficiency//Effectively how much fuel we can safely deal with
@@ -103,15 +100,9 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
if(active)
toggle_power()
stability -= rand(15,30)
if(2)
if(active)
toggle_power()
stability -= rand(10,20)
if(active)
toggle_power()
stability -= rand(round(severity/5),round(severity/3))
/obj/machinery/power/am_control_unit/blob_act()
stability -= 20
@@ -123,20 +114,17 @@
check_stability()
return
/obj/machinery/power/am_control_unit/ex_act(severity, target)
stability -= (80 - (severity * 20))
check_stability()
return
/obj/machinery/power/am_control_unit/bullet_act(obj/item/projectile/Proj)
. = ..()
if(Proj.flag != "bullet")
stability -= Proj.force
check_stability()
/obj/machinery/power/am_control_unit/power_change()
..()
if(stat & NOPOWER)
@@ -150,7 +138,6 @@
return
/obj/machinery/power/am_control_unit/update_icon_state()
if(active)
icon_state = "control_on"
@@ -158,7 +145,6 @@
icon_state = "control"
//No other icons for it atm
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
if(!anchored)
@@ -192,7 +178,6 @@
else
return ..()
/obj/machinery/power/am_control_unit/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
@@ -221,7 +206,6 @@
update_shield_icons = 1
return 1
/obj/machinery/power/am_control_unit/proc/remove_shielding(obj/machinery/am_shielding/AMS)
if(!istype(AMS))
return 0
@@ -231,13 +215,11 @@
toggle_power()
return 1
/obj/machinery/power/am_control_unit/proc/check_stability()//TODO: make it break when low also might want to add a way to fix it like a part or such that can be replaced
if(stability <= 0)
qdel(src)
return
/obj/machinery/power/am_control_unit/proc/toggle_power(powerfail = 0)
active = !active
if(active)
@@ -249,7 +231,6 @@
update_icon()
return
/obj/machinery/power/am_control_unit/proc/check_shield_icons()//Forces icon_update for all shields
if(shield_icon_delay)
return
+1 -1
View File
@@ -1449,7 +1449,7 @@
environ = 0
update_icon()
update()
addtimer(CALLBACK(src, .proc/reset, APC_RESET_EMP), 600)
addtimer(CALLBACK(src, .proc/reset, APC_RESET_EMP), severity*8)
/obj/machinery/power/apc/blob_act(obj/structure/blob/B)
set_broken()
+3 -3
View File
@@ -136,8 +136,8 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
charge -= 1000 / severity
if (charge < 0)
charge -= 10 * severity
if(charge < 0)
charge = 0
/obj/item/stock_parts/cell/ex_act(severity, target)
@@ -359,7 +359,7 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
charge = clamp((charge-(10000/severity)),0,maxcharge)
charge = clamp((charge-(100*severity)),0,maxcharge)
/obj/item/stock_parts/cell/emergency_light
name = "miniature power cell"
+1 -1
View File
@@ -209,7 +209,7 @@
if(obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
emp_act(EMP_HEAVY)
emp_act(100)
/obj/machinery/power/port_gen/pacman/attack_ai(mob/user)
interact(user)
+1 -1
View File
@@ -407,7 +407,7 @@
outputting = output_attempt
output_level = rand(0, output_level_max)
input_level = rand(0, input_level_max)
charge -= 1e6/severity
charge -= 10000*severity
if (charge < 0)
charge = 0
update_icon()
+1 -1
View File
@@ -346,7 +346,7 @@
if(issilicon(closest_mob))
var/mob/living/silicon/S = closest_mob
if((zap_flags & ZAP_MOB_STUN) && (zap_flags & ZAP_MOB_DAMAGE))
S.emp_act(EMP_LIGHT)
S.emp_act(50)
next_range = 7 // metallic folks bounce it further
else
next_range = 5
+1 -1
View File
@@ -41,7 +41,7 @@
/obj/item/gun/energy/emp_act(severity)
. = ..()
if(!(. & EMP_PROTECT_CONTENTS))
cell.use(round(cell.charge / severity))
cell.use(round(cell.charge * severity/100))
chambered = null //we empty the chamber
recharge_newshot() //and try to charge a new shot
update_icon()
@@ -132,7 +132,7 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
fail_chance = min(fail_chance + round(15/severity), 100)
fail_chance = min(fail_chance + round(severity/6.6), 100)
/obj/item/gun/energy/e_gun/nuclear/update_overlays()
. = ..()