Cleans up revive related procs (#47025)

* Cleans up revive related procs

* h

* fuck

* Fixes proc arguments

* Further fixes

* Unfucks line endings
This commit is contained in:
81Denton
2019-10-23 00:16:13 +02:00
committed by Rob Bailey
parent 588346133a
commit 6b1161ecd9
44 changed files with 64 additions and 63 deletions

View File

@@ -152,7 +152,7 @@
var/mob/living/L = l
if(L.stat != DEAD && L.mind)
L.mind.transfer_to(soulowner)
soulowner.revive(TRUE, TRUE)
soulowner.revive(full_heal = TRUE, admin_revive = TRUE)
L.death(FALSE)
//Lose your claim to the throne!

View File

@@ -81,7 +81,7 @@
occupier.adjustBruteLoss(-1, 0)
occupier.updatehealth()
if(occupier.health >= 0 && occupier.stat == DEAD)
occupier.revive()
occupier.revive(full_heal = FALSE, admin_revive = FALSE)
return occupier.health < 100
/obj/machinery/computer/aifixer/process()

View File

@@ -160,7 +160,7 @@
if(!victim.client || !istype(victim))
return
to_chat(victim, "<span class='notice'>You feel great!</span>")
victim.revive(full_heal = 1, admin_revive = 1)
victim.revive(full_heal = TRUE, admin_revive = TRUE)
/obj/effect/mine/pickup/speed
name = "Yellow Orb"

View File

@@ -627,7 +627,7 @@
user.visible_message("<span class='notice'>[req_defib ? "[defib]" : "[src]"] pings: Resuscitation successful.</span>")
playsound(src, 'sound/machines/defib_success.ogg', 50, FALSE)
H.set_heartattack(FALSE)
H.revive()
H.revive(full_heal = FALSE, admin_revive = FALSE)
H.emote("gasp")
H.Jitter(100)
SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK)

View File

@@ -63,7 +63,7 @@
R.mind.grab_ghost()
playsound(loc, 'sound/voice/liveagain.ogg', 75, TRUE)
R.revive()
R.revive(full_heal = FALSE, admin_revive = FALSE)
/obj/item/borg/upgrade/disablercooler
name = "cyborg rapid disabler cooling module"

View File

@@ -131,7 +131,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
/obj/item/claymore/highlander/attack(mob/living/target, mob/living/user)
. = ..()
if(!QDELETED(target) && iscarbon(target) && target.stat == DEAD && target.mind && target.mind.special_role == "highlander")
user.fully_heal() //STEAL THE LIFE OF OUR FALLEN FOES
user.fully_heal(admin_revive = FALSE) //STEAL THE LIFE OF OUR FALLEN FOES
add_notch(user)
target.visible_message("<span class='warning'>[target] crumbles to dust beneath [user]'s blows!</span>", "<span class='userdanger'>As you fall, your body crumbles to dust!</span>")
target.dust()

View File

@@ -85,7 +85,7 @@
mind.transfer_to(body)
else
body.forceMove(T)
body.revive(1,1)
body.revive(full_heal = TRUE, admin_revive = TRUE)
mind.grab_ghost(TRUE)
body.flash_act()

View File

@@ -1130,7 +1130,7 @@
to_chat(usr, "This can only be used on instances of type /mob/living.")
return
L.revive(full_heal = 1, admin_revive = 1)
L.revive(full_heal = TRUE, admin_revive = TRUE)
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)].")

View File

@@ -537,7 +537,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(full_heal = 1, admin_revive = 1)
M.revive(full_heal = TRUE, admin_revive = TRUE)
log_admin("[key_name(usr)] healed / revived [key_name(M)]")
var/msg = "<span class='danger'>Admin [key_name_admin(usr)] healed / revived [ADMIN_LOOKUPFLW(M)]!</span>"

View File

@@ -140,7 +140,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
L.death()
new/mob/living/simple_animal/hostile/blob/blobspore(T)
else
L.fully_heal()
L.fully_heal(admin_revive = FALSE)
for(var/area/A in GLOB.sortedAreas)
if(!(A.type in GLOB.the_station_areas))

