From 5be9559eef6bd16cc1d2442b926a1f40a8a2de89 Mon Sep 17 00:00:00 2001 From: nightred Date: Wed, 22 Jan 2020 18:21:25 -0600 Subject: [PATCH] Temperature projectiles respect insulation (#48912) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 /🆑 --- .../simple_animal/hostile/dark_wizard.dm | 1 + .../hostile/mining_mobs/basilisk.dm | 4 ++-- code/modules/projectiles/projectile/magic.dm | 2 +- .../projectile/special/temperature.dm | 23 +++++++++++++++---- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/dark_wizard.dm b/code/modules/mob/living/simple_animal/hostile/dark_wizard.dm index 6305c786d80..5c3e60c8377 100644 --- a/code/modules/mob/living/simple_animal/hostile/dark_wizard.dm +++ b/code/modules/mob/living/simple_animal/hostile/dark_wizard.dm @@ -38,3 +38,4 @@ damage = 4 damage_type = BURN flag = "energy" + temperature = -100 // closer to the old temp loss diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm index 7455461709f..0bf55c1a321 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm @@ -43,7 +43,7 @@ damage_type = BURN nodamage = TRUE flag = "energy" - temperature = 50 + temperature = -50 // Cools you down! per hit! /obj/projectile/temp/basilisk/heated name = "energy blast" @@ -186,7 +186,7 @@ mob/living/simple_animal/hostile/asteroid/basilisk/proc/cool_down() damage = 5 damage_type = BURN nodamage = FALSE - temperature = 500 //Heats you up! + temperature = 200 // Heats you up! per hit! /obj/projectile/temp/basilisk/magmawing/on_hit(atom/target, blocked = FALSE) . = ..() diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index a24ec941b57..1196acd7210 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -701,5 +701,5 @@ damage_type = BURN nodamage = FALSE armour_penetration = 100 - temperature = 50 + temperature = -200 // Cools you down greatly per hit flag = "magic" diff --git a/code/modules/projectiles/projectile/special/temperature.dm b/code/modules/projectiles/projectile/special/temperature.dm index dbabf2f8ef8..bc3fda6b93b 100644 --- a/code/modules/projectiles/projectile/special/temperature.dm +++ b/code/modules/projectiles/projectile/special/temperature.dm @@ -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)