# HG changeset patch # User Jeremy Thurgood # Date 1282943554 -7200 # Node ID 3ac2e025478ff90bd4617988b6d0e612a43735b1 # Parent fe899fb63866ca61df12616fcecd8b9e1a186c3d Fishbowl and laser lights that don't make the universe go away. diff -r fe899fb63866 -r 3ac2e025478f Resources/images/crew_quarters/fishbowl.png Binary file Resources/images/crew_quarters/fishbowl.png has changed diff -r fe899fb63866 -r 3ac2e025478f Resources/images/crew_quarters/fishbowl_helmet.png Binary file Resources/images/crew_quarters/fishbowl_helmet.png has changed diff -r fe899fb63866 -r 3ac2e025478f Resources/images/items/fishbowl.png Binary file Resources/images/items/fishbowl.png has changed diff -r fe899fb63866 -r 3ac2e025478f Resources/images/items/fishbowl_helmet.png Binary file Resources/images/items/fishbowl_helmet.png has changed diff -r fe899fb63866 -r 3ac2e025478f gamelib/scenes/crew_quarters.py --- a/gamelib/scenes/crew_quarters.py Fri Aug 27 23:09:07 2010 +0200 +++ b/gamelib/scenes/crew_quarters.py Fri Aug 27 23:12:34 2010 +0200 @@ -11,6 +11,8 @@ FOLDER = "crew_quarters" BACKGROUND = "crew_quarters.png" + OFFSET = (0, -50) + INITIAL_DATA = { 'accessible': True, } @@ -18,6 +20,8 @@ def __init__(self, state): super(CrewQuarters, self).__init__(state) self.add_thing(ToMap()) + self.add_thing(FishbowlThing()) + self.add_item(Fishbowl('fishbowl')) def enter(self): return Result("The crew were a messy bunch. Or maybe that's just the intervening centuries.") @@ -69,6 +73,42 @@ return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but reasonably secure." +class FishbowlThing(Thing): + "A safe, for keeping things safe." + + NAME = 'crew.fishbowl' + + INTERACTS = { + 'fishbowl': InteractImage(356, 495, 'fishbowl_on_table.png'), + 'fish_no_bowl': InteractImage(372, 517, 'fish_minus_bowl.png'), + } + + INITIAL = 'fishbowl' + + INITIAL_DATA = { + 'has_bowl': True, + } + + def interact_without(self): + if not self.get_data('has_bowl'): + return Result("What's the point of lugging around a very dead fish " + "and a kilogram or so of sand?") + self.set_interact('fish_no_bowl') + self.set_data('has_bowl', False) + self.state.add_inventory_item('fishbowl') + return Result("The fishbowl is useful, but its contents aren't.") + + def get_description(self): + return "This fishbowl looks exactly like an old science fiction space helmet." + + +class Fishbowl(Item): + "A bowl. Sans fish." + + INVENTORY_IMAGE = 'fishbowl.png' + CURSOR = CursorSprite('fishbowl.png', 29, 27) + + class SafeDetail(Scene): FOLDER = 'crew_quarters' diff -r fe899fb63866 -r 3ac2e025478f gamelib/scenes/machine.py --- a/gamelib/scenes/machine.py Fri Aug 27 23:09:07 2010 +0200 +++ b/gamelib/scenes/machine.py Fri Aug 27 23:12:34 2010 +0200 @@ -1,5 +1,7 @@ """Machine room where tools and machines are found.""" +import random + from gamelib.state import Scene, Item, Thing, Result from gamelib.cursor import CursorSprite from gamelib.scenes.scene_widgets import (Door, InteractText, InteractNoImage,