comparison 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
comparison
equal deleted inserted replaced
295:b5ce2c7f4c60 296:15b2be883a40
15 15
16 class TeaPot(Item): 16 class TeaPot(Item):
17 image_file = 'teapot.png' 17 image_file = 'teapot.png'
18 portable = False 18 portable = False
19 19
20 def setup(self, brewed, **opts):
21 super(TeaPot, self).setup(**opts)
22
23
24 def player_action(self, player):
25 if player.has_item('tealeaf'):
26 self.item_state.brewed = True
27 player.discard_item()
28 return
29 if player.has_item('teacup'):
30 if self.item_state.brewed:
31 player.discard_item()
32 player.take_item_by_name('teacupfull')
33 self.item_state.brewed = False
34 else:
35 print "Sadly, the teapot is empty."
36
37
20 38
21 class Vase(Item): 39 class Vase(Item):
22 image_file = 'dummy.png' 40 image_file = 'dummy.png'
23 41
24 def setup(self, broken, **opts): 42 def setup(self, broken, **opts):