Hostile mobs will now destroy windoors

This commit is contained in:
alex-gh
2014-03-24 02:26:27 +01:00
parent ec14398231
commit b7eb15b120
2 changed files with 12 additions and 2 deletions
+9 -1
View File
@@ -189,6 +189,14 @@
/obj/machinery/door/window/attack_hand(mob/user as mob)
return src.attackby(user, user)
/obj/machinery/door/window/attack_animal(mob/user as mob)
if(!isanimal(user)) return
var/mob/living/simple_animal/M = user
if(M.melee_damage_upper <= 0) return
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
visible_message("\red <B>[user] smashes against the [src.name].</B>", 1)
take_damage(M.melee_damage_upper)
/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/user as mob)
//If it's in the process of opening/closing, ignore the click
@@ -349,4 +357,4 @@
/obj/machinery/door/window/brigdoor/southright
dir = SOUTH
icon_state = "rightsecure"
base_state = "rightsecure"
base_state = "rightsecure"
@@ -271,6 +271,8 @@
for(var/atom/A in T)
if(!A.Adjacent(src))
continue
if(istype(A, /obj/structure/window) || istype(A, /obj/structure/closet) || istype(A, /obj/structure/table) || istype(A, /obj/structure/grille) || istype(A, /obj/structure/rack))
if(istype(A, /obj/structure/window) || istype(A, /obj/structure/closet) || \
istype(A, /obj/structure/table) || istype(A, /obj/structure/grille) || \
istype(A, /obj/structure/rack) || istype(A, /obj/machinery/door/window))
A.attack_animal(src)
return