diff --git a/code/defines/mob/mob.dm b/code/defines/mob/mob.dm index 5c258eb6154..742f0690f8b 100644 --- a/code/defines/mob/mob.dm +++ b/code/defines/mob/mob.dm @@ -48,6 +48,7 @@ var/obj/screen/healths = null var/obj/screen/throw_icon = null var/obj/screen/nutrition_icon = null + var/obj/screen/pressure = 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/code/game/hud.dm b/code/game/hud.dm index 4c2433642bf..c7dadb4eede 100644 --- a/code/game/hud.dm +++ b/code/game/hud.dm @@ -21,6 +21,7 @@ #define ui_belt "SOUTH-1,3" #define ui_throw "SOUTH-1,8" #define ui_oxygen "EAST+1, NORTH-4" +#define ui_pressure "EAST+1, NORTH-5" #define ui_toxin "EAST+1, NORTH-6" #define ui_internal "EAST+1, NORTH-2" #define ui_fire "EAST+1, NORTH-8" diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 4d8d31c860a..4f79ac3e50f 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -133,6 +133,37 @@ Pod/Blast Doors computer user.reset_view(current) return 1 +/obj/machinery/computer/atmosphere/siphonswitch/mastersiphonswitch/attackby(O as obj, user as mob) + + +/obj/machinery/computer/atmosphere/siphonswitch/mastersiphonswitch/attack_ai(var/mob/user as mob) + return attack_hand(user) + +/obj/machinery/computer/atmosphere/siphonswitch/mastersiphonswitch/attack_paw(var/mob/user as mob) + return attack_hand(user) + +/obj/machinery/computer/atmosphere/siphonswitch/mastersiphonswitch/attack_hand(var/mob/user as mob) + if(..()) + return + + user << "We're sorry, this terminal is currently out of order!" + + + + //var/screen = AALARM_SCREEN_MAIN + //var/area_uid + //var/area/alarm_area + //var/danger_level = 0 + + + //var/myproc = /obj/machinery/alarm/proc/return_controls + //call(myproc)() + + + + + + /obj/machinery/computer/card/attackby(O as obj, user as mob) if(istype(O, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/idcard = O diff --git a/code/modules/mob/living/carbon/human/hud.dm b/code/modules/mob/living/carbon/human/hud.dm index a5c1d990785..436ef5ebe46 100644 --- a/code/modules/mob/living/carbon/human/hud.dm +++ b/code/modules/mob/living/carbon/human/hud.dm @@ -468,6 +468,13 @@ mymob.oxygen.name = "oxygen" mymob.oxygen.screen_loc = ui_oxygen + mymob.pressure = new /obj/screen( null ) + mymob.pressure.icon = 'screen1_old.dmi' + mymob.pressure.icon_state = "pressure0" + mymob.pressure.name = "pressure" + mymob.pressure.screen_loc = ui_pressure + + /* mymob.i_select = new /obj/screen( null ) mymob.i_select.icon_state = "selector" @@ -650,7 +657,7 @@ mymob.client.screen = null //, mymob.i_select, mymob.m_select - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, 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.hands, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach ) mymob.client.screen += src.adding + src.other //if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 877eaedf488..6ea255d562f 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -505,14 +505,12 @@ adjustBruteLoss(5) */ - if((pressure > 2000) && (pressure < 3000)) - if(prob(50)) - src << "It's getting hard to breathe.. the air is pushing down on you!" + if(pressure > HAZARD_HIGH_PRESSURE) + + adjustBruteLoss(min((10+(round(pressure/(HIGH_STEP_PRESSURE)-2)*5)),MAX_PRESSURE_DAMAGE)) + + - if(pressure > 3000) - if(prob(25)) - src << "You feel a crushing, opressive force squeezing every fiber, your joints creaking." - adjustBruteLoss(15) @@ -926,6 +924,26 @@ else nutrition_icon.icon_state = "nutrition4" + if (pressure) + + if((wear_suit) && (istype(wear_suit, /obj/item/clothing/suit/space))) + pressure.icon_state = "pressure0" + + else + var/datum/gas_mixture/environment = loc.return_air() + if(environment) + switch(environment.return_pressure()) + if(HAZARD_HIGH_PRESSURE to INFINITY) + pressure.icon_state = "pressure2" + if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) + pressure.icon_state = "pressure1" + if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) + pressure.icon_state = "pressure0" + if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) + pressure.icon_state = "pressure-1" + else + pressure.icon_state = "pressure-2" + if(pullin) pullin.icon_state = "pull[pulling ? 1 : 0]" if(resting || lying || sleeping) rest.icon_state = "rest[(resting || lying || sleeping) ? 1 : 0]" diff --git a/code/modules/mob/living/carbon/monkey/hud.dm b/code/modules/mob/living/carbon/monkey/hud.dm index 6ead2fd432b..fbbad3183fc 100644 --- a/code/modules/mob/living/carbon/monkey/hud.dm +++ b/code/modules/mob/living/carbon/monkey/hud.dm @@ -381,6 +381,12 @@ mymob.oxygen.name = "oxygen" mymob.oxygen.screen_loc = ui_oxygen + mymob.pressure = new /obj/screen( null ) + mymob.pressure.icon = 'screen1_old.dmi' + mymob.pressure.icon_state = "pressure0" + mymob.pressure.name = "pressure" + mymob.pressure.screen_loc = ui_pressure + /* mymob.i_select = new /obj/screen( null ) mymob.i_select.icon_state = "selector" @@ -557,7 +563,7 @@ mymob.client.screen = null //, mymob.i_select, mymob.m_select - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, 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.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach ) mymob.client.screen += src.adding + src.other //if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index d576cfcd268..248c05ec3ee 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -377,15 +377,9 @@ adjustBruteLoss(5) */ - if((pressure > 2000) && (pressure < 3000)) - if(prob(50)) - src << "It's getting hard to breathe.. the air is pushing down on you!" - - if(pressure > 3000) - if(prob(25)) - src << "You feel a crushing, opressive force squeezing every fiber, your joints creaking." - adjustBruteLoss(15) + if(pressure > HAZARD_HIGH_PRESSURE) + adjustBruteLoss(min((10+(round(pressure/(HIGH_STEP_PRESSURE)-2)*5)),MAX_PRESSURE_DAMAGE)) @@ -545,6 +539,22 @@ else src.healths.icon_state = "health7" + if (pressure) + var/datum/gas_mixture/environment = loc.return_air() + if(environment) + switch(environment.return_pressure()) + + if(HAZARD_HIGH_PRESSURE to INFINITY) + pressure.icon_state = "pressure2" + if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) + pressure.icon_state = "pressure1" + if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) + pressure.icon_state = "pressure0" + if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) + pressure.icon_state = "pressure-1" + else + pressure.icon_state = "pressure-2" + if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]" diff --git a/code/setup.dm b/code/setup.dm index 3b276602e75..7ab046a451c 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -18,6 +18,15 @@ #define HUMAN_NEEDED_OXYGEN MOLES_CELLSTANDARD*BREATH_PERCENTAGE*0.16 //Amount of air needed before pass out/suffocation commences +// Pressure limits. +#define HAZARD_HIGH_PRESSURE 750 +#define HIGH_STEP_PRESSURE HAZARD_HIGH_PRESSURE/2 +#define WARNING_HIGH_PRESSURE HAZARD_HIGH_PRESSURE*0.7 +#define HAZARD_LOW_PRESSURE 50 +#define WARNING_LOW_PRESSURE HAZARD_LOW_PRESSURE*0.7 +#define MAX_PRESSURE_DAMAGE 20 + + // Factor of how fast mob nutrition decreases #define HUNGER_FACTOR 0.1 #define REAGENTS_METABOLISM 0.4 diff --git a/icons/mob/screen1.dmi b/icons/mob/screen1.dmi index 450bdcac600..6dce23c6809 100644 Binary files a/icons/mob/screen1.dmi and b/icons/mob/screen1.dmi differ diff --git a/icons/mob/screen1_old.dmi b/icons/mob/screen1_old.dmi index d108f7976a7..1e56031facf 100644 Binary files a/icons/mob/screen1_old.dmi and b/icons/mob/screen1_old.dmi differ