From 383039d8be2ebf6380240b84d1cea60c1d0116aa Mon Sep 17 00:00:00 2001 From: Hatterhat <31829017+Hatterhat@users.noreply.github.com> Date: Fri, 6 Dec 2024 19:41:35 -0600 Subject: [PATCH] tg 88082 early port - armor helps against getting your eye exploded (#4653) early port Co-authored-by: Hatterhat --- .../surgery/organs/internal/eyes/_eyes.dm | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/code/modules/surgery/organs/internal/eyes/_eyes.dm b/code/modules/surgery/organs/internal/eyes/_eyes.dm index ca36429b496..75b477537c9 100644 --- a/code/modules/surgery/organs/internal/eyes/_eyes.dm +++ b/code/modules/surgery/organs/internal/eyes/_eyes.dm @@ -130,6 +130,38 @@ eye_owner.update_tint() eye_owner.update_sight() is_emissive = FALSE // NOVA EDIT ADDITION +<<<<<<< HEAD +======= + UnregisterSignal(organ_owner, COMSIG_ATOM_BULLET_ACT) + +/obj/item/organ/internal/eyes/proc/on_bullet_act(mob/living/carbon/source, obj/projectile/proj, def_zone) + 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 + + var/valid_sides = list() + if (!(scarring & RIGHT_EYE_SCAR)) + valid_sides += RIGHT_EYE_SCAR + if (!(scarring & LEFT_EYE_SCAR)) + valid_sides += LEFT_EYE_SCAR + if (!length(valid_sides)) + return + + var/picked_side = pick(valid_sides) + to_chat(owner, span_userdanger("You feel searing pain shoot though your [picked_side == RIGHT_EYE_SCAR ? "right" : "left"] eye!")) + // oof ouch my eyes + apply_organ_damage(rand((maxHealth - high_threshold) * 0.5, maxHealth - low_threshold)) + var/datum/wound/pierce/bleed/severe/eye/eye_puncture = new + eye_puncture.apply_wound(bodypart_owner, wound_source = "bullet impact", right_side = picked_side) + apply_scar(picked_side) +>>>>>>> a07fb85cf97 (tg 88082 early port - armor helps against getting your eye exploded (#4653)) #define OFFSET_X 1 #define OFFSET_Y 2