Exemplo n.º 1
0
    def buyQuestItems(self):
        """ Attempts to buy all quest items, returns result
           
        Returns
           bool - True if successful, otherwise False
        """
        for item in self.items:
            us = UserShopFront(self.usr, item.owner, item.id, str(item.price))
            us.loadInventory()

            if not item.name in us.inventory:
                return False

            if not us.inventory[item.name].buy():
                return False

        return True
Exemplo n.º 2
0
 def buyQuestItems(self):
     """ Attempts to buy all quest items, returns result
        
     Returns
        bool - True if successful, otherwise False
     """
     for item in self.items:
         us = UserShopFront(self.usr, item.owner, item.id, str(item.price))
         us.loadInventory()
         
         if not item.name in us.inventory:
             return False
             
         if not us.inventory[item.name].buy():
             return False
             
     return True
Exemplo n.º 3
0
 def shop(self, index):
     """ Return's the user shop the indexed item is in
        
     Parameters:
        index (int) -- The item index
        
     Returns
        UserShopFront - User shop item is in
     """
     return UserShopFront(self.usr, item.owner, item.id, str(item.price))
Exemplo n.º 4
0
 def buy(self, index):
     """ Attempts to buy indexed item, returns result
        
     Parameters:
        index (int) -- The item index
        
     Returns
        bool - True if item was bought, false otherwise
     """
     item = self.items[index]
     us = UserShopFront(self.usr, item.owner, item.id, str(item.price))
     us.load()
     
     if not item.name in us.inventory:
         return False
     
     if not us.inventory[item.name].buy():
         return False
             
     return True
Exemplo n.º 5
0
    def buy(self, index):
        """ Attempts to buy indexed item, returns result
           
        Parameters:
           index (int) -- The item index
           
        Returns
           bool - True if item was bought, false otherwise
        """
        item = self.items[index]
        us = UserShopFront(self.usr, item.owner, item.id, str(item.price))
        us.load()

        if not item.name in us.inventory:
            return False

        if not us.inventory[item.name].buy():
            return False

        return True