[MIRROR] Adds some extra flags and args to electrocute_act [MDB IGNORE] (#23873)

* Adds some extra flags and args to electrocute_act

* Update carbon_defense.dm

* Update carbon_defense.dm

---------

Co-authored-by: nikothedude <59709059+nikothedude@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-09-24 06:58:57 -04:00
committed by GitHub
co-authored by nikothedude Bloop
parent cfd4cbf6e1
commit d3d54a3519
3 changed files with 29 additions and 12 deletions
@@ -444,7 +444,7 @@
bodypart.emp_act(severity)
///Adds to the parent by also adding functionality to propagate shocks through pulling and doing some fluff effects.
/mob/living/carbon/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE)
/mob/living/carbon/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE, jitter_time = 20 SECONDS, stutter_time = 4 SECONDS, stun_duration = 4 SECONDS)
. = ..()
if(!.)
return
@@ -465,24 +465,32 @@
//Found our victims, now lets shock them all
for(var/victim in shocking_queue)
var/mob/living/carbon/C = victim
C.electrocute_act(shock_damage*0.75, src, 1, flags)
C.electrocute_act(shock_damage*0.75, src, 1, flags, jitter_time, stutter_time, stun_duration)
//Stun
var/should_stun = (!(flags & SHOCK_TESLA) || siemens_coeff > 0.5) && !(flags & SHOCK_NOSTUN)
if(should_stun)
StaminaKnockdown(10, TRUE)
//Paralyze(40) - SKYRAT EDIT REMOVAL
var/paralyze = !(flags & SHOCK_KNOCKDOWN)
var/immediately_stun = should_stun && !(flags & SHOCK_DELAY_STUN)
if (immediately_stun)
if (paralyze)
//Paralyze(40) - SKYRAT EDIT REMOVAL
StaminaKnockdown(10, TRUE) // SKYRAT EDIT ADDITION
else
Knockdown(stun_duration)
//Jitter and other fluff.
do_jitter_animation(300)
adjust_jitter(20 SECONDS)
adjust_stutter(4 SECONDS)
addtimer(CALLBACK(src, PROC_REF(secondary_shock), should_stun), 2 SECONDS)
adjust_jitter(jitter_time)
adjust_stutter(stutter_time)
if (should_stun)
addtimer(CALLBACK(src, PROC_REF(secondary_shock), paralyze, stun_duration * 1.5), 2 SECONDS)
return shock_damage
///Called slightly after electrocute act to apply a secondary stun.
/mob/living/carbon/proc/secondary_shock(should_stun)
if(should_stun)
/mob/living/carbon/proc/secondary_shock(paralyze, stun_duration)
if (paralyze)
//Paralyze(60) - SKYRAT EDIT REMOVAL
StaminaKnockdown(10, TRUE) //SKYRAT EDIT ADDITION
else
Knockdown(stun_duration)
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/helper)
var/nosound = FALSE //SKYRAT EDIT ADDITION - EMOTES
@@ -484,7 +484,7 @@
///Calculates the siemens coeff based on clothing and species, can also restart hearts.
/mob/living/carbon/human/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE)
/mob/living/carbon/human/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE, jitter_time = 20 SECONDS, stutter_time = 4 SECONDS, stun_duration = 4 SECONDS)
//Calculates the siemens coeff based on clothing. Completely ignores the arguments
if(flags & SHOCK_TESLA) //I hate this entire block. This gets the siemens_coeff for tesla shocks
if(gloves && gloves.siemens_coefficient <= 0)
@@ -521,7 +521,8 @@
var/obj/item/organ/internal/heart/heart = get_organ_slot(ORGAN_SLOT_HEART)
if(heart.Restart() && stat == CONSCIOUS)
to_chat(src, span_notice("You feel your heart beating again!"))
electrocution_animation(40)
if (!(flags & SHOCK_NO_HUMAN_ANIM))
electrocution_animation(4 SECONDS)
/mob/living/carbon/human/acid_act(acidpwr, acid_volume, bodyzone_hit) //todo: update this to utilize check_obscured_slots() //and make sure it's check_obscured_slots(TRUE) to stop aciding through visors etc
var/list/damaged = list()