Files
VOREStation/code/game/gamemodes/changeling/powers/revive.dm
T
ShadowLarkens f905cfc020 Ported /tg/ style screen alerts, replacing the hunger icon with them
This adds throw_alert() and /obj/screen/alert, a system that allows you
to do custom hud alerts for any variety of things from "You're too
cold!" to mecha status indicators for the pilot.

There's quite a few things that actually got replaced; the
fire/oxy/tox/co2 alerts are all now just alerts, as is nutrition. The
xenochimera feral indicator would probably be a good candidate for
conversion, but I didn't touch it in this PR. There's also a number of
new alerts, such as blindness, highness, legcuffed, buckled, handcuffed,
and probably some more I missed; read code/_onclick/hud/alert.dm and see
for yourself!

Additionally, a number of tweaks have been done to resisting code, to
make it so that there's an indicator when you're buckled or handcuffed,
and can just click the alert to start resisting. This includes a
refactor that combines the logic for lockers, holders, micros
escaping from shoes, and struggling in a gut all into one proc, called
container_resist(). This means that vore bellies actually no longer need
the resist override, but it's been left in place just in case someone
finds something else they want to use it for.

Also, the health and internals indicator got moved down one tile each.
Needed room for the alerts. If we add the oxygen tank action buttons
from /tg/ and remove the internals indicator, the health indicator can
go back where it was originally.
2020-05-13 19:36:01 -07:00

110 lines
3.1 KiB
Plaintext

//Revive from revival stasis
/mob/proc/changeling_revive()
set category = "Changeling"
set name = "Revive"
set desc = "We are ready to revive ourselves on command."
var/datum/changeling/changeling = changeling_power(0,0,100,DEAD)
if(!changeling)
return 0
if(changeling.max_geneticpoints < 0) //Absorbed by another ling
to_chat(src, "<span class='danger'>You have no genomes, not even your own, and cannot revive.</span>")
return 0
if(src.stat == DEAD)
dead_mob_list -= src
living_mob_list += src
var/mob/living/carbon/C = src
C.tod = null
C.setToxLoss(0)
C.setOxyLoss(0)
C.setCloneLoss(0)
C.SetParalysis(0)
C.SetStunned(0)
C.SetWeakened(0)
C.radiation = 0
C.heal_overall_damage(C.getBruteLoss(), C.getFireLoss())
C.reagents.clear_reagents()
if(ishuman(C))
var/mob/living/carbon/human/H = src
H.species.create_organs(H)
H.restore_all_organs(ignore_prosthetic_prefs=1) //Covers things like fractures and other things not covered by the above.
H.restore_blood()
H.mutations.Remove(HUSK)
H.status_flags &= ~DISFIGURED
H.update_icons_body()
for(var/limb in H.organs_by_name)
var/obj/item/organ/external/current_limb = H.organs_by_name[limb]
if(current_limb)
current_limb.relocate()
current_limb.open = 0
BITSET(H.hud_updateflag, HEALTH_HUD)
BITSET(H.hud_updateflag, STATUS_HUD)
BITSET(H.hud_updateflag, LIFE_HUD)
if(H.handcuffed)
var/obj/item/weapon/W = H.handcuffed
H.handcuffed = null
if(H.buckled && H.buckled.buckle_require_restraints)
H.buckled.unbuckle_mob()
H.update_handcuffed()
if (H.client)
H.client.screen -= W
W.forceMove(H.loc)
W.dropped(H)
if(W)
W.layer = initial(W.layer)
if(H.legcuffed)
var/obj/item/weapon/W = H.legcuffed
H.legcuffed = null
H.update_inv_legcuffed()
if(H.client)
H.client.screen -= W
W.forceMove(H.loc)
W.dropped(H)
if(W)
W.layer = initial(W.layer)
if(istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket))
var/obj/item/clothing/suit/straight_jacket/SJ = H.wear_suit
SJ.forceMove(H.loc)
SJ.dropped(H)
H.wear_suit = null
C.halloss = 0
C.shock_stage = 0 //Pain
to_chat(C, "<span class='notice'>We have regenerated.</span>")
C.update_canmove()
C.mind.changeling.purchased_powers -= C
feedback_add_details("changeling_powers","CR")
C.set_stat(CONSCIOUS)
C.forbid_seeing_deadchat = FALSE
C.timeofdeath = null
verbs.Remove(/mob/proc/changeling_revive)
// re-add our changeling powers
C.make_changeling()
return 1
//Revive from revival stasis, but one level removed, as the tab refuses to update. Placed in its own tab to avoid hyper-exploding the original tab through the same name being used.
/obj/changeling_revive_holder
name = "strange object"
desc = "Please report this object's existence to the dev team! You shouldn't see it."
mouse_opacity = FALSE
alpha = 1
/obj/changeling_revive_holder/verb/ling_revive()
set src = usr.contents
set category = "Regenerate"
set name = "Revive"
set desc = "We are ready to revive ourselves on command."
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.changeling_revive()
qdel(src)