Skip to content

Commit

Permalink
Attempts to Fix Temperature + Makes It More Realistic in the Face of …
Browse files Browse the repository at this point in the history
…Extreme Temperatures (#3512)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

Zym's temperture PR apparently doesn't work as intended, this is not
because of a coding error but simply because SS13 humans are extremely
fucking durable somehow

This attemps to fix it by making humands much more squishy and easier
for players to notice cold/warm areas without it being in the danger
zone.

This also adds a fun mechanic where staying hydrated reduces burn damage
taken from hot air.

And in order to fine tune some planet's tempertures, rockplanet and
beachplanet's gases have been randomized.

ports tgstation/tgstation#82336 as well, a nice
cold breath effect!

## Why It's Good For The Game

you should no longer be fine in -50 C nor 100 C, this may be
frustrating, but holy shit you should NOT be fine at 100C. Hardsuit
negates this completely

## Changelog

:cl:
add: Melbert, rye-rice
balance: you will no longer be fine at 100 c, nor 50 c, you should also
NOT be fine at -100 c either. clothing helps.
fix: should be able to tell slighlty chilly tempertures
qol: Breathing cold air now has a particle effect associated, careful
not to let your glasses fog up.
qol: Breathing cold air will now occasionally make your spaceman shiver.
Brrr.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: retlaw34 <[email protected]>
  • Loading branch information
rye-rice and rye-rice authored Dec 3, 2024
1 parent be72170 commit 274becd
Show file tree
Hide file tree
Showing 45 changed files with 455 additions and 251 deletions.
11 changes: 7 additions & 4 deletions code/__DEFINES/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@
#define KITCHEN_COLDROOM_ATMOS "o2=33;n2=124;TEMP=193.15"
/// used in the holodeck burn test program
#define BURNMIX_ATMOS "o2=2500;plasma=5000;TEMP=370"
/// used in rockplanet
#define ROCKPLANET_DEFAULT_ATMOS "co2=95;n2=3;TEMP=210.15"
//ATMOSPHERICS DEPARTMENT GAS TANK TURFS
#define ATMOS_TANK_N2O "n2o=6000;TEMP=293.15"
#define ATMOS_TANK_CO2 "co2=50000;TEMP=293.15"
Expand All @@ -226,11 +224,16 @@
//PLANETARY
/// what pressure you have to be under to increase the effect of equipment meant for lavaland
#define LAVALAND_EQUIPMENT_EFFECT_PRESSURE 90
#define ICEMOON_DEFAULT_ATMOS "ICEMOON_ATMOS"
#define GAS_GIANT_ATMOS "GAS_GIANT_ATMOS"
#define PLASMA_GIANT_ATMOS "PLASMA_GIANT_ATMOS"
#define WASTEPLANET_DEFAULT_ATMOS "WASTEPLANET_ATMOS"
#define DEFAULT_ATMOS_DETECTOR "plasma=70000;TEMP=293.15"
#define LAVALAND_DEFAULT_ATMOS "LAVALAND_ATMOS"
#define ICEMOON_DEFAULT_ATMOS "ICEMOON_ATMOS"
#define WASTEPLANET_DEFAULT_ATMOS "WASTEPLANET_ATMOS"
#define ROCKPLANET_DEFAULT_ATMOS "ROCKPLANET_ATMOS"
#define BEACHPLANET_DEFAULT_ATMOS "BEACHPLANET_ATMOS"
#define JUNGLEPLANET_DEFAULT_ATMOS "JUNGLEPLANET_ATMOS"
#define SANDPLANET_DEFAULT_ATMOS "SANDPLANET_ATMOS"


//ATMOS MIX IDS
Expand Down
26 changes: 13 additions & 13 deletions code/__DEFINES/species.dm
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
// Pressure limits.
/// This determins at what pressure the ultra-high pressure red icon is displayed. (This one is set as a constant)
#define HAZARD_HIGH_PRESSURE 550
/// This determins when the orange pressure icon is displayed (it is 0.7 * HAZARD_HIGH_PRESSURE)
#define WARNING_HIGH_PRESSURE 325
/// This is when the gray low pressure icon is displayed. (it is 2.5 * HAZARD_LOW_PRESSURE)
#define WARNING_LOW_PRESSURE 50
/// This is when the black ultra-low pressure icon is displayed. (This one is set as a constant)
#define HAZARD_LOW_PRESSURE 20
/// This determins at what pressure the ultra-high pressure red icon is displayed.
#define HAZARD_HIGH_PRESSURE 303
/// This determins when the orange pressure icon is displayed
#define WARNING_HIGH_PRESSURE 202
/// This is when the gray low pressure icon is displayed.
#define WARNING_LOW_PRESSURE 60
/// This is when the black ultra-low pressure icon is displayed.
#define HAZARD_LOW_PRESSURE 40

/// This is used in handle_temperature_damage() for humans, and in reagents that affect body temperature. Temperature damage is multiplied by this amount.
#define TEMPERATURE_DAMAGE_COEFFICIENT 1.5

/// The natural temperature for a body
#define HUMAN_BODYTEMP_NORMAL 310.15
/// 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 HUMAN_BODYTEMP_AUTORECOVERY_DIVISOR 11
#define HUMAN_BODYTEMP_AUTORECOVERY_DIVISOR 22
/// Minimum amount of kelvin moved toward 310K per tick. So long as abs(310.15 - bodytemp) is more than 50.
#define HUMAN_BODYTEMP_AUTORECOVERY_MINIMUM 12
///Similar to the HUMAN_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 HUMAN_BODYTEMP_COLD_DIVISOR 15
#define HUMAN_BODYTEMP_COLD_DIVISOR 20
/// Similar to the HUMAN_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 HUMAN_BODYTEMP_HEAT_DIVISOR 15
#define HUMAN_BODYTEMP_HEAT_DIVISOR 10
/// The maximum number of degrees that your body can cool in 1 tick, due to the environment, when in a cold area.
#define HUMAN_BODYTEMP_COOLING_MAX -100
/// The maximum number of degrees that your body can heat up in 1 tick, due to the environment, when in a hot area.
#define HUMAN_BODYTEMP_HEATING_MAX 30
/// The body temperature limit the human body can take before it starts taking damage from heat.
/// This also affects how fast the body normalises it's temperature when hot.
/// 340k is about 66c, and rather high for a human.
#define HUMAN_BODYTEMP_HEAT_DAMAGE_LIMIT (HUMAN_BODYTEMP_NORMAL + 30)
#define HUMAN_BODYTEMP_HEAT_DAMAGE_LIMIT (HUMAN_BODYTEMP_NORMAL + 3)
/// The body temperature limit the human body can take before it starts taking damage from cold.
/// This also affects how fast the body normalises it's temperature when cold.
/// 270k is about -3c, that is below freezing and would hurt over time.
#define HUMAN_BODYTEMP_COLD_DAMAGE_LIMIT (HUMAN_BODYTEMP_NORMAL - 40)
#define HUMAN_BODYTEMP_COLD_DAMAGE_LIMIT (HUMAN_BODYTEMP_NORMAL - 8)


//VOX DEFINES
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Override makes it so the alert is not replaced until cleared by a clear_alert wi

/atom/movable/screen/alert/sweat
name = "Sweating"
desc = "You're sweating and the heat is starting to hurt. Get somewhere cooler and take off any insulating clothing like a fire suit."
desc = "You're sweating and the heat is starting to hurt. Stay hydrated, get somewhere cooler, and take off any insulating clothing like a fire suit."
icon_state = "sweat"

/atom/movable/screen/alert/shiver
Expand Down
163 changes: 131 additions & 32 deletions code/datums/atmosphere/planetary.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
)
restricted_gases = list(
GAS_BZ=10,
GAS_PLASMA=0.1,
GAS_H2O=0.1,
)
restricted_chance = 50

