Skip to content

Commit

Permalink
[MIRROR] Fixes body collision causing a stun, despite a successful bl…
Browse files Browse the repository at this point in the history
…ock. [MDB IGNORE] (#739)

* Fixes body collision causing a stun, despite a successful block. (#79824)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: necromanceranne <[email protected]>
  • Loading branch information
3 people authored Nov 21, 2023
1 parent 88d6c16 commit 00d1559
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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()
Expand Down

0 comments on commit 00d1559

Please sign in to comment.