Merge pull request #4762 from Citadel-Station-13/upstream-merge-33817

[MIRROR] [READY]Pulling claw 2
This commit is contained in:
LetterJay
2018-01-11 15:19:11 -06:00
committed by GitHub
10 changed files with 162 additions and 57 deletions
-16
View File
@@ -452,24 +452,8 @@
return 0
var/old_direction = dir
var/atom/movable/pullee = pulling
if(pullee && get_dist(src, pullee) > 1)
stop_pulling()
if(pullee && !isturf(pullee.loc) && pullee.loc != loc) //to be removed once all code that changes an object's loc uses forceMove().
log_game("DEBUG:[src]'s pull on [pullee] wasn't broken despite [pullee] being in [pullee.loc]. Pull stopped manually.")
stop_pulling()
var/turf/T = loc
. = ..()
if(. && pulling && pulling == pullee) //we were pulling a thing and didn't lose it during our move.
if(pulling.anchored)
stop_pulling()
return
var/pull_dir = get_dir(src, pulling)
if(get_dist(src, pulling) > 1 || ((pull_dir - 1) & pull_dir)) //puller and pullee more than one tile away or in diagonal position
pulling.Move(T, get_dir(pulling, T)) //the pullee tries to reach our previous position
if(pulling && get_dist(src, pulling) > 1) //the pullee couldn't keep up
stop_pulling()
if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1)//separated from our puller and not in the middle of a diagonal move.
pulledby.stop_pulling()
+7 -13
View File
@@ -335,7 +335,7 @@
return 1
//this and stop_pulling really ought to be /mob/living procs
/mob/proc/start_pulling(atom/movable/AM, supress_message = 0)
/mob/start_pulling(atom/movable/AM, supress_message = 0)
if(!AM || !src)
return FALSE
if(!(AM.can_be_pulled(src)))
@@ -410,20 +410,14 @@
setDir(D)
spintime -= speed
/mob/verb/stop_pulling()
/mob/stop_pulling()
..()
update_pull_hud_icon()
/mob/verb/stop_pulling1()
set name = "Stop Pulling"
set category = "IC"
if(pulling)
pulling.pulledby = null
var/mob/living/ex_pulled = pulling
pulling = null
grab_state = 0
update_pull_hud_icon()
if(isliving(ex_pulled))
var/mob/living/L = ex_pulled
L.update_canmove()// mob gets up if it was lyng down in a chokehold
stop_pulling()
/mob/proc/update_pull_hud_icon()
if(hud_used)
-2
View File
@@ -29,8 +29,6 @@
var/obj/machinery/machine = null
var/other_mobs = null
var/atom/movable/pulling = null
var/grab_state = 0
var/next_move = null
var/notransform = null //Carbon
-18
View File
@@ -266,24 +266,6 @@
/mob/proc/mob_negates_gravity()
return FALSE
//moves the mob/object we're pulling
/mob/proc/Move_Pulled(atom/A)
if(!pulling)
return
if(pulling.anchored || !pulling.Adjacent(src))
stop_pulling()
return
if(isliving(pulling))
var/mob/living/L = pulling
if(L.buckled && L.buckled.buckle_prevents_pull) //if they're buckled to something that disallows pulling, prevent it
stop_pulling()
return
if(A == loc && pulling.density)
return
if(!Process_Spacemove(get_dir(pulling.loc, A)))
return
step(pulling, get_dir(pulling.loc, A))
/mob/proc/slip(s_amount, w_amount, obj/O, lube)
return