View File

@@ -33,7 +33,7 @@
if(!user || !istype(user))
return
user.cure_fakedeath("changeling")
user.revive(full_heal = TRUE)
user.revive(full_heal = TRUE, admin_revive = FALSE)
var/list/missing = user.get_missing_limbs()
missing -= BODY_ZONE_HEAD // headless changelings are funny
if(missing.len)

View File

@@ -562,7 +562,7 @@ structure_check() searches for nearby cultist structures required for the invoca
fail_invoke()
return
revives_used += SOULS_TO_REVIVE
mob_to_revive.revive(1, 1) //This does remove traits and such, but the rune might actually see some use because of it!
mob_to_revive.revive(full_heal = TRUE, admin_revive = TRUE) //This does remove traits and such, but the rune might actually see some use because of it!
mob_to_revive.grab_ghost()
if(!mob_to_revive.client || mob_to_revive.client.is_afk())
set waitfor = FALSE

View File

@@ -427,13 +427,13 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
reviveNumber += LOSS_PER_DEATH
update_hud()
if(body)
body.revive(TRUE, TRUE) //Adminrevive also recovers organs, preventing someone from resurrecting without a heart.
body.revive(full_heal = TRUE, admin_revive = TRUE) //Adminrevive also recovers organs, preventing someone from resurrecting without a heart.
if(istype(body.loc, /obj/effect/dummy/phased_mob/slaughter/))
body.forceMove(get_turf(body))//Fixes dying while jaunted leaving you permajaunted.
if(istype(body, /mob/living/carbon/true_devil))
var/mob/living/carbon/true_devil/D = body
if(D.oldform)
D.oldform.revive(1,0) // Heal the old body too, so the devil doesn't resurrect, then immediately regress into a dead body.
D.oldform.revive(full_heal = TRUE, admin_revive = FALSE) // Heal the old body too, so the devil doesn't resurrect, then immediately regress into a dead body.
if(body.stat == DEAD)
create_new_body()
else

View File

@@ -233,7 +233,7 @@
return
M.set_species(/datum/species/skeleton, icon_update=0)
M.revive(full_heal = 1, admin_revive = 1)
M.revive(full_heal = TRUE, admin_revive = TRUE)
spooky_scaries |= M
to_chat(M, "<span class='userdanger'>You have been revived by </span><B>[user.real_name]!</B>")
to_chat(M, "<span class='userdanger'>[user.p_theyre(TRUE)] your master now, assist [user.p_them()] even if it costs you your new life!</span>")

View File

@@ -273,7 +273,7 @@
if(12)
//Healing
T.visible_message("<span class='userdanger'>[user] looks very healthy!</span>")
user.revive(full_heal = 1, admin_revive = 1)
user.revive(full_heal = TRUE, admin_revive = TRUE)
if(13)
//Mad Dosh
T.visible_message("<span class='userdanger'>Mad dosh shoots out of [src]!</span>")

View File

@@ -27,7 +27,7 @@
return
if(M.stat == DEAD)
M.faction = list("neutral")
M.revive(full_heal = 1, admin_revive = 1)
M.revive(full_heal = TRUE, admin_revive = TRUE)
if(ishostile(target))
var/mob/living/simple_animal/hostile/H = M
if(malfunctioning)

View File

@@ -60,7 +60,7 @@
if(inert)
to_chat(owner, "<span class='notice'>[src] breaks down as it tries to activate.</span>")
else
owner.revive(full_heal = 1)
owner.revive(full_heal = TRUE, admin_revive = FALSE)
qdel(src)
/obj/item/organ/regenerative_core/on_life()

View File

@@ -126,7 +126,7 @@
return TRUE
to_chat(src, "<span class='danger'>You devour [victim]. Your health is fully restored.</span>")
revive(full_heal = TRUE)
revive(full_heal = TRUE, admin_revive = FALSE)
// No defib possible after laughter
victim.adjustBruteLoss(1000)

View File

