* 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
This commit is contained in:
jack-fractal
2013-10-11 12:39:54 -04:00
parent 973dc25fda
commit 32c3f27675
6 changed files with 1104 additions and 989 deletions
@@ -368,27 +368,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 << "<span class='notice'>We have regenerated.</span>"
C.visible_message("<span class='warning'>[src] appears to wake from the dead, having healed all wounds.</span>")
C.status_flags &= ~(FAKEDEATH)
C.update_canmove()
C.make_changeling()
feedback_add_details("changeling_powers","FD")
return 1
@@ -174,6 +174,21 @@
////////////////////////////////////////////
/*
This function restores the subjects blood to max.
*/
/mob/living/carbon/human/proc/restore_blood()
var/blood_volume = vessel.get_reagent_amount("blood")
vessel.add_reagent("blood",560.0-blood_volume)
/*
This function restores all organs.
*/
/mob/living/carbon/human/restore_all_organs()
for(var/datum/organ/external/current_organ in organs)
current_organ.rejuvenate()
/mob/living/carbon/human/proc/HealDamage(zone, brute, burn)
var/datum/organ/external/E = get_organ(zone)
if(istype(E, /datum/organ/external))
+10
View File
@@ -246,6 +246,9 @@
adjustFireLoss(burn)
src.updatehealth()
/mob/living/proc/restore_all_organs()
return
/mob/living/proc/revive()
setToxLoss(0)
setOxyLoss(0)
@@ -270,8 +273,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
+25 -2
View File
@@ -181,8 +181,31 @@
var/result = update_icon()
return result
/*
This function completely restores a damaged organ to perfect condition.
*/
/datum/organ/external/proc/rejuvenate()
damage_state = "00"
status = 0
perma_injury = 0
brute_dam = 0
burn_dam = 0
// handle internal organs
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.
implanted_object.loc = owner.loc
implants -= implanted_object
owner.updatehealth()
update_icon()
/datum/organ/external/proc/createwound(var/type = CUT, var/damage)
if(damage == 0) return
+3
View File
@@ -11,6 +11,9 @@
var/min_broken_damage = 30
var/parent_organ = "chest"
/datum/organ/internal/proc/rejuvenate()
damage=0
/datum/organ/internal/proc/is_bruised()
return damage >= min_bruised_damage
+990 -977
View File
File diff suppressed because it is too large Load Diff