Mercurial > pyntnclick
annotate gamelib/scenes/machine.py @ 462:eebd6e08cbc9
Mac icons hooked up, chops added and engine fix message fixed.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 29 Aug 2010 01:23:08 +0200 |
parents | 786773393e6f |
children | af2a23b9787d |
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 |
242 | 79 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
|
80 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
81 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
|
82 |
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 INTERACTS = { |
262
5f58da9eeb52
Replace text interacts with doors.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
260
diff
changeset
|
84 "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
|
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 |
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
|
87 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
|
88 |
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
|
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 class LaserWelderSlot(Thing): |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
91 |
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
|
92 NAME = "machine.welder.slot" |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
93 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
94 INTERACTS = { |
329 | 95 "empty": InteractImage(241, 310, "welder_empty.png"), |
96 "can": InteractImage(241, 310, "welder_can.png"), | |
97 "tube": InteractImage(241, 310, "welder_pipe.png"), | |
98 "can_and_tube": InteractImage(241, 310, "welder_can_pipe.png"), | |
99 } | |
100 | |
101 INITIAL = "empty" | |
102 | |
103 INITIAL_DATA = { | |
104 'contents': set(), | |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
105 } |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
106 |
329 | 107 def update_contents(self): |
108 """Update the interact after a contents change.""" | |
109 contents = self.get_data('contents') | |
110 if not contents: | |
111 self.set_interact("empty") | |
112 elif len(contents) == 1: | |
113 if "can" in contents: | |
114 self.set_interact("can") | |
115 elif "tube" in contents: | |
116 self.set_interact("tube") | |
117 else: | |
118 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
|
119 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
120 def interact_without(self): |
406 | 121 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
|
122 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
123 def interact_with_empty_can(self, item): |
329 | 124 contents = self.get_data('contents') |
125 if "can" in contents: | |
126 return Result("There is already a can in the welder.") | |
127 self.state.remove_inventory_item(item.name) | |
128 contents.add("can") | |
129 self.update_contents() | |
130 return Result("You carefully place the can in the laser welder.") | |
131 | |
132 def interact_with_tube_fragment(self, item): | |
133 contents = self.get_data('contents') | |
134 if "tube" in contents: | |
135 return Result("There is already a tube fragment in the welder.") | |
136 self.state.remove_inventory_item(item.name) | |
137 contents.add("tube") | |
138 self.update_contents() | |
139 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
|
140 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
141 def get_description(self): |
329 | 142 contents = self.get_data('contents') |
143 if not contents: | |
193
738608e90e9c
CloneableItem tweaks and a usable laser welder. zOMG!
Jeremy Thurgood <firxen@gmail.com>
parents:
190
diff
changeset
|
144 return "This is a Smith and Wesson 'zOMG' class high-precision laser welder." |
329 | 145 if len(contents) == 1: |
146 msg = "The laser welder looks hungry, somehow." | |
147 if "can" in contents: | |
148 msg += " It currently contains an empty can." | |
149 elif "tube" in contents: | |
150 msg += " It currently contains a tube fragment." | |
151 elif len(contents) == 2: | |
152 msg = "The laser welder looks expectant. " | |
153 if "can" in contents and "tube" in contents: | |
154 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
|
155 return msg |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
156 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
157 |
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
|
158 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
|
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 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
|
161 |
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 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
|
163 "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
|
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 |
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 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
|
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 def interact_without(self): |
329 | 169 contents = self.scene.things["machine.welder.slot"].get_data("contents") |
170 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
|
171 return Result("The laser welder doesn't currently contain anything weldable.") |
329 | 172 elif len(contents) == 1: |
173 if "can" in contents: | |
174 return Result("The laser welder needs something to weld the can to.") | |
175 elif "tube" in contents: | |
176 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
|
177 else: |
329 | 178 self.scene.things["machine.welder.slot"].set_data("contents", set()) |
179 self.scene.things["machine.welder.slot"].update_contents() | |
180 if self.state.items["cryo_pipes_one"] in self.state.inventory: | |
181 self.state.replace_inventory_item("cryo_pipes_one", "cryo_pipes_two") | |
459 | 182 return Result("With high-precision spitzensparken, you weld" |
183 " together a second pipe. You bundle the two pipes together.", | |
184 soundfile='laser.ogg') | |
329 | 185 elif self.state.items["cryo_pipes_two"] in self.state.inventory: |
186 self.state.replace_inventory_item("cryo_pipes_two", "cryo_pipes_three") | |
459 | 187 return Result("With high-precision spitzensparken, you create yet" |
188 " another pipe. You store it with the other two.", | |
189 soundfile='laser.ogg') | |
329 | 190 elif self.state.items["cryo_pipes_three"] in self.state.inventory: |
191 # just for safety | |
459 | 192 return None |
329 | 193 else: |
194 self.state.add_inventory_item("cryo_pipes_one") | |
459 | 195 return Result("With high-precision spitzensparken, the can and tube are welded" |
435 | 196 " into a whole greater than the sum of the parts.", |
329 | 197 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
|
198 |
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
|
199 |
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
|
200 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
|
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 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
|
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 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
|
205 "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
|
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 |
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 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
|
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 def get_description(self): |
372
3aee5895c2c6
remove random out of 1 choice
Neil Muller <neil@dip.sun.ac.za>
parents:
333
diff
changeset
|
211 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
|
212 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
213 |
329 | 214 class CryoPipesOne(Item): |
215 "A single cryo pipe (made from a tube fragment and can)." | |
216 | |
217 INVENTORY_IMAGE = "cryo_pipes_one.png" | |
218 CURSOR = CursorSprite('cryo_pipes_one_cursor.png') | |
219 TOOL_NAME = "cryo_pipes_one" | |
220 | |
221 | |
222 class CryoPipesTwo(Item): | |
223 "Two cryo pipes (each made from a tube fragment and can)." | |
226 | 224 |
329 | 225 INVENTORY_IMAGE = "cryo_pipes_two.png" |
226 CURSOR = CursorSprite('cryo_pipes_two_cursor.png') | |
227 TOOL_NAME = "cryo_pipes_two" | |
228 | |
229 | |
230 class CryoPipesThree(Item): | |
231 "Three cryo pipes (each made from a tube fragment and can)." | |
232 | |
233 INVENTORY_IMAGE = "cryo_pipes_three.png" | |
234 CURSOR = CursorSprite('cryo_pipes_three_cursor.png') | |
235 TOOL_NAME = "cryo_pipes_three" | |
226 | 236 |
237 | |
194 | 238 class Grinder(Thing): |
239 | |
240 NAME = "machine.grinder" | |
241 | |
242 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
|
243 "grind": InteractNoImage(86, 402, 94, 63), |
194 | 244 } |
245 | |
246 INITIAL = "grind" | |
247 | |
248 def interact_without(self): | |
249 return Result("It looks like it eats fingers. Perhaps a different approach is in order?") | |
250 | |
251 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
|
252 self.state.replace_inventory_item(item.name, 'machete') |
194 | 253 return Result("After much delicate grinding and a few close calls with" |
254 " 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
|
255 " 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
|
256 soundfile="grinder.ogg") |
194 | 257 |
258 def get_description(self): | |
259 return "A pretty ordinary, albeit rather industrial, grinding machine." | |
260 | |
261 | |
262 class TitaniumMachete(Item): | |
263 "Titanium machete, formerly a leg." | |
264 | |
307
5031b84fbb4c
Hook up new machete, can_opener, and titanium_femur images
Stefano Rivera <stefano@rivera.za.net>
parents:
306
diff
changeset
|
265 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
|
266 CURSOR = CursorSprite('machete_cursor.png', 23, 1) |
194 | 267 |
268 | |
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
|
269 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
|
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 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
|
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 INTERACTS = { |
333 | 274 "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
|
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 |
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 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
|
278 |
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
|
279 def interact_without(self): |
333 | 280 self.scene.remove_thing(self) |
281 self.state.add_inventory_item("manual") | |
282 return Result("Ah! The ship's instruction manual. You'd feel better" | |
283 " if the previous owner wasn't lying next to it with a" | |
284 " 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
|
285 |
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 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
|
288 "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
|
289 |
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
|
290 INVENTORY_IMAGE = "manual.png" |
384
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
291 CURSOR = None |
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
292 |
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
293 def interact_without(self, state): |
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
294 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
|
295 |
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 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
297 SCENES = [Machine] |