Skip to content

Commit

Permalink
Properly removes and fixes blindess.
Browse files Browse the repository at this point in the history
  • Loading branch information
Coll6 committed Dec 25, 2024
1 parent 71ee97e commit 49c865e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 4 additions & 1 deletion monkestation/code/modules/surgery/organs/internal/brain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,10 @@
if(istype(bodypart, /obj/item/bodypart/chest))
continue
if(istype(bodypart, /obj/item/bodypart/head))
new_body.become_blind(NO_EYES) //Spawning without a head no eyes
// Living mobs eyes are stored in the body so remove the organs properly for their effect to work.
var/obj/item/organ/internal/eyes/eyes = new_body.get_organ_slot(ORGAN_SLOT_EYES)
eyes.Remove(new_body)
qdel(eyes)
qdel(bodypart)
new_body.visible_message(span_warning("[new_body]'s torso \"forms\" from [new_body.p_their()] core, yet to form the rest."))
to_chat(owner, span_purple("Your torso fully forms out of your core, yet to form the rest."))
Expand Down
13 changes: 9 additions & 4 deletions monkestation/code/modules/surgery/organs/internal/heart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,28 @@
/datum/action/innate/regenerate_limbs/Activate()
var/mob/living/carbon/human/H = owner
var/list/limbs_to_heal = H.get_missing_limbs()
var/obj/item/bodypart/head/head_part = new ()
var/obj/item/organ/new_organ
if(!length(limbs_to_heal))
to_chat(H, span_notice("You feel intact enough as it is."))
return
to_chat(H, span_notice("You focus intently on your missing [length(limbs_to_heal) >= 2 ? "limbs" : "limb"]..."))
if(H.blood_volume >= 40*length(limbs_to_heal)+BLOOD_VOLUME_OKAY)
if(head_part.can_attach_limb(H))
H.cure_blind(NO_EYES)
H.regenerate_limbs()
if((BODY_ZONE_HEAD in limbs_to_heal) && H.get_bodypart(BODY_ZONE_HEAD))
new_organ = H.dna.species.get_mutant_organ_type_for_slot(ORGAN_SLOT_EYES)
new_organ = SSwardrobe.provide_type(new_organ)
new_organ.Insert(H)
H.blood_volume -= 40*length(limbs_to_heal)
to_chat(H, span_notice("...and after a moment you finish reforming!"))
return
else if(H.blood_volume >= 40)//We can partially heal some limbs
while(H.blood_volume >= BLOOD_VOLUME_OKAY+40)
var/healed_limb = pick(limbs_to_heal)
H.regenerate_limb(healed_limb)
if(H.regenerate_limb(healed_limb) && istype(healed_limb, /obj/item/bodypart/head))
H.cure_blind(NO_EYES)
new_organ = H.dna.species.get_mutant_organ_type_for_slot(ORGAN_SLOT_EYES)
new_organ = SSwardrobe.provide_type(new_organ)
new_organ.Insert(H)
limbs_to_heal -= healed_limb
H.blood_volume -= 40
to_chat(H, span_warning("...but there is not enough of you to fix everything! You must attain more mass to heal completely!"))
Expand Down

0 comments on commit 49c865e

Please sign in to comment.