Mercurial > pyntnclick
annotate gamelib/scenes/machine.py @ 549:098ea4ea0d0d pyntnclick
Rename imports
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 11 Feb 2012 13:19:21 +0200 |
parents | 11530992924a |
children | 4e9178215e75 |
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 |
549 | 3 from pyntnclick.state import Scene, Item, Thing, Result |
4 from pyntnclick.cursor import CursorSprite | |
5 from pyntnclick.scenewidgets import (InteractNoImage, InteractImage, | |
525
821b322e903b
Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
519
diff
changeset
|
6 InteractAnimated, GenericDescThing) |
821b322e903b
Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
519
diff
changeset
|
7 |
821b322e903b
Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
519
diff
changeset
|
8 from gamelib.scenes.game_widgets import Door |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
9 |
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 class Machine(Scene): |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
12 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
13 FOLDER = "machine" |
260
020f83305bf3
Line art machine room.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
252
diff
changeset
|
14 BACKGROUND = "machine_room.png" |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
15 |
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 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
|
17 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
|
18 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
|
19 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
|
20 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
|
21 self.add_thing(LaserWelderPowerLights()) |
194 | 22 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
|
23 self.add_thing(ManualThing()) |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
215
diff
changeset
|
24 self.add_item(TitaniumMachete('machete')) |
329 | 25 self.add_item(CryoPipesOne('cryo_pipes_one')) |
26 self.add_item(CryoPipesTwo('cryo_pipes_two')) | |
27 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
|
28 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
|
29 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
|
30 "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
|
31 ( |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
32 (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
|
33 (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
|
34 (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
|
35 (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
|
36 (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
|
37 (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
|
38 (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
|
39 (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
|
40 (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
|
41 (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
|
42 (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
|
43 (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
|
44 (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
|
45 (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
|
46 (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
|
47 (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
|
48 ))) |
4adb64d349bc
Add some flavour text to machine room. Tweak rects
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
49 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
|
50 "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
|
51 ((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
|
52 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
|
53 "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
|
54 ((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
|
55 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
|
56 "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
|
57 ((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
|
58 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
|
59 "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
|
60 ( |
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 (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
|
62 (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
|
63 (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
|
64 (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
|
65 (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
|
66 (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
|
67 (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
|
68 (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
|
69 (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
|
70 ))) |
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 self.add_thing(GenericDescThing("machine.drill_press_block", 7, |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
72 "The block for the laser drill press", # TODO: fix description |
317
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
73 ((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
|
74 |
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
75 |
242 | 76 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
|
77 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
78 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
|
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 INTERACTS = { |
262
5f58da9eeb52
Replace text interacts with doors.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
260
diff
changeset
|
81 "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
|
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 |
d00aa26941c4
Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
84 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
|
85 |
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
|
86 |
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
|
87 class LaserWelderSlot(Thing): |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
88 |
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
|
89 NAME = "machine.welder.slot" |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
90 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
91 INTERACTS = { |
329 | 92 "empty": InteractImage(241, 310, "welder_empty.png"), |
93 "can": InteractImage(241, 310, "welder_can.png"), | |
94 "tube": InteractImage(241, 310, "welder_pipe.png"), | |
95 "can_and_tube": InteractImage(241, 310, "welder_can_pipe.png"), | |
96 } | |
97 | |
98 INITIAL = "empty" | |
99 | |
100 INITIAL_DATA = { | |
101 'contents': set(), | |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
102 } |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
103 |
329 | 104 def update_contents(self): |
105 """Update the interact after a contents change.""" | |
106 contents = self.get_data('contents') | |
107 if not contents: | |
108 self.set_interact("empty") | |
109 elif len(contents) == 1: | |
110 if "can" in contents: | |
111 self.set_interact("can") | |
112 elif "tube" in contents: | |
113 self.set_interact("tube") | |
114 else: | |
115 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
|
116 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
117 def interact_without(self): |
406 | 118 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
|
119 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
120 def interact_with_empty_can(self, item): |
329 | 121 contents = self.get_data('contents') |
122 if "can" in contents: | |
123 return Result("There is already a can in the welder.") | |
124 self.state.remove_inventory_item(item.name) | |
125 contents.add("can") | |
126 self.update_contents() | |
127 return Result("You carefully place the can in the laser welder.") | |
128 | |
129 def interact_with_tube_fragment(self, item): | |
130 contents = self.get_data('contents') | |
131 if "tube" in contents: | |
132 return Result("There is already a tube fragment in the welder.") | |
133 self.state.remove_inventory_item(item.name) | |
134 contents.add("tube") | |
135 self.update_contents() | |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
136 return Result("You carefully place the tube fragments in the" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
137 " laser welder.") |
190
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
138 |
30f2308c1efc
Fix tests and add a (currently unhooked) laser welder.
Jeremy Thurgood <firxen@gmail.com>
parents:
151
diff
changeset
|
139 def get_description(self): |
329 | 140 contents = self.get_data('contents') |
141 if not contents: | |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
142 return ("This is a Smith and Wesson 'zOMG' class high-precision" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
143 " laser welder.") |
329 | 144 if len(contents) == 1: |
145 msg = "The laser welder looks hungry, somehow." | |
146 if "can" in contents: | |
147 msg += " It currently contains an empty can." | |
148 elif "tube" in contents: | |
149 msg += " It currently contains a tube fragment." | |
150 elif len(contents) == 2: | |
151 msg = "The laser welder looks expectant. " | |
152 if "can" in contents and "tube" in contents: | |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
153 msg += (" It currently contains an empty can and a" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
154 " 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): |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
169 welder_slot = self.scene.things["machine.welder.slot"] |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
170 contents = welder_slot.get_data("contents") |
329 | 171 if not contents: |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
172 return Result("The laser welder doesn't currently contain" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
173 " anything weldable.") |
329 | 174 elif len(contents) == 1: |
175 if "can" in contents: | |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
176 return Result("The laser welder needs something to weld the" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
177 " can to.") |
329 | 178 elif "tube" in contents: |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
179 return Result("The laser welder needs something to weld the" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
180 " 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
|
181 else: |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
182 welder_slot.set_data("contents", set()) |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
183 welder_slot.update_contents() |
329 | 184 if self.state.items["cryo_pipes_one"] in self.state.inventory: |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
185 self.state.replace_inventory_item("cryo_pipes_one", |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
186 "cryo_pipes_two") |
459 | 187 return Result("With high-precision spitzensparken, you weld" |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
188 " together a second pipe. You bundle the two" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
189 " pipes together.", |
459 | 190 soundfile='laser.ogg') |
329 | 191 elif self.state.items["cryo_pipes_two"] in self.state.inventory: |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
192 self.state.replace_inventory_item("cryo_pipes_two", |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
193 "cryo_pipes_three") |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
194 return Result("With high-precision spitzensparken, you create" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
195 " yet another pipe. You store it with the other" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
196 " two.", |
459 | 197 soundfile='laser.ogg') |
329 | 198 elif self.state.items["cryo_pipes_three"] in self.state.inventory: |
199 # just for safety | |
459 | 200 return None |
329 | 201 else: |
202 self.state.add_inventory_item("cryo_pipes_one") | |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
203 return Result("With high-precision spitzensparken, the can and" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
204 " tube are welded into a whole greater than the" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
205 " sum of the parts.", |
329 | 206 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
|
207 |
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
|
208 |
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 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
|
210 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
211 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
|
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 INTERACTS = { |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
214 "lights": InteractAnimated(199, 273, ["power_lights_%d.png" % i for i |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
215 in range(8) + range(6, 0, -1)], |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
216 10), |
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
|
217 } |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
218 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
219 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
|
220 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
221 def get_description(self): |
372
3aee5895c2c6
remove random out of 1 choice
Neil Muller <neil@dip.sun.ac.za>
parents:
333
diff
changeset
|
222 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
|
223 |
eb3cfcaff469
Too long since last commit. Felt like showing off some machine room progress.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
263
diff
changeset
|
224 |
329 | 225 class CryoPipesOne(Item): |
226 "A single cryo pipe (made from a tube fragment and can)." | |
227 | |
228 INVENTORY_IMAGE = "cryo_pipes_one.png" | |
229 CURSOR = CursorSprite('cryo_pipes_one_cursor.png') | |
230 TOOL_NAME = "cryo_pipes_one" | |
231 | |
232 | |
233 class CryoPipesTwo(Item): | |
234 "Two cryo pipes (each made from a tube fragment and can)." | |
226 | 235 |
329 | 236 INVENTORY_IMAGE = "cryo_pipes_two.png" |
237 CURSOR = CursorSprite('cryo_pipes_two_cursor.png') | |
238 TOOL_NAME = "cryo_pipes_two" | |
239 | |
240 | |
241 class CryoPipesThree(Item): | |
242 "Three cryo pipes (each made from a tube fragment and can)." | |
243 | |
244 INVENTORY_IMAGE = "cryo_pipes_three.png" | |
245 CURSOR = CursorSprite('cryo_pipes_three_cursor.png') | |
246 TOOL_NAME = "cryo_pipes_three" | |
226 | 247 |
248 | |
194 | 249 class Grinder(Thing): |
250 | |
251 NAME = "machine.grinder" | |
252 | |
253 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
|
254 "grind": InteractNoImage(86, 402, 94, 63), |
194 | 255 } |
256 | |
257 INITIAL = "grind" | |
258 | |
259 def interact_without(self): | |
539
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
260 return Result("It looks like it eats fingers. Perhaps a different" |
11530992924a
PEP8 clean-up for engine, machine and mess.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
528
diff
changeset
|
261 " approach is in order?") |
194 | 262 |
263 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
|
264 self.state.replace_inventory_item(item.name, 'machete') |
194 | 265 return Result("After much delicate grinding and a few close calls with" |
266 " 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
|
267 " 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
|
268 soundfile="grinder.ogg") |
194 | 269 |
270 def get_description(self): | |
271 return "A pretty ordinary, albeit rather industrial, grinding machine." | |
272 | |
273 | |
274 class TitaniumMachete(Item): | |
275 "Titanium machete, formerly a leg." | |
276 | |
307
5031b84fbb4c
Hook up new machete, can_opener, and titanium_femur images
Stefano Rivera <stefano@rivera.za.net>
parents:
306
diff
changeset
|
277 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
|
278 CURSOR = CursorSprite('machete_cursor.png', 23, 1) |
194 | 279 |
280 | |
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
|
281 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
|
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 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
|
284 |
3d1a5c0c362a
Split laser welder slot and on button. Add manual thing. Add descriptions for drill press and block.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
307
diff
changeset
|
285 INTERACTS = { |
333 | 286 "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
|
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 |
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 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
|
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 def interact_without(self): |
333 | 292 self.scene.remove_thing(self) |
293 self.state.add_inventory_item("manual") | |
294 return Result("Ah! The ship's instruction manual. You'd feel better" | |
295 " if the previous owner wasn't lying next to it with a" | |
296 " 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
|
297 |
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
|
298 |
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
|
299 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
|
300 "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
|
301 |
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
|
302 INVENTORY_IMAGE = "manual.png" |
384
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
303 CURSOR = None |
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
304 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
513
diff
changeset
|
305 def is_interactive(self, tool=None): |
513
0e8487038834
fixed crash caused by the manual item's special snowflakeness
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
512
diff
changeset
|
306 return True |
0e8487038834
fixed crash caused by the manual item's special snowflakeness
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
512
diff
changeset
|
307 |
512 | 308 def interact_without(self): |
384
56a05ae56574
Initial manual implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
372
diff
changeset
|
309 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
|
310 |
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
|
311 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
312 SCENES = [Machine] |