Mercurial > boomslang
annotate gamelib/scenes/bridge.py @ 828:e81facd05e00 pyntnclick
Use text for destinations
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Tue, 29 Jan 2013 13:33:55 +0200 |
parents | eed75a1d50c4 |
children | f5f998fb698f |
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 |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
9 from pyntnclick.i18n import _ |
549 | 10 from pyntnclick.cursor import CursorSprite |
11 from pyntnclick.state import Scene, Item, Thing, Result | |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
12 from pyntnclick.scenewidgets import ( |
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
13 InteractNoImage, InteractRectUnion, InteractImage, InteractAnimated, |
828 | 14 GenericDescThing, TakeableThing, InteractText) |
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 |
525
821b322e903b
Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
519
diff
changeset
|
17 from gamelib.scenes.game_widgets import Door, BaseCamera, make_jim_dialog |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
259
diff
changeset
|
18 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
19 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
20 class Bridge(Scene): |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
21 |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
22 FOLDER = "bridge" |
235 | 23 BACKGROUND = 'bridge.png' |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
24 |
278 | 25 OFFSET = (0, -50) |
26 | |
248 | 27 MUSIC = [ |
256 | 28 'beep1.ogg', |
29 'beep2.ogg', | |
30 'beep880.ogg', | |
248 | 31 'beep660.ogg', |
256 | 32 'beep3.ogg', |
248 | 33 'silent.ogg', |
34 'creaking.ogg', | |
35 'silent.ogg', | |
36 ] | |
37 | |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
38 INITIAL_DATA = { |
543 | 39 'ai status': 'online', # online, looping, dead |
40 'ai panel': 'closed', # closed, open, broken | |
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 |
592
4e9178215e75
Introduce .setup() for GameDeveloperGizmos.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
578
diff
changeset
|
43 def setup(self): |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
44 self.background_playlist = None |
816 | 45 self.add_item_factory(Superconductor) |
46 self.add_item_factory(TapedSuperconductor) | |
47 self.add_item_factory(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()) |
424
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
57 self.add_thing(StarField()) |
277 | 58 self.add_thing(GenericDescThing('bridge.wires', 1, |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
59 _("The brightly coloured wires contrast with the drab walls."), |
277 | 60 ((46, 4, 711, 143),))) |
61 self.add_thing(GenericDescThing('bridge.note', 2, | |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
62 _("\"Dammit JIM, I'm a doctor, not an engineer!\""), |
277 | 63 ( |
64 (491, 494, 194, 105), | |
65 (422, 533, 71, 66), | |
66 ))) | |
291 | 67 self.doctor = GenericDescThing('bridge.skel', 3, |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
68 _("A skeleton hangs improbably from the wires."), |
291 | 69 ( |
70 (632, 148, 40, 29), | |
71 (683, 176, 30, 101), | |
72 (652, 274, 45, 96), | |
73 (639, 180, 11, 95), | |
74 )) | |
75 self.add_thing(self.doctor) | |
76 | |
120 | 77 def enter(self): |
629 | 78 pieces = [self.sound.get_music(x) for x in self.MUSIC] |
566
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
79 self.background_playlist = self.sound.get_playlist(pieces, random=True, |
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
80 repeat=True) |
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
81 self.sound.change_playlist(self.background_playlist) |
120 | 82 |
248 | 83 def leave(self): |
566
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
84 self.sound.change_playlist(None) |
248 | 85 |
120 | 86 |
242 | 87 class ToMap(Door): |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
88 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
251
diff
changeset
|
89 SCENE = "bridge" |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
90 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
91 INTERACTS = { |
235 | 92 "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
|
93 } |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
94 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
95 INITIAL = "door" |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
120
diff
changeset
|
96 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
97 |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
98 class BridgeComputer(Thing): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
99 """The bridge computer. Gives status updates""" |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
100 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
101 NAME = "bridge.comp" |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
102 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
103 INTERACTS = { |
543 | 104 'screen': InteractNoImage(338, 296, 123, 74), |
237
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 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
107 INITIAL = 'screen' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
108 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
109 def interact_without(self): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
110 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
|
111 |
474
4060e2dd4757
Add missing item parameter to bridge interact_with_foos
Stefano Rivera <stefano@rivera.za.net>
parents:
472
diff
changeset
|
112 def interact_with_titanium_leg(self, item): |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
113 return Result(_("You can't break the duraplastic screen.")) |
237
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_machete(self, item): |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
116 return Result(_("Scratching the screen won't help you.")) |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
117 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
118 def get_description(self): |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
119 return _("The main bridge computer screen.") |
237
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 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
122 class MassageChairBase(Thing): |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
123 "The captain's massage chair, contains superconductor" |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
124 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
125 NAME = 'bridge.massagechair_base' |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
126 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
127 INTERACTS = { |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
128 'chair': InteractNoImage(127, 518, 69, 64), |
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 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
131 INITIAL = 'chair' |
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 INITIAL_DATA = { |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
134 'contains_superconductor': True, |
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 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
137 def interact_without(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
138 return Result(detail_view='chair_detail') |
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 get_description(self): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
141 if self.get_data('contains_superconductor'): |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
142 return _("A top of the line Massage-o-Matic Captain's Executive" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
143 " Command Chair. It's massaging a skeleton.") |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
144 return _("The chair won't work any more, it has no power.") |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
145 |
327
67e8a547970b
More engine room descs
Stefano Rivera <stefano@rivera.za.net>
parents:
316
diff
changeset
|
146 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
147 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
|
148 "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
|
149 |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
150 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
|
151 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
152 INTERACTS = { |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
153 'chair': InteractRectUnion(( |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
154 (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
|
155 (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
|
156 (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
|
157 (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
|
158 (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
|
159 (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
|
160 (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
|
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 |
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
164 INITIAL = 'chair' |
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 def get_description(self): |
792
bdaffaa8b6bf
Loading and saving! (Plus a bunch of other stuff to make it possible.)
Jeremy Thurgood <firxen@gmail.com>
parents:
774
diff
changeset
|
167 base = self.game.get_current_scene().things['bridge.massagechair_base'] |
bdaffaa8b6bf
Loading and saving! (Plus a bunch of other stuff to make it possible.)
Jeremy Thurgood <firxen@gmail.com>
parents:
774
diff
changeset
|
168 return base.get_description() |
316
4a7aa7fcd191
Only the base of the massage chair brings up the subscene
Stefano Rivera <stefano@rivera.za.net>
parents:
315
diff
changeset
|
169 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
170 def is_interactive(self, tool=None): |
330
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
171 return False |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
172 |
8f85902f4cb6
Massage chair and base where swapped
Stefano Rivera <stefano@rivera.za.net>
parents:
327
diff
changeset
|
173 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
174 class Stethoscope(Item): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
175 "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
|
176 |
816 | 177 NAME = 'stethoscope' |
269 | 178 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
|
179 CURSOR = CursorSprite('stethoscope.png') |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
180 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
181 |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
182 class StethoscopeThing(TakeableThing): |
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
183 "Stethoscope on the doctor" |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
184 |
476
c72946d3a59a
Some minor pylint driven style fixes
Neil Muller <neil@dip.sun.ac.za>
parents:
474
diff
changeset
|
185 NAME = 'bridge.stethoscope' |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
186 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
187 INTERACTS = { |
269 | 188 'stethoscope': InteractImage(650, 178, 'hanging_stethoscope.png'), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
189 } |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
190 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
191 INITIAL = 'stethoscope' |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
192 ITEM = 'stethoscope' |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
193 |
291 | 194 def get_description(self): |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
195 return _("A stethoscope hangs from the neck of the skeleton.") |
291 | 196 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
197 def interact_without(self): |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
198 self.take() |
291 | 199 # Fill in the doctor's rect |
200 self.scene.doctor.rect.append(self.rect) | |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
201 return Result(_("You pick up the stethoscope and verify that the" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
202 " doctor's heart has stopped. Probably a while ago.")) |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
203 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
204 |
399
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
205 class TapedSuperconductor(Item): |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
206 "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
|
207 |
816 | 208 NAME = 'taped_superconductor' |
399
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
209 INVENTORY_IMAGE = 'superconductor_taped.png' |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
210 CURSOR = CursorSprite('superconductor_taped_cursor.png') |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
211 |
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
212 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
213 class Superconductor(Item): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
214 "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
|
215 |
816 | 216 NAME = 'superconductor' |
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 |
491
9f488671c02e
No more state in Item interacts.
Jeremy Thurgood <firxen@gmail.com>
parents:
476
diff
changeset
|
220 def interact_with_duct_tape(self, item): |
816 | 221 self.game.replace_inventory_item(self.name, 'taped_superconductor') |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
222 return Result(_("You rip off a piece of duct tape and stick it on the" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
223 " superconductor. It almost sticks to itself, but you" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
224 " successfully avoid disaster.")) |
399
1cfcd82519b6
You have to duct tape the superconductor
Stefano Rivera <stefano@rivera.za.net>
parents:
393
diff
changeset
|
225 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
226 |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
227 class SuperconductorThing(TakeableThing): |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
228 "Superconductor from the massage chair." |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
229 |
476
c72946d3a59a
Some minor pylint driven style fixes
Neil Muller <neil@dip.sun.ac.za>
parents:
474
diff
changeset
|
230 NAME = 'bridge.superconductor' |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
231 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
232 INTERACTS = { |
259
b6e1c4e4e59d
Superconductor Thing now works.
Jeremy Thurgood <firxen@gmail.com>
parents:
257
diff
changeset
|
233 'superconductor': InteractImage(158, 138, 'superconductor.png'), |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
234 } |
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 INITIAL = 'superconductor' |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
237 ITEM = 'superconductor' |
222
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): |
745
b9504e6ecde1
Make a couple of interactions less dependent on current_scene, so the 'mad clicker' test works
Neil Muller <neil@dip.sun.ac.za>
parents:
655
diff
changeset
|
240 self.game.scenes['bridge'].things['bridge.massagechair_base'] \ |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
241 .set_data('contains_superconductor', False) |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
242 self.take() |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
243 return (Result(_("The superconductor module unclips easily.")), |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
244 make_jim_dialog(_("Prisoner %s. That chair you've destroyed" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
245 " was property of the ship's captain. " |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
246 "You will surely be punished.") |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
247 % PLAYER_ID, self.game)) |
543 | 248 |
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'), |
543 | 256 'stars': InteractAnimated(190, 145, |
257 ['stars_%d.png' % (i + 1) for i | |
258 in range(3) + range(1, 0, -1)], 30), | |
424
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 |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
261 INITIAL = 'stars' |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
262 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
263 def is_interactive(self, tool=None): |
424
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
264 return False |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
265 |
8d8ccae862ee
Animated starfield for bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
412
diff
changeset
|
266 |
251 | 267 class BlinkingLights(Thing): |
268 | |
592
4e9178215e75
Introduce .setup() for GameDeveloperGizmos.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
578
diff
changeset
|
269 def setup(self): |
370
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 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
272 def is_interactive(self, tool=None): |
270
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([ |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
277 _("The lights flash in interesting patterns."), |
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
278 _("The flashing lights don't mean anything to you."), |
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
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 |
543 | 287 |
251 | 288 class LeftLights(BlinkingLights): |
289 | |
476
c72946d3a59a
Some minor pylint driven style fixes
Neil Muller <neil@dip.sun.ac.za>
parents:
474
diff
changeset
|
290 NAME = 'bridge.lights.1' |
251 | 291 |
292 INTERACTS = { | |
543 | 293 "lights": InteractAnimated(176, 337, |
294 ["bridge_lights_1_1.png", | |
295 "bridge_lights_1_2.png", | |
296 "bridge_lights_1_3.png", | |
297 "bridge_lights_1_2.png"], 5), | |
251 | 298 } |
299 | |
300 INITIAL = 'lights' | |
301 | |
543 | 302 |
251 | 303 class RightLights(BlinkingLights): |
304 | |
476
c72946d3a59a
Some minor pylint driven style fixes
Neil Muller <neil@dip.sun.ac.za>
parents:
474
diff
changeset
|
305 NAME = 'bridge.lights.2' |
251 | 306 |
307 INTERACTS = { | |
543 | 308 "lights": InteractAnimated(559, 332, |
309 ["bridge_lights_2_1.png", | |
310 "bridge_lights_2_2.png", | |
311 "bridge_lights_2_3.png", | |
312 "bridge_lights_2_2.png"], 5), | |
251 | 313 } |
314 | |
315 INITIAL = 'lights' | |
316 | |
543 | 317 |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
318 class JimPanel(Thing): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
319 "The panel to JIM's internals'" |
251 | 320 |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
321 NAME = "jim_panel" |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
322 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
323 INTERACTS = { |
543 | 324 'closed': InteractNoImage(506, 430, 137, 47), |
325 'open': InteractImage(500, 427, 'jim_panel_open.png'), | |
326 'broken': InteractImage(488, 412, 'jim_panel_destroyed.png'), | |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
327 } |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
328 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
329 INITIAL = 'closed' |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
330 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
331 def get_description(self): |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
332 if self.scene.get_data('ai panel') == 'closed': |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
333 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
|
334 |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
745
diff
changeset
|
335 def select_interact(self): |
774
b0bd36c2c840
The data is actually on the scene (now we can finish the game)
Stefano Rivera <stefano@rivera.za.net>
parents:
770
diff
changeset
|
336 status = self.scene.get_data('ai panel') |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
745
diff
changeset
|
337 return status or self.INITIAL |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
745
diff
changeset
|
338 |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
339 def interact_without(self): |
655
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
629
diff
changeset
|
340 ai_status = self.state.get_jim_state() |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
629
diff
changeset
|
341 if 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
|
342 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
|
343 elif self.scene.get_data('ai panel') == 'closed': |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
344 return Result(_("You are unable to open the panel with your" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
345 " bare hands.")) |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
346 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
|
347 self.scene.set_data('ai panel', 'broken') |
655
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
629
diff
changeset
|
348 self.state.break_ai() |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
745
diff
changeset
|
349 self.set_interact() |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
350 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
|
351 |
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
352 def interact_with_machete(self, item): |
655
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
629
diff
changeset
|
353 ai_status = self.state.get_jim_state() |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
629
diff
changeset
|
354 if 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
|
355 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
|
356 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
|
357 self.scene.set_data('ai panel', 'open') |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
745
diff
changeset
|
358 self.set_interact() |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
359 return Result(_("Using the machete, you lever the panel off.")) |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
360 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
|
361 self.scene.set_data('ai panel', 'broken') |
655
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
629
diff
changeset
|
362 self.state.break_ai() |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
745
diff
changeset
|
363 self.set_interact() |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
364 return Result(_("You smash various delicate components with" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
365 " the machete.")) |
354
09efb8b7c132
Hook up panel part of AI puzzle
Neil Muller <neil@dip.sun.ac.za>
parents:
352
diff
changeset
|
366 |
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
|
367 def interact_default(self, item): |
655
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
629
diff
changeset
|
368 if self.state.get_jim_state() == 'online': |
478
a9925aaf5f61
i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
476
diff
changeset
|
369 return (Result(_('You feel a shock from the panel.')), |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
370 make_jim_dialog(_("Prisoner %s. Please step away from the" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
371 " panel. You are not an authorized" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
372 " technician.") % PLAYER_ID, self.game)) |
543 | 373 |
251 | 374 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
375 class ChairDetail(Scene): |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
376 |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
377 FOLDER = 'bridge' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
378 BACKGROUND = 'chair_detail.png' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
379 NAME = 'chair_detail' |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
380 |
592
4e9178215e75
Introduce .setup() for GameDeveloperGizmos.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
578
diff
changeset
|
381 def setup(self): |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
382 self.add_thing(SuperconductorThing()) |
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
383 |
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 # 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
|
386 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
387 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
388 class LogTab(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
389 """Tab for log screen""" |
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 NAME = 'bridge_comp.screen' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
392 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
393 INTERACTS = { |
543 | 394 'log tab': InteractNoImage(100, 53, 94, 37), |
255
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 INITIAL = 'log tab' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
397 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
398 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
399 def is_interactive(self, tool=None): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
400 return self.game.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
|
401 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
402 def interact_without(self): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
403 self.game.detail_views[self.COMPUTER].set_data('tab', 'log') |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
404 self.game.detail_views[self.COMPUTER].set_background() |
257 | 405 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
|
406 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
407 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
408 class AlertTab(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
409 """Tab for alert screen""" |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
410 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
411 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
|
412 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
413 INTERACTS = { |
543 | 414 'alert tab': InteractNoImage(12, 53, 88, 37), |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
415 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
416 INITIAL = 'alert tab' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
417 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
418 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
419 def is_interactive(self, tool=None): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
420 return (self.game.detail_views[self.COMPUTER].get_data('tab') |
543 | 421 != 'alert') |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
422 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
423 def interact_without(self): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
424 self.game.detail_views[self.COMPUTER].set_data('tab', 'alert') |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
425 self.game.detail_views[self.COMPUTER].set_background() |
257 | 426 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
|
427 |
543 | 428 |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
429 class NavTab(Thing): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
430 """Tab for the Navigation screen""" |
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 NAME = 'bridge_comp.nav_tab' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
433 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
434 INTERACTS = { |
543 | 435 'nav tab': InteractNoImage(197, 53, 126, 37), |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
436 } |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
437 INITIAL = 'nav tab' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
438 COMPUTER = 'bridge_comp_detail' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
439 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
440 def is_interactive(self, tool=None): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
441 return self.game.detail_views[self.COMPUTER].get_data('tab') != 'nav' |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
442 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
443 def interact_without(self): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
444 self.game.detail_views[self.COMPUTER].set_data('tab', 'nav') |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
445 self.game.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
|
446 return Result(soundfile='beep550.ogg') |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
447 |
543 | 448 |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
449 class DestNavPageLine(Thing): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
450 """The destination navigation lines.""" |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
451 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
452 INITIAL = 'line' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
453 COMPUTER = 'bridge_comp_detail' |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
454 |
828 | 455 def __init__(self, number, rect, ai_blocked, dest): |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
456 super(DestNavPageLine, self).__init__() |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
457 self.name = 'bridge_comp.nav_line%s' % number |
578
356795038b87
Remove a couple of uses os DEBUG.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
576
diff
changeset
|
458 # set debugging higlight color for when DEBUG is on. |
356795038b87
Remove a couple of uses os DEBUG.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
576
diff
changeset
|
459 self._interact_hilight_color = Color(THECOLORS.keys()[number]) |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
460 r = Rect(rect) |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
745
diff
changeset
|
461 # We dynamically generate the interact rect here. |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
462 self.interacts = {} |
828 | 463 self.interacts['line'] = InteractText(r.x, r.y, r.w, r.h, |
464 dest, 'darkblue', 16, 'DejaVuSans-Bold.ttf', False) | |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
465 # Whether JIM blocks this |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
466 self.ai_blocked = ai_blocked |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
745
diff
changeset
|
467 self.set_interact() |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
468 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
469 def is_interactive(self, tool=None): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
470 return self.game.detail_views[self.COMPUTER].get_data('tab') == 'nav' |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
471 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
472 def interact_without(self): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
473 if self.game.scenes['bridge'].get_data('ai status') == 'online': |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
474 return make_jim_dialog(_("You are not authorized to change the" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
475 " destination."), self.game) |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
476 if not self.ai_blocked: |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
477 return Result(_("There's no good reason to choose to go to the" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
478 " penal colony.")) |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
479 if self.game.scenes['bridge'].get_data('ai status') == 'looping': |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
480 return Result(_("You could change the destination, but when JIM" |
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
481 " recovers, it'll just get reset.")) |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
482 if self.game.scenes['bridge'].get_data('ai status') == 'dead': |
769
43b49f1de828
Merge i18n for before the pyntnclick split
Stefano Rivera <stefano@rivera.za.net>
diff
changeset
|
483 return Result(_("You change the destination."), |
543 | 484 soundfile="beep550.ogg", end_game=True) |
485 | |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
486 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
487 class CompUpButton(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
488 """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
|
489 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
490 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
|
491 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
492 INTERACTS = { |
543 | 493 'up': InteractNoImage(594, 82, 30, 58), |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
494 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
495 INITIAL = 'up' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
496 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
497 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
498 def is_interactive(self, tool=None): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
499 tab = self.game.detail_views[self.COMPUTER].get_data('tab') |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
500 page = self.game.detail_views[self.COMPUTER].get_data('log page') |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
501 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
|
502 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
503 def interact_without(self): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
504 page = self.game.detail_views[self.COMPUTER].get_data('log page') |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
505 self.game.detail_views[self.COMPUTER].set_data('log page', page - 1) |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
506 self.game.detail_views[self.COMPUTER].set_background() |
257 | 507 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
|
508 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
509 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
510 class CompDownButton(Thing): |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
511 """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
|
512 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
513 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
|
514 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
515 INTERACTS = { |
543 | 516 'down': InteractNoImage(594, 293, 30, 58), |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
517 } |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
518 INITIAL = 'down' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
519 COMPUTER = 'bridge_comp_detail' |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
520 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
521 def is_interactive(self, tool=None): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
522 tab = self.game.detail_views[self.COMPUTER].get_data('tab') |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
523 page = self.game.detail_views[self.COMPUTER].get_data('log page') |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
524 max_page = self.game.detail_views[self.COMPUTER].get_data('max page') |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
525 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
|
526 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
527 def interact_without(self): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
528 page = self.game.detail_views[self.COMPUTER].get_data('log page') |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
529 self.game.detail_views[self.COMPUTER].set_data('log page', page + 1) |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
530 self.game.detail_views[self.COMPUTER].set_background() |
257 | 531 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
|
532 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
533 |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
534 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
|
535 "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
|
536 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
537 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
|
538 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
539 INTERACTS = { |
464 | 540 'online': InteractImage(33, 192, 'camera_small.png'), |
541 'dead': InteractImage(33, 192, 'camera_small_gray.png'), | |
542 'looping': InteractAnimated(33, 192, ('camera_small.png', | |
543 'camera_small_gray.png'), | |
544 15), | |
545 } | |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
546 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
341
diff
changeset
|
547 |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
548 class BridgeCompDetail(Scene): |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
549 |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
550 FOLDER = 'bridge' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
551 NAME = 'bridge_comp_detail' |
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
552 |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
553 ALERT_BASE = 'comp_alert_base.png' |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
554 ALERTS = { |
543 | 555 'ai looping': 'comp_alert_ai_looping.png', |
556 'ai offline': 'comp_alert_ai_offline.png', | |
557 'engine offline': 'comp_alert_engine_offline.png', | |
558 'life support': 'comp_alert_life_support.png', | |
559 '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
|
560 } |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
561 |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
562 # Point to start drawing changeable alerts |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
563 ALERT_OFFSET = (16, 140) |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
564 ALERT_SPACING = 4 |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
565 |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
566 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
|
567 'comp_log_end.png'] |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
568 |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
569 NAVIGATION = { |
543 | 570 'engine offline': 'bridge_nav_engine.png', |
571 'life support': 'bridge_nav_life_support.png', | |
572 'final': 'bridge_nav_dest.png', | |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
573 } |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
574 |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
575 BACKGROUND = ALERT_BASE |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
576 |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
577 INITIAL_DATA = { |
543 | 578 'tab': 'alert', |
579 'log page': 0, | |
580 'max page': len(LOGS), | |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
581 } |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
582 |
592
4e9178215e75
Introduce .setup() for GameDeveloperGizmos.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
578
diff
changeset
|
583 def setup(self): |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
584 self.add_thing(LogTab()) |
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
585 self.add_thing(AlertTab()) |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
586 self.add_thing(NavTab()) |
412 | 587 #self.add_thing(CompUpButton()) |
588 #self.add_thing(CompDownButton()) | |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
589 self._scene_playlist = None |
623
cab77cf07822
Undo fix get_image calls
Stefano Rivera <stefano@rivera.za.net>
parents:
621
diff
changeset
|
590 self._alert = self.get_image(self.FOLDER, self.ALERT_BASE) |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
591 self._alert_messages = {} |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
592 self._nav_messages = {} |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
593 for key, name in self.ALERTS.iteritems(): |
623
cab77cf07822
Undo fix get_image calls
Stefano Rivera <stefano@rivera.za.net>
parents:
621
diff
changeset
|
594 self._alert_messages[key] = self.get_image(self.FOLDER, name) |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
595 for key, name in self.NAVIGATION.iteritems(): |
623
cab77cf07822
Undo fix get_image calls
Stefano Rivera <stefano@rivera.za.net>
parents:
621
diff
changeset
|
596 self._nav_messages[key] = self.get_image(self.FOLDER, name) |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
597 self._nav_lines = [] |
828 | 598 self._nav_lines.append(DestNavPageLine(1, (12, 99, 610, 25), False, |
599 _("1. Bounty Penal Colony Space Port, New South Australia" | |
600 " (397 days)"))) | |
601 self._nav_lines.append(DestNavPageLine(2, (12, 135, 610, 25), True, | |
602 _("2. Hedonia Space Station (782 days)"))) | |
603 self._nav_lines.append(DestNavPageLine(3, (12, 167, 610, 25), True, | |
604 _("3. Spinosa Health Resort, Prunus Secundus (1231 days)"))) | |
605 self._nav_lines.append(DestNavPageLine(4, (12, 203, 610, 25), True, | |
606 _("4. Achene Space Port, Indica Prspinosame (1621 days)"))) | |
607 self._nav_lines.append(DestNavPageLine(5, (12, 239, 610, 25), True, | |
608 _("5. Opioid Space Port, Gelatinosa Prime (1963 days)"))) | |
623
cab77cf07822
Undo fix get_image calls
Stefano Rivera <stefano@rivera.za.net>
parents:
621
diff
changeset
|
609 self._logs = [self.get_image(self.FOLDER, x) for x in self.LOGS] |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
610 |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
611 def enter(self): |
566
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
612 self._scene_playlist = self.sound.get_current_playlist() |
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
613 self.sound.change_playlist(None) |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
614 self.set_background() |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
615 |
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
616 def leave(self): |
566
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
617 self.sound.change_playlist(self._scene_playlist) |
315
7b07ffc37ec0
Suspend background sound for bridge computer detail
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
618 |
453
ab628938b95c
Move background setting. Set end_game flag
Neil Muller <neil@dip.sun.ac.za>
parents:
439
diff
changeset
|
619 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
|
620 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
|
621 self._clear_navigation() |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
622 self._background = self._alert |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
623 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
|
624 self._clear_navigation() |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
625 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
|
626 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
|
627 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
|
628 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
629 def _clear_navigation(self): |
435 | 630 "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
|
631 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
|
632 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
|
633 # 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
|
634 del self.things[thing.name] |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
635 thing.scene = None |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
636 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
637 def _get_nav_page(self): |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
638 if not self.game.scenes['engine'].get_data('engine online'): |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
639 return self._nav_messages['engine offline'] |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
640 elif (not self.game.scenes['mess'].get_data('life support status') |
543 | 641 == 'fixed'): |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
642 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
|
643 else: |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
644 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
|
645 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
|
646 self.add_thing(thing) |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
647 return self._nav_messages['final'] |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
648 |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
649 def _draw_alerts(self, surface): |
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
650 xpos, ypos = self.ALERT_OFFSET |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
651 if self.game.scenes['bridge'].get_data('ai status') == 'looping': |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
652 surface.blit(self._alert_messages['ai looping'], (xpos, ypos)) |
543 | 653 ypos += (self._alert_messages['ai looping'].get_size()[1] |
654 + self.ALERT_SPACING) | |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
655 if self.game.scenes['bridge'].get_data('ai status') == 'dead': |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
656 surface.blit(self._alert_messages['ai offline'], (xpos, ypos)) |
543 | 657 ypos += (self._alert_messages['ai offline'].get_size()[1] |
658 + self.ALERT_SPACING) | |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
659 if not self.game.scenes['engine'].get_data('engine online'): |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
660 surface.blit(self._alert_messages['engine offline'], (xpos, ypos)) |
543 | 661 ypos += (self._alert_messages['engine offline'].get_size()[1] |
662 + self.ALERT_SPACING) | |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
663 if (self.game.scenes['mess'].get_data('life support status') |
800 | 664 == 'broken'): |
403
df3216b369b1
Hook up navigation tab, Add won condition
Neil Muller <neil@dip.sun.ac.za>
parents:
399
diff
changeset
|
665 surface.blit(self._alert_messages['life support'], (xpos, ypos)) |
543 | 666 ypos += (self._alert_messages['life support'].get_size()[1] |
667 + self.ALERT_SPACING) | |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
595
diff
changeset
|
668 if (self.game.scenes['mess'].get_data('life support status') |
800 | 669 == 'replaced'): |
543 | 670 surface.blit(self._alert_messages['life support partial'], |
671 (xpos, ypos)) | |
672 ypos += (self._alert_messages['life support partial'].get_size()[1] | |
673 + self.ALERT_SPACING) | |
255
2bd28030e8e4
Hook up parts of the bridge computer system
Neil Muller <neil@dip.sun.ac.za>
parents:
252
diff
changeset
|
674 |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
675 def draw_things(self, surface): |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
676 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
|
677 self._draw_alerts(surface) |
389
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
678 super(BridgeCompDetail, self).draw_things(surface) |
eef2fca1aa11
Hook up updated alert screens
Neil Muller <neil@dip.sun.ac.za>
parents:
370
diff
changeset
|
679 |
222
b03debaec72d
Things and Items for bridge
Stefano Rivera <stefano@rivera.za.net>
parents:
150
diff
changeset
|
680 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
681 SCENES = [Bridge] |
237
ae01c10497b3
Start work on bridge comp detail
Neil Muller <neil@dip.sun.ac.za>
parents:
235
diff
changeset
|
682 DETAIL_VIEWS = [ChairDetail, BridgeCompDetail] |