# called when zone is first loaded pass # create the Olde Shoppe and its owner shopinfo = ShopBehavior() toothpick = Item("toothpick", "pointy wooden toothpick") toothpick.value = 0.12 shopinfo.forsale.add(toothpick) shopinfo.banks_money = True shopkeeper = Shopkeeper( "Lucy", "f", short_description= "Lucy, the shop owner, is looking happily at her newly arrived customer.") shopkeeper.money = 14000 shop = Location("Curiosity Shoppe", "A weird little shop. It sells odd stuff.") shop.insert(shopkeeper, shop) shop.add_exits([ Exit(["door", "out"], "town.lane", "A fancy door provides access back to the lane outside.") ]) # provide some items in the shop clock = clone(gameclock) clock.value = 500 paper = clone(newspaper) gem2 = clone(diamond) gem2.value = 80000 gem3 = clone(gem) gem3.value = 9055
from tale import mud_context def init(driver): # called when zone is first loaded pass # create the Olde Shoppe and its owner shopinfo = ShopBehavior() toothpick = Item("toothpick", "pointy wooden toothpick") toothpick.value = 0.12 shopinfo.forsale.add(toothpick) shopinfo.banks_money = True shopkeeper = Shopkeeper("Lucy", "f", short_description="Lucy, the shop owner, is looking happily at her newly arrived customer.") shopkeeper.money = 14000 shop = Location("Curiosity Shoppe", "A weird little shop. It sells odd stuff.") shop.insert(shopkeeper, shop) shop.add_exits([Exit(["door", "out"], "town.lane", "A fancy door provides access back to the lane outside.")]) # provide some items in the shop clock = clone(gameclock) clock.value = 500 paper = clone(newspaper) gem2 = clone(diamond) gem2.value = 80000 gem3 = clone(gem) gem3.value = 9055 shopkeeper.init_inventory([gem2, gem3, toothpick]) shopkeeper.set_shop(shopinfo)