[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 03:30:16 -05: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)
+5 -1
View File
@@ -473,14 +473,18 @@ RLD
var/list/rcd_results = A.rcd_vals(user, src)
if(!rcd_results)
return FALSE
var/delay = rcd_results["delay"] * delay_mod
var/obj/effect/constructing_effect/rcd_effect = new(get_turf(A), delay, src.mode)
if(checkResource(rcd_results["cost"], user))
if(do_after(user, rcd_results["delay"] * delay_mod, target = A))
if(do_after(user, delay, target = A))
if(checkResource(rcd_results["cost"], user))
if(A.rcd_act(user, src, rcd_results["mode"]))
rcd_effect.end_animation()
useResource(rcd_results["cost"], user)
activate()
playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE)
return TRUE
qdel(rcd_effect)
/obj/item/construction/rcd/Initialize()
. = ..()