Mercurial > skaapsteker
annotate skaapsteker/sprites/items.py @ 490:0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 22:28:03 +0200 |
parents | e5c060dda22a |
children | 6c21ba7de1e6 |
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) | |
53 self.remove() | |
54 | |
55 | |
56 def setup(self, text, **opts): | |
57 super(HaikuScroll, self).setup(**opts) | |
58 self.text = text | |
59 | |
60 | |
335 | 61 |
62 ################################################## | |
63 # Monk tea mission | |
64 | |
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
|
65 class TeaCup(Item): |
397 | 66 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
|
67 |
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 class TeaLeaf(Item): |
397 | 70 image_file = 'props/tealeaf.png' |
127 | 71 |
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
|
72 |
191 | 73 class TeaCupFull(Item): |
397 | 74 image_file = 'props/teacup_full.png' |
191 | 75 |
76 | |
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
|
77 class TeaPot(Item): |
397 | 78 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
|
79 |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
80 def setup(self, brewed, **opts): |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
81 super(TeaPot, self).setup(**opts) |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
82 |
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 def player_action(self, player): |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
85 if player.has_item('tealeaf'): |
335 | 86 self._me.brewed = True |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
87 player.discard_item() |
388 | 88 notify("A nice cup of tea is brewing.") |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
89 return |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
90 if player.has_item('teacup'): |
335 | 91 if self._me.brewed: |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
92 player.discard_item() |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
93 player.take_item_by_name('teacupfull') |
335 | 94 self._me.brewed = False |
403 | 95 notify("You pour a cup of tea.") |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
96 else: |
388 | 97 notify("Sadly, the teapot is empty.") |
383 | 98 return |
388 | 99 notify("A proper tea ceremony requires a cup.") |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
100 |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
101 |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
102 |
335 | 103 ################################################## |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
104 # Guard seduction |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
105 |
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 class Fan(Item): |
397 | 108 image_file = 'props/fan.png' |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
109 |
395 | 110 def player_action(self, player): |
111 player.get_fan(self) | |
112 | |
113 | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
114 |
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 # Samurai distraction |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
117 |
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 class Kindling(Item): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
120 image_file = 'props/kindling.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
121 |
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 class Oil(Item): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
124 image_file = 'props/oil.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
125 |
412 | 126 |
127 # TODO: Finish this thing's behaviour | |
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.") |
412 | 149 elif player.has_item('oil'): |
417 | 150 notify("You pour the oil on the signal fire.") |
412 | 151 else: |
152 return | |
153 player.discard_item() | |
154 self._me.litness = 'kindled' | |
155 elif self._me.litness == 'kindled': | |
156 if player.has_item('kindling'): | |
417 | 157 notify("You put the kindling on the signal fire and light it.") |
412 | 158 elif player.has_item('oil'): |
417 | 159 notify("You pour the oil on the signal fire and light it.") |
412 | 160 else: |
161 return | |
162 player.discard_item() | |
163 self._me.litness = 'burning' | |
164 self.world.missions.fire_started_on_road = True | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
165 |
474 | 166 def update(self): |
167 if self._me.litness != 'burning': | |
168 return | |
169 if self._last_time is None: | |
170 self._last_time = time.time() | |
171 return | |
172 if time.time() - self._last_time > 0.1: | |
173 self._last_time = time.time() | |
174 self._frame += 1 | |
175 if self._frame >= len(self.animations): | |
176 self._frame = 0 | |
177 pos = self.rect.midbottom | |
178 self.image = self.animations[self._frame] | |
179 self.rect = self.image.get_rect(midbottom=pos) | |
180 self.collide_rect = self.rect.move(0, 0) | |
181 | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
182 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
183 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
184 # Cannon destruction |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
185 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
186 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
187 class Cannon(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
188 whole_image_file = 'props/cannon-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
189 broken_image_file = 'props/cannon-broken.png' |
335 | 190 |
434
827c5d045cf5
Don't allow the cannon to be picked up
Neil Muller <drnlmuller@gmail.com>
parents:
432
diff
changeset
|
191 liftable = False |
827c5d045cf5
Don't allow the cannon to be picked up
Neil Muller <drnlmuller@gmail.com>
parents:
432
diff
changeset
|
192 |
335 | 193 |
237
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
194 |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
195 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
196 # Geisha character assassination |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
197 |
237
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
198 |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
199 class Vase(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
200 whole_image_file = 'props/vase-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
201 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
|
202 |
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
|
203 |
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
|
204 class Salmon(Item): |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
205 image_file = 'props/fish.png' |
335 | 206 |
207 | |
208 | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
209 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
210 # Theatrical debut |
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 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
213 class NoMask(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
214 whole_image_file = 'props/no-mask-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
215 broken_image_file = 'props/no-mask-broken.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
216 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
217 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
218 class NoCostume(Item): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
219 image_file = 'props/no-costume.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
220 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
221 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
222 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
223 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
224 # Big business |
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 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
227 class Rice(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
228 whole_image_file = 'props/rice-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
229 broken_image_file = 'props/rice-broken.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
230 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
231 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
232 class Documents(Item): |
406
9c043be746fa
stuff in the teahouse
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
403
diff
changeset
|
233 image_file = 'props/haiku-scroll.png' |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
234 |
470 | 235 ################################################## |
236 # Tails | |
237 | |
238 class Tail(Item): | |
239 | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
240 image_dir = 'icons/tails/' |
470 | 241 image_file = None |
242 tail_type = None | |
473 | 243 help_msg = None |
470 | 244 |
245 def player_action(self, player): | |
246 player.add_tail(self.tail_type) | |
473 | 247 notify(self.help_msg) |
470 | 248 self.remove() |
249 | |
250 | |
251 class ShapeshiftTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
252 image_file = 'shapeshift.png' |
470 | 253 tail_type = 'shapeshift' |
473 | 254 help_msg = "Shapeshifting tail. Press C to shape shift." \ |
255 " Your powers are more limited while in human form." | |
470 | 256 |
257 | |
258 class FireballTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
259 image_file = 'fireball.png' |
470 | 260 tail_type = 'fireball' |
473 | 261 help_msg = "Fireball tail. The X attack key now shoots fireballs." |
262 | |
263 | |
264 class SprintTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
265 image_file = 'sprint.png' |
473 | 266 tail_type = 'sprint' |
267 help_msg = "Sprint tail. Double-tap the left or right arrow key to" \ | |
268 " sprint for a few seconds." | |
269 | |
270 | |
271 class InvisibilityTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
272 image_file = 'invisibility.png' |
473 | 273 tail_type = 'invisibility' |
274 help_msg = "Invisibility tail. Press V to become invisible for a few seconds." \ | |
275 " You become visible again if you attack or interact with others." | |
276 | |
277 | |
278 class FlightTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
279 image_file = 'flight.png' |
473 | 280 tail_type = 'flight' |
281 help_msg = "Flight tail. Double-tap up to fly. Press down while on the ground to land." \ | |
282 " If you stay in the air too long you'll tire and fall." | |
283 | |
284 | |
285 class ShieldTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
286 image_file = 'shield.png' |
473 | 287 tail_type = 'shield' |
288 help_msg = "Shield tail. If you get hit, your mystical shield will protect you for" \ | |
289 " one second. After that it'll need a little time to recharge." | |
290 | |
291 | |
292 class StealTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
293 image_file = 'steal.png' |
473 | 294 tail_type = 'steal' |
295 help_msg = "Life-stealing tail. If you projectiles hit your enemies, you steal some" \ | |
296 " of their life." | |
297 | |
298 | |
299 class LightningTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
300 image_file = 'lightning.png' |
473 | 301 tail_type = 'lightning' |
302 help_msg = "Lightning tail. The Z attack now shoots lightning bolts." |