Mercurial > boomslang
annotate gamelib/scenes/mess.py @ 264:3cedc4f95925
Ran pyflakes and fixed some minor things.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Fri, 27 Aug 2010 19:35:20 +0200 |
parents | 3b4a78422201 |
children | 4012d50a4674 |
rev | line source |
---|---|
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
1 """Mess where crew eat. Fun stuff.""" |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
2 |
175
3d3efc5648cc
Allow multiple cans to be picked up
Stefano Rivera <stefano@rivera.za.net>
parents:
170
diff
changeset
|
3 from random import choice |
3d3efc5648cc
Allow multiple cans to be picked up
Stefano Rivera <stefano@rivera.za.net>
parents:
170
diff
changeset
|
4 |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
252
diff
changeset
|
5 from gamelib.state import Scene, Item, CloneableItem, Thing, Result |
145 | 6 from gamelib.cursor import CursorSprite |
263
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
252
diff
changeset
|
7 from gamelib.scenes.scene_widgets import (Door, InteractText, InteractNoImage, |
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
252
diff
changeset
|
8 InteractRectUnion, InteractImage, |
3b4a78422201
Shuffled a bunch of stuff into more appropriate places.
Jeremy Thurgood <firxen@gmail.com>
parents:
252
diff
changeset
|
9 InteractAnimated, GenericDescThing) |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
10 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
11 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
12 class Mess(Scene): |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
13 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
14 FOLDER = "mess" |
140
95d882eeba12
Link up mess hall background.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
55
diff
changeset
|
15 BACKGROUND = "mess_hall.png" |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
16 |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
17 INITIAL_DATA = { |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
18 'accessible': True, |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
19 } |
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
20 |
143
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
21 def __init__(self, state): |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
22 super(Mess, self).__init__(state) |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
23 self.add_thing(CansOnShelf()) |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
24 self.add_thing(Tubes()) |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
25 self.add_thing(ToMap()) |
228
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
26 # Flavour items |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
27 # extra cans on shelf |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
28 self.add_thing(GenericDescThing('mess.cans', 1, |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
29 "A large collection of rusted, useless cans", |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
30 ( |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
31 (154, 335, 89, 106), |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
32 (152, 435, 63, 66), |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
33 ))) |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
34 self.add_thing(GenericDescThing('mess.broccoli', 2, |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
35 "An impressively overgrown broccoli.", |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
36 ( |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
37 (503, 89, 245, 282), |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
38 (320, 324, 229, 142), |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
39 ))) |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
40 self.add_thing(GenericDescThing('mess.cans', 2, |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
41 "Empty plastic containers. They used to hold dish washer soap", |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
42 ((565, 399, 62, 95),))) |
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
43 |
143
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
44 |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
45 |
221 | 46 class BaseCan(CloneableItem): |
47 """Base class for the cans""" | |
145 | 48 |
206
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
49 def interact_with_full_can(self, item, state): |
224
8d8aef45db4e
fixed some typos
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
223
diff
changeset
|
50 return Result("You bang the cans together. It sounds like two cans being banged together.", soundfile="can_hit.ogg") |
206
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
51 |
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
52 def interact_with_dented_can(self, item, state): |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
53 return self.interact_with_full_can(item, state) |
206
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
54 |
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
55 def interact_with_empty_can(self, item, state): |
219
326300c218a6
Choppable cryopipes and can refactoring.
Jeremy Thurgood <firxen@gmail.com>
parents:
218
diff
changeset
|
56 return self.interact_with_full_can(item, state) |
206
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
57 |
221 | 58 def interact_with_machete(self, item, state): |
224
8d8aef45db4e
fixed some typos
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
223
diff
changeset
|
59 return Result("You'd mangle it beyond usefulness.") |
191 | 60 |
221 | 61 |
62 class EmptyCan(BaseCan): | |
63 "After emptying the full can." | |
64 | |
65 INVENTORY_IMAGE = "empty_can.png" | |
66 CURSOR = CursorSprite('empty_can_cursor.png', 20, 30) | |
67 | |
68 def interact_with_titanium_leg(self, item, state): | |
69 return Result("Flattening the can doesn't look like a useful thing to do") | |
70 | |
71 | |
72 class FullCan(BaseCan): | |
145 | 73 "Found on the shelf." |
74 | |
75 INVENTORY_IMAGE = "full_can.png" | |
168 | 76 CURSOR = CursorSprite('full_can_cursor.png', 20, 30) |
145 | 77 |
191 | 78 def interact_with_titanium_leg(self, item, state): |
170
179913efac85
Add dented can image to item
Neil Muller <neil@dip.sun.ac.za>
parents:
168
diff
changeset
|
79 dented = DentedCan("dented_can") |
191 | 80 state.add_item(dented) |
170
179913efac85
Add dented can image to item
Neil Muller <neil@dip.sun.ac.za>
parents:
168
diff
changeset
|
81 state.replace_inventory_item(self, dented) |
206
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
82 return Result("You club the can with the femur. The can gets dented, but doesn't open.", soundfile="can_hit.ogg") |
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
83 |
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
84 |
221 | 85 class DentedCan(BaseCan): |
167
5845a3ed4dad
Inventory interaction can (surprisingly) affect the inventory
Neil Muller <neil@dip.sun.ac.za>
parents:
151
diff
changeset
|
86 "A can banged on with the femur" |
5845a3ed4dad
Inventory interaction can (surprisingly) affect the inventory
Neil Muller <neil@dip.sun.ac.za>
parents:
151
diff
changeset
|
87 |
170
179913efac85
Add dented can image to item
Neil Muller <neil@dip.sun.ac.za>
parents:
168
diff
changeset
|
88 INVENTORY_IMAGE = "dented_can.png" |
179913efac85
Add dented can image to item
Neil Muller <neil@dip.sun.ac.za>
parents:
168
diff
changeset
|
89 CURSOR = CursorSprite('dented_can_cursor.png', 20, 30) |
179913efac85
Add dented can image to item
Neil Muller <neil@dip.sun.ac.za>
parents:
168
diff
changeset
|
90 |
191 | 91 def interact_with_titanium_leg(self, item, state): |
206
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
92 return Result("You club the can with the femur. The dents shift around, but it still doesn't open.", soundfile="can_hit.ogg") |
6a52752f4920
some more interacations. Add sound to grinder
Neil Muller <neil@dip.sun.ac.za>
parents:
192
diff
changeset
|
93 |
145 | 94 |
143
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
95 class CansOnShelf(Thing): |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
96 |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
97 NAME = "mess.cans" |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
98 |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
99 INTERACTS = { |
223
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
100 '3cans': InteractImage(165, 209, 'shelf_3_cans.png'), |
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
101 '2cans': InteractImage(165, 209, 'shelf_2_cans.png'), |
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
102 '1cans': InteractImage(165, 209, 'shelf_1_can.png'), |
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
103 '0cans': InteractNoImage(165, 209, 50, 50), |
143
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
104 } |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
105 |
223
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
106 INITIAL = '3cans' |
143
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
107 |
146
1be149cc42db
Allow can to be picked up.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
145
diff
changeset
|
108 INITIAL_DATA = { |
223
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
109 'cans_available': 3, |
146
1be149cc42db
Allow can to be picked up.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
145
diff
changeset
|
110 } |
1be149cc42db
Allow can to be picked up.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
145
diff
changeset
|
111 |
1be149cc42db
Allow can to be picked up.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
145
diff
changeset
|
112 def interact_without(self): |
223
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
113 starting_cans = self.get_data('cans_available') |
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
114 if starting_cans > 0: |
192 | 115 can = FullCan("full_can") |
116 self.state.add_item(can) | |
117 self.state.add_inventory_item(can.name) | |
223
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
118 self.set_data('cans_available', starting_cans - 1) |
10d3265f0bfa
Decreasing cans on shelf
Stefano Rivera <stefano@rivera.za.net>
parents:
221
diff
changeset
|
119 self.set_interact('%icans' % (starting_cans - 1)) |
192 | 120 return Result({ |
224
8d8aef45db4e
fixed some typos
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
223
diff
changeset
|
121 3: "Best before a long time in the past. Better not eat these.", |
8d8aef45db4e
fixed some typos
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
223
diff
changeset
|
122 2: "Mmmm. Nutritious bacteria stew.", |
8d8aef45db4e
fixed some typos
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
223
diff
changeset
|
123 1: "Candied silkworms. Who stocked this place?!", |
192 | 124 }[starting_cans]) |
175
3d3efc5648cc
Allow multiple cans to be picked up
Stefano Rivera <stefano@rivera.za.net>
parents:
170
diff
changeset
|
125 else: |
192 | 126 return Result("The rest of the cans are rusted beyond usefulness.") |
146
1be149cc42db
Allow can to be picked up.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
145
diff
changeset
|
127 |
1be149cc42db
Allow can to be picked up.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
145
diff
changeset
|
128 def get_description(self): |
224
8d8aef45db4e
fixed some typos
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
223
diff
changeset
|
129 return "The contents of these cans look synthetic." |
146
1be149cc42db
Allow can to be picked up.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
145
diff
changeset
|
130 |
143
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
131 |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
132 class Tubes(Thing): |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
133 |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
134 NAME = "mess.tubes" |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
135 |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
136 INTERACTS = { |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
137 "blocked": InteractImage(250, 130, "blocking_broccoli.png"), |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
138 "broken": InteractImage(250, 183, "broken_tubes.png"), |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
139 "fixed": InteractImage(252, 183, "fixed_tubes.png"), |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
140 } |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
141 |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
142 INITIAL = "blocked" |
d15270c2898c
Hook up brocolli and cans. Rotate brocolli to correct orientation.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
140
diff
changeset
|
143 |
226 | 144 INITIAL_DATA = { |
145 "status": "blocked", | |
146 "pipes_replaced": 0, | |
147 "fixed": False, | |
148 } | |
149 | |
228
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
150 def get_description(self): |
230
ec2682b373e7
Add chopping sound. Tweak mess descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
228
diff
changeset
|
151 if self.get_data('status') == "blocked": |
ec2682b373e7
Add chopping sound. Tweak mess descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
228
diff
changeset
|
152 return "The brocolli seems to have become entangled with something" |
ec2682b373e7
Add chopping sound. Tweak mess descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
228
diff
changeset
|
153 elif self.get_data("status") == "broken": |
ec2682b373e7
Add chopping sound. Tweak mess descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
228
diff
changeset
|
154 return "These broken pipes look important." |
ec2682b373e7
Add chopping sound. Tweak mess descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
228
diff
changeset
|
155 else: |
ec2682b373e7
Add chopping sound. Tweak mess descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
228
diff
changeset
|
156 return "Your fix looks like it's holding up well." |
228
ce1e85768f7b
Flavour interactions for mess hall
Neil Muller <neil@dip.sun.ac.za>
parents:
226
diff
changeset
|
157 |
226 | 158 def interact_with_machete(self, item): |
159 if self.get_data("status") == "blocked": | |
160 self.set_data("status", "broken") | |
161 self.set_interact("broken") | |
264
3cedc4f95925
Ran pyflakes and fixed some minor things.
Jeremy Thurgood <firxen@gmail.com>
parents:
263
diff
changeset
|
162 return Result("With a flurry of disgusting mutant vegetable " |
3cedc4f95925
Ran pyflakes and fixed some minor things.
Jeremy Thurgood <firxen@gmail.com>
parents:
263
diff
changeset
|
163 "chunks, you clear the overgrown broccoli away from " |
3cedc4f95925
Ran pyflakes and fixed some minor things.
Jeremy Thurgood <firxen@gmail.com>
parents:
263
diff
changeset
|
164 "the access panel and reveal some broken tubes. " |
3cedc4f95925
Ran pyflakes and fixed some minor things.
Jeremy Thurgood <firxen@gmail.com>
parents:
263
diff
changeset
|
165 "They look important.", |
230
ec2682b373e7
Add chopping sound. Tweak mess descriptions
Neil Muller <neil@dip.sun.ac.za>
parents:
228
diff
changeset
|
166 soundfile='chopping.ogg') |
226 | 167 elif self.get_data("status") == "broken": |
168 return Result("It looks broken enough already.") | |
169 else: | |
264
3cedc4f95925
Ran pyflakes and fixed some minor things.
Jeremy Thurgood <firxen@gmail.com>
parents:
263
diff
changeset
|
170 return Result("After all that effort fixing it, chopping it to " |
3cedc4f95925
Ran pyflakes and fixed some minor things.
Jeremy Thurgood <firxen@gmail.com>
parents:
263
diff
changeset
|
171 "bits doesn't seem very smart.") |
226 | 172 |
173 def interact_with_pipe(self, item): | |
174 if self.get_data("status") == "blocked": | |
175 return Result("It would get lost in the fronds.") | |
176 else: | |
177 self.data['pipes_replaced'] += 1 | |
178 self.state.remove_inventory_item(item.name) | |
179 return Result({ | |
180 1: "The pipe slots neatly into place, but doesn't make an airtight seal.", | |
181 2: "This pipe is a little looser than the first. It definitely needs to be taped up.", | |
182 3: "The final pipe fits snugly, but won't hold under pressure.", | |
183 }[self.get_data('pipes_replaced')]) | |
184 | |
185 def interact_with_duct_tape(self, item): | |
186 if self.get_data("status") == "broken": | |
187 return Result("It would get lost in the fronds.") | |
188 elif self.get_data("fixed"): | |
189 return Result("There's quite enough tape on the ducting already.") | |
190 elif self.get_data("pipes_replaced") < 3: | |
191 return Result("All the pipes need to be in place before they can be taped up.") | |
192 else: | |
193 self.set_data("fixed", True) | |
194 self.set_data("status", "fixed") | |
195 self.set_interact("fixed") | |
196 # TODO: A less anticlimactic climax? | |
197 return Result("It takes quite a lot of tape, but eventually everything is" | |
198 " airtight and ready to hold pressure. Who'd've thought duct" | |
199 " tape could actually be used to tape ducts?") | |
200 | |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
201 |
242 | 202 class ToMap(Door): |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
203 |
252
dfc89bc64fdb
Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents:
242
diff
changeset
|
204 SCENE = "mess" |
150
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
205 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
206 INTERACTS = { |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
207 "door": InteractNoImage(20, 390, 85, 150), |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
208 } |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
209 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
210 INITIAL = "door" |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
211 |
5e5d71e40e54
Add bridge and mess to map and ways back.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
146
diff
changeset
|
212 |
47
8f1fccb8cadf
Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff
changeset
|
213 SCENES = [Mess] |