diff --git a/aurorastation.dme b/aurorastation.dme index 93707c2bac9..aae86ad7c2d 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -1699,6 +1699,7 @@ #include "code\modules\clothing\under\accessories\medal.dm" #include "code\modules\clothing\under\accessories\shirts.dm" #include "code\modules\clothing\under\accessories\storage.dm" +#include "code\modules\clothing\under\accessories\temperature.dm" #include "code\modules\clothing\under\accessories\xeno\diona.dm" #include "code\modules\clothing\under\accessories\xeno\skrell.dm" #include "code\modules\clothing\under\accessories\xeno\tajara.dm" diff --git a/code/__defines/species_languages.dm b/code/__defines/species_languages.dm index 4ed161f6bf9..6bb86bad5b5 100644 --- a/code/__defines/species_languages.dm +++ b/code/__defines/species_languages.dm @@ -12,6 +12,7 @@ #define NO_CHUBBY BITFLAG(11) // Cannot be visibly fat from nutrition type. #define NO_ARTERIES BITFLAG(12) // This species does not have arteries. #define PHORON_IMMUNE BITFLAG(13) // species doesn't suffer the negative effects of phoron contamination +#define CAN_SWEAT BITFLAG(14) // Forgive me. // unused: 0x8000(32768) - higher than this will overflow // Base flags for IPCs. diff --git a/code/modules/client/preference_setup/loadout/loadout_accessories.dm b/code/modules/client/preference_setup/loadout/loadout_accessories.dm index 7093d0fa311..4dfd546e2ea 100644 --- a/code/modules/client/preference_setup/loadout/loadout_accessories.dm +++ b/code/modules/client/preference_setup/loadout/loadout_accessories.dm @@ -575,3 +575,17 @@ aodai["ao dai, new hai phong cut"] = /obj/item/clothing/accessory/aodai/nhp aodai["ao dai, masculine formalwear"] = /obj/item/clothing/accessory/aodai/masc gear_tweaks += new /datum/gear_tweak/path(aodai) + +/datum/gear/accessory/temperature + display_name = "temperature packs" + description = "A nice little pack that heats/cools you when worn under your clothes!" + path = /obj/item/clothing/accessory/temperature + flags = 0 + +/datum/gear/accessory/temperature/New() + ..() + var/list/temperature = list() + for(var/temp_path in subtypesof(/obj/item/clothing/accessory/temperature)) + var/obj/item/clothing/accessory/temperature/temp_pack = temp_path + temperature[initial(temp_pack.name)] = temp_path + gear_tweaks += new /datum/gear_tweak/path(temperature) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 2ea101a27a1..bc0be822a21 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -31,6 +31,9 @@ var/move_trail = /obj/effect/decal/cleanable/blood/tracks/footprints + /// Measured in Celsius, when worn, the clothing modifies the baseline temperature by this much + var/body_temperature_change = 0 + /obj/item/clothing/Initialize(var/mapload, var/material_key) . = ..(mapload) if(!material_key) @@ -300,6 +303,11 @@ return accessory return null +/obj/item/clothing/proc/recalculate_body_temperature_change() + body_temperature_change = initial(body_temperature_change) + for(var/obj/item/clothing/accessory/accessory as anything in accessories) + body_temperature_change += accessory.body_temperature_change + /////////////////////////////////////////////////////////////////////// // Ears: headsets, earmuffs and tiny objects /obj/item/clothing/ears diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm index f1dcd2bccde..ac0e76c7ab3 100644 --- a/code/modules/clothing/clothing_accessories.dm +++ b/code/modules/clothing/clothing_accessories.dm @@ -108,6 +108,7 @@ src.verbs |= /obj/item/clothing/proc/removetie_verb update_clothing_icon() update_accessory_slowdown() + recalculate_body_temperature_change() /obj/item/clothing/proc/remove_accessory(mob/user, obj/item/clothing/accessory/A) if(!(A in accessories)) @@ -117,6 +118,7 @@ LAZYREMOVE(accessories, A) update_clothing_icon() update_accessory_slowdown() + recalculate_body_temperature_change() /obj/item/clothing/proc/removetie_verb() set name = "Remove Accessory" @@ -132,7 +134,7 @@ if(!LAZYLEN(accessories)) return - + var/obj/item/clothing/accessory/A if(LAZYLEN(accessories) > 1) var/list/options = list() diff --git a/code/modules/clothing/under/accessories/temperature.dm b/code/modules/clothing/under/accessories/temperature.dm new file mode 100644 index 00000000000..09571627723 --- /dev/null +++ b/code/modules/clothing/under/accessories/temperature.dm @@ -0,0 +1,30 @@ +/obj/item/clothing/accessory/temperature + name = "temperature pack" + desc = "A nice little pack that heats/cools you when worn under your clothes!" + icon = 'icons/obj/item/clothing/accessory/temperature.dmi' + icon_state = "pack" + contained_sprite = TRUE + +/obj/item/clothing/accessory/temperature/warm + name = "heat pack" + desc = "A nice little pack that heats you when worn under your clothes!" + icon_state = "heat_pack" + body_temperature_change = 5 + +/obj/item/clothing/accessory/temperature/volcano + name = "volcano pack" + desc = "A dangerous little pack that can warm even the coldest heart!" + icon_state = "volcano_pack" + body_temperature_change = 10 + +/obj/item/clothing/accessory/temperature/cold + name = "cold pack" + desc = "A nice little pack that cools you when worn under your clothes!" + icon_state = "cold_pack" + body_temperature_change = -5 + +/obj/item/clothing/accessory/temperature/blizzard + name = "blizzard pack" + desc = "A dangerous little pack that can suck the warmth out of any hearth!" + icon_state = "blizzard_pack" + body_temperature_change = -10 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 960ba115549..502afae7998 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -431,13 +431,19 @@ if (is_diona()) diona_handle_temperature(DS) +/mob/living/carbon/human/proc/get_baseline_body_temperature() + var/baseline = species.body_temperature + for(var/obj/item/clothing/clothing in list(w_uniform, wear_suit)) + baseline += clothing.body_temperature_change + return baseline + /mob/living/carbon/human/proc/stabilize_body_temperature() if (species.passive_temp_gain) // We produce heat naturally. bodytemperature += species.passive_temp_gain if (species.body_temperature == null) return //this species doesn't have metabolic thermoregulation - var/body_temperature_difference = species.body_temperature - bodytemperature + var/body_temperature_difference = get_baseline_body_temperature() - bodytemperature if (abs(body_temperature_difference) < 0.5) return //fuck this precision @@ -453,7 +459,10 @@ var/recovery_amt = body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR 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...~ + if(hydration >= 2) + adjustHydrationLoss(2) + if(HAS_FLAG(species.flags, CAN_SWEAT) && fire_stacks == 0) + fire_stacks = -1 var/recovery_amt = min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers bodytemperature += recovery_amt @@ -1154,7 +1163,7 @@ "Ennoia be with you, it's a bit too dark..." ) to_chat(src, SPAN_WARNING(pick(assunzione_messages))) - + if(HAS_TRAIT(src, TRAIT_ORIGIN_LIGHT_SENSITIVE)) if(T.get_lumcount() > 0.8) if(prob(1)) diff --git a/code/modules/mob/living/carbon/human/species/station/human/human.dm b/code/modules/mob/living/carbon/human/species/station/human/human.dm index 93be9d2a47d..26d31c9d99a 100644 --- a/code/modules/mob/living/carbon/human/species/station/human/human.dm +++ b/code/modules/mob/living/carbon/human/species/station/human/human.dm @@ -28,6 +28,7 @@ name_language = null // Use the first-name last-name generator rather than a language scrambler mob_size = 9 spawn_flags = CAN_JOIN + flags = CAN_SWEAT appearance_flags = HAS_HAIR_COLOR | HAS_SKIN_TONE | HAS_LIPS | HAS_UNDERWEAR | HAS_EYE_COLOR | HAS_SOCKS | HAS_SKIN_PRESET remains_type = /obj/effect/decal/remains/human dust_remains_type = /obj/effect/decal/remains/human/burned diff --git a/code/modules/organs/internal/lungs.dm b/code/modules/organs/internal/lungs.dm index 5efa9f74a9d..5cae815d319 100644 --- a/code/modules/organs/internal/lungs.dm +++ b/code/modules/organs/internal/lungs.dm @@ -331,9 +331,9 @@ if (temp_adj < BODYTEMP_COOLING_MAX) temp_adj = BODYTEMP_COOLING_MAX owner.bodytemperature += temp_adj - else if(breath.temperature >= owner.species.heat_discomfort_level) + else if(owner.bodytemperature >= owner.species.heat_discomfort_level) owner.species.get_environment_discomfort(owner,"heat") - else if(breath.temperature <= owner.species.cold_discomfort_level) + else if(owner.bodytemperature <= owner.species.cold_discomfort_level) owner.species.get_environment_discomfort(owner,"cold") /obj/item/organ/internal/lungs/listen() diff --git a/html/changelogs/geeves-heat_packs.yml b/html/changelogs/geeves-heat_packs.yml new file mode 100644 index 00000000000..a5e8f89ba25 --- /dev/null +++ b/html/changelogs/geeves-heat_packs.yml @@ -0,0 +1,8 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Added temperature pack accessories to the loadout menu, with heat and cold cooling/warming by 5 degrees celsius, and volcano and blizzard cooling/warming by 10 degrees celsius." + - tweak: "Temperature discomfort messages are now based off body temperature instead of the temperature of the air your breath." + - rscadd: "Humans now sweat to get rid of heat." \ No newline at end of file diff --git a/icons/obj/item/clothing/accessory/temperature.dmi b/icons/obj/item/clothing/accessory/temperature.dmi new file mode 100644 index 00000000000..13f97c3cd96 Binary files /dev/null and b/icons/obj/item/clothing/accessory/temperature.dmi differ