Exemplo n.º 1
0
#! /usr/bin/env python

from librpg.item import OrdinaryItem, OrdinaryInventory
from librpg.util import IdFactory

item_factory = IdFactory()


class Item19(OrdinaryItem):

    id = 19

    def __init__(self):
        OrdinaryItem.__init__(self, 'Item19')


item_factory.register(Item19)


class Item42(OrdinaryItem):

    id = 42

    def __init__(self):
        OrdinaryItem.__init__(self, 'Item42')


item_factory.register(Item42)


class Item66(OrdinaryItem):
Exemplo n.º 2
0
from librpg.quest import *
from librpg.util import IdFactory

quest_factory = IdFactory()

# Quests ###################################################


class TeaAtFiveQuest(Quest):

    id = 'tea at five'

    class Step1(QuestStep):
        def custom_start(self):
            print 'Started Tea at Five step 1'

        def custom_finish(self):
            print 'Finished Tea at Five step 1'
            self.owner.reward(100)

    class Step2(QuestStep):
        def custom_start(self):
            print 'Started Tea at Five step 2'

        def custom_finish(self):
            print 'Finished Tea at Five step 2'
            self.owner.reward(300)

    def __init__(self, owner):
        Quest.__init__(self, owner, 'Tea at Five',
                       [TeaAtFiveQuest.Step1, TeaAtFiveQuest.Step2])