Mercurial > pyntnclick
annotate gamelib/scenes/machine.py @ 765:2f1952748cdb i18n
merge i18n and Russian translation
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Tue, 08 Mar 2011 14:37:43 +0200 |
parents | 0ce08d5e2acb a9925aaf5f61 |
children | 43b49f1de828 |
rev | line source |
---|---|
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
1 """Machine room where tools and machines are found.""" |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
2 |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
262
diff
changeset
|
3 from gamelib.state import Scene, Item, Thing, Result |
194 | 4 from gamelib.cursor import CursorSprite |
528
0ce08d5e2acb
pyflakes-induced cleanup.
Jeremy Thurgood <firxen@gmail.com>
parents:
525
diff
changeset
|
5 from gamelib.scenewidgets import (InteractNoImage, InteractImage, |
525
821b322e903b
Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
519
diff
changeset
|
6 InteractAnimated, GenericDescThing) |
821b322e903b
Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
519
diff
changeset
|
7 |
821b322e903b
Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
519
diff
changeset
|
8 from gamelib.scenes.game_widgets import Door |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
9 |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
10 from gamelib.i18n import _ |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
11 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
12 class Machine(Scene): |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
13 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
14 FOLDER = "machine" |
260
020f83305bf3
Line art machine room.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
252
diff
changeset
|
15 BACKGROUND = "machine_room.png" |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
16 |
151
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
17 def __init__(self, state): |
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
18 super(Machine, self).__init__(state) |
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
19 self.add_thing(ToMap()) |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
20 self.add_thing(LaserWelderSlot()) |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
21 self.add_thing(LaserWelderButton()) |
281
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
22 self.add_thing(LaserWelderPowerLights()) |
194 | 23 self.add_thing(Grinder()) |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
24 self.add_thing(ManualThing()) |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
215
diff
changeset
|
25 self.add_item(TitaniumMachete('machete')) |
329 | 26 self.add_item(CryoPipesOne('cryo_pipes_one')) |
27 self.add_item(CryoPipesTwo('cryo_pipes_two')) | |
28 self.add_item(CryoPipesThree('cryo_pipes_three')) | |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
29 self.add_item(Manual('manual')) |
297
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
30 self.add_thing(GenericDescThing('machine.wires', 2, |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
31 _("Wires run to all the machines in the room"), |
297
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
32 ( |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
33 (250, 172, 252, 12), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
34 (388, 183, 114, 13), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
35 (496, 112, 36, 64), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
36 (533, 85, 19, 45), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
37 (647, 114, 10, 308), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
38 (111, 96, 13, 285), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
39 (152, 106, 34, 30), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
40 (189, 136, 27, 28), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
41 (222, 157, 24, 25), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
42 (120, 86, 34, 29), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
43 (110, 80, 21, 15), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
44 (383, 196, 12, 56), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
45 (553, 61, 26, 50), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
46 (574, 39, 16, 48), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
47 (648, 85, 22, 26), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
48 (674, 54, 23, 36), |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
49 ))) |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
50 self.add_thing(GenericDescThing('machine.diagram', 3, |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
51 _("A wiring diagram of some sort"), |
297
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
52 ((694, 140, 94, 185),))) |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
53 self.add_thing(GenericDescThing('machine.powerpoint', 4, |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
54 _("The cables to this power point have been cut"), |
297
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
55 ((155, 22, 92, 74),))) |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
56 self.add_thing(GenericDescThing("machine.powerpoint", 5, |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
57 _("All the machines run off this powerpoint"), |
297
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
58 ((593, 19, 74, 57),))) |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
59 self.add_thing(GenericDescThing("machine.drill_press", 6, |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
60 _("An impressive looking laser drill press"), |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
61 ( |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
62 (519, 338, 36, 63), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
63 (545, 348, 93, 46), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
64 (599, 309, 41, 150), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
65 (588, 445, 66, 42), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
66 (616, 479, 41, 14), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
67 (527, 393, 15, 17), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
68 (510, 360, 13, 11), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
69 (532, 331, 14, 11), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
70 (605, 304, 26, 8), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
71 ))) |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
72 self.add_thing(GenericDescThing("machine.drill_press_block", 7, |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
73 _("The block for the laser drill press"), # TODO: fix description |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
74 ((461, 446, 38, 27),))) |
151
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
75 |
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
76 |
242 | 77 class ToMap(Door): |
151
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
78 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
79 SCENE = "machine" |
151
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
80 |
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
81 INTERACTS = { |
262
5f58da9eeb52
Replace text interacts with doors.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
260
diff
changeset
|
82 "door": InteractNoImage(695, 350, 97, 212), |
151
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
83 } |
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
84 |
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
85 INITIAL = "door" |
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
86 |
281
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
87 |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
88 class LaserWelderSlot(Thing): |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
89 |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
90 NAME = "machine.welder.slot" |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
91 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
92 INTERACTS = { |
329 | 93 "empty": InteractImage(241, 310, "welder_empty.png"), |
94 "can": InteractImage(241, 310, "welder_can.png"), | |
95 "tube": InteractImage(241, 310, "welder_pipe.png"), | |
96 "can_and_tube": InteractImage(241, 310, "welder_can_pipe.png"), | |
97 } | |
98 | |
99 INITIAL = "empty" | |
100 | |
101 INITIAL_DATA = { | |
102 'contents': set(), | |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
103 } |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
104 |
329 | 105 def update_contents(self): |
106 """Update the interact after a contents change.""" | |
107 contents = self.get_data('contents') | |
108 if not contents: | |
109 self.set_interact("empty") | |
110 elif len(contents) == 1: | |
111 if "can" in contents: | |
112 self.set_interact("can") | |
113 elif "tube" in contents: | |
114 self.set_interact("tube") | |
115 else: | |
116 self.set_interact("can_and_tube") | |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
117 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
118 def interact_without(self): |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
119 return Result(_("You really don't want to put your hand in there.")) |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
120 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
121 def interact_with_empty_can(self, item): |
329 | 122 contents = self.get_data('contents') |
123 if "can" in contents: | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
124 return Result(_("There is already a can in the welder.")) |
329 | 125 self.state.remove_inventory_item(item.name) |
126 contents.add("can") | |
127 self.update_contents() | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
128 return Result(_("You carefully place the can in the laser welder.")) |
329 | 129 |
130 def interact_with_tube_fragment(self, item): | |
131 contents = self.get_data('contents') | |
132 if "tube" in contents: | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
133 return Result(_("There is already a tube fragment in the welder.")) |
329 | 134 self.state.remove_inventory_item(item.name) |
135 contents.add("tube") | |
136 self.update_contents() | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
137 return Result(_("You carefully place the tube fragments in the laser welder.")) |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
138 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
139 def get_description(self): |
329 | 140 contents = self.get_data('contents') |
141 if not contents: | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
142 return _("This is a Smith and Wesson 'zOMG' class high-precision laser welder.") |
329 | 143 if len(contents) == 1: |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
144 msg = _("The laser welder looks hungry, somehow.") |
329 | 145 if "can" in contents: |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
146 msg += _(" It currently contains an empty can.") |
329 | 147 elif "tube" in contents: |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
148 msg += _(" It currently contains a tube fragment.") |
329 | 149 elif len(contents) == 2: |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
150 msg = _("The laser welder looks expectant. ") |
329 | 151 if "can" in contents and "tube" in contents: |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
152 msg += _(" It currently contains an empty can and a tube fragment.") |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
153 return msg |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
154 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
155 |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
156 class LaserWelderButton(Thing): |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
157 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
158 NAME = "machine.welder.button" |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
159 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
160 INTERACTS = { |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
161 "button": InteractNoImage(406, 389, 28, 31), |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
162 } |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
163 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
164 INITIAL = "button" |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
165 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
166 def interact_without(self): |
329 | 167 contents = self.scene.things["machine.welder.slot"].get_data("contents") |
168 if not contents: | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
169 return Result(_("The laser welder doesn't currently contain anything weldable.")) |
329 | 170 elif len(contents) == 1: |
171 if "can" in contents: | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
172 return Result(_("The laser welder needs something to weld the can to.")) |
329 | 173 elif "tube" in contents: |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
174 return Result(_("The laser welder needs something to weld the tube fragments to.")) |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
175 else: |
329 | 176 self.scene.things["machine.welder.slot"].set_data("contents", set()) |
177 self.scene.things["machine.welder.slot"].update_contents() | |
178 if self.state.items["cryo_pipes_one"] in self.state.inventory: | |
179 self.state.replace_inventory_item("cryo_pipes_one", "cryo_pipes_two") | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
180 return Result(_("With high-precision spitzensparken, you weld" |
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
181 " together a second pipe. You bundle the two pipes together."), |
459 | 182 soundfile='laser.ogg') |
329 | 183 elif self.state.items["cryo_pipes_two"] in self.state.inventory: |
184 self.state.replace_inventory_item("cryo_pipes_two", "cryo_pipes_three") | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
185 return Result(_("With high-precision spitzensparken, you create yet" |
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
186 " another pipe. You store it with the other two."), |
459 | 187 soundfile='laser.ogg') |
329 | 188 elif self.state.items["cryo_pipes_three"] in self.state.inventory: |
189 # just for safety | |
459 | 190 return None |
329 | 191 else: |
192 self.state.add_inventory_item("cryo_pipes_one") | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
193 return Result(_("With high-precision spitzensparken, the can and tube are welded" |
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
194 " into a whole greater than the sum of the parts."), |
329 | 195 soundfile='laser.ogg') |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
196 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
197 |
281
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
198 class LaserWelderPowerLights(Thing): |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
199 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
200 NAME = "machine.welder.lights" |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
201 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
202 INTERACTS = { |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
203 "lights": InteractAnimated(199, 273, ["power_lights_%d.png" % i for i in range(8) + range(6,0,-1)], 10) |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
204 } |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
205 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
206 INITIAL = 'lights' |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
207 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
208 def get_description(self): |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
209 return _("The power lights pulse expectantly.") |
281
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
210 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
211 |
329 | 212 class CryoPipesOne(Item): |
213 "A single cryo pipe (made from a tube fragment and can)." | |
214 | |
215 INVENTORY_IMAGE = "cryo_pipes_one.png" | |
216 CURSOR = CursorSprite('cryo_pipes_one_cursor.png') | |
217 TOOL_NAME = "cryo_pipes_one" | |
218 | |
219 | |
220 class CryoPipesTwo(Item): | |
221 "Two cryo pipes (each made from a tube fragment and can)." | |
226 | 222 |
329 | 223 INVENTORY_IMAGE = "cryo_pipes_two.png" |
224 CURSOR = CursorSprite('cryo_pipes_two_cursor.png') | |
225 TOOL_NAME = "cryo_pipes_two" | |
226 | |
227 | |
228 class CryoPipesThree(Item): | |
229 "Three cryo pipes (each made from a tube fragment and can)." | |
230 | |
231 INVENTORY_IMAGE = "cryo_pipes_three.png" | |
232 CURSOR = CursorSprite('cryo_pipes_three_cursor.png') | |
233 TOOL_NAME = "cryo_pipes_three" | |
226 | 234 |
235 | |
194 | 236 class Grinder(Thing): |
237 | |
238 NAME = "machine.grinder" | |
239 | |
240 INTERACTS = { | |
281
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
241 "grind": InteractNoImage(86, 402, 94, 63), |
194 | 242 } |
243 | |
244 INITIAL = "grind" | |
245 | |
246 def interact_without(self): | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
247 return Result(_("It looks like it eats fingers. Perhaps a different approach is in order?")) |
194 | 248 |
249 def interact_with_titanium_leg(self, item): | |
306
bd9a760eeb18
Hook up canopener. Fix for replace_inventory changes
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
250 self.state.replace_inventory_item(item.name, 'machete') |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
251 return Result(_("After much delicate grinding and a few close calls with" |
194 | 252 " various body parts, the titanium femur now resembles" |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
253 " a machete more than a bone. Nice and sharp, too."), |
206
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
194
diff
changeset
|
254 soundfile="grinder.ogg") |
194 | 255 |
256 def get_description(self): | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
257 return _("A pretty ordinary, albeit rather industrial, grinding machine.") |
194 | 258 |
259 | |
260 class TitaniumMachete(Item): | |
261 "Titanium machete, formerly a leg." | |
262 | |
307
5031b84fbb4c
Hook up new machete, can_opener, and titanium_femur images
Stefano Rivera <stefano@rivera.za.net>
parents:
306
diff
changeset
|
263 INVENTORY_IMAGE = "machete.png" |
5031b84fbb4c
Hook up new machete, can_opener, and titanium_femur images
Stefano Rivera <stefano@rivera.za.net>
parents:
306
diff
changeset
|
264 CURSOR = CursorSprite('machete_cursor.png', 23, 1) |
194 | 265 |
266 | |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
267 class ManualThing(Thing): |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
268 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
269 NAME = "machine.manual" |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
270 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
271 INTERACTS = { |
333 | 272 "manual": InteractImage(432, 493, "manual_on_floor.png"), |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
273 } |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
274 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
275 INITIAL = "manual" |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
276 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
277 def interact_without(self): |
333 | 278 self.scene.remove_thing(self) |
279 self.state.add_inventory_item("manual") | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
280 return Result(_("Ah! The ship's instruction manual. You'd feel better" |
333 | 281 " if the previous owner wasn't lying next to it with a" |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
466
diff
changeset
|
282 " gaping hole in his rib cage.")) |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
283 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
284 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
285 class Manual(Item): |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
286 "A ship instruction manual." |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
287 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
288 INVENTORY_IMAGE = "manual.png" |
384
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
289 CURSOR = None |
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
290 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
513
diff
changeset
|
291 def is_interactive(self, tool=None): |
513
0e8487038834
fixed crash caused by the manual item's special snowflakeness
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
512
diff
changeset
|
292 return True |
0e8487038834
fixed crash caused by the manual item's special snowflakeness
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
512
diff
changeset
|
293 |
512 | 294 def interact_without(self): |
384
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
295 return Result(detail_view='manual_detail') |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
296 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
297 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
298 SCENES = [Machine] |