Expand All @@ -26,12 +24,65 @@
// even worse, occasionally there would be a perma-TRITFIRE, if oxygen
// concentration was high enough. this caused a bunch of lag and added nothing to the game whatsoever
// thus, the temperatures were reduced to 70-90 C
minimum_temp = T20C + 50
maximum_temp = T20C + 70
minimum_temp = T20C + 20
maximum_temp = T20C + 40

/datum/atmosphere/icemoon
id = ICEMOON_DEFAULT_ATMOS

base_gases = list(
GAS_O2=5,
GAS_N2=10,
)
normal_gases = list(
GAS_O2=10,
GAS_N2=10,
GAS_CO2=10,
)
restricted_gases = list(
GAS_CO2=0.1,
)
restricted_chance = 50

minimum_pressure = HAZARD_LOW_PRESSURE + 10
maximum_pressure = LAVALAND_EQUIPMENT_EFFECT_PRESSURE - 1


minimum_temp = 200 //fucking cold to
maximum_temp = 240 //still cold


//wasteplanet

/datum/atmosphere/wasteplanet
id = WASTEPLANET_DEFAULT_ATMOS


base_gases = list(
GAS_O2=7,
GAS_N2=10,
)
normal_gases = list(
GAS_O2=7,
GAS_O2=3,
GAS_N2=5,
GAS_N2=2
)
restricted_gases = list(
GAS_O2=1,
)
restricted_chance = 0

