Mercurial > boomslang
annotate gamelib/scenes/machine.py @ 426:dabc9d15c18c
Jim complains when you break the chair
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 28 Aug 2010 23:25:48 +0200 |
parents | 90ae05f25793 |
children | 19aff54b2e73 |
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 |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
262
diff
changeset
|
5 from gamelib.scenes.scene_widgets import (Door, InteractText, InteractNoImage, |
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
262
diff
changeset
|
6 InteractRectUnion, InteractImage, |
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
262
diff
changeset
|
7 InteractAnimated, GenericDescThing) |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
8 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
9 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
10 class Machine(Scene): |
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 FOLDER = "machine" |
260
020f83305bf3
Line art machine room.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
252
diff
changeset
|
13 BACKGROUND = "machine_room.png" |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
14 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
15 INITIAL_DATA = { |
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
|
16 'accessible': True, |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
17 } |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
18 |
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
|
19 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
|
20 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
|
21 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
|
22 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
|
23 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
|
24 self.add_thing(LaserWelderPowerLights()) |
194 | 25 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
|
26 self.add_thing(ManualThing()) |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
215
diff
changeset
|
27 self.add_item(TitaniumMachete('machete')) |
329 | 28 self.add_item(CryoPipesOne('cryo_pipes_one')) |
29 self.add_item(CryoPipesTwo('cryo_pipes_two')) | |
30 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
|
31 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
|
32 self.add_thing(GenericDescThing('machine.wires', 2, |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
33 "Wires run to all the machines in the room", |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
34 ( |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
35 (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
|
36 (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
|
37 (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
|
38 (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
|
39 (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
|
40 (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
|
41 (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
|
42 (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
|
43 (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
|
44 (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
|
45 (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
|
46 (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
|
47 (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
|
48 (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
|
49 (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
|
50 (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
|
51 ))) |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
52 self.add_thing(GenericDescThing('machine.diagram', 3, |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
53 "A wiring diagram of some sort", |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
54 ((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
|
55 self.add_thing(GenericDescThing('machine.powerpoint', 4, |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
56 "The cables to this power point have been cut", |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
57 ((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
|
58 self.add_thing(GenericDescThing("machine.powerpoint", 5, |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
59 "All the machines run off this powerpoint", |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
60 ((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
|
61 self.add_thing(GenericDescThing("machine.drill_press", 6, |
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 "An impressive looking laser drill press", |
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 ( |
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 (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
|
65 (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
|
66 (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
|
67 (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
|
68 (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
|
69 (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
|
70 (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
|
71 (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
|
72 (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
|
73 ))) |
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 self.add_thing(GenericDescThing("machine.drill_press_block", 7, |
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
|
75 "The block for the laser drill press", # TODO: fix description |
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
|
76 ((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
|
77 |
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 def enter(self): |
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
|
79 return Result("The machine room is dark and forbidding.") |
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 |
242 | 82 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
|
83 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
84 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
|
85 |
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 INTERACTS = { |
262
5f58da9eeb52
Replace text interacts with doors.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
260
diff
changeset
|
87 "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
|
88 } |
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
|
89 |
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
|
90 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
|
91 |
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
|
92 |
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
|
93 class LaserWelderSlot(Thing): |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
94 |
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
|
95 NAME = "machine.welder.slot" |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
96 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
97 INTERACTS = { |
329 | 98 "empty": InteractImage(241, 310, "welder_empty.png"), |
99 "can": InteractImage(241, 310, "welder_can.png"), | |
100 "tube": InteractImage(241, 310, "welder_pipe.png"), | |
101 "can_and_tube": InteractImage(241, 310, "welder_can_pipe.png"), | |
102 } | |
103 | |
104 INITIAL = "empty" | |
105 | |
106 INITIAL_DATA = { | |
107 'contents': set(), | |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
108 } |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
109 |
329 | 110 def update_contents(self): |
111 """Update the interact after a contents change.""" | |
112 contents = self.get_data('contents') | |
113 if not contents: | |
114 self.set_interact("empty") | |
115 elif len(contents) == 1: | |
116 if "can" in contents: | |
117 self.set_interact("can") | |
118 elif "tube" in contents: | |
119 self.set_interact("tube") | |
120 else: | |
121 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
|
122 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
123 def interact_without(self): |
406 | 124 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
|
125 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
126 def interact_with_empty_can(self, item): |
329 | 127 contents = self.get_data('contents') |
128 if "can" in contents: | |
129 return Result("There is already a can in the welder.") | |
130 self.state.remove_inventory_item(item.name) | |
131 contents.add("can") | |
132 self.update_contents() | |
133 return Result("You carefully place the can in the laser welder.") | |
134 | |
135 def interact_with_tube_fragment(self, item): | |
136 contents = self.get_data('contents') | |
137 if "tube" in contents: | |
138 return Result("There is already a tube fragment in the welder.") | |
139 self.state.remove_inventory_item(item.name) | |
140 contents.add("tube") | |
141 self.update_contents() | |
142 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
|
143 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
144 def get_description(self): |
329 | 145 contents = self.get_data('contents') |
146 if not contents: | |
193
738608e90e9c
CloneableItem tweaks and a usable laser welder. zOMG!
Jeremy Thurgood <firxen@gmail.com>
parents:
190
diff
changeset
|
147 return "This is a Smith and Wesson 'zOMG' class high-precision laser welder." |
329 | 148 if len(contents) == 1: |
149 msg = "The laser welder looks hungry, somehow." | |
150 if "can" in contents: | |
151 msg += " It currently contains an empty can." | |
152 elif "tube" in contents: | |
153 msg += " It currently contains a tube fragment." | |
154 elif len(contents) == 2: | |
155 msg = "The laser welder looks expectant. " | |
156 if "can" in contents and "tube" in contents: | |
157 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
|
158 return msg |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
159 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
160 |
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
|
161 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
|
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 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
|
164 |
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 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
|
166 "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
|
167 } |
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
|
168 |
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
|
169 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
|
170 |
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
|
171 def interact_without(self): |
329 | 172 contents = self.scene.things["machine.welder.slot"].get_data("contents") |
173 if not contents: | |
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
|
174 return Result("The laser welder doesn't currently contain anything weldable.") |
329 | 175 elif len(contents) == 1: |
176 if "can" in contents: | |
177 return Result("The laser welder needs something to weld the can to.") | |
178 elif "tube" in contents: | |
179 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
|
180 else: |
329 | 181 self.scene.things["machine.welder.slot"].set_data("contents", set()) |
182 self.scene.things["machine.welder.slot"].update_contents() | |
183 if self.state.items["cryo_pipes_one"] in self.state.inventory: | |
184 self.state.replace_inventory_item("cryo_pipes_one", "cryo_pipes_two") | |
185 elif self.state.items["cryo_pipes_two"] in self.state.inventory: | |
186 self.state.replace_inventory_item("cryo_pipes_two", "cryo_pipes_three") | |
187 elif self.state.items["cryo_pipes_three"] in self.state.inventory: | |
188 # just for safety | |
189 pass | |
190 else: | |
191 self.state.add_inventory_item("cryo_pipes_one") | |
406 | 192 return Result("With high-precision spitzensparken, the can and tube are welded" |
329 | 193 " into a whole greater than the parts.", |
194 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
|
195 |
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 |
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
|
197 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
|
198 |
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 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
|
200 |
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 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
|
202 "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
|
203 } |
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 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
|
206 |
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 def get_description(self): |
372
3aee5895c2c6
remove random out of 1 choice
Neil Muller <neil@dip.sun.ac.za>
parents:
333
diff
changeset
|
208 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
|
209 |
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 |
329 | 211 class CryoPipesOne(Item): |
212 "A single cryo pipe (made from a tube fragment and can)." | |
213 | |
214 INVENTORY_IMAGE = "cryo_pipes_one.png" | |
215 CURSOR = CursorSprite('cryo_pipes_one_cursor.png') | |
216 TOOL_NAME = "cryo_pipes_one" | |
217 | |
218 | |
219 class CryoPipesTwo(Item): | |
220 "Two cryo pipes (each made from a tube fragment and can)." | |
226 | 221 |
329 | 222 INVENTORY_IMAGE = "cryo_pipes_two.png" |
223 CURSOR = CursorSprite('cryo_pipes_two_cursor.png') | |
224 TOOL_NAME = "cryo_pipes_two" | |
225 | |
226 | |
227 class CryoPipesThree(Item): | |
228 "Three cryo pipes (each made from a tube fragment and can)." | |
229 | |
230 INVENTORY_IMAGE = "cryo_pipes_three.png" | |
231 CURSOR = CursorSprite('cryo_pipes_three_cursor.png') | |
232 TOOL_NAME = "cryo_pipes_three" | |
226 | 233 |
234 | |
194 | 235 class Grinder(Thing): |
236 | |
237 NAME = "machine.grinder" | |
238 | |
239 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
|
240 "grind": InteractNoImage(86, 402, 94, 63), |
194 | 241 } |
242 | |
243 INITIAL = "grind" | |
244 | |
245 def interact_without(self): | |
246 return Result("It looks like it eats fingers. Perhaps a different approach is in order?") | |
247 | |
248 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
|
249 self.state.replace_inventory_item(item.name, 'machete') |
194 | 250 return Result("After much delicate grinding and a few close calls with" |
251 " various body parts, the titanium femur now resembles" | |
206
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
194
diff
changeset
|
252 " a machete more than a bone. Nice and sharp, too.", |
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
194
diff
changeset
|
253 soundfile="grinder.ogg") |
194 | 254 |
255 def get_description(self): | |
256 return "A pretty ordinary, albeit rather industrial, grinding machine." | |
257 | |
258 | |
259 class TitaniumMachete(Item): | |
260 "Titanium machete, formerly a leg." | |
261 | |
307
5031b84fbb4c
Hook up new machete, can_opener, and titanium_femur images
Stefano Rivera <stefano@rivera.za.net>
parents:
306
diff
changeset
|
262 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
|
263 CURSOR = CursorSprite('machete_cursor.png', 23, 1) |
194 | 264 |
265 | |
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
|
266 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
|
267 |
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 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
|
269 |
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 INTERACTS = { |
333 | 271 "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
|
272 } |
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 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
|
275 |
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 def interact_without(self): |
333 | 277 self.scene.remove_thing(self) |
278 self.state.add_inventory_item("manual") | |
279 return Result("Ah! The ship's instruction manual. You'd feel better" | |
280 " if the previous owner wasn't lying next to it with a" | |
281 " 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
|
282 |
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 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
|
285 "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
|
286 |
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 INVENTORY_IMAGE = "manual.png" |
384
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
288 CURSOR = None |
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
289 |
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
290 def interact_without(self, state): |
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
291 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
|
292 |
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
|
293 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
294 SCENES = [Machine] |