Skip to content

Commit

Permalink
check damage now
Browse files Browse the repository at this point in the history
  • Loading branch information
Rerik007 committed Apr 19, 2024
1 parent 9b6ab55 commit da39123
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
7 changes: 5 additions & 2 deletions code/modules/surgery/organs/ears.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@



/obj/item/organ/internal/ears/can_surgeryize()
if(owner)
/obj/item/organ/internal/ears/has_damage()
. = ..()
if(.)
return .
if(owner.AmountDeaf())
return TRUE

/obj/item/organ/internal/ears/surgeryize()
Expand Down
11 changes: 9 additions & 2 deletions code/modules/surgery/organs/eyes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@
owner.SetEyeBlurry(0)
owner.SetEyeBlind(0)

/obj/item/organ/internal/eyes/can_surgeryize()
if(owner)
/obj/item/organ/internal/eyes/has_damage(obj/item/tool, tool_name)
. = ..()
if(.)
return .
if(owner.AmountEyeBlurry() || owner.AmountBlinded())
return TRUE
if(NEARSIGHTED in owner.mutations)
return TRUE
if(BLINDNESS in owner.mutations)
return TRUE

/obj/item/organ/internal/eyes/robotize(make_tough = FALSE)
Expand Down
4 changes: 3 additions & 1 deletion code/modules/surgery/organs/organ.dm
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@
/obj/item/organ/proc/surgeryize()
return

/obj/item/organ/proc/can_surgeryize()
/obj/item/organ/proc/has_damage()
if(damage)
return TRUE
return FALSE

/obj/item/organ/proc/is_robotic()
Expand Down
4 changes: 3 additions & 1 deletion code/modules/surgery/organs_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
var/any_organs_damaged = FALSE

for(var/obj/item/organ/internal/organ as anything in get_organ_list(target_zone, target, affected))
if(!organ.damage && !organ.can_surgeryize())
if(!organ.has_damage())
continue
any_organs_damaged = TRUE
var/can_treat_robotic = organ.is_robotic() && istype(tool, /obj/item/stack/nanopaste)
Expand All @@ -329,6 +329,8 @@
if(!any_organs_damaged)
if(affected)
to_chat(user, "There are no damaged organs in [affected.name].")
else
to_chat(user, "There are no damaged organs in [parse_zone(target_zone)].")
return SURGERY_BEGINSTEP_SKIP

if(affected)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/surgery/robotics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@

var/found_damaged_organ = FALSE
for(var/obj/item/organ/internal/organ as anything in affected.internal_organs)
if((organ.damage || organ.can_surgeryize()) && organ.is_robotic())
if(organ.has_damage() && organ.is_robotic())
user.visible_message(
"[user] starts mending the damage to [target]'s [organ.name]'s mechanisms.",
"You start mending the damage to [target]'s [organ.name]'s mechanisms."
Expand Down

0 comments on commit da39123

Please sign in to comment.