Mercurial > boomslang
annotate gamelib/scenes/bridge.py @ 330:8f85902f4cb6
Massage chair and base where swapped
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 28 Aug 2010 14:01:17 +0200 |
parents | 67e8a547970b |
children | 7d30cff9f949 |
rev | line source |
---|---|
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
1 """Bridge where the final showdown with the AI occurs.""" |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
2 |
251 | 3 import random |
4 | |
248 | 5 from albow.music import change_playlist, get_music, PlayList |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
6 from albow.resource import get_image |
248 | 7 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
8 from gamelib.cursor import CursorSprite |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
9 from gamelib.state import Scene, Item, Thing, Result |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
10 from gamelib.sound import get_current_playlist |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
11 |
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
12 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:
259
diff
changeset
|
13 InteractRectUnion, InteractImage, |
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
14 InteractAnimated, GenericDescThing) |
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
15 |
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 class Bridge(Scene): |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
18 |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
19 FOLDER = "bridge" |
235 | 20 BACKGROUND = 'bridge.png' |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
21 |
278 | 22 OFFSET = (0, -50) |
23 | |
248 | 24 MUSIC = [ |
256 | 25 'beep1.ogg', |
26 'beep2.ogg', | |
27 'beep880.ogg', | |
248 | 28 'beep660.ogg', |
256 | 29 'beep3.ogg', |
248 | 30 'silent.ogg', |
31 'creaking.ogg', | |
32 'silent.ogg', | |
33 ] | |
34 | |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
35 INITIAL_DATA = { |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
36 'accessible': True, |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
37 } |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
38 |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
39 def __init__(self, state): |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
40 super(Bridge, self).__init__(state) |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
41 self.background_playlist = None |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
42 self.add_item(Superconductor('superconductor')) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
43 self.add_item(Stethoscope('stethoscope')) |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
44 self.add_thing(ToMap()) |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
45 self.add_thing(MassageChair()) |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
46 self.add_thing(MassageChairBase()) |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
47 self.add_thing(StethoscopeThing()) |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
48 self.add_thing(BridgeComputer()) |
251 | 49 self.add_thing(LeftLights()) |
50 self.add_thing(RightLights()) | |
277 | 51 self.add_thing(GenericDescThing('bridge.wires', 1, |
293
4012d50a4674
more spelling and full stops
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
292
diff
changeset
|
52 "The brightly coloured wires contrast with the drab walls.", |
277 | 53 ((46, 4, 711, 143),))) |
54 self.add_thing(GenericDescThing('bridge.note', 2, | |
293
4012d50a4674
more spelling and full stops
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
292
diff
changeset
|
55 "\"Dammit JIM, I'm a doctor, not an engineer!\"", |
277 | 56 ( |
57 (491, 494, 194, 105), | |
58 (422, 533, 71, 66), | |
59 ))) | |
291 | 60 self.doctor = GenericDescThing('bridge.skel', 3, |
61 "A skeleton hangs improbably from the wires.", | |
62 ( | |
63 (632, 148, 40, 29), | |
64 (683, 176, 30, 101), | |
65 (652, 274, 45, 96), | |
66 (639, 180, 11, 95), | |
67 )) | |
68 self.add_thing(self.doctor) | |
69 | |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
70 |
120 | 71 def enter(self): |
248 | 72 pieces = [get_music(x, prefix='sounds') for x in self.MUSIC] |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
73 self.background_playlist = PlayList(pieces, random=True, repeat=True) |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
74 change_playlist(self.background_playlist) |
293
4012d50a4674
more spelling and full stops
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
292
diff
changeset
|
75 return Result("The bridge is in a sorry, shabby state.") |
120 | 76 |
248 | 77 def leave(self): |
78 change_playlist(None) | |
79 | |
120 | 80 |
242 | 81 class ToMap(Door): |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
82 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
251
diff
changeset
|
83 SCENE = "bridge" |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
84 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
85 INTERACTS = { |
235 | 86 "door": InteractNoImage(707, 344, 84, 245), |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
87 } |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
88 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
89 INITIAL = "door" |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
90 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
91 |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
92 class BridgeComputer(Thing): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
93 """The bridge computer. Gives status updates""" |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
94 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
95 NAME = "bridge.comp" |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
96 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
97 INTERACTS = { |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
98 'screen' : InteractNoImage(338, 296, 123, 74), |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
99 } |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
100 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
101 INITIAL = 'screen' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
102 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
103 def interact_without(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
104 return Result(detail_view='bridge_comp_detail') |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
105 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
106 def interact_with_titanium_leg(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
107 return Result("You can't break the duraplastic screen.") |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
108 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
109 def interact_with_machete(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
110 return Result("Scratching the screen won't help you.") |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
111 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
112 def get_description(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
113 return "The main bridge computer screen." |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
114 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
115 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
116 class MassageChairBase(Thing): |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
117 "The captain's massage chair, contains superconductor" |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
118 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
119 NAME = 'bridge.massagechair_base' |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
120 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
121 INTERACTS = { |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
122 'chair': InteractNoImage(127, 518, 69, 64), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
123 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
124 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
125 INITIAL = 'chair' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
126 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
127 INITIAL_DATA = { |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
128 'contains_superconductor': True, |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
129 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
130 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
131 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
132 return Result(detail_view='chair_detail') |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
133 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
134 def get_description(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
135 if self.get_data('contains_superconductor'): |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
136 return "A top of the line Massage-o-Matic Captain's Executive Command Chair. " \ |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
137 "It's massaging a skeleton." |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
138 return "The chair won't work any more, it has no power." |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
139 |
327
67e8a547970b
More engine room descs
Stefano Rivera <stefano@rivera.za.net>
parents:
316
diff
changeset
|
140 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
141 class MassageChair(Thing): |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
142 "The captain's massage chair, contains superconductor" |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
143 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
144 NAME = 'bridge.massagechair' |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
145 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
146 INTERACTS = { |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
147 'chair': InteractRectUnion(( |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
148 (148, 418, 77, 68), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
149 (69, 363, 80, 156), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
150 (104, 514, 18, 40), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
151 (147, 487, 106, 32), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
152 (220, 518, 83, 49), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
153 (196, 502, 75, 34), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
154 (207, 534, 69, 51), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
155 )), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
156 } |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
157 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
158 INITIAL = 'chair' |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
159 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
160 def get_description(self): |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
161 return self.state.current_scene.things['bridge.massagechair_base'] \ |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
162 .get_description() |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
163 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
164 def is_interactive(self): |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
165 return False |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
166 |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
167 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
168 class Stethoscope(Item): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
169 "Used for cracking safes. Found on the doctor on the chair" |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
170 |
269 | 171 INVENTORY_IMAGE = 'stethoscope.png' |
302
6d93e04036c9
CursorSprite: Default pointer-position to the centre of the cursor
Stefano Rivera <stefano@rivera.za.net>
parents:
293
diff
changeset
|
172 CURSOR = CursorSprite('stethoscope.png') |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
173 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
174 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
175 class StethoscopeThing(Thing): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
176 "Stehoscope on the doctor" |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
177 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
178 NAME ='bridge.stethoscope' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
179 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
180 INTERACTS = { |
269 | 181 'stethoscope': InteractImage(650, 178, 'hanging_stethoscope.png'), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
182 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
183 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
184 INITIAL = 'stethoscope' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
185 |
291 | 186 def get_description(self): |
293
4012d50a4674
more spelling and full stops
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
292
diff
changeset
|
187 return "A stethoscope hangs from the neck of the skeleton." |
291 | 188 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
189 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
190 self.state.add_inventory_item('stethoscope') |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
191 self.scene.remove_thing(self) |
291 | 192 # Fill in the doctor's rect |
193 self.scene.doctor.rect.append(self.rect) | |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
194 return Result("You pick up the stethoscope and verify that the doctor's " |
292 | 195 "heart has stopped. Probably a while ago.") |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
196 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
197 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
198 class Superconductor(Item): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
199 "Used for connecting high-powered parts of the ship up" |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
200 |
285
2ec328aeeaf8
Engine room mostly hooked up
Stefano Rivera <stefano@rivera.za.net>
parents:
278
diff
changeset
|
201 INVENTORY_IMAGE = 'superconductor_fixed.png' |
302
6d93e04036c9
CursorSprite: Default pointer-position to the centre of the cursor
Stefano Rivera <stefano@rivera.za.net>
parents:
293
diff
changeset
|
202 CURSOR = CursorSprite('superconductor_fixed.png') |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
203 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
204 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
205 class SuperconductorThing(Thing): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
206 "Superconductor from the massage chair." |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
207 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
208 NAME ='bridge.superconductor' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
209 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
210 INTERACTS = { |
259
b6e1c4e4e59d
Superconductor Thing now works.
Jeremy Thurgood <firxen@gmail.com>
parents:
257
diff
changeset
|
211 'superconductor': InteractImage(158, 138, 'superconductor.png'), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
212 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
213 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
214 INITIAL = 'superconductor' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
215 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
216 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
217 self.state.add_inventory_item('superconductor') |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
218 self.state.current_scene.things['bridge.massagechair_base'] \ |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
219 .set_data('contains_superconductor', False) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
220 self.scene.remove_thing(self) |
259
b6e1c4e4e59d
Superconductor Thing now works.
Jeremy Thurgood <firxen@gmail.com>
parents:
257
diff
changeset
|
221 return Result("The superconductor module unclips easily.") |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
222 |
251 | 223 class BlinkingLights(Thing): |
224 | |
270
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
269
diff
changeset
|
225 def is_interactive(self): |
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
269
diff
changeset
|
226 return False |
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
269
diff
changeset
|
227 |
251 | 228 def get_description(self): |
229 return random.choice([ | |
230 "The lights flash in interesting patterns.", | |
292 | 231 "The flashing lights don't mean anything to you.", |
232 "The console lights flash and flicker.", | |
251 | 233 ]) |
234 | |
235 class LeftLights(BlinkingLights): | |
236 | |
237 NAME ='bridge.lights.1' | |
238 | |
239 INTERACTS = { | |
240 "lights": InteractAnimated(176, 337, ["bridge_lights_1_1.png", "bridge_lights_1_2.png", "bridge_lights_1_3.png", "bridge_lights_1_2.png"], 5) | |
241 } | |
242 | |
243 INITIAL = 'lights' | |
244 | |
245 class RightLights(BlinkingLights): | |
246 | |
247 NAME ='bridge.lights.2' | |
248 | |
249 INTERACTS = { | |
250 "lights": InteractAnimated(559, 332, ["bridge_lights_2_1.png", "bridge_lights_2_2.png", "bridge_lights_2_3.png", "bridge_lights_2_2.png"], 5) | |
251 } | |
252 | |
253 INITIAL = 'lights' | |
254 | |
255 | |
256 | |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
257 class ChairDetail(Scene): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
258 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
259 FOLDER = 'bridge' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
260 BACKGROUND = 'chair_detail.png' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
261 NAME = 'chair_detail' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
262 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
263 SIZE = (300, 300) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
264 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
265 def __init__(self, state): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
266 super(ChairDetail, self).__init__(state) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
267 self.add_thing(SuperconductorThing()) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
268 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
269 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
270 # classes related the computer detail |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
271 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
272 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
273 class LogTab(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
274 """Tab for log screen""" |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
275 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
276 NAME = 'bridge_comp.screen' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
277 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
278 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
279 'log tab' : InteractNoImage(100, 53, 94, 37) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
280 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
281 INITIAL = 'log tab' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
282 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
283 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
284 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
285 return self.state.detail_views[self.COMPUTER].get_data('tab') == 'alert' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
286 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
287 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
288 self.state.detail_views[self.COMPUTER].set_data('tab', 'log') |
257 | 289 return Result(soundfile='beep550.ogg') |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
290 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
291 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
292 class AlertTab(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
293 """Tab for alert screen""" |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
294 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
295 NAME = 'bridge_comp.alert_tab' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
296 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
297 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
298 'alert tab' : InteractNoImage(12, 53, 88, 37) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
299 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
300 INITIAL = 'alert tab' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
301 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
302 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
303 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
304 return self.state.detail_views[self.COMPUTER].get_data('tab') == 'log' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
305 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
306 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
307 self.state.detail_views[self.COMPUTER].set_data('tab', 'alert') |
257 | 308 return Result(soundfile='beep550.ogg') |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
309 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
310 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
311 class CompUpButton(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
312 """Up button on log screen""" |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
313 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
314 NAME = 'bridge_comp.up_button' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
315 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
316 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
317 'up' : InteractNoImage(594, 82, 30, 58) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
318 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
319 INITIAL = 'up' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
320 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
321 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
322 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
323 tab = self.state.detail_views[self.COMPUTER].get_data('tab') |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
324 page = self.state.detail_views[self.COMPUTER].get_data('log page') |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
325 return tab == 'log' and page > 0 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
326 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
327 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
328 page = self.state.detail_views[self.COMPUTER].get_data('log page') |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
329 self.state.detail_views[self.COMPUTER].set_data('log page', page-1) |
257 | 330 return Result(soundfile='beep550.ogg') |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
331 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
332 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
333 class CompDownButton(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
334 """Down button on log screen""" |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
335 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
336 NAME = 'bridge_comp.down_button' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
337 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
338 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
339 'down' : InteractNoImage(594, 293, 30, 58) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
340 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
341 INITIAL = 'down' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
342 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
343 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
344 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
345 tab = self.state.detail_views[self.COMPUTER].get_data('tab') |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
346 page = self.state.detail_views[self.COMPUTER].get_data('log page') |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
347 max_page = self.state.detail_views[self.COMPUTER].get_data('max page') |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
348 return tab == 'log' and (page + 1) < max_page |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
349 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
350 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
351 page = self.state.detail_views[self.COMPUTER].get_data('log page') |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
352 self.state.detail_views[self.COMPUTER].set_data('log page', page+1) |
257 | 353 return Result(soundfile='beep550.ogg') |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
354 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
355 |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
356 class BridgeCompDetail(Scene): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
357 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
358 FOLDER = 'bridge' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
359 NAME = 'bridge_comp_detail' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
360 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
361 SIZE = (640, 400) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
362 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
363 ALERT = 'comp_detail_1.png' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
364 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
365 LOGS = ['comp_log_1.png', 'comp_log_2.png', |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
366 'comp_log_end.png'] |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
367 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
368 BACKGROUND = ALERT |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
369 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
370 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
371 INITIAL_DATA = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
372 'tab' : 'alert', |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
373 'log page' : 0, |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
374 'max page' : len(LOGS), |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
375 } |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
376 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
377 def __init__(self, state): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
378 super(BridgeCompDetail, self).__init__(state) |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
379 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
380 self.add_thing(LogTab()) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
381 self.add_thing(AlertTab()) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
382 self.add_thing(CompUpButton()) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
383 self.add_thing(CompDownButton()) |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
384 self._scene_playlist = None |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
385 self._alert = get_image(self.FOLDER, self.ALERT) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
386 self._logs = [get_image(self.FOLDER, x) for x in self.LOGS] |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
387 |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
388 def enter(self): |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
389 self._scene_playlist = get_current_playlist() |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
390 change_playlist(None) |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
391 |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
392 def leave(self): |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
393 change_playlist(self._scene_playlist) |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
394 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
395 def draw_background(self, surface): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
396 if self.get_data('tab') == 'alert': |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
397 self._background = self._alert |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
398 else: |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
399 self._background = self._logs[self.get_data('log page')] |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
400 super(BridgeCompDetail, self).draw_background(surface) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
401 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
402 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
403 SCENES = [Bridge] |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
404 DETAIL_VIEWS = [ChairDetail, BridgeCompDetail] |