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