Skip to content

Commit

Permalink
tg 88082 early port - armor helps against getting your eye exploded (#…
Browse files Browse the repository at this point in the history
…4653)

early port

Co-authored-by: Hatterhat <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Dec 7, 2024
1 parent a48424f commit 383039d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions code/modules/surgery/organs/internal/eyes/_eyes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 383039d

Please sign in to comment.