Mercurial > skaapsteker
annotate skaapsteker/sprites/items.py @ 518:be1333278d5b
proper image for document
author | Adrianna Pińska <adrianna.pinska@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 23:22:28 +0200 |
parents | 6c21ba7de1e6 |
children | 4de4f94c326d |
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 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
|
128 image_file = 'props/signal_fire/signal_fire_unlit.png' |
412 | 129 |
474 | 130 animation_files = ['props/signal_fire/signal_fire_lit01.png', |
131 'props/signal_fire/signal_fire_lit02.png', | |
132 'props/signal_fire/signal_fire_lit03.png', | |
133 'props/signal_fire/signal_fire_lit04.png'] | |
134 | |
135 wants_updates = True | |
136 | |
412 | 137 def setup(self, litness, **opts): |
138 super(SignalFire, self).setup(**opts) | |
474 | 139 self._last_time = None |
140 self._frame = 0 | |
141 self.animations = [data.load_image(self.image_dir + x) for x in self.animation_files] | |
412 | 142 |
143 | |
144 def player_action(self, player): | |
145 if self._me.litness == 'set': | |
146 if player.has_item('kindling'): | |
417 | 147 notify("You put the kindling in the signal fire.") |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
148 self._me.litness = 'kindled' |
412 | 149 elif player.has_item('oil'): |
417 | 150 notify("You pour the oil on the signal fire.") |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
151 self._me.litness = 'oiled' |
412 | 152 else: |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
153 notify("This signal fire needs some oil and kindling before it can be lit.") |
412 | 154 return |
155 player.discard_item() | |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
156 |
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
157 elif self._me.litness in ['oiled', 'kindled']: |
412 | 158 if player.has_item('kindling'): |
417 | 159 notify("You put the kindling on the signal fire and light it.") |
412 | 160 elif player.has_item('oil'): |
417 | 161 notify("You pour the oil on the signal fire and light it.") |
412 | 162 else: |
515
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
163 if self._me.litness == 'oiled': |
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
164 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
|
165 else: |
6c21ba7de1e6
Better signal fire interaction.
Jeremy Thurgood <firxen@gmail.com>
parents:
490
diff
changeset
|
166 notify("This fire still needs some oil before it can be lit.") |
412 | 167 return |
168 player.discard_item() | |
169 self._me.litness = 'burning' | |
170 self.world.missions.fire_started_on_road = True | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
171 |
474 | 172 def update(self): |
173 if self._me.litness != 'burning': | |
174 return | |
175 if self._last_time is None: | |
176 self._last_time = time.time() | |
177 return | |
178 if time.time() - self._last_time > 0.1: | |
179 self._last_time = time.time() | |
180 self._frame += 1 | |
181 if self._frame >= len(self.animations): | |
182 self._frame = 0 | |
183 pos = self.rect.midbottom | |
184 self.image = self.animations[self._frame] | |
185 self.rect = self.image.get_rect(midbottom=pos) | |
186 self.collide_rect = self.rect.move(0, 0) | |
187 | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
188 |
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 # Cannon destruction |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
191 |
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 class Cannon(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
194 whole_image_file = 'props/cannon-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
195 broken_image_file = 'props/cannon-broken.png' |
335 | 196 |
434
827c5d045cf5
Don't allow the cannon to be picked up
Neil Muller <drnlmuller@gmail.com>
parents:
432
diff
changeset
|
197 liftable = False |
827c5d045cf5
Don't allow the cannon to be picked up
Neil Muller <drnlmuller@gmail.com>
parents:
432
diff
changeset
|
198 |
335 | 199 |
237
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
200 |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
201 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
202 # Geisha character assassination |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
203 |
237
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
204 |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
205 class Vase(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
206 whole_image_file = 'props/vase-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
207 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
|
208 |
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
|
209 |
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
|
210 class Salmon(Item): |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
211 image_file = 'props/fish.png' |
335 | 212 |
213 | |
214 | |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
215 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
216 # Theatrical debut |
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 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
219 class NoMask(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
220 whole_image_file = 'props/no-mask-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
221 broken_image_file = 'props/no-mask-broken.png' |
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 class NoCostume(Item): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
225 image_file = 'props/no-costume.png' |
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 |
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 ################################################## |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
230 # Big business |
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 |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
233 class Rice(BreakableItem): |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
234 whole_image_file = 'props/rice-whole.png' |
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
235 broken_image_file = 'props/rice-broken.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 class Documents(Item): |
518
be1333278d5b
proper image for document
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
515
diff
changeset
|
239 image_file = 'props/documents.png' |
354
b37dbc557ae0
Stub classes for all items.
Jeremy Thurgood <firxen@gmail.com>
parents:
340
diff
changeset
|
240 |
470 | 241 ################################################## |
242 # Tails | |
243 | |
244 class Tail(Item): | |
245 | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
246 image_dir = 'icons/tails/' |
470 | 247 image_file = None |
248 tail_type = None | |
473 | 249 help_msg = None |
470 | 250 |
251 def player_action(self, player): | |
252 player.add_tail(self.tail_type) | |
473 | 253 notify(self.help_msg) |
470 | 254 self.remove() |
255 | |
256 | |
257 class ShapeshiftTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
258 image_file = 'shapeshift.png' |
470 | 259 tail_type = 'shapeshift' |
473 | 260 help_msg = "Shapeshifting tail. Press C to shape shift." \ |
261 " Your powers are more limited while in human form." | |
470 | 262 |
263 | |
264 class FireballTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
265 image_file = 'fireball.png' |
470 | 266 tail_type = 'fireball' |
473 | 267 help_msg = "Fireball tail. The X attack key now shoots fireballs." |
268 | |
269 | |
270 class SprintTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
271 image_file = 'sprint.png' |
473 | 272 tail_type = 'sprint' |
273 help_msg = "Sprint tail. Double-tap the left or right arrow key to" \ | |
274 " sprint for a few seconds." | |
275 | |
276 | |
277 class InvisibilityTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
278 image_file = 'invisibility.png' |
473 | 279 tail_type = 'invisibility' |
280 help_msg = "Invisibility tail. Press V to become invisible for a few seconds." \ | |
281 " You become visible again if you attack or interact with others." | |
282 | |
283 | |
284 class FlightTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
285 image_file = 'flight.png' |
473 | 286 tail_type = 'flight' |
287 help_msg = "Flight tail. Double-tap up to fly. Press down while on the ground to land." \ | |
288 " If you stay in the air too long you'll tire and fall." | |
289 | |
290 | |
291 class ShieldTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
292 image_file = 'shield.png' |
473 | 293 tail_type = 'shield' |
294 help_msg = "Shield tail. If you get hit, your mystical shield will protect you for" \ | |
295 " one second. After that it'll need a little time to recharge." | |
296 | |
297 | |
298 class StealTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
299 image_file = 'steal.png' |
473 | 300 tail_type = 'steal' |
301 help_msg = "Life-stealing tail. If you projectiles hit your enemies, you steal some" \ | |
302 " of their life." | |
303 | |
304 | |
305 class LightningTail(Tail): | |
490
0eade58a71b9
Support item dropping (specifically tails). Have monk drop tail.
Simon Cross <hodgestar@gmail.com>
parents:
489
diff
changeset
|
306 image_file = 'lightning.png' |
473 | 307 tail_type = 'lightning' |
308 help_msg = "Lightning tail. The Z attack now shoots lightning bolts." |