|
668 | 668 | return |
669 | 669 | var/mob/living/carbon/human/H = owner |
670 | 670 | H.restore_blood() |
671 | | - H.species.create_organs(H, TRUE) |
672 | | - H.restore_all_organs() |
673 | | - H.adjustBruteLoss(-healing_amount) |
674 | | - H.adjustFireLoss(-healing_amount) |
| 671 | + //Go through all the organs and limbs we should have, if one's missing, grow it. |
| 672 | + for(var/organ_tag in H.species.has_organ) |
| 673 | + var/obj/item/organ/I = H.internal_organs_by_name[name] |
| 674 | + if(!I) |
| 675 | + var/organ_type = H.species.has_organ[organ_tag] |
| 676 | + var/obj/item/organ/O = new organ_type(H,1) |
| 677 | + if(organ_tag != O.organ_tag) |
| 678 | + warning("[O.type] has a default organ tag \"[O.organ_tag]\" that differs from the species' organ tag \"[organ_tag]\". Updating organ_tag to match.") |
| 679 | + O.organ_tag = organ_tag |
| 680 | + H.internal_organs_by_name[organ_tag] = O |
| 681 | + for(var/limb_type in H.species.has_limbs) |
| 682 | + var/obj/item/organ/I = H.organs_by_name[limb_type] |
| 683 | + if(istype(I, /obj/item/organ/external/stump)) |
| 684 | + I.removed(null, TRUE)//Shouldn't have a vital stump that can be removed, but no need to kill if that somehow is the case, as it'll be replaced. |
| 685 | + I = null |
| 686 | + if(!I) |
| 687 | + var/list/organ_data = H.species.has_limbs[limb_type] |
| 688 | + var/limb_path = organ_data["path"] |
| 689 | + var/obj/item/organ/O = new limb_path(H) |
| 690 | + organ_data["descriptor"] = O.name |
| 691 | + if(O.parent_organ) |
| 692 | + organ_data = H.species.has_limbs[O.parent_organ] |
| 693 | + organ_data["has_children"] = organ_data["has_children"]+1 |
| 694 | + H.restore_all_organs(ignore_prosthetic_prefs=TRUE) //A chimera couldn't make a limb robotic by this, shouldn't remove robotic parts, though. |
675 | 695 | H.adjustOxyLoss(-healing_amount) |
676 | 696 | H.adjustCloneLoss(-healing_amount) |
677 | | - H.adjustBrainLoss(-healing_amount) |
678 | 697 | H.remove_status_effect(/datum/status_effect/sight/blindness) |
679 | 698 | H.eye_blurry = FALSE |
680 | 699 | H.ear_deaf = FALSE |
|
0 commit comments