






init -900 python:
    class InventoryObject():
        def __init__(self, **kwargs):
            self.grid = {"width" : InventorySettings.grid[0], "height" : InventorySettings.grid[1]}
            self.page = 0
            self.inventory = [item for item in kwargs.get('inventory', [])]
            self.selectedSlot = None
            self.equippedSlot = None
            self.gift_zone = kwargs.get('gift_zone', False)
            
            self.gift_zone_alice = kwargs.get('gift_zone_alice', False)
            self.gift_zone_elena = kwargs.get('gift_zone_elena', False)
            self.gift_zone_melissa = kwargs.get('gift_zone_melissa', False)
            self.gift_zone_bianca = kwargs.get('gift_zone_bianca', False)
            self.gift_zone_sofia = kwargs.get('gift_zone_sofia', False)
            
            self.gift_zone_moms_number_one = kwargs.get('gift_zone_moms_number_one', False)
            self.gift_zone_moms_number_two = kwargs.get('gift_zone_moms_number_two', False)
            
            self.no_notify_zone = kwargs.get('no_notify_zone', False)
            self.in_the_kitchen = kwargs.get('in_the_kitchen', False)
        
        
        def add(self, Item):
            global Main_Character
            if len(self.inventory) < ( Main_Character.stamina_level * self.getSize() ):
                self.inventory.append(Item)
                if self.no_notify_zone == True:
                    pass
                else:
                    renpy.notify("Item added to the inventory!")
                    renpy.play("sound_effects/notify_classic.mp3")
            else:
                renpy.notify("Reached maxing limit of Inventory! Boost your Stamina to carry more items!")
                renpy.play("sound_effects/notify_negative.mp3")
        
        def bought(self):
            self.inventory.append(InvLegDrawing)
            renpy.notify("Item added to the inventory!")
            renpy.play("sound_effects/notify_classic.mp3")
        
        
        
        def remove(self, Item = None):
            
            if Item != None:
                if Item in self.inventory:
                    
                    if Item == self.getEquippedItem():
                        self.unequip()
                    
                    if Item == self.getSelectedItem():
                        self.unselect()
                    
                    self.inventory.remove(Item)
                    
                    
                    self.checkPages()
                    return
            
            
            if self.selectedSlot == None:
                return
            
            if self.selectedSlot == self.equippedSlot:
                self.unequip()
            
            toRemove = self.selectedSlot
            
            self.unselect()
            
            self.inventory.pop( toRemove )
            self.checkPages()
        
        
        
        
        
        
        
        
        
        
        
        def getSize(self):
            return self.grid["width"] * self.grid["height"]
        
        def clear(self):
            self.inventory = []
            self.equippedSlot = None
            self.selectedSlot = None
            self.page = 0
        
        
        
        
        
        def getPages(self):
            
            lastPage = (len(self.inventory) - 1) // self.getSize()
            
            if lastPage < 0:
                lastPage = 0
            
            return ( self.page, lastPage )
        
        def checkPages(self):
            pages = self.getPages()
            if pages[0] > pages[1]:
                self.page = pages[1]
        
        
        def changePage(self, direction):
            
            if not self.canChangePage(direction):
                return None
            try:
                self.page += direction
            
            except TypeError:
                raise Exception("changePage() got invalid direction.")
            
            self.unselect()
        
        
        
        def canChangePage(self, direction):
            
            if self.getPages()[1] == 0:
                return False
            try:
                
                if direction > 0:
                    
                    if not (self.page + direction) > self.getPages()[1]:
                        return True
                
                elif direction < 0:
                    
                    if self.page > 0:
                        return True
            
            except TypeError:
                raise Exception("changePage() got invalid direction.")
            
            return False
        
        
        def getPagesRepr(self):
            firstPage, lastPage = self.getPages()
            return (firstPage + 1, lastPage + 1)
        
        
        
        
        
        
        
        
        
        
        
        def getFlattenedSlot(self, slot):
            
            lastIndex = len( self.getAllItems() ) - 1
            
            
            
            if slot > self.getSize() or slot > lastIndex:
                return None
            
            return ( self.page * self.getSize() + slot )
        
        def compareFlattenedSlotToSelected(self, slot):
            return ( self.getFlattenedSlot(slot) == self.selectedSlot )
        
        def compareFlattenedSlotToEquipped(self, slot):
            return ( self.getFlattenedSlot(slot) == self.equippedSlot )
        
        
        
        
        def unselect(self):
            self.selectedSlot = None
        
        
        def selectToggle(self, slot):
            
            if self.compareFlattenedSlotToSelected(slot):
                
                return self.unselect()
            
            
            self.selectedSlot = self.getFlattenedSlot(slot)
        
        def getSelectedItem(self):
            if self.selectedSlot != None:
                return self.inventory[ self.selectedSlot ]
            
            return None
        
        
        
        
        def getPageItems(self):
            
            
            bottomLimitIndex = self.page * self.getSize()
            
            
            
            topLimitIndex = self.page * self.getSize() + self.getSize()
            
            
            if topLimitIndex > len(self.inventory) - 1:
                topLimitIndex = len(self.inventory) - 1 + 1
            
            
            
            
            
            
            
            
            
            return self.inventory[ bottomLimitIndex : topLimitIndex ]
        
        def getAllItems(self):
            return self.inventory
        
        
        def getEmptyCells(self):
            
            pages = self.getPages()
            
            if not pages[0] == 0:
                
                
                if pages[0] != pages[1]:
                    return 0
            
            return self.getSize() - len( self.getPageItems() )
        
        def getItemFromSlot(slot):
            
            
            if not slot > len( self.getAllItems() ) - 1:
                return self.inventory[slot]
            
            return None
        
        def getItemFromFlattenedSlot(slot):
            
            slot = self.getFlattenedSlot(slot)
            
            
            if not slot > self.getSize():
                
                
                if not slot > len( self.getAllItems() ) - 1:
                    return self.inventory[ slot ]
            
            return None
        
        
        
        
        
        def equip(self):
            
            if self.equippedSlot != None:
                
                self.unequip()
            self.equippedSlot = self.selectedSlot
            
            self.getSelectedItem().equipped(self)
        
        def unequip(self):
            
            if self.equippedSlot == None:
                return
            
            self.getEquippedItem().unequipped(self)
            self.equippedSlot = None
        
        def getEquippedItem(self):
            if self.equippedSlot != None:
                return self.inventory[ self.equippedSlot ]
            
            return None
        
        
        
        
        def use(self, specified = None):
            
            if specified:
                return specified.used(self)
            
            
            self.getSelectedItem().used(self)
            
            
            
            if self.getSelectedItem():
                
                
                if self.getSelectedItem().consumedOnUse:
                    
                    
                    self.remove()
        def gift(self, specified = None):
            if specified:
                return specified.gifted(self)
            
            self.getSelectedItem().gifted(self)
            
            
            if self.getSelectedItem():
                
                if self.getSelectedItem().consumedOnUse:
                    
                    self.remove()
        
        
        
        
        
        
        def isSelected(self, slot):
            
            return self.compareFlattenedSlotToSelected(slot)
        
        
        
        def isEquipped(self, slot):
            
            return self.compareFlattenedSlotToEquipped(slot)
        
        
        
        
        def canUnequip(self):
            
            
            
            return ( self.selectedSlot == self.equippedSlot and self.selectedSlot != None )
        
        
        
        
        def canEquip(self):
            
            if self.selectedSlot != None:
                return self.getSelectedItem().isEquippable()
            
            return False
        
        
        
        def canUse(self):
            
            if self.selectedSlot != None:
                return self.getSelectedItem().isUsable()
            
            return False
        def canGift(self):
            
            if self.selectedSlot != None:
                return self.getSelectedItem().isGiftable()
            
            return False
        
        
        
        
        
        def isInInventory(self, item):
            
            return item in self.inventory
        
        
        
        def isItemSelected(self, item):
            
            return item == self.getSelectedItem()
        
        
        
        def isItemEquipped(self, item):
            
            return item == self.getEquippedItem()
        
        @staticmethod
        def update(old):
            return InventoryObject(**old.__dict__)

init -850:
    default Inventory = InventoryObject()
# Decompiled by unrpyc: https://github.com/CensoredUsername/unrpyc
