From f1cd94fc971cc7838224f602139239204c69f4ee Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 9 Sep 2020 23:14:06 +0100 Subject: [PATCH] emp rework --- code/datums/wires/_wires.dm | 4 +-- code/game/atoms.dm | 2 +- code/game/gamemodes/gangs/dominator.dm | 2 +- code/game/machinery/Sleeper.dm | 2 +- code/game/machinery/_machinery.dm | 2 +- code/game/machinery/announcement_system.dm | 2 +- code/game/machinery/camera/camera.dm | 2 +- code/game/machinery/cloning.dm | 2 +- code/game/machinery/computer/_computer.dm | 9 ++----- code/game/machinery/computer/arcade.dm | 7 +---- code/game/machinery/computer/medical.dm | 4 +-- code/game/machinery/computer/security.dm | 4 +-- code/game/machinery/doors/airlock_types.dm | 2 +- code/game/machinery/doors/door.dm | 7 +---- code/game/machinery/doors/windowdoor.dm | 2 +- code/game/machinery/firealarm.dm | 2 +- .../machinery/porta_turret/portable_turret.dm | 4 +-- code/game/machinery/shieldgen.dm | 9 +++---- code/game/machinery/slotmachine.dm | 4 +-- .../machinery/telecomms/telecomunications.dm | 6 ++--- code/game/mecha/mecha_control_console.dm | 2 +- code/game/mecha/mecha_defense.dm | 6 ++--- code/game/objects/empulse.dm | 26 ++++++------------- code/game/objects/items/credit_holochip.dm | 2 +- code/game/objects/items/defib.dm | 2 +- code/game/objects/items/devices/PDA/PDA.dm | 2 +- code/game/objects/items/devices/camera_bug.dm | 2 +- code/game/objects/items/devices/flashlight.dm | 2 +- .../objects/items/devices/laserpointer.dm | 2 +- code/game/objects/items/electrostaff.dm | 2 +- code/game/objects/items/stunbaton.dm | 2 +- code/game/objects/structures/barsigns.dm | 24 ----------------- .../structures/crates_lockers/closets.dm | 4 +-- .../blob/blobstrains/electromagnetic_web.dm | 2 +- code/modules/antagonists/blob/blob/theblob.dm | 2 +- .../clockcult/clock_helpers/slab_abilities.dm | 2 +- code/modules/antagonists/cult/blood_magic.dm | 4 +-- .../revenant/revenant_abilities.dm | 6 ++--- .../atmospherics/machinery/portable/pump.dm | 5 ++-- .../machinery/portable/scrubber.dm | 2 +- .../modules/clothing/spacesuits/chronosuit.dm | 13 +++++----- .../modules/events/communications_blackout.dm | 2 +- code/modules/events/pirates.dm | 2 +- code/modules/events/processor_overload.dm | 2 +- .../mining/equipment/wormhole_jaunter.dm | 7 ++--- code/modules/mob/living/brain/MMI.dm | 8 +----- .../mob/living/carbon/human/human_defense.dm | 10 +++---- .../carbon/human/species_types/ethereal.dm | 6 +---- .../human/species_types/shadowpeople.dm | 2 +- .../mob/living/silicon/ai/ai_defense.dm | 15 ++++++----- .../mob/living/silicon/pai/pai_defense.dm | 4 +-- .../mob/living/silicon/robot/robot_defense.dm | 7 +---- .../mob/living/silicon/silicon_defense.dm | 8 ++---- .../mob/living/simple_animal/bot/bot.dm | 4 +-- .../mob/living/simple_animal/bot/ed209bot.dm | 4 +-- .../mob/living/simple_animal/bot/mulebot.dm | 1 - .../simple_animal/friendly/drone/_drone.dm | 4 +-- code/modules/power/antimatter/control.dm | 25 +++--------------- code/modules/power/apc.dm | 2 +- code/modules/power/cell.dm | 6 ++--- code/modules/power/port_gen.dm | 2 +- code/modules/power/smes.dm | 2 +- code/modules/power/tesla/energy_ball.dm | 2 +- code/modules/projectiles/guns/energy.dm | 2 +- .../projectiles/guns/energy/energy_gun.dm | 2 +- 65 files changed, 109 insertions(+), 212 deletions(-) diff --git a/code/datums/wires/_wires.dm b/code/datums/wires/_wires.dm index 04fbc4a590..07c00d460a 100644 --- a/code/datums/wires/_wires.dm +++ b/code/datums/wires/_wires.dm @@ -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) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 8a66394ecc..81d5110b32 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -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) diff --git a/code/game/gamemodes/gangs/dominator.dm b/code/game/gamemodes/gangs/dominator.dm index a7e44ef325..ed17d830ba 100644 --- a/code/game/gamemodes/gangs/dominator.dm +++ b/code/game/gamemodes/gangs/dominator.dm @@ -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() diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 047e6c955f..bced9db61f 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -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() diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index b82d932e6d..e178829d87 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -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) diff --git a/code/game/machinery/announcement_system.dm b/code/game/machinery/announcement_system.dm index b004746051..1b1fa949a2 100644 --- a/code/game/machinery/announcement_system.dm +++ b/code/game/machinery/announcement_system.dm @@ -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() diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 2795ba45a9..7950d54ad3 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -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() diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 5bbd3f8a65..60a310e9d5 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -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() diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm index 6a1514a85e..16081db2c1 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -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() diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 4fb39c04e1..077571b931 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -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) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 4e99f67157..7f5fafcd80 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -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 diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 844f14465a..0157f4ca87 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -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 diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index b34e97d374..fe2bdf90b1 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -612,7 +612,7 @@ . += "The cogwheel has been loosened, but remains connected loosely to the door!" /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) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index d4ba70bb6c..1faff76626 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -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 diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 22bacf6aa1..3cd2011334 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -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() diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 000b3dc7b5..ca9ce09ced 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -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) diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index 54d320e93b..b82349f0e5 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -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 diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 6793d361b5..8a0f376b0f 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -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) diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index 4740adaffb..6282d74346 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -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) diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index e1b345f507..f75eef0b21 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -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) diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index 50d18c6fda..0e47872221 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -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 diff --git a/code/game/mecha/mecha_defense.dm b/code/game/mecha/mecha_defense.dm index e2d3af149f..0ac24f6312 100644 --- a/code/game/mecha/mecha_defense.dm +++ b/code/game/mecha/mecha_defense.dm @@ -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) diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm index b63a126c5d..d6cad22efd 100644 --- a/code/game/objects/empulse.dm +++ b/code/game/objects/empulse.dm @@ -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 diff --git a/code/game/objects/items/credit_holochip.dm b/code/game/objects/items/credit_holochip.dm index 0acb225772..21cfd1fbad 100644 --- a/code/game/objects/items/credit_holochip.dm +++ b/code/game/objects/items/credit_holochip.dm @@ -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("[src] fizzles and disappears!") qdel(src) //rip cash diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index 6396a4fe3d..484901990a 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -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) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 10b2b68646..c09d23aafb 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -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() diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index 6b53a9ba46..e20321414d 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -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() diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 75024aec26..035375fdaf 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -428,7 +428,7 @@ else A.visible_message("[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, "\The [src] needs time to recharge!") return diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index c931d92379..6d10d31f5c 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -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 = "You hit the lens of [C] with [src], temporarily disabling the camera!" log_combat(user, C, "EMPed", src) else diff --git a/code/game/objects/items/electrostaff.dm b/code/game/objects/items/electrostaff.dm index 9750994c87..65d2fdd699 100644 --- a/code/game/objects/items/electrostaff.dm +++ b/code/game/objects/items/electrostaff.dm @@ -261,4 +261,4 @@ if (!(. & EMP_PROTECT_SELF)) turn_off() if(!iscyborg(loc)) - deductcharge(1000 / severity, TRUE, FALSE) + deductcharge(severity*10, TRUE, FALSE) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index 1a84b85a1a..5e76d506ba 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -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" diff --git a/code/game/objects/structures/barsigns.dm b/code/game/objects/structures/barsigns.dm index 905888c904..2a4856f60e 100644 --- a/code/game/objects/structures/barsigns.dm +++ b/code/game/objects/structures/barsigns.dm @@ -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" diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 5c5b2bb132..46eb82342a 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -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 diff --git a/code/modules/antagonists/blob/blob/blobstrains/electromagnetic_web.dm b/code/modules/antagonists/blob/blob/blobstrains/electromagnetic_web.dm index 45bf2b1e1d..45c289019a 100644 --- a/code/modules/antagonists/blob/blob/blobstrains/electromagnetic_web.dm +++ b/code/modules/antagonists/blob/blob/blobstrains/electromagnetic_web.dm @@ -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) diff --git a/code/modules/antagonists/blob/blob/theblob.dm b/code/modules/antagonists/blob/blob/theblob.dm index ed85726a4a..22d1458086 100644 --- a/code/modules/antagonists/blob/blob/theblob.dm +++ b/code/modules/antagonists/blob/blob/theblob.dm @@ -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) diff --git a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm index 89ed669e7b..5affcd5dec 100644 --- a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm +++ b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm @@ -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, "\"How does it feel to see the light, dog?\"") L.visible_message("[L]'s eyes flare with burning light!", \ diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index 68a890028e..c43fd424d8 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -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("The dark cloud receedes from what was formerly [candidate], revealing a\n [construct_class]!") switch(construct_class) diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index 7a2f661fd9..38f7207ab8 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -300,7 +300,7 @@ continue to_chat(human, "You feel [pick("your sense of direction flicker out", "a stabbing pain in your head", "your mind fill with static")].") 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 diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm index bdde8f0f22..2c9bcdc1a7 100644 --- a/code/modules/atmospherics/machinery/portable/pump.dm +++ b/code/modules/atmospherics/machinery/portable/pump.dm @@ -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) diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index 7976ba641a..7fd50158ca 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -58,7 +58,7 @@ if(. & EMP_PROTECT_SELF) return if(is_operational()) - if(prob(50 / severity)) + if(prob(severity/3)) on = !on update_icon() diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm index 3f77a2befc..57659a70c4 100644 --- a/code/modules/clothing/spacesuits/chronosuit.dm +++ b/code/modules/clothing/spacesuits/chronosuit.dm @@ -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, "E:FATAL:RAM_READ_FAIL\nE:FATAL:STACK_EMPTY\nE:FATAL:READ_NULL_POINT\nE:FATAL:PWR_BUS_OVERLOAD") - to_chat(user, "An electromagnetic pulse disrupts your [name] and violently tears you out of time-bluespace!") - user.emote("scream") - deactivate(1, 1) + if(severity >= 70) + if(activated && user && ishuman(user) && (user.wear_suit == src)) + to_chat(user, "E:FATAL:RAM_READ_FAIL\nE:FATAL:STACK_EMPTY\nE:FATAL:READ_NULL_POINT\nE:FATAL:PWR_BUS_OVERLOAD") + to_chat(user, "An electromagnetic pulse disrupts your [name] and violently tears you out of time-bluespace!") + 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) diff --git a/code/modules/events/communications_blackout.dm b/code/modules/events/communications_blackout.dm index cb62e0df22..0342ca4643 100644 --- a/code/modules/events/communications_blackout.dm +++ b/code/modules/events/communications_blackout.dm @@ -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) diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm index 4cbfb8ae9a..3bcec9f471 100644 --- a/code/modules/events/pirates.dm +++ b/code/modules/events/pirates.dm @@ -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) diff --git a/code/modules/events/processor_overload.dm b/code/modules/events/processor_overload.dm index 6bedce6b4b..6f20d954ed 100644 --- a/code/modules/events/processor_overload.dm +++ b/code/modules/events/processor_overload.dm @@ -36,4 +36,4 @@ // at all P.ex_act(EXPLODE_DEVASTATE) else - P.emp_act(EMP_HEAVY) + P.emp_act(80) diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm index e9f8079400..ed97665603 100644 --- a/code/modules/mining/equipment/wormhole_jaunter.dm +++ b/code/modules/mining/equipment/wormhole_jaunter.dm @@ -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("[src] overloads and activates!") diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 891243496a..85c256f5b0 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -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() diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 18501b4ca2..14c595ac8c 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -412,13 +412,9 @@ if(!informed) to_chat(src, "You feel a sharp pain as your robotic limbs overload.") 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() diff --git a/code/modules/mob/living/carbon/human/species_types/ethereal.dm b/code/modules/mob/living/carbon/human/species_types/ethereal.dm index cd9b3b80c7..c182defda4 100644 --- a/code/modules/mob/living/carbon/human/species_types/ethereal.dm +++ b/code/modules/mob/living/carbon/human/species_types/ethereal.dm @@ -84,11 +84,7 @@ EMPeffect = TRUE spec_updatehealth(H) to_chat(H, "You feel the light of your body leave you.") - 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) diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm index 228a69c30f..a7d9ce4473 100644 --- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm @@ -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) diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm index 9cefa7a12f..b05b5f1aaf 100644 --- a/code/modules/mob/living/silicon/ai/ai_defense.dm +++ b/code/modules/mob/living/silicon/ai/ai_defense.dm @@ -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) diff --git a/code/modules/mob/living/silicon/pai/pai_defense.dm b/code/modules/mob/living/silicon/pai/pai_defense.dm index 64509d2deb..d8c1b8fe7d 100644 --- a/code/modules/mob/living/silicon/pai/pai_defense.dm +++ b/code/modules/mob/living/silicon/pai/pai_defense.dm @@ -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) diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index 746c4f469d..80afdecef1 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -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 diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm index 8be2183d3b..3377bf9601 100644 --- a/code/modules/mob/living/silicon/silicon_defense.dm +++ b/code/modules/mob/living/silicon/silicon_defense.dm @@ -105,14 +105,10 @@ to_chat(src, "Warning: Electromagnetic pulse detected.") 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, "*BZZZT*") 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("[M] is thrown off of [src]!", diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index a1772d9281..bb7c437ca7 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -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) diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 91462a6713..3f28fd6e01 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -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)) diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index d9bf8cc553..c0893f5ada 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -719,7 +719,6 @@ if(load) load.emp_act(severity) - /mob/living/simple_animal/bot/mulebot/explode() visible_message("[src] blows apart!") var/atom/Tsec = drop_location() diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index 2a84152088..a8c0e7d207 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -220,11 +220,10 @@ return Stun(100) to_chat(src, "ER@%R: MME^RY CO#RU9T! R&$b@0tin)...") - if(severity == 1) + if(severity >= 65) adjustBruteLoss(heavy_emp_damage) to_chat(src, "HeAV% DA%^MMA+G TO I/O CIR!%UUT!") - /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] diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm index 568ad893a2..cac2b1f2b1 100644 --- a/code/modules/power/antimatter/control.dm +++ b/code/modules/power/antimatter/control.dm @@ -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 diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 2480288484..e9390d30e9 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -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() diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 6425feac31..4dac668adc 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -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" diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index e2f8c4e58a..b5ed659e47 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -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) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index a4fc7d0641..f0f99ab7da 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -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() diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index 89c5aa3316..fc51915b73 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -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 diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 0a587e8eba..0f5934e8fd 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -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() diff --git a/code/modules/projectiles/guns/energy/energy_gun.dm b/code/modules/projectiles/guns/energy/energy_gun.dm index 2c9794f391..45bc3a79dc 100644 --- a/code/modules/projectiles/guns/energy/energy_gun.dm +++ b/code/modules/projectiles/guns/energy/energy_gun.dm @@ -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() . = ..()