Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions code/game/objects/effects/temporary_visuals/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -493,3 +493,42 @@
randomdir = FALSE
duration = 2 SECONDS
icon_state = "summon"

/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, .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)
3 changes: 3 additions & 0 deletions code/game/objects/items/RCD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -538,14 +538,17 @@ RLD
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, 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()
. = ..()
Expand Down
Binary file added icons/effects/effects_rcd.dmi
Binary file not shown.