# HG changeset patch # User Jeremy Thurgood # Date 1282771417 -7200 # Node ID 9887c68110d84da2853de090c40f61bfd6fc7f39 # Parent 738608e90e9c8b6bcdf7303331011712fed27588 Sharp things. diff -r 738608e90e9c -r 9887c68110d8 gamelib/scenes/machine.py --- a/gamelib/scenes/machine.py Wed Aug 25 21:59:26 2010 +0200 +++ b/gamelib/scenes/machine.py Wed Aug 25 23:23:37 2010 +0200 @@ -1,6 +1,7 @@ """Machine room where tools and machines are found.""" from gamelib.state import Scene, Item, Thing, InteractText, Result +from gamelib.cursor import CursorSprite class Machine(Scene): @@ -16,6 +17,8 @@ super(Machine, self).__init__(state) self.add_thing(ToMap()) self.add_thing(LaserWelder()) + self.add_thing(Grinder()) + self.add_item(TitaniumMachete('titanium_machete')) def enter(self): return Result("The machine room is dark and forbidding.") @@ -91,4 +94,34 @@ return msg +class Grinder(Thing): + + NAME = "machine.grinder" + + INTERACTS = { + "grind": InteractText(200, 300, "Grinder"), + } + + INITIAL = "grind" + + def interact_without(self): + return Result("It looks like it eats fingers. Perhaps a different approach is in order?") + + def interact_with_titanium_leg(self, item): + 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.") + + def get_description(self): + return "A pretty ordinary, albeit rather industrial, grinding machine." + + +class TitaniumMachete(Item): + "Titanium machete, formerly a leg." + + INVENTORY_IMAGE = "triangle.png" + CURSOR = CursorSprite('titanium_femur_cursor.png', 47, 3) + + SCENES = [Machine]