diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index bca259b0dc1..f3ae254e6b8 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -403,6 +403,14 @@ #define SHOCK_NOSTUN (1 << 3) /// No default message is sent from the shock #define SHOCK_SUPPRESS_MESSAGE (1 << 4) +/// No skeleton animation if a human was shocked +#define SHOCK_NO_HUMAN_ANIM (1 << 5) +/// Ignores TRAIT_STUNIMMUNE +#define SHOCK_IGNORE_IMMUNITY (1 << 6) +/// Prevents the immediate stun, instead only gives the delay +#define SHOCK_DELAY_STUN (1 << 7) +/// Makes the paralyze into a knockdown +#define SHOCK_KNOCKDOWN (1 << 8) #define INCORPOREAL_MOVE_BASIC 1 /// normal movement, see: [/mob/living/var/incorporeal_move] #define INCORPOREAL_MOVE_SHADOW 2 /// leaves a trail of shadows diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 8a704a277b7..8b97685d0a8 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 1475d61ed38..bc951d49bb7 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -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()