Advertisement
LiTTleDRAgo

[Archive] DRG Inventory System 1.86

Jul 18th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 98.65 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  2. # DRG Inventory System
  3. # Version: 1.86
  4. # Author : LiTTleDRAgo
  5. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  6. if true
  7. module LiTTleDRAgo
  8. #==============================================================================
  9. # *** EDITABLE SECTION
  10. #==============================================================================
  11.   NONDISCARD = {0 => [23,24,25,50,51,52],   # item nondiscardable
  12.                 1 => [],                    # weapon nondiscardable
  13.                 2 => []}                    # armor nondiscardable
  14.                  
  15.   DEFAULT_MAX_SIZE   = 10 # Max size inventory default (can be changed in game)
  16.  
  17.   DEFAULT_ITEM_STACK = {   # Max Item stack
  18.             0 => 90,       # For All Unlisted Item
  19.             3 => 80,       # For item ID 3 (Full Potion)
  20.   }
  21.  
  22.   #------------------------------------------------------------
  23.   #*** ADDITIONAL SECTION (Can be deleted)
  24.   #------------------------------------------------------------
  25.   #------------------------------------------------------
  26.   # COMBINE ITEM (Reference : Resident Evil series)
  27.   # Format
  28.   #  'Item(ID-1) + Item(ID-2)' => 'Item(ID-Result)'
  29.   #------------------------------------------------------
  30.   # delete if you don't want to use it
  31.  
  32.   COMBINE_ITEM = {
  33.  
  34.     'Item(1) + Item(1)'     => 'Item(2)',
  35.     'Item(1) + Item(2)'     => 'Item(3)',
  36.    
  37.       # Means :
  38.       # Item ID 1 (potion) + Item ID 1 (potion)   => Item ID 2 (Hipotion)
  39.       # Item ID 1 (potion) + Item ID 2 (Hipotion) => Item ID 3 (Fullpotion)
  40.       #------------------------------------------------------
  41.        
  42.     'Item(1) + Weapon(1)'   => 'Weapon(2)',
  43.     'Weapon(1) + Weapon(2)' => 'Weapon(3)',
  44.     'Weapon(1) + Armor(1)'  => 'Weapon(4)',
  45.    
  46.   }
  47.  
  48.   SOUND_COMBINE = '055-Right01' # SE Used when combining item
  49.   # end delete
  50.  
  51.   #------------------------------------------------------
  52.   # RARITY SISTEM
  53.   # Format
  54.   # Type = { ID Item => Star (max 8) }
  55.   #------------------------------------------------------
  56.   # delete if you don't want to use it
  57.   RARITY = {
  58.  
  59.     'Item'   => {
  60.                   1 => 1,
  61.                   2 => 3,
  62.                 },
  63.       # Means :
  64.       # Item ID 1 (potion)     will have 1 star
  65.       # Item ID 2 (Hipotion)   will have 3 star
  66.       #------------------------------------------------------
  67.     'Weapon' =>  {
  68.                   1 => 2,
  69.                   2 => 3,
  70.                  },
  71.                      
  72.     'Armor' => {
  73.                   1 => 2,
  74.                   2 => 3,
  75.                 },
  76.                  
  77.   }
  78.   # end delete
  79.  
  80.   #------------------------------------------------------------
  81.   # *** ADDITIONAL SECTION END
  82.   #------------------------------------------------------------
  83.  
  84.   #------------------------------------------------------------
  85.   #                            EDITABLE DETAIL
  86.   #------------------------------------------------------------
  87.  
  88.   BACKGROUND  = "Mn_Bk3"      # Animated background graphic    
  89.   TRAN_TIME   = 20            # Transition Time
  90.   TRAN_TYPE   = "004-Blind04" # Transition Type (Name)  
  91.  
  92.   # STRING SECTION
  93.   ITEM_WELCOME   = "In %s's Bag"
  94.   EQUIP_WELCOME  = "Press Shift button to Unequip"
  95.   PARTY_INV      = "%s's Inventory"
  96.   LOOT_INV       = "Discarded Item"
  97.   USE_COM        = "Use"
  98.   COMBINE_COM    = "Combine"     # Insert nil to disable permanently
  99.   EQ_COM         = "Equip"       # Insert nil to disable permanently
  100.   TRANSFER_COM   = "Transfer"    # Insert nil to disable permanently
  101.   UNEQUIP_COM    = "Unequip"
  102.   UNEQUIPALL_COM = "Unequip All"
  103.   DIS_COM        = "Discard"
  104.   CANCEL_COM     = "Cancel"
  105.   FULL_INVENTORY = 'Inventory is full'
  106.  
  107.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108.   # You can disable combine and equip feature by using script call
  109.   #
  110.   #       $game_party.disable_combine = true / false
  111.   #       $game_party.disable_equip = true / false
  112.   #
  113.   # You can change the inventory size by using script call
  114.   #
  115.   #       $game_party.resize_inventory(new_size)
  116.   #
  117.   # You can switch the main inventory with the call script
  118.   #
  119.   #       $game_party.switch_inventory(ID_Actor)
  120.   #
  121.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122.  
  123. #==============================================================================
  124. # *** END of EDITABLE SECTION
  125. #==============================================================================
  126. end
  127.  
  128. #==============================================================================
  129. # ** Window_Base
  130. #------------------------------------------------------------------------------
  131. #  This class is for all in-game windows.
  132. #==============================================================================
  133. VX  = defined?(Window_ActorCommand)
  134. VXA = defined?(Window_BattleActor)
  135. class Window_Base < Window
  136.   #--------------------------------------------------------------------------
  137.   # * Draw Level2
  138.   #     actor : actor
  139.   #     x     : draw spot x-coordinate
  140.   #     y     : draw spot y-coordinate
  141.   #--------------------------------------------------------------------------
  142.   def draw_actor_level2(actor, x, y)
  143.     self.contents.font.color = system_color
  144.     self.contents.draw_text(x, y, 32, 32, "Lv:")
  145.     self.contents.font.color = normal_color
  146.     self.contents.draw_text(x + 16, y, 24, 32, actor.level.to_s, 2)
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # * Draw Icon
  150.   # file_name : the file name for the iconset
  151.   # icon_index : Icon number
  152.   # x : draw spot x-coordinate
  153.   # y : draw spot y-coordinate
  154.   # enabled : Enabled flag. When false, draw semi-transparently.
  155.   #--------------------------------------------------------------------------
  156.   def cache() VX ? Cache : RPG::Cache end
  157.   def draw_icon_vx_a(file_name,icon_index, x, y, enabled = true)
  158.     bitmap = cache.picture(file_name.to_s)
  159.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  160.     self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # * Draw Icon
  164.   #     icon_index : Icon number
  165.   #     x     : draw spot x-coordinate
  166.   #     y     : draw spot y-coordinate
  167.   #     enabled    : Enabled flag. When false, draw semi-transparently.
  168.   #--------------------------------------------------------------------------
  169.   def draw_icon_vx(icon_index=1, x=0, y=0, enabled = true)
  170.     bitmap = cache.system("Iconset")
  171.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  172.     self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
  173.   end
  174. end
  175.  
  176. #==============================================================================
  177. # ** Window_Selectable_Drago
  178. #------------------------------------------------------------------------------
  179. #  
  180. #==============================================================================
  181. unless VX then  class Window_Selectable_Drago < Window_Selectable ;  end end
  182. raise "Please place \"DRG Inventory System "+
  183.   "VX Compatibility Patch\" above this script" if VX && !$drg_inv_sys_vx
  184. #==============================================================================
  185. # ** Window_Welcome
  186. #------------------------------------------------------------------------------
  187. #  Window for the welcome at the top.
  188. #==============================================================================
  189.  
  190. class Window_Welcome < Window_Base
  191.   #--------------------------------------------------------------------------
  192.   # * Object Initialization
  193.   #--------------------------------------------------------------------------
  194.   def initialize(about = nil)
  195.     case about
  196.     when nil,'help'
  197.       super(0, 0, 640, 64)
  198.     when 'statistic'
  199.       super(352, 64, 288, 416)
  200.     end
  201.     self.contents = Bitmap.new(width - 32, height - 32)
  202.     self.contents.font.name = "Sylfaen"
  203.     refresh if about == nil
  204.   end
  205.  
  206.   def refresh(x=nil)
  207.     self.contents.clear
  208.     @text,@align = "#{$game_party.limit_inventory.slots.size} / " +
  209.             "#{$game_party.limit_inventory.max_size}",4
  210.     return self.contents.draw_text(0, 0, 255, 32,  x.to_s, 4) if !x.nil?
  211.     actor = $game_actors[$game_party.inventory].name rescue ''
  212.     text = sprintf(LiTTleDRAgo::ITEM_WELCOME,actor)
  213.     self.contents.draw_text(0, 0, 255, 32,  text, 4)
  214.     if $game_party.limit_inventory.nil?
  215.       $game_party.limit_inventory =
  216.       Game_LimitedInventory.new(LiTTleDRAgo::DEFAULT_MAX_SIZE)
  217.     end
  218.     self.contents.draw_text(550,0,100,32, @text ,@align )
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # * Set Text
  222.   #--------------------------------------------------------------------------
  223.   def set_text(text, align = 0)
  224.     if text != @text or align != @align
  225.       self.contents.clear
  226.       self.contents.font.color = normal_color
  227.       self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
  228.       @text,@align = text, align
  229.     end
  230.   end
  231. end #of class
  232. #==============================================================================
  233. # ** Window_Command
  234. #------------------------------------------------------------------------------
  235. #  This window deals with general command choices.
  236. #==============================================================================
  237. class Window_Command
  238.   attr_accessor :commands
  239. end
  240.  
  241. #==============================================================================
  242. # ** Window_Target
  243. #------------------------------------------------------------------------------
  244. #  This window selects a use target for the actor on item and skill screens.
  245. #==============================================================================
  246.  
  247. class Window_Target < Window_Selectable_Drago
  248.   #--------------------------------------------------------------------------
  249.   # * Object Initialization
  250.   #--------------------------------------------------------------------------
  251.   def initialize
  252.     super(202, 170, 288, 160)
  253.     self.contents = Bitmap.new(width - 32, height - 32)
  254.     self.contents.font.name = "Sylfaen"
  255.     self.z += 10
  256.     @item_max = $game_party.actors.size
  257.     @column_max = 4
  258.   end
  259.   def refresh() update_cursor_rect end
  260.   #--------------------------------------------------------------------------
  261.   # * Cursor Rectangle Update
  262.   #--------------------------------------------------------------------------
  263.   def update_cursor_rect
  264.     self.contents.clear
  265.     for i in 0...$game_party.actors.size
  266.       x = 10 + i * 60
  267.       y = 0
  268.       actor = $game_party.actors[i]
  269.       draw_actor_name(actor, x, y)
  270.       draw_actor_graphic(actor, x + 20, y + 80)
  271.       draw_actor_level2(actor, x, y + 66)
  272.     end
  273.     actor = $game_party.actors[self.index]
  274.     x = y = 0
  275.     draw_actor_hp(actor, x + 60, y + 86)
  276.     VX ? draw_actor_mp(actor, x + 60, y + 106) :
  277.       draw_actor_sp(actor, x + 60, y + 106)
  278.     if @index <= -2
  279.       self.cursor_rect.set(0, (@index + 10) * 60, 60, 96)
  280.     elsif @index == -1
  281.       self.cursor_rect.set(0, 0, 60, @item_max * 116 - 20)
  282.     else
  283.       self.cursor_rect.set(@index * 60, 0, 60, 96)
  284.     end
  285.   end
  286. end
  287.  
  288. #==============================================================================
  289. # ** Scene_Item
  290. #------------------------------------------------------------------------------
  291. #  This class performs item screen processing.
  292. #==============================================================================
  293.  
  294. class Scene_Item
  295.   #--------------------------------------------------------------------------
  296.   # * Stats Text Update
  297.   #   -- If Item = Item -> Item_Values
  298.   #   -- If Item = Weapon -> Weapon_Values
  299.   #   -- If Item = Armor -> Armor_Values
  300.   #--------------------------------------------------------------------------
  301.   def update_stats
  302.     @x, @y = 0, 0
  303.     unless @hp_word
  304.       # Create Default Word Values
  305.       if !VX
  306.         @hp_word =  "#{$data_system.words.hp} :"
  307.         @sp_word =  "#{$data_system.words.sp} :"
  308.         @str_word =  "#{$data_system.words.str} :"
  309.         @dex_word =  "#{$data_system.words.dex} :"
  310.         @agi_word =  "#{$data_system.words.agi} :"
  311.         @int_word =  "#{$data_system.words.int} :"
  312.         @atk_word =  "#{$data_system.words.atk} :"
  313.         @pdef_word =  "#{$data_system.words.pdef} :"
  314.         @mdef_word =  "#{$data_system.words.mdef} :"
  315.         @guard_word = "#{$data_system.words.guard} :"
  316.       else
  317.         @hp_word =  "#{Vocab.hp} :"
  318.         @sp_word =  "#{Vocab.mp} :"
  319.         @str_word =  ''#Vocab.str
  320.         @dex_word =  ''#Vocab.dex
  321.         @agi_word =  "#{Vocab.agi} :"
  322.         @int_word =  "#{Vocab.spi} :"
  323.         @atk_word =  "#{Vocab.atk} :"
  324.         @pdef_word =  "#{Vocab.def} :"
  325.         @mdef_word =  ''#Vocab.mdef
  326.         @guard_word = "#{Vocab.guard} :"
  327.       end
  328.     end
  329.     if @item_window[0].active && @item_window[0].item != 0
  330.       @item = @item_window[0].item
  331.       update_item
  332.     elsif @item_window[1].active &&  @item_window[1].item != 0
  333.       @item = @item_window[1].item
  334.     end
  335.     case @item
  336.     when RPG::Item
  337.       number = $game_party.item_number(@item.id)
  338.       update_item_values if window_index_update?
  339.     when RPG::Weapon
  340.       number = $game_party.weapon_number(@item.id)
  341.       update_weapon_values if window_index_update?
  342.     when RPG::Armor
  343.       number = $game_party.armor_number(@item.id)
  344.       update_armor_values if window_index_update?
  345.     end
  346.   end
  347.   def window_index_update?
  348.     if @must_update
  349.       @must_update = nil
  350.       return true
  351.     elsif @item_window[0].active && @old_index != @item_window[0].index
  352.       @old_index = @item_window[0].index
  353.       return true
  354.     elsif @item_window[1].active && @old_index != @item_window[1].index
  355.       @old_index = @item_window[1].index
  356.       return true
  357.     end
  358.     return false
  359.   end
  360.   #--------------------------------------------------------------------------
  361.   # * Set Rarity
  362.   #--------------------------------------------------------------------------
  363.   def set_rarity(about='',id=0)
  364.     rarity = LiTTleDRAgo::RARITY rescue {}
  365.     if rarity[about] != nil && rarity[about][id] != nil && !$drg_inv_sys_no_star
  366.       rarity[about][id].abs.times do |i|
  367.         src_rect = Rect.new(0, 0, 24, 24)
  368.         cache = VX ? Cache : RPG::Cache
  369.         icon = cache.icon('star') rescue 'no_icon'
  370.         if icon == 'no_icon'
  371.           opac = @item_window[2].opacity
  372.           @item_window[2].opacity -= 150
  373.           $drg_inv_sys_no_star = true
  374.           report_missing_image('star.png','Icons')
  375.           @item_window[2].opacity = opac
  376.         else
  377.           @statistics_window.contents.blt(@x-32*i+230, @y + 24, icon, src_rect)
  378.         end
  379.       end
  380.     end
  381.   end
  382.   #--------------------------------------------------------------------------
  383.   # * Update Item Values
  384.   #--------------------------------------------------------------------------
  385.   def update_item_values
  386.     @statistics_window.contents.clear
  387.     @statistics_window.contents.font.color = Color.new(192, 224, 255, 255)
  388.     @statistics_window.contents.font.bold = true
  389.     set_rarity('Item',@item.id)
  390.     @statistics_window.contents.draw_text(@x,@y,212,32, "Name: ", 0)    
  391.     @statistics_window.contents.draw_text(@x,@y+42,212,32, "Description:", 0)
  392.     @statistics_window.contents.draw_text(@x,@y+106,212,32, "Item Type: ", 0)
  393.     @statistics_window.contents.draw_text(@x,@y+140,212,32, "Statistics: ", 0)
  394.     @statistics_window.contents.font.bold = false
  395.     @statistics_window.contents.font.color = Color.new(255, 255, 255, 255)
  396.     @statistics_window.contents.draw_text(@x + 60, @y, 212, 32, @item.name, 0)
  397.     description = @item.description
  398.     @statistics_window.contents.draw_text(@x, @y + 62, 252, 32, description, 0)
  399.     @statistics_window.contents.draw_text(@x + 95, @y + 106, 212, 32, "Item", 0)
  400.     begin
  401.       return if @item.card?
  402.     rescue
  403.       nil
  404.     end
  405.     @statistics_window.contents.font.color = Color.new(192, 224, 255, 255)
  406.     @statistics_window.contents.draw_text(@x,@y+165,212,32,"Enhancements: ",0)
  407.     @statistics_window.contents.draw_text(@x,@y+185,212,32,"Range: ", 0)
  408.     @statistics_window.contents.draw_text(@x,@y+205,212,32,"Recovery: ",0)
  409.     @statistics_window.contents.draw_text(@x,@y+225,212,32,"Elements: ",0)
  410.     @statistics_window.contents.draw_text(@x,@y+245,212,32,"Status Effects: ",0)
  411.     @statistics_window.contents.font.color = Color.new(255, 255, 255, 255)
  412.     text = case @item.parameter_type
  413.     when 0 then "None"
  414.     when 1 then "Max #{@hp_word} + #{@item.parameter_points}"
  415.     when 2 then "Max #{@sp_word} + #{@item.parameter_points}"
  416.     when 3 then "#{@str_word} + #{@item.parameter_points}"
  417.     when 4 then "#{@dex_word} + #{@item.parameter_points}"
  418.     when 5 then "#{@agi_word} + #{@item.parameter_points}"
  419.     when 6 then "#{@int_word} + #{@item.parameter_points}"
  420.     end
  421.     @statistics_window.contents.draw_text(@x + 110, @y + 165, 212, 32, text, 0)
  422.     text = case @item.scope
  423.     when 0 then "None"
  424.     when 1 then "One Enemy"
  425.     when 2 then "All Enemies"
  426.     when 3 then "One Ally"
  427.     when 4 then "All Allies"
  428.     when 5 then "One Ally"
  429.     when 6 then "All Allies"
  430.     when 7 then "This User"
  431.     end
  432.     @statistics_window.contents.draw_text(@x + 110, @y + 185, 212, 32, text, 0)
  433.     rec = VX ? [@item.hp_recovery,@item.mp_recovery] :
  434.                [@item.recover_hp,@item.recover_sp]
  435.     @statistics_window.contents.font.color = Color.new(255, 255, 255, 255)
  436.     @statistics_window.contents.draw_text(@x+110,@y+205,212,32,"#{rec[0]} HP",0)
  437.     @statistics_window.contents.font.color = Color.new(255, 255, 255, 255)
  438.     @statistics_window.contents.draw_text(@x+180,@y+205,212,32,"#{rec[1]} SP",0)
  439.     @element = ""
  440.     flag = false
  441.     @item.element_set.each {|i| @element += ", " if flag
  442.                 @element += $data_system.elements[i]
  443.                 flag = true }
  444.     @element = "None" if @element == ""
  445.     @status = ""
  446.     flag = false
  447.     @item.plus_state_set.each {|i| @status += ", " if flag
  448.                 @status += $data_states[i].name
  449.                 flag = true }
  450.     @status = "None" if @status == ""
  451.     @statistics_window.contents.draw_text(@x+110,@y+230,420,24, @element, 0)
  452.     @statistics_window.contents.draw_text(@x+110,@y+250,420,24, @status, 0)
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # * Update Weapon Values
  456.   #--------------------------------------------------------------------------
  457.   def update_weapon_values
  458.     @statistics_window.contents.clear
  459.     @statistics_window.contents.font.color = Color.new(192, 224, 255, 255)
  460.     @statistics_window.contents.font.bold = true
  461.     set_rarity('Weapon',@item.id)
  462.     vy = VX ? -60 : 0
  463.     @statistics_window.contents.draw_text(@x,@y,212,32,"Name: ",0)
  464.     @statistics_window.contents.draw_text(@x,@y + 42,212,32,"Description:",0)
  465.     @statistics_window.contents.draw_text(@x,@y + 106,212,32,"Item Type: ",0)
  466.     @statistics_window.contents.draw_text(@x,@y + 140,212,32,"Statistics: ",0)
  467.     @statistics_window.contents.font.bold = false
  468.     @statistics_window.contents.font.color = Color.new(255, 255, 255, 255)
  469.     @statistics_window.contents.draw_text(@x + 60,@y,212,32,@item.name,0)
  470.     @statistics_window.contents.draw_text(@x,@y + 62,252,32,@item.description,0)
  471.     @statistics_window.contents.draw_text(@x + 95,@y + 106,212,32,"Weapon",0)
  472.     @statistics_window.contents.font.color = Color.new(192, 224, 255, 255)
  473.     @statistics_window.contents.draw_text(@x,@y+165,212,32,@atk_word)
  474.     @statistics_window.contents.draw_text(@x,@y+185,212,32,@pdef_word)
  475.     @statistics_window.contents.draw_text(@x,@y+205,212,32,@mdef_word)
  476.     @statistics_window.contents.draw_text(@x,@y+225,212,32,@str_word)
  477.     @statistics_window.contents.draw_text(@x,@y+245,212,32,@dex_word)
  478.     @statistics_window.contents.draw_text(@x,@y+265+vy,212,32,@agi_word)
  479.     @statistics_window.contents.draw_text(@x,@y+285+vy,212,32,@int_word)
  480.     @statistics_window.contents.draw_text(@x,@y+305+vy,212,32,"Elements: ")
  481.     @statistics_window.contents.draw_text(@x,@y+325+vy,212,32,"Status Effects: ")
  482.     @statistics_window.contents.font.color = Color.new(255, 255, 255, 255)
  483.     atk = @item.atk
  484.     pdef = VX ? @item.def : @item.pdef
  485.     mdef = VX ? '' : @item.mdef
  486.     str_plus = VX ? '' : @item.str_plus
  487.     dex_plus = VX ? '' : @item.dex_plus
  488.     agi_plus = VX ? @item.agi : @item.agi_plus
  489.     int_plus = VX ? @item.spi : @item.int_plus
  490.     @statistics_window.contents.draw_text(@x+120,@y+165,212,32,"#{atk}")
  491.     @statistics_window.contents.draw_text(@x+120,@y+185,212,32,"#{pdef}")
  492.     @statistics_window.contents.draw_text(@x+120,@y+205,212,32,"#{mdef}")
  493.     @statistics_window.contents.draw_text(@x+120,@y+225,212,32,"#{str_plus}")
  494.     @statistics_window.contents.draw_text(@x+120,@y+245,212,32,"#{dex_plus}")
  495.     @statistics_window.contents.draw_text(@x+120,@y+265+vy,212,32,"#{agi_plus}")
  496.     @statistics_window.contents.draw_text(@x+120,@y+285+vy,212,32,"#{int_plus}")
  497.     @element = @status = ""
  498.     flag = false
  499.     @item.element_set.each {|i| @element += ", " if flag
  500.                 @element += $data_system.elements[i]
  501.                 flag = true }
  502.     @element = "None" if @element == ""
  503.     flag = false
  504.     stateset = VX ? @item.state_set : @item.plus_state_set
  505.     stateset.each {|i| @status += ", " if flag
  506.                 @status += $data_states[i].name
  507.                 flag = true }
  508.     @status = "None" if @status == ""
  509.     @statistics_window.contents.draw_text(@x+120, @y+310+vy, 420, 24, @element)
  510.     @statistics_window.contents.draw_text(@x+120, @y+330+vy, 420, 24, @status)
  511.   end
  512.   #--------------------------------------------------------------------------
  513.   # * Update Armor Values
  514.   #--------------------------------------------------------------------------
  515.   def update_armor_values
  516.     @statistics_window.contents.clear
  517.     @statistics_window.contents.font.color = Color.new(192, 224, 255, 255)
  518.     @statistics_window.contents.font.bold = true
  519.     set_rarity('Armor',@item.id)
  520.     vy = VX ? -60 : 0
  521.     @statistics_window.contents.draw_text(@x, @y, 212, 32, "Name: ", 0)
  522.     @statistics_window.contents.draw_text(@x, @y+42, 212, 32, "Description:", 0)
  523.     @statistics_window.contents.draw_text(@x, @y+106, 212, 32, "Item Type: ", 0)
  524.     @statistics_window.contents.draw_text(@x, @y+140, 212, 32, "Statistics: ", 0)
  525.     @statistics_window.contents.font.bold = false
  526.     @statistics_window.contents.font.color = Color.new(255, 255, 255, 255)
  527.     @statistics_window.contents.draw_text(@x+60, @y, 212, 32, @item.name, 0)
  528.     @statistics_window.contents.draw_text(@x, @y+62, 252, 32, @item.description, 0)
  529.     kind_word = VX ? eval("Vocab.armor#{@item.kind + 1}") :
  530.           $data_system.words.send("armor#{@item.kind + 1}")
  531.     @statistics_window.contents.draw_text(@x + 95, @y + 106, 212, 32, "Armor -> #{kind_word}", 0)
  532.     @statistics_window.contents.font.color = Color.new(192, 224, 255, 255)
  533.     @statistics_window.contents.draw_text(@x, @y+165, 212, 32, @pdef_word)
  534.     @statistics_window.contents.draw_text(@x, @y+185, 212, 32, @mdef_word)
  535.     @statistics_window.contents.draw_text(@x, @y+205+vy/3, 212, 32, "EVA : ")
  536.     @statistics_window.contents.draw_text(@x, @y+225, 212, 32, @str_word)
  537.     @statistics_window.contents.draw_text(@x, @y+245, 212, 32, @dex_word)
  538.     @statistics_window.contents.draw_text(@x, @y+265+vy, 212, 32, @agi_word)
  539.     @statistics_window.contents.draw_text(@x, @y+285+vy, 212, 32, @int_word)
  540.     @statistics_window.contents.draw_text(@x, @y+305+vy, 212, 32, "Guard Elements: ")
  541.     @statistics_window.contents.draw_text(@x, @y+325+vy, 212, 32, "Guard Effects: ")
  542.     @statistics_window.contents.font.color = Color.new(255, 255, 255, 255)
  543.     pdef = VX ? "#{@item.def}" : @item.pdef
  544.     mdef = VX ? '' : @item.mdef
  545.     eva = @item.eva
  546.     str = VX ? '' : @item.str_plus
  547.     dex = VX ? '' : @item.dex_plus
  548.     agi = VX ? @item.agi : @item.agi_plus
  549.     int = VX ? @item.spi : @item.int_plus
  550.     @statistics_window.contents.draw_text(@x+120, @y+165, 212, 32, "#{pdef}")
  551.     @statistics_window.contents.draw_text(@x+120, @y+185, 212, 32, "#{mdef}")
  552.     @statistics_window.contents.draw_text(@x+120, @y+205+vy/3, 212, 32, "#{eva}")
  553.     @statistics_window.contents.draw_text(@x+120, @y+225, 212, 32, "#{str}")
  554.     @statistics_window.contents.draw_text(@x+120, @y+245, 212, 32, "#{dex}")
  555.     @statistics_window.contents.draw_text(@x+120, @y+265+vy, 212, 32, "#{agi}")
  556.     @statistics_window.contents.draw_text(@x+120, @y+285+vy, 212, 32, "#{int}")
  557.     @element = @status = ""
  558.     flag = false
  559.     stateset = VX ? @item.state_set : @item.guard_state_set
  560.     guardset = VX ? @item.element_set : @item.guard_element_set
  561.     guardset.each {|i| @element += ", " if flag
  562.                 @element += $data_system.elements[i]
  563.                 flag = true }
  564.     @element = "None" if @element == ""
  565.     flag = false
  566.     stateset.each {|i| @status += ", " if flag
  567.                 @status += $data_states[i].name
  568.                 flag = true }
  569.     @status = "None" if @status == ""
  570.     @statistics_window.contents.draw_text(@x+120, @y+310+vy, 420, 24, @element)
  571.     @statistics_window.contents.draw_text(@x+120, @y+330+vy, 420, 24, @status)
  572.   end
  573. end #of class
  574. #==============================================================================
  575. # ** Game Actor
  576. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  577. #  Summary of Changes:
  578. #    aliased method - equip
  579. #==============================================================================
  580. class Game_Actor < Game_Battler
  581.   unless VX
  582.     alias drg146_equip equip unless method_defined?(:drg146_equip)
  583.   else
  584.     alias drg146_equip change_equip unless method_defined?(:drg146_equip)
  585.   end
  586.   def change_equip(*args) equip(*args) end if VX
  587.   def equip_fix?(*args) fix_equipment end if VX
  588.   def equip(*args)
  589.     max = $game_party.limit_inventory.max_size
  590.     $game_party.limit_inventory.resize (max+1)
  591.     drg146_equip(*args)
  592.     if false && !$game_temp.slots_to_discard.slots.empty?
  593.       $game_temp.slots_to_discard.slots.reverse.each { |slot|
  594.         break unless $game_party.limit_inventory.enough_space? (slot)
  595.         item, type, id, n = slot.item, slot.item_type, slot.item_id, slot.amount
  596.         $game_party.gain_item(item, n)
  597.         $game_temp.slots_to_discard.remove_item (type, id, n) }
  598.       end
  599.     $game_party.limit_inventory.resize (max)
  600.   end
  601. end
  602. #==============================================================================
  603. # ** Game Actor
  604. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  605. #  Summary of Changes:
  606. #    new public instance variables - slots_to_discard
  607. #==============================================================================
  608. class Game_Temp
  609.   alias drg137_init initialize unless method_defined?(:drg137_init)
  610.   attr_accessor :slots_to_discard,:inventory
  611.   def initialize
  612.     drg137_init
  613.     @slots_to_discard = Game_LimitedInventory.new(-1)
  614.   end
  615. end
  616. #==============================================================================
  617. # ** Game_Party
  618. #------------------------------------------------------------------------------
  619. #  This class handles the party. It includes information on amount of gold
  620. #  and items. Refer to "$game_party" for the instance of this class.
  621. #==============================================================================
  622. class Game_Party
  623.   #--------------------------------------------------------------------------
  624.   # * Number of Inventories (Value must be > 1)
  625.   #--------------------------------------------------------------------------
  626.   Inventories = 9999
  627.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  628.   # * Public Instance Variables
  629.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  630.   attr_reader :inventories
  631.   attr_accessor :inventory,:gold,:disable_combine,:disable_equip
  632.   attr_accessor :no_multi_use
  633.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  634.   # * Aliased Method
  635.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  636.   alias drg137_init initialize unless method_defined?(:drg137_init)
  637.   alias drg146_can_use item_can_use? unless method_defined?(:drg146_can_use)
  638.   alias drg146_number item_number unless method_defined?(:drg146_number)
  639.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  640.   # * Object Initialization
  641.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  642.   def initialize
  643.     drg137_init
  644.     @limit_inventory = {} if @limit_inventory.nil?
  645.     init_multi_inventory
  646.   end
  647.  
  648.   def limit_inventory(id=@inventory)
  649.     @limit_inventory = {} if @limit_inventory.nil?
  650.     if @limit_inventory[id].nil?
  651.       @limit_inventory[id] =
  652.           Game_LimitedInventory.new(LiTTleDRAgo::DEFAULT_MAX_SIZE)
  653.     end
  654.     return @limit_inventory[id]
  655.   end
  656.  
  657.   def limit_inventory=(val,id=@inventory)
  658.     @limit_inventory = {} if @limit_inventory.nil?
  659.     if @limit_inventory[id].nil?
  660.       @limit_inventory[id] =
  661.           Game_LimitedInventory.new (LiTTleDRAgo::DEFAULT_MAX_SIZE)
  662.     end
  663.     return @limit_inventory[id] = val
  664.   end
  665.  
  666.   def stack_item(item_id)
  667.     stack = LiTTleDRAgo::DEFAULT_ITEM_STACK
  668.     return stack[item_id] if !stack[item_id].nil?
  669.     return stack[0]
  670.   end  
  671.  
  672.   if VX
  673.     def actors() members end
  674.     def weapon_number(v) item_number($data_weapons[v]) end
  675.     def armor_number(v) item_number($data_armors[v]) end
  676.     def item_can_use?(item)
  677.       item = $data_items[item] if item.is_a?(Integer)
  678.       drg146_can_use(item)
  679.     end
  680.     def item_number(item)
  681.       item = $data_items[item] if item.is_a?(Integer)
  682.       drg146_number(item)
  683.     end
  684.   end
  685.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  686.   # * Gain Item (or Lose)
  687.   #       item  >> item / item_id
  688.   #       n     >> number
  689.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  690.   def drg137_gain_item(id, n)
  691.     @items[id] = [item_number(id) + n, 0].max if id > 0
  692.   end
  693.   def drg137_gain_weapon(id, n)
  694.     @weapons[id] = [weapon_number(id) + n, 0].max if id > 0
  695.   end
  696.   def drg137_gain_armor(id, n)
  697.     @armors[id] = [armor_number(id) + n, 0].max if id > 0
  698.   end
  699.  
  700.   def gain_item(item, n, include_equip = false)
  701.     return if item.nil?
  702.     case item
  703.     when RPG::Item, Numeric
  704.       array = item.is_a?(RPG::Item) ? [item,item.id] : [$data_items[item],item]
  705.       @ammount = n
  706.       while @ammount > 1
  707.         gain_proses(array[0], 1)
  708.         drg137_gain_item (array[1], 1)
  709.         @ammount -= 1
  710.       end
  711.       gain_proses(array[0], @ammount)
  712.       drg137_gain_item (array[1], @ammount)
  713.     when RPG::Weapon then gain_weapon(item.id, n)
  714.     when RPG::Armor  then gain_armor (item.id, n)
  715.     end
  716.     return unless VX
  717.     number = item_number(item)
  718.     n += number
  719.     if include_equip and n < 0
  720.       for actor in members
  721.         while n < 0 and actor.equips.include?(item)
  722.           actor.discard_equip(item)
  723.           n += 1
  724.         end
  725.       end
  726.     end
  727.   end
  728.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  729.   # * Gain Weapon And Armor (or Lose)
  730.   #       item_id  >> weapon / armor id
  731.   #       n        >> number
  732.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  733.   def gain_weapon(item_id, n)
  734.     @ammount = n
  735.     while @ammount > 1
  736.       drg137_gain_weapon (item_id, 1)
  737.       gain_proses($data_weapons[item_id],1)
  738.       @ammount -= 1
  739.     end
  740.     drg137_gain_weapon (item_id, @ammount)
  741.     gain_proses($data_weapons[item_id],@ammount)
  742.   end
  743.  
  744.   def gain_armor(item_id, n)
  745.     @ammount = n
  746.     while @ammount > 1
  747.       drg137_gain_armor (item_id, 1)
  748.       gain_proses($data_armors[item_id],1)
  749.       @ammount -= 1
  750.     end
  751.     drg137_gain_armor (item_id, @ammount)
  752.     gain_proses($data_armors[item_id],@ammount)
  753.   end
  754.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  755.   # * Reduce_Item (for synchronize default item number and limited item number)
  756.   #       item  >> item
  757.   #       n     >> number
  758.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  759.   def reduce_item(item, n)
  760.     case item
  761.     when RPG::Item then  drg137_gain_item (item.id, -n)
  762.     when RPG::Weapon then drg137_gain_weapon (item.id, -n)
  763.     when RPG::Armor then drg137_gain_armor (item.id, -n)
  764.     end
  765.   end
  766.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  767.   # * Gain Proses
  768.   #       item  >> item
  769.   #       n     >> number
  770.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  771.   def gain_proses(item,n)
  772.     return if item == nil
  773.     type = item.is_a? (RPG::Item) ? 0 : item.is_a? (RPG::Weapon) ? 1 : 2
  774.     if n > 0
  775.       n2 = limit_inventory.add_item (type, item.id, n)
  776.       n -= n2
  777.       if LiTTleDRAgo::NONDISCARD[type].include?(item.id)
  778.         while n2 > 0
  779.           for i in 0...limit_inventory.slots.size
  780.             x = limit_inventory.slots.size - 1 - i
  781.             slot = limit_inventory.slots[x]
  782.             if !LiTTleDRAgo::NONDISCARD[slot.item_type].include?(slot.item_id)
  783.               l_type, id = slot.item_type, slot.item_id
  784.               while l_type == slot.item_type && id == slot.item_id
  785.                 x -= 1
  786.                 slot = limit_inventory.slots[x]
  787.               end
  788.               l_item, l_n = limit_inventory.slots[x + 1].item, limit_inventory.slots[x + 1].amount
  789.               break
  790.             end
  791.           end
  792.           return if l_item.nil? or l_n.nil?
  793.           gain_proses(l_item, -1*l_n)
  794.           $game_temp.slots_to_discard.add_item (l_type, id, l_n)
  795.           n3 = limit_inventory.add_item (type, item.id, n2)
  796.           n -= n3
  797.           n2 = n3
  798.         end
  799.       end
  800.     else
  801.       n2 = limit_inventory.remove_item (type, item.id, -1*n)
  802.       n += n2
  803.       n2 *= -1
  804.     end
  805.     if n2 > 0
  806.       $game_temp.slots_to_discard.add_item (type, item.id, n2)
  807.     elsif n2 < 0
  808.       $game_temp.slots_to_discard.remove_item (type, item.id, -1*n2)
  809.     end
  810.   end
  811.   #--------------------------------------------------------------------------
  812.   # * Item Number
  813.   #--------------------------------------------------------------------------
  814.   def all_item_number(item)
  815.     case item
  816.     when RPG::Item   then item_number(item.id)
  817.     when RPG::Weapon then weapon_number(item.id)
  818.     when RPG::Armor  then armor_number(item.id)
  819.     end
  820.   end
  821.  
  822.   def transfer_item(item, n, invent, target)
  823.     item = $data_items[item] if item.is_a?(Integer)
  824.     transfer_process(item, n, invent, target)
  825.   end
  826.  
  827.   def transfer_weapon(item, n, invent, target)
  828.     item = $data_weapons[item] if item.is_a?(Integer)
  829.     transfer_process(item, n, invent, target)
  830.   end
  831.  
  832.   def transfer_armor(item, n, invent, target)
  833.     item = $data_armors[item] if item.is_a?(Integer)
  834.     transfer_process(item, n, invent, target)
  835.   end
  836.  
  837.   def transfer_process(item, n, invent, target)
  838.     return if item.nil? || invent == target
  839.     type = item.is_a? (RPG::Item) ? 0 : item.is_a? (RPG::Weapon) ? 1 : 2
  840.     d = @inventory
  841.     stack = item.is_a?(RPG::Item) ?
  842.               (LiTTleDRAgo::DEFAULT_ITEM_STACK[item.id] ||
  843.               LiTTleDRAgo::DEFAULT_ITEM_STACK[0]) : 1
  844.     n.times {
  845.       slot = limit_inventory(target).slots
  846.       limit_max = limit_inventory(target).max_size
  847.       number =  all_item_number(item)
  848.       unless slot.size >= limit_max && (number <= 0 || (number % stack) == 0)
  849.         switch_inventory(invent)
  850.         if all_item_number(item) >= 1
  851.           gain_item(item, -1)
  852.           switch_inventory(target)
  853.           gain_item(item, 1)
  854.         end
  855.       end}
  856.     switch_inventory(d)
  857.   end
  858.   #--------------------------------------------------------------------------
  859.   # * Initialize Multi Inventory
  860.   #--------------------------------------------------------------------------
  861.   def init_multi_inventory
  862.     @inventories = [[@items, @weapons, @armors, @gold]]
  863.     @inventories.push(*Array.new(Inventories - 1) {[{}, {}, {}, 0]})
  864.     @inventory = 1
  865.   end
  866.   #--------------------------------------------------------------------------
  867.   # * Switch Inventory
  868.   #--------------------------------------------------------------------------
  869.   def switch_inventory(id)
  870.     return if @inventory == id
  871.     init_multi_inventory if @inventories.nil?
  872.     new_inventory = @inventories[id]
  873.     @inventories[@inventory] = [@items, @weapons, @armors, @gold]
  874.     @items = new_inventory[0]
  875.     @weapons = new_inventory[1]
  876.     @armors = new_inventory[2]
  877.     @gold = new_inventory[3]
  878.     @inventory = id
  879.   end
  880.   #--------------------------------------------------------------------------
  881.   # * Destroy Inventory
  882.   #--------------------------------------------------------------------------
  883.   def destroy_inventory(id=0)
  884.     init_multi_inventory if @inventories.nil?
  885.     @inventories[id] = [{}, {}, {}, 0]
  886.     if @inventory == id
  887.       @items,@weapons,@armors,gold = {}, {}, {}, 0
  888.       limit_inventory.clear
  889.     end
  890.   end
  891.   #--------------------------------------------------------------------------
  892.   # * Resize Inventory
  893.   #--------------------------------------------------------------------------
  894.   def resize_inventory(new_size)
  895.     $game_party.limit_inventory.resize(new_size)
  896.   end
  897.   #--------------------------------------------------------------------------
  898.   # * Combine Inventory
  899.   #--------------------------------------------------------------------------
  900.   def combine_inventory(base_id, merge_id, overflow = false)
  901.     base_id = @inventory if base_id == nil
  902.     base, merge = @inventories[base_id], @inventories[merge_id]
  903.     base_items, base_weapons, base_armors, base_gold = base
  904.     items, weapons, armors, gold = merge
  905.     items.each do |item_id, amount|
  906.       number = base_items[item_id].to_i + amount
  907.       items[item_id] = overflow && number > 99 ? number - 99 : 0
  908.       base_items[item_id] = overflow && number > 99 ? 99 : number
  909.     end
  910.     weapons.each do |weapon_id, amount|
  911.       number = base_weapons[weapon_id].to_i + amount
  912.       weapons[weapon_id] = overflow && number > 99 ? number - 99 : 0
  913.       base_weapons[weapon_id] = overflow && number > 99 ? 99 : number
  914.     end
  915.     armors.each do |armor_id, amount|
  916.       number = base_armors[armor_id].to_i + amount
  917.       armors[armor_id] = overflow && number > 99 ? number - 99 : 0
  918.       base_armors[armor_id] = overflow && number > 99 ? 99 : number
  919.     end
  920.     number = base_gold + gold
  921.     base[3] = overflow && number > 9999999 ? 9999999 : number
  922.     merge[3] = overflow && number > 9999999 ? number - 9999999 : 0
  923.   end
  924. end
  925. #==============================================================================
  926. # ** Interpreter
  927. #------------------------------------------------------------------------------
  928. #  This interpreter runs event commands. This class is used within the
  929. #  Game_System class and the Game_Event class.
  930. #==============================================================================
  931. eval "
  932. class #{VX ? 'Game_' : ''}Interpreter
  933.  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  934.  # * Resize Inventory (change inventory size)
  935.  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  936.  def resize_inventory(new_size)
  937.    $game_party.limit_inventory.resize (new_size)
  938.  end
  939.  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  940.  # * Command End
  941.  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  942.  alias new_command_end command_end unless method_defined?(:new_command_end) ||
  943.                                           !method_defined?(:command_end)
  944.  def command_end
  945.    new_command_end
  946.    check_discard_item
  947.  end
  948.  def check_discard_item
  949.    $scene = Scene_Loot.new  unless $game_temp.slots_to_discard.slots.empty?
  950.  end
  951. end#"
  952.  
  953. #==============================================================================
  954. # ** Scene Equip
  955. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  956. #  Summary of Changes:
  957. #    aliased method - main
  958. #==============================================================================
  959. class Scene_Equip
  960.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  961.   # * Main
  962.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  963.   alias drg137_main main unless method_defined?(:drg137_main)
  964.   def main
  965.     drg137_main
  966.     $scene = Scene_Loot.new if !$game_temp.slots_to_discard.slots.empty?
  967.   end
  968. end
  969.  
  970. #==============================================================================
  971. # ** Scene Battle
  972. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  973. #  Summary of Changes:
  974. #    aliased method - battle_end
  975. #==============================================================================
  976. class Scene_Battle
  977.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  978.   # * battle_end
  979.   #     open up loot management if inventory is full in the end of battle
  980.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  981.   alias drg137_battle_end battle_end unless method_defined?(:drg137_battle_end)
  982.   def battle_end(result)
  983.     drg137_battle_end (result)
  984.     if !$game_temp.slots_to_discard.slots.empty? && !$scene.is_a? (Scene_Gameover)
  985.       $scene = Scene_Loot.new
  986.     end
  987.   end
  988. end
  989.  
  990. #==============================================================================
  991. # ** Game LimInvSlot
  992. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  993. #  This class holds the data on a single slot of the inventory
  994. #==============================================================================
  995. class Game_LimInvSlot
  996.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  997.   # * Public Instance Variables
  998.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  999.   attr_reader   :item_type
  1000.   attr_reader   :item_id
  1001.   attr_reader   :amount
  1002.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1003.   # * Object Initialization
  1004.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1005.   def initialize
  1006.     @item_type = -1
  1007.     @item_id = 0
  1008.     @amount = 0
  1009.   end
  1010.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1011.   # * Add Item
  1012.   #    n         >> the amount to add
  1013.   #    item_type >> the type of item being added
  1014.   #    item_id   >> the ID of item being added
  1015.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1016.   def add_item (n, item_type = -1, item_id = 0)
  1017.     if item_type != -1
  1018.       @item_type = item_type
  1019.       @item_id = item_id
  1020.     end
  1021.     if n > space_left
  1022.       @amount += space_left
  1023.       return n - space_left
  1024.     else
  1025.       @amount += n
  1026.       return 0
  1027.     end
  1028.   end
  1029.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1030.   # * Remove Item
  1031.   #    n >> the amount to remove
  1032.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1033.   def remove_item (n)
  1034.     @amount -= n
  1035.     if @amount <= 0
  1036.       n = -1*@amount
  1037.       @item_type = -1
  1038.       @item_id = 0
  1039.       @amount = 0
  1040.       return n
  1041.     end
  1042.     return 0
  1043.   end
  1044.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1045.   # * Item
  1046.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1047.   def item
  1048.     return case @item_type
  1049.     when -1 then nil
  1050.     when 0 then $data_items[@item_id]
  1051.     when 1 then $data_weapons[@item_id]
  1052.     when 2 then $data_armors[@item_id]
  1053.     end
  1054.   end
  1055.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1056.   # * Space Left
  1057.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1058.   def space_left
  1059.     return 1 if item == nil
  1060.     if item.is_a?(RPG::Item)
  1061.       stack = LiTTleDRAgo::DEFAULT_ITEM_STACK
  1062.       return stack[item.id] - @amount if !stack[item.id].nil?
  1063.       return stack[0] - @amount
  1064.     end
  1065.     return 1 - @amount
  1066.   end
  1067.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1068.   # * Equal?
  1069.   #    other : another Game_LimInvSlot
  1070.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1071.   def == (other)
  1072.     return false if !other.is_a? (Game_LimInvSlot)
  1073.     return false if other.item_type != @item_type
  1074.     return false if other.item_id != @item_id
  1075.     return false if other.amount != @amount
  1076.     return super (other)
  1077.   end
  1078. end
  1079.  
  1080. #==============================================================================
  1081. # ** Game_LimitedInventory
  1082. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1083. #  This is an array to store the party's inventory
  1084. #==============================================================================
  1085. class Game_LimitedInventory
  1086.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1087.   # * Public Instance Variable
  1088.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1089.   attr_reader   :max_size
  1090.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1091.   # * Object Initialization
  1092.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1093.   def initialize (size)
  1094.     @max_size = size
  1095.     clear
  1096.   end
  1097.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1098.   # * Clear
  1099.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1100.   def clear()  @items,@weapons,@armors = [],[],[] end
  1101.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1102.   # * Resize
  1103.   #    size : the number of slots available
  1104.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1105.   def resize (size)
  1106.     old_size = slots.size
  1107.     if size < old_size
  1108.       index = slots.size - 1
  1109.       while slots.size > size
  1110.         slot = slots[index]
  1111.         if !LiTTleDRAgo::NONDISCARD[slot.item_type].include?(slot.item_id)
  1112.           type, id, n = slot.item_type, slot.item_id, slot.amount
  1113.           remove_item (type, id, n)
  1114.           $game_temp.slots_to_discard.add_item (type, id, n)
  1115.           index -= 1
  1116.         else
  1117.           index -= 1
  1118.         end
  1119.         break if index < 0
  1120.       end
  1121.     end
  1122.     @max_size = size
  1123.   end
  1124.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1125.   # * Add Item
  1126.   #    type : the type of item being added
  1127.   #    id   : the ID of item being added
  1128.   #    n    : the amount to add
  1129.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1130.   def add_item (type, id, n = 1)
  1131.     array = case type
  1132.     when 0 then @items
  1133.     when 1 then @weapons
  1134.     when 2 then @armors
  1135.     end
  1136.     sort_index = 0
  1137.     array.each { |slot|
  1138.       if slot.item_id == id
  1139.         n = slot.add_item (n, type, id)
  1140.         break if n == 0
  1141.         sort_index += 1
  1142.       elsif slot.item_id < id
  1143.         sort_index += 1
  1144.       else
  1145.         break
  1146.       end }
  1147.     if n > 0
  1148.       while @max_size == -1 || ((@items.size + @weapons.size + @armors.size) < @max_size)
  1149.         slot = Game_LimInvSlot.new
  1150.         n = slot.add_item (n, type, id)
  1151.         array.insert (sort_index, slot)
  1152.         sort_index += 1
  1153.         break if n == 0
  1154.       end
  1155.     end
  1156.     return n
  1157.   end
  1158.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1159.   # * Remove Item
  1160.   #    type : the type of item being removed
  1161.   #    id   : the ID of item being removed
  1162.   #    n    : the amount to remove
  1163.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1164.   def remove_item (type, id, n = 1)
  1165.     array = case type
  1166.     when 0 then @items
  1167.     when 1 then @weapons
  1168.     when 2 then @armors
  1169.     end
  1170.     array.reverse.each { |slot|
  1171.       if slot.item_type == type && slot.item_id == id
  1172.         n = slot.remove_item (n)
  1173.         array.delete (slot) if slot.amount == 0
  1174.         break if n == 0
  1175.       end }
  1176.     return n
  1177.   end
  1178.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1179.   # * Remove Item
  1180.   #    type : the type of item being removed
  1181.   #    id   : the ID of item being removed
  1182.   #    n    : the amount to remove
  1183.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1184.   def remove_item_reverse (type, id, n = 1)
  1185.     array = case type
  1186.     when 0 then @items
  1187.     when 1 then @weapons
  1188.     when 2 then @armors
  1189.     end
  1190.     array.each { |slot|
  1191.       if slot.item_type == type && slot.item_id == id
  1192.         n = slot.remove_item (n)
  1193.         array.delete (slot) if slot.amount == 0
  1194.         break if n == 0
  1195.       end }
  1196.     return n
  1197.   end
  1198.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1199.   # * Slots
  1200.   #    get all slot in the inventory
  1201.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1202.   def slots
  1203.     return @items + @weapons + @armors
  1204.   end
  1205.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1206.   # * slot
  1207.   #    get slot for the certain item
  1208.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1209.   def slot(item)
  1210.     array = @items
  1211.     array = @weapons if item.is_a?(RPG::Weapon)
  1212.     array = @armors if item.is_a?(RPG::Armor)
  1213.     for i in 0...array.size
  1214.       slot = array[i]
  1215.       break if slot.item_id == item.id
  1216.     end
  1217.     return slot
  1218.   end
  1219.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1220.   # * slot
  1221.   #    get slot for the certain item
  1222.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1223.   def slot_reverse(item)
  1224.     array = @items
  1225.     array = @weapons if item.is_a?(RPG::Weapon)
  1226.     array = @armors if item.is_a?(RPG::Armor)
  1227.     array.reverse!
  1228.     for i in 0...array.size
  1229.       slot = array[i]
  1230.       break if slot.item_id == item.id
  1231.     end
  1232.     return slot
  1233.   end
  1234.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1235.   # * Check Space
  1236.   #    slot : an Game_InvSlot object
  1237.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1238.   def enough_space? (slot)
  1239.     return true if @max_size == -1 || slots.size < @max_size
  1240.     array = [@items, @weapons, @armors][slot.item_type]
  1241.     array.each { |i|
  1242.       if i.item_id > slot.item_id
  1243.         break
  1244.       elsif i.item_id == slot.item_id
  1245.         l = LiTTleDRAgo::DEFAULT_ITEM_STACK
  1246.         l = l[i.item_id].nil? ? l[0] : l[i.item_id]
  1247.         x = slot.item.is_a?(RPG::Item) ? l : 1
  1248.         break if i.space_left == 0
  1249.         return true if i.space_left < x
  1250.       end }
  1251.     return false
  1252.   end
  1253.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1254.   # * Equals?
  1255.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1256.   def == (other)
  1257.     return false unless other.is_a? (Game_LimitedInventory)
  1258.     return false if @max_size != other.max_size
  1259.     return false if slots != other.slots
  1260.     return super (other)
  1261.   end
  1262.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1263.   # * Cek Amount
  1264.   #    cek amount of an item in the inventory
  1265.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1266.   def cek_amount(type, id)
  1267.     array = case type
  1268.     when 0 then @items
  1269.     when 1 then @weapons
  1270.     when 2 then @armors
  1271.     end
  1272.     @n = 0
  1273.     array.each { |slot|  @n += slot.amount if slot.item_id == id   }
  1274.     return @n
  1275.   end
  1276. end
  1277.  
  1278. #==============================================================================
  1279. # ** Window_Item
  1280. #------------------------------------------------------------------------------
  1281. #  The Item Grid Window. Based off a 10 column coding.
  1282. #==============================================================================
  1283. class Window_Item_Fake_Grid < Window_Selectable_Drago
  1284.  #--------------------------------------------------------------------------
  1285.  # * Public Instance Variables
  1286.  #--------------------------------------------------------------------------
  1287.  attr_accessor :item
  1288.   #--------------------------------------------------------------------------
  1289.   # * Object Initialization
  1290.   #--------------------------------------------------------------------------
  1291.   def initialize(inventory = $game_party.limit_inventory,
  1292.                  discard = $game_temp.slots_to_discard )
  1293.     s = inventory.is_a?(Array) ? inventory.size :
  1294.            $game_party.limit_inventory.max_size
  1295.            
  1296.     if s >= 35 &&  $scene.is_a?(Scene_Loot)
  1297.       super(55, 160, 200+32, 32*6)
  1298.       @column_max = 6
  1299.     else
  1300.       if s <= 10 then super(100, 200, 200, 32*3)
  1301.       elsif s <= 15 then super(100, 200, 200, 32*4)
  1302.       elsif s <= 24 then super(80, 180, 200+32, 32*5)
  1303.       elsif s <= 30 then super(80, 160, 200+32, 32*6)
  1304.       elsif s <= 42 then super(60, 140, 200+32*2, 32*7)
  1305.       elsif s <= 49 then super(60, 120, 200+32*2, 32*8)
  1306.       elsif s <= 56 then super(40, 120, 200+32*3, 32*8)
  1307.       elsif s <= 64 then super(40, 100, 200+32*3, 32*9)
  1308.       elsif s <= 72 then super(20, 100, 200+32*4, 32*9)
  1309.       elsif s <= 81 then super(20, 70, 200+32*4, 32*10)
  1310.       elsif s <= 90 then super(0, 70, 200+32*5, 32*10)
  1311.       elsif s <= 100 then super(0, 70, 200+32*5, 32*10)
  1312.       elsif s <= 110 then super(0, 68, 200+32*5, 32*10)
  1313.       else super(0, 64, 200+32*5, 32*10)
  1314.       end
  1315.       if s <= 10 then @column_max = 5
  1316.       elsif s <= 15 then @column_max = 5
  1317.       elsif s <= 24 then @column_max = 6
  1318.       elsif s <= 30 then @column_max = 6
  1319.       elsif s <= 42 then @column_max = 7
  1320.       elsif s <= 49 then @column_max = 7
  1321.       elsif s <= 56 then @column_max = 8
  1322.       elsif s <= 64 then @column_max = 8
  1323.       elsif s <= 72 then @column_max = 9
  1324.       elsif s <= 81 then @column_max = 9
  1325.       elsif s <= 90 then @column_max = 10
  1326.       elsif s <= 100 then @column_max = 10
  1327.       elsif s <= 110 then @column_max = 10
  1328.       else @column_max = 10
  1329.       end
  1330.     end
  1331.     @inventory = inventory
  1332.     return self.contents = Bitmap.new(width-32, height-32) if inventory == nil
  1333.     return self.contents = Bitmap.new(width-32, height-32) if discard == nil
  1334.     self.opacity = 0
  1335.     refresh
  1336.     self.index = 0
  1337.     if $game_temp.in_battle
  1338.       self.x = 144
  1339.       self.y = 64
  1340.       self.back_opacity = 250
  1341.     end
  1342.   end
  1343.   #--------------------------------------------------------------------------
  1344.   # * Get Inventory
  1345.   #--------------------------------------------------------------------------
  1346.   def inventory() @inventory end
  1347.   #--------------------------------------------------------------------------
  1348.   # * Get Disabled Text Color
  1349.   #--------------------------------------------------------------------------
  1350.   def disabled_color() Color.new(255, 255, 255, 128) end
  1351.   #--------------------------------------------------------------------------
  1352.   # * Update Cursor Rectangle
  1353.   #--------------------------------------------------------------------------
  1354.   def update_cursor_rect
  1355.     return if @inventory == nil
  1356.     return  self.cursor_rect.empty if @index < 0
  1357.     row = @index / @column_max
  1358.     self.top_row = row if row < self.top_row
  1359.     if row > self.top_row + (self.page_row_max - 1)
  1360.       self.top_row = row - (self.page_row_max - 1)
  1361.     end
  1362.     cursor_width = self.width / @column_max - 32
  1363.     cursor_width =  32
  1364.     x = @index % @column_max * (cursor_width)
  1365.     y = @index / @column_max * 32 - self.oy
  1366.     self.cursor_rect.set(x, y, cursor_width, 32)
  1367.   end
  1368.   #--------------------------------------------------------------------------
  1369.   # * Get Item
  1370.   #--------------------------------------------------------------------------
  1371.   def item
  1372.     return nil if @data[self.index] == nil
  1373.     return @data[self.index].item
  1374.   end
  1375.   #--------------------------------------------------------------------------
  1376.   # * Refresh
  1377.   #--------------------------------------------------------------------------
  1378.   def refresh
  1379.     return if @inventory == nil
  1380.     if self.contents != nil
  1381.       self.contents.dispose
  1382.       self.contents = nil
  1383.     end
  1384.     @data = []
  1385.     @inventory.slots.each {|slot| @data.push(slot) if slot.item != nil }
  1386.     @item_max = @data.size
  1387.     if @data.size > 0
  1388.       self.contents = Bitmap.new(width - 32, row_max * 32)
  1389.       @data.each_index {|i|   draw_item(i)}
  1390.     end
  1391.   end
  1392.   #--------------------------------------------------------------------------
  1393.   # * Draw Item
  1394.   #     index : item number
  1395.   #--------------------------------------------------------------------------
  1396.   def draw_item(index)
  1397.     return if @inventory == nil || @data[index] == nil
  1398.     item, number = @data[index].item, @data[index].amount
  1399.     if item.is_a?(RPG::Item) && $game_party.item_can_use?(item.id)
  1400.       self.contents.font.color = normal_color
  1401.     else
  1402.       self.contents.font.color = disabled_color
  1403.     end
  1404.     x = index % @column_max * (32) +2
  1405.     y = index / @column_max * 32
  1406.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1407.     self.contents.font.size = 18
  1408.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1409.     opacity = self.contents.font.color == normal_color ? 255 : 128
  1410.     unless VX
  1411.       bitmap = RPG::Cache.icon(item.icon_name) rescue RPG::Cache.icon('')
  1412.       self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1413.     else
  1414.       draw_icon(item.icon_index, x, y, opacity == 255)
  1415.     end
  1416.     if item.is_a?(RPG::Item) && number > 1
  1417.        self.contents.draw_text(x + 2-5, y + 9+1, 32, 32, "#{number}", 2)
  1418.     end
  1419.   end
  1420.   #------------------------------------------------------------------------
  1421.   # * Update Help Text
  1422.   #------------------------------------------------------------------------
  1423.   def update_help
  1424.     @help_window.set_text(self.item.nil? ? '' :
  1425.       "#{self.item.name} : #{self.item.description}")
  1426.   end
  1427. end
  1428. #==============================================================================
  1429. # ** Window Item Count
  1430. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1431. #  Class for title of the inventory
  1432. #==============================================================================
  1433. class Window_Item_Count < Window_Base
  1434.   #--------------------------------------------------------------------------
  1435.   # * Object Initialization
  1436.   #    inventory >> an Game_LimitedInventory object
  1437.   #--------------------------------------------------------------------------
  1438.   def initialize(inventory)
  1439.     super(0, 64+15, 320, 64)
  1440.     @inventory = inventory
  1441.     self.x = 320 if inventory == $game_temp.slots_to_discard
  1442.     self.contents = Bitmap.new(width - 32, height - 32)
  1443.     self.contents.font.name = "Sylfaen"
  1444.     refresh
  1445.   end
  1446.   #--------------------------------------------------------------------------
  1447.   # * Refresh
  1448.   #--------------------------------------------------------------------------
  1449.   def refresh
  1450.     self.contents.clear
  1451.     width = self.contents.width
  1452.     actor = $game_actors[$game_party.inventory].name rescue ''
  1453.     text = sprintf(LiTTleDRAgo::PARTY_INV,actor)
  1454.     if @inventory == $game_party.limit_inventory
  1455.       self.contents.draw_text(0,0,width,32,text)
  1456.       self.contents.draw_text(0,0,width,32,@inventory.slots.size.to_s + " / " + @inventory.max_size.to_s,2)
  1457.     else
  1458.       self.contents.draw_text(0,0,width,32,LiTTleDRAgo::LOOT_INV)
  1459.     end
  1460.   end
  1461. end
  1462.  
  1463. class Window_Eq_Show < Window_Base
  1464.   def initialize(actor=nil)
  1465.     super(0, 152, 200, 176)
  1466.     @actor = actor
  1467.     self.contents = Bitmap.new(width - 32, height - 32)
  1468.     return if actor.nil?
  1469.     refresh
  1470.   end
  1471.   def refresh(s=nil)
  1472.     @actor = s if !s.nil?
  1473.     @arm = [] if @arm.nil?
  1474.     if !@actor.nil? && (@actor != @old_act ||
  1475.       @actor.weapon_id != @arm[0] ||
  1476.       @actor.armor1_id != @arm[1] ||
  1477.       @actor.armor2_id != @arm[2] ||
  1478.       @actor.armor3_id != @arm[3] ||
  1479.       @actor.armor4_id != @arm[4])
  1480.       @old_act = @actor
  1481.       @arm = [@actor.weapon_id, @actor.armor1_id, @actor.armor2_id,
  1482.               @actor.armor3_id, @actor.armor4_id]
  1483.       self.contents.clear
  1484.       self.contents.font.color = system_color
  1485.       draw_item_name($data_weapons[@arm[0]], 0 , 0)
  1486.       draw_item_name($data_armors[@arm[1]], 0 , 28*1)
  1487.       draw_item_name($data_armors[@arm[2]], 0 , 28*2)
  1488.       draw_item_name($data_armors[@arm[3]], 0 , 28*3)
  1489.       draw_item_name($data_armors[@arm[4]], 0 , 28*4)
  1490.     end
  1491.   end
  1492. end
  1493.  
  1494. #==============================================================================
  1495. # ** Scene_Item
  1496. #------------------------------------------------------------------------------
  1497. #  This class performs item screen processing.
  1498. #==============================================================================
  1499.  
  1500. class Scene_Item
  1501.   #--------------------------------------------------------------------------
  1502.   # * Initialize
  1503.   #--------------------------------------------------------------------------
  1504.   def initialize(inv=$game_party.inventory)
  1505.     $game_temp.inventory = $game_party.inventory
  1506.     $game_party.switch_inventory(inv)
  1507.   end
  1508.   #--------------------------------------------------------------------------
  1509.   # * Main Processing
  1510.   #--------------------------------------------------------------------------
  1511.   def main
  1512.     # Make help window
  1513.     @help_window = Window_Help.new
  1514.     @help_window.z = -10
  1515.     @help_window.x = 999
  1516.     @item_window = []
  1517.     @item_window[0] = Window_Item_Fake_Grid.new
  1518.     @item_window[1] = Window_Item_Fake_Grid.new
  1519.     @item_window.each {|i| i.help_window = @help_window }
  1520.     @item_window[2] = Window_Item_Fake_Grid.new(nil)
  1521.     create_inv_com_window
  1522.     @statistics_window = Window_Welcome.new('statistic')
  1523.     @welcome_window    = Window_Welcome.new
  1524.     @target_window     = Window_Target.new
  1525.     @window_eq         = Window_Eq_Show.new
  1526.     @additional_window = [@statistics_window, @welcome_window ,
  1527.                           @target_window,@window_eq,@help_window]
  1528.     @all_window = [@additional_window,@item_window,@invcom_window].flatten
  1529.     @window_eq.active = false
  1530.     @statistics_window.x = 999
  1531.     #@statistics_window.visible = false
  1532.     @target_window.active = false
  1533.     @target_window.visible = false
  1534.     @item_window[1].active = false
  1535.     @item_window[1].visible = false
  1536.     @item_window[0].z += 100
  1537.     @item_window[1].z += 100
  1538.     @item_window[2].z = @item_window[0].z - 10
  1539.     @target_window.z = @item_window[0].z + 50
  1540.     @window_eq.x = -200
  1541.     @window_eq.z = @item_window[0].z + 100
  1542.     @welcome_window.refresh
  1543.     @statistics_window.y -= 40
  1544.     @statistics_window.z = 99
  1545.     @welcome_window.y = 405
  1546.     @welcome_window.x = -200
  1547.     unless $drg_inv_sys_no_layout
  1548.       @welcome_window.opacity = 0
  1549.       @welcome_window.contents_opacity = 0
  1550.     end
  1551.     @slide = true
  1552.     Graphics.transition(LiTTleDRAgo::TRAN_TIME, 'Graphics/Transitions/' +
  1553.           LiTTleDRAgo::TRAN_TYPE) rescue Graphics.transition
  1554.     while $scene == self
  1555.       [Graphics,Input].each {|i| i.update}
  1556.       update
  1557.     end
  1558.     30.times {    @welcome_window.x += 20
  1559.                   @help_window.x += 20
  1560.                   @item_window.each {|i| i.x += 20 }
  1561.                   @window_eq.x -= 20
  1562.                   @statistics_window.x += 15
  1563.                   Graphics.update  
  1564.                   @item_lay.opacity -= 15
  1565.                   @item_lay.zoom_x += 0.2
  1566.                   @help_window.contents_opacity -= 15     }
  1567.     Graphics.freeze
  1568.     @all_window.each {|i| i.dispose if !i.nil? && !i.disposed? rescue nil }
  1569.     exit_normalize_inventory
  1570.     return unless !$game_temp.slots_to_discard.slots.empty? &&
  1571.                                !$scene.is_a?(Scene_Gameover)
  1572.     $scene = Scene_Loot.new($game_party.inventory)
  1573.   end
  1574.   #--------------------------------------------------------------------------
  1575.   # * exit_normalize_inventory
  1576.   #--------------------------------------------------------------------------
  1577.   def exit_normalize_inventory
  1578.     return unless $game_temp.inventory != $game_party.inventory
  1579.     $game_party.switch_inventory($game_temp.inventory)
  1580.   end
  1581.   #--------------------------------------------------------------------------
  1582.   # * create_inv_com_window
  1583.   #--------------------------------------------------------------------------
  1584.   def create_inv_com_window
  1585.     @invcom_window = []
  1586.     comb = combine_not_exist? ? '' : LiTTleDRAgo::COMBINE_COM
  1587.     equ = equip_not_exist? ? '' : LiTTleDRAgo::EQ_COM
  1588.     del = [LiTTleDRAgo::DIS_COM, LiTTleDRAgo::CANCEL_COM]
  1589.     use = LiTTleDRAgo::USE_COM
  1590.     nocomb = combine_not_exist? ||  $game_party.disable_combine
  1591.     noeq = equip_not_exist? || $game_party.disable_equip
  1592.     tra = transfer_com
  1593.     if tra != ''
  1594.       @invcom_window[0] = Window_Command.new(160, nocomb ? [use,tra,del[0],del[1]] :
  1595.                               [use, tra, comb, del[0]])
  1596.       @invcom_window[1] = Window_Command.new(160,nocomb ?
  1597.                          noeq ? [del[0],tra,del[1]] : [equ,tra,del[0]] :
  1598.                          noeq ? [comb,tra,del[0],del[1]] : [comb,tra,equ,del[0]])
  1599.     else
  1600.     @invcom_window[0] = Window_Command.new(160, nocomb ? (use.to_a + del) :
  1601.                             [use, comb, del[0]])
  1602.     @invcom_window[1] = Window_Command.new(160,nocomb ?
  1603.                        noeq ? del : [equ,del[0]] :
  1604.                        noeq ? [comb,del[0],del[1]] : [comb,equ,del[0]])
  1605.     end
  1606.     @invcom_window[2] = Window_Command.new(160,[comb,del[1]])
  1607.     del = [LiTTleDRAgo::UNEQUIP_COM, LiTTleDRAgo::UNEQUIPALL_COM,
  1608.         LiTTleDRAgo::CANCEL_COM]  if noeq
  1609.     @invcom_window[3] = Window_Command.new(190,del)
  1610.     @invcom_window.each_with_index {|i,s|  i.x = s == 3 ? 228 : 258
  1611.                               i.y = 160 + 1*32
  1612.                               i.z = @item_window[0].z + 200
  1613.                               i.active = i.visible = false }
  1614.   end
  1615.   #--------------------------------------------------------------------------
  1616.   # * Frame Update
  1617.   #--------------------------------------------------------------------------
  1618.   def update
  1619.     # Update windows
  1620.     @welcome_window.update
  1621.     @help_window.update
  1622.     @item_window[0].update
  1623.     @statistics_window.x = [@statistics_window.x - 10,352].max
  1624.     @welcome_window.x = [@welcome_window.x+10,0].min
  1625.     welcome_opac = @welcome_window.contents_opacity
  1626.     @welcome_window.contents_opacity = [welcome_opac+15,255].max  
  1627.     if @window_eq_active
  1628.       @window_eq.active = true
  1629.       @actor = $game_party.actors[@target_window.index]
  1630.       @window_eq.refresh(@actor)
  1631.       @window_eq.x = [@window_eq.x+10,0].min
  1632.     else
  1633.       if @window_eq.x > -200
  1634.         @actor = $game_party.actors[@target_window.index]
  1635.         @window_eq.refresh(@actor)
  1636.         @window_eq.x -= 10
  1637.       elsif @window_eq.x <= -200
  1638.         @window_eq.active = false
  1639.       end
  1640.     end
  1641.     # If grid window is active: call update_item
  1642.     if @item_window[0].active
  1643.       update_item
  1644.       update_stats
  1645.       if VX
  1646.         @statistics_window.x += 1
  1647.         @statistics_window.x -= 1
  1648.       end
  1649.       @statistics_window.visible = @item != nil
  1650.       return
  1651.     end
  1652.     if @invcom_window[0].active || @invcom_window[1].active ||
  1653.       @invcom_window[3].active
  1654.       @invcom_window[0].update if @invcom_window[0].active
  1655.       @invcom_window[1].update if @invcom_window[1].active
  1656.       @invcom_window[3].update if @invcom_window[3].active
  1657.       return update_command
  1658.     end
  1659.     # If target window is active: call update_target
  1660.     if @target_window.active
  1661.       @target_window.update
  1662.       return update_target
  1663.     end
  1664.     if @item_window[1].active
  1665.       @item_window[1].update
  1666.       update_stats
  1667.       update_combine
  1668.       return
  1669.     end
  1670.     if @invcom_window[2].active
  1671.       @invcom_window[2].update
  1672.       return update_command
  1673.     end
  1674.   end
  1675.   #--------------------------------------------------------------------------
  1676.   # * Update Command Window
  1677.   #--------------------------------------------------------------------------
  1678.   def update_command
  1679.     if Input.trigger?(Input::B)
  1680.       return cancel_combination
  1681.     end
  1682.     if Input.trigger?(Input::C)
  1683.       if @item.is_a?(RPG::Item) && @invcom_window[0].active &&
  1684.         !@invcom_window[2].active && !@invcom_window[3].active
  1685.         nocomb = combine_not_exist? || $game_party.disable_combine
  1686.         if @invcom_window[1].commands.size != 4
  1687.           case @invcom_window[0].index
  1688.           when 0 then use_item
  1689.           when 1 then nocomb ? discard_item : combine_item
  1690.           when 2 then nocomb ? cancel_combination : discard_item
  1691.           end
  1692.         else
  1693.           case @invcom_window[0].index
  1694.           when 0 then use_item
  1695.           when 1 then transfer_item
  1696.           when 2 then nocomb ? discard_item : combine_item
  1697.           when 3 then nocomb ? cancel_combination : discard_item
  1698.           end
  1699.         end
  1700.       elsif (@item.is_a?(RPG::Weapon) || @item.is_a?(RPG::Armor)) &&
  1701.         @invcom_window[1].active && !@invcom_window[3].active
  1702.         noeq = equip_not_exist? || $game_party.disable_equip
  1703.         nocomb = 0
  1704.         nocomb += 1 if @invcom_window[1].commands.size == 2
  1705.         if @invcom_window[1].commands.size != 4
  1706.           case @invcom_window[1].index + nocomb
  1707.           when 0 then combine_item
  1708.           when 1 then noeq ? discard_item : equip_item
  1709.           when 2 then noeq ? cancel_combination : discard_item
  1710.           end
  1711.         else
  1712.           case @invcom_window[1].index + nocomb
  1713.           when 0 then combine_item
  1714.           when 1 then transfer_item
  1715.           when 2 then noeq ? discard_item : equip_item
  1716.           when 3 then noeq ? cancel_combination : discard_item
  1717.           end
  1718.         end
  1719.       elsif @invcom_window[2].active && !@invcom_window[0].active
  1720.         case @invcom_window[2].index
  1721.         when 0 then combination
  1722.         when 1 then cancel_combination
  1723.         end
  1724.       elsif @invcom_window[3].active
  1725.         case @invcom_window[3].index
  1726.         when 0 then update_unequip(0)
  1727.         when 1 then update_unequip(1)
  1728.         when 2 then cancel_combination
  1729.         end
  1730.       end
  1731.       @invcom_window.each {|i| i.index = 0 }
  1732.       return
  1733.     end
  1734.   end
  1735.   #--------------------------------------------------------------------------
  1736.   # * combine_not_exist?
  1737.   #--------------------------------------------------------------------------
  1738.   def combine_not_exist?
  1739.     result = LiTTleDRAgo::COMBINE_ITEM.nil? ||
  1740.             LiTTleDRAgo::COMBINE_ITEM == {} ||
  1741.             LiTTleDRAgo::COMBINE_ITEM == [] ||
  1742.             LiTTleDRAgo::COMBINE_COM.nil? ||
  1743.             LiTTleDRAgo::COMBINE_COM == '' rescue true
  1744.     return result
  1745.   end
  1746.   #--------------------------------------------------------------------------
  1747.   # * transfer_com
  1748.   #--------------------------------------------------------------------------
  1749.   def transfer_com
  1750.     LiTTleDRAgo::TRANSFER_COM || '' rescue ''
  1751.   end
  1752.   #--------------------------------------------------------------------------
  1753.   # * equip_not_exist?
  1754.   #--------------------------------------------------------------------------
  1755.   def equip_not_exist?
  1756.     result = LiTTleDRAgo::EQ_COM.nil? ||
  1757.              LiTTleDRAgo::EQ_COM == '' rescue true
  1758.     return result
  1759.   end
  1760.   #--------------------------------------------------------------------------
  1761.   # * cancel_combination
  1762.   #--------------------------------------------------------------------------
  1763.   def cancel_combination
  1764.     sound_play('cancel')
  1765.     @item_window[0].active = true
  1766.     @item_window[0].visible = true
  1767.     @item_window[1].active = false
  1768.     @item_window[1].visible = false
  1769.     @invcom_window.each {|i|  i.active = i.visible = false }
  1770.     @window_eq_active = nil
  1771.     @welcome_window.refresh
  1772.     return
  1773.   end
  1774.   #--------------------------------------------------------------------------
  1775.   # * Use Item Processing
  1776.   #--------------------------------------------------------------------------
  1777.   def equip_item
  1778.     @window_eq.refresh(@actor) if !@window_eq.nil?
  1779.     if @item.is_a?(RPG::Item)
  1780.       return sound_play('buzzer')
  1781.     end
  1782.     sound_play('decision')
  1783.     @invcom_window.each {|i|  i.active = i.visible = false }
  1784.     @target_window.visible = true
  1785.     @target_window.active = true
  1786.     @window_eq_active = true
  1787.     @target_window.index = 0
  1788.     @welcome_window.set_text(LiTTleDRAgo::EQUIP_WELCOME)
  1789.   end  
  1790.   #--------------------------------------------------------------------------
  1791.   # * Discard Item Processing
  1792.   #--------------------------------------------------------------------------
  1793.   def discard_item
  1794.     slot = @item_window[0].inventory.slot_reverse(@item) rescue nil
  1795.     return if slot.nil?
  1796.     type, id, n = slot.item_type, slot.item_id, slot.amount
  1797.     if LiTTleDRAgo::NONDISCARD[type].include?(id)
  1798.       return sound_play('buzzer')
  1799.     end
  1800.     $game_party.no_multi_use = true
  1801.     sound_play('decision')
  1802.     $game_party.reduce_item(@item, n)
  1803.     $game_party.limit_inventory.remove_item_reverse (type, id, n)
  1804.     @welcome_window.refresh
  1805.     @item_window.each {|i| i.refresh }
  1806.     @item_window[0].active = true
  1807.     @item_window[0].index = [@item_window[0].index - 1, 0].max
  1808.     @invcom_window.each {|i|  i.active = i.visible = false }
  1809.     $game_party.no_multi_use = false
  1810.     @window_eq_active = false
  1811.     @must_update = true
  1812.   end
  1813.   #--------------------------------------------------------------------------
  1814.   # * Transfer Item Processing
  1815.   #--------------------------------------------------------------------------
  1816.   def transfer_item
  1817.     sound_play('decision')
  1818.     @invcom_window.each {|i|  i.active = i.visible = false }
  1819.     @target_window.visible = true
  1820.     @target_window.active = true
  1821.     @window_eq_active = false
  1822.     @target_window.index = 0
  1823.     @transfer_flag = true
  1824.   end
  1825.   #--------------------------------------------------------------------------
  1826.   # * Use Item Processing
  1827.   #--------------------------------------------------------------------------
  1828.   def use_item
  1829.     unless @item.is_a?(RPG::Item)
  1830.       return sound_play('buzzer')
  1831.     end
  1832.     unless $game_party.item_can_use?(@item.id)
  1833.       return sound_play('buzzer')
  1834.     end
  1835.     sound_play('decision')
  1836.     if @item.scope >= 3
  1837.       @invcom_window.each {|i|  i.active = i.visible = false }
  1838.       @target_window.visible = true
  1839.       @target_window.active = true
  1840.       @window_eq_active = false
  1841.       if @item.scope == 4 || @item.scope == 6
  1842.         @target_window.index = -1
  1843.       else
  1844.         @target_window.index = 0
  1845.       end
  1846.     else
  1847.       if @item.common_event_id > 0
  1848.         $game_temp.common_event_id = @item.common_event_id
  1849.         sound_play('use_item')
  1850.         if @item.consumable
  1851.           @welcome_window.refresh
  1852.           $game_party.lose_item(@item.id, 1)
  1853.           @item_window[0].draw_item(@item_window[0].index)
  1854.         end
  1855.         return $scene = Scene_Map.new
  1856.       end
  1857.     end
  1858.   end  
  1859.   #--------------------------------------------------------------------------
  1860.   # * Use Item Processing
  1861.   #--------------------------------------------------------------------------
  1862.   def combine_item
  1863.     sound_play('decision')
  1864.     @invcom_window.each {|i| i.active = i.visible = false }
  1865.     @invcom_window[2].active = true
  1866.     @invcom_window[2].visible = false
  1867.     @item_window[1].active = true
  1868.     @item_window[1].visible = true
  1869.     @item_window[0].active = false
  1870.     @item_window[0].visible = false
  1871.     @window_eq_active = false
  1872.     @item_window[1].index = 0
  1873.   end  
  1874.   #--------------------------------------------------------------------------
  1875.   # * Frame Update (combine item window is active)
  1876.   #--------------------------------------------------------------------------
  1877.   def update_combine
  1878.     if Input.trigger?(Input::B)
  1879.       sound_play('cancel')
  1880.       return $scene = Scene_Menu.new(0)
  1881.     end
  1882.     if Input.trigger?(Input::C)
  1883.       @item_1 = @item_window[0].item
  1884.       @item_2 = @item_window[1].item
  1885.       if @item_1 != nil && @item_2 != nil
  1886.         c = combine_result rescue nil
  1887.         c.nil? ? @invcom_window[2].disable_item(0) : @invcom_window[2].refresh
  1888.         @item_window[1].active = false
  1889.         @invcom_window.each {|i| i.active = i.visible = false }
  1890.         @invcom_window[2].active = true
  1891.         @invcom_window[2].visible = true
  1892.         @window_eq_active = false
  1893.       else
  1894.         sound_play('buzzer')
  1895.       end
  1896.       return
  1897.     end
  1898.   end
  1899.   #--------------------------------------------------------------------------
  1900.   # * Frame Update (when item window is active)
  1901.   #--------------------------------------------------------------------------
  1902.   def update_item
  1903.     if Input.trigger?(Input::B)
  1904.       sound_play('cancel')
  1905.       return $scene = Scene_Menu.new(0)
  1906.     end
  1907.     if Input.trigger?(Input::C)
  1908.       @item = @item_window[0].item
  1909.       if @item != nil
  1910.         sound_play('decision')
  1911.         if @item.is_a?(RPG::Item)
  1912.           @item_window[0].active = false
  1913.           @invcom_window.each {|i| i.active = i.visible = false }
  1914.           @invcom_window[0].active = true
  1915.           @invcom_window[0].visible = true
  1916.         elsif @item.is_a?(RPG::Weapon) || @item.is_a?(RPG::Armor)
  1917.           @item_window[0].active = false
  1918.           @invcom_window.each {|i| i.active = i.visible = false }
  1919.           @invcom_window[1].active = true
  1920.           @invcom_window[1].visible = true
  1921.           @window_eq_active = false
  1922.         end
  1923.       else
  1924.         sound_play('buzzer')
  1925.       end
  1926.       return
  1927.     end
  1928.   end
  1929.   #--------------------------------------------------------------------------
  1930.   # * update_unequip
  1931.   #--------------------------------------------------------------------------
  1932.   def update_unequip(type=0,siz=$game_party.limit_inventory.slots.size >=
  1933.                      $game_party.limit_inventory.max_size)
  1934.     if type == 0
  1935.       if @item.is_a?(RPG::Weapon) && !@actor.equip_fix?(0) && !siz
  1936.         @actor.equip(0, 0)
  1937.         sound_play('equip')
  1938.       elsif @item.is_a?(RPG::Armor)&& !@actor.equip_fix?(@item.kind+1) && !siz
  1939.         @actor.equip(@item.kind+1, 0)
  1940.         sound_play('equip')
  1941.       else
  1942.         sound_play('buzzer')
  1943.         @welcome_window.set_text(LiTTleDRAgo::FULL_INVENTORY) if siz
  1944.       end
  1945.     else
  1946.       @play_unequip = []
  1947.       (0...4).each {|i| @play_unequip[1] =
  1948.                            ($game_party.limit_inventory.slots.size >=
  1949.                             $game_party.limit_inventory.max_size)
  1950.                         unless @actor.equip_fix?(i) || @play_unequip[1]
  1951.                           @actor.equip(i, 0)
  1952.                           @play_unequip[0] = true
  1953.                         end}
  1954.       @play_unequip[0] ? sound_play('equip') : sound_play('buzzer')
  1955.       @welcome_window.set_text(LiTTleDRAgo::FULL_INVENTORY) if @play_unequip[1]
  1956.     end
  1957.     @item_window.each {|i| i.refresh }
  1958.     @invcom_window[3].active = false
  1959.     @invcom_window[3].visible = false
  1960.     @target_window.visible = true
  1961.     @target_window.active = true
  1962.   end
  1963.   #--------------------------------------------------------------------------
  1964.   # * update_target
  1965.   #--------------------------------------------------------------------------
  1966.   def update_target
  1967.     if Input.trigger?(Input::B)
  1968.       sound_play('cancel')
  1969.       @item_window.each {|i| i.refresh }
  1970.       @item_window[0].active = true
  1971.       @target_window.visible = false
  1972.       @target_window.active = false
  1973.       @welcome_window.refresh
  1974.       return @window_eq_active = nil
  1975.     end
  1976.     if @transfer_flag
  1977.       if Input.trigger?(Input::C)
  1978.         @transfer_flag = false
  1979.         slot = @item_window[0].inventory.slot(@item) rescue nil
  1980.         return sound_play('buzzer') if slot.nil?
  1981.         type, id, n = slot.item_type, slot.item_id, slot.amount
  1982.         @actor = $game_party.actors[@target_window.index]
  1983.         sound_play('decision')
  1984.         inv = $game_party.inventory
  1985.         $game_party.transfer_process(@item,n,inv,@actor.id)
  1986.         @item_window.each {|i| i.refresh }
  1987.         @item_window[0].active = true
  1988.         @target_window.visible = false
  1989.         @target_window.active = false
  1990.         @welcome_window.refresh
  1991.         @must_update = true
  1992.       end
  1993.       return
  1994.     end
  1995.     if Input.trigger?(Input::A)
  1996.       @actor = $game_party.actors[@target_window.index]
  1997.       if @item.is_a?(RPG::Weapon) || @item.is_a?(RPG::Armor)
  1998.         sound_play('decision')
  1999.         del = [LiTTleDRAgo::UNEQUIP_COM, LiTTleDRAgo::UNEQUIPALL_COM,
  2000.               LiTTleDRAgo::CANCEL_COM]
  2001.         items = case @item
  2002.         when RPG::Weapon then 'Weapon'
  2003.         when RPG::Armor then VX ? eval("Vocab.armor#{@item.kind + 1}") :
  2004.                              $data_system.words.send("armor#{@item.kind + 1}")
  2005.         end
  2006.         @invcom_window[3].commands = ["#{del[0]} #{items}" ,del[1], del[2]]
  2007.         @invcom_window[3].refresh
  2008.         @invcom_window[3].active = true
  2009.         @invcom_window[3].visible = true
  2010.         @target_window.visible = false
  2011.         @target_window.active = false
  2012.         return @must_update = true
  2013.       end
  2014.     end
  2015.     if Input.trigger?(Input::C)
  2016.       @actor = $game_party.actors[@target_window.index]
  2017.       if @item.is_a?(RPG::Weapon) || @item.is_a?(RPG::Armor)
  2018.         if !@actor.equippable?(@item) ||
  2019.          (@item.is_a?(RPG::Weapon) && @actor.equip_fix?(0)) ||
  2020.          (@item.is_a?(RPG::Armor) && @actor.equip_fix?(@item.kind+1))
  2021.           return sound_play('buzzer')
  2022.         end
  2023.         sound_play('equip')
  2024.         if @item.is_a?(RPG::Weapon)
  2025.           @actor.equip(0, @item.nil? ? 0 : @item.id)
  2026.         elsif @item.is_a?(RPG::Armor)
  2027.           @actor.equip(@item.kind+1, @item.nil? ? 0 : @item.id)
  2028.         end
  2029.         @window_eq.refresh(@actor)
  2030.         @item_window[0].refresh    
  2031.         return @must_update = true
  2032.       end
  2033.       return sound_play('buzzer') if $game_party.item_number(@item.id) == 0  
  2034.       if @target_window.index == -1
  2035.         used = false
  2036.         for i in $game_party.actors
  2037.           used |= i.item_effect(@item)
  2038.         end
  2039.       end
  2040.       if @target_window.index >= 0
  2041.         target = $game_party.actors[@target_window.index]
  2042.         used = target.item_effect(@item)
  2043.       end
  2044.       if used
  2045.         sound_play('use_item')
  2046.         if @item.consumable
  2047.           $game_party.lose_item(@item.id, 1)
  2048.           @item_window[0].draw_item(@item_window[0].index)
  2049.           @item_window[0].refresh
  2050.           @welcome_window.refresh
  2051.         end
  2052.         @target_window.refresh
  2053.         return $scene = Scene_Gameover.new if $game_party.all_dead?
  2054.         if @item.common_event_id > 0
  2055.           $game_temp.common_event_id = @item.common_event_id
  2056.           return $scene = Scene_Map.new
  2057.         end
  2058.       end
  2059.       sound_play('buzzer') unless used
  2060.       return
  2061.     end
  2062.   end
  2063.   #--------------------------------------------------------------------------
  2064.   # * Combine Result
  2065.   #--------------------------------------------------------------------------
  2066.   def combine_result
  2067.     req, com = [], LiTTleDRAgo::COMBINE_ITEM
  2068.     req[0] = case @item_1
  2069.     when RPG::Item then 'Item(' + @item_1.id.to_s + ')'
  2070.     when RPG::Weapon then 'Weapon(' + @item_1.id.to_s + ')'
  2071.     when RPG::Armor then 'Armor(' + @item_1.id.to_s + ')'
  2072.     end
  2073.     req[1] = case @item_2
  2074.     when RPG::Item then 'Item(' + @item_2.id.to_s + ')'
  2075.     when RPG::Weapon then 'Weapon(' + @item_2.id.to_s + ')'
  2076.     when RPG::Armor then 'Armor(' + @item_2.id.to_s + ')'
  2077.     end
  2078.     req[3] = com[req[0] + ' + ' + req[1]] rescue nil
  2079.     req[3] = req[3] ? req[3] : com[req[1] + ' + ' + req[0]] rescue ''
  2080.     if req[3] =~ /item/i
  2081.       item = req[3].downcase.gsub(/item\(([0-9]+)\)/) { $1 }
  2082.       item = $data_items[item.to_i]
  2083.     elsif req[3] =~ /weapon/i
  2084.       item = req[3].downcase.gsub(/weapon\(([0-9]+)\)/) { $1 }
  2085.       item = $data_weapons[item.to_i]
  2086.     elsif req[3] =~ /armor/i
  2087.       item = req[3].downcase.gsub(/armor\(([0-9]+)\)/) { $1 }
  2088.       item = $data_armors[item.to_i]
  2089.     end
  2090.     return item
  2091.   end
  2092.   #--------------------------------------------------------------------------
  2093.   # * Item Number
  2094.   #--------------------------------------------------------------------------
  2095.   def item_number(item)
  2096.     case item
  2097.     when RPG::Item   then $game_party.item_number(item.id)
  2098.     when RPG::Weapon then $game_party.weapon_number(item.id)
  2099.     when RPG::Armor  then $game_party.armor_number(item.id)
  2100.     end
  2101.   end
  2102.   #--------------------------------------------------------------------------
  2103.   # * Combination
  2104.   #--------------------------------------------------------------------------
  2105.   def combination
  2106.     c = combine_result rescue nil
  2107.     number = [item_number(@item_1), item_number(@item_2)]
  2108.     if c != nil && ((@item_1 != @item_2 && number[0] > 0 && number[1] > 0) ||
  2109.       (@item_1 == @item_2 && number[0] > 1))
  2110.       number[2] = item_number(c)
  2111.       stack = c.is_a?(RPG::Item) ?
  2112.               (LiTTleDRAgo::DEFAULT_ITEM_STACK[c.id] ||
  2113.               LiTTleDRAgo::DEFAULT_ITEM_STACK[0]) : 1
  2114.       if slot.size>=limit_max && (number[2] <= 0 || (number[2]%stack) == 0) &&
  2115.         ((@item_1 != @item_2 && number[0] > 1 && number[1] > 1) ||
  2116.         (@item_1 == @item_2 && number[0] > 2))
  2117.         @welcome_window.refresh(LiTTleDRAgo::FULL_INVENTORY)
  2118.         return sound_play('buzzer')
  2119.       end
  2120.       $game_party.lose_item(@item_1,1)
  2121.       $game_party.lose_item(@item_2,1)
  2122.       $game_party.gain_item(c,1)
  2123.       @item_window.each {|i| i.refresh }        
  2124.       @welcome_window.refresh
  2125.       cancel_combination if item_number(@item_1) <= 0||item_number(@item_2) <= 0
  2126.       @must_update = true
  2127.       sound = LiTTleDRAgo::SOUND_COMBINE rescue ''
  2128.       return Audio.se_play("Audio/SE/#{sound}", 80, 100) rescue nil
  2129.     else
  2130.       return sound_play('buzzer')
  2131.     end
  2132.   end
  2133.  
  2134.   def slot()            $game_party.limit_inventory.slots    end
  2135.   def limit_max()       $game_party.limit_inventory.max_size end
  2136.   #--------------------------------------------------------------------------
  2137.   # Sound Play
  2138.   #--------------------------------------------------------------------------
  2139.   def sound_play(se)
  2140.     case se
  2141.     when 'cursor'
  2142.       VX ? Sound.play_cursor : $game_system.se_play($data_system.cursor_se)
  2143.     when 'cancel'
  2144.       VX ? Sound.play_cancel : $game_system.se_play($data_system.cancel_se)
  2145.     when 'equip'
  2146.       VX ? Sound.play_equip : $game_system.se_play($data_system.equip_se)
  2147.     when 'use_item'
  2148.       VX ? Sound.play_use_item : $game_system.se_play(@item.menu_se)
  2149.     when 'decision'
  2150.       VX ? VXA ? Sound.play_ok : Sound.play_decision :
  2151.       $game_system.se_play($data_system.decision_se)
  2152.     when 'buzzer'
  2153.       VX ? Sound.play_buzzer : $game_system.se_play($data_system.buzzer_se)
  2154.     end
  2155.   end
  2156.   #--------------------------------------------------------------------------
  2157.   # * report_no_star
  2158.   #--------------------------------------------------------------------------
  2159.   def report_missing_image(image,loc)
  2160.     return unless $DEBUG || $TEST
  2161.     bit = Bitmap.new(480, 72)
  2162.     bit.font.size = 16
  2163.     bit.font.bold = true
  2164.     bit.draw_text(4,52,472,24,
  2165.               "Image #{image} can\'t be found at folder #{loc}.", 1)
  2166.     Graphics.freeze
  2167.     $spr = Sprite.new
  2168.     $spr.bitmap = bit
  2169.     $spr.x, $spr.y = 320-(472/2), 240-(72/2)
  2170.     $spr.z = 1000
  2171.     Graphics.transition
  2172.     3600.times  {  [Graphics,Input].each {|i| i.update }
  2173.                     break if Input.trigger?(Input::C)  }
  2174.     Graphics.freeze
  2175.     $spr.bitmap.dispose
  2176.     $spr.dispose
  2177.     Graphics.transition
  2178.   end
  2179.   #--------------------------------------------------------------------------
  2180.   # * Create Layout
  2181.   #--------------------------------------------------------------------------
  2182.   def create_layout
  2183.     $game_temp_screen = [Graphics.width,Graphics.height] if VX
  2184.     Graphics.resize_screen(640,480) if VX
  2185.     @item_lay, @btm = Sprite.new,'Item_Lay'
  2186.     @map_back = VX ? Spriteset_Map_Drago.new : Spriteset_Map.new
  2187.     cache = VX ? Cache : RPG::Cache
  2188.     unless $drg_inv_sys_no_layout || @btm == ''
  2189.       image = cache.picture(@btm) rescue ''
  2190.       if image == ''
  2191.         report_missing_image(@btm.to_s,'Pictures')
  2192.         $drg_inv_sys_no_layout,@btm = true,''
  2193.       end
  2194.     else
  2195.       @btm = ''
  2196.     end
  2197.     @item_lay.bitmap = cache.picture(@btm)
  2198.     @item_lay.z = 100
  2199.     @mnback = Plane.new
  2200.     @btm = LiTTleDRAgo::BACKGROUND
  2201.     unless $drg_inv_sys_no_background || @btm == ''
  2202.       image = cache.picture(@btm) rescue ''
  2203.       if image == ''
  2204.         report_missing_image(@btm.to_s,'Pictures')
  2205.         $drg_inv_sys_no_background,@btm = true,''
  2206.       end
  2207.     else
  2208.       @btm = ''
  2209.     end
  2210.     @mnback.bitmap = cache.picture(@btm)
  2211.     @mnback.z = 1
  2212.     @mnback.opacity = 155
  2213.     @mnback.blend_type = 0
  2214.     @menu1 = Sprite.new
  2215.     @menu1.z = 1
  2216.     @menu1.opacity = 160
  2217.     @menu1.x = -200
  2218.     @menu1.blend_type = 2
  2219.   end
  2220.   #--------------------------------------------------------------------------
  2221.   # Dispose Layout
  2222.   #--------------------------------------------------------------------------
  2223.   def dispose_layout
  2224.     @menu1.dispose
  2225.     @mnback.dispose
  2226.     @item_lay.dispose
  2227.     @map_back.dispose if @map_back != nil
  2228.     Graphics.resize_screen($game_temp_screen[0],$game_temp_screen[1]) if VX
  2229.   end
  2230.   #--------------------------------------------------------------------------
  2231.   # Update Layout
  2232.   #--------------------------------------------------------------------------
  2233.   def update_layout
  2234.     @mnback.visible = true
  2235.     if @btm == 'MN_BacK'
  2236.       @mnback.ox += 2
  2237.       @mnback.oy += 3
  2238.     else        
  2239.       @mnback.ox += 1
  2240.       @mnback.oy += 1
  2241.     end
  2242.     @menu1.x += 50 if @menu1.x < 0
  2243.   end
  2244.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2245.   # * Aliased Method
  2246.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2247.   alias drg112_main main  unless method_defined?(:drg112_main)
  2248.   alias drg112_upd update unless method_defined?(:drg112_upd)
  2249.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2250.   # * Main Processing
  2251.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2252.   def main
  2253.     create_layout
  2254.     drg112_main
  2255.     dispose_layout
  2256.   end
  2257.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2258.   # * Frame Update
  2259.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2260.   def update
  2261.     update_layout
  2262.     drg112_upd
  2263.   end
  2264.  
  2265. end #of class
  2266. #==============================================================================
  2267. # ** Scene_Loot
  2268. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2269. #  Loot management scene
  2270. #==============================================================================
  2271. class Scene_Loot < Scene_Item
  2272.   #--------------------------------------------------------------------------
  2273.   # * MainProcessing
  2274.   #--------------------------------------------------------------------------
  2275.   def main
  2276.     dis = $game_temp.slots_to_discard
  2277.     create_layout
  2278.     @all_window = [
  2279.       @help_window     = Window_Welcome.new('help'),
  2280.       @item_window     = Window_Item_Fake_Grid.new,
  2281.       @dummy1_window   = Window_Item_Fake_Grid.new(nil),
  2282.       @loot_window     = Window_Item_Fake_Grid.new(dis),
  2283.       @dummy2_window   = Window_Item_Fake_Grid.new(dis,nil),
  2284.       @party_item_window = Window_Item_Count.new($game_party.limit_inventory),
  2285.       @loot_item_window  = Window_Item_Count.new($game_temp.slots_to_discard)]
  2286.     @item_window.help_window = @help_window
  2287.     @loot_window.help_window = @help_window
  2288.     @loot_window.active = false
  2289.     @loot_window.x = 320
  2290.     @item_window.z = @loot_window.z += 101
  2291.     @dummy2_window.x = @loot_window.x
  2292.     @all_dummy = [@dummy1_window,@dummy2_window]
  2293.     @all_party = [@party_item_window,@item_window,@dummy1_window]
  2294.     @all_loot = [@loot_item_window,@loot_window,@dummy2_window]
  2295.     @all_atas = [@party_item_window,@loot_item_window]
  2296.     if true
  2297.       @sprite_qw = Sprite.new
  2298.       @sprite_qw.bitmap = Bitmap.new(640,480)
  2299.       @sprite_qw.bitmap.font.name = "Sylfaen"
  2300.       @sprite_qw.bitmap.font.size = 50
  2301.       @sprite_qw.bitmap.draw_text(0,230,640,72,'  <Q',0)
  2302.       @sprite_qw.bitmap.draw_text(0,230,640,72,'W>  ',2)
  2303.       @sprite_qw.z = @item_window.z
  2304.       @sprite_qw.opacity = 0
  2305.       @all_window << @sprite_qw
  2306.     end
  2307.     @loot_item_window.x = 320
  2308.     @help_window.y = 405
  2309.     @help_window.x = -200
  2310.     @item_window_x = @item_window.x
  2311.     @all_atas.each {|i| i.z = @item_window.z - 200
  2312.                           i.opacity = 180 }
  2313.     @all_party.each {|i| i.x -= 320 }
  2314.     @all_loot.each {|i| i.x += 320 }
  2315.     @all_dummy.each {|i| i.z = @item_window.z - 100
  2316.                           i.opacity = 180 }
  2317.     unless $drg_inv_sys_no_layout
  2318.       @help_window.opacity = 0
  2319.       @help_window.contents_opacity = 0
  2320.     end
  2321.     Graphics.transition(LiTTleDRAgo::TRAN_TIME, 'Graphics/Transitions/' +
  2322.           LiTTleDRAgo::TRAN_TYPE) rescue Graphics.transition
  2323.     while $scene == self
  2324.       [Graphics,Input].each {|i| i.update}
  2325.       update
  2326.     end
  2327.     30.times { [Graphics,Input].each {|i| i.update}
  2328.                 @sprite_qw.opacity -= 10
  2329.                 @sprite_qw.zoom_x += 0.2
  2330.                 @sprite_qw.x -= 22
  2331.                 @help_window.x += 15    
  2332.                 @all_party.each {|i| i.x -= 10 }
  2333.                 @all_loot.each {|i| i.x += 10 }
  2334.                 @item_lay.opacity -= 10
  2335.                 @item_lay.zoom_x += 0.2}
  2336.     Graphics.freeze
  2337.     dispose_layout
  2338.     @all_window.each {|i| i.dispose if !i.nil? && !i.disposed? rescue nil }
  2339.     exit_normalize_inventory
  2340.   end
  2341.   #--------------------------------------------------------------------------
  2342.   # * update animated_position
  2343.   #--------------------------------------------------------------------------
  2344.   def update_animated_position
  2345.     @help_window.x = [@help_window.x+10,0].min
  2346.     @help_window.contents_opacity = [@help_window.contents_opacity+15,255].max
  2347.     if @party_item_window.x == 0
  2348.       @sprite_qw.opacity = [@sprite_qw.opacity+15,255].min
  2349.       if @sprite_qw.oy < 50 && !@below
  2350.         @sprite_qw.oy += 1
  2351.         @below = true if @sprite_qw.oy >= 50
  2352.       elsif @sprite_qw.oy > 0 && @below
  2353.         @sprite_qw.oy -= 1
  2354.         @below = false if @sprite_qw.oy <= 0
  2355.       end
  2356.     end
  2357.     @all_party.each_with_index {|i,s|  i.x = [i.x + 10,
  2358.                                 s == 0 ? 0 : @item_window_x].min }
  2359.     @all_loot.each_with_index {|i,s| i.x = [i.x - 10,
  2360.                         320 + (s == 0 ? 0 : (100-@item_window_x).abs)].max }
  2361.   end
  2362.   #--------------------------------------------------------------------------
  2363.   # * update Frame
  2364.   #--------------------------------------------------------------------------
  2365.   def update
  2366.     update_animated_position
  2367.     update_layout
  2368.     @all_window.each_with_index {|i,d| i.update if ![2,4].include?(d)}
  2369.     if Input.trigger?(Input::B)
  2370.       sound_play('cancel')
  2371.       if !$game_temp.slots_to_discard.slots.empty?
  2372.         $game_temp.slots_to_discard.slots.each { |slot|
  2373.           $game_party.reduce_item(slot.item, slot.amount) }
  2374.         $game_temp.slots_to_discard.clear
  2375.       end
  2376.       return  $scene = Scene_Map.new
  2377.     end
  2378.     return update_item if @item_window.active
  2379.     return update_loot if @loot_window.active
  2380.   end
  2381.   #--------------------------------------------------------------------------
  2382.   # * Update Item Window
  2383.   #--------------------------------------------------------------------------
  2384.   def update_item
  2385.     if Input.trigger?(Input::C)
  2386.       item = @item_window.item
  2387.       return if item.nil?
  2388.       slot = @item_window.inventory.slot(item)
  2389.       type, id, n = slot.item_type, slot.item_id, slot.amount
  2390.       if !LiTTleDRAgo::NONDISCARD[type].include?(item.id)
  2391.         sound_play('decision')
  2392.         $game_party.limit_inventory.remove_item (type, id, n)
  2393.         $game_temp.slots_to_discard.add_item(type, id, n)
  2394.       else
  2395.         sound_play('buzzer')
  2396.       end
  2397.       return refresh
  2398.     end
  2399.     if Input.repeat?(Input::R)
  2400.       @item_window.active = false
  2401.       @loot_window.active = true
  2402.       @loot_window.index = 0
  2403.       @item_window.index = -1
  2404.       sound_play('decision')
  2405.       return
  2406.     end
  2407.   end
  2408.   #--------------------------------------------------------------------------
  2409.   # * Update Loot Window
  2410.   #--------------------------------------------------------------------------
  2411.   def update_loot
  2412.     if Input.trigger?(Input::C)
  2413.       item = @loot_window.item
  2414.       return if item.nil?
  2415.       slot = @loot_window.inventory.slot_reverse(item)
  2416.       type, id, n = slot.item_type, slot.item_id, slot.amount
  2417.       if @item_window.inventory.enough_space? (slot)
  2418.         sound_play('decision')
  2419.         $game_party.limit_inventory.add_item (type, id, n)
  2420.         $game_temp.slots_to_discard.remove_item(type, id, n)
  2421.       else
  2422.         sound_play('buzzer')
  2423.       end
  2424.       return refresh
  2425.     end
  2426.     if Input.repeat?(Input::L)
  2427.       @item_window.active = true
  2428.       @loot_window.active = false
  2429.       @loot_window.index = -1
  2430.       @item_window.index = 0
  2431.       sound_play('decision')
  2432.       return
  2433.     end
  2434.   end
  2435.   #--------------------------------------------------------------------------
  2436.   # * Refresh Window
  2437.   #--------------------------------------------------------------------------
  2438.   def refresh()
  2439.     [@all_party,@all_loot].flatten.each {|i| i.refresh  }  
  2440.   end
  2441. end
  2442. #==============================================================================
  2443. # ** Scene_Menu
  2444. #------------------------------------------------------------------------------
  2445. #  This class performs menu screen processing.
  2446. #==============================================================================
  2447. class Scene_Menu
  2448.   if LiTTleDRAgo::TRANSFER_COM
  2449.     #--------------------------------------------------------------------------
  2450.     # * Alias Listing
  2451.     #--------------------------------------------------------------------------
  2452.     @@command = VX ? 'update_command_selection' : 'update_command'
  2453.     @@status = VX ? 'update_actor_selection' : 'update_status'
  2454.     eval "
  2455.    alias drg150_upd_com #{@@command} unless method_defined?(:drg150_upd_com)
  2456.    alias drg150_upd_sta #{@@status} unless method_defined?(:drg150_upd_sta)
  2457.    #--------------------------------------------------------------------------
  2458.    # * Frame Update (when command window is active)
  2459.    #--------------------------------------------------------------------------
  2460.    def #{@@command}
  2461.      if Input.trigger?(Input::C)
  2462.        item = Scene_Item.new
  2463.        return item.sound_play('buzzer') if $game_party.actors.size == 0
  2464.        if @command_window.index == 0
  2465.          item.sound_play('decision')
  2466.          @command_window.active = false
  2467.          @status_window.active = true
  2468.          return @status_window.index = 0
  2469.        end
  2470.      end
  2471.      drg150_upd_com
  2472.    end
  2473.    #--------------------------------------------------------------------------
  2474.    # * Frame Update (when status window is active)
  2475.    #--------------------------------------------------------------------------
  2476.    def #{@@status}
  2477.      if Input.trigger?(Input::C)
  2478.        if @command_window.index == 0
  2479.          item = Scene_Item.new
  2480.          item.sound_play('decision')
  2481.          $scene = Scene_Item.new($game_party.actors[@status_window.index].id)
  2482.          return
  2483.        end
  2484.      end
  2485.      drg150_upd_sta
  2486.    end#"
  2487.   end
  2488. end
  2489.  
  2490. class Spriteset_Map_Drago < Spriteset_Map
  2491.   #--------------------------------------------------------------------------
  2492.   # * Create Viewport
  2493.   #--------------------------------------------------------------------------
  2494.   def create_viewports
  2495.     @viewport1 = Viewport.new(0, 0, 640, 480)
  2496.     @viewport2 = Viewport.new(0, 0, 640, 480)
  2497.     @viewport3 = Viewport.new(0, 0, 640, 480)
  2498.     @viewport2.z, @viewport3.z = 50, 100
  2499.   end
  2500. end
  2501. end
  2502.  
  2503. $drg_inv_sys = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement