Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Game_Party < Game_Unit
- attr_reader :earned_items_list #This makes the list readable only.
- alias inti_gm_party_gained_items_list initialize unless $@
- def initialize
- inti_gm_party_gained_items_list
- @earned_items_list = []
- end
- #--------------------------------------------------------------------------
- # * Gain Items (or lose)
- # item : Item
- # n : Number
- # include_equip : Include equipped items
- #--------------------------------------------------------------------------
- alias gain_items_earned_items_list gain_item unless $@
- def gain_item(item, n, include_equip = false)
- gain_items_earned_items_list(item, n, include_equip)
- type = nil
- case item
- when RPG::Item
- type = 0
- when RPG::Weapon
- type = 1
- when RPG::Armor
- type = 2
- end
- #This will push the item in the list (array) unless it is already in it.
- i_details = [type, item.id]
- @earned_items_list << i_details unless @earned_items_list.include?(i_details)
- end
- end
- class Earned_Item_Shop < Scene_Shop
- def initialize
- $game_temp.shop_goods = $game_party.earned_items_list
- super
- end
- end
Add Comment
Please, Sign In to add comment