diff --git a/baystation12.dme b/baystation12.dme index e12a801c63..92d393a37e 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -15,6 +15,7 @@ #include "code\names.dm" #include "code\stylesheet.dm" #include "code\world.dm" +#include "code\__defines\_compile_options.dm" #include "code\__defines\admin.dm" #include "code\__defines\atmos.dm" #include "code\__defines\chemistry.dm" @@ -1145,6 +1146,7 @@ #include "code\modules\mob\language\synthetic.dm" #include "code\modules\mob\living\damage_procs.dm" #include "code\modules\mob\living\default_language.dm" +#include "code\modules\mob\living\life.dm" #include "code\modules\mob\living\living.dm" #include "code\modules\mob\living\living_defense.dm" #include "code\modules\mob\living\living_defines.dm" diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index ee8d23daf5..87a72eb6f3 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -1,3 +1,6 @@ +/mob/living/carbon/brain/handle_breathing() + return + /mob/living/carbon/brain/Life() set invisibility = 0 set background = 1 @@ -31,7 +34,6 @@ if(client) handle_regular_hud_updates() - /mob/living/carbon/brain/proc/handle_mutations_and_radiation() if (radiation) if (radiation > 100) diff --git a/code/modules/mob/living/carbon/breathe.dm b/code/modules/mob/living/carbon/breathe.dm index 62f14da499..dc23b57094 100644 --- a/code/modules/mob/living/carbon/breathe.dm +++ b/code/modules/mob/living/carbon/breathe.dm @@ -1,5 +1,10 @@ //Common breathing procs +//Start of a breath chain, calls breathe() +/mob/living/carbon/handle_breathing() + if(air_master.current_cycle%4==2 || failed_last_breath || (health < config.health_threshold_crit)) //First, resolve location and get a breath + breathe() + /mob/living/carbon/proc/breathe() //if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return if(species && (species.flags & NO_BREATHE)) return diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 156d9aeb81..8b308e79ae 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -946,7 +946,6 @@ V.cure(src) losebreath = 0 - failed_last_breath = 0 //So mobs that died of oxyloss don't revive and have perpetual out of breath. ..() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 4546fab050..8d4ca440fc 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -71,8 +71,6 @@ var/miming = null //Toggle for the mime's abilities. var/special_voice = "" // For changing our voice. Used by a symptom. - var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks. - var/last_dam = -1 //Used for determining if we need to process all organs or just some or even none. var/list/bad_external_organs = list()// organs we check until they are good. diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 33877037f1..7717a912d6 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -36,12 +36,10 @@ /mob/living/carbon/human/Life() set invisibility = 0 - set background = 1 + set background = BACKGROUND_ENABLED - if (transforming) return - if(!loc) return // Fixing a null error that occurs when the mob isn't found in the world -- TLE - - ..() + if (transforming) + return //Apparently, the person who wrote this code designed it so that //blinded get reset each cycle and then get activated later in the @@ -65,9 +63,6 @@ //No need to update all of these procs if the guy is dead. if(stat != DEAD && !in_stasis) - if(air_master.current_cycle%4==2 || failed_last_breath || (health < config.health_threshold_crit)) //First, resolve location and get a breath - breathe() //Only try to take a breath every 4 ticks, unless suffocating - //Updates the number of stored chemicals for powers handle_changeling() diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 948490e0af..ef2d88481f 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -9,6 +9,12 @@ var/datum/gas_mixture/environment = loc.return_air() if(stat != DEAD) + //Breathing, if applicable + handle_breathing() + . = 1 return . + +/mob/living/proc/handle_breathing() + return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 38f1bca254..af99441108 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -453,6 +453,9 @@ default behaviour is: BITSET(hud_updateflag, HEALTH_HUD) BITSET(hud_updateflag, STATUS_HUD) BITSET(hud_updateflag, LIFE_HUD) + + failed_last_breath = 0 //So mobs that died of oxyloss don't revive and have perpetual out of breath. + return /mob/living/proc/UpdateDamageIcon() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 284afa69a4..bc441e665f 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -43,3 +43,6 @@ var/on_fire = 0 //The "Are we on fire?" var var/fire_stacks + var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks. + +