# HG changeset patch # User Neil Muller # Date 1282851301 -7200 # Node ID bcb7b2093118ffc40034aa39b868557260ff57e6 # Parent 15a86dba9df0eb5c6b94976293a7d29a3f5eac51 Tweak cans diff -r 15a86dba9df0 -r bcb7b2093118 gamelib/scenes/mess.py --- a/gamelib/scenes/mess.py Thu Aug 26 21:00:09 2010 +0200 +++ b/gamelib/scenes/mess.py Thu Aug 26 21:35:01 2010 +0200 @@ -24,11 +24,8 @@ self.add_thing(ToMap()) -class EmptyCan(CloneableItem): - "After emptying the full can." - - INVENTORY_IMAGE = "empty_can.png" - CURSOR = CursorSprite('empty_can_cursor.png', 20, 30) +class BaseCan(CloneableItem): + """Base class for the cans""" 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") @@ -39,8 +36,22 @@ def interact_with_empty_can(self, item, state): return self.interact_with_full_can(item, state) + def interact_with_machete(self, item, state): + return Result("You'd managle it beyond usefulness") -class FullCan(CloneableItem): + +class EmptyCan(BaseCan): + "After emptying the full can." + + INVENTORY_IMAGE = "empty_can.png" + CURSOR = CursorSprite('empty_can_cursor.png', 20, 30) + + + def interact_with_titanium_leg(self, item, state): + return Result("Flattening the can doesn't look like a useful thing to do") + + +class FullCan(BaseCan): "Found on the shelf." INVENTORY_IMAGE = "full_can.png" @@ -52,17 +63,8 @@ state.replace_inventory_item(self, dented) 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 self.interact_with_full_can(item, state) - - def interact_with_empty_can(self, item, state): - return self.interact_with_full_can(item, state) - - -class DentedCan(CloneableItem): +class DentedCan(BaseCan): "A can banged on with the femur" INVENTORY_IMAGE = "dented_can.png" @@ -71,15 +73,6 @@ 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.", 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 self.interact_with_full_can(item, state) - - def interact_with_empty_can(self, item, state): - return self.interact_with_full_can(item, state) - class TubeFragments(Item): "Old tubes that need repair."