Mercurial > boomslang
annotate gamelib/scenes/machine.py @ 350:125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 28 Aug 2010 15:31:45 +0200 |
parents | 81f5fb9f50e4 |
children | 3aee5895c2c6 |
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 |
283
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
281
diff
changeset
|
3 import random |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
281
diff
changeset
|
4 |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
262
diff
changeset
|
5 from gamelib.state import Scene, Item, Thing, Result |
194 | 6 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
|
7 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
|
8 InteractRectUnion, InteractImage, |
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
262
diff
changeset
|
9 InteractAnimated, GenericDescThing) |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
10 |
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 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
17 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
|
18 'accessible': True, |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
19 } |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
20 |
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
|
21 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
|
22 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
|
23 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
|
24 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
|
25 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
|
26 self.add_thing(LaserWelderPowerLights()) |
194 | 27 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
|
28 self.add_thing(ManualThing()) |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
215
diff
changeset
|
29 self.add_item(TitaniumMachete('machete')) |
329 | 30 self.add_item(CryoPipesOne('cryo_pipes_one')) |
31 self.add_item(CryoPipesTwo('cryo_pipes_two')) | |
32 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
|
33 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
|
34 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
|
35 "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
|
36 ( |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
37 (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
|
38 (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
|
39 (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
|
40 (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
|
41 (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
|
42 (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
|
43 (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
|
44 (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
|
45 (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
|
46 (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
|
47 (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
|
48 (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
|
49 (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
|
50 (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
|
51 (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
|
52 (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
|
53 ))) |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
54 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
|
55 "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
|
56 ((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
|
57 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
|
58 "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
|
59 ((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
|
60 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
|
61 "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
|
62 ((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
|
63 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
|
64 "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
|
65 ( |
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 (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
|
67 (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
|
68 (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
|
69 (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
|
70 (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
|
71 (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
|
72 (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
|
73 (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
|
74 (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
|
75 ))) |
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 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
|
77 "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
|
78 ((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
|
79 |
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 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
|
81 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
|
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 |
242 | 84 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
|
85 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
86 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
|
87 |
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 INTERACTS = { |
262
5f58da9eeb52
Replace text interacts with doors.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
260
diff
changeset
|
89 "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
|
90 } |
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 |
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
|
92 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
|
93 |
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
|
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 class LaserWelderSlot(Thing): |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
96 |
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
|
97 NAME = "machine.welder.slot" |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
98 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
99 INTERACTS = { |
329 | 100 "empty": InteractImage(241, 310, "welder_empty.png"), |
101 "can": InteractImage(241, 310, "welder_can.png"), | |
102 "tube": InteractImage(241, 310, "welder_pipe.png"), | |
103 "can_and_tube": InteractImage(241, 310, "welder_can_pipe.png"), | |
104 } | |
105 | |
106 INITIAL = "empty" | |
107 | |
108 INITIAL_DATA = { | |
109 'contents': set(), | |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
110 } |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
111 |
329 | 112 def update_contents(self): |
113 """Update the interact after a contents change.""" | |
114 contents = self.get_data('contents') | |
115 if not contents: | |
116 self.set_interact("empty") | |
117 elif len(contents) == 1: | |
118 if "can" in contents: | |
119 self.set_interact("can") | |
120 elif "tube" in contents: | |
121 self.set_interact("tube") | |
122 else: | |
123 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
|
124 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
125 def interact_without(self): |
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
|
126 return Result("You really don't want to but your hand in there.") |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
127 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
128 def interact_with_empty_can(self, item): |
329 | 129 contents = self.get_data('contents') |
130 if "can" in contents: | |
131 return Result("There is already a can in the welder.") | |
132 self.state.remove_inventory_item(item.name) | |
133 contents.add("can") | |
134 self.update_contents() | |
135 return Result("You carefully place the can in the laser welder.") | |
136 | |
137 def interact_with_tube_fragment(self, item): | |
138 contents = self.get_data('contents') | |
139 if "tube" in contents: | |
140 return Result("There is already a tube fragment in the welder.") | |
141 self.state.remove_inventory_item(item.name) | |
142 contents.add("tube") | |
143 self.update_contents() | |
144 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
|
145 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
146 def get_description(self): |
329 | 147 contents = self.get_data('contents') |
148 if not contents: | |
193
738608e90e9c
CloneableItem tweaks and a usable laser welder. zOMG!
Jeremy Thurgood <firxen@gmail.com>
parents:
190
diff
changeset
|
149 return "This is a Smith and Wesson 'zOMG' class high-precision laser welder." |
329 | 150 if len(contents) == 1: |
151 msg = "The laser welder looks hungry, somehow." | |
152 if "can" in contents: | |
153 msg += " It currently contains an empty can." | |
154 elif "tube" in contents: | |
155 msg += " It currently contains a tube fragment." | |
156 elif len(contents) == 2: | |
157 msg = "The laser welder looks expectant. " | |
158 if "can" in contents and "tube" in contents: | |
159 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
|
160 return msg |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
161 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
162 |
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
|
163 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
|
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 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
|
166 |
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 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
|
168 "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
|
169 } |
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 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
|
172 |
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
|
173 def interact_without(self): |
329 | 174 contents = self.scene.things["machine.welder.slot"].get_data("contents") |
175 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
|
176 return Result("The laser welder doesn't currently contain anything weldable.") |
329 | 177 elif len(contents) == 1: |
178 if "can" in contents: | |
179 return Result("The laser welder needs something to weld the can to.") | |
180 elif "tube" in contents: | |
181 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
|
182 else: |
329 | 183 self.scene.things["machine.welder.slot"].set_data("contents", set()) |
184 self.scene.things["machine.welder.slot"].update_contents() | |
185 if self.state.items["cryo_pipes_one"] in self.state.inventory: | |
186 self.state.replace_inventory_item("cryo_pipes_one", "cryo_pipes_two") | |
187 elif self.state.items["cryo_pipes_two"] in self.state.inventory: | |
188 self.state.replace_inventory_item("cryo_pipes_two", "cryo_pipes_three") | |
189 elif self.state.items["cryo_pipes_three"] in self.state.inventory: | |
190 # just for safety | |
191 pass | |
192 else: | |
193 self.state.add_inventory_item("cryo_pipes_one") | |
194 return Result("With high-precision spitzensparken, the can and tube a welded" | |
195 " into a whole greater than the parts.", | |
196 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
|
197 |
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 |
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
|
199 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
|
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 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
|
202 |
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 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
|
204 "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
|
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 |
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 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
|
208 |
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 def get_description(self): |
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 return random.choice([ |
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 "The power lights pulse expectantly.", |
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 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
214 |
329 | 215 class CryoPipesOne(Item): |
216 "A single cryo pipe (made from a tube fragment and can)." | |
217 | |
218 INVENTORY_IMAGE = "cryo_pipes_one.png" | |
219 CURSOR = CursorSprite('cryo_pipes_one_cursor.png') | |
220 TOOL_NAME = "cryo_pipes_one" | |
221 | |
222 | |
223 class CryoPipesTwo(Item): | |
224 "Two cryo pipes (each made from a tube fragment and can)." | |
226 | 225 |
329 | 226 INVENTORY_IMAGE = "cryo_pipes_two.png" |
227 CURSOR = CursorSprite('cryo_pipes_two_cursor.png') | |
228 TOOL_NAME = "cryo_pipes_two" | |
229 | |
230 | |
231 class CryoPipesThree(Item): | |
232 "Three cryo pipes (each made from a tube fragment and can)." | |
233 | |
234 INVENTORY_IMAGE = "cryo_pipes_three.png" | |
235 CURSOR = CursorSprite('cryo_pipes_three_cursor.png') | |
236 TOOL_NAME = "cryo_pipes_three" | |
226 | 237 |
238 | |
194 | 239 class Grinder(Thing): |
240 | |
241 NAME = "machine.grinder" | |
242 | |
243 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
|
244 "grind": InteractNoImage(86, 402, 94, 63), |
194 | 245 } |
246 | |
247 INITIAL = "grind" | |
248 | |
249 def interact_without(self): | |
250 return Result("It looks like it eats fingers. Perhaps a different approach is in order?") | |
251 | |
252 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
|
253 self.state.replace_inventory_item(item.name, 'machete') |
194 | 254 return Result("After much delicate grinding and a few close calls with" |
255 " 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
|
256 " 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
|
257 soundfile="grinder.ogg") |
194 | 258 |
259 def get_description(self): | |
260 return "A pretty ordinary, albeit rather industrial, grinding machine." | |
261 | |
262 | |
263 class TitaniumMachete(Item): | |
264 "Titanium machete, formerly a leg." | |
265 | |
307
5031b84fbb4c
Hook up new machete, can_opener, and titanium_femur images
Stefano Rivera <stefano@rivera.za.net>
parents:
306
diff
changeset
|
266 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
|
267 CURSOR = CursorSprite('machete_cursor.png', 23, 1) |
194 | 268 |
269 | |
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
|
270 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
|
271 |
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 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
|
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 INTERACTS = { |
333 | 275 "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
|
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 |
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 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
|
279 |
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
|
280 def interact_without(self): |
333 | 281 self.scene.remove_thing(self) |
282 self.state.add_inventory_item("manual") | |
283 return Result("Ah! The ship's instruction manual. You'd feel better" | |
284 " if the previous owner wasn't lying next to it with a" | |
285 " 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
|
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 |
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 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
|
289 "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
|
290 |
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
|
291 INVENTORY_IMAGE = "manual.png" |
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 CURSOR = CursorSprite('traingle.png', 23, 1) # TODO: replace with manual_cursor.png |
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 |
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
|
294 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
295 SCENES = [Machine] |