Mercurial > pyntnclick
comparison gamelib/scenes/crew_quarters.py @ 769:43b49f1de828 pyntnclick-i18n
Merge i18n for before the pyntnclick split
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 26 Jan 2013 16:57:33 +0200 |
parents | 386475464202 2f1952748cdb |
children | a35f5364437d |
comparison
equal
deleted
inserted
replaced
763:afe7b1cb16c0 | 769:43b49f1de828 |
---|---|
1 """Crew quarters.""" | 1 """Crew quarters.""" |
2 | 2 |
3 from pyntnclick.i18n import _ | |
3 from pyntnclick.cursor import CursorSprite | 4 from pyntnclick.cursor import CursorSprite |
4 from pyntnclick.state import Scene, Item, Thing, Result | 5 from pyntnclick.state import Scene, Item, Thing, Result |
5 from pyntnclick.scenewidgets import (InteractNoImage, InteractImage, | 6 from pyntnclick.scenewidgets import (InteractNoImage, InteractImage, |
6 InteractAnimated, GenericDescThing) | 7 InteractAnimated, GenericDescThing) |
7 | 8 |
24 self.add_item(DuctTape('duct_tape')) | 25 self.add_item(DuctTape('duct_tape')) |
25 self.add_item(EscherPoster('escher_poster')) | 26 self.add_item(EscherPoster('escher_poster')) |
26 self.add_thing(PosterThing()) | 27 self.add_thing(PosterThing()) |
27 self.add_thing(MonitorCamera()) | 28 self.add_thing(MonitorCamera()) |
28 self.add_thing(GenericDescThing('crew.plant', 1, | 29 self.add_thing(GenericDescThing('crew.plant', 1, |
29 "The plant is doing surprisingly well for centuries of neglect", | 30 _("The plant is doing surprisingly well for centuries of neglect"), |
30 ((624, 215, 61, 108),))) | 31 ((624, 215, 61, 108),))) |
31 self.add_thing(GenericDescThing('crew.cat', 2, | 32 self.add_thing(GenericDescThing('crew.cat', 2, |
32 "A picture of a cat labelled 'Clementine'", | 33 _("A picture of a cat labelled 'Clementine'"), |
33 ((722, 382, 66, 72),))) | 34 ((722, 382, 66, 72),))) |
34 | 35 |
35 | 36 |
36 class ToMap(Door): | 37 class ToMap(Door): |
37 | 38 |
73 if self.get_data('is_cracked'): | 74 if self.get_data('is_cracked'): |
74 if self.get_data('has_tape'): | 75 if self.get_data('has_tape'): |
75 self.set_data('has_tape', False) | 76 self.set_data('has_tape', False) |
76 self.game.add_inventory_item('duct_tape') | 77 self.game.add_inventory_item('duct_tape') |
77 self.set_interact() | 78 self.set_interact() |
78 return Result("Duct tape. It'll stick to everything except " | 79 return Result(_("Duct tape. It'll stick to everything except " |
79 "ducts, apparently.") | 80 "ducts, apparently.")) |
80 return Result("The perfectly balanced door swings frictionlessly " | 81 return Result(_("The perfectly balanced door swings " |
81 "to and fro. What craftsmanship!") | 82 "frictionlessly to and fro. What craftsmanship!")) |
82 return Result("The safe is locked. This might be an interesting " | 83 return Result(_("The safe is locked. This might be an interesting " |
83 "challenge, if suitable equipment can be found.") | 84 "challenge, if suitable equipment can be found.")) |
84 | 85 |
85 def interact_with_stethoscope(self, item): | 86 def interact_with_stethoscope(self, item): |
86 if self.get_data('is_cracked'): | 87 if self.get_data('is_cracked'): |
87 return Result("It's already unlocked. There's no more challenge.") | 88 return Result(_("It's already unlocked. " |
89 "There's no more challenge.")) | |
88 # TODO: Add years to the sentence for safecracking. | 90 # TODO: Add years to the sentence for safecracking. |
89 # TODO: Wax lyrical some more about safecracking. | 91 # TODO: Wax lyrical some more about safecracking. |
90 self.set_data('is_cracked', True) | 92 self.set_data('is_cracked', True) |
91 self.set_interact() | 93 self.set_interact() |
92 return (Result("Even after centuries of neglect, the tumblers slide" | 94 return (Result(_("Even after centuries of neglect, the tumblers slide" |
93 " almost silently into place. Turns out the combination" | 95 " almost silently into place. Turns out the" |
94 " was '1 2 3 4 5'. An idiot must keep his luggage in" | 96 " combination was '1 2 3 4 5'. An idiot must keep his" |
95 " here."), | 97 " luggage in here.")), |
96 make_jim_dialog("Prisoner %s, you have been observed" | 98 make_jim_dialog(_("Prisoner %s, you have been observed" |
97 " committing a felony violation. This will go onto" | 99 " committing a felony violation. This will" |
98 " your permanent record, and your sentence may be" | 100 " go onto your permanent record, and your" |
99 " extended by up to twenty years." | 101 " sentence may be extended by up to twenty" |
100 % PLAYER_ID, self.game)) | 102 " years.") % PLAYER_ID, self.game)) |
101 | 103 |
102 def get_description(self): | 104 def get_description(self): |
103 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but" \ | 105 return _("Ah, a vintage Knoxx & Co. model QR3. Quaint, but" |
104 " reasonably secure." | 106 " reasonably secure.") |
105 | 107 |
106 | 108 |
107 class FishbowlThing(Thing): | 109 class FishbowlThing(Thing): |
108 "A safe, for keeping things safe." | 110 "A safe, for keeping things safe." |
109 | 111 |
125 return 'fish_no_bowl' | 127 return 'fish_no_bowl' |
126 return self.INITIAL | 128 return self.INITIAL |
127 | 129 |
128 def interact_without(self): | 130 def interact_without(self): |
129 if not self.get_data('has_bowl'): | 131 if not self.get_data('has_bowl'): |
130 return Result("What's the point of lugging around a very dead" | 132 return Result(_("What's the point of lugging around a very dead" |
131 " fish and a kilogram or so of sand?") | 133 " fish and a kilogram or so of sand?")) |
132 self.set_data('has_bowl', False) | 134 self.set_data('has_bowl', False) |
133 self.set_interact() | 135 self.set_interact() |
134 self.game.add_inventory_item('fishbowl') | 136 self.game.add_inventory_item('fishbowl') |
135 return Result("The fishbowl is useful, but its contents aren't.") | 137 return Result(_("The fishbowl is useful, but its contents aren't.")) |
136 | 138 |
137 def get_description(self): | 139 def get_description(self): |
138 if self.get_data('has_bowl'): | 140 if self.get_data('has_bowl'): |
139 return "This fishbowl looks exactly like an old science fiction" \ | 141 return _("This fishbowl looks exactly like an old science fiction" |
140 " space helmet." | 142 " space helmet.") |
141 else: | 143 else: |
142 return "An evicted dead fish and some sand lie forlornly on the" \ | 144 return _("An evicted dead fish and some sand lie forlornly on the" |
143 " table" | 145 " table") |
144 | 146 |
145 | 147 |
146 class Fishbowl(Item): | 148 class Fishbowl(Item): |
147 "A bowl. Sans fish." | 149 "A bowl. Sans fish." |
148 | 150 |
152 | 154 |
153 def interact_with_duct_tape(self, item): | 155 def interact_with_duct_tape(self, item): |
154 helmet = FishbowlHelmet('helmet') | 156 helmet = FishbowlHelmet('helmet') |
155 self.game.add_item(helmet) | 157 self.game.add_item(helmet) |
156 self.game.replace_inventory_item(self.name, helmet.name) | 158 self.game.replace_inventory_item(self.name, helmet.name) |
157 return Result("You duct tape the edges of the helmet. The seal is" | 159 return Result(_("You duct tape the edges of the helmet. The seal is" |
158 " crude, but it will serve as a workable helmet if needed.") | 160 " crude, but it will serve as a workable helmet if" |
161 " needed.")) | |
159 | 162 |
160 | 163 |
161 class FishbowlHelmet(Item): | 164 class FishbowlHelmet(Item): |
162 "A bowl with duct-tape" | 165 "A bowl with duct-tape" |
163 | 166 |
199 INITIAL = 'poster' | 202 INITIAL = 'poster' |
200 | 203 |
201 def interact_without(self): | 204 def interact_without(self): |
202 self.game.add_inventory_item('escher_poster') | 205 self.game.add_inventory_item('escher_poster') |
203 self.scene.remove_thing(self) | 206 self.scene.remove_thing(self) |
204 return Result("This poster will go nicely on your bedroom wall.") | 207 return Result(_("This poster will go nicely on your bedroom wall.")) |
205 | 208 |
206 def get_description(self): | 209 def get_description(self): |
207 return "A paradoxical poster hangs below the security camera." | 210 return _("A paradoxical poster hangs below the security camera.") |
208 | 211 |
209 | 212 |
210 class EscherPoster(Item): | 213 class EscherPoster(Item): |
211 "A confusing poster to disable JIM" | 214 "A confusing poster to disable JIM" |
212 | 215 |