Files
VOREStation/code/modules/vore/resizing/grav_pull_vr.dm
T
Will eba43f278c Explosion subsystem (#17499)
* Initial port

* pause air

* decoupled input from processing

* explosion condition tweak

* closer to original recursive code

* accurate explosions

* better defer calls

* glob fix

* fix

* DON'T DO THAT

* initial deferral code

* small explosions ignored

* lower thresholds

* better thresholds again

* forbid powernet defer during init, explosions too

* don't block your own network regen

* use procs

* better thresholds, always defer at least

* admin notice

* subsytem updated

* Allow removal from networks

* defer till rebuild

* dir

* Update breaker_box.dm

* no init means no init

* then flag it...

---------

Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com>
Co-authored-by: C.L. <killer65311@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-08-15 22:55:19 +02:00

57 lines
1.5 KiB
Plaintext

//
// Gravity Pull effect which draws in movable objects to its center.
// In this case, "number" refers to the range. directions is ignored.
//
/datum/effect/effect/system/grav_pull
var/pull_radius = 3
var/pull_anchored = 0
var/break_windows = 0
/datum/effect/effect/system/grav_pull/set_up(range, num, loca)
pull_radius = range
number = num
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
/datum/effect/effect/system/grav_pull/start()
spawn(0)
if(holder)
location = get_turf(holder)
for(var/i = 0, i < number, i++)
do_pull()
sleep(25)
/datum/effect/effect/system/grav_pull/proc/do_pull()
// Let's just make this one loop.
for(var/X in orange(pull_radius, location))
// Movable atoms only
if(!ismovable(X) || istype(X, /obj/effect/overlay))
continue
if(ishuman(X))
var/mob/living/carbon/human/H = X
if(istype(H.shoes, /obj/item/clothing/shoes/magboots))
var/obj/item/clothing/shoes/magboots/M = H.shoes
if(M.magpulse)
step_towards(H, location) //step just once with magboots
continue
step_towards(H, location) //step twice
step_towards(H, location)
else
if(break_windows && istype(X, /obj/structure/window)) //shatter windows
var/obj/structure/window/W = X
W.ex_act(2.0)
if(isobj(X))
var/obj/O = X
if(O.anchored)
if(!pull_anchored)
continue // Don't pull anchored stuff unless configured
step_towards(X, location) // step just once if anchored
continue
step_towards(X, location) // Step twice
step_towards(X, location)