mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 01:34:01 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user