@@ -717,7 +717,7 @@
new /obj/effect/decal/cleanable/ash(get_turf(src))
..()
/obj/structure/cloth_pile/proc/revive()
/obj/structure/cloth_pile/proc/revive(full_heal = FALSE, admin_revive = FALSE)
if(QDELETED(src) || QDELETED(cloth_golem)) //QDELETED also checks for null, so if no cloth golem is set this won't runtime
return
if(cloth_golem.suiciding || cloth_golem.hellbound)
@@ -1074,7 +1074,7 @@
. = ..()
C.equip_to_slot_or_del(new /obj/item/clothing/head/that (), SLOT_HEAD)
C.equip_to_slot_or_del(new /obj/item/clothing/glasses/monocle (), SLOT_GLASSES)
C.revive(full_heal = TRUE)
C.revive(full_heal = TRUE, admin_revive = FALSE)
SEND_SOUND(C, sound('sound/misc/capitialism.ogg'))
C.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock ())
@@ -1116,7 +1116,7 @@
/datum/species/golem/soviet/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
C.equip_to_slot_or_del(new /obj/item/clothing/head/ushanka (), SLOT_HEAD)
C.revive(full_heal = TRUE)
C.revive(full_heal = TRUE, admin_revive = FALSE)
SEND_SOUND(C, sound('sound/misc/Russian_Anthem_chorus.ogg'))
C.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock ())

View File

@@ -140,7 +140,7 @@
respawn_progress++
playsound(owner,'sound/effects/singlebeat.ogg',40,TRUE)
if(respawn_progress >= HEART_RESPAWN_THRESHHOLD)
owner.revive(full_heal = TRUE)
owner.revive(full_heal = TRUE, admin_revive = FALSE)
if(!(owner.dna.species.id == "shadow" || owner.dna.species.id == "nightmare"))
var/mob/living/carbon/old_owner = owner
Remove(owner, HEART_SPECIAL_SHADOWIFY)

View File

@@ -502,11 +502,11 @@
med_hud_set_health()
med_hud_set_status()
//proc used to ressuscitate a mob
//Proc used to resuscitate a mob, for full_heal see fully_heal()
/mob/living/proc/revive(full_heal = FALSE, admin_revive = FALSE)
SEND_SIGNAL(src, COMSIG_LIVING_REVIVE, full_heal, admin_revive)
if(full_heal)
fully_heal(admin_revive)
fully_heal(admin_revive = TRUE)
if(stat == DEAD && can_be_revived()) //in some cases you can't revive (e.g. no brain)
GLOB.dead_mob_list -= src
GLOB.alive_mob_list += src
@@ -517,7 +517,7 @@
update_sight()
clear_alert("not_enough_oxy")
reload_fullscreen()
. = 1
. = TRUE
if(mind)
for(var/S in mind.spell_list)
var/obj/effect/proc_holder/spell/spell = S
@@ -543,7 +543,8 @@
//proc used to completely heal a mob.
/mob/living/proc/fully_heal(admin_revive = 0)
//admin_revive = TRUE is used in other procs, for example mob/living/carbon/fully_heal()
/mob/living/proc/fully_heal(admin_revive = FALSE)
restore_blood()
setToxLoss(0, 0) //zero as second argument not automatically call updatehealth().
setOxyLoss(0, 0)
@@ -574,9 +575,9 @@
//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
. = TRUE
if(health <= HEALTH_THRESHOLD_DEAD)
return 0
return FALSE
/mob/living/proc/update_damage_overlays()
return
@@ -593,7 +594,7 @@
if (!buckled.anchored)
return buckled.Move(newloc, direct)
else
return 0
return FALSE
var/old_direction = dir
var/turf/T = loc

View File

@@ -922,7 +922,7 @@
else
clear_fullscreen("remote_view", 0)
/mob/living/silicon/ai/revive(full_heal = 0, admin_revive = 0)
/mob/living/silicon/ai/revive(full_heal = FALSE, admin_revive = FALSE)
. = ..()
if(.) //successfully ressuscitated from death
set_core_display_icon(display_icon_override)

