diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 363b62f8b9a..4402b9ea2eb 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -1,3 +1,5 @@ +#define SHAKE_ANIMATION_OFFSET 4 + /mob/living/carbon/get_eye_protection() . = ..() var/obj/item/organ/eyes/E = getorganslot(ORGAN_SLOT_EYES) @@ -469,6 +471,13 @@ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1) + // Shake animation + if (incapacitated()) + var/direction = prob(50) ? -1 : 1 + animate(src, pixel_x = pixel_x + SHAKE_ANIMATION_OFFSET * direction, time = 1, easing = QUAD_EASING | EASE_OUT) + animate(pixel_x = pixel_x - (SHAKE_ANIMATION_OFFSET * 2 * direction), time = 1) + animate(pixel_x = pixel_x + SHAKE_ANIMATION_OFFSET * direction, time = 1, easing = QUAD_EASING | EASE_IN) + /// Check ourselves to see if we've got any shrapnel, return true if we do. This is a much simpler version of what humans do, we only indicate we're checking ourselves if there's actually shrapnel /mob/living/carbon/proc/check_self_for_injuries() if(stat == DEAD || stat == UNCONSCIOUS) @@ -625,3 +634,5 @@ var/obj/item/bodypart/limb = _limb if (limb.status != BODYPART_ORGANIC) . += (limb.brute_dam * limb.body_damage_coeff) + (limb.burn_dam * limb.body_damage_coeff) + +#undef SHAKE_ANIMATION_OFFSET