minimum_pressure = ONE_ATMOSPHERE - 30
maximum_pressure = ONE_ATMOSPHERE + 100

minimum_temp = T20C - 10
maximum_temp = T20C + 20

//sandplanet
/datum/atmosphere/whitesands
id = SANDPLANET_DEFAULT_ATMOS

base_gases = list(
GAS_O2=5,
GAS_N2=10,
Expand All @@ -43,16 +94,89 @@
)
restricted_gases = list(
GAS_PLASMA=0.1,
GAS_H2O=0.1,
)
restricted_chance = 50

minimum_pressure = HAZARD_LOW_PRESSURE + 10
maximum_pressure = LAVALAND_EQUIPMENT_EFFECT_PRESSURE - 1

minimum_temp = 180
maximum_temp = 180
minimum_temp = 233
maximum_temp = 263 //No longer always 180

//Jungleplanet

/datum/atmosphere/jungleplanet
id = JUNGLEPLANET_DEFAULT_ATMOS

base_gases = list(
GAS_O2=15,
GAS_N2=60,
GAS_CO2=1,
)
normal_gases = list(
GAS_O2=1,
GAS_N2=4,
)
restricted_gases = list(
GAS_CO2=0.1,
)
restricted_chance = 0

minimum_pressure = 101.3
maximum_pressure = 135.7 //Nonsense values

minimum_temp = T20C + 10
maximum_temp = T20C + 20

//welcome to the beach

/datum/atmosphere/beach
id = BEACHPLANET_DEFAULT_ATMOS

base_gases = list(
GAS_O2=10,
GAS_N2=40,
)
normal_gases = list(
GAS_O2=1,
GAS_N2=4,
)
restricted_gases = list(
GAS_PLASMA=0.1,
)
restricted_chance = 0

minimum_pressure = 101.3
maximum_pressure = 135.7

minimum_temp = T20C - 10
maximum_temp = T20C + 10

//rockplanets have lots of CO2 and are moderately cold.
/datum/atmosphere/rockplanet

id = ROCKPLANET_DEFAULT_ATMOS

base_gases = list(
GAS_CO2=5,
GAS_N2=1,
)
normal_gases = list(
GAS_CO2=3,
GAS_N2=1,
)
restricted_gases = list(
GAS_PLASMA=0.1,
)
restricted_chance = 0

minimum_pressure = 101.3
maximum_pressure = 135.7

minimum_temp = T0C - 20
maximum_temp = T0C

// gas giants
/datum/atmosphere/gas_giant
id = GAS_GIANT_ATMOS

Expand Down Expand Up @@ -92,28 +216,3 @@
GAS_PLASMA=0.1,
)
restricted_chance = 1

/datum/atmosphere/wasteplanet
id = WASTEPLANET_DEFAULT_ATMOS


base_gases = list(
GAS_O2=7,
GAS_N2=10,
)
normal_gases = list(
GAS_O2=7,
GAS_O2=3,
GAS_N2=5,
GAS_N2=2
)
restricted_gases = list(
GAS_H2O=1,
)
restricted_chance = 10

