comparison gamelib/scenes/crew_quarters.py @ 541:87368ceebb5d

pep8
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 11 Feb 2012 12:28:09 +0200
parents 0ce08d5e2acb
children 098ea4ea0d0d
comparison
equal deleted inserted replaced
540:e0d2ec1d9720 541:87368ceebb5d
5 from gamelib.scenewidgets import (InteractNoImage, InteractImage, 5 from gamelib.scenewidgets import (InteractNoImage, InteractImage,
6 InteractAnimated, GenericDescThing) 6 InteractAnimated, GenericDescThing)
7 7
8 from gamelib.scenes.game_constants import PLAYER_ID 8 from gamelib.scenes.game_constants import PLAYER_ID
9 from gamelib.scenes.game_widgets import Door, BaseCamera, make_jim_dialog 9 from gamelib.scenes.game_widgets import Door, BaseCamera, make_jim_dialog
10
10 11
11 class CrewQuarters(Scene): 12 class CrewQuarters(Scene):
12 13
13 FOLDER = "crew_quarters" 14 FOLDER = "crew_quarters"
14 BACKGROUND = "crew_quarters.png" 15 BACKGROUND = "crew_quarters.png"
84 self.set_interact('full_safe') 85 self.set_interact('full_safe')
85 return (Result("Even after centuries of neglect, the tumblers slide" 86 return (Result("Even after centuries of neglect, the tumblers slide"
86 " almost silently into place. Turns out the combination" 87 " almost silently into place. Turns out the combination"
87 " was '1 2 3 4 5'. An idiot must keep his luggage in" 88 " was '1 2 3 4 5'. An idiot must keep his luggage in"
88 " here."), 89 " here."),
89 make_jim_dialog("Prisoner %s, you have been observed committing a felony violation. " 90 make_jim_dialog("Prisoner %s, you have been observed"
90 "This will go onto your permanent record, and your sentence may be extended by up to twenty years." 91 " committing a felony violation. This will go onto"
92 " your permanent record, and your sentence may be"
93 " extended by up to twenty years."
91 % PLAYER_ID, self.state)) 94 % PLAYER_ID, self.state))
92 95
93 def get_description(self): 96 def get_description(self):
94 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but reasonably secure." 97 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but" \
98 " reasonably secure."
95 99
96 100
97 class FishbowlThing(Thing): 101 class FishbowlThing(Thing):
98 "A safe, for keeping things safe." 102 "A safe, for keeping things safe."
99 103
110 'has_bowl': True, 114 'has_bowl': True,
111 } 115 }
112 116
113 def interact_without(self): 117 def interact_without(self):
114 if not self.get_data('has_bowl'): 118 if not self.get_data('has_bowl'):
115 return Result("What's the point of lugging around a very dead fish " 119 return Result("What's the point of lugging around a very dead"
116 "and a kilogram or so of sand?") 120 " fish and a kilogram or so of sand?")
117 self.set_interact('fish_no_bowl') 121 self.set_interact('fish_no_bowl')
118 self.set_data('has_bowl', False) 122 self.set_data('has_bowl', False)
119 self.state.add_inventory_item('fishbowl') 123 self.state.add_inventory_item('fishbowl')
120 return Result("The fishbowl is useful, but its contents aren't.") 124 return Result("The fishbowl is useful, but its contents aren't.")
121 125
122 def get_description(self): 126 def get_description(self):
123 if self.get_data('has_bowl'): 127 if self.get_data('has_bowl'):
124 return "This fishbowl looks exactly like an old science fiction space helmet." 128 return "This fishbowl looks exactly like an old science fiction" \
129 " space helmet."
125 else: 130 else:
126 return "An evicted dead fish and some sand lie forlornly on the table" 131 return "An evicted dead fish and some sand lie forlornly on the" \
132 " table"
133
127 134
128 class Fishbowl(Item): 135 class Fishbowl(Item):
129 "A bowl. Sans fish." 136 "A bowl. Sans fish."
130 137
131 INVENTORY_IMAGE = 'fishbowl.png' 138 INVENTORY_IMAGE = 'fishbowl.png'
141 148
142 149
143 class FishbowlHelmet(Item): 150 class FishbowlHelmet(Item):
144 "A bowl with duct-tape" 151 "A bowl with duct-tape"
145 152
146 INVENTORY_IMAGE = "fishbowl_helmet.png" 153 INVENTORY_IMAGE = "fishbowl_helmet.png"
147 CURSOR = CursorSprite('fishbowl_helmet.png') 154 CURSOR = CursorSprite('fishbowl_helmet.png')
148 NAME = "helmet" 155 NAME = "helmet"
149 156
150 157
151 class DuctTape(Item): 158 class DuctTape(Item):
159 "A Camera pointing to JIM" 166 "A Camera pointing to JIM"
160 167
161 NAME = 'crew.camera' 168 NAME = 'crew.camera'
162 169
163 INTERACTS = { 170 INTERACTS = {
164 'online' : InteractImage(85, 97, 'camera_medium.png'), 171 'online': InteractImage(85, 97, 'camera_medium.png'),
165 'dead': InteractImage(85, 97, 'camera_medium_gray.png'), 172 'dead': InteractImage(85, 97, 'camera_medium_gray.png'),
166 'looping': InteractAnimated(85, 97, ('camera_medium.png', 173 'looping': InteractAnimated(85, 97, ('camera_medium.png',
167 'camera_medium_gray.png'), 174 'camera_medium_gray.png'),
168 15), 175 15),
169 } 176 }