Skip to content

Commit

Permalink
Added stomping sound effects to the mech toys. Thanks to Skasi for th…
Browse files Browse the repository at this point in the history
…e 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
  • Loading branch information
petethegoat@gmail.com committed Nov 14, 2012
1 parent 242cd37 commit 1a4d38d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
17 changes: 17 additions & 0 deletions code/defines/obj/toy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 << "<span class='notice'>You play with [src].</span>"
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 << "<span class='notice'>You play with [src].</span>"
playsound(user, 'sound/mecha/mechturn.ogg', 20, 1)
cooldown = world.time
return
..()

/obj/item/toy/prize/ripley
name = "toy ripley"
Expand Down
9 changes: 5 additions & 4 deletions code/defines/obj/weapon.dm
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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("<span class='warning'>[user] bashes their [src] with [W]!</span>")
playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1)
if(cooldown < world.time - 25)
user.visible_message("<span class='warning'>[user] bashes [src] with [W]!</span>")
playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1)
cooldown = world.time
else
..()

Expand Down

0 comments on commit 1a4d38d

Please sign in to comment.