#------------------------------------------------------------------------------- # page 3 of 12 # Shopoholic v 2.0 # code by cmpsr2000 # available exclusively @ rpgrevolution.com/forums # Released June 25, 2008 # #------------------------------------------------------------------------------- class Storage_Slot < RPG::BaseItem attr_reader :locked attr_reader :amount attr_reader :item #----------------------------------------------------------------------------- # Creates the Storage_Slot object #----------------------------------------------------------------------------- def initialize @icon_index = 1947 @item = nil @amount = 0 @locked = true end #----------------------------------------------------------------------------- # Stores the specified item in the slot # item: The item being stored # amount: The amount of the item being stored #----------------------------------------------------------------------------- def storeItem(item, amount) $game_party.lose_item(item, amount) @item = item @amount = amount end #----------------------------------------------------------------------------- # removes the stored item from the slot and gives it to the party #----------------------------------------------------------------------------- def takeItem $game_party.gain_item(@item, @amount) @item = nil @amount = 0 end #----------------------------------------------------------------------------- # locks the slot #----------------------------------------------------------------------------- def lock @locked = true end #----------------------------------------------------------------------------- # unlocks the slot #----------------------------------------------------------------------------- def unlock @locked = false end end