diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index 1c6fe70e8c0..ba63563d7c5 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -84,3 +84,45 @@ icon_state = icon_closed else icon_state = icon_opened + + +/obj/item/bodybag/cryobag + name = "stasis bag" + desc = "A folded, non-reusable bag designed for the preservation of an occupant's brain by stasis." + icon = 'icons/obj/cryobag.dmi' + icon_state = "bodybag_folded" + + + attack_self(mob/user) + var/obj/structure/closet/body_bag/cryobag/R = new /obj/structure/closet/body_bag/cryobag(user.loc) + R.add_fingerprint(user) + del(src) + + + +/obj/structure/closet/body_bag/cryobag + name = "stasis bag" + desc = "A non-reusable plastic bag designed for the preservation of an occupant's brain by stasis." + icon = 'icons/obj/cryobag.dmi' + icon_state = "bodybag_closed" + icon_closed = "bodybag_closed" + icon_opened = "bodybag_open" + density = 0 + + var/used = 0 + + open() + . = ..() + if(used) + var/obj/item/O = new/obj/item(src.loc) + O.name = "used stasis bag" + O.icon = src.icon + O.icon_state = "bodybag_used" + O.desc = "Pretty useless now.." + del(src) + + MouseDrop(over_object, src_location, over_location) + if((over_object == usr && (in_range(src, usr) || usr.contents.Find(src)))) + if(!ishuman(usr)) return + usr << "\red You can't fold that up anymore.." + ..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 5221d779791..36b039dc89b 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -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 diff --git a/icons/obj/cryobag.dmi b/icons/obj/cryobag.dmi index 116a2c44d16..fe543fad642 100644 Binary files a/icons/obj/cryobag.dmi and b/icons/obj/cryobag.dmi differ