annotate gamelib/scenes/cryo.py @ 183:829551aad0f1

Add some flavour descriptions
author Neil Muller <neil@dip.sun.ac.za>
date Wed, 25 Aug 2010 15:46:03 +0200
parents 5cb3fbe61f75
children c18ef647ffe6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
141
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
4 from albow.music import change_playlist, get_music, PlayList
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
5
135
b43599b7f8a2 Cursor highlights
Stefano Rivera <stefano@rivera.za.net>
parents: 134
diff changeset
6 from gamelib import speech
141
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
7 from gamelib.sound import get_sound
135
b43599b7f8a2 Cursor highlights
Stefano Rivera <stefano@rivera.za.net>
parents: 134
diff changeset
8 from gamelib.cursor import CursorSprite
86
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
9 from gamelib.state import Scene, Item, Thing, Result, \
105
65976205fc2d Rough Stab at basic animation support
Neil Muller <neil@dip.sun.ac.za>
parents: 103
diff changeset
10 InteractImage, InteractNoImage, InteractRectUnion, \
65976205fc2d Rough Stab at basic animation support
Neil Muller <neil@dip.sun.ac.za>
parents: 103
diff changeset
11 InteractAnimated
182
5cb3fbe61f75 Add genric thing with description helper class
Neil Muller <neil@dip.sun.ac.za>
parents: 180
diff changeset
12 from gamelib.statehelpers import GenericDescThing
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
13 from gamelib.constants import DEBUG
39
088a101f5b94 Add an example Thing to cryo scene.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 35
diff changeset
14
28
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
15
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
16 class Cryo(Scene):
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
17
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
18 FOLDER = "cryo"
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
19 BACKGROUND = "cryo_room.png"
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
20
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
21 INITIAL_DATA = {
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
22 'accessible': True,
120
48d24a48d0ce Enter and leave hooks
Neil Muller <neil@dip.sun.ac.za>
parents: 119
diff changeset
23 'greet' : True
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
24 }
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
25
141
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
26 # 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
27 MUSIC = [
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
28 'drip1.ogg',
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
29 'drip2.ogg',
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
30 'creaking.ogg',
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
31 'silent.ogg',
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
32 'silent.ogg',
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
33 ]
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
34
28
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
35 def __init__(self, state):
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
36 super(Cryo, self).__init__(state)
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
37 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
38 self.add_thing(CryoUnitAlpha())
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
39 self.add_thing(CryoRoomDoor())
89
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
40 self.add_thing(CryoComputer())
183
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
41 # Flavour items
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
42 # pipes
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
43 self.add_thing(GenericDescThing('cryo.pipes', 1,
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
44 "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
45 (
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
46 (552, 145, 129, 66),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
47 (621, 191, 69, 227),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
48 (636, 82, 165, 60),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
49 (756, 127, 52, 393),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
50 (140, 135, 112, 73),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
51 (125, 192, 27, 258),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
52 (11, 63, 140, 67),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
53 (2, 130, 44, 394),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
54 )))
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
55 # leaks
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
56 self.add_thing(GenericDescThing('cryo.leaks', 2,
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
57 "Fluid leaks disturbingly from the bulkheads",
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
58 (
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
59 (444, 216, 125, 67),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
60 (44, 133, 74, 107),
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
61 )))
829551aad0f1 Add some flavour descriptions
Neil Muller <neil@dip.sun.ac.za>
parents: 182
diff changeset
62 # cryo units
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
63 self.add_thing(GenericCryoUnit(2,
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
64 "An empty cryo chamber.",
180
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
65 "Prisoner 81e4-c8900480e635. Embezzlement. 20 years.",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
66 (
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
67 (155, 430, 50, 35),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
68 (125, 450, 60, 35),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
69 (95, 470, 60, 35),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
70 (55, 490, 60, 55),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
71 )))
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
72 self.add_thing(GenericCryoUnit(3,
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
73 "A working cryo chamber. The frosted glass obscures the details of the occupant.",
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
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 )))
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
81 self.add_thing(GenericCryoUnit(4,
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
82 "A broken cryo chamber. The skeleton inside has been picked clean.",
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
83 "Prisoner bfbc-8bf4c6b7492b. Importing illegal alien biomatter. 15 years.",
180
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
84 (
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
85 (275, 430, 50, 70),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
86 (255, 460, 50, 70),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
87 (235, 490, 50, 60),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
88 )))
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
89 self.add_thing(GenericCryoUnit(5,
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
90 "A working cryo chamber. The frosted glass obscures the details of the occupant.",
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
91 "Prisoner b520-99495b8c41ce. Copyright infringment. 60 years.",
180
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
92 (
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
93 (340, 430, 50, 70),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
94 (330, 500, 60, 50),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
95 )))
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
96 self.add_thing(GenericCryoUnit(6,
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
97 "An empty cryo unit. Recently filled by you.",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
98 "Prisoner 84c7-d10dcfda0878. Safe cracker. 30 years.",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
99 (
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
100 (399, 426, 70, 56),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
101 (404, 455, 69, 120),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
102 )))
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
103 self.add_thing(GenericCryoUnit(7,
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
104 "An empty cryo unit.",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
105 "Prisoner 83f1-ce32d3234749. Spammer. 5 years",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
106 (
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
107 (472, 432, 58, 51),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
108 (488, 455, 41, 134),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
109 (517, 487, 42, 93),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
110 )))
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
111 self.add_thing(GenericCryoUnit(8,
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
112 "An empty cryo unit.",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
113 "Prisoner 48af-a455-9df9f43c43e5. Medical Malpractice. 10 years.",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
114 (
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
115 (596, 419, 69, 39),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
116 (616, 442, 82, 40),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
117 (648, 467, 84, 37),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
118 (681, 491, 97, 60),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
119 )))
35
ebc76bc0c067 First item!
Simon Cross <hodgestar+bzr@gmail.com>
parents: 28
diff changeset
120
120
48d24a48d0ce Enter and leave hooks
Neil Muller <neil@dip.sun.ac.za>
parents: 119
diff changeset
121 def enter(self):
141
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
122 # Setup music
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
123 pieces = [get_music(x, prefix='sounds') for x in self.MUSIC]
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
124 background_playlist = PlayList(pieces, random=True, repeat=True)
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
125 change_playlist(background_playlist)
120
48d24a48d0ce Enter and leave hooks
Neil Muller <neil@dip.sun.ac.za>
parents: 119
diff changeset
126 if self.get_data('greet'):
48d24a48d0ce Enter and leave hooks
Neil Muller <neil@dip.sun.ac.za>
parents: 119
diff changeset
127 self.set_data('greet', False)
180
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
128 return Result("Greetings Prisoner 84c7-d10dcfda0878. You have woken early under"
120
48d24a48d0ce Enter and leave hooks
Neil Muller <neil@dip.sun.ac.za>
parents: 119
diff changeset
129 " the terms of the emergency conscription act to help with"
48d24a48d0ce Enter and leave hooks
Neil Muller <neil@dip.sun.ac.za>
parents: 119
diff changeset
130 " repairs to the ship. Your behaviour during this time will"
48d24a48d0ce Enter and leave hooks
Neil Muller <neil@dip.sun.ac.za>
parents: 119
diff changeset
131 " be added to your record and will be relayed to "
48d24a48d0ce Enter and leave hooks
Neil Muller <neil@dip.sun.ac.za>
parents: 119
diff changeset
132 " prison officials when we reach the destination."
48d24a48d0ce Enter and leave hooks
Neil Muller <neil@dip.sun.ac.za>
parents: 119
diff changeset
133 " Please report to the bridge.")
35
ebc76bc0c067 First item!
Simon Cross <hodgestar+bzr@gmail.com>
parents: 28
diff changeset
134
141
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
135 def leave(self):
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
136 # Stop music
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
137 change_playlist(None)
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
138
35
ebc76bc0c067 First item!
Simon Cross <hodgestar+bzr@gmail.com>
parents: 28
diff changeset
139
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
140 class TitaniumLeg(Item):
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
141 "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
142
91
542ede2896bb Link in femur inventory image.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 89
diff changeset
143 INVENTORY_IMAGE = "titanium_femur.png"
135
b43599b7f8a2 Cursor highlights
Stefano Rivera <stefano@rivera.za.net>
parents: 134
diff changeset
144 CURSOR = CursorSprite('titanium_femur_cursor.png', 47, 3)
28
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
145
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
146
39
088a101f5b94 Add an example Thing to cryo scene.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 35
diff changeset
147 class CryoUnitAlpha(Thing):
67
6b0f7364f3bf Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents: 63
diff changeset
148 "Cryo unit containing titanium leg."
6b0f7364f3bf Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents: 63
diff changeset
149
86
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
150 NAME = "cryo.unit.1"
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
151
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
152 INTERACTS = {
133
0530547a131f Better map handling, detail_view stuff in Result.
Jeremy Thurgood <firxen@gmail.com>
parents: 131
diff changeset
153 "unit": InteractRectUnion((
180
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
154 (531, 430, 64, 49),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
155 (560, 460, 57, 47),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
156 (583, 482, 65, 69),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
157 (600, 508, 71, 48),
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
158 ))
86
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
159 }
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
160
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
161 INITIAL = "unit"
67
6b0f7364f3bf Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents: 63
diff changeset
162
6b0f7364f3bf Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents: 63
diff changeset
163 INITIAL_DATA = {
6b0f7364f3bf Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents: 63
diff changeset
164 'contains_titanium_leg': True,
6b0f7364f3bf Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents: 63
diff changeset
165 }
6b0f7364f3bf Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents: 63
diff changeset
166
6b0f7364f3bf Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents: 63
diff changeset
167 def interact_without(self):
134
faac82748f5a Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents: 133
diff changeset
168 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
169
180
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
170 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
171 return Result("You hit the chamber that used to hold this very leg. Nothing happens as a result.")
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
172
94
ce23fad8ecb3 More complex shaped interactables
Neil Muller <neil@dip.sun.ac.za>
parents: 91
diff changeset
173 def get_description(self):
ce23fad8ecb3 More complex shaped interactables
Neil Muller <neil@dip.sun.ac.za>
parents: 91
diff changeset
174 if self.get_data('contains_titanium_leg'):
180
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
175 return "A broken cryo chamber, with a poor unfortunate corpse inside."
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
176 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
177
180
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
178
182
5cb3fbe61f75 Add genric thing with description helper class
Neil Muller <neil@dip.sun.ac.za>
parents: 180
diff changeset
179 class GenericCryoUnit(GenericDescThing):
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
180 "Generic Cryo unit"
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
181
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
182 def __init__(self, number, description, detailed_description, areas):
182
5cb3fbe61f75 Add genric thing with description helper class
Neil Muller <neil@dip.sun.ac.za>
parents: 180
diff changeset
183 super(GenericCryoUnit, self).__init__('cryo.unit', number, description, areas)
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
184 self.detailed_description = detailed_description
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
185
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
186 def interact_without(self):
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
187 return Result(self.detailed_description)
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
188
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
189 def get_description(self):
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
190 return self.description
94
ce23fad8ecb3 More complex shaped interactables
Neil Muller <neil@dip.sun.ac.za>
parents: 91
diff changeset
191
180
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
192 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
193 return Result(random.choice([
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
194 "You bang on the chamber with the titanium femur. Nothing much happens",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
195 "Hitting the cryo unit with the femur doesn't achieve anything",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
196 "You hit the chamber with the femur. Nothing happens.",
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
197 ]))
6b3ccee6f3f9 Fill in more flavour for cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 167
diff changeset
198
39
088a101f5b94 Add an example Thing to cryo scene.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 35
diff changeset
199
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
200 class CryoRoomDoor(Thing):
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
201 "Door to the cryo room."
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
202
86
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
203 NAME = "cryo.door"
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
204
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
205 INTERACTS = {
95
7590586180f5 door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 94
diff changeset
206 "shut": InteractNoImage(290, 260, 99, 152),
87
4c6fea1b242b Fix interact positions.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 86
diff changeset
207 "ajar": InteractImage(290, 260, "door_ajar.png"),
4c6fea1b242b Fix interact positions.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 86
diff changeset
208 "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
209 }
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
210
95
7590586180f5 door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 94
diff changeset
211 INITIAL = "shut"
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
212
55
2e2f6ff54780 Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents: 41
diff changeset
213 INITIAL_DATA = {
95
7590586180f5 door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 94
diff changeset
214 'door': "shut",
55
2e2f6ff54780 Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents: 41
diff changeset
215 }
2e2f6ff54780 Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents: 41
diff changeset
216
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
217 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
218 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
219 self.open_door()
7590586180f5 door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 94
diff changeset
220 return Result("You wedge the titanium femur into the chain and twist. With a satisfying *snap*, the chain breaks and the door opens.")
118
e548f4a13741 Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents: 109
diff changeset
221 elif self.get_data('door') == "shut":
109
66898d810247 Add hackish speech support (run regen-speech.py to generate files -- needs espeak and oggenc).
Simon Cross <simon@simonx>
parents: 105
diff changeset
222 text = "You bang on the door with the titanium femur. It makes a clanging sound."
66898d810247 Add hackish speech support (run regen-speech.py to generate files -- needs espeak and oggenc).
Simon Cross <simon@simonx>
parents: 105
diff changeset
223 speech.say(self.name, text)
141
4f18e68fd0dc Add a few sounds to the cryo room
Neil Muller <neil@dip.sun.ac.za>
parents: 136
diff changeset
224 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
225 else:
e548f4a13741 Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents: 109
diff changeset
226 return Result("You wave the femur in the doorway. Nothing happens.")
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
227
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
228 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
229 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
230 self.half_open_door()
118
e548f4a13741 Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents: 109
diff changeset
231 if self.get_data('door') != "open":
e548f4a13741 Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents: 109
diff changeset
232 return Result("It moves slightly and then stops. A chain on the other side is preventing it from opening completely.")
e548f4a13741 Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents: 109
diff changeset
233 else:
131
97c5ff0a05bb Hook up map.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 129
diff changeset
234 self.state.set_current_scene('map')
144
29ba5456e8b3 Removed a bunch of cruft.
Jeremy Thurgood <firxen@gmail.com>
parents: 141
diff changeset
235 return None
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
236
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
237 def interact_default(self, item):
78
6bfebfbce42e Partial message support
Neil Muller <neil@dip.sun.ac.za>
parents: 67
diff changeset
238 return Result(random.choice([
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
239 "Sadly, this isn't that sort of game.",
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
240 "Your valiant efforts are foiled by the Evil Game Designer.",
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
241 "The door resists. Try something else, perhaps?",
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
242 ]))
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
243
56
75bf3d3689e9 Refactor thing interactivity and add "fake" bridge scene.
Jeremy Thurgood <firxen@gmail.com>
parents: 55
diff changeset
244 def is_interactive(self):
118
e548f4a13741 Add a transition, on general principles
Neil Muller <neil@dip.sun.ac.za>
parents: 109
diff changeset
245 return True
95
7590586180f5 door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 94
diff changeset
246
7590586180f5 door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 94
diff changeset
247 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
248 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
249 self.set_interact("ajar")
56
75bf3d3689e9 Refactor thing interactivity and add "fake" bridge scene.
Jeremy Thurgood <firxen@gmail.com>
parents: 55
diff changeset
250
55
2e2f6ff54780 Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents: 41
diff changeset
251 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
252 self.set_data('door', "open")
86
593bddfacf18 Refactor Things a bit to render images.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 78
diff changeset
253 self.set_interact("open")
55
2e2f6ff54780 Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents: 41
diff changeset
254 self.state.scenes['bridge'].set_data('accessible', True)
147
a039d3b81b3d Deselect tools and get to the Mess.
Jeremy Thurgood <firxen@gmail.com>
parents: 144
diff changeset
255 self.state.scenes['mess'].set_data('accessible', True)
55
2e2f6ff54780 Part of the cryo door puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents: 41
diff changeset
256
63
3087be3463e0 Some framework support for better message handling
Neil Muller <neil@dip.sun.ac.za>
parents: 56
diff changeset
257 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
258 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
259 return 'An open doorway leads to the rest of the ship.'
103
0f799b6f40bc Fix ajar door description
Neil Muller <neil@dip.sun.ac.za>
parents: 95
diff changeset
260 elif self.get_data('door') == "ajar":
95
7590586180f5 door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 94
diff changeset
261 return "A rusty door. It can't open all the way because of a chain on the other side."
7590586180f5 door goes from shut to ajar to open
Adrianna Pińska <adrianna.pinska@gmail.com>
parents: 94
diff changeset
262 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
263
41
ad6f56bfa8b7 Cryo door, titanium leg and some interaction prototypes.
Jeremy Thurgood <firxen@gmail.com>
parents: 39
diff changeset
264
89
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
265 class CryoComputer(Thing):
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
266 "Computer in the cryo room."
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
267
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
268 NAME = "cryo.computer"
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
269
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
270 INTERACTS = {
105
65976205fc2d Rough Stab at basic animation support
Neil Muller <neil@dip.sun.ac.za>
parents: 103
diff changeset
271 "info": InteractAnimated(416, 290, ["comp_info.png", "comp_warn.png"],
65976205fc2d Rough Stab at basic animation support
Neil Muller <neil@dip.sun.ac.za>
parents: 103
diff changeset
272 10),
89
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
273 "warn": InteractImage(416, 290, "comp_warn.png"),
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
274 "error": InteractImage(416, 290, "comp_error.png"),
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
275 }
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
276
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
277 INITIAL = "info"
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
278
4625efe69c37 Hook up cryo computer.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 87
diff changeset
279
125
d3ca34a664fd Some detail view and data cleanup.
Jeremy Thurgood <firxen@gmail.com>
parents: 120
diff changeset
280 class TitaniumLegThing(Thing):
119
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
281 "Triangle in the cryo room."
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
282
125
d3ca34a664fd Some detail view and data cleanup.
Jeremy Thurgood <firxen@gmail.com>
parents: 120
diff changeset
283 NAME = "cryo.titanium_leg"
119
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
284
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
285 INTERACTS = {
134
faac82748f5a Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents: 133
diff changeset
286 "leg": InteractImage(50, 50, "triangle.png"),
119
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
287 }
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
288
134
faac82748f5a Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents: 133
diff changeset
289 INITIAL = "leg"
119
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
290
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
291 def interact_without(self):
134
faac82748f5a Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents: 133
diff changeset
292 self.state.add_inventory_item('titanium_leg')
faac82748f5a Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents: 133
diff changeset
293 self.state.current_scene.things['cryo.unit.1'].set_data('contains_titanium_leg', False)
faac82748f5a Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents: 133
diff changeset
294 self.scene.remove_thing(self)
faac82748f5a Put the leg inside the cryo unit.
Jeremy Thurgood <firxen@gmail.com>
parents: 133
diff changeset
295 return Result("The skeletal occupant of this cryo unit has an artificial femur made of titanium. You take it.")
119
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
296
136
d264850806dc Better description handling in detail windows. (Sort of.)
Jeremy Thurgood <firxen@gmail.com>
parents: 135
diff changeset
297 def get_description(self):
d264850806dc Better description handling in detail windows. (Sort of.)
Jeremy Thurgood <firxen@gmail.com>
parents: 135
diff changeset
298 return "This femur looks synthetic."
d264850806dc Better description handling in detail windows. (Sort of.)
Jeremy Thurgood <firxen@gmail.com>
parents: 135
diff changeset
299
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
300 class PlaqueThing(Thing):
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
301 "Plaque on the detailed cryo chamber"
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
302
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
303 NAME = "cryo.plaque"
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
304
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
305 INTERACTS = {
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
306 "plaque": InteractImage(150, 150, "triangle.png"),
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
307 }
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
308
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
309 INITIAL = "plaque"
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
310
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
311 def interact_without(self):
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
312 return Result("The plaque is welded to the unit. You can't shift it")
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
313
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
314 def get_description(self):
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
315 return "'Prisoner 98cc-764e646391ee. War crimes. 45 years."
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
316
119
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
317
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
318 class CryoUnitWithCorpse(Scene):
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
319
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
320 FOLDER = "cryo"
127
9646e7c8bb97 Size detail window based on the Scene background image.
Jeremy Thurgood <firxen@gmail.com>
parents: 125
diff changeset
321 BACKGROUND = "cryo_unit_detail.png"
119
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
322 NAME = "cryo_detail"
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
323
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
324 SIZE = (300, 300)
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
325
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
326 def __init__(self, state):
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
327 super(CryoUnitWithCorpse, self).__init__(state)
125
d3ca34a664fd Some detail view and data cleanup.
Jeremy Thurgood <firxen@gmail.com>
parents: 120
diff changeset
328 self.add_thing(TitaniumLegThing())
157
153dcb313057 Fill in more cryo room stuff
Neil Muller <neil@dip.sun.ac.za>
parents: 148
diff changeset
329 self.add_thing(PlaqueThing())
119
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
330
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
331
28
0f25f7b9b37a Add loading of initial state.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
diff changeset
332 SCENES = [Cryo]
119
d5f7cccfdb6c Hook up "detail view" scenes.
Jeremy Thurgood <firxen@gmail.com>
parents: 118
diff changeset
333 DETAIL_VIEWS = [CryoUnitWithCorpse]