Mercurial > pyntnclick
comparison gamelib/scenes/crew_quarters.py @ 283:3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Fri, 27 Aug 2010 23:12:34 +0200 |
parents | d78ce15bccc8 |
children | 2a11709cb427 |
comparison
equal
deleted
inserted
replaced
282:fe899fb63866 | 283:3ac2e025478f |
---|---|
9 class CrewQuarters(Scene): | 9 class CrewQuarters(Scene): |
10 | 10 |
11 FOLDER = "crew_quarters" | 11 FOLDER = "crew_quarters" |
12 BACKGROUND = "crew_quarters.png" | 12 BACKGROUND = "crew_quarters.png" |
13 | 13 |
14 OFFSET = (0, -50) | |
15 | |
14 INITIAL_DATA = { | 16 INITIAL_DATA = { |
15 'accessible': True, | 17 'accessible': True, |
16 } | 18 } |
17 | 19 |
18 def __init__(self, state): | 20 def __init__(self, state): |
19 super(CrewQuarters, self).__init__(state) | 21 super(CrewQuarters, self).__init__(state) |
20 self.add_thing(ToMap()) | 22 self.add_thing(ToMap()) |
23 self.add_thing(FishbowlThing()) | |
24 self.add_item(Fishbowl('fishbowl')) | |
21 | 25 |
22 def enter(self): | 26 def enter(self): |
23 return Result("The crew were a messy bunch. Or maybe that's just the intervening centuries.") | 27 return Result("The crew were a messy bunch. Or maybe that's just the intervening centuries.") |
24 | 28 |
25 | 29 |
67 | 71 |
68 def get_description(self): | 72 def get_description(self): |
69 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but reasonably secure." | 73 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but reasonably secure." |
70 | 74 |
71 | 75 |
76 class FishbowlThing(Thing): | |
77 "A safe, for keeping things safe." | |
78 | |
79 NAME = 'crew.fishbowl' | |
80 | |
81 INTERACTS = { | |
82 'fishbowl': InteractImage(356, 495, 'fishbowl_on_table.png'), | |
83 'fish_no_bowl': InteractImage(372, 517, 'fish_minus_bowl.png'), | |
84 } | |
85 | |
86 INITIAL = 'fishbowl' | |
87 | |
88 INITIAL_DATA = { | |
89 'has_bowl': True, | |
90 } | |
91 | |
92 def interact_without(self): | |
93 if not self.get_data('has_bowl'): | |
94 return Result("What's the point of lugging around a very dead fish " | |
95 "and a kilogram or so of sand?") | |
96 self.set_interact('fish_no_bowl') | |
97 self.set_data('has_bowl', False) | |
98 self.state.add_inventory_item('fishbowl') | |
99 return Result("The fishbowl is useful, but its contents aren't.") | |
100 | |
101 def get_description(self): | |
102 return "This fishbowl looks exactly like an old science fiction space helmet." | |
103 | |
104 | |
105 class Fishbowl(Item): | |
106 "A bowl. Sans fish." | |
107 | |
108 INVENTORY_IMAGE = 'fishbowl.png' | |
109 CURSOR = CursorSprite('fishbowl.png', 29, 27) | |
110 | |
111 | |
72 class SafeDetail(Scene): | 112 class SafeDetail(Scene): |
73 | 113 |
74 FOLDER = 'crew_quarters' | 114 FOLDER = 'crew_quarters' |
75 BACKGROUND = None # TODO | 115 BACKGROUND = None # TODO |
76 NAME = 'safe_detail' | 116 NAME = 'safe_detail' |