changeset 206:6a52752f4920

some more interacations. Add sound to grinder
author Neil Muller <neil@dip.sun.ac.za>
date Thu, 26 Aug 2010 14:19:57 +0200
parents 060e51d4cef1
children 59862f857c31
files gamelib/scenes/machine.py gamelib/scenes/mess.py
diffstat 2 files changed, 31 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/scenes/machine.py	Thu Aug 26 14:18:53 2010 +0200
+++ b/gamelib/scenes/machine.py	Thu Aug 26 14:19:57 2010 +0200
@@ -111,7 +111,8 @@
         self.state.replace_inventory_item(item, self.state.items['titanium_machete'])
         return Result("After much delicate grinding and a few close calls with"
                       " various body parts, the titanium femur now resembles"
-                      " a machete more than a bone. Nice and sharp, too.")
+                      " a machete more than a bone. Nice and sharp, too.",
+                      soundfile="grinder.ogg")
 
     def get_description(self):
         return "A pretty ordinary, albeit rather industrial, grinding machine."
--- a/gamelib/scenes/mess.py	Thu Aug 26 14:18:53 2010 +0200
+++ b/gamelib/scenes/mess.py	Thu Aug 26 14:19:57 2010 +0200
@@ -30,6 +30,15 @@
     INVENTORY_IMAGE = "empty_can.png"
     CURSOR = CursorSprite('empty_can_cursor.png', 20, 30)
 
+    def interact_with_full_can(self, item, state):
+        return Result("You bang the cans togther. It sounds like two cans being banged togther.", soundfile="can_hit.ogg")
+
+    def interact_with_dented_can(self, item, state):
+        return Result("You bang the cans togther. It sounds like two cans being banged togther.", soundfile="can_hit.ogg")
+
+    def interact_with_empty_can(self, item, state):
+        return Result("You bang the cans togther. It sounds like two cans being banged togther.", soundfile="can_hit.ogg")
+
 
 class FullCan(CloneableItem):
     "Found on the shelf."
@@ -41,7 +50,16 @@
         dented = DentedCan("dented_can")
         state.add_item(dented)
         state.replace_inventory_item(self, dented)
-        return Result("You club the can with the femur. The can gets dented, but doesn't open.")
+        return Result("You club the can with the femur. The can gets dented, but doesn't open.", soundfile="can_hit.ogg")
+
+    def interact_with_full_can(self, item, state):
+        return Result("You bang the cans togther. It sounds like two cans being banged togther.", soundfile="can_hit.ogg")
+
+    def interact_with_dented_can(self, item, state):
+        return Result("You bang the cans togther. It sounds like two cans being banged togther.", soundfile="can_hit.ogg")
+
+    def interact_with_empty_can(self, item, state):
+        return Result("You bang the cans togther. It sounds like two cans being banged togther.", soundfile="can_hit.ogg")
 
 
 class DentedCan(CloneableItem):
@@ -51,7 +69,16 @@
     CURSOR = CursorSprite('dented_can_cursor.png', 20, 30)
 
     def interact_with_titanium_leg(self, item, state):
-        return Result("You club the can with the femur. The dents shift around, but it still doesn't open.")
+        return Result("You club the can with the femur. The dents shift around, but it still doesn't open.", soundfile="can_hit.ogg")
+
+    def interact_with_full_can(self, item, state):
+        return Result("You bang the cans togther. It sounds like two cans being banged togther.", soundfile="can_hit.ogg")
+
+    def interact_with_dented_can(self, item, state):
+        return Result("You bang the cans togther. It sounds like two cans being banged togther.", soundfile="can_hit.ogg")
+
+    def interact_with_empty_can(self, item, state):
+        return Result("You bang the cans togther. It sounds like two cans being banged togther.", soundfile="can_hit.ogg")
 
 
 class TubeFragments(Item):