From cf8348c25d0b0005f6695e51acd04387e79d707c Mon Sep 17 00:00:00 2001 From: jack-fractal Date: Fri, 11 Oct 2013 12:39:54 -0400 Subject: [PATCH] * adding a 'rejuvinate' function to organs that fixes all types of damage * adding a 'restore_all_organs' function to living creatures * adding a 'restore_blood_loss' function to humans * fixing changeling stasis power to heal organ and blood damage * fixing adming rejuvinate verb to fix organ and blood damage Conflicts: code/modules/mob/living/carbon/human/human_damage.dm code/modules/organs/organ_external.dm html/changelog.html --- .../gamemodes/changeling/changeling_powers.dm | 71 ++++++++++++++++--- .../mob/living/carbon/human/human_damage.dm | 1 - code/modules/mob/living/living.dm | 10 +++ code/modules/organs/organ_external.dm | 2 + code/modules/organs/organ_internal.dm | 2 +- 5 files changed, 74 insertions(+), 12 deletions(-) diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index 0c0b676e32c..539ef55529b 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -377,27 +377,78 @@ spawn(rand(800,2000)) if(changeling_power(20,1,100,DEAD)) + // charge the changeling chemical cost for stasis changeling.chem_charges -= 20 - if(C.stat == DEAD) - dead_mob_list -= C - living_mob_list += C - C.stat = CONSCIOUS - C.tod = null + + // shut down various types of badness C.setToxLoss(0) C.setOxyLoss(0) C.setCloneLoss(0) + C.setBrainLoss(0) C.SetParalysis(0) C.SetStunned(0) C.SetWeakened(0) + + // shut down ongoing problems C.radiation = 0 - C.heal_overall_damage(C.getBruteLoss(), C.getFireLoss()) + C.nutrition = 400 + C.bodytemperature = 310 + C.sdisabilities = 0 + C.disabilities = 0 + C.blinded = 0 + + // fix blindness and deafness + C.eye_blind = 0 + C.eye_blurry = 0 + C.ear_deaf = 0 + C.ear_damage = 0 + + // head actual damage numbers + C.heal_overall_damage(1000, 1000) + + // get rid of the reagents C.reagents.clear_reagents() + + // cure diseases + for(var/datum/disease/D in viruses) + D.cure(0) + + // fix all the organs + C.restore_all_organs() + + // restore blood + if(ishuman(C)) + var/mob/living/carbon/human/human_mob = C + human_mob.restore_blood() + + // remove the character from the list of the dead + if(C.stat == 2) + dead_mob_list -= src + living_mob_list += src + + // make us conscious again + C.stat = CONSCIOUS + + // remove the time of death + C.tod = null + + // fix all the icons + C.regenerate_icons() + + // remove our fake death flag + C.status_flags &= ~(FAKEDEATH) + + // let us move again + C.update_canmove() + + // re-add out changeling powers + C.make_changeling() + + // sending display messages C << "We have regenerated." C.visible_message("[src] appears to wake from the dead, having healed all wounds.") - - C.status_flags &= ~(FAKEDEATH) - C.update_canmove() - C.make_changeling() + + feedback_add_details("changeling_powers","FD") return 1 diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 06a63c7672c..1c61af73353 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -198,7 +198,6 @@ This function restores the subjects blood to max. var/blood_volume = vessel.get_reagent_amount("blood") vessel.add_reagent("blood",560.0-blood_volume) - /* This function restores all organs. */ diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a8d8608924e..cadf9e44d9e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -271,6 +271,9 @@ adjustFireLoss(burn) src.updatehealth() +/mob/living/proc/restore_all_organs() + return + /mob/living/proc/revive() rejuvenate() buckled = initial(src.buckled) @@ -315,8 +318,15 @@ if(iscarbon(src)) var/mob/living/carbon/C = src C.handcuffed = initial(C.handcuffed) + + // restore all of the human's blood + if(ishuman(src)) + var/mob/living/carbon/human/human_mob = src + human_mob.restore_blood() + for(var/datum/disease/D in viruses) D.cure(0) + restore_all_organs() if(stat == 2) dead_mob_list -= src living_mob_list += src diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 048d1af6583..54a5beb4a6b 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -210,6 +210,7 @@ This function completely restores a damaged organ to perfect condition. for(var/datum/organ/internal/current_organ in internal_organs) current_organ.rejuvenate() + // remove embedded objects and drop them on the floor for(var/obj/implanted_object in implants) if(!istype(implanted_object,/obj/item/weapon/implant)) // We don't want to remove REAL implants. Just shrapnel etc. @@ -219,6 +220,7 @@ This function completely restores a damaged organ to perfect condition. owner.updatehealth() update_icon() + /datum/organ/external/proc/createwound(var/type = CUT, var/damage) if(damage == 0) return diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index 3b80d6a748a..461a52a3102 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -157,4 +157,4 @@ if(is_bruised()) owner.eye_blurry = 20 if(is_broken()) - owner.eye_blind = 20 \ No newline at end of file + owner.eye_blind = 20