Mercurial > skaapsteker
annotate skaapsteker/sprites/items.py @ 296:15b2be883a40
Ancient and honorable tea ceremony.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Fri, 08 Apr 2011 22:29:49 +0200 |
parents | e06c54d7701f |
children | 2844edb6c1cc |
rev | line source |
---|---|
127 | 1 from base import Item |
2 | |
3 | |
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
|
4 class TeaCup(Item): |
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
5 image_file = 'teacup_empty.png' |
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
6 |
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
7 |
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
8 class TeaLeaf(Item): |
162
663bdac80299
Fix items, and stop the tea from looking like a monk.
Jeremy Thurgood <firxen@gmail.com>
parents:
127
diff
changeset
|
9 image_file = 'tealeaf.png' |
127 | 10 |
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
|
11 |
191 | 12 class TeaCupFull(Item): |
13 image_file = 'teacup_full.png' | |
14 | |
15 | |
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
|
16 class TeaPot(Item): |
9d08f99b5ddf
Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents:
162
diff
changeset
|
17 image_file = 'teapot.png' |
191 | 18 portable = False |
237
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
19 |
296
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
20 def setup(self, brewed, **opts): |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
21 super(TeaPot, self).setup(**opts) |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
22 |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
23 |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
24 def player_action(self, player): |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
25 if player.has_item('tealeaf'): |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
26 self.item_state.brewed = True |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
27 player.discard_item() |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
28 return |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
29 if player.has_item('teacup'): |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
30 if self.item_state.brewed: |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
31 player.discard_item() |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
32 player.take_item_by_name('teacupfull') |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
33 self.item_state.brewed = False |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
34 else: |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
35 print "Sadly, the teapot is empty." |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
36 |
15b2be883a40
Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents:
237
diff
changeset
|
37 |
237
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
38 |
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
39 class Vase(Item): |
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
40 image_file = 'dummy.png' |
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
41 |
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
42 def setup(self, broken, **opts): |
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
43 super(Vase, self).setup(**opts) |
e06c54d7701f
Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents:
191
diff
changeset
|
44 self.broken = broken |