From 2aeff0b79ed9267673f150b47f7805de6c50d3d1 Mon Sep 17 00:00:00 2001 From: "n3ophyt3@gmail.com" Date: Tue, 28 Sep 2010 04:04:57 +0000 Subject: [PATCH] Fixed a bug with the foam dart crossbow. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@202 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/obj/toy.dm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/code/defines/obj/toy.dm b/code/defines/obj/toy.dm index 5d227b68e3b..6fc8722908f 100644 --- a/code/defines/obj/toy.dm +++ b/code/defines/obj/toy.dm @@ -117,6 +117,11 @@ obj/item/toy/crossbow/afterattack(atom/target as mob|obj|turf|area, mob/user as del(D) return + else if (bullets == 0) + user.weakened += 5 + for(var/mob/O in viewers(world.view, user)) + O.show_message(text("\red [] realized they were out of ammo and starting scrounging for some!", user), 1) + obj/item/toy/crossbow/attack(mob/M as mob, mob/user as mob) src.add_fingerprint(user) @@ -128,13 +133,14 @@ obj/item/toy/crossbow/attack(mob/M as mob, mob/user as mob) for(var/mob/O in viewers(M, null)) if(O.client) O.show_message(text("\red [] casually lines up a shot with []'s head and pulls the trigger!", user, M), 1, "\red You hear the sound of foam against skull", 2) - playsound(user.loc, 'syringeproj.ogg', 50, 1) O.show_message(text("\red [] was hit in the head by the foam dart!", M), 1) - new /obj/item/toy/ammo/crossbow(M.loc) - src.bullets-- - else if (M.lying && !src.bullets) + playsound(user.loc, 'syringeproj.ogg', 50, 1) + new /obj/item/toy/ammo/crossbow(M.loc) + src.bullets-- + else if (M.lying && src.bullets == 0) for(var/mob/O in viewers(M, null)) - if (O.client) O.show_message(text("\red [] casually lines up a shot with []'s head, then realizes they are out of ammo!", user, M), 1, "\red You hear nothing", 2) + if (O.client) O.show_message(text("\red [] casually lines up a shot with []'s head, pulls the trigger, then realizes they are out of ammo and drops to the floor in search of some!", user, M), 1, "\red You hear someone fall", 2) + user.weakened += 5 return /obj/item/toy/ammo/gun/proc/update_icon()