The real slips rewrite (#22490)

* Fix a bug in forceMove

Don't call Exited/Entered if the loc is the same

* Added forced_movement

* Remove usages comment

Fixed a parameters bug

* Refactor slips

* Refactors meathook

* Negative check

* Shittier syntax, more performance

* Seperation of src and args

* Sanity check

Because you know someone will fuck it up

* X to Y is inclusive

* Bettter diagonals

* Remove unused var

* Better suggestion

* This was never used, why was it here?

* Arg prefixing...

* Better cleanup

* Do not touch the self managing var

* Cleanup

* More cleanup

* Missed 2

* Added callbacks

* Fix ice again

* Sanity checks

* Applied to larva/attack_hulk

* Fix the chain's usage

* LDFJAHDJKAGFHLJKDSAGHJKLSDAGBLKJADGFHKLJADGNLKAMDFNBJK:ANFDJKLADSNLSJKDFHNASFADSFLK:AJFL:KASJFKLASJF:LAJSF:LKJASKFMSALKF
This commit is contained in:
Cyberboss
2017-01-12 13:57:23 +13:00
committed by oranges
parent 03e659b18c
commit de454f5a35
10 changed files with 122 additions and 33 deletions
@@ -193,14 +193,18 @@
if(firer)
chain = firer.Beam(src, icon_state = "chain", time = INFINITY, maxdistance = INFINITY)
..()
//TODO: root the firer until the chain returns
/obj/item/projectile/hook/on_hit(atom/target)
. = ..()
if(isliving(target))
var/mob/living/L = target
if(!L.anchored)
L.visible_message("<span class='danger'>[L] is snagged by [firer]'s hook!</span>")
L.forceMove(get_turf(firer))
if(istype(target, /atom/movable))
var/atom/movable/A = target
if(A.anchored)
return
A.visible_message("<span class='danger'>[A] is snagged by [firer]'s hook!</span>")
new /datum/forced_movement(A, get_turf(firer), 5, TRUE)
//TODO: keep the chain beamed to A
//TODO: needs a callback to delete the chain
/obj/item/projectile/hook/Destroy()
qdel(chain)