diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm
index ab12e53bcf..8f23d89a0b 100644
--- a/code/__DEFINES/atmospherics.dm
+++ b/code/__DEFINES/atmospherics.dm
@@ -69,13 +69,16 @@
#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 SYNTH_PASSIVE_HEAT_GAIN 10 //Degrees C per handle_environment() Synths passively heat up. Mitigated by cooling efficiency. Can lead to overheating if not managed.
-#define SYNTH_MAX_PASSIVE_GAIN_TEMP 250 //Degrees C above 0 that a synth can be heated up to by their internal heat gain, provided their cooling is insufficient to mitigate it.
+#define SYNTH_MAX_PASSIVE_GAIN_TEMP 250 //Degrees C that a synth can be heated up to by their internal heat gain, provided their cooling is insufficient to mitigate it.
+#define SYNTH_MIN_PASSIVE_COOLING_TEMP -30 //Degrees C a synth can cool towards at very high cooling efficiency.
#define SYNTH_HEAT_EFFICIENCY_COEFF 0.005 //How quick the difference between the Synth and the environment starts to matter. The smaller the higher the difference has to be for the same change.
#define SYNTH_SINGLE_INFLUENCE_COOLING_EFFECT_CAP 3 //How big can the multiplier for heat / pressure cooling be in an optimal environment
-#define SYNTH_TOTAL_ENVIRONMENT_EFFECT_CAP 2 //How big of an multiplier can the environment give in an optimal scenario (maximum efficiency in the end is 1, this just counters low coolant levels)
+#define SYNTH_TOTAL_ENVIRONMENT_EFFECT_CAP 2 //How big of an multiplier can the environment give in an optimal scenario (maximum efficiency in the end is at a lower cap, this mostly counters low coolant levels)
+#define SYNTH_MAX_COOLING_EFFICIENCY 1.5 //The maximum possible cooling efficiency one can achieve at optimal conditions.
#define SYNTH_ACTIVE_COOLING_TEMP_BOUNDARY 10 //The minimum distance from room temperature a Synth needs to have for active cooling to actively cool.
#define SYNTH_ACTIVE_COOLING_LOW_PRESSURE_THRESHOLD 0.05 //At how much percentage of default pressure (or lower) active cooling gets a massive cost penalty.
#define SYNTH_ACTIVE_COOLING_LOW_PRESSURE_PENALTY 2.5 //By how much is active cooling cost multiplied if in a very-low-pressure environment?
+#define SYNTH_ACTIVE_COOLING_MIN_ADJUSTMENT 5 //What is the minimum amount of temp you move towards the target point, even if it would be less with default calculations?
#define BODYTEMP_NORMAL 310.15 //The natural temperature for a body
#define BODYTEMP_AUTORECOVERY_DIVISOR 11 //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.
diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm
index d8d44690f2..fe8a716234 100644
--- a/code/_onclick/hud/human.dm
+++ b/code/_onclick/hud/human.dm
@@ -89,7 +89,7 @@
/atom/movable/screen/synth/proc/clear()
invisibility = INVISIBILITY_ABSTRACT
-/atom/movable/screen/synth/proc/update_counter(value, mob/living/carbon/human/owner)
+/atom/movable/screen/synth/proc/update_counter(mob/living/carbon/human/owner)
invisibility = 0
/atom/movable/screen/synth/coolant_counter
@@ -97,21 +97,30 @@
name = "Coolant System Readout"
icon_state = "coolant-3"
screen_loc = ui_coolant_display
+ var/jammed = 0
-/atom/movable/screen/synth/coolant_counter/update_counter(value, mob/living/carbon/owner)
+/atom/movable/screen/synth/coolant_counter/update_counter(mob/living/carbon/owner)
..()
var/valuecolor = "#FF6666"
if(owner.stat == DEAD)
maptext = "
ERR-0F
"
icon_state = "coolant-3"
return
- if(owner.blood_volume > BLOOD_VOLUME_SAFE * owner.blood_ratio)
+ var/coolant_efficiency
+ var/coolant
+ if(!jammed)
+ coolant_efficiency = owner.get_cooling_efficiency()
+ coolant = owner.blood_volume
+ else
+ coolant_efficiency = rand(1, 15) / 10
+ coolant = rand(1, 600)
+ jammed--
+ if(coolant > BLOOD_VOLUME_SAFE * owner.blood_ratio)
valuecolor = "#FFDDDD"
- else if(owner.blood_volume > BLOOD_VOLUME_BAD * owner.blood_ratio)
+ else if(coolant > BLOOD_VOLUME_BAD * owner.blood_ratio)
valuecolor = "#FFAAAA"
- maptext = "[round(value,1)]
"
+ maptext = "[round(coolant,1)]
"
- var/coolant_efficiency = owner.get_cooling_efficiency()
switch(coolant_efficiency)
if(-INFINITY to 0.4)
icon_state = "coolant-1"
@@ -129,9 +138,20 @@
var/mob/living/carbon/human/owner = hud.mymob
if(owner.stat == DEAD)
return
+ var/coolant
+ var/total_efficiency
+ var/environ_efficiency
+ if(!jammed)
+ coolant = owner.blood_volume
+ total_efficiency = owner.get_cooling_efficiency()
+ environ_efficiency = owner.get_environment_cooling_efficiency()
+ else
+ coolant = rand(1, 600)
+ total_efficiency = rand(1, 15) / 10
+ environ_efficiency = rand(1, 20) / 10
. += "Performing internal cooling system diagnostics:"
- . += "Coolant level: [owner.blood_volume] units, [round((owner.blood_volume / (BLOOD_VOLUME_NORMAL * owner.blood_ratio)) * 100, 0.1)] percent"
- . += "Current Cooling Efficiency: [round(owner.get_cooling_efficiency() * 100, 0.1)] percent, environment viability: [round(owner.get_environment_cooling_efficiency() * 100, 0.1)] percent."
+ . += "Coolant level: [coolant] units, [round((coolant / (BLOOD_VOLUME_NORMAL * owner.blood_ratio)) * 100, 0.1)] percent"
+ . += "Current Cooling Efficiency: [round(total_efficiency * 100, 0.1)] percent, environment viability: [round(environ_efficiency * 100, 0.1)] percent."
/datum/hud/human/New(mob/living/carbon/human/owner)
..()
diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm
index f888927411..0bd3083a59 100644
--- a/code/game/objects/items/stacks/medical.dm
+++ b/code/game/objects/items/stacks/medical.dm
@@ -488,6 +488,9 @@
icon_state = "nanogel"
var/being_applied = FALSE //No doafter stacking.
+/obj/item/stack/medical/nanogel/one
+ amount = 1
+
/obj/item/stack/medical/nanogel/try_heal(mob/living/M, mob/user, silent = FALSE)
if(being_applied)
to_chat(user, "You are already applying [src]!")
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index 16ab351d64..e1f4055998 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -416,6 +416,7 @@
severity *= 0.5
var/do_not_stun = FALSE
if(HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM))
+ hud_used?.coolant_display.jammed = min(round(hud_used.coolant_display.jammed + (severity / 10),1), 20) //Messes up the cooling system readout.
severity *= 0.5 //Robotpeople take less limb damage, but instead suffer system corruption (see carbon emp_act)
do_not_stun = TRUE
for(var/obj/item/bodypart/L in src.bodyparts)
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 1c73a4bd37..1ea28211af 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -31,7 +31,7 @@
if(!(. = ..()))
return
if(HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM) && hud_used)
- hud_used.coolant_display.update_counter(blood_volume, src)
+ hud_used.coolant_display.update_counter(src)
//Update our name based on whether our face is obscured/disfigured
name = get_visible_name()
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 4f26907eff..83486dc0f2 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -2190,8 +2190,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
natural = H.natural_bodytemperature_stabilization()
cooling_efficiency = H.get_cooling_efficiency()
- if(HAS_TRAIT(H, TRAIT_ROBOTIC_ORGANISM)) //Synths by default slowly heat up and need to lose said heat to the environment or active cooling.
- H.adjust_bodytemperature(SYNTH_PASSIVE_HEAT_GAIN * (1 - cooling_efficiency), max_temp = (T0C + SYNTH_MAX_PASSIVE_GAIN_TEMP))
+ if(HAS_TRAIT(H, TRAIT_ROBOTIC_ORGANISM)) //Synths by default slowly heat up and need to lose said heat to the environment or active cooling. If you have very high cooling efficiency, you instead passively cool.
+ H.adjust_bodytemperature(SYNTH_PASSIVE_HEAT_GAIN * (1 - cooling_efficiency), (T0C + SYNTH_MIN_PASSIVE_COOLING_TEMP), (T0C + SYNTH_MAX_PASSIVE_GAIN_TEMP))
var/thermal_protection = 1
if(loc_temp < H.bodytemperature) //Place is colder than we are
thermal_protection -= H.get_thermal_protection(loc_temp, TRUE) //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.
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index a2d1a12d17..d5c4ab8e7d 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -683,7 +683,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
var/coolant_efficiency = min(blood_effective_volume / BLOOD_VOLUME_SAFE, 1) //Low coolant is only a negative, adding more than needed will not help you.
var/environment_efficiency = get_environment_cooling_efficiency()
- return min(coolant_efficiency * environment_efficiency, 1)
+ return min(coolant_efficiency * environment_efficiency, SYNTH_MAX_COOLING_EFFICIENCY)
/mob/living/carbon/proc/get_environment_cooling_efficiency()
diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm
index 663cf1fdd7..cf17ec8545 100644
--- a/code/modules/research/designs/medical_designs.dm
+++ b/code/modules/research/designs/medical_designs.dm
@@ -213,7 +213,7 @@
category = list("Medical Designs")
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL | DEPARTMENTAL_FLAG_SCIENCE
-/datum/design/hypospray/mkii
+/datum/design/hypospray_mkii
name = "Hypospray Mk. II"
id = "hypospray_mkii"
build_type = PROTOLATHE
@@ -222,6 +222,15 @@
category = list("Medical Designs")
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
+/datum/design/nanogel
+ name = "Nanogel paste"
+ id = "nanogel"
+ build_type = PROTOLATHE | MECHFAB
+ materials = list(/datum/material/iron = 800, /datum/material/titanium = 500, /datum/material/gold = 100, /datum/material/diamond = 20)
+ build_path = /obj/item/stack/medical/nanogel/one
+ category = list("Medical Designs")
+ departmental_flags = DEPARTMENTAL_FLAG_MEDICAL | DEPARTMENTAL_FLAG_SCIENCE
+
/datum/design/blood_bag
name = "Empty Blood Bag"
desc = "A small sterilized plastic bag for blood."
diff --git a/code/modules/research/techweb/nodes/robotics_nodes.dm b/code/modules/research/techweb/nodes/robotics_nodes.dm
index 6248cd99aa..ee4fbd261b 100644
--- a/code/modules/research/techweb/nodes/robotics_nodes.dm
+++ b/code/modules/research/techweb/nodes/robotics_nodes.dm
@@ -28,7 +28,7 @@
display_name = "Advanced Robotics Research"
description = "It can even do the dishes!"
prereq_ids = list("robotics")
- design_ids = list("borg_upgrade_diamonddrill", "borg_upgrade_advancedmop", "borg_upgrade_advcutter")
+ design_ids = list("borg_upgrade_diamonddrill", "borg_upgrade_advancedmop", "borg_upgrade_advcutter", "nanogel")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 3000)
/datum/techweb_node/neural_programming
diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm
index 313a97a40d..8df0696098 100644
--- a/code/modules/surgery/organs/lungs.dm
+++ b/code/modules/surgery/organs/lungs.dm
@@ -484,9 +484,9 @@
var/actual_drain = cooling_coolant_drain * max(1 - cooling_efficiency, 0.2) //Being in a suitable environment reduces drain by up to 80%
var/temp_diff = owner.bodytemperature - T20C
if(temp_diff > 0)
- owner.adjust_bodytemperature(max(((T0C - owner.bodytemperature) * max(cooling_efficiency, 0.5) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX))
+ owner.adjust_bodytemperature(clamp(((T0C - owner.bodytemperature) * max(cooling_efficiency, 0.5) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX, -SYNTH_ACTIVE_COOLING_MIN_ADJUSTMENT))
else
- owner.adjust_bodytemperature(min(((T20C - owner.bodytemperature) * max(cooling_efficiency, 0.5) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX))
+ owner.adjust_bodytemperature(clamp(((T20C - owner.bodytemperature) * max(cooling_efficiency, 0.5) / BODYTEMP_HEAT_DIVISOR), SYNTH_ACTIVE_COOLING_MIN_ADJUSTMENT, BODYTEMP_HEATING_MAX))
var/datum/gas_mixture/air = owner.loc.return_air()
if(!air || air.return_pressure() < ONE_ATMOSPHERE * SYNTH_ACTIVE_COOLING_LOW_PRESSURE_THRESHOLD)
actual_drain *= SYNTH_ACTIVE_COOLING_LOW_PRESSURE_PENALTY //Our cooling system can handle hot places okayish, but starts to cry at low pressures (reads: Effectively vents hot coolant thats been warmed up via internal heat-exchange as emergency measure and with very low efficiency)