From ee1eea8874cf90b337cd4861b896d9e052a0a797 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Mon, 9 Mar 2020 04:01:23 +0100 Subject: [PATCH 1/3] Ports "Switches out the three billion args of electrocute act for flags" --- code/__DEFINES/components.dm | 2 +- code/__DEFINES/mobs.dm | 11 +++++++++++ code/game/objects/effects/anomalies.dm | 18 ++++-------------- code/game/objects/items/robot/robot_items.dm | 2 +- code/game/objects/obj_defense.dm | 2 +- code/game/objects/structures/holosign.dm | 4 ++-- code/game/objects/structures/traps.dm | 4 ++-- .../antagonists/clockcult/clock_mobs.dm | 2 +- .../antagonists/revenant/revenant_abilities.dm | 2 +- code/modules/antagonists/swarmer/swarmer.dm | 6 +++--- code/modules/clothing/spacesuits/chronosuit.dm | 2 +- code/modules/hydroponics/plant_genes.dm | 4 ++-- .../mob/living/carbon/carbon_defense.dm | 17 +++++++---------- .../mob/living/carbon/human/human_defense.dm | 10 +++++----- code/modules/mob/living/living_defense.dm | 8 ++++---- .../mob/living/silicon/silicon_defense.dm | 4 ++-- .../mob/living/simple_animal/constructs.dm | 2 +- .../simple_animal/friendly/drone/_drone.dm | 2 +- .../simple_animal/hostile/megafauna/swarmer.dm | 2 +- code/modules/power/supermatter/supermatter.dm | 2 +- code/modules/power/tesla/energy_ball.dm | 2 +- .../chemistry/reagents/pyrotechnic_reagents.dm | 2 +- .../nanites/nanite_programs/suppression.dm | 2 +- code/modules/spells/spell_types/lightning.dm | 4 ++-- code/modules/spells/spell_types/wizard.dm | 2 +- .../emergency_cardioversion_recovery.dm | 6 +++--- .../chemistry/reagents/fermi_reagents.dm | 4 ++-- 27 files changed, 63 insertions(+), 65 deletions(-) diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 56cf681a27..c334ed1e9b 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -206,7 +206,7 @@ #define COMSIG_LIVING_RESIST "living_resist" //from base of mob/living/resist() (/mob/living) #define COMSIG_LIVING_IGNITED "living_ignite" //from base of mob/living/IgniteMob() (/mob/living) #define COMSIG_LIVING_EXTINGUISHED "living_extinguished" //from base of mob/living/ExtinguishMob() (/mob/living) -#define COMSIG_LIVING_ELECTROCUTE_ACT "living_electrocute_act" //from base of mob/living/electrocute_act(): (shock_damage) +#define COMSIG_LIVING_ELECTROCUTE_ACT "living_electrocute_act" //from base of mob/living/electrocute_act(): (shock_damage, source, siemens_coeff, flags) #define COMSIG_LIVING_MINOR_SHOCK "living_minor_shock" //sent by stuff like stunbatons and tasers: () #define COMSIG_LIVING_REVIVE "living_revive" //from base of mob/living/revive() (full_heal, admin_revive) #define COMSIG_MOB_CLIENT_LOGIN "comsig_mob_client_login" //sent when a mob/login() finishes: (client) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index c1686560d6..69e7ac99fc 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -210,6 +210,17 @@ #define MAX_CHICKENS 50 +///Flags used by the flags parameter of electrocute act. + +///Makes it so that the shock doesn't take gloves into account. +#define SHOCK_NOGLOVES (1 << 0) +///Used when the shock is from a tesla bolt. +#define SHOCK_TESLA (1 << 1) +///Used when an illusion shocks something. Makes the shock deal stamina damage and not trigger certain secondary effects. +#define SHOCK_ILLUSION (1 << 2) +///The shock doesn't stun. +#define SHOCK_NOSTUN (1 << 3) + #define INCORPOREAL_MOVE_BASIC 1 #define INCORPOREAL_MOVE_SHADOW 2 // leaves a trail of shadows diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index 8c3ffa3cfc..e75a18dca8 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -138,13 +138,13 @@ name = "flux wave anomaly" icon_state = "electricity2" density = TRUE - var/canshock = 0 + var/canshock = FALSE var/shockdamage = 20 var/explosive = TRUE /obj/effect/anomaly/flux/anomalyEffect() ..() - canshock = 1 + canshock = TRUE for(var/mob/living/M in range(0, src)) mobShock(M) @@ -159,18 +159,8 @@ /obj/effect/anomaly/flux/proc/mobShock(mob/living/M) if(canshock && istype(M)) - canshock = 0 //Just so you don't instakill yourself if you slam into the anomaly five times in a second. - if(iscarbon(M)) - if(ishuman(M)) - M.electrocute_act(shockdamage, "[name]", safety=1) - return - M.electrocute_act(shockdamage, "[name]") - return - else - M.adjustFireLoss(shockdamage) - M.visible_message("[M] was shocked by \the [name]!", \ - "You feel a powerful shock coursing through your body!", \ - "You hear a heavy electrical crack.") + canshock = FALSE //Just so you don't instakill yourself if you slam into the anomaly five times in a second. + M.electrocute_act(shockdamage, "[name]", flags = SHOCK_NOGLOVES) /obj/effect/anomaly/flux/detonate() if(explosive) diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index d3e966f2fa..32e07284ec 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -109,7 +109,7 @@ if(scooldown < world.time) if(M.health >= 0) if(ishuman(M)||ismonkey(M)) - M.electrocute_act(5, "[user]", safety = 1) + M.electrocute_act(5, "[user]", flags = SHOCK_NOGLOVES) user.visible_message("[user] electrocutes [M] with [user.p_their()] touch!", \ "You electrocute [M] with your touch!") else diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index 2fd6cf9f4c..e582aa7e67 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -244,7 +244,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e if(has_buckled_mobs()) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - buckled_mob.electrocute_act((CLAMP(round(strength/400), 10, 90) + rand(-5, 5)), src, tesla_shock = 1) + buckled_mob.electrocute_act((CLAMP(round(strength/400), 10, 90) + rand(-5, 5)), src, flags = SHOCK_TESLA) /obj/proc/reset_shocked() obj_flags &= ~BEING_SHOCKED diff --git a/code/game/objects/structures/holosign.dm b/code/game/objects/structures/holosign.dm index fc1e642468..7ac3aba246 100644 --- a/code/game/objects/structures/holosign.dm +++ b/code/game/objects/structures/holosign.dm @@ -189,7 +189,7 @@ if(!shockcd) if(ismob(user)) var/mob/living/M = user - M.electrocute_act(15,"Energy Barrier", safety=1) + M.electrocute_act(15,"Energy Barrier", flags = SHOCK_NOGLOVES) shockcd = TRUE addtimer(CALLBACK(src, .proc/cooldown), 5) @@ -201,6 +201,6 @@ return var/mob/living/M = AM - M.electrocute_act(15,"Energy Barrier", safety=1) + M.electrocute_act(15,"Energy Barrier", flags = SHOCK_NOGLOVES) shockcd = TRUE addtimer(CALLBACK(src, .proc/cooldown), 5) diff --git a/code/game/objects/structures/traps.dm b/code/game/objects/structures/traps.dm index fa9c052aa3..8044bb9bb7 100644 --- a/code/game/objects/structures/traps.dm +++ b/code/game/objects/structures/traps.dm @@ -82,7 +82,7 @@ icon_state = "trap-shock" /obj/structure/trap/stun/trap_effect(mob/living/L) - L.electrocute_act(30, src, safety=1) // electrocute act does a message. + L.electrocute_act(30, src, flags = SHOCK_NOGLOVES) // electrocute act does a message. L.DefaultCombatKnockdown(100) /obj/structure/trap/fire @@ -146,7 +146,7 @@ /obj/structure/trap/cult/trap_effect(mob/living/L) to_chat(L, "With a crack, the hostile constructs come out of hiding, stunning you!") - L.electrocute_act(10, src, safety = TRUE) // electrocute act does a message. + L.electrocute_act(10, src, flags = SHOCK_NOGLOVES) // electrocute act does a message. L.DefaultCombatKnockdown(20) new /mob/living/simple_animal/hostile/construct/proteon/hostile(loc) new /mob/living/simple_animal/hostile/construct/proteon/hostile(loc) diff --git a/code/modules/antagonists/clockcult/clock_mobs.dm b/code/modules/antagonists/clockcult/clock_mobs.dm index 9bdf03cbc7..2f00fd4e4a 100644 --- a/code/modules/antagonists/clockcult/clock_mobs.dm +++ b/code/modules/antagonists/clockcult/clock_mobs.dm @@ -37,7 +37,7 @@ /mob/living/simple_animal/hostile/clockwork/ratvar_act() fully_heal(TRUE) -/mob/living/simple_animal/hostile/clockwork/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) +/mob/living/simple_animal/hostile/clockwork/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) return 0 //ouch, my metal-unlikely-to-be-damaged-by-electricity-body /mob/living/simple_animal/hostile/clockwork/examine(mob/user) diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index d2e71615e3..a99e3900b0 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -213,7 +213,7 @@ continue L.Beam(M,icon_state="purple_lightning",time=5) if(!M.anti_magic_check(FALSE, TRUE)) - M.electrocute_act(shock_damage, L, safety=TRUE) + M.electrocute_act(shock_damage, L, flags = SHOCK_NOGLOVES) do_sparks(4, FALSE, M) playsound(M, 'sound/machines/defib_zap.ogg', 50, 1, -1) diff --git a/code/modules/antagonists/swarmer/swarmer.dm b/code/modules/antagonists/swarmer/swarmer.dm index 92852c6c7f..292fb10202 100644 --- a/code/modules/antagonists/swarmer/swarmer.dm +++ b/code/modules/antagonists/swarmer/swarmer.dm @@ -492,8 +492,8 @@ playsound(src,'sound/effects/sparks4.ogg',50,1) do_teleport(target, F, 0, channel = TELEPORT_CHANNEL_BLUESPACE) -/mob/living/simple_animal/hostile/swarmer/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = FALSE, tesla_shock = FALSE, illusion = FALSE, stun = TRUE) - if(!tesla_shock) +/mob/living/simple_animal/hostile/swarmer/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) + if(!(flags & SHOCK_TESLA)) return FALSE return ..() @@ -584,7 +584,7 @@ var/mob/living/L = AM if(!istype(L, /mob/living/simple_animal/hostile/swarmer)) playsound(loc,'sound/effects/snap.ogg',50, 1, -1) - L.electrocute_act(0, src, 1, 1, 1) + L.electrocute_act(0, src, 1, flags = SHOCK_NOGLOVES|SHOCK_ILLUSION) if(iscyborg(L)) L.DefaultCombatKnockdown(100) qdel(src) diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm index 3d06fba285..81fedcf57c 100644 --- a/code/modules/clothing/spacesuits/chronosuit.dm +++ b/code/modules/clothing/spacesuits/chronosuit.dm @@ -220,7 +220,7 @@ teleport_now.Remove(user) if(user.wear_suit == src) if(hard_landing) - user.electrocute_act(35, src, safety = 1) + user.electrocute_act(35, src, flags = SHOCK_NOGLOVES) user.DefaultCombatKnockdown(200) if(!silent) to_chat(user, "\nroot@ChronosuitMK4# chronowalk4 --stop\n") diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 272f44267e..b3ec36e0bb 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -250,14 +250,14 @@ /datum/plant_gene/trait/cell_charge/on_slip(obj/item/reagent_containers/food/snacks/grown/G, mob/living/carbon/C) var/power = G.seed.potency*rate if(prob(power)) - C.electrocute_act(round(power), G, 1, 1) + C.electrocute_act(round(power), G, 1, SHOCK_NOGLOVES) /datum/plant_gene/trait/cell_charge/on_squash(obj/item/reagent_containers/food/snacks/grown/G, atom/target) if(iscarbon(target)) var/mob/living/carbon/C = target var/power = G.seed.potency*rate if(prob(power)) - C.electrocute_act(round(power), G, 1, 1) + C.electrocute_act(round(power), G, 1, SHOCK_NOGLOVES) /datum/plant_gene/trait/cell_charge/on_consume(obj/item/reagent_containers/food/snacks/grown/G, mob/living/carbon/target) if(!G.reagents.total_volume) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 5bbc6d6a64..1ea2fa1130 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -238,19 +238,19 @@ var/obj/item/organ/O = X O.emp_act(severity) -/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0, illusion = 0, stun = TRUE) - if(tesla_shock && (flags_1 & TESLA_IGNORE_1)) +/mob/living/carbon/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) + if((flags & SHOCK_TESLA) && (flags_1 & TESLA_IGNORE_1)) return FALSE if(HAS_TRAIT(src, TRAIT_SHOCKIMMUNE)) return FALSE shock_damage *= siemens_coeff if(dna && dna.species) shock_damage *= dna.species.siemens_coeff - if(shock_damage<1 && !override) + if(shock_damage < 1) return 0 if(reagents.has_reagent(/datum/reagent/teslium)) shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging! - if(illusion) + if((flags & SHOCK_ILLUSION)) adjustStaminaLoss(shock_damage) else take_overall_damage(0,shock_damage) @@ -262,16 +262,13 @@ jitteriness += 1000 //High numbers for violent convulsions do_jitter_animation(jitteriness) stuttering += 2 - if((!tesla_shock || (tesla_shock && siemens_coeff > 0.5)) && stun) + if((!(flags & SHOCK_TESLA) || siemens_coeff > 0.5) && (flags & SHOCK_NOSTUN)) Stun(40) spawn(20) jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less - if((!tesla_shock || (tesla_shock && siemens_coeff > 0.5)) && stun) + if((!(flags & SHOCK_TESLA) || siemens_coeff > 0.5) && (flags & SHOCK_NOSTUN)) DefaultCombatKnockdown(60) - if(override) - return override - else - return shock_damage + return shock_damage /mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) if(on_fire) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 5bedce359b..4ef5a3ca04 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -397,8 +397,8 @@ //Added a safety check in case you want to shock a human mob directly through electrocute_act. -/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0, illusion = 0, stun = TRUE) - if(tesla_shock) +/mob/living/carbon/human/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) + if(flags & SHOCK_TESLA) var/total_coeff = 1 if(gloves) var/obj/item/clothing/gloves/G = gloves @@ -413,20 +413,20 @@ siemens_coeff = total_coeff if(flags_1 & TESLA_IGNORE_1) siemens_coeff = 0 - else if(!safety) + else if(!(flags & SHOCK_NOGLOVES)) var/gloves_siemens_coeff = 1 if(gloves) var/obj/item/clothing/gloves/G = gloves gloves_siemens_coeff = G.siemens_coefficient siemens_coeff = gloves_siemens_coeff - if(undergoing_cardiac_arrest() && !illusion) + if(undergoing_cardiac_arrest() && !(flags & SHOCK_ILLUSION)) if(shock_damage * siemens_coeff >= 1 && prob(25)) var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) heart.beating = TRUE if(stat == CONSCIOUS) to_chat(src, "You feel your heart beating again!") siemens_coeff *= physiology.siemens_coeff - . = ..(shock_damage,source,siemens_coeff,safety,override,tesla_shock, illusion, stun) + . = ..() if(.) electrocution_animation(40) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index af8dc6dca9..27ecaf30d5 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -427,14 +427,14 @@ take_bodypart_damage(acidpwr * min(1, acid_volume * 0.1)) return 1 -/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) - SEND_SIGNAL(src, COMSIG_LIVING_ELECTROCUTE_ACT, shock_damage) - if(tesla_shock && (flags_1 & TESLA_IGNORE_1)) +/mob/living/proc/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) + SEND_SIGNAL(src, COMSIG_LIVING_ELECTROCUTE_ACT, shock_damage, source, siemens_coeff, flags) + if((flags & SHOCK_TESLA) && (flags_1 & TESLA_IGNORE_1)) return FALSE if(HAS_TRAIT(src, TRAIT_SHOCKIMMUNE)) return FALSE if(shock_damage > 0) - if(!illusion) + if(!(flags & SHOCK_ILLUSION)) adjustFireLoss(shock_damage) visible_message( "[src] was shocked by \the [source]!", \ diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm index 5d1d2610b9..a93bc8662e 100644 --- a/code/modules/mob/living/silicon/silicon_defense.dm +++ b/code/modules/mob/living/silicon/silicon_defense.dm @@ -85,11 +85,11 @@ return return ..() -/mob/living/silicon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) +/mob/living/silicon/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) if(buckled_mobs) for(var/mob/living/M in buckled_mobs) unbuckle_mob(M) - M.electrocute_act(shock_damage/100, source, siemens_coeff, safety, tesla_shock, illusion, stun) //Hard metal shell conducts! + M.electrocute_act(shock_damage/100, source, siemens_coeff, flags) //Hard metal shell conducts! return 0 //So borgs they don't die trying to fix wiring /mob/living/silicon/emp_act(severity) diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index 64b783b692..51c392003c 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -103,7 +103,7 @@ /mob/living/simple_animal/hostile/construct/narsie_act() return -/mob/living/simple_animal/hostile/construct/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) +/mob/living/simple_animal/bot/secbot/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) return 0 /mob/living/simple_animal/hostile/construct/adjustHealth(amount, updating_health = TRUE, forced = FALSE) 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 726eda6c45..24dfa96119 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -277,7 +277,7 @@ // Why would bees pay attention to drones? return 1 -/mob/living/simple_animal/drone/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) +/mob/living/simple_animal/bot/secbot/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) return 0 //So they don't die trying to fix wiring /mob/living/simple_animal/drone/can_see_reagents() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm index 1ddd9079b2..50c6025378 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm @@ -275,7 +275,7 @@ GLOBAL_LIST_INIT(AISwarmerCapsByType, list(/mob/living/simple_animal/hostile/swa else var/mob/living/L = target L.attack_animal(src) - L.electrocute_act(10, src, safety = TRUE) //safety = TRUE means we don't check gloves... Ok? + L.electrocute_act(10, src, flags = SHOCK_NOGLOVES) return TRUE else return ..() diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 67cc371c3b..2548620a7f 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -807,7 +807,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) . = zapdir if(target_mob) - target_mob.electrocute_act(rand(5,10), "Supermatter Discharge Bolt", 1, stun = 0) + target_mob.electrocute_act(rand(5,10), "Supermatter Discharge Bolt", 1, SHOCK_NOSTUN) if(prob(15)) supermatter_zap(target_mob, 5, power / 2) supermatter_zap(target_mob, 5, power / 2) diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index 13f53f14d0..1b08693d1c 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -297,7 +297,7 @@ else if(closest_mob) var/shock_damage = (tesla_flags & TESLA_MOB_DAMAGE)? (min(round(power/600), 90) + rand(-5, 5)) : 0 - closest_mob.electrocute_act(shock_damage, source, 1, tesla_shock = 1, stun = (tesla_flags & TESLA_MOB_STUN)) + closest_mob.electrocute_act(shock_damage, source, 1, SHOCK_TESLA | ((tesla_flags & TESLA_MOB_STUN) ? NONE : SHOCK_NOSTUN)) if(issilicon(closest_mob)) var/mob/living/silicon/S = closest_mob if((tesla_flags & TESLA_MOB_STUN) && (tesla_flags & TESLA_MOB_DAMAGE)) diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm index cd63fff0db..939d5c9707 100644 --- a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm @@ -213,7 +213,7 @@ shock_timer++ if(shock_timer >= rand(5,30)) //Random shocks are wildly unpredictable shock_timer = 0 - M.electrocute_act(rand(5,20), "Teslium in their body", 1, 1) //Override because it's caused from INSIDE of you + M.electrocute_act(rand(5,20), "Teslium in their body", 1, SHOCK_NOGLOVES) //Override because it's caused from INSIDE of you playsound(M, "sparks", 50, 1) ..() diff --git a/code/modules/research/nanites/nanite_programs/suppression.dm b/code/modules/research/nanites/nanite_programs/suppression.dm index 1c882cead3..dcc9521798 100644 --- a/code/modules/research/nanites/nanite_programs/suppression.dm +++ b/code/modules/research/nanites/nanite_programs/suppression.dm @@ -40,7 +40,7 @@ rogue_types = list(/datum/nanite_program/toxic) /datum/nanite_program/shocking/on_trigger(comm_message) - host_mob.electrocute_act(rand(5,10), "shock nanites", TRUE, TRUE) + host_mob.electrocute_act(rand(5,10), "shock nanites", 1, SHOCK_NOGLOVES) /datum/nanite_program/stun name = "Neural Shock" diff --git a/code/modules/spells/spell_types/lightning.dm b/code/modules/spells/spell_types/lightning.dm index 56d7dc771f..f4812e7462 100644 --- a/code/modules/spells/spell_types/lightning.dm +++ b/code/modules/spells/spell_types/lightning.dm @@ -69,10 +69,10 @@ playsound(get_turf(current), 'sound/magic/lightningshock.ogg', 50, 1, -1) current.visible_message("[current] absorbs the spell, remaining unharmed!", "You absorb the spell, remaining unharmed!") if(bounces < 1) - current.electrocute_act(bolt_energy,"Lightning Bolt",safety=1) + current.electrocute_act(bolt_energy,"Lightning Bolt", flags = SHOCK_NOGLOVES) playsound(get_turf(current), 'sound/magic/lightningshock.ogg', 50, 1, -1) else - current.electrocute_act(bolt_energy,"Lightning Bolt",safety=1) + current.electrocute_act(bolt_energy,"Lightning Bolt", flags = SHOCK_NOGLOVES) playsound(get_turf(current), 'sound/magic/lightningshock.ogg', 50, 1, -1) var/list/possible_targets = new for(var/mob/living/M in view_or_range(range,target,"view")) diff --git a/code/modules/spells/spell_types/wizard.dm b/code/modules/spells/spell_types/wizard.dm index 124159e910..405bde212a 100644 --- a/code/modules/spells/spell_types/wizard.dm +++ b/code/modules/spells/spell_types/wizard.dm @@ -379,7 +379,7 @@ if(isliving(hit_atom)) var/mob/living/M = hit_atom if(!M.anti_magic_check()) - M.electrocute_act(80, src, illusion = 1) + M.electrocute_act(80, src, SHOCK_ILLUSION) qdel(src) /obj/item/spellpacket/lightningbolt/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback) diff --git a/code/modules/surgery/emergency_cardioversion_recovery.dm b/code/modules/surgery/emergency_cardioversion_recovery.dm index 25f499fa76..5646c43f00 100644 --- a/code/modules/surgery/emergency_cardioversion_recovery.dm +++ b/code/modules/surgery/emergency_cardioversion_recovery.dm @@ -35,7 +35,7 @@ "[user] screws up, causing [H] to flop around violently as they're zapped!", "[user] screws up, causing [H] to flop around violently as they're zapped!") H.emote("scream") - H.electrocute_act(25, (tool), 1, FALSE, FALSE, FALSE, TRUE) + H.electrocute_act(25, (tool), 1, SHOCK_ILLUSION) H.adjustFireLoss(10) H.emote("flip") H.Jitter(100) @@ -50,7 +50,7 @@ var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) if(BR.organ_flags & ORGAN_FAILING) H.adjustOrganLoss(ORGAN_SLOT_BRAIN, -5) - H.electrocute_act(0, (tool), 1, FALSE, FALSE, FALSE, TRUE) + H.electrocute_act(0, (tool), 1, SHOCK_ILLUSION) //If we're using a defib, let the defib handle the revive. if(istype(tool, /obj/item/twohanded/shockpaddles)) return @@ -70,7 +70,7 @@ display_results(user, target, "You screw up, sending a current through their body!", "[user] screws up, causing [H] to flop around violently as they're zapped!", "[user] screws up, causing [H] to flop around violently as they're zapped!") - H.electrocute_act(25, (tool), 1, FALSE, FALSE, FALSE, TRUE) + H.electrocute_act(25, (tool), 1, SHOCK_ILLUSION) H.adjustFireLoss(10) H.emote("flip") H.adjustOrganLoss(ORGAN_SLOT_HEART, 10) diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm index a7dbe8d799..dac6d97eef 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -191,7 +191,7 @@ var/datum/component/nanites/N = C.GetComponent(/datum/component/nanites) if(prob(5)) to_chat(C, "The residual voltage from the nanites causes you to seize up!") - C.electrocute_act(10, (get_turf(C)), 1, FALSE, FALSE, FALSE, TRUE) + C.electrocute_act(10, (get_turf(C)), 1, SHOCK_ILLUSION) if(prob(10)) var/atom/T = C T.emp_act(EMP_HEAVY) @@ -218,7 +218,7 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume) /datum/reagent/fermi/nanite_b_goneTox/on_mob_life(mob/living/carbon/C)//Damages the taker if their purity is low. Extended use of impure chemicals will make the original die. (thus can't be spammed unless you've very good) if(prob(15)) to_chat(C, "The residual voltage in your system causes you to seize up!") - C.electrocute_act(10, (get_turf(C)), 1, FALSE, FALSE, FALSE, TRUE) + C.electrocute_act(10, (get_turf(C)), 1, SHOCK_ILLUSION) if(prob(50)) var/atom/T = C T.emp_act(EMP_HEAVY) From 0400fbf8a214e81b3e7d7d9ab35333cf13a1fe0e Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Mon, 9 Mar 2020 22:21:32 +0100 Subject: [PATCH 2/3] Update constructs.dm --- code/modules/mob/living/simple_animal/constructs.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index 51c392003c..708c9ea2cd 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -103,7 +103,7 @@ /mob/living/simple_animal/hostile/construct/narsie_act() return -/mob/living/simple_animal/bot/secbot/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) +/mob/living/simple_animal/hostile/construct/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) return 0 /mob/living/simple_animal/hostile/construct/adjustHealth(amount, updating_health = TRUE, forced = FALSE) From 80eaf3be0d4c1f5ef23f6497726563bd224b5d1c Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Mon, 9 Mar 2020 22:22:38 +0100 Subject: [PATCH 3/3] Update _drone.dm --- code/modules/mob/living/simple_animal/friendly/drone/_drone.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 24dfa96119..0d344f1a9b 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -277,7 +277,7 @@ // Why would bees pay attention to drones? return 1 -/mob/living/simple_animal/bot/secbot/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) +/mob/living/simple_animal/drone/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) return 0 //So they don't die trying to fix wiring /mob/living/simple_animal/drone/can_see_reagents()