View File

@@ -960,7 +960,7 @@
diag_hud_set_aishell()
update_health_hud()
/mob/living/silicon/robot/revive(full_heal = 0, admin_revive = 0)
/mob/living/silicon/robot/revive(full_heal = FALSE, admin_revive = FALSE)
if(..()) //successfully ressuscitated from death
if(!QDELETED(builtInCamera) && !wires.is_cut(WIRE_CAMERA))
builtInCamera.toggle_cam(src,0)
@@ -968,7 +968,7 @@
if(admin_revive)
locked = TRUE
notify_ai(NEW_BORG)
. = 1
. = TRUE
/mob/living/silicon/robot/fully_replace_character_name(oldname, newname)
..()

View File

@@ -945,10 +945,10 @@ Pass a positive integer as an argument to override a bot's default speed.
. = ..()
bot_reset()
/mob/living/simple_animal/bot/revive(full_heal = 0, admin_revive = 0)
/mob/living/simple_animal/bot/revive(full_heal = FALSE, admin_revive = FALSE)
if(..())
update_icon()
. = 1
. = TRUE
/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.

View File

@@ -68,7 +68,7 @@
return
user.visible_message("<span class='notice'>[user] begins to reactivate [src].</span>", "<span class='notice'>You begin to reactivate [src]...</span>")
if(do_after(user, 30, 1, target = src))
revive(full_heal = 1)
revive(full_heal = TRUE, admin_revive = FALSE)
user.visible_message("<span class='notice'>[user] reactivates [src]!</span>", "<span class='notice'>You reactivate [src].</span>")
alert_drones(DRONE_NET_CONNECT)
if(G)

View File

@@ -48,7 +48,7 @@
QDEL_NULL(pcollar)
return ..()
/mob/living/simple_animal/pet/revive(full_heal = 0, admin_revive = 0)
/mob/living/simple_animal/pet/revive(full_heal = FALSE, admin_revive = FALSE)
. = ..()
if(.)
if(collar_type)

View File

@@ -103,7 +103,7 @@
return
add_dead_carp_overlay()
/mob/living/simple_animal/hostile/carp/revive(full_heal = 0, admin_revive = 0)
/mob/living/simple_animal/hostile/carp/revive(full_heal = FALSE, admin_revive = FALSE)
. = ..()
if(.)
regenerate_icons()

View File

@@ -588,7 +588,7 @@ Difficulty: Very Hard
H.set_species(/datum/species/shadow, 1)
H.regenerate_limbs()
H.regenerate_organs()
H.revive(1,0)
H.revive(full_heal = TRUE, admin_revive = FALSE)
ADD_TRAIT(H, TRAIT_BADDNA, MAGIC_TRAIT) //Free revives, but significantly limits your options for reviving except via the crystal
H.grab_ghost(force = TRUE)

View File

@@ -49,7 +49,7 @@
return
icon_state = pre_attack_icon
/mob/living/simple_animal/hostile/asteroid/goliath/revive(full_heal = 0, admin_revive = 0)
/mob/living/simple_animal/hostile/asteroid/goliath/revive(full_heal = FALSE, admin_revive = FALSE)
if(..())
anchored = TRUE
. = 1

View File

@@ -112,7 +112,7 @@
return TRUE
return ..()
/mob/living/simple_animal/hostile/mushroom/revive(full_heal = 0, admin_revive = 0)
/mob/living/simple_animal/hostile/mushroom/revive(full_heal = FALSE, admin_revive = FALSE)
if(..())
icon_state = "mushroom_color"
UpdateMushroomCap()
@@ -134,7 +134,7 @@
/mob/living/simple_animal/hostile/mushroom/proc/Recover()
visible_message("<span class='notice'>[src] slowly begins to recover.</span>")
faint_ticker = 0
revive(full_heal = 1)
revive(full_heal = TRUE, admin_revive = FALSE)
UpdateMushroomCap()
recovery_cooldown = 1
addtimer(CALLBACK(src, .proc/recovery_recharge), 300)

