From 2b2ea9c82238fa34ba9b4878fa0d8428f09d4343 Mon Sep 17 00:00:00 2001 From: dwasint <82520990+dwasint@users.noreply.github.com> Date: Sun, 29 Oct 2023 02:04:00 -0400 Subject: [PATCH] repulsor touch ups --- .../artifact_components/repulsor.dm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/monkestation/code/modules/art_sci_overrides/artifact_components/repulsor.dm b/monkestation/code/modules/art_sci_overrides/artifact_components/repulsor.dm index c9e81c01d6e3..6cc73b792a4e 100644 --- a/monkestation/code/modules/art_sci_overrides/artifact_components/repulsor.dm +++ b/monkestation/code/modules/art_sci_overrides/artifact_components/repulsor.dm @@ -15,11 +15,20 @@ /datum/component/artifact/repulsor/setup() attract = prob(40) range = rand(1,3) - cooldown_time = rand(10,40) SECONDS + cooldown_time = rand(3,5) SECONDS strength = rand(MOVE_FORCE_DEFAULT,MOVE_FORCE_OVERPOWERING) potency += cooldown_time / 4 + strength / 3000 /datum/component/artifact/repulsor/effect_touched(mob/user) + if(!COOLDOWN_FINISHED(src,cooldown)) + return + pulse() + COOLDOWN_START(src,cooldown,cooldown_time) + +/datum/component/artifact/repulsor/effect_process() + . = ..() + if(prob(100 - potency)) + return pulse() /datum/component/artifact/repulsor/RegisterWithParent() @@ -32,11 +41,10 @@ /datum/component/artifact/repulsor/proc/pulse(datum/source,atom/movable/thrown, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) SIGNAL_HANDLER - if(!active || !COOLDOWN_FINISHED(src,cooldown)) + if(!active) return holder.visible_message(span_warning("[holder] emits a pulse of energy, throwing things [attract ? "towards it!" : "away from it!"]")) var/owner_turf = get_turf(holder) - var/real_cooldown_time = cooldown_time if(isnull(thrown)) for(var/atom/movable/throwee in oview(range,holder)) if(throwee.anchored) @@ -47,6 +55,4 @@ var/throwtarget = get_edge_target_turf(get_turf(throwee), get_dir(owner_turf, get_step_away(throwee, owner_turf))) throwee.safe_throw_at(throwtarget, strength / 3000, 1, force = strength) else if(throwingdatum?.thrower) - real_cooldown_time = real_cooldown_time / 4 thrown.safe_throw_at(throwingdatum.thrower, get_dist(holder, throwingdatum.thrower), 1, force = strength) - COOLDOWN_START(src,cooldown,cooldown_time)