Guncode Agony 4.4: Armor as an argument (#88143)

## About The Pull Request
Lil cleanup/tweak I couldn't do in the main PR because it conflicted
before and i forgot after. Yes this works with overrides that don't have
the arg, yes I tested it.

## Why It's Good For The Game
Don't run armor code thrice please thank you

## Changelog
🆑
code: Projectile impacts no longer fetch mobs' armor values thrice
/🆑
This commit is contained in:
SmArtKar
2024-11-25 14:59:21 +03:00
committed by GitHub
parent 013660537d
commit a2d463cdd8
13 changed files with 33 additions and 20 deletions

View File

@@ -107,14 +107,13 @@
organ_owner.update_sight()
UnregisterSignal(organ_owner, COMSIG_ATOM_BULLET_ACT)
/obj/item/organ/eyes/proc/on_bullet_act(mob/living/carbon/source, obj/projectile/proj, def_zone)
/obj/item/organ/eyes/proc/on_bullet_act(mob/living/carbon/source, obj/projectile/proj, def_zone, piercing_hit, blocked)
SIGNAL_HANDLER
// Once-a-dozen-rounds level of rare
if (def_zone != BODY_ZONE_HEAD || !prob(proj.damage * 0.1) || !(proj.damage_type == BRUTE || proj.damage_type == BURN))
return
var/blocked = source.check_projectile_armor(def_zone, proj, is_silent = TRUE)
if (blocked && source.is_eyes_covered())
if (!proj.armour_penetration || prob(blocked - proj.armour_penetration))
return