No more multi-Z grabs, + ladder grabbing (#3025)

Grabs break if the mobs aren't on the same Z level. You also take someone you're grabbing up ladders with you.
This commit is contained in:
MarinaGryphon
2017-07-15 17:03:37 +03:00
committed by skull132
parent b4a34d27f9
commit f04baf71ac
2 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -288,7 +288,7 @@
return 0
if(affecting)
if(!isturf(assailant.loc) || ( !isturf(affecting.loc) || assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1) )
if(!isturf(assailant.loc) || ( !isturf(affecting.loc) || assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1) || assailant.z != affecting.z )
qdel(src)
return 0
+14 -1
View File
@@ -54,9 +54,17 @@
var/obj/structure/ladder/target_ladder = getTargetLadder(M)
if(!target_ladder)
return
var/obj/item/weapon/grab/G = M.l_hand
if (!istype(G))
G = M.r_hand
if(!M.Move(get_turf(src)))
to_chat(M, "<span class='notice'>You fail to reach \the [src].</span>")
return
if (istype(G))
G.affecting.forceMove(get_turf(src))
var/direction = target_ladder == target_up ? "up" : "down"
@@ -66,7 +74,7 @@
target_ladder.audible_message("<span class='notice'>You hear something coming [direction] \the [src]</span>")
if(do_after(M, climb_time))
if(do_after(M, istype(G) ? (climb_time*2) : climb_time))
climbLadder(M, target_ladder)
/obj/structure/ladder/attack_ghost(var/mob/M)
@@ -126,6 +134,11 @@
if(!A.CanPass(M, M.loc, 1.5, 0))
to_chat(M, "<span class='notice'>\The [A] is blocking \the [src].</span>")
return FALSE
var/obj/item/weapon/grab/G = M.l_hand
if (!istype(G))
G = M.r_hand
if (istype(G))
G.affecting.forceMove(T)
return M.Move(T)
/obj/structure/ladder/CanPass(obj/mover, turf/source, height, airflow)