Add RCD effects
Port : https://github.com/tgstation/tgstation/pull/47894 & https://github.com/tgstation/tgstation/pull/48362/files
This commit is contained in:
@@ -452,4 +452,44 @@
|
||||
icon_state = "slugboom"
|
||||
randomdir = FALSE
|
||||
duration = 30
|
||||
pixel_x = -24
|
||||
pixel_x = -24
|
||||
|
||||
/obj/effect/constructing_effect
|
||||
icon = 'icons/effects/effects_rcd.dmi'
|
||||
icon_state = ""
|
||||
layer = ABOVE_ALL_MOB_LAYER
|
||||
anchored = TRUE
|
||||
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)
|
||||
Reference in New Issue
Block a user