diff --git a/code/modules/mob/living/carbon/human/hud.dm b/code/modules/mob/living/carbon/human/hud.dm index a4e3be1f62c..2804cf016d7 100644 --- a/code/modules/mob/living/carbon/human/hud.dm +++ b/code/modules/mob/living/carbon/human/hud.dm @@ -1,7 +1,5 @@ /obj/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi') - //ui_style='icons/mob/screen1_old.dmi' //Overriding the parameter. Only this UI style is acceptable with the 'sleek' layout. - src.adding = list( ) src.other = list( ) src.vimpaired = list( ) @@ -554,9 +552,17 @@ mymob.blind.icon_state = "blackimageoverlay" mymob.blind.name = " " mymob.blind.screen_loc = "1,1" - + mymob.blind.mouse_opacity = 0 mymob.blind.layer = 0 + mymob.damageoverlay = new /obj/screen( null ) + mymob.damageoverlay.icon = 'icons/mob/screen1_full.dmi' + mymob.damageoverlay.icon_state = "oxydamageoverlay0" + mymob.damageoverlay.name = "dmg" + mymob.damageoverlay.screen_loc = "1,1" + mymob.damageoverlay.mouse_opacity = 0 + mymob.damageoverlay.layer = 17 + mymob.flash = new /obj/screen( null ) mymob.flash.icon = ui_style mymob.flash.icon_state = "blank" @@ -680,7 +686,7 @@ mymob.client.screen = null //, mymob.i_select, mymob.m_select - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) + mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) mymob.client.screen += src.adding + src.hotkeybuttons inventory_shown = 0; diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 0143f418e69..8eb2963bac6 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -47,4 +47,6 @@ var/list/organs = list() - var/miming = null //Toggle for the mime's abilities. \ No newline at end of file + var/miming = null //Toggle for the mime's abilities. + + 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. \ 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 d310e7f3d8a..6b127489dc1 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1,7 +1,8 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 -#define HUMAN_MAX_OXYLOSS 12 //Defines how much oxyloss humans can get per tick. No air applies this value. -#define HUMAN_CRIT_MAX_OXYLOSS ( (4 * last_tick_duration) /3) //The amount of damage you'll get when in critical condition. We want this to be a 5 minute deal = 300s. There are 100HP to get through, so (1/3)*last_tick_duration per second. Breaths however only happen every 4 ticks. +//NOTE: Breathing happens once per FOUR TICKS, unless the last breath fails. In which case it happens once per ONE TICK! So oxyloss healing is done once per 4 ticks while oxyloss damage is applied once per tick! +#define HUMAN_MAX_OXYLOSS 3 //Defines how much oxyloss humans can get per tick. A tile with no air at all (such as space) applies this value, otherwise it's a percentage of it. +#define HUMAN_CRIT_MAX_OXYLOSS ( (last_tick_duration) /3) //The amount of damage you'll get when in critical condition. We want this to be a 5 minute deal = 300s. There are 100HP to get through, so (1/3)*last_tick_duration per second. Breaths however only happen every 4 ticks. /mob/living/carbon/human var/oxygen_alert = 0 @@ -31,7 +32,7 @@ //No need to update all of these procs if the guy is dead. if(stat != DEAD) - if(air_master.current_cycle%4==2) //First, resolve location and get a breath + if(air_master.current_cycle%4==2 || failed_last_breath) //First, resolve location and get a breath spawn(0) breathe() //Only try to take a breath every 4 ticks, unless suffocating else //Still give containing object the chance to interact @@ -323,8 +324,10 @@ return if(health > 0) adjustOxyLoss(HUMAN_MAX_OXYLOSS) + failed_last_breath = 1 else adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS) + failed_last_breath = 1 oxygen_alert = max(oxygen_alert, 1) @@ -353,9 +356,11 @@ if(O2_pp > 0) var/ratio = safe_oxygen_min/O2_pp adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!) + failed_last_breath = 1 oxygen_used = breath.oxygen*ratio/6 else adjustOxyLoss(HUMAN_MAX_OXYLOSS) + failed_last_breath = 1 oxygen_alert = max(oxygen_alert, 1) /*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose) spawn(0) emote("cough") @@ -364,6 +369,7 @@ oxygen_used = breath.oxygen*ratio/6 oxygen_alert = max(oxygen_alert, 1)*/ else // We're in safe limits + failed_last_breath = 0 adjustOxyLoss(-5) oxygen_used = breath.oxygen/6 oxygen_alert = 0 @@ -371,6 +377,7 @@ breath.oxygen -= oxygen_used breath.carbon_dioxide += oxygen_used + //CO2 does not affect failed_last_breath. So if there was enough oxygen in the air but too much co2, this will hurt you, but only once per 4 ticks, instead of once per tick. if(CO2_pp > safe_co2_max) if(!co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so. co2overloadtime = world.time @@ -803,6 +810,25 @@ update_action_buttons() + if(src.oxyloss) + switch(oxyloss) + if(0 to 10) + damageoverlay.icon_state = "oxydamageoverlay0" + if(10 to 20) + damageoverlay.icon_state = "oxydamageoverlay1" + if(20 to 25) + damageoverlay.icon_state = "oxydamageoverlay2" + if(25 to 30) + damageoverlay.icon_state = "oxydamageoverlay3" + if(30 to 35) + damageoverlay.icon_state = "oxydamageoverlay4" + if(35 to 40) + damageoverlay.icon_state = "oxydamageoverlay5" + if(40 to 45) + damageoverlay.icon_state = "oxydamageoverlay6" + if(45 to INFINITY) + damageoverlay.icon_state = "oxydamageoverlay7" + if( stat == DEAD ) sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) see_in_dark = 8 diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 69b0a910321..da24a65fdd9 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -21,4 +21,4 @@ var/last_special = 0 //Used by the resist verb, likely used to prevent players from bypassing next_move by logging in/out. //Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects. - var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas. \ No newline at end of file + var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas. diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index e06d6a3fa2d..391d985969c 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -29,6 +29,7 @@ var/obj/screen/throw_icon = null var/obj/screen/nutrition_icon = null var/obj/screen/pressure = null + var/obj/screen/damageoverlay = null var/total_luminosity = 0 //This controls luminosity for mobs, when you pick up lights and such this is edited. If you want the mob to use lights it must update its lum in its life proc or such. Note clamp this value around 7 or such to prevent massive light lag. var/last_luminosity = 0 diff --git a/icons/mob/screen1_full.dmi b/icons/mob/screen1_full.dmi index 9f913dafb61..5b7e485b104 100644 Binary files a/icons/mob/screen1_full.dmi and b/icons/mob/screen1_full.dmi differ