minimum_pressure = ONE_ATMOSPHERE - 30
maximum_pressure = ONE_ATMOSPHERE + 100

minimum_temp = T20C + 1
maximum_temp = T20C + 80
25 changes: 0 additions & 25 deletions code/datums/mapgen/Whitesandsatmos.dm
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
#define WHITESANDS_WALL_ENV "rock"
#define WHITESANDS_SAND_ENV "sand"
#define WHITESANDS_DRIED_ENV "dried_up"
#define WHITESANDS_ATMOS "ws_atmos"

/datum/atmosphere/whitesands
id = WHITESANDS_ATMOS

base_gases = list(
GAS_O2=5,
GAS_N2=10,
)
normal_gases = list(
GAS_O2=10,
GAS_N2=10,
GAS_CO2=10,
)
restricted_gases = list(
GAS_PLASMA=0.1,
GAS_H2O=0.1,
)
restricted_chance = 50

minimum_pressure = HAZARD_LOW_PRESSURE + 10
maximum_pressure = LAVALAND_EQUIPMENT_EFFECT_PRESSURE - 1

minimum_temp = 180
maximum_temp = 180
2 changes: 1 addition & 1 deletion code/datums/weather/weather_types/hailstorm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
/// Think of some good solution of how weather should affect monsters and how they should be resistant to things like this
if(isanimal(living_mob))
return
living_mob.adjust_bodytemperature(-rand(3,6))
living_mob.adjust_bodytemperature(-rand(1,2))
living_mob.adjustBruteLoss(rand(2,4))
2 changes: 1 addition & 1 deletion code/datums/weather/weather_types/snow_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
sound_weak_inside = /datum/looping_sound/weak_inside_ashstorm

/datum/weather/snow_storm/weather_act(mob/living/living_mob)
living_mob.adjust_bodytemperature(-rand(5,15))
living_mob.adjust_bodytemperature(-rand(2,4))

2 changes: 1 addition & 1 deletion code/datums/weather/weather_types/snowfall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
thunder_chance = 2

/datum/weather/snowfall/heavy/weather_act(mob/living/living_mob)
living_mob.adjust_bodytemperature(-rand(2,4))
living_mob.adjust_bodytemperature(-rand(1,2))
13 changes: 13 additions & 0 deletions code/game/objects/effects/particles/smoke.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,16 @@
fadein = 0.7 SECONDS
position = generator(GEN_VECTOR, list(-3, 5, 0), list(3, 6.5, 0), NORMAL_RAND)
velocity = generator(GEN_VECTOR, list(-0.1, 0.4, 0), list(0.1, 0.5, 0), NORMAL_RAND)

/particles/fog
icon = 'icons/effects/particles/smoke.dmi'
icon_state = list("chill_1" = 2, "chill_2" = 2, "chill_3" = 1)

/particles/fog/breath
count = 1
spawning = 1
lifespan = 1 SECONDS
fade = 0.5 SECONDS
grow = 0.05
spin = 2
color = "#fcffffff"
4 changes: 2 additions & 2 deletions code/game/objects/structures/shower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@

if(current_temperature == SHOWER_FREEZING)
if(iscarbon(L))
C.adjust_bodytemperature(-80, 80)
C.adjust_bodytemperature(-5, 280)
to_chat(L, "<span class='warning'>[src] is freezing!</span>")
else if(current_temperature == SHOWER_BOILING)
if(iscarbon(L))
C.adjust_bodytemperature(35, 0, 500)
C.adjust_bodytemperature(5, 0, 350)
L.adjustFireLoss(5)
to_chat(L, "<span class='danger'>[src] is searing!</span>")

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/traps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
/obj/structure/trap/chill/trap_effect(mob/living/L)
to_chat(L, "<span class='danger'><B>You're frozen solid!</B></span>")
L.Paralyze(20)
L.adjust_bodytemperature(-300)
L.adjust_bodytemperature(-20)
L.apply_status_effect(/datum/status_effect/freon)


Expand Down
Loading

0 comments on commit 274becd

Please sign in to comment.