diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 786b663758f..6a34c7fd005 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -52,6 +52,7 @@ . = ..() var/hurt = TRUE var/extra_speed = 0 + var/oof_noise = FALSE //We smacked something with denisty, so play a noise if(throwingdatum.thrower != src) extra_speed = min(max(0, throwingdatum.speed - initial(throw_speed)), CARBON_MAX_IMPACT_SPEED_BONUS) @@ -66,19 +67,37 @@ take_bodypart_damage(5 + 5 * extra_speed, check_armor = TRUE, wound_bonus = extra_speed * 5) else if(!iscarbon(hit_atom) && extra_speed) take_bodypart_damage(5 * extra_speed, check_armor = TRUE, wound_bonus = extra_speed * 5) + oof_noise = TRUE + if(iscarbon(hit_atom) && hit_atom != src) var/mob/living/carbon/victim = hit_atom + var/blocked = FALSE if(victim.movement_type & FLYING) return - if(hurt) - victim.take_bodypart_damage(10 + 5 * extra_speed, check_armor = TRUE, wound_bonus = extra_speed * 5) - take_bodypart_damage(10 + 5 * extra_speed, check_armor = TRUE, wound_bonus = extra_speed * 5) + if(!hurt) + return + + if(victim.check_block(src, 0, "[name]", LEAP_ATTACK)) + blocked = TRUE + + take_bodypart_damage(10 + 5 * extra_speed, check_armor = TRUE, wound_bonus = extra_speed * 5) + Paralyze(2 SECONDS) + oof_noise = TRUE + + if(blocked) + visible_message(span_danger("[src] crashes into [victim][extra_speed ? " really hard" : ""], but [victim] blocked the worst of it!"),\ + span_userdanger("You violently crash into [victim][extra_speed ? " extra hard" : ""], but [victim] managed to block the worst of it!")) + log_combat(src, victim, "crashed into and was blocked by") + return + else victim.Paralyze(2 SECONDS) - Paralyze(2 SECONDS) + victim.take_bodypart_damage(10 + 5 * extra_speed, check_armor = TRUE, wound_bonus = extra_speed * 5) visible_message(span_danger("[src] crashes into [victim][extra_speed ? " really hard" : ""], knocking them both over!"),\ span_userdanger("You violently crash into [victim][extra_speed ? " extra hard" : ""]!")) + log_combat(src, victim, "crashed into") + + if(oof_noise) playsound(src,'sound/weapons/punch1.ogg',50,TRUE) - log_combat(src, victim, "crashed into") //Throwing stuff /mob/living/carbon/proc/toggle_throw_mode()