Fixes armour penetration not working against mechs in melee. (#21265)

A deprecated variable in the apply_damage chain fucked up the variable
order.

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2025-08-31 15:25:05 +00:00
committed by GitHub
co-authored by Matt Atlas
parent 9595c784ee
commit a3a9a2ad4a
48 changed files with 115 additions and 63 deletions
@@ -542,7 +542,7 @@
/mob/living/carbon/human/proc/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, inrange, params)
return
/mob/living/carbon/human/attack_generic(var/mob/user, var/damage, var/attack_message, var/armor_penetration, var/attack_flags, var/damage_type)
/mob/living/carbon/human/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type)
if(!damage)
return
@@ -436,7 +436,7 @@ This function restores all organs.
if(zone_to_get in organs_by_name)
return organs_by_name[zone_to_get]
/mob/living/carbon/human/apply_damage(damage = 0, damagetype = DAMAGE_BRUTE, def_zone, blocked, used_weapon, damage_flags = 0, armor_pen, silent = FALSE)
/mob/living/carbon/human/apply_damage(damage = 0, damagetype = DAMAGE_BRUTE, def_zone, used_weapon, damage_flags = 0, armor_pen, silent = FALSE)
if (invisibility == INVISIBILITY_LEVEL_TWO && back && (istype(back, /obj/item/rig)))
if(damage > 0)
to_chat(src, SPAN_DANGER("You are now visible."))
+1 -1
View File
@@ -8,7 +8,7 @@
standard 0 if fail
*/
/mob/living/proc/apply_damage(damage = 0, damagetype = DAMAGE_BRUTE, def_zone, blocked, used_weapon, damage_flags = 0, armor_pen, silent = FALSE)
/mob/living/proc/apply_damage(damage = 0, damagetype = DAMAGE_BRUTE, def_zone, used_weapon, damage_flags = 0, armor_pen, silent = FALSE)
SHOULD_NOT_SLEEP(TRUE)
if(!damage)
+1 -1
View File
@@ -349,7 +349,7 @@
// End BS12 momentum-transfer code.
/mob/living/attack_generic(var/mob/user, var/damage, var/attack_message, var/armor_penetration, var/attack_flags, var/damage_type = DAMAGE_BRUTE)
/mob/living/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type)
if(!damage)
return
@@ -823,7 +823,7 @@
user.put_in_active_hand(broken_device)
//Robots take half damage from basic attacks.
/mob/living/silicon/robot/attack_generic(var/mob/user, var/damage, var/attack_message)
/mob/living/silicon/robot/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type)
return ..(user,FLOOR(damage/2, 1),attack_message)
/mob/living/silicon/robot/proc/allowed(mob/M)
@@ -88,7 +88,7 @@
/mob/living/simple_animal/construct/get_bullet_impact_effect_type(var/def_zone)
return BULLET_IMPACT_METAL
/mob/living/simple_animal/construct/attack_generic(var/mob/user)
/mob/living/simple_animal/construct/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(istype(user, /mob/living/simple_animal/construct))
var/mob/living/simple_animal/construct/C = user
@@ -299,7 +299,7 @@ ABSTRACT_TYPE(/mob/living/simple_animal/hostile/commanded)
if(M in friends)
friends -= M
/mob/living/simple_animal/hostile/commanded/attack_generic(var/mob/user, var/damage, var/attack_message)
/mob/living/simple_animal/hostile/commanded/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type)
..()
// We forgive our master
@@ -152,7 +152,7 @@ ABSTRACT_TYPE(/mob/living/simple_animal/hostile)
set_last_found_target(tmp_target_mob)
change_stance(HOSTILE_STANCE_ATTACK)
/mob/living/simple_animal/hostile/attack_generic(var/mob/user, var/damage, var/attack_message)
/mob/living/simple_animal/hostile/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type)
..()
if(last_found_target != user)
set_last_found_target(user)
@@ -217,7 +217,7 @@
if(morphed)
restore()
/mob/living/simple_animal/hostile/morph/attack_generic(mob/user, damage, attack_message)
/mob/living/simple_animal/hostile/morph/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type)
..()
if(morphed)
restore()
@@ -732,8 +732,7 @@
return
speech_buffer.Add(message)
/mob/living/simple_animal/parrot/attack_generic(var/mob/user, var/damage, var/attack_message)
/mob/living/simple_animal/parrot/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type)
var/success = ..()
if(client)
@@ -104,7 +104,7 @@
var/datum/weakref/original_body
var/datum/weakref/possessed_body
/mob/living/simple_animal/shade/bluespace/apply_damage(damage = 0, damagetype = DAMAGE_BRUTE, def_zone, blocked, used_weapon, damage_flags = 0, armor_pen, silent = FALSE)
/mob/living/simple_animal/shade/bluespace/apply_damage(damage = 0, damagetype = DAMAGE_BRUTE, def_zone, used_weapon, damage_flags = 0, armor_pen, silent = FALSE)
return 0
/mob/living/simple_animal/shade/bluespace/adjustBruteLoss()
@@ -705,7 +705,7 @@
if(ismob(hitting_projectile.firer))
handle_attack_by(hitting_projectile.firer)
/mob/living/simple_animal/apply_damage(damage = 0, damagetype = DAMAGE_BRUTE, def_zone, blocked, used_weapon, damage_flags = 0, armor_pen, silent = FALSE)
/mob/living/simple_animal/apply_damage(damage = 0, damagetype = DAMAGE_BRUTE, def_zone, used_weapon, damage_flags = 0, armor_pen, silent = FALSE)
. = ..()
handle_bleeding_timer(damage)
handle_blood()