|
|
|
@@ -1256,9 +1256,9 @@
|
|
|
|
|
germ_level += n
|
|
|
|
|
|
|
|
|
|
/mob/living/carbon/human/proc/check_and_regenerate_organs(var/mob/living/carbon/human/H) //Regenerates missing limbs/organs.
|
|
|
|
|
var/list/types_of_int_organs = list()
|
|
|
|
|
var/list/types_of_int_organs = list() //This will hold all the types of organs in the mob before rejuvenation.
|
|
|
|
|
for(var/obj/item/organ/internal/I in H.internal_organs)
|
|
|
|
|
types_of_int_organs |= I.type
|
|
|
|
|
types_of_int_organs |= I.type //Compiling the list of organ types. It is possible for organs to be missing from this list if they are absent from the mob.
|
|
|
|
|
|
|
|
|
|
//Removing stumps.
|
|
|
|
|
for(var/obj/item/organ/organ in H.contents)
|
|
|
|
@@ -1276,20 +1276,32 @@
|
|
|
|
|
H.organs_by_name -= organ_name //Making sure the list entry is removed.
|
|
|
|
|
|
|
|
|
|
//Replacing lost limbs with the species default.
|
|
|
|
|
var/mob/living/carbon/human/temp_holder
|
|
|
|
|
for(var/limb_type in H.species.has_limbs)
|
|
|
|
|
if(!(limb_type in H.organs_by_name))
|
|
|
|
|
var/list/organ_data = H.species.has_limbs[limb_type]
|
|
|
|
|
var/limb_path = organ_data["path"]
|
|
|
|
|
var/obj/item/organ/external/O = new limb_path(H)
|
|
|
|
|
O.owner = H
|
|
|
|
|
H.organs |= H.organs_by_name[O.limb_name]
|
|
|
|
|
var/obj/item/organ/external/O = new limb_path(temp_holder)
|
|
|
|
|
if(H.get_limb_by_name(O.name)) //Check to see if the user already has an limb with the same name as the 'missing limb'. If they do, skip regrowth.
|
|
|
|
|
continue //In an example, this will prevent duplication of the mob's right arm if the mob is a Human and they have a Diona right arm, since,
|
|
|
|
|
//while the limb with the name 'right_arm' the mob has may not be listed in their species' bodyparts definition, it is still viable and has the appropriate limb name.
|
|
|
|
|
else
|
|
|
|
|
O = new limb_path(H) //Create the limb on the player.
|
|
|
|
|
O.owner = H
|
|
|
|
|
H.organs |= H.organs_by_name[O.limb_name]
|
|
|
|
|
|
|
|
|
|
//Replacing lost organs with the species default.
|
|
|
|
|
temp_holder = new /mob/living/carbon/human()
|
|
|
|
|
for(var/index in H.species.has_organ)
|
|
|
|
|
var/organ = H.species.has_organ[index]
|
|
|
|
|
if(!(organ in types_of_int_organs))
|
|
|
|
|
var/obj/item/organ/internal/I = new organ(H)
|
|
|
|
|
I.insert(H)
|
|
|
|
|
if(!(organ in types_of_int_organs)) //If the mob is missing this particular organ...
|
|
|
|
|
var/obj/item/organ/internal/I = new organ(temp_holder) //Create the organ inside our holder so we can check it before implantation.
|
|
|
|
|
if(H.get_organ_slot(I.slot)) //Check to see if the user already has an organ in the slot the 'missing organ' belongs to. If they do, skip implantation.
|
|
|
|
|
continue //In an example, this will prevent duplication of the mob's eyes if the mob is a Human and they have Nucleation eyes, since,
|
|
|
|
|
//while the organ in the eyes slot may not be listed in the mob's species' organs definition, it is still viable and fits in the appropriate organ slot.
|
|
|
|
|
else
|
|
|
|
|
I = new organ(H) //Create the organ inside the player.
|
|
|
|
|
I.insert(H)
|
|
|
|
|
|
|
|
|
|
/mob/living/carbon/human/revive()
|
|
|
|
|
|
|
|
|
@@ -1299,8 +1311,9 @@
|
|
|
|
|
fixblood()
|
|
|
|
|
|
|
|
|
|
//Fix up all organs and replace lost ones.
|
|
|
|
|
restore_all_organs()
|
|
|
|
|
check_and_regenerate_organs(src)
|
|
|
|
|
restore_all_organs() //Rejuvenate and reset all existing organs.
|
|
|
|
|
check_and_regenerate_organs(src) //Regenerate limbs and organs only if they're really missing.
|
|
|
|
|
surgeries.Cut() //End all surgeries.
|
|
|
|
|
|
|
|
|
|
if(!client || !key) //Don't boot out anyone already in the mob.
|
|
|
|
|
for (var/obj/item/organ/internal/brain/H in world)
|
|
|
|
|