Mercurial > pyntnclick
annotate gamelib/scenes/bridge.py @ 510:d274cc414178
Add show animate & cycle interact options
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Fri, 03 Sep 2010 17:04:38 +0200 |
parents | c72946d3a59a |
children | a9925aaf5f61 9f488671c02e |
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 | |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
5 from pygame.colordict import THECOLORS |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
6 from pygame.color import Color |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
7 from pygame.rect import Rect |
248 | 8 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
|
9 from albow.resource import get_image |
248 | 10 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
11 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
|
12 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
|
13 from gamelib.sound import get_current_playlist |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
14 from gamelib.constants import DEBUG |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
15 |
352
88c1a59b0544
Add sentence for bridge. Have poster break AI
Neil Muller <neil@dip.sun.ac.za>
parents:
350
diff
changeset
|
16 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
|
17 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
|
18 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
|
19 InteractAnimated, GenericDescThing, |
360
452230d78541
Use make_jim_dialog everywhere
Neil Muller <neil@dip.sun.ac.za>
parents:
354
diff
changeset
|
20 BaseCamera, make_jim_dialog) |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
21 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
22 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
23 class Bridge(Scene): |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
24 |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
25 FOLDER = "bridge" |
235 | 26 BACKGROUND = 'bridge.png' |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
27 |
278 | 28 OFFSET = (0, -50) |
29 | |
248 | 30 MUSIC = [ |
256 | 31 'beep1.ogg', |
32 'beep2.ogg', | |
33 'beep880.ogg', | |
248 | 34 'beep660.ogg', |
256 | 35 'beep3.ogg', |
248 | 36 'silent.ogg', |
37 'creaking.ogg', | |
38 'silent.ogg', | |
39 ] | |
40 | |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
41 INITIAL_DATA = { |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
42 'ai status' : 'online', # online, looping, dead |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
43 'ai panel' : 'closed', # closed, open, broken |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
44 } |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
45 |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
46 def __init__(self, state): |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
47 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
|
48 self.background_playlist = None |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
49 self.add_item(Superconductor('superconductor')) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
50 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
|
51 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
|
52 self.add_thing(MonitorCamera()) |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
53 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
|
54 self.add_thing(MassageChairBase()) |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
55 self.add_thing(StethoscopeThing()) |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
56 self.add_thing(BridgeComputer()) |
251 | 57 self.add_thing(LeftLights()) |
58 self.add_thing(RightLights()) | |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
59 self.add_thing(JimPanel()) |
424
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
60 self.add_thing(StarField()) |
277 | 61 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
|
62 "The brightly coloured wires contrast with the drab walls.", |
277 | 63 ((46, 4, 711, 143),))) |
64 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
|
65 "\"Dammit JIM, I'm a doctor, not an engineer!\"", |
277 | 66 ( |
67 (491, 494, 194, 105), | |
68 (422, 533, 71, 66), | |
69 ))) | |
291 | 70 self.doctor = GenericDescThing('bridge.skel', 3, |
71 "A skeleton hangs improbably from the wires.", | |
72 ( | |
73 (632, 148, 40, 29), | |
74 (683, 176, 30, 101), | |
75 (652, 274, 45, 96), | |
76 (639, 180, 11, 95), | |
77 )) | |
78 self.add_thing(self.doctor) | |
79 | |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
80 |
120 | 81 def enter(self): |
248 | 82 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
|
83 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
|
84 change_playlist(self.background_playlist) |
120 | 85 |
248 | 86 def leave(self): |
87 change_playlist(None) | |
88 | |
120 | 89 |
242 | 90 class ToMap(Door): |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
91 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
251
diff
changeset
|
92 SCENE = "bridge" |
150
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 INTERACTS = { |
235 | 95 "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
|
96 } |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
97 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
98 INITIAL = "door" |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
99 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
100 |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
101 class BridgeComputer(Thing): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
102 """The bridge computer. Gives status updates""" |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
103 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
104 NAME = "bridge.comp" |
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 INTERACTS = { |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
107 'screen' : InteractNoImage(338, 296, 123, 74), |
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 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
110 INITIAL = 'screen' |
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 interact_without(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
113 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
|
114 |
474
4060e2dd4757
Add missing item parameter to bridge interact_with_foos
Stefano Rivera <stefano@rivera.za.net>
parents:
472
diff
changeset
|
115 def interact_with_titanium_leg(self, item): |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
116 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
|
117 |
474
4060e2dd4757
Add missing item parameter to bridge interact_with_foos
Stefano Rivera <stefano@rivera.za.net>
parents:
472
diff
changeset
|
118 def interact_with_machete(self, item): |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
119 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
|
120 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
121 def get_description(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
122 return "The main bridge computer screen." |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
123 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
124 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
125 class MassageChairBase(Thing): |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
126 "The captain's massage chair, contains superconductor" |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
127 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
128 NAME = 'bridge.massagechair_base' |
222
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 INTERACTS = { |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
131 'chair': InteractNoImage(127, 518, 69, 64), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
132 } |
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 INITIAL = 'chair' |
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 INITIAL_DATA = { |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
137 'contains_superconductor': True, |
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 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
140 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
141 return Result(detail_view='chair_detail') |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
142 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
143 def get_description(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
144 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
|
145 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
|
146 "It's massaging a skeleton." |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
147 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
|
148 |
327
67e8a547970b
More engine room descs
Stefano Rivera <stefano@rivera.za.net>
parents:
316
diff
changeset
|
149 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
150 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
|
151 "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
|
152 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
153 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
|
154 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
155 INTERACTS = { |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
156 'chair': InteractRectUnion(( |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
157 (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
|
158 (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
|
159 (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
|
160 (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
|
161 (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
|
162 (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
|
163 (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
|
164 )), |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
165 } |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
166 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
167 INITIAL = 'chair' |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
168 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
169 def get_description(self): |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
170 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
|
171 .get_description() |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
172 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
173 def is_interactive(self): |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
174 return False |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
175 |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
176 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
177 class Stethoscope(Item): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
178 "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
|
179 |
269 | 180 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
|
181 CURSOR = CursorSprite('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 class StethoscopeThing(Thing): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
185 "Stehoscope on the doctor" |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
186 |
476
c72946d3a59a
Some minor pylint driven style fixes
Neil Muller <neil@dip.sun.ac.za>
parents:
474
diff
changeset
|
187 NAME = 'bridge.stethoscope' |
222
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 INTERACTS = { |
269 | 190 'stethoscope': InteractImage(650, 178, 'hanging_stethoscope.png'), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
191 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
192 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
193 INITIAL = 'stethoscope' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
194 |
291 | 195 def get_description(self): |
293
4012d50a4674
more spelling and full stops
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
292
diff
changeset
|
196 return "A stethoscope hangs from the neck of the skeleton." |
291 | 197 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
198 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
199 self.state.add_inventory_item('stethoscope') |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
200 self.scene.remove_thing(self) |
291 | 201 # Fill in the doctor's rect |
202 self.scene.doctor.rect.append(self.rect) | |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
203 return Result("You pick up the stethoscope and verify that the doctor's " |
292 | 204 "heart has stopped. Probably a while ago.") |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
205 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
206 |
399
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
207 class TapedSuperconductor(Item): |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
208 "Used for connecting high-powered parts of the ship up" |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
209 |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
210 INVENTORY_IMAGE = 'superconductor_taped.png' |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
211 CURSOR = CursorSprite('superconductor_taped_cursor.png') |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
212 |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
213 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
214 class Superconductor(Item): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
215 "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
|
216 |
285
2ec328aeeaf8
Engine room mostly hooked up
Stefano Rivera <stefano@rivera.za.net>
parents:
278
diff
changeset
|
217 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
|
218 CURSOR = CursorSprite('superconductor_fixed.png') |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
219 |
399
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
220 def interact_with_duct_tape(self, item, state): |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
221 taped_superconductor = TapedSuperconductor('taped_superconductor') |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
222 state.add_item(taped_superconductor) |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
223 state.replace_inventory_item(self.name, taped_superconductor.name) |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
224 return Result("You rip off a piece of duct tape and stick it on the superconductor. " |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
225 "It almost sticks to itself, but you successfully avoid disaster.") |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
226 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
227 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
228 class SuperconductorThing(Thing): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
229 "Superconductor from the massage chair." |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
230 |
476
c72946d3a59a
Some minor pylint driven style fixes
Neil Muller <neil@dip.sun.ac.za>
parents:
474
diff
changeset
|
231 NAME = 'bridge.superconductor' |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
232 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
233 INTERACTS = { |
259
b6e1c4e4e59d
Superconductor Thing now works.
Jeremy Thurgood <firxen@gmail.com>
parents:
257
diff
changeset
|
234 'superconductor': InteractImage(158, 138, 'superconductor.png'), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
235 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
236 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
237 INITIAL = 'superconductor' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
238 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
239 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
240 self.state.add_inventory_item('superconductor') |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
241 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
|
242 .set_data('contains_superconductor', False) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
243 self.scene.remove_thing(self) |
426
dabc9d15c18c
Jim complains when you break the chair
Stefano Rivera <stefano@rivera.za.net>
parents:
424
diff
changeset
|
244 return (Result("The superconductor module unclips easily."), |
dabc9d15c18c
Jim complains when you break the chair
Stefano Rivera <stefano@rivera.za.net>
parents:
424
diff
changeset
|
245 make_jim_dialog(("Prisoner %s. That chair you've destroyed was " |
dabc9d15c18c
Jim complains when you break the chair
Stefano Rivera <stefano@rivera.za.net>
parents:
424
diff
changeset
|
246 "property of the ship's captain. " |
dabc9d15c18c
Jim complains when you break the chair
Stefano Rivera <stefano@rivera.za.net>
parents:
424
diff
changeset
|
247 "You will surely be punished." |
dabc9d15c18c
Jim complains when you break the chair
Stefano Rivera <stefano@rivera.za.net>
parents:
424
diff
changeset
|
248 ) % PLAYER_ID, self.state)) |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
249 |
424
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
250 class StarField(Thing): |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
251 |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
252 NAME = 'bridge.stars' |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
253 |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
254 INTERACTS = { |
427 | 255 #'stars' : InteractImage(190, 145, 'stars_3.png'), |
256 'stars' : InteractAnimated(190, 145, | |
424
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
257 ['stars_%d.png' % (i+1) for i in range(3) + range(1,0,-1)], 30) |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
258 } |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
259 |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
260 INITIAL = 'stars' |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
261 |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
262 def is_interactive(self): |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
263 return False |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
264 |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
265 |
251 | 266 class BlinkingLights(Thing): |
267 | |
370
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
268 def __init__(self): |
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
269 super(BlinkingLights, self).__init__() |
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
270 self.description = None |
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
271 |
270
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
269
diff
changeset
|
272 def is_interactive(self): |
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
269
diff
changeset
|
273 return False |
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
269
diff
changeset
|
274 |
370
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
275 def leave(self): |
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
276 self.description = random.choice([ |
251 | 277 "The lights flash in interesting patterns.", |
292 | 278 "The flashing lights don't mean anything to you.", |
279 "The console lights flash and flicker.", | |
251 | 280 ]) |
281 | |
370
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
282 def get_description(self): |
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
283 if not self.description: |
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
284 self.leave() |
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
285 return self.description |
8936c043d7a1
Fix bliken lights description
Neil Muller <neil@dip.sun.ac.za>
parents:
369
diff
changeset
|
286 |
251 | 287 class LeftLights(BlinkingLights): |
288 | |
476
c72946d3a59a
Some minor pylint driven style fixes
Neil Muller <neil@dip.sun.ac.za>
parents:
474
diff
changeset
|
289 NAME = 'bridge.lights.1' |
251 | 290 |
291 INTERACTS = { | |
292 "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) | |
293 } | |
294 | |
295 INITIAL = 'lights' | |
296 | |
297 class RightLights(BlinkingLights): | |
298 | |
476
c72946d3a59a
Some minor pylint driven style fixes
Neil Muller <neil@dip.sun.ac.za>
parents:
474
diff
changeset
|
299 NAME = 'bridge.lights.2' |
251 | 300 |
301 INTERACTS = { | |
302 "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) | |
303 } | |
304 | |
305 INITIAL = 'lights' | |
306 | |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
307 class JimPanel(Thing): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
308 "The panel to JIM's internals'" |
251 | 309 |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
310 NAME = "jim_panel" |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
311 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
312 INTERACTS = { |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
313 '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
|
314 '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
|
315 '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
|
316 } |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
317 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
318 INITIAL = 'closed' |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
319 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
320 def get_description(self): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
321 if self.scene.get_data('ai panel') == 'closed': |
435 | 322 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
|
323 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
324 def interact_without(self): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
325 if self.scene.get_data('ai status') == 'online': |
472
cab67fd696b9
Fix crash bug on the bridge. (JIM's panel really doesn't like items.)
Jeremy Thurgood <firxen@gmail.com>
parents:
469
diff
changeset
|
326 return self.interact_default(None) |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
327 elif self.scene.get_data('ai panel') == 'closed': |
368 | 328 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
|
329 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
|
330 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
|
331 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
|
332 self.set_interact('broken') |
368 | 333 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
|
334 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
335 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
336 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
|
337 if self.scene.get_data('ai status') == 'online': |
472
cab67fd696b9
Fix crash bug on the bridge. (JIM's panel really doesn't like items.)
Jeremy Thurgood <firxen@gmail.com>
parents:
469
diff
changeset
|
338 return self.interact_default(item) |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
339 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
|
340 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
|
341 self.set_interact('open') |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
342 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
|
343 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
|
344 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
|
345 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
|
346 self.set_interact('broken') |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
347 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
|
348 |
472
cab67fd696b9
Fix crash bug on the bridge. (JIM's panel really doesn't like items.)
Jeremy Thurgood <firxen@gmail.com>
parents:
469
diff
changeset
|
349 def interact_default(self, item): |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
350 if self.scene.get_data('ai status') == 'online': |
368 | 351 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
|
352 make_jim_dialog("Prisoner %s. Please step away from the panel. " |
439 | 353 "You are not an authorized technician." % PLAYER_ID, self.state)) |
251 | 354 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
355 class ChairDetail(Scene): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
356 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
357 FOLDER = 'bridge' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
358 BACKGROUND = 'chair_detail.png' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
359 NAME = 'chair_detail' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
360 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
361 SIZE = (300, 300) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
362 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
363 def __init__(self, state): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
364 super(ChairDetail, self).__init__(state) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
365 self.add_thing(SuperconductorThing()) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
366 |
255
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 # 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
|
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 class LogTab(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
372 """Tab for log screen""" |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
373 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
374 NAME = 'bridge_comp.screen' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
375 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
376 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
377 '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
|
378 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
379 INITIAL = 'log tab' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
380 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
381 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
382 def is_interactive(self): |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
383 return self.state.detail_views[self.COMPUTER].get_data('tab') != 'log' |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
384 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
385 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
386 self.state.detail_views[self.COMPUTER].set_data('tab', 'log') |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
387 self.state.detail_views[self.COMPUTER].set_background() |
257 | 388 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
|
389 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
390 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
391 class AlertTab(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
392 """Tab for alert screen""" |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
393 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
394 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
|
395 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
396 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
397 '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
|
398 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
399 INITIAL = 'alert tab' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
400 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
401 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
402 def is_interactive(self): |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
403 return self.state.detail_views[self.COMPUTER].get_data('tab') != 'alert' |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
404 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
405 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
406 self.state.detail_views[self.COMPUTER].set_data('tab', 'alert') |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
407 self.state.detail_views[self.COMPUTER].set_background() |
257 | 408 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
|
409 |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
410 class NavTab(Thing): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
411 """Tab for the Navigation screen""" |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
412 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
413 NAME = 'bridge_comp.nav_tab' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
414 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
415 INTERACTS = { |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
416 'nav tab' : InteractNoImage(197, 53, 126, 37), |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
417 } |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
418 INITIAL = 'nav tab' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
419 COMPUTER = 'bridge_comp_detail' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
420 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
421 def is_interactive(self): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
422 return self.state.detail_views[self.COMPUTER].get_data('tab') != 'nav' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
423 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
424 def interact_without(self): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
425 self.state.detail_views[self.COMPUTER].set_data('tab', 'nav') |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
426 self.state.detail_views[self.COMPUTER].set_background() |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
427 return Result(soundfile='beep550.ogg') |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
428 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
429 class DestNavPageLine(Thing): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
430 """The destination navigation lines.""" |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
431 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
432 INITIAL = 'line' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
433 COMPUTER = 'bridge_comp_detail' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
434 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
435 def __init__(self, number, rect, ai_blocked): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
436 super(DestNavPageLine, self).__init__() |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
437 self.name = 'bridge_comp.nav_line%s' % number |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
438 if DEBUG: |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
439 self._interact_hilight_color = Color(THECOLORS.keys()[number]) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
440 r = Rect(rect) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
441 self.interacts = {} |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
442 self.interacts['line'] = InteractNoImage(r.x, r.y, r.w, r.h) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
443 # Whether JIM blocks this |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
444 self.ai_blocked = ai_blocked |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
445 self.set_interact('line') |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
446 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
447 def is_interactive(self): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
448 return self.state.detail_views[self.COMPUTER].get_data('tab') == 'nav' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
449 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
450 def interact_without(self): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
451 if self.state.scenes['bridge'].get_data('ai status') == 'online': |
429 | 452 return make_jim_dialog("You are not authorized to change the destination.", self.state) |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
453 if not self.ai_blocked: |
429 | 454 return Result("There's no good reason to choose to go to the penal colony.") |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
455 if self.state.scenes['bridge'].get_data('ai status') == 'looping': |
429 | 456 return Result("You could change the destination, but when JIM recovers, it'll just get reset.") |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
457 if self.state.scenes['bridge'].get_data('ai status') == 'dead': |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
458 return Result("You change the destination.", soundfile="beep550.ogg", end_game=True) |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
459 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
460 class CompUpButton(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
461 """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
|
462 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
463 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
|
464 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
465 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
466 '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
|
467 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
468 INITIAL = 'up' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
469 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
470 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
471 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
472 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
|
473 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
|
474 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
|
475 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
476 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
477 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
|
478 self.state.detail_views[self.COMPUTER].set_data('log page', page-1) |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
479 self.state.detail_views[self.COMPUTER].set_background() |
257 | 480 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
|
481 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
482 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
483 class CompDownButton(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
484 """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
|
485 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
486 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
|
487 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
488 INTERACTS = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
489 '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
|
490 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
491 INITIAL = 'down' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
492 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
493 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
494 def is_interactive(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
495 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
|
496 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
|
497 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
|
498 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
|
499 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
500 def interact_without(self): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
501 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
|
502 self.state.detail_views[self.COMPUTER].set_data('log page', page+1) |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
503 self.state.detail_views[self.COMPUTER].set_background() |
257 | 504 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
|
505 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
506 |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
507 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
|
508 "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
|
509 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
510 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
|
511 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
512 INTERACTS = { |
464 | 513 'online': InteractImage(33, 192, 'camera_small.png'), |
514 'dead': InteractImage(33, 192, 'camera_small_gray.png'), | |
515 'looping': InteractAnimated(33, 192, ('camera_small.png', | |
516 'camera_small_gray.png'), | |
517 15), | |
518 } | |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
519 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
520 |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
521 class BridgeCompDetail(Scene): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
522 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
523 FOLDER = 'bridge' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
524 NAME = 'bridge_comp_detail' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
525 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
526 SIZE = (640, 400) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
527 |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
528 ALERT_BASE = 'comp_alert_base.png' |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
529 ALERTS = { |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
530 'ai looping' : 'comp_alert_ai_looping.png', |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
531 'ai offline' : 'comp_alert_ai_offline.png', |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
532 'engine offline' : 'comp_alert_engine_offline.png', |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
533 'life support' : 'comp_alert_life_support.png', |
409
72baf5bfebc6
Support for partial fixed state (pending artwork)
Neil Muller <neil@dip.sun.ac.za>
parents:
403
diff
changeset
|
534 'life support partial' : 'comp_alert_life_support_partial.png', |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
535 } |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
536 |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
537 # Point to start drawing changeable alerts |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
538 ALERT_OFFSET = (16, 140) |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
539 ALERT_SPACING = 4 |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
540 |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
541 LOGS = ['comp_log_start.png', 'comp_log_1.png', |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
542 'comp_log_end.png'] |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
543 |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
544 NAVIGATION = { |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
545 'engine offline' : 'bridge_nav_engine.png', |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
546 'life support' : 'bridge_nav_life_support.png', |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
547 'final' : 'bridge_nav_dest.png' |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
548 } |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
549 |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
550 BACKGROUND = ALERT_BASE |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
551 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
552 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
553 INITIAL_DATA = { |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
554 'tab' : 'alert', |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
555 'log page' : 0, |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
556 'max page' : len(LOGS), |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
557 } |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
558 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
559 def __init__(self, state): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
560 super(BridgeCompDetail, self).__init__(state) |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
561 |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
562 self.add_thing(LogTab()) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
563 self.add_thing(AlertTab()) |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
564 self.add_thing(NavTab()) |
412 | 565 #self.add_thing(CompUpButton()) |
566 #self.add_thing(CompDownButton()) | |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
567 self._scene_playlist = None |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
568 self._alert = get_image(self.FOLDER, self.ALERT_BASE) |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
569 self._alert_messages = {} |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
570 self._nav_messages = {} |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
571 for key, name in self.ALERTS.iteritems(): |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
572 self._alert_messages[key] = get_image(self.FOLDER, name) |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
573 for key, name in self.NAVIGATION.iteritems(): |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
574 self._nav_messages[key] = get_image(self.FOLDER, name) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
575 self._nav_lines = [] |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
576 self._nav_lines.append(DestNavPageLine(1, (14, 99, 595, 30), False)) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
577 self._nav_lines.append(DestNavPageLine(2, (14, 135, 595, 30), True)) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
578 self._nav_lines.append(DestNavPageLine(3, (14, 167, 595, 30), True)) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
579 self._nav_lines.append(DestNavPageLine(4, (14, 203, 595, 30), True)) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
580 self._nav_lines.append(DestNavPageLine(5, (14, 239, 595, 30), True)) |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
581 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
|
582 |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
583 def enter(self): |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
584 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
|
585 change_playlist(None) |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
586 self.set_background() |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
587 |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
588 def leave(self): |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
589 change_playlist(self._scene_playlist) |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
590 |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
591 def set_background(self): |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
592 if self.get_data('tab') == 'alert': |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
593 self._clear_navigation() |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
594 self._background = self._alert |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
595 elif self.get_data('tab') == 'log': |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
596 self._clear_navigation() |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
597 self._background = self._logs[self.get_data('log page')] |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
598 elif self.get_data('tab') == 'nav': |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
599 self._background = self._get_nav_page() |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
600 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
601 def _clear_navigation(self): |
435 | 602 "Remove navigation things if necessary" |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
603 for thing in self._nav_lines: |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
604 if thing.name in self.things.keys(): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
605 # Much fiddling to do the right thing when we reinsert it |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
606 del self.things[thing.name] |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
607 thing.scene = None |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
608 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
609 def _get_nav_page(self): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
610 if not self.state.scenes['engine'].get_data('engine online'): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
611 return self._nav_messages['engine offline'] |
409
72baf5bfebc6
Support for partial fixed state (pending artwork)
Neil Muller <neil@dip.sun.ac.za>
parents:
403
diff
changeset
|
612 elif not self.state.scenes['mess'].get_data('life support status') == 'fixed': |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
613 return self._nav_messages['life support'] |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
614 else: |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
615 for thing in self._nav_lines: |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
616 if thing.name not in self.things: |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
617 self.add_thing(thing) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
618 return self._nav_messages['final'] |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
619 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
620 def _draw_alerts(self, surface): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
621 xpos, ypos = self.ALERT_OFFSET |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
622 if self.state.scenes['bridge'].get_data('ai status') == 'looping': |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
623 surface.blit(self._alert_messages['ai looping'], (xpos, ypos)) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
624 ypos += self._alert_messages['ai looping'].get_size()[1] + self.ALERT_SPACING |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
625 if self.state.scenes['bridge'].get_data('ai status') == 'dead': |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
626 surface.blit(self._alert_messages['ai offline'], (xpos, ypos)) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
627 ypos += self._alert_messages['ai offline'].get_size()[1] + self.ALERT_SPACING |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
628 if not self.state.scenes['engine'].get_data('engine online'): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
629 surface.blit(self._alert_messages['engine offline'], (xpos, ypos)) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
630 ypos += self._alert_messages['engine offline'].get_size()[1] + self.ALERT_SPACING |
409
72baf5bfebc6
Support for partial fixed state (pending artwork)
Neil Muller <neil@dip.sun.ac.za>
parents:
403
diff
changeset
|
631 if self.state.scenes['mess'].get_data('life support status') == 'broken': |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
632 surface.blit(self._alert_messages['life support'], (xpos, ypos)) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
633 ypos += self._alert_messages['life support'].get_size()[1] + self.ALERT_SPACING |
409
72baf5bfebc6
Support for partial fixed state (pending artwork)
Neil Muller <neil@dip.sun.ac.za>
parents:
403
diff
changeset
|
634 if self.state.scenes['mess'].get_data('life support status') == 'replaced': |
72baf5bfebc6
Support for partial fixed state (pending artwork)
Neil Muller <neil@dip.sun.ac.za>
parents:
403
diff
changeset
|
635 surface.blit(self._alert_messages['life support partial'], (xpos, ypos)) |
72baf5bfebc6
Support for partial fixed state (pending artwork)
Neil Muller <neil@dip.sun.ac.za>
parents:
403
diff
changeset
|
636 ypos += self._alert_messages['life support partial'].get_size()[1] + self.ALERT_SPACING |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
637 |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
638 def draw_things(self, surface): |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
639 if self.get_data('tab') == 'alert': |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
640 self._draw_alerts(surface) |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
641 super(BridgeCompDetail, self).draw_things(surface) |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
642 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
643 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
644 SCENES = [Bridge] |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
645 DETAIL_VIEWS = [ChairDetail, BridgeCompDetail] |