annotate skaapsteker/sprites/items.py @ 335:c6552e9fc2e1

Added aburage.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 09 Apr 2011 12:15:19 +0200
parents 2844edb6c1cc
children f870e3122ac7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
127
e1dd3b785269 Initial game state stuff.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
1 from base import Item
e1dd3b785269 Initial game state stuff.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
2
e1dd3b785269 Initial game state stuff.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
3
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
4 ##################################################
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
5 # Collectibles
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
6
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
7 class Aburage(Item):
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
8 image_file = 'tofu.png'
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
9
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
10 def player_action(self, player):
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
11 player.eat_aburage()
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
12 self.remove()
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
13
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
14
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
15
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
16 ##################################################
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
17 # Monk tea mission
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
18
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
19 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
20 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
21
9d08f99b5ddf Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents: 162
diff changeset
22
9d08f99b5ddf Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents: 162
diff changeset
23 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
24 image_file = 'tealeaf.png'
127
e1dd3b785269 Initial game state stuff.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
25
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
26
191
993f4f55eb93 Minor item changes.
Jeremy Thurgood <firxen@gmail.com>
parents: 189
diff changeset
27 class TeaCupFull(Item):
993f4f55eb93 Minor item changes.
Jeremy Thurgood <firxen@gmail.com>
parents: 189
diff changeset
28 image_file = 'teacup_full.png'
993f4f55eb93 Minor item changes.
Jeremy Thurgood <firxen@gmail.com>
parents: 189
diff changeset
29
993f4f55eb93 Minor item changes.
Jeremy Thurgood <firxen@gmail.com>
parents: 189
diff changeset
30
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
31 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
32 image_file = 'teapot.png'
237
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
33
296
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
34 def setup(self, brewed, **opts):
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
35 super(TeaPot, self).setup(**opts)
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
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
38 def player_action(self, player):
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
39 if player.has_item('tealeaf'):
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
40 self._me.brewed = True
296
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
41 player.discard_item()
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
42 return
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
43 if player.has_item('teacup'):
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
44 if self._me.brewed:
296
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
45 player.discard_item()
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
46 player.take_item_by_name('teacupfull')
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
47 self._me.brewed = False
296
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
48 else:
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
49 print "Sadly, the teapot is empty."
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
50
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
51
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
52 ##################################################
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
53 # Unclassified
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
54
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
55
237
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
56
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
57 class Vase(Item):
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
58 image_file = 'dummy.png'
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
59
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
60 def setup(self, broken, **opts):
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
61 super(Vase, self).setup(**opts)
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
62 self.broken = broken
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
63
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
64
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
65 class Salmon(Item):
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
66 image_file = 'dummy.png'
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
67
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
68
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
69