comparison gamelib/scenes/map.py @ 770:a35f5364437d pyntnclick

Merge i18n
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 26 Jan 2013 17:00:43 +0200
parents 43b49f1de828
children eed75a1d50c4
comparison
equal deleted inserted replaced
764:a8510f4e2ea1 770:a35f5364437d
5 six months. 5 six months.
6 6
7 Many parts of the ship are derelict and inaccessible. 7 Many parts of the ship are derelict and inaccessible.
8 """ 8 """
9 9
10 from pyntnclick.i18n import _
10 from pyntnclick.state import Scene, Thing, Result 11 from pyntnclick.state import Scene, Thing, Result
11 from pyntnclick.scenewidgets import InteractRectUnion 12 from pyntnclick.scenewidgets import InteractRectUnion
12 13
13 from gamelib.scenes.game_constants import PLAYER_ID 14 from gamelib.scenes.game_constants import PLAYER_ID
14 from gamelib.scenes.game_widgets import make_jim_dialog 15 from gamelib.scenes.game_widgets import make_jim_dialog
35 36
36 def enter(self): 37 def enter(self):
37 if self.get_data('implant'): 38 if self.get_data('implant'):
38 self.set_data('implant', False) 39 self.set_data('implant', False)
39 ai1 = make_jim_dialog( 40 ai1 = make_jim_dialog(
40 "Under the terms of the emergency conscription " 41 _("Under the terms of the emergency conscription "
41 "act, I have downloaded the ship's schematics to your " 42 "act, I have downloaded the ship's schematics to your "
42 "neural implant to help you navigate around the ship.", 43 "neural implant to help you navigate around the ship."),
43 self.game) 44 self.game)
44 if ai1: 45 if ai1:
45 return ai1, make_jim_dialog("Prisoner %s, you are a " 46 return ai1, make_jim_dialog(_("Prisoner %s, you are a "
46 "class 1 felon. Obtaining access to the ship's schematics " 47 "class 1 felon. Obtaining access to the ship's schematics "
47 "constitutes a level 2 offence and carries a minimal penalty " 48 "constitutes a level 2 offence and carries a minimal penalty "
48 "of an additional 3 years on your sentence." % PLAYER_ID, 49 "of an additional 3 years on your sentence.") % PLAYER_ID,
49 self.game) 50 self.game)
50 51
51 52
52 class DoorThing(Thing): 53 class DoorThing(Thing):
53 54
123 124
124 INITIAL = 'door' 125 INITIAL = 'door'
125 126
126 def interact(self, item): 127 def interact(self, item):
127 if not self.game.is_in_inventory('helmet'): 128 if not self.game.is_in_inventory('helmet'):
128 return Result('The airlock refuses to open. The automated' 129 return Result(_('The airlock refuses to open. The automated'
129 ' voice says: "Hull breach beyond this door. Personnel' 130 ' voice says: "Hull breach beyond this door. Personnel'
130 ' must be equipped for vacuum before entry."') 131 ' must be equipped for vacuum before entry."'))
131 else: 132 else:
132 return super(ToEngine, self).interact(item) 133 return super(ToEngine, self).interact(item)
133 134
134 135
135 class ToMachine(DoorThing): 136 class ToMachine(DoorThing):
178 } 179 }
179 180
180 INITIAL = 'areas' 181 INITIAL = 'areas'
181 182
182 def interact(self, _item): 183 def interact(self, _item):
183 return Result("You look in the door, but just see empty space: " 184 return Result(_("You look in the door, but just see empty space: "
184 "that room appears to have been obliterated by meteors.") 185 "that room appears to have been obliterated by "
186 "meteors."))
185 187
186 188
187 class HydroponicsArea(Thing): 189 class HydroponicsArea(Thing):
188 NAME = 'map.hydroponics' 190 NAME = 'map.hydroponics'
189 191
195 } 197 }
196 198
197 INITIAL = 'areas' 199 INITIAL = 'areas'
198 200
199 def interact(self, _item): 201 def interact(self, _item):
200 return Result("Peering in through the window, you see that the entire " 202 return Result(_("Peering in through the window, you see that the "
201 "chamber is overgrown with giant broccoli. It would " 203 "entire chamber is overgrown with giant broccoli. "
202 "take you years to cut a path through that.") 204 "It would take you years to cut a path through that."))
203 205
204 206
205 SCENES = [Map] 207 SCENES = [Map]