annotate skaapsteker/sprites/items.py @ 340:f870e3122ac7

Collect haiku scrolls.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 09 Apr 2011 12:55:38 +0200
parents c6552e9fc2e1
children b37dbc557ae0
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
340
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
15 class HaikuScroll(Item):
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
16 image_file = 'haiku-scroll.png'
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
17
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
18 def player_action(self, player):
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
19 player.collect_scroll(self)
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
20 self.remove()
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
21
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
22
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
23 def setup(self, text, **opts):
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
24 super(HaikuScroll, self).setup(**opts)
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
25 self.text = text
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
26
f870e3122ac7 Collect haiku scrolls.
Jeremy Thurgood <firxen@gmail.com>
parents: 335
diff changeset
27
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
28
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
29 ##################################################
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
30 # Monk tea mission
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
31
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
32 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
33 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
34
9d08f99b5ddf Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents: 162
diff changeset
35
9d08f99b5ddf Add npcs to gamestate. Update gamestate. Pass world around a bit. Some other stuff.
Simon Cross <hodgestar@gmail.com>
parents: 162
diff changeset
36 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
37 image_file = 'tealeaf.png'
127
e1dd3b785269 Initial game state stuff.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff changeset
38
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
39
191
993f4f55eb93 Minor item changes.
Jeremy Thurgood <firxen@gmail.com>
parents: 189
diff changeset
40 class TeaCupFull(Item):
993f4f55eb93 Minor item changes.
Jeremy Thurgood <firxen@gmail.com>
parents: 189
diff changeset
41 image_file = 'teacup_full.png'
993f4f55eb93 Minor item changes.
Jeremy Thurgood <firxen@gmail.com>
parents: 189
diff changeset
42
993f4f55eb93 Minor item changes.
Jeremy Thurgood <firxen@gmail.com>
parents: 189
diff changeset
43
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
44 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
45 image_file = 'teapot.png'
237
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
46
296
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
47 def setup(self, brewed, **opts):
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
48 super(TeaPot, self).setup(**opts)
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
49
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 def player_action(self, player):
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
52 if player.has_item('tealeaf'):
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
53 self._me.brewed = True
296
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
54 player.discard_item()
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
55 return
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
56 if player.has_item('teacup'):
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
57 if self._me.brewed:
296
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
58 player.discard_item()
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
59 player.take_item_by_name('teacupfull')
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
60 self._me.brewed = False
296
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
61 else:
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
62 print "Sadly, the teapot is empty."
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
63
15b2be883a40 Ancient and honorable tea ceremony.
Jeremy Thurgood <firxen@gmail.com>
parents: 237
diff changeset
64
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
65 ##################################################
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
66 # Unclassified
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
237
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
69
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
70 class Vase(Item):
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
71 image_file = 'dummy.png'
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
72
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
73 def setup(self, broken, **opts):
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
74 super(Vase, self).setup(**opts)
e06c54d7701f Add vase to demonstrate item state testing in dialogues.
Simon Cross <hodgestar@gmail.com>
parents: 191
diff changeset
75 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
76
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
77
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
78 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
79 image_file = 'dummy.png'
335
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
80
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
81
c6552e9fc2e1 Added aburage.
Jeremy Thurgood <firxen@gmail.com>
parents: 297
diff changeset
82