From 1a4d38dfab08413f4e43688576bd19249f050eb6 Mon Sep 17 00:00:00 2001 From: "petethegoat@gmail.com" Date: Wed, 14 Nov 2012 20:37:43 +0000 Subject: [PATCH] Added stomping sound effects to the mech toys. Thanks to Skasi for the idea. Click them inhand to make a stomp, and click them with your other hand to make a turn. Added a cooldown to riot shield bashing, as it does actually seem to cause lag. Kor was right! Who knew? git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5066 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/obj/toy.dm | 17 +++++++++++++++++ code/defines/obj/weapon.dm | 9 +++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/code/defines/obj/toy.dm b/code/defines/obj/toy.dm index e47f11f7774..afddd617a46 100644 --- a/code/defines/obj/toy.dm +++ b/code/defines/obj/toy.dm @@ -10,6 +10,23 @@ /obj/item/toy/prize icon = 'icons/obj/toy.dmi' icon_state = "ripleytoy" + var/cooldown = 0 + +//all credit to skasi for toy mech fun ideas +/obj/item/toy/prize/attack_self(mob/user as mob) + if(cooldown < world.time - 8) + user << "You play with [src]." + playsound(user, 'sound/mecha/mechstep.ogg', 20, 1) + cooldown = world.time + +/obj/item/toy/prize/attack_hand(mob/user as mob) + if(loc == user) + if(cooldown < world.time - 8) + user << "You play with [src]." + playsound(user, 'sound/mecha/mechturn.ogg', 20, 1) + cooldown = world.time + return + ..() /obj/item/toy/prize/ripley name = "toy ripley" diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index b93e418a5c2..c6823e88a11 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -1,5 +1,3 @@ -//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 - /obj/item/weapon name = "weapon" icon = 'icons/obj/weapons.dmi' @@ -37,14 +35,17 @@ m_amt = 1000 origin_tech = "materials=2" attack_verb = list("shoved", "bashed") + var/cooldown = 0 //shield bash cooldown. based on world.time IsShield() return 1 attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/melee/baton)) - user.visible_message("[user] bashes their [src] with [W]!") - playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1) + if(cooldown < world.time - 25) + user.visible_message("[user] bashes [src] with [W]!") + playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1) + cooldown = world.time else ..()