Temperature projectiles respect insulation (#48912)

About The Pull Request

Guns, Spells, and mobs that use temperature based projectiles got an update so that the projectile must deal with insulation when applying temperature changes.
The more insulation you have the less body temperature change you will take.

This does not change how much damage you take from a projectile.

The projectiles have been updated from the temperature to be set as, to the amount of change they can do.
The old security temp gun would always set the body temp to 100 kelvin, now each shot tries to reduce your body temp by -50 kelvin before insulation. The reverse is also true for temp projectiles that heat you up.

This does mean that naked you will take more body temp loss, and in a hard suit you have almost no temp change. (hardsuits do protect you from space cold so this follows)

edit: this does not touch cryo sting, that uses frost oil.
Why It's Good For The Game

Better handling of temperature shots.
Insulation matters in combat.
Cold blooded creatures are better off with good insulation.
Changelog

🆑
balance: Temperature based projectiles respect insulation
/🆑
This commit is contained in:
nightred
2020-01-23 13:21:25 +13:00
committed by oranges
parent bae97dc6a7
commit 5be9559eef
4 changed files with 23 additions and 7 deletions
+1 -1
View File
@@ -701,5 +701,5 @@
damage_type = BURN
nodamage = FALSE
armour_penetration = 100
temperature = 50
temperature = -200 // Cools you down greatly per hit
flag = "magic"
@@ -5,21 +5,36 @@
damage_type = BURN
nodamage = FALSE
flag = "energy"
var/temperature = 100
var/temperature = -50 // reduce the body temperature by 50 points
/obj/projectile/temp/on_hit(atom/target, blocked = 0)
. = ..()
if(isliving(target))
if(iscarbon(target))
var/mob/living/carbon/hit_mob = target
var/thermal_protection = 1 // The inverse of the amount of protection
if(temperature > 0) // The projectile is hot
thermal_protection -= hit_mob.get_heat_protection(hit_mob.bodytemperature + temperature)
else // The projectile was cold
thermal_protection -= hit_mob.get_cold_protection(hit_mob.bodytemperature + temperature)
// The new body temperature is adjusted by 100-blocked % of the bullet's effect temperature
// Reduce the amount of the effect temperature change based on the amount of insulation the mob is wearing
hit_mob.adjust_bodytemperature(((100 - blocked) / 100) * (thermal_protection * temperature))
else if(isliving(target))
var/mob/living/L = target
L.adjust_bodytemperature(((100-blocked)/100)*(temperature - L.bodytemperature)) // the new body temperature is adjusted by 100-blocked % of the delta between body temperature and the bullet's effect temperature
// the new body temperature is adjusted by 100-blocked % of the bullet's effect temperature
L.adjust_bodytemperature(((100 - blocked) / 100) * temperature)
/obj/projectile/temp/hot
name = "heat beam"
temperature = 400
temperature = 100 // Raise the body temp by 100 points
/obj/projectile/temp/cryo
name = "cryo beam"
range = 3
temperature = -240 // Single slow shot reduces temp greatly
/obj/projectile/temp/cryo/on_range()
var/turf/T = get_turf(src)