Adding more animations and overheating effect to the sensors suite (#15252)

This commit is contained in:
Mykhailo Bykhovtsev
2022-12-10 12:05:32 +01:00
committed by GitHub
parent 27a98e9615
commit 2d559cd992
4 changed files with 72 additions and 4 deletions
@@ -196,7 +196,7 @@
/obj/machinery/shipsensors
name = "sensors suite"
desc = "Long range gravity scanner with various other sensors, used to detect irregularities in surrounding space. Can only run in vacuum to protect delicate quantum BS elements."
icon = 'icons/obj/stationobjs.dmi'
icon = 'icons/obj/machines/sensors.dmi'
icon_state = "sensors"
anchored = 1
var/max_health = 200
@@ -237,10 +237,35 @@
return 1
/obj/machinery/shipsensors/update_icon()
if(use_power)
icon_state = "sensors"
icon_state = "sensors_off"
if(!use_power)
cut_overlays()
return
var/overlay = "sensors-effect"
var/range_percentage = range / world.view * 100
if(range_percentage < 20)
overlay = "[overlay]1"
else if(range_percentage < 40)
overlay = "[overlay]2"
else if(range_percentage < 60)
overlay = "[overlay]3"
else if(range_percentage < 80)
overlay = "[overlay]4"
else
icon_state = "sensors_off"
overlay = "[overlay]5"
// Check if we are already using this overlay. Since updating is expensive.
if(!(overlay in our_overlays))
cut_overlays()
add_overlay(overlay)
var/heat_percentage = heat / critical_heat * 100
if(heat_percentage > 85)
add_overlay("sensors-effect-hot")
/obj/machinery/shipsensors/examine(mob/user)
. = ..()
@@ -280,6 +305,8 @@
if (heat > 0)
heat = max(0, heat - heat_reduction)
update_icon()
/obj/machinery/shipsensors/power_change()
. = ..()