view 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
line wrap: on
line source

from base import Item


class TeaCup(Item):
    image_file = 'teacup_empty.png'


class TeaLeaf(Item):
    image_file = 'tealeaf.png'


class TeaCupFull(Item):
    image_file = 'teacup_full.png'


class TeaPot(Item):
    image_file = 'teapot.png'
    portable = False

    def setup(self, brewed, **opts):
        super(TeaPot, self).setup(**opts)


    def player_action(self, player):
        if player.has_item('tealeaf'):
            self.item_state.brewed = True
            player.discard_item()
            return
        if player.has_item('teacup'):
            if self.item_state.brewed:
                player.discard_item()
                player.take_item_by_name('teacupfull')
                self.item_state.brewed = False
            else:
                print "Sadly, the teapot is empty."



class Vase(Item):
    image_file = 'dummy.png'

    def setup(self, broken, **opts):
        super(Vase, self).setup(**opts)
        self.broken = broken