From 6741b652a7df443d4330751d4410020590a74bd1 Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Fri, 25 Aug 2017 06:39:02 -0400 Subject: [PATCH] Adds CanSmashTurfs proc for simple animals (#30152) * Adds CanSmashTurfs proc for simple animals * Changes --- .../mob/living/simple_animal/hostile/gorilla/gorilla.dm | 3 +++ code/modules/mob/living/simple_animal/hostile/hostile.dm | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm index 2dfd879560e..18cddbe8746 100644 --- a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm +++ b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm @@ -71,6 +71,9 @@ var/list/parts = target_bodyparts(target) return ..() && !istype(the_target, /mob/living/carbon/monkey) && (!parts || parts.len > 3) +/mob/living/simple_animal/hostile/gorilla/CanSmashTurfs(turf/T) + return iswallturf(T) + /mob/living/simple_animal/hostile/gorilla/handle_automated_speech(override) if(speak_chance && (override || prob(speak_chance))) playsound(src, "sound/creatures/gorilla.ogg", 200) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 4dfc9d8a258..f379666a9a3 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -357,13 +357,15 @@ P.fire() return P +/mob/living/simple_animal/hostile/proc/CanSmashTurfs(turf/T) + return iswallturf(T) || ismineralturf(T) /mob/living/simple_animal/hostile/proc/DestroySurroundings() if(environment_smash) EscapeConfinement() for(var/dir in GLOB.cardinals) var/turf/T = get_step(targets_from, dir) - if(iswallturf(T) || ismineralturf(T)) + if(CanSmashTurfs(T)) if(T.Adjacent(targets_from)) T.attack_animal(src) for(var/a in T)