mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Fixes the juggernaut reflect and refactors the reflect to be a proc instead of copy pasta
This commit is contained in:
@@ -302,6 +302,21 @@
|
||||
Range()
|
||||
sleep(1)
|
||||
|
||||
obj/item/projectile/proc/reflect_back(atom/source, list/position_modifiers = list(0, 0, 0, 0, 0, -1, 1, -2, 2))
|
||||
if(starting)
|
||||
var/new_x = starting.x + pick(position_modifiers)
|
||||
var/new_y = starting.y + pick(position_modifiers)
|
||||
var/turf/curloc = get_turf(source)
|
||||
|
||||
// redirect the projectile
|
||||
firer = source
|
||||
original = locate(new_x, new_y, z)
|
||||
starting = curloc
|
||||
current = curloc
|
||||
yo = new_y - curloc.y
|
||||
xo = new_x - curloc.x
|
||||
Angle = null // Will be calculated in fire()
|
||||
|
||||
obj/item/projectile/Crossed(atom/movable/AM, oldloc) //A mob moving on a tile with a projectile is hit by it.
|
||||
..()
|
||||
if(isliving(AM) && AM.density && !checkpass(PASSMOB))
|
||||
|
||||
Reference in New Issue
Block a user