Allows 'escaping' sleepers, among other things

Added some helper procs for stasis things, and also allows using grabs on sleepers like the advanced scanner because that inconsistency between the machines was bothering me.
This commit is contained in:
Arokha Sieyes
2017-04-29 18:59:28 -04:00
parent 418db00c19
commit 58fec31ea4
4 changed files with 52 additions and 11 deletions
@@ -159,6 +159,20 @@
else
in_stasis = amount
/mob/living/carbon/human/proc/getStasis()
if((species.flags & NO_SCAN) || isSynthetic())
return 0
return in_stasis
//This determines if, RIGHT NOW, the life() tick is being skipped due to stasis
/mob/living/carbon/human/proc/inStasisNow()
var/stasisValue = getStasis()
if(stasisValue && (life_tick % stasisValue))
return 1
return 0
/mob/living/carbon/human/getCloneLoss()
if((species.flags & NO_SCAN) || isSynthetic())
cloneloss = 0
+9 -8
View File
@@ -62,11 +62,12 @@
voice = GetVoice()
//No need to update all of these procs if the guy is dead.
if(stat != DEAD && (!in_stasis || life_tick % in_stasis == 1))
if(in_stasis > 2)
Sleeping(10)
var/stasis = inStasisNow()
if(getStasis() > 2)
Sleeping(20)
//No need to update all of these procs if the guy is dead.
if(stat != DEAD && !stasis)
//Updates the number of stored chemicals for powers
handle_changeling()
@@ -99,7 +100,7 @@
return 1
/mob/living/carbon/human/breathe()
if(!in_stasis || life_tick % in_stasis == 1)
if(!inStasisNow())
..()
// Calculate how vulnerable the human is to under- and overpressure.
@@ -209,7 +210,7 @@
/mob/living/carbon/human/handle_mutations_and_radiation()
if(in_stasis && life_tick % in_stasis != 1)
if(inStasisNow())
return
if(getFireLoss())
@@ -791,7 +792,7 @@
/mob/living/carbon/human/handle_chemicals_in_body()
if(in_stasis && life_tick % in_stasis != 1)
if(inStasisNow())
return
if(reagents)
@@ -1341,7 +1342,7 @@
if(!druggy && !seer) see_invisible = SEE_INVISIBLE_LIVING
/mob/living/carbon/human/handle_random_events()
if(in_stasis && life_tick % in_stasis != 1)
if(inStasisNow())
return
// Puke if toxloss is too high
+1 -1
View File
@@ -37,7 +37,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5
// Takes care blood loss and regeneration
/mob/living/carbon/human/handle_blood()
if(in_stasis)
if(inStasisNow())
return
if(!should_have_organ(O_HEART))