[NEW AND IMPROVED AND READY TO MINGLE] Adds animations to RCD construction (#47894)

* start

* new images

* more finished

* lessgo

* yaga

* better

* ty zxaber
This commit is contained in:
MrDoomBringer
2019-11-27 09:30:16 +01:00
committed by skoglol
parent 2eb4bf3478
commit d75cbd0a29
3 changed files with 43 additions and 1 deletions
@@ -462,3 +462,41 @@
else
return INITIALIZE_HINT_QDEL
/obj/effect/constructing_effect
icon = 'icons/effects/effects_rcd.dmi'
icon_state = ""
layer = ABOVE_ALL_MOB_LAYER
var/status = 0
var/delay = 0
/obj/effect/constructing_effect/Initialize(mapload, rcd_delay, rcd_status)
. = ..()
status = rcd_status
delay = rcd_delay
if (status == RCD_DECONSTRUCT)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 11)
delay -= 11
icon_state = "rcd_end_reverse"
else
update_icon()
/obj/effect/constructing_effect/update_icon()
icon_state = "rcd"
if (delay < 10)
icon_state += "_shortest"
else if (delay < 20)
icon_state += "_shorter"
else if (delay < 37)
icon_state += "_short"
if (status == RCD_DECONSTRUCT)
icon_state += "_reverse"
/obj/effect/constructing_effect/proc/end_animation()
if (status == RCD_DECONSTRUCT)
qdel(src)
else
icon_state = "rcd_end"
addtimer(CALLBACK(src, .proc/end), 15)
/obj/effect/constructing_effect/proc/end()
qdel(src)