All turfs except /turf/simulated/wall can now be clicked to push pulled objects towards them

This commit is contained in:
GinjaNinja32
2014-12-10 22:08:44 +00:00
parent 44e8dd7153
commit 3968f8b492
4 changed files with 24 additions and 55 deletions

View File

@@ -218,29 +218,16 @@ turf/simulated/floor/proc/update_icon()
return 0
/turf/simulated/floor/attack_hand(mob/user as mob)
if (is_light_floor())
toggle_lightfloor_on()
update_icon()
if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
. = ..()
if(.)
return
if (user.pulling.anchored || !isturf(user.pulling.loc))
return
if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
return
if (ismob(user.pulling))
var/mob/M = user.pulling
// if(M==user) //temporary hack to stop runtimes. ~Carn
// user.stop_pulling() //but...fixed the root of the problem
// return //shoudn't be needed now, unless somebody fucks with pulling again.
var/mob/t = M.pulling
M.stop_pulling()
step(user.pulling, get_dir(user.pulling.loc, src))
M.start_pulling(t)
else
step(user.pulling, get_dir(user.pulling.loc, src))
return
if(is_light_floor())
if(user.canmove && !user.restrained())
toggle_lightfloor_on()
update_icon()
return 1
return 0
/turf/simulated/floor/proc/gets_drilled()
return

View File

@@ -11,23 +11,6 @@
if(!istype(src, /turf/space/transit))
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
/turf/space/attack_hand(mob/user as mob)
if ((user.restrained() || !( user.pulling )))
return
if (user.pulling.anchored || !isturf(user.pulling.loc))
return
if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
return
if (ismob(user.pulling))
var/mob/M = user.pulling
var/atom/movable/t = M.pulling
M.stop_pulling()
step(user.pulling, get_dir(user.pulling.loc, src))
M.start_pulling(t)
else
step(user.pulling, get_dir(user.pulling.loc, src))
return
/turf/space/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/stack/rods))

View File

@@ -37,6 +37,22 @@
/turf/ex_act(severity)
return 0
/turf/attack_hand(mob/user)
if(!(user.canmove) || user.restrained() || !(user.pulling))
return 0
if(user.pulling.anchored || !isturf(user.pulling.loc))
return 0
if(user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1)
return 0
if(ismob(user.pulling))
var/mob/M = user.pulling
var/atom/movable/t = M.pulling
M.stop_pulling()
step(user.pulling, get_dir(user.pulling.loc, src))
M.start_pulling(t)
else
step(user.pulling, get_dir(user.pulling.loc, src))
return 1
/turf/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj ,/obj/item/projectile/beam/pulse))

View File

@@ -2,20 +2,3 @@
name = "floor"
icon = 'icons/turf/floors.dmi'
icon_state = "Floor3"
/turf/unsimulated/floor/attack_hand(var/mob/user as mob)
if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
return
if (user.pulling.anchored || !isturf(user.pulling.loc))
return
if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
return
if (ismob(user.pulling))
var/mob/M = user.pulling
var/mob/t = M.pulling
M.stop_pulling()
step(user.pulling, get_dir(user.pulling.loc, src))
M.start_pulling(t)
else
step(user.pulling, get_dir(user.pulling.loc, src))
return