View File

@@ -402,21 +402,21 @@
/mob/living/simple_animal/ExtinguishMob()
return
/mob/living/simple_animal/revive(full_heal = 0, admin_revive = 0)
/mob/living/simple_animal/revive(full_heal = FALSE, admin_revive = FALSE)
if(..()) //successfully ressuscitated from death
icon = initial(icon)
icon_state = icon_living
density = initial(density)
mobility_flags = MOBILITY_FLAGS_DEFAULT
update_mobility()
. = 1
. = TRUE
setMovetype(initial(movement_type))
/mob/living/simple_animal/proc/make_babies() // <3 <3 <3
if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || !SSticker.IsRoundInProgress())
return
next_scan_time = world.time + 400
var/alone = 1
var/alone = TRUE
var/mob/living/simple_animal/partner
var/children = 0
for(var/mob/M in view(7, src))

View File

@@ -13,7 +13,7 @@
R.Remove(src)
var/datum/action/innate/slime/evolve/E = new
E.Grant(src)
revive(full_heal = 1)
revive(full_heal = TRUE, admin_revive = FALSE)
regenerate_icons()
update_name()
return

View File

@@ -80,7 +80,7 @@
A.adjustBruteLoss(-1, 0)
A.updatehealth()
if(A.health >= 0 && A.stat == DEAD)
A.revive()
A.revive(full_heal = FALSE, admin_revive = FALSE)
// Finished restoring
if(A.health >= 100)
ai_slot.locked = FALSE
@@ -119,4 +119,4 @@
/datum/computer_file/program/aidiag/kill_program(forced)
restoring = FALSE
return ..(forced)
return ..(forced)

View File

@@ -234,7 +234,7 @@
else
response = tgalert(target.current, "A devil is offering you another chance at life, at the price of your soul, do you accept?", "Infernal Resurrection", "Yes", "No", "Never for this round", 0, 200)
if(response == "Yes")
H.revive(1,0)
H.revive(full_heal = TRUE, admin_revive = FALSE)
log_combat(user, H, "infernally revived via contract")
user.visible_message("<span class='notice'>With a sudden blaze, [H] stands back up.</span>")
H.fakefire()

View File

@@ -74,13 +74,13 @@
if(isliving(user))
var/mob/living/L = user
if(L.mob_biotypes & MOB_UNDEAD) //negative energy heals the undead
user.revive(full_heal = TRUE)
user.revive(full_heal = TRUE, admin_revive = FALSE)
to_chat(user, "<span class='notice'>You feel great!</span>")
return
to_chat(user, "<span class='warning'>You irradiate yourself with pure negative energy! \
[pick("Do not pass go. Do not collect 200 zorkmids.","You feel more confident in your spell casting skills.","You Die...","Do you want your possessions identified?")]\
</span>")
user.death(0)
user.death(FALSE)
/obj/item/gun/magic/wand/death/debug
desc = "In some obscure circles, this is known as the 'cloning tester's friend'."
@@ -116,7 +116,7 @@
</span>")
user.death(0)
return
user.revive(full_heal = TRUE)
user.revive(full_heal = TRUE, admin_revive = FALSE)
to_chat(user, "<span class='notice'>You feel great!</span>")
/obj/item/gun/magic/wand/resurrection/debug //for testing

View File

@@ -23,7 +23,7 @@
if(L.mob_biotypes & MOB_UNDEAD) //negative energy heals the undead
if(L.hellbound && L.stat == DEAD)
return BULLET_ACT_BLOCK
if(L.revive(full_heal = TRUE))
if(L.revive(full_heal = TRUE, admin_revive = FALSE))
L.grab_ghost(force = TRUE) // even suicides
to_chat(L, "<span class='notice'>You rise with a start, you're undead!!!</span>")
else if(L.stat != DEAD)
@@ -51,7 +51,7 @@
else
if(target.hellbound && target.stat == DEAD)
return BULLET_ACT_BLOCK
if(target.revive(full_heal = TRUE))
if(target.revive(full_heal = TRUE, admin_revive = FALSE))
target.grab_ghost(force = TRUE) // even suicides
to_chat(target, "<span class='notice'>You rise with a start, you're alive!!!</span>")
else if(target.stat != DEAD)

