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] (#25146)

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

## About The Pull Request

Puts a block check into the ``throw_impact()`` of carbon mobs.

## Why It's Good For The Game

I'm touching on a lot of 'get around shields' stuns, and this has been a
big one for the better part of a few years and potentially not even
intentional. I would say it gained its largest popularity when it became
weaponized with fireman carrying.

Despite seemingly rolling to block, blocking a body hitting you doesn't
actually do anything at all. This reminds me a bit of energy bolas. So I
fixed it? I think, there might be a better fix, I'm just replicating
code present in xenomorph tackles. This shit sucks, please recommend a
better fix if you know it.

## Changelog
:cl:
fix: When you successfully block a body collision, it does something
rather than nothing at all.
/:cl:

* Fixes body collision causing a stun, despite a successful block.

---------

Co-authored-by: necromanceranne <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Nov 20, 2023
1 parent 8b905c9 commit a110b24
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 a110b24

Please sign in to comment.