Mercurial > pyntnclick
annotate gamelib/scenes/bridge.py @ 369:8a288db78f40
speling
author | Adrianna Pińska <adrianna.pinska@gmail.com> |
---|---|
date | Sat, 28 Aug 2010 17:36:40 +0200 |
parents | a95bfba3acd5 |
children | 8936c043d7a1 |
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 |
352
88c1a59b0544
Add sentence for bridge. Have poster break AI
Neil Muller <neil@dip.sun.ac.za>
parents:
350
diff
changeset
|
12 from gamelib.scenes.game_constants import PLAYER_ID |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
13 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
|
14 InteractRectUnion, InteractImage, |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
15 InteractAnimated, GenericDescThing, |
360
452230d78541
Use make_jim_dialog everywhere
Neil Muller <neil@dip.sun.ac.za>
parents:
354
diff
changeset
|
16 BaseCamera, make_jim_dialog) |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
17 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
18 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
19 class Bridge(Scene): |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
20 |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
21 FOLDER = "bridge" |
235 | 22 BACKGROUND = 'bridge.png' |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
23 |
278 | 24 OFFSET = (0, -50) |
25 | |
248 | 26 MUSIC = [ |
256 | 27 'beep1.ogg', |
28 'beep2.ogg', | |
29 'beep880.ogg', | |
248 | 30 'beep660.ogg', |
256 | 31 'beep3.ogg', |
248 | 32 'silent.ogg', |
33 'creaking.ogg', | |
34 'silent.ogg', | |
35 ] | |
36 | |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
37 INITIAL_DATA = { |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
38 'accessible': True, |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
39 'ai status' : 'online', |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
40 'ai panel' : 'closed', |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
41 } |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
42 |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
43 def __init__(self, state): |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
44 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
|
45 self.background_playlist = None |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
46 self.add_item(Superconductor('superconductor')) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
47 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
|
48 self.add_thing(ToMap()) |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
49 self.add_thing(MonitorCamera()) |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
50 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
|
51 self.add_thing(MassageChairBase()) |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
52 self.add_thing(StethoscopeThing()) |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
53 self.add_thing(BridgeComputer()) |
251 | 54 self.add_thing(LeftLights()) |
55 self.add_thing(RightLights()) | |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
56 self.add_thing(JimPanel()) |
277 | 57 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
|
58 "The brightly coloured wires contrast with the drab walls.", |
277 | 59 ((46, 4, 711, 143),))) |
60 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
|
61 "\"Dammit JIM, I'm a doctor, not an engineer!\"", |
277 | 62 ( |
63 (491, 494, 194, 105), | |
64 (422, 533, 71, 66), | |
65 ))) | |
291 | 66 self.doctor = GenericDescThing('bridge.skel', 3, |
67 "A skeleton hangs improbably from the wires.", | |
68 ( | |
69 (632, 148, 40, 29), | |
70 (683, 176, 30, 101), | |
71 (652, 274, 45, 96), | |
72 (639, 180, 11, 95), | |
73 )) | |
74 self.add_thing(self.doctor) | |
75 | |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
76 |
120 | 77 def enter(self): |
248 | 78 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
|
79 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
|
80 change_playlist(self.background_playlist) |
120 | 81 |
248 | 82 def leave(self): |
83 change_playlist(None) | |
84 | |
120 | 85 |
242 | 86 class ToMap(Door): |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
87 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
251
diff
changeset
|
88 SCENE = "bridge" |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
89 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
90 INTERACTS = { |
235 | 91 "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
|
92 } |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
93 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
94 INITIAL = "door" |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
95 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
96 |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
97 class BridgeComputer(Thing): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
98 """The bridge computer. Gives status updates""" |
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 NAME = "bridge.comp" |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
101 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
102 INTERACTS = { |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
103 'screen' : InteractNoImage(338, 296, 123, 74), |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
104 } |
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 INITIAL = 'screen' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
107 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
108 def interact_without(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
109 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
|
110 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
111 def interact_with_titanium_leg(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
112 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
|
113 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
114 def interact_with_machete(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
115 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
|
116 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
117 def get_description(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
118 return "The main bridge computer screen." |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
119 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
120 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
121 class MassageChairBase(Thing): |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
122 "The captain's massage chair, contains superconductor" |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
123 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
124 NAME = 'bridge.massagechair_base' |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
125 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
126 INTERACTS = { |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
127 'chair': InteractNoImage(127, 518, 69, 64), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
128 } |
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 INITIAL = 'chair' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
131 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
132 INITIAL_DATA = { |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
133 'contains_superconductor': True, |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
134 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
135 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
136 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
137 return Result(detail_view='chair_detail') |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
138 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
139 def get_description(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
140 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
|
141 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
|
142 "It's massaging a skeleton." |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
143 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
|
144 |
327
67e8a547970b
More engine room descs
Stefano Rivera <stefano@rivera.za.net>
parents:
316
diff
changeset
|
145 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
146 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
|
147 "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
|
148 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
149 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
|
150 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
151 INTERACTS = { |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
152 'chair': InteractRectUnion(( |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
153 (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
|
154 (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
|
155 (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
|
156 (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
|
157 (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
|
158 (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
|
159 (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
|
160 )), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
161 } |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
162 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
163 INITIAL = 'chair' |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
164 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
165 def get_description(self): |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
166 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
|
167 .get_description() |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
168 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
169 def is_interactive(self): |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
170 return False |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
171 |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
172 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
173 class Stethoscope(Item): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
174 "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
|
175 |
269 | 176 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
|
177 CURSOR = CursorSprite('stethoscope.png') |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
178 |
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 class StethoscopeThing(Thing): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
181 "Stehoscope on the doctor" |
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 NAME ='bridge.stethoscope' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
184 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
185 INTERACTS = { |
269 | 186 'stethoscope': InteractImage(650, 178, 'hanging_stethoscope.png'), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
187 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
188 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
189 INITIAL = 'stethoscope' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
190 |
291 | 191 def get_description(self): |
293
4012d50a4674
more spelling and full stops
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
292
diff
changeset
|
192 return "A stethoscope hangs from the neck of the skeleton." |
291 | 193 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
194 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
195 self.state.add_inventory_item('stethoscope') |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
196 self.scene.remove_thing(self) |
291 | 197 # Fill in the doctor's rect |
198 self.scene.doctor.rect.append(self.rect) | |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
199 return Result("You pick up the stethoscope and verify that the doctor's " |
292 | 200 "heart has stopped. Probably a while ago.") |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
201 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
202 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
203 class Superconductor(Item): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
204 "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
|
205 |
285
2ec328aeeaf8
Engine room mostly hooked up
Stefano Rivera <stefano@rivera.za.net>
parents:
278
diff
changeset
|
206 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
|
207 CURSOR = CursorSprite('superconductor_fixed.png') |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
208 |
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 class SuperconductorThing(Thing): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
211 "Superconductor from the massage chair." |
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 NAME ='bridge.superconductor' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
214 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
215 INTERACTS = { |
259
b6e1c4e4e59d
Superconductor Thing now works.
Jeremy Thurgood <firxen@gmail.com>
parents:
257
diff
changeset
|
216 'superconductor': InteractImage(158, 138, 'superconductor.png'), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
217 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
218 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
219 INITIAL = 'superconductor' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
220 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
221 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
222 self.state.add_inventory_item('superconductor') |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
223 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
|
224 .set_data('contains_superconductor', False) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
225 self.scene.remove_thing(self) |
259
b6e1c4e4e59d
Superconductor Thing now works.
Jeremy Thurgood <firxen@gmail.com>
parents:
257
diff
changeset
|
226 return Result("The superconductor module unclips easily.") |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
227 |
251 | 228 class BlinkingLights(Thing): |
229 | |
270
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
269
diff
changeset
|
230 def is_interactive(self): |
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
269
diff
changeset
|
231 return False |
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
269
diff
changeset
|
232 |
251 | 233 def get_description(self): |
234 return random.choice([ | |
235 "The lights flash in interesting patterns.", | |
292 | 236 "The flashing lights don't mean anything to you.", |
237 "The console lights flash and flicker.", | |
251 | 238 ]) |
239 | |
240 class LeftLights(BlinkingLights): | |
241 | |
242 NAME ='bridge.lights.1' | |
243 | |
244 INTERACTS = { | |
245 "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) | |
246 } | |
247 | |
248 INITIAL = 'lights' | |
249 | |
250 class RightLights(BlinkingLights): | |
251 | |
252 NAME ='bridge.lights.2' | |
253 | |
254 INTERACTS = { | |
255 "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) | |
256 } | |
257 | |
258 INITIAL = 'lights' | |
259 | |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
260 class JimPanel(Thing): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
261 "The panel to JIM's internals'" |
251 | 262 |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
263 NAME = "jim_panel" |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
264 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
265 INTERACTS = { |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
266 'closed' : InteractNoImage(506, 430, 137, 47), |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
267 'open' : InteractImage(500, 427, 'jim_panel_open.png'), |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
268 'broken' : InteractImage(488, 412, 'jim_panel_destroyed.png'), |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
269 } |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
270 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
271 INITIAL = 'closed' |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
272 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
273 def get_description(self): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
274 if self.scene.get_data('ai panel') == 'closed': |
369 | 275 return "The sign reads 'Warning: Authorized Techinicians Only'" |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
276 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
277 def interact_without(self): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
278 if self.scene.get_data('ai status') == 'online': |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
279 return self.interact_default() |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
280 elif self.scene.get_data('ai panel') == 'closed': |
368 | 281 return Result("You are unable to open the panel with your bare hands.") |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
282 elif self.scene.get_data('ai panel') == 'open': |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
283 self.scene.set_data('ai panel', 'broken') |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
284 self.scene.set_data('ai status', 'dead') |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
285 self.set_interact('broken') |
368 | 286 return Result("You unplug various important-looking wires.") |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
287 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
288 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
289 def interact_with_machete(self, item): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
290 if self.scene.get_data('ai status') == 'online': |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
291 return self.interact_default() |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
292 elif self.scene.get_data('ai panel') == 'closed': |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
293 self.scene.set_data('ai panel', 'open') |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
294 self.set_interact('open') |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
295 return Result("Using the machete, you lever the panel off.") |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
296 elif self.scene.get_data('ai panel') == 'open': |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
297 self.scene.set_data('ai panel', 'broken') |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
298 self.scene.set_data('ai status', 'dead') |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
299 self.set_interact('broken') |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
300 return Result("You smash various delicate components with the machete.") |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
301 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
302 def interact_default(self): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
303 if self.scene.get_data('ai status') == 'online': |
368 | 304 return (Result('You feel a shock from the panel.'), |
360
452230d78541
Use make_jim_dialog everywhere
Neil Muller <neil@dip.sun.ac.za>
parents:
354
diff
changeset
|
305 make_jim_dialog("Prisoner %s. Please step away from the panel. " |
452230d78541
Use make_jim_dialog everywhere
Neil Muller <neil@dip.sun.ac.za>
parents:
354
diff
changeset
|
306 "You are not an authorized techinican." % PLAYER_ID, self.state)) |
251 | 307 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
308 class ChairDetail(Scene): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
309 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
310 FOLDER = 'bridge' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
311 BACKGROUND = 'chair_detail.png' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
312 NAME = 'chair_detail' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
313 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
314 SIZE = (300, 300) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
315 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
316 def __init__(self, state): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
317 super(ChairDetail, self).__init__(state) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
318 self.add_thing(SuperconductorThing()) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
319 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
320 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
321 # 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
|
322 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
323 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
324 class LogTab(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
325 """Tab for log screen""" |
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 NAME = 'bridge_comp.screen' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
328 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
329 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
330 '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
|
331 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
332 INITIAL = 'log tab' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
333 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
334 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
335 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
336 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
|
337 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
338 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
339 self.state.detail_views[self.COMPUTER].set_data('tab', 'log') |
257 | 340 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
|
341 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
342 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
343 class AlertTab(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
344 """Tab for alert screen""" |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
345 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
346 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
|
347 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
348 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
349 '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
|
350 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
351 INITIAL = 'alert tab' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
352 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
353 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
354 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
355 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
|
356 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
357 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
358 self.state.detail_views[self.COMPUTER].set_data('tab', 'alert') |
257 | 359 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
|
360 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
361 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
362 class CompUpButton(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
363 """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
|
364 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
365 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
|
366 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
367 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
368 '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
|
369 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
370 INITIAL = 'up' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
371 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
372 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
373 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
374 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
|
375 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
|
376 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
|
377 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
378 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
379 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
|
380 self.state.detail_views[self.COMPUTER].set_data('log page', page-1) |
257 | 381 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
|
382 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
383 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
384 class CompDownButton(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
385 """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
|
386 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
387 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
|
388 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
389 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
390 '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
|
391 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
392 INITIAL = 'down' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
393 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
394 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
395 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
396 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
|
397 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
|
398 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
|
399 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
|
400 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
401 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
402 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
|
403 self.state.detail_views[self.COMPUTER].set_data('log page', page+1) |
257 | 404 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
|
405 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
406 |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
407 class MonitorCamera(BaseCamera): |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
408 "A camera on the bridge" |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
409 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
410 NAME = "bridge.camera" |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
411 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
412 INTERACTS = { |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
413 'camera' : InteractImage(33, 192, 'camera_small.png') |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
414 } |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
415 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
416 |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
417 class BridgeCompDetail(Scene): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
418 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
419 FOLDER = 'bridge' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
420 NAME = 'bridge_comp_detail' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
421 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
422 SIZE = (640, 400) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
423 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
424 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
|
425 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
426 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
|
427 'comp_log_end.png'] |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
428 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
429 BACKGROUND = ALERT |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
430 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
431 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
432 INITIAL_DATA = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
433 'tab' : 'alert', |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
434 'log page' : 0, |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
435 'max page' : len(LOGS), |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
436 } |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
437 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
438 def __init__(self, state): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
439 super(BridgeCompDetail, self).__init__(state) |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
440 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
441 self.add_thing(LogTab()) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
442 self.add_thing(AlertTab()) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
443 self.add_thing(CompUpButton()) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
444 self.add_thing(CompDownButton()) |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
445 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
|
446 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
|
447 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
|
448 |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
449 def enter(self): |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
450 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
|
451 change_playlist(None) |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
452 |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
453 def leave(self): |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
454 change_playlist(self._scene_playlist) |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
455 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
456 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
|
457 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
|
458 self._background = self._alert |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
459 else: |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
460 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
|
461 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
|
462 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
463 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
464 SCENES = [Bridge] |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
465 DETAIL_VIEWS = [ChairDetail, BridgeCompDetail] |