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):
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]) def custom_complete(self): print 'Tea at Five quest completed!' quest_factory.register(TeaAtFiveQuest) class JourneyBakeryQuest(Quest): id = 'journey bakery' def __init__(self, owner): Quest.__init__(self, owner, 'Journey to the Bakery', []) quest_factory.register(JourneyBakeryQuest) class HousekeepingQuest(Quest): id = 'housekeeping'
class LogItem(OrdinaryItem): id = 'log' def __init__(self): OrdinaryItem.__init__(self, 'Log') def get_description(self): return 'A small log of ash wood.' def get_icon_location(self): return (tileset_path('world_upper.png'), 2) item_factory.register(LogItem) class LeafItem(OrdinaryItem): id = 'leaf' def __init__(self): OrdinaryItem.__init__(self, 'Leaf') def get_icon_location(self): return ('item_icons.png', 3) def get_description(self): return 'A big, green leaf.'
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]) def custom_complete(self): print 'Tea at Five quest completed!' quest_factory.register(TeaAtFiveQuest) class JourneyBakeryQuest(Quest): id = 'journey bakery' def __init__(self, owner): Quest.__init__(self, owner, 'Journey to the Bakery', []) quest_factory.register(JourneyBakeryQuest) class HousekeepingQuest(Quest):
#! /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): id = 66