View File

@@ -57,7 +57,7 @@
else //VICTORY ROYALE
to_chat(M, "<span class='hierophant'>You win, and the malevolent spirits fade away as well as your wounds.</span>")
SSmedals.UnlockMedal(MEDAL_HELBITALJANKEN,M.client)
M.revive(TRUE)
M.revive(full_heal = TRUE, admin_revive = FALSE)
M.reagents.del_reagent(type)
return

View File

@@ -731,7 +731,7 @@
M.adjustOxyLoss(-20, 0)
M.adjustToxLoss(-20, 0)
M.updatehealth()
if(M.revive())
if(M.revive(full_heal = FALSE, admin_revive = FALSE))
M.emote("gasp")
log_combat(M, M, "revived", src)
..()

View File

@@ -248,7 +248,7 @@
if(check_revivable())
playsound(C, 'sound/machines/defib_success.ogg', 50, FALSE)
C.set_heartattack(FALSE)
C.revive()
C.revive(full_heal = FALSE, admin_revive = FALSE)
C.emote("gasp")
C.Jitter(100)
SEND_SIGNAL(C, COMSIG_LIVING_MINOR_SHOCK)

View File

@@ -186,7 +186,7 @@ Slimecrossing Potions
return
if(M.maxHealth <= 0)
to_chat(user, "<span class='warning'>The slime is too unstable to return!</span>")
M.revive(full_heal = 1)
M.revive(full_heal = TRUE, admin_revive = FALSE)
M.stat = CONSCIOUS
M.visible_message("<span class='notice'>[M] is filled with renewed vigor and blinks awake!</span>")
M.maxHealth -= 10 //Revival isn't healthy.

View File

@@ -29,7 +29,7 @@ Regenerative extracts:
user.visible_message("<span class='notice'>[user] crushes the [src] over [user.p_them()]self, the milky goo quickly regenerating all of [user.p_their()] injuries!</span>",
"<span class='notice'>You squeeze the [src], and it bursts in your hand, splashing you with milky goo which quickly regenerates your injuries!</span>")
core_effect_before(H, user)
H.revive(full_heal = 1)
H.revive(full_heal = TRUE, admin_revive = FALSE)
core_effect(H, user)
playsound(target, 'sound/effects/splat.ogg', 40, TRUE)
qdel(src)
@@ -258,7 +258,7 @@ Regenerative extracts:
if(target == user)
return
var/mob/living/U = user
U.revive(full_heal = 1)
U.revive(full_heal = TRUE, admin_revive = FALSE)
to_chat(U, "<span class='notice'>Some of the milky goo sprays onto you, as well!</span>")
/obj/item/slimecross/regenerative/adamantine

View File

@@ -157,7 +157,7 @@
if(death)
stored.death()
else if(source.convert_damage)
stored.revive(full_heal = TRUE)
stored.revive(full_heal = TRUE, admin_revive = FALSE)
var/damage_percent = (shape.maxHealth - shape.health)/shape.maxHealth;
var/damapply = stored.maxHealth * damage_percent

View File

@@ -64,7 +64,7 @@
playsound(get_turf(target), 'sound/magic/lightningbolt.ogg', 50, TRUE)
target.adjustOxyLoss(-50, 0)
target.updatehealth()
if(target.revive())
if(target.revive(full_heal = FALSE, admin_revive = FALSE))
target.visible_message("<span class='notice'>...[target] wakes up, alive and aware!</span>")
target.emote("gasp")
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 50, 199) //MAD SCIENCE

View File

@@ -84,7 +84,7 @@
owner.setOxyLoss(0, 0)
owner.heal_overall_damage(INFINITY, INFINITY, INFINITY, null, TRUE)
if(!owner.revive())
if(!owner.revive(full_heal = FALSE, admin_revive = FALSE))
return
owner.grab_ghost()