From b4d15e55e14d245d300c578f7364ddda76371652 Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Sat, 12 Jan 2013 17:56:12 +0000 Subject: [PATCH] -Added a check for anchored items for spiders to caccoon. -Removed some copy and pasted code. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5529 316c924e-a436-60f5-8080-3fe189b3f50e --- .../simple_animal/hostile/giant_spider.dm | 35 ++++--------------- tgstation.dme | 1 + 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 673d3bb1a77..c1edcdea208 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -138,39 +138,16 @@ //fourthly, cocoon any nearby items so those pesky pinkskins can't use them for(var/obj/O in can_see) - if(istype(O, /obj/item)) - var/obj/item/I = O - cocoon_target = I - busy = MOVING_TO_TARGET - stop_automated_movement = 1 - walk_to(src, I, 1, move_to_delay) - //give up if we can't reach them after 10 seconds - GiveUp(I) - return + if(O.anchored) + continue - if(istype(O, /obj/structure)) - var/obj/structure/S = O - if(S.anchored) - continue - cocoon_target = S + if(istype(O, /obj/item) || istype(O, /obj/structure) || istype(O, /obj/machinery)) + cocoon_target = O busy = MOVING_TO_TARGET stop_automated_movement = 1 - walk_to(src, S, 1, move_to_delay) + walk_to(src, O, 1, move_to_delay) //give up if we can't reach them after 10 seconds - GiveUp(S) - return - - if(istype(O, /obj/machinery)) - var/obj/machinery/M = O - if(M.anchored) - continue - cocoon_target = M - busy = MOVING_TO_TARGET - stop_automated_movement = 1 - walk_to(src, M, 1, move_to_delay) - //give up if we can't reach them after 10 seconds - GiveUp(M) - return + GiveUp(O) else if(busy == MOVING_TO_TARGET && cocoon_target) if(get_dist(src, cocoon_target) <= 1) diff --git a/tgstation.dme b/tgstation.dme index 02984bb6613..245da9ed49f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -733,6 +733,7 @@ #include "code\modules\events\prison_break.dm" #include "code\modules\events\radiation_storm.dm" #include "code\modules\events\spacevine.dm" +#include "code\modules\events\spider_infestation.dm" #include "code\modules\events\spontaneous_appendicitis.dm" #include "code\modules\flufftext\Dreaming.dm" #include "code\modules\flufftext\Hallucination.dm"