Added stasis bag.

This stops all life functions of a patient for a while. It can only be used once, and inflicts low amounts of brain and clone damage over time.
This commit is contained in:
cib
2013-05-19 07:48:43 +02:00
parent ac8b64734b
commit f5b0b52b6c
3 changed files with 74 additions and 14 deletions
+32 -14
View File
@@ -28,6 +28,7 @@
var/pressure_alert = 0
var/prev_gender = null // Debug for plural genders
var/temperature_alert = 0
var/in_stasis = 0
/mob/living/carbon/human/Life()
@@ -59,8 +60,11 @@
life_tick++
var/datum/gas_mixture/environment = loc.return_air()
in_stasis = istype(loc, /obj/structure/closet/body_bag/cryobag) && loc:opened == 0
if(in_stasis) loc:used++
//No need to update all of these procs if the guy is dead.
if(stat != DEAD)
if(stat != DEAD && !in_stasis)
if(air_master.current_cycle%4==2 || failed_last_breath) //First, resolve location and get a breath
breathe() //Only try to take a breath every 4 ticks, unless suffocating
@@ -86,18 +90,20 @@
handle_virus_updates()
//stuff in the stomach
handle_stomach()
handle_shock()
handle_pain()
handle_medical_side_effects()
handle_stasis_bag()
//Handle temperature/pressure differences between body and environment
handle_environment(environment)
//stuff in the stomach
handle_stomach()
handle_shock()
handle_pain()
handle_medical_side_effects()
//Status updates, death etc.
handle_regular_status_updates() //TODO: optimise ~Carn
update_canmove()
@@ -196,6 +202,16 @@
src << "\red Your legs won't respond properly, you fall down."
lying = 1
proc/handle_stasis_bag()
// Handle side effects from stasis bag
if(in_stasis)
// First off, there's no oxygen supply, so the mob will slowly take brain damage
adjustBrainLoss(0.1)
// Next, the method to induce stasis has some adverse side-effects, manifesting
// as cloneloss
adjustCloneLoss(0.1)
proc/handle_mutations_and_radiation()
if(getFireLoss())
if((COLD_RESISTANCE in mutations) || (prob(1)))
@@ -787,8 +803,8 @@
var/total_plasmaloss = 0
for(var/obj/item/I in src)
if(I.contaminated)
total_plasmaloss += vsc.plc.CONTAMINATION_LOSS
if(status_flags & GODMODE) return 0 //godmode
total_plasmaloss += vsc.plc.CONTAMINATION_LOSS
if(status_flags & GODMODE) return 0 //godmode
adjustToxLoss(total_plasmaloss)
// if(dna && dna.mutantrace == "plant") //couldn't think of a better place to place it, since it handles nutrition -- Urist
@@ -886,8 +902,10 @@
silent = 0
else //ALIVE. LIGHTS ARE ON
updatehealth() //TODO
handle_organs()
handle_blood()
if(!in_stasis)
handle_organs()
handle_blood()
if(health <= config.health_threshold_dead || brain_op_stage == 4.0)
death()
blinded = 1