Mercurial > boomslang
comparison gamelib/scenes/cryo.py @ 478:a9925aaf5f61 1.0.1
i18n and Russian translation
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Tue, 08 Mar 2011 12:29:14 +0200 |
parents | af2a23b9787d |
children | 2f1952748cdb |
comparison
equal
deleted
inserted
replaced
477:51055400a9a8 | 478:a9925aaf5f61 |
---|---|
14 from gamelib.scenes.scene_widgets import (Door, InteractText, InteractNoImage, | 14 from gamelib.scenes.scene_widgets import (Door, InteractText, InteractNoImage, |
15 InteractRectUnion, InteractImage, | 15 InteractRectUnion, InteractImage, |
16 InteractAnimated, GenericDescThing, | 16 InteractAnimated, GenericDescThing, |
17 make_jim_dialog) | 17 make_jim_dialog) |
18 | 18 |
19 from gamelib.i18n import _ | |
19 | 20 |
20 class Cryo(Scene): | 21 class Cryo(Scene): |
21 | 22 |
22 FOLDER = "cryo" | 23 FOLDER = "cryo" |
23 BACKGROUND = "cryo_room.png" | 24 BACKGROUND = "cryo_room.png" |
49 self.add_thing(CryoPools()) | 50 self.add_thing(CryoPools()) |
50 | 51 |
51 # Flavour items | 52 # Flavour items |
52 # pipes | 53 # pipes |
53 self.add_thing(GenericDescThing('cryo.pipes', 1, | 54 self.add_thing(GenericDescThing('cryo.pipes', 1, |
54 "These pipes carry cooling fluid to the cryo units.", | 55 _("These pipes carry cooling fluid to the cryo units."), |
55 ( | 56 ( |
56 (552, 145, 129, 66), | 57 (552, 145, 129, 66), |
57 (636, 82, 165, 60), | 58 (636, 82, 165, 60), |
58 (140, 135, 112, 73), | 59 (140, 135, 112, 73), |
59 (11, 63, 140, 67), | 60 (11, 63, 140, 67), |
60 ))) | 61 ))) |
61 self.add_thing(UncuttableCryoPipes()) | 62 self.add_thing(UncuttableCryoPipes()) |
62 | 63 |
63 # cryo units | 64 # cryo units |
64 self.add_thing(GenericCryoUnit(2, | 65 self.add_thing(GenericCryoUnit(2, |
65 "An empty cryo chamber.", | 66 _("An empty cryo chamber."), |
66 "Prisoner 81E4-C8900480E635. Embezzlement. 20 years.", | 67 _("Prisoner 81E4-C8900480E635. Embezzlement. 20 years."), |
67 ( | 68 ( |
68 (155, 430, 50, 35), | 69 (155, 430, 50, 35), |
69 (125, 450, 60, 35), | 70 (125, 450, 60, 35), |
70 (95, 470, 60, 35), | 71 (95, 470, 60, 35), |
71 (55, 490, 60, 55), | 72 (55, 490, 60, 55), |
72 ))) | 73 ))) |
73 | 74 |
74 self.add_thing(GenericCryoUnit(3, | 75 self.add_thing(GenericCryoUnit(3, |
75 "A working cryo chamber. The frosted glass obscures the details of the occupant.", | 76 _("A working cryo chamber. The frosted glass obscures the details of the occupant."), |
76 "Prisoner 9334-CE1EB0243BAB. Murder. 40 years.", | 77 _("Prisoner 9334-CE1EB0243BAB. Murder. 40 years."), |
77 ( | 78 ( |
78 (215, 430, 50, 35), | 79 (215, 430, 50, 35), |
79 (205, 450, 50, 35), | 80 (205, 450, 50, 35), |
80 (185, 470, 50, 35), | 81 (185, 470, 50, 35), |
81 (125, 505, 80, 40), | 82 (125, 505, 80, 40), |
82 ))) | 83 ))) |
83 | 84 |
84 self.add_thing(GenericCryoUnit(4, | 85 self.add_thing(GenericCryoUnit(4, |
85 "A broken cryo chamber. The skeleton inside has been picked clean.", | 86 _("A broken cryo chamber. The skeleton inside has been picked clean."), |
86 "Prisoner BFBC-8BF4C6B7492B. Importing illegal alien biomatter. 15 years.", | 87 _("Prisoner BFBC-8BF4C6B7492B. Importing illegal alien biomatter. 15 years."), |
87 ( | 88 ( |
88 (275, 430, 50, 70), | 89 (275, 430, 50, 70), |
89 (255, 460, 50, 70), | 90 (255, 460, 50, 70), |
90 (235, 490, 50, 60), | 91 (235, 490, 50, 60), |
91 ))) | 92 ))) |
92 | 93 |
93 self.add_thing(GenericCryoUnit(5, | 94 self.add_thing(GenericCryoUnit(5, |
94 "A working cryo chamber. The frosted glass obscures the details of the occupant.", | 95 _("A working cryo chamber. The frosted glass obscures the details of the occupant."), |
95 "Prisoner B520-99495B8C41CE. Copyright infringement. 60 years.", | 96 _("Prisoner B520-99495B8C41CE. Copyright infringement. 60 years."), |
96 ( | 97 ( |
97 (340, 430, 50, 70), | 98 (340, 430, 50, 70), |
98 (330, 500, 60, 50), | 99 (330, 500, 60, 50), |
99 ))) | 100 ))) |
100 | 101 |
101 self.add_thing(GenericCryoUnit(6, | 102 self.add_thing(GenericCryoUnit(6, |
102 "An empty cryo unit. Recently filled by you.", | 103 _("An empty cryo unit. Recently filled by you."), |
103 "Prisoner %s. Safecracking, grand larceny. 30 years." % PLAYER_ID, | 104 _("Prisoner %s. Safecracking, grand larceny. 30 years.") % PLAYER_ID, |
104 ( | 105 ( |
105 (399, 426, 70, 56), | 106 (399, 426, 70, 56), |
106 (404, 455, 69, 120), | 107 (404, 455, 69, 120), |
107 ))) | 108 ))) |
108 | 109 |
109 self.add_thing(GenericCryoUnit(7, | 110 self.add_thing(GenericCryoUnit(7, |
110 "An empty cryo unit.", | 111 _("An empty cryo unit."), |
111 "Prisoner 83F1-CE32D3234749. Spamming. 5 years.", | 112 _("Prisoner 83F1-CE32D3234749. Spamming. 5 years."), |
112 ( | 113 ( |
113 (472, 432, 58, 51), | 114 (472, 432, 58, 51), |
114 (488, 455, 41, 134), | 115 (488, 455, 41, 134), |
115 (517, 487, 42, 93), | 116 (517, 487, 42, 93), |
116 ))) | 117 ))) |
117 | 118 |
118 self.add_thing(GenericCryoUnit(8, | 119 self.add_thing(GenericCryoUnit(8, |
119 "An empty cryo unit.", | 120 _("An empty cryo unit."), |
120 "Prisoner A455-9DF9F43C43E5. Medical malpractice. 10 years.", | 121 _("Prisoner A455-9DF9F43C43E5. Medical malpractice. 10 years."), |
121 ( | 122 ( |
122 (596, 419, 69, 39), | 123 (596, 419, 69, 39), |
123 (616, 442, 82, 40), | 124 (616, 442, 82, 40), |
124 (648, 467, 84, 37), | 125 (648, 467, 84, 37), |
125 (681, 491, 97, 60), | 126 (681, 491, 97, 60), |
131 background_playlist = PlayList(pieces, random=True, repeat=True) | 132 background_playlist = PlayList(pieces, random=True, repeat=True) |
132 change_playlist(background_playlist) | 133 change_playlist(background_playlist) |
133 if self.get_data('greet'): | 134 if self.get_data('greet'): |
134 self.set_data('greet', False) | 135 self.set_data('greet', False) |
135 return make_jim_dialog( | 136 return make_jim_dialog( |
136 "Greetings, Prisoner %s. I am the Judicial " | 137 _("Greetings, Prisoner %s. I am the Judicial " |
137 "Incarceration Monitor. " | 138 "Incarceration Monitor. " |
138 "You have been woken early under the terms of the " | 139 "You have been woken early under the terms of the " |
139 "emergency conscription act to assist with repairs to " | 140 "emergency conscription act to assist with repairs to " |
140 "the ship. Your behaviour during this time will " | 141 "the ship. Your behaviour during this time will " |
141 "be noted on your record and will be relayed to " | 142 "be noted on your record and will be relayed to " |
142 "prison officials when we reach the destination. " | 143 "prison officials when we reach the destination. " |
143 "Please report to the bridge." % PLAYER_ID, self.state) | 144 "Please report to the bridge.") % PLAYER_ID, self.state) |
144 | 145 |
145 def leave(self): | 146 def leave(self): |
146 # Stop music | 147 # Stop music |
147 change_playlist(None) | 148 change_playlist(None) |
148 | 149 |
161 self.set_data('fixed', False) | 162 self.set_data('fixed', False) |
162 pipe = TubeFragment('tube_fragment') | 163 pipe = TubeFragment('tube_fragment') |
163 self.state.add_item(pipe) | 164 self.state.add_item(pipe) |
164 self.state.add_inventory_item(pipe.name) | 165 self.state.add_inventory_item(pipe.name) |
165 self.set_interact("chopped") | 166 self.set_interact("chopped") |
166 responses = [Result("It takes more effort than one would expect, but " | 167 responses = [Result(_("It takes more effort than one would expect, but " |
167 "eventually the pipe is separated from the wall.", | 168 "eventually the pipe is separated from the wall."), |
168 soundfile="chop-chop.ogg")] | 169 soundfile="chop-chop.ogg")] |
169 if self.state.current_scene.get_data('vandalism_warn'): | 170 if self.state.current_scene.get_data('vandalism_warn'): |
170 self.state.current_scene.set_data('vandalism_warn', False) | 171 self.state.current_scene.set_data('vandalism_warn', False) |
171 responses.append(make_jim_dialog( | 172 responses.append(make_jim_dialog( |
172 ("Prisoner %s. Vandalism is an offence punishable by a " | 173 _("Prisoner %s. Vandalism is an offence punishable by a " |
173 "minimum of an additional 6 months to your sentence." | 174 "minimum of an additional 6 months to your sentence." |
174 ) % PLAYER_ID, self.state)) | 175 ) % PLAYER_ID, self.state)) |
175 return responses | 176 return responses |
176 | 177 |
177 def is_interactive(self): | 178 def is_interactive(self): |
178 return self.get_data('fixed') | 179 return self.get_data('fixed') |
179 | 180 |
180 def interact_without(self): | 181 def interact_without(self): |
181 if self.get_data('fixed'): | 182 if self.get_data('fixed'): |
182 return Result("These pipes aren't attached to the wall very solidly.") | 183 return Result(_("These pipes aren't attached to the wall very solidly.")) |
183 return None | 184 return None |
184 | 185 |
185 def get_description(self): | 186 def get_description(self): |
186 if self.get_data('fixed'): | 187 if self.get_data('fixed'): |
187 return "These pipes carry cooling fluid to empty cryo units." | 188 return _("These pipes carry cooling fluid to empty cryo units.") |
188 return "There used to be a pipe carrying cooling fluid here." | 189 return _("There used to be a pipe carrying cooling fluid here.") |
189 | 190 |
190 | 191 |
191 class UncuttableCryoPipes(Thing): | 192 class UncuttableCryoPipes(Thing): |
192 "Base class for cryo pipes that can't be cut down." | 193 "Base class for cryo pipes that can't be cut down." |
193 | 194 |
200 } | 201 } |
201 | 202 |
202 INITIAL = "fixed" | 203 INITIAL = "fixed" |
203 | 204 |
204 def interact_with_machete(self, item): | 205 def interact_with_machete(self, item): |
205 return Result("These pipes carry fluid to the working cryo units." | 206 return Result(_("These pipes carry fluid to the working cryo units." |
206 " Chopping them down doesn't seem sensible.") | 207 " Chopping them down doesn't seem sensible.")) |
207 | 208 |
208 def is_interactive(self): | 209 def is_interactive(self): |
209 return True | 210 return True |
210 | 211 |
211 def interact_without(self): | 212 def interact_without(self): |
212 return Result("These pipes aren't attached to the wall very solidly.") | 213 return Result(_("These pipes aren't attached to the wall very solidly.")) |
213 | 214 |
214 def get_description(self): | 215 def get_description(self): |
215 return "These pipes carry cooling fluid to the working cryo units." | 216 return _("These pipes carry cooling fluid to the working cryo units.") |
216 | 217 |
217 | 218 |
218 class TubeFragment(CloneableItem): | 219 class TubeFragment(CloneableItem): |
219 "Obtained after cutting down a cryo room pipe." | 220 "Obtained after cutting down a cryo room pipe." |
220 | 221 |
282 | 283 |
283 def interact_without(self): | 284 def interact_without(self): |
284 return Result(detail_view='cryo_detail') | 285 return Result(detail_view='cryo_detail') |
285 | 286 |
286 def interact_with_titanium_leg(self, item): | 287 def interact_with_titanium_leg(self, item): |
287 return Result("You hit the chamber that used to hold this very leg. Nothing happens as a result.", | 288 return Result(_("You hit the chamber that used to hold this very leg. Nothing happens as a result."), |
288 soundfile="clang2.ogg") | 289 soundfile="clang2.ogg") |
289 | 290 |
290 def get_description(self): | 291 def get_description(self): |
291 if self.get_data('contains_titanium_leg'): | 292 if self.get_data('contains_titanium_leg'): |
292 return "A broken cryo chamber, with a poor unfortunate corpse inside." | 293 return _("A broken cryo chamber, with a poor unfortunate corpse inside.") |
293 return "A broken cryo chamber. The corpse inside is missing a leg." | 294 return _("A broken cryo chamber. The corpse inside is missing a leg.") |
294 | 295 |
295 | 296 |
296 class GenericCryoUnit(GenericDescThing): | 297 class GenericCryoUnit(GenericDescThing): |
297 "Generic Cryo unit" | 298 "Generic Cryo unit" |
298 | 299 |
309 def get_description(self): | 310 def get_description(self): |
310 return self.description | 311 return self.description |
311 | 312 |
312 def interact_with_titanium_leg(self, item): | 313 def interact_with_titanium_leg(self, item): |
313 return Result(random.choice([ | 314 return Result(random.choice([ |
314 "You bang on the chamber with the titanium femur. Nothing much happens.", | 315 _("You bang on the chamber with the titanium femur. Nothing much happens."), |
315 "Hitting the cryo unit with the femur doesn't achieve anything.", | 316 _("Hitting the cryo unit with the femur doesn't achieve anything."), |
316 "You hit the chamber with the femur. Nothing happens.", | 317 _("You hit the chamber with the femur. Nothing happens."), |
317 ]), soundfile="clang2.ogg") | 318 ]), soundfile="clang2.ogg") |
318 | 319 |
319 | 320 |
320 class CryoRoomDoor(Door): | 321 class CryoRoomDoor(Door): |
321 "Door to the cryo room." | 322 "Door to the cryo room." |
335 } | 336 } |
336 | 337 |
337 def interact_with_titanium_leg(self, item): | 338 def interact_with_titanium_leg(self, item): |
338 if self.get_data('door') == "ajar": | 339 if self.get_data('door') == "ajar": |
339 self.open_door() | 340 self.open_door() |
340 return Result("You wedge the titanium femur into the chain and twist. With a satisfying *snap*, the chain breaks and the door opens.", soundfile='break.ogg') | 341 return Result(_("You wedge the titanium femur into the chain and twist. With a satisfying *snap*, the chain breaks and the door opens."), soundfile='break.ogg') |
341 elif self.get_data('door') == "shut": | 342 elif self.get_data('door') == "shut": |
342 text = "You bang on the door with the titanium femur. It makes a clanging sound." | 343 text = _("You bang on the door with the titanium femur. It makes a clanging sound.") |
343 return Result(text, soundfile='clang.ogg') | 344 return Result(text, soundfile='clang.ogg') |
344 else: | 345 else: |
345 return Result("You wave the femur in the doorway. Nothing happens.") | 346 return Result(_("You wave the femur in the doorway. Nothing happens.")) |
346 | 347 |
347 def interact_without(self): | 348 def interact_without(self): |
348 if self.get_data('door') == "shut": | 349 if self.get_data('door') == "shut": |
349 self.half_open_door() | 350 self.half_open_door() |
350 if self.get_data('door') != "open": | 351 if self.get_data('door') != "open": |
351 return Result("It moves slightly and then stops. A chain on the other side is preventing it from opening completely.", soundfile='chain.ogg') | 352 return Result(_("It moves slightly and then stops. A chain on the other side is preventing it from opening completely."), soundfile='chain.ogg') |
352 else: | 353 else: |
353 self.state.set_current_scene('map') | 354 self.state.set_current_scene('map') |
354 return None | 355 return None |
355 | 356 |
356 def interact_default(self, item): | 357 def interact_default(self, item): |
364 self.set_data('door', "open") | 365 self.set_data('door', "open") |
365 self.set_interact("open") | 366 self.set_interact("open") |
366 | 367 |
367 def get_description(self): | 368 def get_description(self): |
368 if self.get_data('door') == "open": | 369 if self.get_data('door') == "open": |
369 return 'An open doorway leads to the rest of the ship.' | 370 return _('An open doorway leads to the rest of the ship.') |
370 elif self.get_data('door') == "ajar": | 371 elif self.get_data('door') == "ajar": |
371 return ("A rusty door. It can't open all the way because of a " | 372 return _("A rusty door. It can't open all the way because of a " |
372 "chain on the other side.") | 373 "chain on the other side.") |
373 return 'A rusty door. It is currently closed.' | 374 return _('A rusty door. It is currently closed.') |
374 | 375 |
375 | 376 |
376 class CryoComputer(Thing): | 377 class CryoComputer(Thing): |
377 "Computer in the cryo room." | 378 "Computer in the cryo room." |
378 | 379 |
389 | 390 |
390 def interact_without(self): | 391 def interact_without(self): |
391 return Result(detail_view='cryo_comp_detail') | 392 return Result(detail_view='cryo_comp_detail') |
392 | 393 |
393 def interact_with_titanium_leg(self, item): | 394 def interact_with_titanium_leg(self, item): |
394 return Result("Hitting it with the leg accomplishes nothing.") | 395 return Result(_("Hitting it with the leg accomplishes nothing.")) |
395 | 396 |
396 def get_description(self): | 397 def get_description(self): |
397 return "A computer terminal, with some text on it." | 398 return _("A computer terminal, with some text on it.") |
398 | 399 |
399 | 400 |
400 class TitaniumLegThing(Thing): | 401 class TitaniumLegThing(Thing): |
401 "Triangle in the cryo room." | 402 "Triangle in the cryo room." |
402 | 403 |
410 | 411 |
411 def interact_without(self): | 412 def interact_without(self): |
412 self.state.add_inventory_item('titanium_leg') | 413 self.state.add_inventory_item('titanium_leg') |
413 self.state.current_scene.things['cryo.unit.1'].set_data('contains_titanium_leg', False) | 414 self.state.current_scene.things['cryo.unit.1'].set_data('contains_titanium_leg', False) |
414 self.scene.remove_thing(self) | 415 self.scene.remove_thing(self) |
415 return Result("The skeletal occupant of this cryo unit has an artificial femur made of titanium. You take it.") | 416 return Result(_("The skeletal occupant of this cryo unit has an artificial femur made of titanium. You take it.")) |
416 | 417 |
417 def get_description(self): | 418 def get_description(self): |
418 return "This femur looks synthetic." | 419 return _("This femur looks synthetic.") |
419 | 420 |
420 | 421 |
421 class PlaqueThing(Thing): | 422 class PlaqueThing(Thing): |
422 "Plaque on the detailed cryo chamber" | 423 "Plaque on the detailed cryo chamber" |
423 | 424 |
428 } | 429 } |
429 | 430 |
430 INITIAL = "plaque" | 431 INITIAL = "plaque" |
431 | 432 |
432 def interact_without(self): | 433 def interact_without(self): |
433 return Result("The plaque is welded to the unit. You can't shift it.") | 434 return Result(_("The plaque is welded to the unit. You can't shift it.")) |
434 | 435 |
435 def get_description(self): | 436 def get_description(self): |
436 return "'Prisoner 98CC-764E646391EE. War crimes. 45 years." | 437 return _("'Prisoner 98CC-764E646391EE. War crimes. 45 years.") |
437 | 438 |
438 | 439 |
439 class FullBottle(Item): | 440 class FullBottle(Item): |
440 INVENTORY_IMAGE = 'bottle_full.png' | 441 INVENTORY_IMAGE = 'bottle_full.png' |
441 CURSOR = CursorSprite('bottle_full_cursor.png', 27, 7) | 442 CURSOR = CursorSprite('bottle_full_cursor.png', 27, 7) |
455 } | 456 } |
456 | 457 |
457 INITIAL = 'pools' | 458 INITIAL = 'pools' |
458 | 459 |
459 def get_description(self): | 460 def get_description(self): |
460 return "Coolant leaks disturbingly from the bulkheads." | 461 return _("Coolant leaks disturbingly from the bulkheads.") |
461 | 462 |
462 def interact_without(self): | 463 def interact_without(self): |
463 return Result("It's gooey") | 464 return Result("It's gooey") |
464 | 465 |
465 def interact_with_detergent_bottle(self, item): | 466 def interact_with_detergent_bottle(self, item): |
466 full = FullBottle('full_detergent_bottle') | 467 full = FullBottle('full_detergent_bottle') |
467 self.state.add_item(full) | 468 self.state.add_item(full) |
468 self.state.replace_inventory_item(item.name, full.name) | 469 self.state.replace_inventory_item(item.name, full.name) |
469 return Result("You scoop up some coolant and fill the bottle.") | 470 return Result(_("You scoop up some coolant and fill the bottle.")) |
470 | 471 |
471 | 472 |
472 class CryoCompDetail(Scene): | 473 class CryoCompDetail(Scene): |
473 | 474 |
474 FOLDER = "cryo" | 475 FOLDER = "cryo" |