Mercurial > boomslang
annotate gamelib/scenes/cryo.py @ 566:ea9dd2b9186a pyntnclick
Hook up sound in gamelib/scenes.
author | Simon Cross <hodgestar+bzr@gmail.com> |
---|---|
date | Sat, 11 Feb 2012 15:05:18 +0200 |
parents | 098ea4ea0d0d |
children | 4e9178215e75 |
rev | line source |
---|---|
39
088a101f5b94
Add an example Thing to cryo scene.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
35
diff
changeset
|
1 """Cryo room where the prisoner starts out.""" |
088a101f5b94
Add an example Thing to cryo scene.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
35
diff
changeset
|
2 |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
3 import random |
433 | 4 |
5 from albow.resource import get_image | |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
6 |
549 | 7 from pyntnclick.cursor import CursorSprite |
8 from pyntnclick.state import Scene, Item, CloneableItem, Thing, Result | |
9 from pyntnclick.scenewidgets import (InteractNoImage, InteractRectUnion, | |
528
0ce08d5e2acb
pyflakes-induced cleanup.
Jeremy Thurgood <firxen@gmail.com>
parents:
525
diff
changeset
|
10 InteractImage, InteractAnimated, |
0ce08d5e2acb
pyflakes-induced cleanup.
Jeremy Thurgood <firxen@gmail.com>
parents:
525
diff
changeset
|
11 GenericDescThing) |
525
821b322e903b
Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
519
diff
changeset
|
12 |
212
2b820b4ba3bf
Add constant for player id. Make IDs uppercase
Neil Muller <neil@dip.sun.ac.za>
parents:
210
diff
changeset
|
13 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
|
14 from gamelib.scenes.game_widgets import Door, make_jim_dialog |
39
088a101f5b94
Add an example Thing to cryo scene.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
35
diff
changeset
|
15 |
28
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
16 |
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
17 class Cryo(Scene): |
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
18 |
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
19 FOLDER = "cryo" |
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
20 BACKGROUND = "cryo_room.png" |
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
21 |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
22 INITIAL_DATA = { |
540 | 23 'greet': True, |
375
c80a1bd291d1
Only give vandalism warning once
Stefano Rivera <stefano@rivera.za.net>
parents:
368
diff
changeset
|
24 'vandalism_warn': True, |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
25 } |
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
26 |
141
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
27 # sounds that will be played randomly as background noise |
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
28 MUSIC = [ |
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
29 'drip1.ogg', |
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
30 'drip2.ogg', |
209
aeb96ca5f76c
Add more sounds to cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
202
diff
changeset
|
31 'drip3.ogg', |
141
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
32 'creaking.ogg', |
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
33 'silent.ogg', |
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
34 'silent.ogg', |
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
35 ] |
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
36 |
28
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
37 def __init__(self, state): |
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
38 super(Cryo, self).__init__(state) |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
39 self.add_item(TitaniumLeg("titanium_leg")) |
86
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
40 self.add_thing(CryoUnitAlpha()) |
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
41 self.add_thing(CryoRoomDoor()) |
89
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
42 self.add_thing(CryoComputer()) |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
43 self.add_thing(CryoPipeLeft()) |
348
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
44 self.add_thing(CryoPipeRightTop()) |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
45 self.add_thing(CryoPipeRightBottom()) |
353
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
46 self.add_thing(CryoPools()) |
213
20998c650ce1
Fixed rect_drawer tool and adjusted JIM message background.
Jeremy Thurgood <firxen@gmail.com>
parents:
212
diff
changeset
|
47 |
183
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
48 # Flavour items |
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
49 # pipes |
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
50 self.add_thing(GenericDescThing('cryo.pipes', 1, |
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
51 "These pipes carry cooling fluid to the cryo units.", |
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
52 ( |
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
53 (552, 145, 129, 66), |
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
54 (636, 82, 165, 60), |
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
55 (140, 135, 112, 73), |
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
56 (11, 63, 140, 67), |
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
57 ))) |
328
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
58 self.add_thing(UncuttableCryoPipes()) |
213
20998c650ce1
Fixed rect_drawer tool and adjusted JIM message background.
Jeremy Thurgood <firxen@gmail.com>
parents:
212
diff
changeset
|
59 |
183
829551aad0f1
Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
182
diff
changeset
|
60 # cryo units |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
61 self.add_thing(GenericCryoUnit(2, |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
62 "An empty cryo chamber.", |
212
2b820b4ba3bf
Add constant for player id. Make IDs uppercase
Neil Muller <neil@dip.sun.ac.za>
parents:
210
diff
changeset
|
63 "Prisoner 81E4-C8900480E635. Embezzlement. 20 years.", |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
64 ( |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
65 (155, 430, 50, 35), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
66 (125, 450, 60, 35), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
67 (95, 470, 60, 35), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
68 (55, 490, 60, 55), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
69 ))) |
213
20998c650ce1
Fixed rect_drawer tool and adjusted JIM message background.
Jeremy Thurgood <firxen@gmail.com>
parents:
212
diff
changeset
|
70 |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
71 self.add_thing(GenericCryoUnit(3, |
540 | 72 "A working cryo chamber. The frosted glass obscures the details" |
73 " of the occupant.", | |
212
2b820b4ba3bf
Add constant for player id. Make IDs uppercase
Neil Muller <neil@dip.sun.ac.za>
parents:
210
diff
changeset
|
74 "Prisoner 9334-CE1EB0243BAB. Murder. 40 years.", |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
75 ( |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
76 (215, 430, 50, 35), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
77 (205, 450, 50, 35), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
78 (185, 470, 50, 35), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
79 (125, 505, 80, 40), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
80 ))) |
213
20998c650ce1
Fixed rect_drawer tool and adjusted JIM message background.
Jeremy Thurgood <firxen@gmail.com>
parents:
212
diff
changeset
|
81 |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
82 self.add_thing(GenericCryoUnit(4, |
540 | 83 "A broken cryo chamber. The skeleton inside has been picked" |
84 " clean.", | |
85 "Prisoner BFBC-8BF4C6B7492B. Importing illegal alien biomatter." | |
86 " 15 years.", | |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
87 ( |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
88 (275, 430, 50, 70), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
89 (255, 460, 50, 70), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
90 (235, 490, 50, 60), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
91 ))) |
213
20998c650ce1
Fixed rect_drawer tool and adjusted JIM message background.
Jeremy Thurgood <firxen@gmail.com>
parents:
212
diff
changeset
|
92 |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
93 self.add_thing(GenericCryoUnit(5, |
540 | 94 "A working cryo chamber. The frosted glass obscures the details of" |
95 " the occupant.", | |
368 | 96 "Prisoner B520-99495B8C41CE. Copyright infringement. 60 years.", |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
97 ( |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
98 (340, 430, 50, 70), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
99 (330, 500, 60, 50), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
100 ))) |
213
20998c650ce1
Fixed rect_drawer tool and adjusted JIM message background.
Jeremy Thurgood <firxen@gmail.com>
parents:
212
diff
changeset
|
101 |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
102 self.add_thing(GenericCryoUnit(6, |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
103 "An empty cryo unit. Recently filled by you.", |
435 | 104 "Prisoner %s. Safecracking, grand larceny. 30 years." % PLAYER_ID, |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
105 ( |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
106 (399, 426, 70, 56), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
107 (404, 455, 69, 120), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
108 ))) |
213
20998c650ce1
Fixed rect_drawer tool and adjusted JIM message background.
Jeremy Thurgood <firxen@gmail.com>
parents:
212
diff
changeset
|
109 |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
110 self.add_thing(GenericCryoUnit(7, |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
111 "An empty cryo unit.", |
463 | 112 "Prisoner 83F1-CE32D3234749. Spamming. 5 years.", |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
113 ( |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
114 (472, 432, 58, 51), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
115 (488, 455, 41, 134), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
116 (517, 487, 42, 93), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
117 ))) |
213
20998c650ce1
Fixed rect_drawer tool and adjusted JIM message background.
Jeremy Thurgood <firxen@gmail.com>
parents:
212
diff
changeset
|
118 |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
119 self.add_thing(GenericCryoUnit(8, |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
120 "An empty cryo unit.", |
224
8d8aef45db4e
fixed some typos
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
219
diff
changeset
|
121 "Prisoner A455-9DF9F43C43E5. Medical malpractice. 10 years.", |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
122 ( |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
123 (596, 419, 69, 39), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
124 (616, 442, 82, 40), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
125 (648, 467, 84, 37), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
126 (681, 491, 97, 60), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
127 ))) |
35 | 128 |
120 | 129 def enter(self): |
141
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
130 # Setup music |
566
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
131 pieces = [self.sound.get_music(x, prefix='sounds') for x in self.MUSIC] |
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
132 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
|
133 repeat=True) |
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
134 self.sound.change_playlist(background_playlist) |
120 | 135 if self.get_data('greet'): |
136 self.set_data('greet', False) | |
360
452230d78541
Use make_jim_dialog everywhere
Neil Muller <neil@dip.sun.ac.za>
parents:
353
diff
changeset
|
137 return make_jim_dialog( |
376
41ee3fc71404
Tweaks to text and JIM background.
Jeremy Thurgood <firxen@gmail.com>
parents:
375
diff
changeset
|
138 "Greetings, Prisoner %s. I am the Judicial " |
360
452230d78541
Use make_jim_dialog everywhere
Neil Muller <neil@dip.sun.ac.za>
parents:
353
diff
changeset
|
139 "Incarceration Monitor. " |
202 | 140 "You have been woken early under the terms of the " |
376
41ee3fc71404
Tweaks to text and JIM background.
Jeremy Thurgood <firxen@gmail.com>
parents:
375
diff
changeset
|
141 "emergency conscription act to assist with repairs to " |
202 | 142 "the ship. Your behaviour during this time will " |
376
41ee3fc71404
Tweaks to text and JIM background.
Jeremy Thurgood <firxen@gmail.com>
parents:
375
diff
changeset
|
143 "be noted on your record and will be relayed to " |
202 | 144 "prison officials when we reach the destination. " |
376
41ee3fc71404
Tweaks to text and JIM background.
Jeremy Thurgood <firxen@gmail.com>
parents:
375
diff
changeset
|
145 "Please report to the bridge." % PLAYER_ID, self.state) |
35 | 146 |
141
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
147 def leave(self): |
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
148 # Stop music |
566
ea9dd2b9186a
Hook up sound in gamelib/scenes.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
149 self.sound.change_playlist(None) |
141
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
150 |
35 | 151 |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
152 class CryoPipeBase(Thing): |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
153 "Base class for cryo pipes that need to be stolen." |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
154 |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
155 INITIAL = "fixed" |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
156 |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
157 INITIAL_DATA = { |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
158 'fixed': True, |
375
c80a1bd291d1
Only give vandalism warning once
Stefano Rivera <stefano@rivera.za.net>
parents:
368
diff
changeset
|
159 } |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
160 |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
161 def interact_with_machete(self, item): |
247
0bad554d0926
More tests, some cryo room fixes and docs in the build.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
162 if self.get_data('fixed'): |
0bad554d0926
More tests, some cryo room fixes and docs in the build.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
163 self.set_data('fixed', False) |
329 | 164 pipe = TubeFragment('tube_fragment') |
247
0bad554d0926
More tests, some cryo room fixes and docs in the build.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
165 self.state.add_item(pipe) |
0bad554d0926
More tests, some cryo room fixes and docs in the build.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
166 self.state.add_inventory_item(pipe.name) |
0bad554d0926
More tests, some cryo room fixes and docs in the build.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
167 self.set_interact("chopped") |
540 | 168 responses = [Result("It takes more effort than one would expect," |
169 " but eventually the pipe is separated from the wall.", | |
170 soundfile="chop-chop.ogg")] | |
375
c80a1bd291d1
Only give vandalism warning once
Stefano Rivera <stefano@rivera.za.net>
parents:
368
diff
changeset
|
171 if self.state.current_scene.get_data('vandalism_warn'): |
c80a1bd291d1
Only give vandalism warning once
Stefano Rivera <stefano@rivera.za.net>
parents:
368
diff
changeset
|
172 self.state.current_scene.set_data('vandalism_warn', False) |
c80a1bd291d1
Only give vandalism warning once
Stefano Rivera <stefano@rivera.za.net>
parents:
368
diff
changeset
|
173 responses.append(make_jim_dialog( |
c80a1bd291d1
Only give vandalism warning once
Stefano Rivera <stefano@rivera.za.net>
parents:
368
diff
changeset
|
174 ("Prisoner %s. Vandalism is an offence punishable by a " |
422 | 175 "minimum of an additional 6 months to your sentence." |
375
c80a1bd291d1
Only give vandalism warning once
Stefano Rivera <stefano@rivera.za.net>
parents:
368
diff
changeset
|
176 ) % PLAYER_ID, self.state)) |
c80a1bd291d1
Only give vandalism warning once
Stefano Rivera <stefano@rivera.za.net>
parents:
368
diff
changeset
|
177 return responses |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
178 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
179 def is_interactive(self, tool=None): |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
180 return self.get_data('fixed') |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
181 |
247
0bad554d0926
More tests, some cryo room fixes and docs in the build.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
182 def interact_without(self): |
0bad554d0926
More tests, some cryo room fixes and docs in the build.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
183 if self.get_data('fixed'): |
540 | 184 return Result("These pipes aren't attached to the wall very" |
185 " solidly.") | |
247
0bad554d0926
More tests, some cryo room fixes and docs in the build.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
186 return None |
0bad554d0926
More tests, some cryo room fixes and docs in the build.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
187 |
228
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
227
diff
changeset
|
188 def get_description(self): |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
227
diff
changeset
|
189 if self.get_data('fixed'): |
328
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
190 return "These pipes carry cooling fluid to empty cryo units." |
422 | 191 return "There used to be a pipe carrying cooling fluid here." |
228
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
227
diff
changeset
|
192 |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
193 |
328
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
194 class UncuttableCryoPipes(Thing): |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
195 "Base class for cryo pipes that can't be cut down." |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
196 |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
197 NAME = "cryo.pipes.2" |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
198 |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
199 INTERACTS = { |
540 | 200 "fixed": InteractRectUnion(( |
328
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
201 (2, 130, 44, 394), |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
202 (756, 127, 52, 393),)) |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
203 } |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
204 |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
205 INITIAL = "fixed" |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
206 |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
207 def interact_with_machete(self, item): |
368 | 208 return Result("These pipes carry fluid to the working cryo units." |
328
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
209 " Chopping them down doesn't seem sensible.") |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
210 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
211 def is_interactive(self, tool=None): |
328
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
212 return True |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
213 |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
214 def interact_without(self): |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
215 return Result("These pipes aren't attached to the wall very solidly.") |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
216 |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
217 def get_description(self): |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
218 return "These pipes carry cooling fluid to the working cryo units." |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
219 |
3cb48621759a
Add uncuttable cryo pipe interact
Neil Muller <neil@dip.sun.ac.za>
parents:
307
diff
changeset
|
220 |
329 | 221 class TubeFragment(CloneableItem): |
222 "Obtained after cutting down a cryo room pipe." | |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
223 |
329 | 224 INVENTORY_IMAGE = "tube_fragment.png" |
225 CURSOR = CursorSprite('tube_fragment_cursor.png') | |
226 TOOL_NAME = "tube_fragment" | |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
227 |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
228 |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
229 class CryoPipeLeft(CryoPipeBase): |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
230 "Left cryo pipe." |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
231 |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
232 NAME = "cryo.pipe.left" |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
233 INTERACTS = { |
271 | 234 "fixed": InteractImage(117, 226, "intact_cryo_pipe_left.png"), |
235 "chopped": InteractNoImage(125, 192, 27, 258), | |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
236 } |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
237 |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
238 |
348
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
239 class CryoPipeRightTop(CryoPipeBase): |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
240 "Right cryo pipe, top." |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
241 |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
242 NAME = "cryo.pipe.right.top" |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
243 INTERACTS = { |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
244 "fixed": InteractImage(645, 212, "intact_cryo_pipe_right_top.png"), |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
245 "chopped": InteractNoImage(643, 199, 31, 111), |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
246 } |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
247 |
348
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
248 |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
249 class CryoPipeRightBottom(CryoPipeBase): |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
250 "Right cryo pipe, bottom." |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
251 |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
252 NAME = "cryo.pipe.right.bottom" |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
253 INTERACTS = { |
348
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
254 "fixed": InteractImage(644, 333, "intact_cryo_pipe_right_bottom.png"), |
c193cbff785d
The environment / pipe puzzle is now solveable
Stefano Rivera <stefano@rivera.za.net>
parents:
329
diff
changeset
|
255 "chopped": InteractNoImage(644, 333, 31, 107), |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
256 } |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
257 |
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
258 |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
259 class TitaniumLeg(Item): |
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
260 "Titanium leg, found on a piratical corpse." |
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
261 |
91
542ede2896bb
Link in femur inventory image.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
89
diff
changeset
|
262 INVENTORY_IMAGE = "titanium_femur.png" |
307
5031b84fbb4c
Hook up new machete, can_opener, and titanium_femur images
Stefano Rivera <stefano@rivera.za.net>
parents:
302
diff
changeset
|
263 CURSOR = CursorSprite('titanium_femur_cursor.png', 13, 5) |
28
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
264 |
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
265 |
39
088a101f5b94
Add an example Thing to cryo scene.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
35
diff
changeset
|
266 class CryoUnitAlpha(Thing): |
67
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
63
diff
changeset
|
267 "Cryo unit containing titanium leg." |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
63
diff
changeset
|
268 |
86
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
269 NAME = "cryo.unit.1" |
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
270 |
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
271 INTERACTS = { |
133
0530547a131f
Better map handling, detail_view stuff in Result.
Jeremy Thurgood <firxen@gmail.com>
parents:
131
diff
changeset
|
272 "unit": InteractRectUnion(( |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
273 (531, 430, 64, 49), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
274 (560, 460, 57, 47), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
275 (583, 482, 65, 69), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
276 (600, 508, 71, 48), |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
277 )) |
86
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
278 } |
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
279 |
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
280 INITIAL = "unit" |
67
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
63
diff
changeset
|
281 |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
63
diff
changeset
|
282 INITIAL_DATA = { |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
63
diff
changeset
|
283 'contains_titanium_leg': True, |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
63
diff
changeset
|
284 } |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
63
diff
changeset
|
285 |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
63
diff
changeset
|
286 def interact_without(self): |
134
faac82748f5a
Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents:
133
diff
changeset
|
287 return Result(detail_view='cryo_detail') |
39
088a101f5b94
Add an example Thing to cryo scene.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
35
diff
changeset
|
288 |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
289 def interact_with_titanium_leg(self, item): |
540 | 290 return Result("You hit the chamber that used to hold this very leg." |
291 " Nothing happens as a result.", | |
209
aeb96ca5f76c
Add more sounds to cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
202
diff
changeset
|
292 soundfile="clang2.ogg") |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
293 |
94
ce23fad8ecb3
More complex shaped interactables
Neil Muller <neil@dip.sun.ac.za>
parents:
91
diff
changeset
|
294 def get_description(self): |
ce23fad8ecb3
More complex shaped interactables
Neil Muller <neil@dip.sun.ac.za>
parents:
91
diff
changeset
|
295 if self.get_data('contains_titanium_leg'): |
540 | 296 return "A broken cryo chamber, with a poor unfortunate corpse" \ |
297 " inside." | |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
298 return "A broken cryo chamber. The corpse inside is missing a leg." |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
299 |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
300 |
182
5cb3fbe61f75
Add genric thing with description helper class
Neil Muller <neil@dip.sun.ac.za>
parents:
180
diff
changeset
|
301 class GenericCryoUnit(GenericDescThing): |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
302 "Generic Cryo unit" |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
303 |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
304 def __init__(self, number, description, detailed_description, areas): |
540 | 305 super(GenericCryoUnit, self).__init__('cryo.unit', number, |
306 description, areas) | |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
307 self.detailed_description = detailed_description |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
308 |
519
8f3c82c685a4
Fix is_interactive() by adding tool param.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
309 def is_interactive(self, tool=None): |
270
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
263
diff
changeset
|
310 return True |
d4f08abc58fb
Interactivity status tweaks
Neil Muller <neil@dip.sun.ac.za>
parents:
263
diff
changeset
|
311 |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
312 def interact_without(self): |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
313 return Result(self.detailed_description) |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
314 |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
315 def get_description(self): |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
316 return self.description |
94
ce23fad8ecb3
More complex shaped interactables
Neil Muller <neil@dip.sun.ac.za>
parents:
91
diff
changeset
|
317 |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
318 def interact_with_titanium_leg(self, item): |
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
319 return Result(random.choice([ |
540 | 320 "You bang on the chamber with the titanium femur. Nothing" |
321 " much happens.", | |
322 "Hitting the cryo unit with the femur doesn't achieve" | |
323 " anything.", | |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
324 "You hit the chamber with the femur. Nothing happens.", |
209
aeb96ca5f76c
Add more sounds to cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
202
diff
changeset
|
325 ]), soundfile="clang2.ogg") |
180
6b3ccee6f3f9
Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
167
diff
changeset
|
326 |
39
088a101f5b94
Add an example Thing to cryo scene.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
35
diff
changeset
|
327 |
242 | 328 class CryoRoomDoor(Door): |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
329 "Door to the cryo room." |
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
330 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
247
diff
changeset
|
331 SCENE = "cryo" |
86
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
332 |
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
333 INTERACTS = { |
95
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
334 "shut": InteractNoImage(290, 260, 99, 152), |
87
4c6fea1b242b
Fix interact positions.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
86
diff
changeset
|
335 "ajar": InteractImage(290, 260, "door_ajar.png"), |
4c6fea1b242b
Fix interact positions.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
86
diff
changeset
|
336 "open": InteractImage(290, 260, "door_open.png"), |
86
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
337 } |
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
338 |
95
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
339 INITIAL = "shut" |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
340 |
55
2e2f6ff54780
Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents:
41
diff
changeset
|
341 INITIAL_DATA = { |
95
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
342 'door': "shut", |
55
2e2f6ff54780
Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents:
41
diff
changeset
|
343 } |
2e2f6ff54780
Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents:
41
diff
changeset
|
344 |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
345 def interact_with_titanium_leg(self, item): |
95
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
346 if self.get_data('door') == "ajar": |
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
347 self.open_door() |
540 | 348 return Result("You wedge the titanium femur into the chain and" |
349 " twist. With a satisfying *snap*, the chain breaks and" | |
350 " the door opens.", soundfile='break.ogg') | |
118
e548f4a13741
Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents:
109
diff
changeset
|
351 elif self.get_data('door') == "shut": |
540 | 352 text = "You bang on the door with the titanium femur. It makes a" |
353 " clanging sound." | |
141
4f18e68fd0dc
Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents:
136
diff
changeset
|
354 return Result(text, soundfile='clang.ogg') |
118
e548f4a13741
Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents:
109
diff
changeset
|
355 else: |
540 | 356 return Result("You wave the femur in the doorway. Nothing" |
357 " happens.") | |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
358 |
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
359 def interact_without(self): |
95
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
360 if self.get_data('door') == "shut": |
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
361 self.half_open_door() |
118
e548f4a13741
Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents:
109
diff
changeset
|
362 if self.get_data('door') != "open": |
540 | 363 return Result("It moves slightly and then stops. A chain on the" |
364 " other side is preventing it from opening completely.", | |
365 soundfile='chain.ogg') | |
118
e548f4a13741
Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents:
109
diff
changeset
|
366 else: |
131 | 367 self.state.set_current_scene('map') |
144
29ba5456e8b3
Removed a bunch of cruft.
Jeremy Thurgood <firxen@gmail.com>
parents:
141
diff
changeset
|
368 return None |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
369 |
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
370 def interact_default(self, item): |
435 | 371 return self.interact_without() |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
372 |
95
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
373 def half_open_door(self): |
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
374 self.set_data('door', "ajar") |
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
375 self.set_interact("ajar") |
56
75bf3d3689e9
Refactor thing interactivity and add "fake" bridge scene.
Jeremy Thurgood <firxen@gmail.com>
parents:
55
diff
changeset
|
376 |
55
2e2f6ff54780
Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents:
41
diff
changeset
|
377 def open_door(self): |
95
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
378 self.set_data('door', "open") |
86
593bddfacf18
Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
78
diff
changeset
|
379 self.set_interact("open") |
55
2e2f6ff54780
Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents:
41
diff
changeset
|
380 |
63
3087be3463e0
Some framework support for better message handling
Neil Muller <neil@dip.sun.ac.za>
parents:
56
diff
changeset
|
381 def get_description(self): |
95
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
382 if self.get_data('door') == "open": |
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
383 return 'An open doorway leads to the rest of the ship.' |
103 | 384 elif self.get_data('door') == "ajar": |
376
41ee3fc71404
Tweaks to text and JIM background.
Jeremy Thurgood <firxen@gmail.com>
parents:
375
diff
changeset
|
385 return ("A rusty door. It can't open all the way because of a " |
41ee3fc71404
Tweaks to text and JIM background.
Jeremy Thurgood <firxen@gmail.com>
parents:
375
diff
changeset
|
386 "chain on the other side.") |
95
7590586180f5
door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
94
diff
changeset
|
387 return 'A rusty door. It is currently closed.' |
63
3087be3463e0
Some framework support for better message handling
Neil Muller <neil@dip.sun.ac.za>
parents:
56
diff
changeset
|
388 |
41
ad6f56bfa8b7
Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents:
39
diff
changeset
|
389 |
89
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
390 class CryoComputer(Thing): |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
391 "Computer in the cryo room." |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
392 |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
393 NAME = "cryo.computer" |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
394 |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
395 INTERACTS = { |
189
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
396 "info": InteractAnimated(416, 290, ["comp_info.png", "comp_info2.png"], |
105
65976205fc2d
Rough Stab at basic animation support
Neil Muller <neil@dip.sun.ac.za>
parents:
103
diff
changeset
|
397 10), |
89
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
398 "warn": InteractImage(416, 290, "comp_warn.png"), |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
399 "error": InteractImage(416, 290, "comp_error.png"), |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
400 } |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
401 |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
402 INITIAL = "info" |
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
403 |
189
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
404 def interact_without(self): |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
405 return Result(detail_view='cryo_comp_detail') |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
406 |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
407 def interact_with_titanium_leg(self, item): |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
408 return Result("Hitting it with the leg accomplishes nothing.") |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
409 |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
410 def get_description(self): |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
411 return "A computer terminal, with some text on it." |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
412 |
89
4625efe69c37
Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
87
diff
changeset
|
413 |
125
d3ca34a664fd
Some detail view and data cleanup.
Jeremy Thurgood <firxen@gmail.com>
parents:
120
diff
changeset
|
414 class TitaniumLegThing(Thing): |
119
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
415 "Triangle in the cryo room." |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
416 |
125
d3ca34a664fd
Some detail view and data cleanup.
Jeremy Thurgood <firxen@gmail.com>
parents:
120
diff
changeset
|
417 NAME = "cryo.titanium_leg" |
119
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
418 |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
419 INTERACTS = { |
232
ca490aecbe0e
Updated cryo unit to use new stuff. No more triangles! (Except for the ones that are still there.)
Jeremy Thurgood <firxen@gmail.com>
parents:
228
diff
changeset
|
420 "leg": InteractImage(180, 132, "leg.png"), |
119
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
421 } |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
422 |
134
faac82748f5a
Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents:
133
diff
changeset
|
423 INITIAL = "leg" |
119
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
424 |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
425 def interact_without(self): |
134
faac82748f5a
Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents:
133
diff
changeset
|
426 self.state.add_inventory_item('titanium_leg') |
540 | 427 self.state.current_scene.things['cryo.unit.1'].set_data( |
428 'contains_titanium_leg', False) | |
134
faac82748f5a
Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents:
133
diff
changeset
|
429 self.scene.remove_thing(self) |
540 | 430 return Result("The skeletal occupant of this cryo unit has an" |
431 " artificial femur made of titanium. You take it.") | |
119
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
432 |
136
d264850806dc
Better description handling in detail windows. (Sort of.)
Jeremy Thurgood <firxen@gmail.com>
parents:
135
diff
changeset
|
433 def get_description(self): |
d264850806dc
Better description handling in detail windows. (Sort of.)
Jeremy Thurgood <firxen@gmail.com>
parents:
135
diff
changeset
|
434 return "This femur looks synthetic." |
d264850806dc
Better description handling in detail windows. (Sort of.)
Jeremy Thurgood <firxen@gmail.com>
parents:
135
diff
changeset
|
435 |
353
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
436 |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
437 class PlaqueThing(Thing): |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
438 "Plaque on the detailed cryo chamber" |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
439 |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
440 NAME = "cryo.plaque" |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
441 |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
442 INTERACTS = { |
232
ca490aecbe0e
Updated cryo unit to use new stuff. No more triangles! (Except for the ones that are still there.)
Jeremy Thurgood <firxen@gmail.com>
parents:
228
diff
changeset
|
443 "plaque": InteractNoImage(60, 40, 35, 24), |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
444 } |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
445 |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
446 INITIAL = "plaque" |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
447 |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
448 def interact_without(self): |
422 | 449 return Result("The plaque is welded to the unit. You can't shift it.") |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
450 |
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
451 def get_description(self): |
376
41ee3fc71404
Tweaks to text and JIM background.
Jeremy Thurgood <firxen@gmail.com>
parents:
375
diff
changeset
|
452 return "'Prisoner 98CC-764E646391EE. War crimes. 45 years." |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
453 |
353
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
454 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
455 class FullBottle(Item): |
363
2cadb47405a4
Use bottle image. The boomslang is now triangle-free
Stefano Rivera <stefano@rivera.za.net>
parents:
362
diff
changeset
|
456 INVENTORY_IMAGE = 'bottle_full.png' |
2cadb47405a4
Use bottle image. The boomslang is now triangle-free
Stefano Rivera <stefano@rivera.za.net>
parents:
362
diff
changeset
|
457 CURSOR = CursorSprite('bottle_full_cursor.png', 27, 7) |
353
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
458 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
459 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
460 class CryoPools(Thing): |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
461 "Handy for cooling engines" |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
462 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
463 NAME = 'cryo.pool' |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
464 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
465 INTERACTS = { |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
466 'pools': InteractRectUnion(( |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
467 (444, 216, 125, 67), |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
468 (44, 133, 74, 107), |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
469 (485, 396, 97, 34), |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
470 )), |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
471 } |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
472 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
473 INITIAL = 'pools' |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
474 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
475 def get_description(self): |
422 | 476 return "Coolant leaks disturbingly from the bulkheads." |
353
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
477 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
478 def interact_without(self): |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
479 return Result("It's gooey") |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
480 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
481 def interact_with_detergent_bottle(self, item): |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
482 full = FullBottle('full_detergent_bottle') |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
483 self.state.add_item(full) |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
484 self.state.replace_inventory_item(item.name, full.name) |
422 | 485 return Result("You scoop up some coolant and fill the bottle.") |
353
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
486 |
b61dccc7fb42
Detergent + cryo fluid puzzle (currently triangular)
Stefano Rivera <stefano@rivera.za.net>
parents:
348
diff
changeset
|
487 |
189
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
488 class CryoCompDetail(Scene): |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
489 |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
490 FOLDER = "cryo" |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
491 BACKGROUND = "comp_info_detail.png" |
433 | 492 BACKGROUND_FIXED = "comp_info_detail_fixed.png" |
189
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
493 NAME = "cryo_comp_detail" |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
494 |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
495 def __init__(self, state): |
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
496 super(CryoCompDetail, self).__init__(state) |
433 | 497 self._background_fixed = get_image(self.FOLDER, self.BACKGROUND_FIXED) |
498 | |
499 def draw_background(self, surface): | |
500 if self.state.scenes['engine'].get_data('engine online'): | |
501 surface.blit(self._background_fixed, self.OFFSET, None) | |
502 else: | |
503 surface.blit(self._background, self.OFFSET, None) | |
189
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
504 |
119
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
505 |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
506 class CryoUnitWithCorpse(Scene): |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
507 |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
508 FOLDER = "cryo" |
127
9646e7c8bb97
Size detail window based on the Scene background image.
Jeremy Thurgood <firxen@gmail.com>
parents:
125
diff
changeset
|
509 BACKGROUND = "cryo_unit_detail.png" |
119
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
510 NAME = "cryo_detail" |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
511 |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
512 def __init__(self, state): |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
513 super(CryoUnitWithCorpse, self).__init__(state) |
125
d3ca34a664fd
Some detail view and data cleanup.
Jeremy Thurgood <firxen@gmail.com>
parents:
120
diff
changeset
|
514 self.add_thing(TitaniumLegThing()) |
157
153dcb313057
Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents:
148
diff
changeset
|
515 self.add_thing(PlaqueThing()) |
119
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
516 |
d5f7cccfdb6c
Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents:
118
diff
changeset
|
517 |
28
0f25f7b9b37a
Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff
changeset
|
518 SCENES = [Cryo] |
189
c18ef647ffe6
Add detail view for cryo screen. Tweak animation
Neil Muller <neil@dip.sun.ac.za>
parents:
183
diff
changeset
|
519 DETAIL_VIEWS = [CryoUnitWithCorpse, CryoCompDetail] |