Add RCD effects
Port : https://github.com/tgstation/tgstation/pull/47894 & https://github.com/tgstation/tgstation/pull/48362/files
This commit is contained in:
@@ -439,18 +439,22 @@ 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)
|
||||
var/turf/the_turf = get_turf(A)
|
||||
var/turf_coords = "[COORD(the_turf)]"
|
||||
investigate_log("[user] is attempting to use [src] on [A] (loc [turf_coords] at [the_turf]) with cost [rcd_results["cost"]], delay [rcd_results["delay"]], mode [rcd_results["mode"]].", INVESTIGATE_RCD)
|
||||
if(do_after(user, rcd_results["delay"] * delay_mod, target = A))
|
||||
if(do_after(user, delay, target = A))
|
||||
if(checkResource(rcd_results["cost"], user))
|
||||
var/atom/cached = A
|
||||
if(A.rcd_act(user, src, rcd_results["mode"]))
|
||||
rcd_effect.end_animation()
|
||||
useResource(rcd_results["cost"], user)
|
||||
activate()
|
||||
investigate_log("[user] used [src] on [cached] (loc [turf_coords] at [the_turf]) with cost [rcd_results["cost"]], delay [rcd_results["delay"]], mode [rcd_results["mode"]].", INVESTIGATE_RCD)
|
||||
playsound(src, 'sound/machines/click.ogg', 50, 1)
|
||||
return TRUE
|
||||
qdel(rcd_effect)
|
||||
|
||||
/obj/item/construction/rcd/Initialize()
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user