Add sound parameter to weapon class
authorNeil <neil@dip.sun.ac.za>
Sat, 5 Mar 2016 20:05:32 +0000 (22:05 +0200)
committerNeil <neil@dip.sun.ac.za>
Sat, 5 Mar 2016 20:05:32 +0000 (22:05 +0200)
koperkapel/weapons.py

index 890743dbe5ccb5fb1338006a762f7874aae2a3d6..0050879b068b4b22d6a7903528d4f59cfb269f6a 100644 (file)
@@ -7,18 +7,19 @@ from .util import safepath
 
 class Weapon:
     def __init__(self, name, damage, image_name=None, bullet_range=0,
-                 can_tape=True, frames=("_1",)):
+                 can_tape=True, frames=("_1",), sound=None):
         self.name = name
         self.image_name = image_name or name
         self.frames = frames
         self.damage = damage
         self.bullet_range = bullet_range
         self.can_tape = can_tape
+        self.sound = sound
 
 
 WEAPONS = [
     Weapon("spit", damage=1, bullet_range=2, can_tape=False,
-           image_name="blank", frames=("",)),
+           image_name="blank", frames=("",), sound="fire_spit"),
     Weapon("butter_knife", damage=2),
     Weapon("crowbar", damage=4),
     Weapon("gun", damage=4, bullet_range=4),