diff --git a/code/LINDA/LINDA_fire.dm b/code/LINDA/LINDA_fire.dm index 822c96f6632..cc2adb6300a 100644 --- a/code/LINDA/LINDA_fire.dm +++ b/code/LINDA/LINDA_fire.dm @@ -48,7 +48,7 @@ icon_state = "1" layer = TURF_LAYER - light_color = "#ED9200" + blend_mode = BLEND_ADD var/volume = 125 var/temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST @@ -57,7 +57,8 @@ /obj/effect/hotspot/New() ..() - set_light(7) + color = heat2color(temperature) + set_light(3, 1, color) air_master.hotspots += src /obj/effect/hotspot/proc/perform_exposure() @@ -83,6 +84,9 @@ if(item) // It's possible that the item is deleted in temperature_expose item.fire_act(null, temperature, volume) + animate(src, color = heat2color(temperature), 5) + set_light(l_color = color) + return 0 @@ -113,6 +117,7 @@ if(bypassing) icon_state = "3" + set_light(7,3) location.burn_tile() //Possible spread due to radiated heat @@ -128,8 +133,10 @@ else if(volume > CELL_VOLUME*0.4) icon_state = "2" + set_light(5, 2) else icon_state = "1" + set_light(3, 1) if(temperature > location.max_fire_temperature_sustained) location.max_fire_temperature_sustained = temperature @@ -149,6 +156,7 @@ qdel(src) /obj/effect/hotspot/Destroy() + set_light(0) if(istype(loc, /turf/simulated)) var/turf/simulated/T = loc if(T.active_hotspot == src) diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 634697b8e44..bac5959d630 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -366,3 +366,32 @@ proc/tg_text2list(text, glue=",", assocglue=";") finalNum = copytext(finalNum, 1, pos) + sep + copytext(finalNum, pos) return finalNum + + +// heat2color functions. Adapted from: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/ +/proc/heat2color(temp) + return rgb(heat2color_r(temp), heat2color_g(temp), heat2color_b(temp)) + +/proc/heat2color_r(temp) + temp /= 100 + if(temp <= 66) + . = 255 + else + . = max(0, min(255, 329.698727446 * (temp - 60) ** -0.1332047592)) + +/proc/heat2color_g(temp) + temp /= 100 + if(temp <= 66) + . = max(0, min(255, 99.4708025861 * log(temp) - 161.1195681661)) + else + . = max(0, min(255, 288.1221695283 * ((temp - 60) ** -0.0755148492))) + +/proc/heat2color_b(temp) + temp /= 100 + if(temp >= 66) + . = 255 + else + if(temp <= 16) + . = 0 + else + . = max(0, min(255, 138.5177312231 * log(temp - 10) - 305.0447927307)) \ No newline at end of file diff --git a/code/modules/lighting/lighting_overlay.dm b/code/modules/lighting/lighting_overlay.dm index e14ccd8f63f..932eee6461a 100644 --- a/code/modules/lighting/lighting_overlay.dm +++ b/code/modules/lighting/lighting_overlay.dm @@ -1,5 +1,5 @@ /atom/movable/lighting_overlay - name = "loverlay" + name = "" mouse_opacity = 0 simulated = 0 anchored = 1 diff --git a/icons/effects/fire.dmi b/icons/effects/fire.dmi index 2b9071d25ef..5f5cfe3a2f9 100644 Binary files a/icons/effects/fire.dmi and b/icons/effects/fire.dmi differ