Mercurial > skaapsteker
annotate skaapsteker/sprites/items.py @ 526:5613f7b61b23
Stop Sasuke falling off the world
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 23:47:58 +0200 |
parents | 8087e95ade2f |
children | 0ffb493a6fa4 |
rev | line source |
---|---|
474 | 1 from .. import engine, data |
442
a084af91d5dc
Make breakable items break
Neil Muller <drnlmuller@gmail.com>
parents:
434
diff
changeset
|
2 from .base import Item, PC_LAYER, PROJECTILE_LAYER |
a084af91d5dc
Make breakable items break
Neil Muller <drnlmuller@gmail.com>
parents:
434
diff
changeset
|
3 |
474 | 4 import time |
5 | |
127 | 6 |
7 | |
388 | 8 def notify(text): |
9 engine.OpenNotification.post(text=text) | |
10 | |
11 | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
12 class BreakableItem(Item): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
13 whole_image_file = None |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
14 broken_image_file = None |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
15 |
442
a084af91d5dc
Make breakable items break
Neil Muller <drnlmuller@gmail.com>
parents:
434
diff
changeset
|
16 collides_with = set([PC_LAYER, PROJECTILE_LAYER]) |
a084af91d5dc
Make breakable items break
Neil Muller <drnlmuller@gmail.com>
parents:
434
diff
changeset
|
17 |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
18 def setup(self, broken, **opts): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
19 super(BreakableItem, self).setup(**opts) |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
20 self.broken = broken |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
21 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
22 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
23 def setup_image_data(self, pos): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
24 self.image_file = self.broken_image_file if self._me.broken else self.whole_image_file |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
25 super(BreakableItem, self).setup_image_data(pos) |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
26 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
27 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
28 def smash(self): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
29 self._me.broken = True |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
30 self.broken = True |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
31 self.setup_image_data(self._starting_tile_pos) |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
32 |
442
a084af91d5dc
Make breakable items break
Neil Muller <drnlmuller@gmail.com>
parents:
434
diff
changeset
|
33 def damage(self, damage): |
a084af91d5dc
Make breakable items break
Neil Muller <drnlmuller@gmail.com>
parents:
434
diff
changeset
|
34 self.smash() |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
35 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
36 |
335 | 37 ################################################## |
38 # Collectibles | |
39 | |
40 class Aburage(Item): | |
397 | 41 image_file = 'props/tofu.png' |
335 | 42 |
43 def player_action(self, player): | |
44 player.eat_aburage() | |
45 self.remove() | |
46 | |
47 | |
340 | 48 class HaikuScroll(Item): |
397 | 49 image_file = 'props/haiku-scroll.png' |
340 | 50 |
51 def player_action(self, player): | |
52 player.collect_scroll(self) | |
522
4de4f94c326d
Move skaapsteker behind stuff and make haiku scrolls display text on collection.
Jeremy Thurgood <firxen@gmail.com>
parents:
518
diff
changeset
|
53 notify("The scroll looks like a fragment of a haiku: '%s'" % self.text) |
340 | 54 self.remove() |
55 | |
56 | |
57 def setup(self, text, **opts): | |
58 super(HaikuScroll, self).setup(**opts) | |
59 self.text = text | |
60 | |
61 | |
335 | 62 |
63 ################################################## | |
64 # Monk tea mission | |
65 | |
189
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
66 class TeaCup(Item): |
397 | 67 image_file = 'props/teacup_empty.png' |
189
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
68 |
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
69 |
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
70 class TeaLeaf(Item): |
397 | 71 image_file = 'props/tealeaf.png' |
127 | 72 |
189
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
73 |
191 | 74 class TeaCupFull(Item): |
397 | 75 image_file = 'props/teacup_full.png' |
191 | 76 |
77 | |
189
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
78 class TeaPot(Item): |
397 | 79 image_file = 'props/teapot.png' |
237
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
80 |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
81 def setup(self, brewed, **opts): |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
82 super(TeaPot, self).setup(**opts) |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
83 |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
84 |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
85 def player_action(self, player): |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
86 if player.has_item('tealeaf'): |
335 | 87 self._me.brewed = True |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
88 player.discard_item() |
388 | 89 notify("A nice cup of tea is brewing.") |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
90 return |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
91 if player.has_item('teacup'): |
335 | 92 if self._me.brewed: |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
93 player.discard_item() |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
94 player.take_item_by_name('teacupfull') |
335 | 95 self._me.brewed = False |
403 | 96 notify("You pour a cup of tea.") |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
97 else: |
388 | 98 notify("Sadly, the teapot is empty.") |
383 | 99 return |
388 | 100 notify("A proper tea ceremony requires a cup.") |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
101 |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
102 |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
103 |
335 | 104 ################################################## |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
105 # Guard seduction |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
106 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
107 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
108 class Fan(Item): |
397 | 109 image_file = 'props/fan.png' |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
110 |
395 | 111 def player_action(self, player): |
112 player.get_fan(self) | |
113 | |
114 | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
115 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
116 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
117 # Samurai distraction |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
118 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
119 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
120 class Kindling(Item): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
121 image_file = 'props/kindling.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
122 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
123 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
124 class Oil(Item): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
125 image_file = 'props/oil.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
126 |
412 | 127 |
128 class SignalFire(Item): | |
432
e65f6783a9f7
placed fire on the road; animation not yet hooked up
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
417
diff
changeset
|
129 image_file = 'props/signal_fire/signal_fire_unlit.png' |
412 | 130 |
474 | 131 animation_files = ['props/signal_fire/signal_fire_lit01.png', |
132 'props/signal_fire/signal_fire_lit02.png', | |
133 'props/signal_fire/signal_fire_lit03.png', | |
134 'props/signal_fire/signal_fire_lit04.png'] | |
135 | |
136 wants_updates = True | |
137 | |
412 | 138 def setup(self, litness, **opts): |
139 super(SignalFire, self).setup(**opts) | |
474 | 140 self._last_time = None |
141 self._frame = 0 | |
142 self.animations = [data.load_image(self.image_dir + x) for x in self.animation_files] | |
412 | 143 |
144 | |
145 def player_action(self, player): | |
146 if self._me.litness == 'set': | |
147 if player.has_item('kindling'): | |
417 | 148 notify("You put the kindling in the signal fire.") |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
149 self._me.litness = 'kindled' |
412 | 150 elif player.has_item('oil'): |
417 | 151 notify("You pour the oil on the signal fire.") |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
152 self._me.litness = 'oiled' |
412 | 153 else: |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
154 notify("This signal fire needs some oil and kindling before it can be lit.") |
412 | 155 return |
156 player.discard_item() | |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
157 |
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
158 elif self._me.litness in ['oiled', 'kindled']: |
412 | 159 if player.has_item('kindling'): |
417 | 160 notify("You put the kindling on the signal fire and light it.") |
412 | 161 elif player.has_item('oil'): |
417 | 162 notify("You pour the oil on the signal fire and light it.") |
412 | 163 else: |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
164 if self._me.litness == 'oiled': |
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
165 notify("This fire still needs some kindling before it can be lit.") |
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
166 else: |
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
167 notify("This fire still needs some oil before it can be lit.") |
412 | 168 return |
169 player.discard_item() | |
170 self._me.litness = 'burning' | |
171 self.world.missions.fire_started_on_road = True | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
172 |
474 | 173 def update(self): |
174 if self._me.litness != 'burning': | |
175 return | |
176 if self._last_time is None: | |
177 self._last_time = time.time() | |
178 return | |
179 if time.time() - self._last_time > 0.1: | |
180 self._last_time = time.time() | |
181 self._frame += 1 | |
182 if self._frame >= len(self.animations): | |
183 self._frame = 0 | |
184 pos = self.rect.midbottom | |
185 self.image = self.animations[self._frame] | |
186 self.rect = self.image.get_rect(midbottom=pos) | |
187 self.collide_rect = self.rect.move(0, 0) | |
188 | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
189 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
190 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
191 # Cannon destruction |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
192 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
193 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
194 class Cannon(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
195 whole_image_file = 'props/cannon-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
196 broken_image_file = 'props/cannon-broken.png' |
335 | 197 |
434
827c5d045cf5
Don't allow the cannon to be picked up
Neil Muller <drnlmuller@gmail.com>
parents:
432
diff
changeset
|
198 liftable = False |
827c5d045cf5
Don't allow the cannon to be picked up
Neil Muller <drnlmuller@gmail.com>
parents:
432
diff
changeset
|
199 |
525 | 200 def setup(self, block, **opts): |
201 super(Cannon, self).setup(**opts) | |
202 self.block = block | |
203 | |
204 def smash(self): | |
205 self._me.block = False | |
206 self.block = False | |
207 super(Cannon, self).smash() | |
208 self.world.missions.cannon_destroyed = True | |
335 | 209 |
237
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
210 |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
211 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
212 # Geisha character assassination |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
213 |
237
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
214 |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
215 class Vase(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
216 whole_image_file = 'props/vase-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
217 broken_image_file = 'props/vase-broken.png' |
297
2844edb6c1cc
Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents:
296
diff
changeset
|
218 |
2844edb6c1cc
Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents:
296
diff
changeset
|
219 |
2844edb6c1cc
Hook up maneki, kaneda2 and the fishmonger who were hiding in limbo (i.e. not in game.json).
Simon Cross <hodgestar@gmail.com>
parents:
296
diff
changeset
|
220 class Salmon(Item): |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
221 image_file = 'props/fish.png' |
335 | 222 |
223 | |
224 | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
225 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
226 # Theatrical debut |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
227 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
228 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
229 class NoMask(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
230 whole_image_file = 'props/no-mask-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
231 broken_image_file = 'props/no-mask-broken.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
232 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
233 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
234 class NoCostume(Item): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
235 image_file = 'props/no-costume.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
236 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
237 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
238 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
239 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
240 # Big business |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
241 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
242 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
243 class Rice(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
244 whole_image_file = 'props/rice-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
245 broken_image_file = 'props/rice-broken.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
246 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
247 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
248 class Documents(Item): |
518
be1333278d5b
proper image for document
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
515
diff
changeset
|
249 image_file = 'props/documents.png' |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
250 |
470 | 251 ################################################## |
252 # Tails | |
253 | |
254 class Tail(Item): | |
255 | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
256 image_dir = 'icons/tails/' |
470 | 257 image_file = None |
258 tail_type = None | |
473 | 259 help_msg = None |
470 | 260 |
261 def player_action(self, player): | |
262 player.add_tail(self.tail_type) | |
473 | 263 notify(self.help_msg) |
470 | 264 self.remove() |
265 | |
266 | |
267 class ShapeshiftTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
268 image_file = 'shapeshift.png' |
470 | 269 tail_type = 'shapeshift' |
473 | 270 help_msg = "Shapeshifting tail. Press C to shape shift." \ |
271 " Your powers are more limited while in human form." | |
470 | 272 |
273 | |
274 class FireballTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
275 image_file = 'fireball.png' |
470 | 276 tail_type = 'fireball' |
473 | 277 help_msg = "Fireball tail. The X attack key now shoots fireballs." |
278 | |
279 | |
280 class SprintTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
281 image_file = 'sprint.png' |
473 | 282 tail_type = 'sprint' |
283 help_msg = "Sprint tail. Double-tap the left or right arrow key to" \ | |
284 " sprint for a few seconds." | |
285 | |
286 | |
287 class InvisibilityTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
288 image_file = 'invisibility.png' |
473 | 289 tail_type = 'invisibility' |
290 help_msg = "Invisibility tail. Press V to become invisible for a few seconds." \ | |
291 " You become visible again if you attack or interact with others." | |
292 | |
293 | |
294 class FlightTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
295 image_file = 'flight.png' |
473 | 296 tail_type = 'flight' |
297 help_msg = "Flight tail. Double-tap up to fly. Press down while on the ground to land." \ | |
298 " If you stay in the air too long you'll tire and fall." | |
299 | |
300 | |
301 class ShieldTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
302 image_file = 'shield.png' |
473 | 303 tail_type = 'shield' |
304 help_msg = "Shield tail. If you get hit, your mystical shield will protect you for" \ | |
305 " one second. After that it'll need a little time to recharge." | |
306 | |
307 | |
308 class StealTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
309 image_file = 'steal.png' |
473 | 310 tail_type = 'steal' |
311 help_msg = "Life-stealing tail. If you projectiles hit your enemies, you steal some" \ | |
312 " of their life." | |
313 | |
314 | |
315 class LightningTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
316 image_file = 'lightning.png' |
473 | 317 tail_type = 'lightning' |
318 help_msg = "Lightning tail. The Z attack now shoots lightning bolts." |