def setUp(self): self.shopkeeper = Shopkeeper("lucy", "f") shop = ShopBehavior() shop.open_hours = [(9, 17), (22, 3)] # from 9 to 17 and in the night from 22 to 03 self.shopkeeper.set_shop(shop)
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)