From 2af2ae574807c41ddd6add9cbb7263bb01d2d94f Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Mon, 12 Dec 2011 05:19:46 +0000 Subject: [PATCH] Ian can now pull items and bodies that are either dead or unconscious. To stop pulling use the "stop pulling" verb. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2670 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/mob/simple_animal/corgi.dm | 74 ++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/code/defines/mob/simple_animal/corgi.dm b/code/defines/mob/simple_animal/corgi.dm index ed5cf705a4e..cba65cdabe8 100644 --- a/code/defines/mob/simple_animal/corgi.dm +++ b/code/defines/mob/simple_animal/corgi.dm @@ -193,7 +193,7 @@ ..() //Feeding, chasing food, FOOOOODDDD - if(alive && !resting && !buckled) + if(alive && !restrained() ) turns_since_scan++ if(turns_since_scan > 5) turns_since_scan = 0 @@ -240,6 +240,78 @@ dir = i sleep(1) +/mob/living/simple_animal/corgi/Ian/restrained() + if(resting || buckled) + return 1 + return 0 + +/mob/living/simple_animal/corgi/Ian/verb/stoppull() + set name = "Stop pulling" + set category = "IC" + + pulling = null + +/mob/living/simple_animal/corgi/Ian/Move() + if(restrained()) + pulling = null + return + + var/turf/old_loc + var/turf/new_loc + + if(isturf(loc)) + old_loc = src.loc + else + return //in a container, cannot move + + ..() + + if(isturf(loc)) + new_loc = src.loc + else + return //in a container, cannot move + + if(old_loc == new_loc) + return //has not moved + + if(pulling) + + if(isturf(old_loc) && isturf(pulling.loc)) + if(get_dist(src.loc,old_loc) > 1) + world << "get_dist(src.loc,pulling.loc)" + pulling = null + return + else + pulling = null + return + + if(istype(pulling,/obj/item)) + var/obj/item/I = pulling + if(I.w_class > 4) + pulling = null + return + if(I.anchored) + pulling = null + return + + I.loc = old_loc + return + + if(ismob(pulling)) + var/mob/M = pulling + if(!M.stat) + pulling = null + return //cannot drag live people + if(M.anchored) + pulling = null + return + if(M.restrained()) + pulling = null + return + + M.loc = old_loc + return + /obj/item/weapon/reagent_containers/food/snacks/meat/corgi name = "Corgi meat" desc = "Tastes like... well you know..." \ No newline at end of file