diff --git a/baystation12.dme b/baystation12.dme index 8d30436152d..b6aeb528e64 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -569,6 +569,7 @@ #include "code\game\objects\items\devices\pipe_painter.dm" #include "code\game\objects\items\devices\powersink.dm" #include "code\game\objects\items\devices\scanners.dm" +#include "code\game\objects\items\devices\suit_cooling.dm" #include "code\game\objects\items\devices\taperecorder.dm" #include "code\game\objects\items\devices\traitordevices.dm" #include "code\game\objects\items\devices\transfer_valve.dm" diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index c49bcdbdddc..a12f7dfadbe 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -100,7 +100,7 @@ item_state = "cult_armour" desc = "A bulky suit of armour, bristling with spikes. It looks space proof." w_class = 3 - allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade,/obj/item/weapon/tank/emergency_oxygen) + allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade,/obj/item/weapon/tank/emergency_oxygen,/obj/item/device/suit_cooling_unit) slowdown = 1 armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30) siemens_coefficient = 0 diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm new file mode 100644 index 00000000000..4035ab3c0c3 --- /dev/null +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -0,0 +1,161 @@ +/obj/item/device/suit_cooling_unit + name = "portable suit cooling unit" + desc = "A portable heat sink and liquid cooled radiator that can be hooked up to a space suit's existing temperature controls to provide industrial levels of cooling." + w_class = 4 + icon = 'icons/obj/power.dmi' //temporary, I hope + icon_state = "portgen0" + slot_flags = SLOT_BACK //you can carry it on your back if you want, but it won't do anything unless attached to suit storage + + var/on = 0 //is it turned on? + var/cover_open = 0 //is the cover open? + var/obj/item/weapon/cell/cell + var/max_cooling = 12 //in degrees per second - probably don't need to mess with heat capacity here + var/charge_consumption = 16.6 //charge per second at max_cooling + var/thermostat = T20C + + //TODO: make it heat up the surroundings when not in space + +/obj/item/device/suit_cooling_unit/proc/cool_mob(mob/M) + if (!on || !cell) return + + //make sure they have a suit and we are attached to it + if (!attached_to_suit(M)) + return + + var/mob/living/carbon/human/H = M + + var/efficiency = H.get_pressure_protection() //you need to have a good seal for effective cooling + var/env_temp = get_environment_temperature() //wont save you from a fire + var/temp_adj = min(H.bodytemperature - max(thermostat, env_temp), max_cooling) + + if (temp_adj < 0) //only cools, doesn't heat + return + + var/charge_usage = (temp_adj/max_cooling)*charge_consumption + + H.bodytemperature -= temp_adj*efficiency + + cell.use(charge_usage) + + if(cell.charge <= 0) + turn_off() + +/obj/item/device/suit_cooling_unit/proc/get_environment_temperature() + if (ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(istype(H.loc, /obj/mecha)) + var/obj/mecha/M = loc + return M.return_temperature() + else if(istype(H.loc, /obj/machinery/atmospherics/unary/cryo_cell)) + return H.loc:air_contents.temperature + + var/turf/T = get_turf(src) + if(istype(T, /turf/space)) + return 0 //space has no temperature, this just makes sure the cooling unit works in space + + var/datum/gas_mixture/environment = T.return_air() + if (!environment) + return 0 + + return environment.temperature + +/obj/item/device/suit_cooling_unit/proc/attached_to_suit(mob/M) + if (!ishuman(M)) + return 0 + + var/mob/living/carbon/human/H = M + + if (!H.wear_suit || H.s_store != src) + return 0 + + return 1 + +/obj/item/device/suit_cooling_unit/proc/turn_on() + if(!cell) + return + if(cell.charge <= 0) + return + + on = 1 + updateicon() + +/obj/item/device/suit_cooling_unit/proc/turn_off() + if (ismob(src.loc)) + src.loc << "\The [src] clicks and whines as it powers down." //let them know + on = 0 + updateicon() + +/obj/item/device/suit_cooling_unit/attack_self(mob/user as mob) + if(cover_open && cell) + if(ishuman(user)) + user.put_in_hands(cell) + else + cell.loc = get_turf(loc) + + cell.add_fingerprint(user) + cell.updateicon() + + user << "You remove the [src.cell]." + src.cell = null + updateicon() + return + + //TODO use a UI like the air tanks + if(on) + turn_off() + else + turn_on() + if (on) + user << "You switch on the [src]." + +/obj/item/device/suit_cooling_unit/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/screwdriver)) + if(cover_open) + cover_open = 0 + user << "You screw the panel into place." + else + cover_open = 1 + user << "You unscrew the panel." + updateicon() + return + + if (istype(W, /obj/item/weapon/cell)) + if(cover_open) + if(cell) + user << "There is a [cell] already installed here." + else + user.drop_item() + W.loc = src + cell = W + user << "You insert the [cell]." + updateicon() + return + + return ..() + +/obj/item/device/suit_cooling_unit/proc/updateicon() + return 0 //TODO + +/obj/item/device/suit_cooling_unit/examine() + set src in view(1) + + ..() + + if (on) + if (attached_to_suit(src.loc)) + usr << "It's switched on and running." + else + usr << "It's switched on, but not attached to anything." + else + usr << "It is switched off." + + if (cover_open) + if(cell) + usr << "The panel is open, exposing the [cell]." + else + usr << "The panel is open." + + if (cell) + usr << "The charge meter reads [round(cell.percent())]%." + else + usr << "It doesn't have a power cell installed." \ No newline at end of file diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 33bf662ebf3..616dc0c114b 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -7,6 +7,7 @@ flags = FPRINT | TABLEPASS | CONDUCT slot_flags = SLOT_BACK hitsound = 'sound/weapons/smash.ogg' + w_class = 3 pressure_resistance = ONE_ATMOSPHERE*5 diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 03cd5e21b4c..d97cf213099 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -229,7 +229,7 @@ BLIND // can't see anything permeability_coefficient = 0.02 flags = FPRINT | TABLEPASS | STOPSPRESSUREDMAGE body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS - allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/emergency_oxygen) + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/emergency_oxygen,/obj/item/device/suit_cooling_unit) slowdown = 3 armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 50) flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT||HIDETAIL diff --git a/code/modules/clothing/spacesuits/ninja.dm b/code/modules/clothing/spacesuits/ninja.dm index 4bf80556dce..ba453b40507 100644 --- a/code/modules/clothing/spacesuits/ninja.dm +++ b/code/modules/clothing/spacesuits/ninja.dm @@ -14,7 +14,7 @@ desc = "A unique, vaccum-proof suit of nano-enhanced armor designed specifically for Spider Clan assassins." icon_state = "s-ninja" item_state = "s-ninja_suit" - allowed = list(/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank,/obj/item/weapon/cell) + allowed = list(/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank,/obj/item/weapon/cell,/obj/item/device/suit_cooling_unit) slowdown = 0 armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30) siemens_coefficient = 0.2 diff --git a/code/modules/clothing/spacesuits/rig.dm b/code/modules/clothing/spacesuits/rig.dm index bcc35d6ec34..65bd6d0ca80 100644 --- a/code/modules/clothing/spacesuits/rig.dm +++ b/code/modules/clothing/spacesuits/rig.dm @@ -103,8 +103,8 @@ icon_state = "rig-engineering" item_state = "eng_hardsuit" slowdown = 1 - armor = list(melee = 30, bullet = 5, laser = 20,energy = 5, bomb = 20, bio = 100, rad = 80) - allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/weapon/storage/bag/ore,/obj/item/device/t_scanner,/obj/item/weapon/pickaxe, /obj/item/weapon/rcd) + armor = list(melee = 30, bullet = 5, laser = 20,energy = 5, bomb = 35, bio = 100, rad = 80) + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/storage/bag/ore,/obj/item/device/t_scanner,/obj/item/weapon/pickaxe, /obj/item/weapon/rcd) heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECITON_TEMPERATURE flags = FPRINT | TABLEPASS | STOPSPRESSUREDMAGE | ONESIZEFITSALL @@ -429,7 +429,7 @@ slowdown = 1 w_class = 3 armor = list(melee = 60, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 60) - allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/melee/energy/sword,/obj/item/weapon/handcuffs) + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/melee/energy/sword,/obj/item/weapon/handcuffs,/obj/item/device/suit_cooling_unit) siemens_coefficient = 0.6 flags = FPRINT | TABLEPASS | STOPSPRESSUREDMAGE | ONESIZEFITSALL @@ -470,8 +470,8 @@ name = "medical hardsuit" desc = "A special suit that protects against hazardous, low pressure environments. Has minor radiation shielding." item_state = "medical_hardsuit" - allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/weapon/storage/firstaid,/obj/item/device/healthanalyzer,/obj/item/stack/medical) - flags = FPRINT | TABLEPASS | STOPSPRESSUREDMAGE | ONESIZEFITSALL + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/storage/firstaid,/obj/item/device/healthanalyzer,/obj/item/stack/medical) + armor = list(melee = 30, bullet = 5, laser = 20,energy = 5, bomb = 25, bio = 100, rad = 50) //Security /obj/item/clothing/head/helmet/space/rig/security @@ -489,7 +489,7 @@ desc = "A special suit that protects against hazardous, low pressure environments. Has an additional layer of armor." item_state = "sec_hardsuit" armor = list(melee = 50, bullet = 10, laser = 30, energy = 15, bomb = 45, bio = 100, rad = 10) - allowed = list(/obj/item/weapon/gun,/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/weapon/melee/baton) + allowed = list(/obj/item/weapon/gun,/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/melee/baton) siemens_coefficient = 0.7 flags = FPRINT | TABLEPASS | STOPSPRESSUREDMAGE | ONESIZEFITSALL diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 6cb013a8610..66bc1b75b4b 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -179,10 +179,8 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc handle_vampire() -/mob/living/carbon/human/calculate_affecting_pressure(var/pressure) - ..() - var/pressure_difference = abs( pressure - ONE_ATMOSPHERE ) - +//Much like get_heat_protection(), this returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. +/mob/living/carbon/human/proc/get_pressure_protection() var/pressure_adjustment_coefficient = 1 //Determins how much the clothing you are wearing protects you in percent. if(head && (head.flags & STOPSPRESSUREDMAGE)) @@ -200,7 +198,13 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc pressure_adjustment_coefficient = min(1,max(pressure_adjustment_coefficient,0)) //So it isn't less than 0 or larger than 1. - pressure_difference = pressure_difference * pressure_adjustment_coefficient + return 1 - pressure_adjustment_coefficient //want 0 to be bad protection, 1 to be good protection + +/mob/living/carbon/human/calculate_affecting_pressure(var/pressure) + ..() + var/pressure_difference = abs( pressure - ONE_ATMOSPHERE ) + + pressure_difference = pressure_difference * (1 - get_pressure_protection()) if(pressure > ONE_ATMOSPHERE) return ONE_ATMOSPHERE + pressure_difference @@ -678,14 +682,14 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc adjustOxyLoss(-5) // Hot air hurts :( - if( (abs(310.15 - breath.temperature) > 50) && !(M_RESIST_HEAT in mutations)) + if( (breath.temperature < species.cold_level_1 || breath.temperature > species.heat_level_1) && !(M_RESIST_HEAT in mutations)) if(status_flags & GODMODE) return 1 if(breath.temperature < species.cold_level_1) if(prob(20)) - src << "\red You feel your face freezing and an icicle forming in your lungs!" + src << "\red You feel your face freezing and icicles forming in your lungs!" else if(breath.temperature > species.heat_level_1) if(prob(20)) src << "\red You feel your face burning and a searing heat in your lungs!" @@ -710,8 +714,20 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat") fire_alert = max(fire_alert, 2) - //Temporary fixes to the alerts. + //breathing in hot/cold air also heats/cools you a bit + var/temp_adj = breath.temperature - bodytemperature + if (temp_adj < 0) + temp_adj /= (BODYTEMP_COLD_DIVISOR * 5) //don't raise temperature as much as if we were directly exposed + else + temp_adj /= (BODYTEMP_HEAT_DIVISOR * 5) //don't raise temperature as much as if we were directly exposed + var/relative_density = breath.total_moles() / (MOLES_CELLSTANDARD * BREATH_PERCENTAGE) + temp_adj *= relative_density + + if (temp_adj > BODYTEMP_HEATING_MAX) temp_adj = BODYTEMP_HEATING_MAX + if (temp_adj < BODYTEMP_COOLING_MAX) temp_adj = BODYTEMP_COOLING_MAX + //world << "Breath: [breath.temperature], [src]: [bodytemperature], Adjusting: [temp_adj]" + bodytemperature += temp_adj return 1 proc/handle_environment(datum/gas_mixture/environment) @@ -727,10 +743,12 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(istype(loc, /obj/mecha)) var/obj/mecha/M = loc loc_temp = M.return_temperature() + if(istype(loc, /obj/spacepod)) var/obj/spacepod/S = loc loc_temp = S.return_temperature() //else if(istype(get_turf(src), /turf/space)) + else if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) loc_temp = loc:air_contents.temperature else @@ -757,9 +775,9 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if (temp_adj > BODYTEMP_HEATING_MAX) temp_adj = BODYTEMP_HEATING_MAX if (temp_adj < BODYTEMP_COOLING_MAX) temp_adj = BODYTEMP_COOLING_MAX + //world << "Environment: [loc_temp], [src]: [bodytemperature], Adjusting: [temp_adj]" bodytemperature += temp_adj - // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. if(bodytemperature > species.heat_level_1) //Body temperature is too hot. @@ -767,13 +785,17 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(status_flags & GODMODE) return 1 //godmode switch(bodytemperature) if(species.heat_level_1 to species.heat_level_2) - apply_damage(HEAT_DAMAGE_LEVEL_1, BURN, used_weapon = "High Body Temperature") + //I'm thinking it might be better to use adjustFireLoss here instead of apply_damage so that damage is spread evenly across organs, instead of being dealt mostly to the chest + //apply_damage(HEAT_DAMAGE_LEVEL_1, BURN, used_weapon = "High Body Temperature") + adjustFireLoss(HEAT_DAMAGE_LEVEL_1) fire_alert = max(fire_alert, 2) if(species.heat_level_2 to species.heat_level_3) - apply_damage(HEAT_DAMAGE_LEVEL_2, BURN, used_weapon = "High Body Temperature") + //apply_damage(HEAT_DAMAGE_LEVEL_2, BURN, used_weapon = "High Body Temperature") + adjustFireLoss(HEAT_DAMAGE_LEVEL_2) fire_alert = max(fire_alert, 2) if(species.heat_level_3 to INFINITY) - apply_damage(HEAT_DAMAGE_LEVEL_3, BURN, used_weapon = "High Body Temperature") + //apply_damage(HEAT_DAMAGE_LEVEL_3, BURN, used_weapon = "High Body Temperature") + adjustFireLoss(HEAT_DAMAGE_LEVEL_3) fire_alert = max(fire_alert, 2) else if(bodytemperature < species.cold_level_1) @@ -783,13 +805,17 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(!istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) switch(bodytemperature) if(species.cold_level_2 to species.cold_level_1) - apply_damage(COLD_DAMAGE_LEVEL_1, BURN, used_weapon = "Low Body Temperature") + //I'm thinking it might be better to use adjustFireloss here instead of apply_damage so that damage is spread evenly across organs, instead of being dealt mostly to the chest + //apply_damage(COLD_DAMAGE_LEVEL_1, BURN, used_weapon = "Low Body Temperature") + adjustFireLoss(COLD_DAMAGE_LEVEL_1) fire_alert = max(fire_alert, 1) if(species.cold_level_3 to species.cold_level_2) - apply_damage(COLD_DAMAGE_LEVEL_2, BURN, used_weapon = "Low Body Temperature") + //apply_damage(COLD_DAMAGE_LEVEL_2, BURN, used_weapon = "Low Body Temperature") + adjustFireLoss(COLD_DAMAGE_LEVEL_2) fire_alert = max(fire_alert, 1) if(-INFINITY to species.cold_level_3) - apply_damage(COLD_DAMAGE_LEVEL_3, BURN, used_weapon = "Low Body Temperature") + //apply_damage(COLD_DAMAGE_LEVEL_3, BURN, used_weapon = "Low Body Temperature") + adjustFireLoss(COLD_DAMAGE_LEVEL_3) fire_alert = max(fire_alert, 1) // Account for massive pressure differences. Done by Polymorph @@ -797,7 +823,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(status_flags & GODMODE) return 1 //godmode if(adjusted_pressure >= species.hazard_high_pressure) - adjustBruteLoss( min( ( (adjusted_pressure / species.hazard_high_pressure) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) ) + adjustBruteLoss(min( ( (adjusted_pressure / species.hazard_high_pressure) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE)) pressure_alert = 2 else if(adjusted_pressure >= species.warning_high_pressure) pressure_alert = 1 @@ -805,13 +831,9 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc pressure_alert = 0 else if(adjusted_pressure >= species.hazard_low_pressure) pressure_alert = -1 - - if(species && species.flags & IS_SYNTHETIC) - bodytemperature += 0.5 * TEMPERATURE_DAMAGE_COEFFICIENT //Synthetics suffer overheating in a vaccuum. ~Z - else if( !(M_RESIST_COLD in mutations)) - apply_damage(LOW_PRESSURE_DAMAGE, BRUTE, used_weapon = "Low Pressure") + adjustBruteLoss(LOW_PRESSURE_DAMAGE) pressure_alert = -2 else pressure_alert = -1 @@ -850,29 +872,38 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc */ proc/stabilize_body_temperature() - if (species && species.flags & IS_SYNTHETIC) + //TODO find a better place to put this + if (s_store && istype(s_store, /obj/item/device/suit_cooling_unit)) + var/obj/item/device/suit_cooling_unit/CU = s_store + CU.cool_mob(src) + + if (species.flags & IS_SYNTHETIC) bodytemperature += species.synth_temp_gain //that CPU/posibrain just keeps putting out heat. return var/body_temperature_difference = species.body_temperature - bodytemperature + if (abs(body_temperature_difference) < 0.5) return //fuck this precision - switch(bodytemperature) - if(-INFINITY to species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects. - if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up. - nutrition -= 2 - var/recovery_amt = max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) + + if(bodytemperature < species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects. + if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up. + nutrition -= 2 + var/recovery_amt = max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) + //world << "Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]" // log_debug("Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]") - bodytemperature += recovery_amt - if(species.cold_level_1 to species.heat_level_1) - var/recovery_amt = body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR + bodytemperature += recovery_amt + else if(species.cold_level_1 <= bodytemperature && bodytemperature <= species.heat_level_1) + var/recovery_amt = body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR + //world << "Norm. Difference = [body_temperature_difference]. Recovering [recovery_amt]" // log_debug("Norm. Difference = [body_temperature_difference]. Recovering [recovery_amt]") - bodytemperature += recovery_amt - if(species.heat_level_1 to INFINITY) //360.15 is 310.15 + 50, the temperature where you start to feel effects. - //We totally need a sweat system cause it totally makes sense...~ - var/recovery_amt = min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers + bodytemperature += recovery_amt + else if(bodytemperature > species.heat_level_1) //360.15 is 310.15 + 50, the temperature where you start to feel effects. + //We totally need a sweat system cause it totally makes sense...~ + var/recovery_amt = min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers + //world << "Hot. Difference = [body_temperature_difference]. Recovering [recovery_amt]" // log_debug("Hot. Difference = [body_temperature_difference]. Recovering [recovery_amt]") - bodytemperature += recovery_amt + bodytemperature += recovery_amt //This proc returns a number made up of the flags for body parts which you are protected on. (such as HEAD, UPPER_TORSO, LOWER_TORSO, etc. See setup.dm for the full list) proc/get_heat_protection_flags(temperature) //Temperature is the temperature you're being exposed to. @@ -1585,17 +1616,46 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc else fire.icon_state = "fire0" if(bodytemp) - switch(bodytemperature) //310.055 optimal body temp - if(370 to INFINITY) bodytemp.icon_state = "temp4" - if(350 to 370) bodytemp.icon_state = "temp3" - if(335 to 350) bodytemp.icon_state = "temp2" - if(320 to 335) bodytemp.icon_state = "temp1" - if(300 to 320) bodytemp.icon_state = "temp0" - if(295 to 300) bodytemp.icon_state = "temp-1" - if(280 to 295) bodytemp.icon_state = "temp-2" - if(260 to 280) bodytemp.icon_state = "temp-3" - else bodytemp.icon_state = "temp-4" + if (!species) + switch(bodytemperature) //310.055 optimal body temp + if(370 to INFINITY) bodytemp.icon_state = "temp4" + if(350 to 370) bodytemp.icon_state = "temp3" + if(335 to 350) bodytemp.icon_state = "temp2" + if(320 to 335) bodytemp.icon_state = "temp1" + if(300 to 320) bodytemp.icon_state = "temp0" + if(295 to 300) bodytemp.icon_state = "temp-1" + if(280 to 295) bodytemp.icon_state = "temp-2" + if(260 to 280) bodytemp.icon_state = "temp-3" + else bodytemp.icon_state = "temp-4" + else + var/temp_step + if (bodytemperature >= species.body_temperature) + temp_step = (species.heat_level_1 - species.body_temperature)/4 + if (bodytemperature >= species.heat_level_1) + bodytemp.icon_state = "temp4" + else if (bodytemperature >= species.body_temperature + temp_step*3) + bodytemp.icon_state = "temp3" + else if (bodytemperature >= species.body_temperature + temp_step*2) + bodytemp.icon_state = "temp2" + else if (bodytemperature >= species.body_temperature + temp_step*1) + bodytemp.icon_state = "temp1" + else + bodytemp.icon_state = "temp0" + + else if (bodytemperature < species.body_temperature) + temp_step = (species.body_temperature - species.cold_level_1)/4 + + if (bodytemperature <= species.cold_level_1) + bodytemp.icon_state = "temp-4" + else if (bodytemperature <= species.body_temperature - temp_step*3) + bodytemp.icon_state = "temp-3" + else if (bodytemperature <= species.body_temperature - temp_step*2) + bodytemp.icon_state = "temp-2" + else if (bodytemperature <= species.body_temperature - temp_step*1) + bodytemp.icon_state = "temp-1" + else + bodytemp.icon_state = "temp0" if(blind) if(blinded) blind.layer = 18 else blind.layer = 0 diff --git a/code/modules/research/xenoarchaeology/tools/anomaly_suit.dm b/code/modules/research/xenoarchaeology/tools/anomaly_suit.dm index 6539f3d1838..8922c5dae17 100644 --- a/code/modules/research/xenoarchaeology/tools/anomaly_suit.dm +++ b/code/modules/research/xenoarchaeology/tools/anomaly_suit.dm @@ -20,7 +20,7 @@ icon_state = "cespace_suit" item_state = "cespace_suit" armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 100) - allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank) + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit) /obj/item/clothing/head/helmet/space/anomaly name = "Excavation hood" diff --git a/code/setup.dm b/code/setup.dm index 3587159a5e9..ce10db610b5 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -35,7 +35,7 @@ #define TEMPERATURE_DAMAGE_COEFFICIENT 1.5 //This is used in handle_temperature_damage() for humans, and in reagents that affect body temperature. Temperature damage is multiplied by this amount. #define BODYTEMP_AUTORECOVERY_DIVISOR 12 //This is the divisor which handles how much of the temperature difference between the current body temperature and 310.15K (optimal temperature) humans auto-regenerate each tick. The higher the number, the slower the recovery. This is applied each tick, so long as the mob is alive. -#define BODYTEMP_AUTORECOVERY_MINIMUM 10 //Minimum amount of kelvin moved toward 310.15K per tick. So long as abs(310.15 - bodytemp) is more than 50. +#define BODYTEMP_AUTORECOVERY_MINIMUM 1 //Minimum amount of kelvin moved toward 310.15K per tick. So long as abs(310.15 - bodytemp) is more than 50. #define BODYTEMP_COLD_DIVISOR 6 //Similar to the BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is lower than their body temperature. Make it lower to lose bodytemp faster. #define BODYTEMP_HEAT_DIVISOR 6 //Similar to the BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is higher than their body temperature. Make it lower to gain bodytemp faster. #define BODYTEMP_COOLING_MAX -30 //The maximum number of degrees that your body can cool in 1 tick, when in a cold area.