Skip to content

Commit

Permalink
Various mob attack procs treat their attacks as unarmed attacks inste…
Browse files Browse the repository at this point in the history
…ad of melee attacks when checking blocking. (tgstation#88481)
  • Loading branch information
necromanceranne authored Dec 14, 2024
1 parent 2c4fd5e commit 6db5734
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 2 additions & 5 deletions code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
var/damage = HAS_TRAIT(user, TRAIT_PERFECT_ATTACKER) ? monkey_mouth.unarmed_damage_high : rand(monkey_mouth.unarmed_damage_low, monkey_mouth.unarmed_damage_high)
if(!damage)
return FALSE
if(check_block(user, damage, "the [user.name]"))
if(check_block(user, damage, "the [user.name]", attack_type = UNARMED_ATTACK))
return FALSE
apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, MELEE))
return TRUE
Expand Down Expand Up @@ -248,17 +248,14 @@
return TRUE
apply_damage(damage, BRUTE, affecting, armor_block)




/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L, list/modifiers)
. = ..()
if(!.)
return //successful larva bite.
var/damage = rand(L.melee_damage_lower, L.melee_damage_upper)
if(!damage)
return
if(check_block(L, damage, "the [L.name]"))
if(check_block(L, damage, "the [L.name]", attack_type = UNARMED_ATTACK))
return FALSE
if(stat != DEAD)
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
return FALSE
if(SEND_SIGNAL(src, COMSIG_LIVING_GRAB, target) & (COMPONENT_CANCEL_ATTACK_CHAIN|COMPONENT_SKIP_ATTACK))
return FALSE
if(target.check_block(src, 0, "[src]'s grab"))
if(target.check_block(src, 0, "[src]'s grab", UNARMED_ATTACK))
return FALSE
target.grabbedby(src)
return TRUE
Expand Down Expand Up @@ -397,7 +397,7 @@
return FALSE

var/damage = rand(user.melee_damage_lower, user.melee_damage_upper)
if(check_block(user, damage, "[user]'s [user.attack_verb_simple]", MELEE_ATTACK/*or UNARMED_ATTACK?*/, user.armour_penetration, user.melee_damage_type))
if(check_block(user, damage, "[user]'s [user.attack_verb_simple]", UNARMED_ATTACK, user.armour_penetration, user.melee_damage_type))
return FALSE

if(user.attack_sound)
Expand Down Expand Up @@ -512,7 +512,7 @@
/mob/living/attack_alien(mob/living/carbon/alien/adult/user, list/modifiers)
SEND_SIGNAL(src, COMSIG_MOB_ATTACK_ALIEN, user, modifiers)
if(LAZYACCESS(modifiers, RIGHT_CLICK))
if(check_block(user, 0, "[user]'s tackle", MELEE_ATTACK, 0, BRUTE))
if(check_block(user, 0, "[user]'s tackle", UNARMED_ATTACK, 0, BRUTE))
return FALSE
user.do_attack_animation(src, ATTACK_EFFECT_DISARM)
return TRUE
Expand All @@ -521,7 +521,7 @@
if(HAS_TRAIT(user, TRAIT_PACIFISM))
to_chat(user, span_warning("You don't want to hurt anyone!"))
return FALSE
if(check_block(user, user.melee_damage_upper, "[user]'s slash", MELEE_ATTACK, 0, BRUTE))
if(check_block(user, user.melee_damage_upper, "[user]'s slash", UNARMED_ATTACK, 0, BRUTE))
return FALSE
user.do_attack_animation(src)
return TRUE
Expand Down

0 comments on commit 6db5734

Please sign in to comment.