Merge pull request #15575 from phil235/ReviveFix1

Fixes mob revival
This commit is contained in:
Cheridan
2016-02-17 20:42:10 -06:00
35 changed files with 193 additions and 215 deletions
+1 -1
View File
@@ -1487,7 +1487,7 @@
usr << "This can only be used on instances of type /mob/living"
return
L.revive()
L.revive(full_heal = 1, admin_revive = 1)
message_admins("<span class='danger'>Admin [key_name_admin(usr)] healed / revived [key_name_admin(L)]!</span>")
log_admin("[key_name(usr)] healed / Revived [key_name(L)]")
+1 -1
View File
@@ -454,7 +454,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!istype(M))
alert("Cannot revive a ghost")
return
M.revive()
M.revive(full_heal = 1, admin_revive = 1)
log_admin("[key_name(usr)] healed / revived [key_name(M)]")
message_admins("<span class='danger'>Admin [key_name_admin(usr)] healed / revived [key_name_admin(M)]!</span>")
@@ -234,7 +234,7 @@
C.name = "Cookie of Fate"
if(12)
//Healing
user.revive()
user.revive(full_heal = 1, admin_revive = 1)
if(13)
//Mad Dosh
var/turf/Start = get_turf(src)
@@ -160,7 +160,7 @@
C << "<span class='notice'>Death is not your end!</span>"
spawn(rand(80,120))
C.revive()
C.revive(full_heal = 1, admin_revive = 1)
C << "<span class='notice'>You have regenerated.</span>"
C.visible_message("<span class='warning'>[usr] appears to wake from the dead, having healed all wounds.</span>")
C.update_canmove()
+1 -1
View File
@@ -771,7 +771,7 @@
var/mob/living/simple_animal/M = target
if(M.stat == DEAD)
M.faction = list("neutral")
M.revive()
M.revive(full_heal = 1, admin_revive = 1)
if(istype(target, /mob/living/simple_animal/hostile))
var/mob/living/simple_animal/hostile/H = M
if(malfunctioning)
+1 -1
View File
@@ -61,7 +61,7 @@
newbrain.brainmob = null
brainmob.loc = src
brainmob.container = src
if(!newbrain.damaged_brain) // the brain organ hasn't beaten to death.
if(!newbrain.damaged_brain) // the brain organ hasn't been beaten to death.
brainmob.stat = CONSCIOUS //we manually revive the brain mob
dead_mob_list -= brainmob
living_mob_list += brainmob
@@ -51,3 +51,8 @@
/mob/living/carbon/brain/update_damage_hud()
return //no red circles for brain
/mob/living/carbon/brain/can_be_revived()
. = 1
if(!container || health <= config.health_threshold_dead)
return 0
+32 -59
View File
@@ -14,7 +14,6 @@
/mob/living/carbon/updatehealth()
..()
med_hud_set_health()
med_hud_set_status()
/mob/living/carbon/Destroy()
for(var/atom/movable/guts in internal_organs)
@@ -154,16 +153,18 @@
if(health >= 0)
if(lying)
AdjustSleeping(-5)
M.visible_message("<span class='notice'>[M] shakes [src] trying to get \him up!</span>", \
"<span class='notice'>You shake [src] trying to get \him up!</span>")
else
M.visible_message("<span class='notice'>[M] hugs [src] to make \him feel better!</span>", \
"<span class='notice'>You hug [src] to make \him feel better!</span>")
AdjustSleeping(-5)
AdjustParalysis(-3)
AdjustStunned(-3)
AdjustWeakened(-3)
if(resting)
resting = 0
update_canmove()
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
@@ -677,62 +678,6 @@ var/const/GALOSHES_DONT_HELP = 4
if(wear_mask)
. += wear_mask.tint
/mob/living/carbon/revive()
setToxLoss(0)
setOxyLoss(0)
setCloneLoss(0)
setBrainLoss(0)
setStaminaLoss(0)
SetParalysis(0)
SetStunned(0)
SetWeakened(0)
SetSleeping(0)
radiation = 0
nutrition = NUTRITION_LEVEL_FED + 50
bodytemperature = 310
disabilities = 0
ear_deaf = 0
ear_damage = 0
hallucination = 0
heal_overall_damage(1000, 1000)
ExtinguishMob()
fire_stacks = 0
suiciding = 0
handcuffed = initial(handcuffed)
for(var/obj/item/weapon/restraints/R in contents) //actually remove cuffs from inventory
qdel(R)
update_handcuffed()
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
reagents.clear_reagents()
reagents.addiction_list = list()
for(var/datum/disease/D in viruses)
D.cure(0)
var/obj/item/organ/internal/brain/BR = getorgan(/obj/item/organ/internal/brain)
if(BR) //can't revive if the mob has no brain
if(stat == DEAD)
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
BR.damaged_brain = 0 //if the brain itself is damaged we heal it
set_blindness(0)
set_blurriness(0)
set_eye_damage(0)
if(ishuman(src))
var/mob/living/carbon/human/human_mob = src
human_mob.restore_blood()
human_mob.remove_all_embedded_objects()
updatehealth()
update_fire()
if(dna)
for(var/datum/mutation/human/HM in dna.mutations)
if(HM.quality != POSITIVE)
dna.remove_mutation(HM.name)
update_sight()
reload_fullscreen()
update_canmove()
//this handles hud updates
/mob/living/carbon/update_damage_hud()
@@ -833,6 +778,7 @@ var/const/GALOSHES_DONT_HELP = 4
update_canmove()
update_damage_hud()
update_health_hud()
med_hud_set_status()
//called when we get cuffed/uncuffed
/mob/living/carbon/proc/update_handcuffed()
@@ -845,3 +791,30 @@ var/const/GALOSHES_DONT_HELP = 4
clear_alert("handcuffed")
update_inv_handcuffed()
update_hud_handcuffed()
/mob/living/carbon/fully_heal(admin_revive = 0)
if(reagents)
reagents.clear_reagents()
var/obj/item/organ/internal/brain/B = getorgan(/obj/item/organ/internal/brain)
if(B)
B.damaged_brain = 0
if(admin_revive)
handcuffed = initial(handcuffed)
for(var/obj/item/weapon/restraints/R in contents) //actually remove cuffs from inventory
qdel(R)
update_handcuffed()
if(reagents)
reagents.addiction_list = list()
for(var/datum/disease/D in viruses)
D.cure(0)
if(dna)
for(var/datum/mutation/human/HM in dna.mutations)
if(HM.quality != POSITIVE)
dna.remove_mutation(HM.name)
..()
/mob/living/carbon/can_be_revived()
. = ..()
if(!getorgan(/obj/item/organ/internal/brain))
return 0
@@ -943,3 +943,8 @@
hud_used.healthdoll.overlays += image('icons/mob/screen_gen.dmi',"[L.name][icon_num]")
else
hud_used.healthdoll.icon_state = "healthdoll_DEAD"
/mob/living/carbon/human/fully_heal(admin_revive = 0)
restore_blood()
remove_all_embedded_objects()
..()
+38 -22
View File
@@ -456,38 +456,54 @@ Sorry Giacom. Please don't be mad :(
if(updating_health)
updatehealth()
/mob/living/proc/revive()
setToxLoss(0)
setOxyLoss(0)
setCloneLoss(0)
//proc used to ressuscitate a mob
/mob/living/proc/revive(full_heal = 0, admin_revive = 0)
if(full_heal)
fully_heal(admin_revive)
if(stat == DEAD && can_be_revived()) //in some cases you can't revive (e.g. no brain)
dead_mob_list -= src
living_mob_list += src
suiciding = 0
stat = UNCONSCIOUS //the mob starts unconscious,
blind_eyes(1)
updatehealth() //then we check if the mob should wake up.
update_canmove()
update_sight()
reload_fullscreen()
. = 1
//proc used to completely heal a mob.
/mob/living/proc/fully_heal(admin_revive = 0)
setToxLoss(0, 0)
setOxyLoss(0, 0)
setCloneLoss(0, 0)
setBrainLoss(0)
setStaminaLoss(0)
SetParalysis(0)
SetStunned(0)
SetWeakened(0)
SetSleeping(0)
setStaminaLoss(0, 0)
SetParalysis(0, 0)
SetStunned(0, 0)
SetWeakened(0, 0)
SetSleeping(0, 0)
radiation = 0
nutrition = NUTRITION_LEVEL_FED + 50
bodytemperature = 310
disabilities = 0
set_blindness(0)
set_blurriness(0)
set_eye_damage(0)
ear_deaf = 0
ear_damage = 0
hallucination = 0
heal_overall_damage(1000, 1000)
ExtinguishMob()
fire_stacks = 0
suiciding = 0
if(stat == DEAD)
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
set_blindness(0)
set_blurriness(0)
set_eye_damage(0)
updatehealth()
update_fire()
regenerate_icons()
reload_fullscreen()
//proc called by revive(), to check if we can actually ressuscitate the mob (we don't want to revive him and have him instantly die again)
/mob/living/proc/can_be_revived()
. = 1
if(health <= config.health_threshold_dead)
return 0
/mob/living/proc/update_damage_overlays()
return
@@ -984,7 +1000,7 @@ Sorry Giacom. Please don't be mad :(
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else if(eye_blind)
var/blind_minimum = 0
if(stat == UNCONSCIOUS || (disabilities & BLIND))
if(stat != CONSCIOUS || (disabilities & BLIND))
blind_minimum = 1
eye_blind = max(eye_blind+amount, blind_minimum)
if(!eye_blind)
@@ -1000,7 +1016,7 @@ Sorry Giacom. Please don't be mad :(
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else if(eye_blind)
var/blind_minimum = 0
if(stat == UNCONSCIOUS || (disabilities & BLIND))
if(stat != CONSCIOUS || (disabilities & BLIND))
blind_minimum = 1
eye_blind = blind_minimum
if(!eye_blind)
+5
View File
@@ -890,3 +890,8 @@ var/list/ai_list = list()
AT.get_remote_view_fullscreens(src)
else
clear_fullscreen("remote_view", 0)
/mob/living/silicon/ai/revive(full_heal = 0, admin_revive = 0)
if(..()) //successfully ressuscitated from death
icon_state = "ai"
. = 1
+4 -1
View File
@@ -64,7 +64,6 @@
if(!fire_res_on_core)
health -= getFireLoss()
update_stat()
diag_hud_set_status()
diag_hud_set_health()
/mob/living/silicon/ai/update_stat()
@@ -74,6 +73,10 @@
if(health <= config.health_threshold_dead)
death()
return
else if(stat == UNCONSCIOUS)
stat = CONSCIOUS
adjust_blindness(-1)
diag_hud_set_status()
/mob/living/silicon/ai/update_sight()
see_invisible = initial(see_invisible)
+6
View File
@@ -6,3 +6,9 @@
/mob/living/silicon/spawn_dust()
new /obj/effect/decal/remains/robot(loc)
/mob/living/silicon/death(gibbed)
diag_hud_set_status()
diag_hud_set_health()
update_health_hud()
..()
+12 -3
View File
@@ -1188,9 +1188,6 @@
if(health < -maxHealth*0.5)
if(uneq_module(module_state_1))
src << "<span class='warning'>CRITICAL ERROR: All modules OFFLINE.</span>"
diag_hud_set_health()
diag_hud_set_status()
update_health_hud()
/mob/living/silicon/robot/update_sight()
if(!client)
@@ -1247,6 +1244,9 @@
adjust_blindness(-1)
update_canmove()
update_headlamp()
diag_hud_set_status()
diag_hud_set_health()
update_health_hud()
/mob/living/silicon/robot/fully_replace_character_name(oldname, newname)
..()
@@ -1264,3 +1264,12 @@
Stun(3)
..()
/mob/living/silicon/robot/revive(full_heal = 0, admin_revive = 0)
if(..()) //successfully ressuscitated from death
if(camera && !wires.is_cut(WIRE_CAMERA))
camera.toggle_cam(src,0)
update_headlamp()
if(admin_revive)
locked = 1
notify_ai(1)
. = 1
@@ -876,9 +876,10 @@ Pass a positive integer as an argument to override a bot's default speed.
. = ..()
bot_reset()
/mob/living/simple_animal/bot/revive()
..()
update_icon()
/mob/living/simple_animal/bot/revive(full_heal = 0, admin_revive = 0)
if(..())
update_icon()
. = 1
/mob/living/simple_animal/bot/ghost()
if(stat != DEAD) // Only ghost if we're doing this while alive, the pAI probably isn't dead yet.
@@ -51,10 +51,6 @@
..(gibbed)
regenerate_icons()
/mob/living/simple_animal/pet/dog/corgi/revive()
..()
regenerate_icons()
/mob/living/simple_animal/pet/dog/corgi/show_inv(mob/user)
user.set_machine(src)
if(user.stat) return
@@ -240,16 +240,7 @@
/mob/living/simple_animal/drone/experience_pressure_difference(pressure_difference, direction)
return
/mob/living/simple_animal/drone/revive()
/mob/living/simple_animal/drone/fully_heal(admin_revive = 0)
adjustBruteLoss(-getBruteLoss()) //Heal all brute damage
stat = CONSCIOUS
updatehealth()
icon_state = icon_living
if(stat == DEAD)
dead_mob_list -= src
living_mob_list += src
update_sight()
reload_fullscreen()
update_canmove()
@@ -34,7 +34,7 @@
return
D.visible_message("<span class='notice'>[D] begins to reactivate [src].</span>", "<span class='notice'>You begin to reactivate [src]...</span>")
if(do_after(user,30, 1, target = src))
revive()
revive(full_heal = 1)
D.visible_message("<span class='notice'>[D] reactivates [src]!</span>", "<span class='notice'>You reactivate [src].</span>")
alert_drones(DRONE_NET_CONNECT)
if(G)
@@ -34,9 +34,10 @@
pcollar = new(src)
regenerate_icons()
/mob/living/simple_animal/pet/revive()
..()
regenerate_icons()
/mob/living/simple_animal/pet/revive(full_heal = 0, admin_revive = 0)
if(..())
regenerate_icons()
. = 1
/mob/living/simple_animal/pet/death(gibbed)
..(gibbed)
@@ -280,7 +280,7 @@
H.visible_message("[user] forces [H] to apply [src]... they quickly regenerate all injuries!")
else
user << "<span class='notice'>You start to smear [src] on yourself. It feels and smells disgusting, but you feel amazingly refreshed in mere moments.</span>"
H.revive()
H.revive(fully_heal = 1)
qdel(src)
..()
@@ -364,9 +364,10 @@
return
icon_state = "Goliath_preattack"
/mob/living/simple_animal/hostile/asteroid/goliath/revive()
anchored = 1
..()
/mob/living/simple_animal/hostile/asteroid/goliath/revive(full_heal = 0, admin_revive = 0)
if(..())
anchored = 1
. = 1
/mob/living/simple_animal/hostile/asteroid/goliath/death(gibbed)
anchored = 0
@@ -85,10 +85,11 @@
qdel(src)
..()
/mob/living/simple_animal/hostile/mushroom/revive()
..()
icon_state = "mushroom_color"
UpdateMushroomCap()
/mob/living/simple_animal/hostile/mushroom/revive(full_heal = 0, admin_revive = 0)
if(..())
icon_state = "mushroom_color"
UpdateMushroomCap()
. = 1
/mob/living/simple_animal/hostile/mushroom/death(gibbed)
..(gibbed)
@@ -104,7 +105,7 @@
/mob/living/simple_animal/hostile/mushroom/proc/Recover()
visible_message("[src] slowly begins to recover.")
faint_ticker = 0
revive()
revive(full_heal = 1)
UpdateMushroomCap()
recovery_cooldown = 1
spawn(300)
@@ -50,7 +50,7 @@
L.gib()
visible_message("<span class='danger'>[src] tears [L] to pieces!</span>")
src << "<span class='userdanger'>You feast on [L], restoring your health!</span>"
src.revive()
revive(full_heal = 1)
/mob/living/simple_animal/hostile/zombie/death()
..()
@@ -67,7 +67,7 @@
spawn(rand(800,1200))
if(src)
visible_message("<span class='danger'>[src] staggers to their feet!</span>")
src.revive()
revive(full_heal = 1)
/mob/living/simple_animal/hostile/zombie/proc/Zombify(mob/living/carbon/human/H)
H.set_species(/datum/species/zombie)
@@ -104,8 +104,10 @@
if(status_flags & GODMODE)
return
if(stat != DEAD)
if(health < 1)
if(health <= 0)
death()
else
stat = CONSCIOUS
/mob/living/simple_animal/blind_eyes()
return
@@ -466,17 +468,22 @@
/mob/living/simple_animal/update_fire()
return
/mob/living/simple_animal/IgniteMob()
return
/mob/living/simple_animal/ExtinguishMob()
return
/mob/living/simple_animal/revive()
/mob/living/simple_animal/revive(full_heal = 0, admin_revive = 0)
if(..()) //successfully ressuscitated from death
icon = initial(icon)
icon_state = icon_living
density = initial(density)
. = 1
/mob/living/simple_animal/fully_heal(admin_revive = 0)
health = maxHealth
icon = initial(icon)
icon_state = icon_living
density = initial(density)
update_canmove()
..()
/mob/living/simple_animal/proc/make_babies() // <3 <3 <3
@@ -11,7 +11,7 @@
maxHealth = 150
var/datum/action/innate/slime/evolve/E = new
E.Grant(src)
revive()
revive(full_heal = 1)
regenerate_icons()
number = rand(1, 1000)
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
+1 -1
View File
@@ -86,7 +86,7 @@
max_charges = 10 //10, 5, 5, 4
/obj/item/weapon/gun/magic/wand/resurrection/zap_self(mob/living/user)
user.revive()
user.revive(full_heal = 1)
user << "<span class='notice'>You feel great!</span>"
charges--
..()
+8 -11
View File
@@ -55,18 +55,15 @@
/obj/item/projectile/magic/resurrection/on_hit(mob/living/carbon/target)
. = ..()
if(ismob(target))
var/old_stat = target.stat
target.revive()
target.suiciding = 0
if(!target.ckey)
for(var/mob/dead/observer/ghost in player_list)
if(target.real_name == ghost.real_name)
ghost.reenter_corpse()
break
if(old_stat != DEAD)
target << "<span class='notice'>You feel great!</span>"
else
if(target.revive(full_heal = 1))
if(!target.ckey)
for(var/mob/dead/observer/ghost in player_list)
if(target.real_name == ghost.real_name)
ghost.reenter_corpse()
break
target << "<span class='notice'>You rise with a start, you're alive!!!</span>"
else if(target.stat != DEAD)
target << "<span class='notice'>You feel great!</span>"
/obj/item/projectile/magic/teleport
name = "bolt of teleportation"
@@ -707,13 +707,10 @@
spawn (100) //so the ghost has time to re-enter
return
else
M.adjustOxyLoss(-20)
M.adjustToxLoss(-20)
if(M.health > config.health_threshold_dead && M.getorgan(/obj/item/organ/internal/brain))
M.stat = UNCONSCIOUS
M.blind_eyes(1)
dead_mob_list -= M
living_mob_list |= list(M)
M.adjustOxyLoss(-20, 0)
M.adjustToxLoss(-20, 0)
M.updatehealth()
if(M.revive())
M.emote("gasp")
add_logs(M, M, "revived", src)
..()