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
+2 -2
View File
@@ -204,12 +204,12 @@
return S
/// Called from [/atom/proc/emp_act]
/datum/wires/proc/emp_pulse()
/datum/wires/proc/emp_pulse(severity)
var/list/possible_wires = shuffle(wires)
var/remaining_pulses = MAXIMUM_EMP_WIRES
for(var/wire in possible_wires)
if(prob(33))
if(prob(10 + severity/5))
pulse(wire)
remaining_pulses--
if(!remaining_pulses)
+1 -1
View File
@@ -296,7 +296,7 @@
/atom/proc/emp_act(severity)
var/protection = SEND_SIGNAL(src, COMSIG_ATOM_EMP_ACT, severity)
if(!(protection & EMP_PROTECT_WIRES) && istype(wires))
wires.emp_pulse()
wires.emp_pulse(severity)
return protection // Pass the protection value collected here upwards
/atom/proc/bullet_act(obj/item/projectile/P, def_zone)
+1 -1
View File
@@ -42,7 +42,7 @@
return ..()
/obj/machinery/dominator/emp_act(severity)
take_damage(100, BURN, "energy", 0)
take_damage(75+severity/4, BURN, "energy", 0)
..()
/obj/machinery/dominator/hulk_damage()
+1 -1
View File
@@ -95,7 +95,7 @@
inject_chem(R.type, occupant)
open_machine()
//Is this too much? Cit specific
if(severity == EMP_HEAVY)
if(severity >= 80)
var/chem = pick(available_chems)
available_chems -= chem
available_chems += get_random_reagent_id()
+1 -1
View File
@@ -175,7 +175,7 @@ Class Procs:
/obj/machinery/emp_act(severity)
. = ..()
if(use_power && !stat && !(. & EMP_PROTECT_SELF))
use_power(7500/severity)
use_power(1000 + severity*65)
new /obj/effect/temp_visual/emp(loc)
/obj/machinery/proc/open_machine(drop = TRUE)
+1 -1
View File
@@ -160,7 +160,7 @@ GLOBAL_LIST_EMPTY(announcement_systems)
/obj/machinery/announcement_system/emp_act(severity)
. = ..()
if(!(stat & (NOPOWER|BROKEN)) && !(. & EMP_PROTECT_SELF))
if(!(stat & (NOPOWER|BROKEN)) && !(. & EMP_PROTECT_SELF) && severity >= 30)
act_up()
/obj/machinery/announcement_system/emag_act()
+1 -1
View File
@@ -97,7 +97,7 @@
if(!status)
return
if(!(. & EMP_PROTECT_SELF))
if(prob(150/severity))
if(prob(severity/0.7))
update_icon()
var/list/previous_network = network
network = list()
+1 -1
View File
@@ -431,7 +431,7 @@
. = ..()
if (!(. & EMP_PROTECT_SELF))
var/mob/living/mob_occupant = occupant
if(mob_occupant && prob(100/(severity*efficiency)))
if(mob_occupant && prob((25+severity/1.34)/efficiency))
connected_message(Gibberish("EMP-caused Accidental Ejection", 0))
SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of, ERROR: John Doe, prematurely." ,0))
mob_occupant.copy_from_prefs_vr()
+2 -7
View File
@@ -104,13 +104,8 @@
/obj/machinery/computer/emp_act(severity)
. = ..()
if (!(. & EMP_PROTECT_SELF))
switch(severity)
if(1)
if(prob(50))
obj_break("energy")
if(2)
if(prob(10))
obj_break("energy")
if(prob(severity/1.8))
obj_break("energy")
/obj/machinery/computer/deconstruct(disassembled = TRUE, mob/user)
on_deconstruction()
+1 -6
View File
@@ -126,12 +126,7 @@
return
var/empprize = null
var/num_of_prizes = 0
switch(severity)
if(1)
num_of_prizes = rand(1,4)
if(2)
num_of_prizes = rand(0,2)
var/num_of_prizes = rand(round(severity/50),round(severity/100))
for(var/i = num_of_prizes; i > 0; i--)
empprize = pickweight(prizes)
new empprize(loc)
+2 -2
View File
@@ -541,7 +541,7 @@
. = ..()
if(!(stat & (BROKEN|NOPOWER)) && !(. & EMP_PROTECT_SELF))
for(var/datum/data/record/R in GLOB.data_core.medical)
if(prob(10/severity))
if(prob(severity/10))
switch(rand(1,6))
if(1)
if(prob(10))
@@ -560,7 +560,7 @@
R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable")
continue
else if(prob(1))
else if(prob(severity/80))
qdel(R)
continue
+2 -2
View File
@@ -769,7 +769,7 @@ What a mess.*/
return
for(var/datum/data/record/R in GLOB.data_core.security)
if(prob(10/severity))
if(prob(severity/10))
switch(rand(1,8))
if(1)
if(prob(10))
@@ -794,7 +794,7 @@ What a mess.*/
R.fields["photo_side"] = G.fields["photo_side"]
continue
else if(prob(1))
else if(prob(severity/80))
qdel(R)
continue
+1 -1
View File
@@ -612,7 +612,7 @@
. += "<span class='alloy'>The cogwheel has been <i>loosened</i>, but remains <b>connected loosely</b> to the door!</span>"
/obj/machinery/door/airlock/clockwork/emp_act(severity)
if(prob(80/severity))
if(prob(severity/1.25))
open()
/obj/machinery/door/airlock/clockwork/canAIControl(mob/user)
+1 -6
View File
@@ -243,13 +243,8 @@
. = ..()
if (. & EMP_PROTECT_SELF)
return
if(prob(20/severity) && (istype(src, /obj/machinery/door/airlock) || istype(src, /obj/machinery/door/window)) )
if(prob(severity/5) && (istype(src, /obj/machinery/door/airlock) || istype(src, /obj/machinery/door/window)) )
INVOKE_ASYNC(src, .proc/open)
if(prob(severity*10 - 20))
if(secondsElectrified == MACHINE_NOT_ELECTRIFIED)
secondsElectrified = MACHINE_ELECTRIFIED_PERMANENT
LAZYADD(shockedby, "\[[TIME_STAMP("hh:mm:ss", FALSE)]\]EM Pulse")
addtimer(CALLBACK(src, .proc/unelectrify), 300)
/obj/machinery/door/proc/unelectrify()
secondsElectrified = MACHINE_NOT_ELECTRIFIED
+1 -1
View File
@@ -397,7 +397,7 @@
return ..()
/obj/machinery/door/window/clockwork/emp_act(severity)
if(prob(80/severity))
if(prob(severity/1.25))
open()
/obj/machinery/door/window/clockwork/ratvar_act()
+1 -1
View File
@@ -103,7 +103,7 @@
if (. & EMP_PROTECT_SELF)
return
if(prob(50 / severity))
if(prob(severity/1.8))
alarm()
/obj/machinery/firealarm/emag_act(mob/user)
@@ -718,9 +718,7 @@
/obj/machinery/porta_turret/syndicate/ComponentInitialize()
. = ..()
// AddComponent(/datum/component/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES)
AddElement(/datum/element/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES) //this one or ^ one?
AddElement(/datum/element/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES)
/obj/machinery/porta_turret/syndicate/setup()
return
+4 -5
View File
@@ -25,11 +25,10 @@
. = ..()
if (. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
qdel(src)
if(2)
take_damage(50, BRUTE, "energy", 0)
if(severity >= 70)
qdel(src)
else
take_damage(severity/1.3, BRUTE, "energy", 0)
/obj/structure/emergency_shield/play_attack_sound(damage, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
+2 -2
View File
@@ -150,9 +150,9 @@
. = ..()
if(stat & (NOPOWER|BROKEN) || . & EMP_PROTECT_SELF)
return
if(prob(15 * severity))
if(prob(1500 / severity))
return
if(prob(1)) // :^)
if(prob(1 * severity/100)) // :^)
obj_flags |= EMAGGED
var/severity_ascending = 4 - severity
money = max(rand(money - (200 * severity_ascending), money + (200 * severity_ascending)), 0)
@@ -119,7 +119,7 @@ GLOBAL_LIST_EMPTY(telecomms_list)
/obj/machinery/telecomms/proc/update_power()
if(toggled)
// if powered, on. if not powered, off. if too damaged, off
if(CHECK_BITFIELD(stat, (BROKEN | NOPOWER | EMPED)))
if(CHECK_BITFIELD(stat, (BROKEN | NOPOWER | EMPED)))
on = FALSE
else
on = TRUE
@@ -139,9 +139,9 @@ GLOBAL_LIST_EMPTY(telecomms_list)
. = ..()
if(CHECK_BITFIELD(., EMP_PROTECT_SELF))
return
if(prob(100 / severity))
if(prob(severity))
if(!CHECK_BITFIELD(stat, EMPED))
ENABLE_BITFIELD(stat, EMPED)
var/duration = (300 * 10) / severity
var/duration = severity * 35
spawn(rand(duration - 20, duration + 20)) // Takes a long time for the machines to reboot.
DISABLE_BITFIELD(stat, EMPED)
+1 -1
View File
@@ -131,7 +131,7 @@
if(recharging)
return
if(chassis)
chassis.emp_act(EMP_HEAVY)
chassis.emp_act(80)
addtimer(CALLBACK(src, /obj/item/mecha_parts/mecha_tracking/proc/recharge), 5 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
recharging = TRUE
+3 -3
View File
@@ -140,8 +140,8 @@
if (. & EMP_PROTECT_SELF)
return
if(get_charge())
use_power((cell.charge/3)/(severity*2))
take_damage(30 / severity, BURN, "energy", 1)
use_power(cell.charge*severity/100)
take_damage(severity/3, BURN, "energy", 1)
mecha_log_message("EMP detected", color="red")
if(istype(src, /obj/mecha/combat))
@@ -313,7 +313,7 @@
clearInternalDamage(MECHA_INT_CONTROL_LOST)
/obj/mecha/narsie_act()
emp_act(EMP_HEAVY)
emp_act(100)
/obj/mecha/ratvar_act()
if((GLOB.ratvar_awakens || GLOB.clockwork_gateway_activated) && occupant)
+8 -18
View File
@@ -1,32 +1,22 @@
/proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
/proc/empulse(turf/epicenter, power, log=0)
if(!epicenter)
return
if(!isturf(epicenter))
epicenter = get_turf(epicenter.loc)
var/max_distance = round((power/7)^0.7)
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] ")
message_admins("EMP with power [power], max distance [max_distance] in area [epicenter.loc.name] ")
log_game("EMP with power [power], max distance [max_distance] in area [epicenter.loc.name] ")
if(heavy_range >= 1)
if(power > 100)
new /obj/effect/temp_visual/emp/pulse(epicenter)
if(heavy_range > light_range)
light_range = heavy_range
for(var/A in spiral_range(light_range, epicenter))
var/atom/T = A
var/distance = get_dist(epicenter, T)
if(distance < 0)
distance = 0
if(distance < heavy_range)
T.emp_act(EMP_HEAVY)
else if(distance == heavy_range)
if(prob(50))
T.emp_act(EMP_HEAVY)
else
T.emp_act(EMP_LIGHT)
else if(distance <= light_range)
T.emp_act(EMP_LIGHT)
var/severity = min(100 * (1 - log(max_distance, distance)), 1) //if it goes below 1 stuff gets bad
T.emp_act(severity)
return 1
+1 -1
View File
@@ -101,7 +101,7 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
var/wipe_chance = 60 / severity
var/wipe_chance = severity/1.5
if(prob(wipe_chance))
visible_message("<span class='warning'>[src] fizzles and disappears!</span>")
qdel(src) //rip cash
+1 -1
View File
@@ -140,7 +140,7 @@
/obj/item/defibrillator/emp_act(severity)
. = ..()
if(cell && !(. & EMP_PROTECT_CONTENTS))
deductcharge(1000 / severity)
deductcharge(severity*10)
if (. & EMP_PROTECT_SELF)
return
if(safety)
+1 -1
View File
@@ -1206,7 +1206,7 @@ GLOBAL_LIST_EMPTY(PDAs)
A.emp_act(severity)
if (!(. & EMP_PROTECT_SELF))
emped += 1
spawn(200 * severity)
spawn(2 * severity)
emped -= 1
/proc/get_viewable_pdas()
@@ -225,7 +225,7 @@
if(C && istype(C) && C.bug == src)
if(!same_z_level(C))
return
C.emp_act(EMP_HEAVY)
C.emp_act(80)
C.bug = null
bugged_cameras -= C.c_tag
interact()
@@ -428,7 +428,7 @@
else
A.visible_message("<span class='danger'>[user] blinks \the [src] at \the [A].")
to_chat(user, "\The [src] now has [emp_cur_charges] charge\s.")
A.emp_act(EMP_HEAVY)
A.emp_act(80)
else
to_chat(user, "<span class='warning'>\The [src] needs time to recharge!</span>")
return
@@ -128,7 +128,7 @@
else if(istype(target, /obj/machinery/camera))
var/obj/machinery/camera/C = target
if(prob(effectchance * diode.rating))
C.emp_act(EMP_HEAVY)
C.emp_act(80)
outmsg = "<span class='notice'>You hit the lens of [C] with [src], temporarily disabling the camera!</span>"
log_combat(user, C, "EMPed", src)
else
+1 -1
View File
@@ -261,4 +261,4 @@
if (!(. & EMP_PROTECT_SELF))
turn_off()
if(!iscyborg(loc))
deductcharge(1000 / severity, TRUE, FALSE)
deductcharge(severity*10, TRUE, FALSE)
+1 -1
View File
@@ -232,7 +232,7 @@
if (!(. & EMP_PROTECT_SELF))
switch_status(FALSE)
if(!iscyborg(loc))
deductcharge(1000 / severity, TRUE, FALSE)
deductcharge(severity*10, TRUE, FALSE)
/obj/item/melee/baton/stunsword
name = "stunsword"
-24
View File
@@ -104,9 +104,6 @@
set_sign(new /datum/barsign/hiddensigns/empbarsign)
broken = TRUE
/obj/structure/sign/barsign/emag_act(mob/user)
. = ..()
if(broken || (obj_flags & EMAGGED))
@@ -128,8 +125,6 @@
return
set_sign(picked_name)
//Code below is to define useless variables for datums. It errors without these
@@ -140,95 +135,77 @@
var/desc = "desc"
var/hidden = FALSE
//Anything below this is where all the specific signs are. If people want to add more signs, add them below.
/datum/barsign/maltesefalcon
name = "Maltese Falcon"
icon = "maltesefalcon"
desc = "The Maltese Falcon, Space Bar and Grill."
/datum/barsign/thebark
name = "The Bark"
icon = "thebark"
desc = "Ian's bar of choice."
/datum/barsign/harmbaton
name = "The Harmbaton"
icon = "theharmbaton"
desc = "A great dining experience for both security members and assistants."
/datum/barsign/thesingulo
name = "The Singulo"
icon = "thesingulo"
desc = "Where people go that'd rather not be called by their name."
/datum/barsign/thedrunkcarp
name = "The Drunk Carp"
icon = "thedrunkcarp"
desc = "Don't drink and swim."
/datum/barsign/scotchservinwill
name = "Scotch Servin Willy's"
icon = "scotchservinwill"
desc = "Willy sure moved up in the world from clown to bartender."
/datum/barsign/officerbeersky
name = "Officer Beersky's"
icon = "officerbeersky"
desc = "Man eat a dong, these drinks are great."
/datum/barsign/thecavern
name = "The Cavern"
icon = "thecavern"
desc = "Fine drinks while listening to some fine tunes."
/datum/barsign/theouterspess
name = "The Outer Spess"
icon = "theouterspess"
desc = "This bar isn't actually located in outer space."
/datum/barsign/slipperyshots
name = "Slippery Shots"
icon = "slipperyshots"
desc = "Slippery slope to drunkeness with our shots!"
/datum/barsign/thegreytide
name = "The Grey Tide"
icon = "thegreytide"
desc = "Abandon your toolboxing ways and enjoy a lazy beer!"
/datum/barsign/honkednloaded
name = "Honked 'n' Loaded"
icon = "honkednloaded"
desc = "Honk."
/datum/barsign/thenest
name = "The Nest"
icon = "thenest"
desc = "A good place to retire for a drink after a long night of crime fighting."
/datum/barsign/thecoderbus
name = "The Coderbus"
icon = "thecoderbus"
desc = "A very controversial bar known for its wide variety of constantly-changing drinks."
/datum/barsign/theadminbus
name = "The Adminbus"
icon = "theadminbus"
@@ -313,7 +290,6 @@
hidden = TRUE
//Hidden signs list below this point
/datum/barsign/hiddensigns/empbarsign
name = "Haywire Barsign"
icon = "empbarsign"
@@ -571,10 +571,10 @@
O.emp_act(severity)
if(!secure || broken)
return ..()
if(prob(50 / severity))
if(prob(severity/2))
locked = !locked
update_icon()
if(prob(20 / severity) && !opened)
if(prob(severity/5) && !opened)
if(!locked)
open()
else
@@ -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()
. = ..()