Skip to content

Commit

Permalink
repulsor touch ups
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasint committed Oct 29, 2023
1 parent bc5966d commit 2b2ea9c
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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)

0 comments on commit 2b2ea9c

Please sign in to comment.