Guest User

Untitled

a guest
Apr 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 23.93 KB | None | 0 0
  1. #==============================================================================
  2. # ** Scene_Spoils
  3. #------------------------------------------------------------------------------
  4. #  This class controls the scene that allows the player to access chests
  5. #==============================================================================
  6. class Scene_Spoils < Scene_Base
  7.  
  8.   include Overlord_Dave::DRIACS::Settings
  9.  
  10.   #--------------------------------------------------------------------------
  11.   # * Object Initialisation
  12.   #     source : The scene from which the spoils scene was opened
  13.   #       head : The name displayed above the chest
  14.   #   chest_id : The id of the chest opened (from the $chests hash)
  15.   #--------------------------------------------------------------------------
  16.   def initialize(source, head = nil, chest_id = nil)
  17.     @source = source
  18.     @chest_id = chest_id
  19.     @max_size = chest_id.nil? ? 0 : $chests[chest_id].max_size
  20.     @spoils_head = case @source # 1: from map, 2: from menu, 3: from battle
  21.       when 1,2: USE_CONTAINER_NAME && !head.nil? && head != '' ? head : WIN_CONT_HEAD
  22.       when 3: head # the head is determined in Game_System.init_battle_spoils
  23.     end
  24.   end
  25.  
  26.   #--------------------------------------------------------------------------
  27.   # * Start processing
  28.   #--------------------------------------------------------------------------
  29.   def start
  30.     super
  31.     create_menu_background
  32.  
  33.     case SPOILS_INFO_POS
  34.       when 0
  35.         info_y = 0
  36.         titles_y = 56
  37.         items_y = 112
  38.       when 1
  39.         info_y = 360
  40.         titles_y = 0
  41.         items_y = 56
  42.     end
  43.    
  44.     @info_window = Window_Help.new
  45.     @info_window.y = info_y
  46.    
  47.     @spoils_title = Window_Help.new
  48.     @spoils_title.y = titles_y
  49.     @spoils_title.width = 544/2.0
  50.     @spoils_title.create_contents
  51.    
  52.     @inv_title = Window_Help.new
  53.     @inv_title.y = titles_y
  54.     @inv_title.x = 544/2.0
  55.     @inv_title.width = 544/2.0
  56.     @inv_title.create_contents
  57.    
  58.     @spoils_window = Window_Spoils.new(0, items_y, 544/2.0, 304)
  59.     @spoils_window.chest = $game_temp.temp_chest
  60.    
  61.     @inv_window = Window_Item.new(544/2.0, items_y, 544/2.0, 304, true)
  62.     @inv_window.column_max = 1
  63.     @inv_window.refresh
  64.     @inv_window.update
  65.    
  66.     @inv_window.index = 0
  67.     # make the spoils window active unless it is empty
  68.     if $game_temp.temp_chest.all_items == [-1]
  69.       @spoils_window.active = false
  70.       @inv_window.active = true
  71.     else
  72.       @spoils_window.active = true
  73.       @spoils_window.index = 0
  74.       @inv_window.active = false
  75.     end
  76.    
  77.     update
  78.   end
  79.  
  80.   #--------------------------------------------------------------------------
  81.   # * Makes the message window appear
  82.   #       type : the message window to display (1-5)
  83.   #        obj : and object that can be passed to the method if necessary
  84.   #              (such as for type 5)
  85.   #--------------------------------------------------------------------------
  86.   def show_message(type, obj = nil)
  87.     @message_window = case type
  88.       when 1: Window_Info.new(LEAVE_ND_MSG, 1) # from inv_window
  89.       when 2: Window_Info.new(INV_FULL, 1) # exiting with an over-size inventory
  90.       when 3: Window_Info.new(SPOILS_FULL, 2) # exiting with an over-size chest
  91.       when 4: Window_Info.new(NO_LEAVE_MSG, 1) # if a chest is not accessable
  92.       when 5: Window_List.new(WARN_FORCED_MSG, 2, obj) # forced items window
  93.       # gold found message (must check whether chest has items to find value
  94.       # of return_to)
  95.       when 6: Window_Info.new(sprintf(GOLD_FOUND, obj), $game_temp.temp_chest.all_items == [-1] ? 1 : 2)
  96.     end
  97.      
  98.     # play the shop sound for the gold message window
  99.     Sound.play_shop if type == 6 && GOLD_MSG_SOUND
  100.    
  101.     @message_window.visible = true
  102.     @spoils_window.active = false
  103.     @inv_window.active = false
  104.   end
  105.  
  106.   #--------------------------------------------------------------------------
  107.   # * Makes the message window disappear
  108.   #--------------------------------------------------------------------------
  109.   def hide_message_window
  110.     case @message_window.return_to
  111.       when 1 # return to inv_window
  112.         @inv_window.active = true
  113.         @spoils_window.active = false
  114.       when 2 # return to spoils_window
  115.         @inv_window.active = false
  116.         @spoils_window.active = true
  117.     end
  118.       @message_window.dispose
  119.       @message_window = nil
  120.   end
  121.  
  122.   #--------------------------------------------------------------------------
  123.   # * Makes the exit confirmation window appear
  124.   #       type : the message window to display (1-4)
  125.   #--------------------------------------------------------------------------
  126.   def show_exit_window(type)
  127.     if @inv_window.active
  128.       return_to = 1
  129.     elsif @spoils_window.active
  130.       return_to = 2
  131.     end
  132.     message = case type
  133.       when 0 :CONF_MSG_0
  134.       when 1 :CONF_MSG_1
  135.       when 2 :CONF_MSG_2
  136.       when 3 :E_MSG_SPOILS
  137.     end
  138.      
  139.     @inv_window.active = false
  140.     @spoils_window.active = false
  141.     if type == 3 # over-encumbered message
  142.       @exit_window = Window_Option.new(message, E_OPT1_SPOILS, E_OPT2_SPOILS, 4)
  143.     else
  144.       @exit_window = Window_Option.new(message, CONF_OPT1, CONF_OPT2)
  145.     end
  146.     @exit_window.visible = true
  147.     @exit_window.active = true
  148.     @exit_window.index = 0
  149.     @exit_window.return_to = return_to
  150.   end
  151.  
  152.   #--------------------------------------------------------------------------
  153.   # * Makes the exit confirmation window disappear
  154.   #--------------------------------------------------------------------------
  155.   def hide_exit_window
  156.     case @exit_window.return_to
  157.       when 1 # inv window
  158.         @inv_window.active = true
  159.       when 2 # spoils
  160.         @spoils_window.active = true
  161.     end
  162.     @exit_window.dispose
  163.     @exit_window = nil
  164.   end
  165.  
  166.   #--------------------------------------------------------------------------
  167.   # * Makes the option window appear when an item is selected from the inventory
  168.   #       source : which window it was called from (kept for possible future
  169.   #                features)
  170.   #--------------------------------------------------------------------------
  171.   def show_drop_choice_window(source)
  172.     case source
  173.       when 1 # inv_window
  174.         @drop_choice_window = Window_Option.new('', USE_ITEM_OPT1B, USE_ITEM_OPT2, 2)
  175.         @drop_choice_window.draw_window(@item)
  176.     end
  177.     @drop_choice_window.visible = true
  178.     @drop_choice_window.active = true
  179.     @drop_choice_window.index = 0
  180.     @spoils_window.active = false
  181.     @inv_window.active = false
  182.   end
  183.  
  184.   #--------------------------------------------------------------------------
  185.   # * Makes the option window when an item is selected from the inventory
  186.   #   disappear
  187.   #--------------------------------------------------------------------------
  188.   def hide_drop_choice_window
  189.     case @drop_choice_window.type
  190.       when 2 # from inv_window
  191.         @inv_window.active = true
  192.       when 3 # from spoils window
  193.         @spoils_window.active = true
  194.       end
  195.       @drop_choice_window.dispose
  196.       @drop_choice_window = nil
  197.   end
  198.  
  199.   #--------------------------------------------------------------------------
  200.   # * Makes the number select window appear
  201.   #       type : which message is shown above the number (1-3)
  202.   #--------------------------------------------------------------------------
  203.   def show_num_window(type)
  204.     message = case type
  205.       when 1 :LEAVE_SPOILS_MSG
  206.       when 2 :TAKE_SPOILS_MSG
  207.       when 3 :DROP_SPOILS_MSG
  208.     end
  209.      
  210.     @num_window = Window_NumSelect.new(message, type)
  211.    
  212.     @num_window.num_max = case type
  213.       when 1 :$game_party.item_number(@item)
  214.       when 2 :$game_temp.temp_chest.item_number(@item, @dropped)
  215.       when 3 :$game_party.item_number(@item)
  216.     end
  217.    
  218.     hide_drop_choice_window if !@drop_choice_window.nil?
  219.     @spoils_window.active = false
  220.     @inv_window.active = false
  221.   end
  222.  
  223.   #--------------------------------------------------------------------------
  224.   # * Makes the number select window disappear
  225.   #--------------------------------------------------------------------------
  226.   def hide_num_window
  227.     case @num_window.type
  228.       when 1
  229.         @inv_window.active = true
  230.       when 2
  231.         @spoils_window.active = true
  232.       when 3
  233.         @inv_window.active = true
  234.     end
  235.     @num_window.dispose
  236.     @num_window = nil
  237.   end
  238.  
  239.   #--------------------------------------------------------------------------
  240.   # * Determines which windows to show after an action is selected from the drop
  241.   #   choice window.
  242.   #       type : which action has been selected (1-3)
  243.   #--------------------------------------------------------------------------
  244.   def det_move_item(type)
  245.     case type
  246.       when 1 # from inv_window
  247.         case SHOW_MOVE_ITEM
  248.           when 0 # never
  249.             Sound.play_decision
  250.             leave_item(1)
  251.           when 1 # if more than one in stack
  252.             if $game_party.item_number(@item) > 1
  253.               Sound.play_decision
  254.               show_num_window(1)
  255.             else
  256.               Sound.play_decision
  257.               leave_item(1)
  258.             end
  259.           when 2 # always
  260.             Sound.play_decision
  261.             show_num_window(1)
  262.         end
  263.       when 2 # from spoils_window
  264.         if @spoils_window.index == 0 # take all selected
  265.           Sound.play_decision
  266.           take_all
  267.           return
  268.         end
  269.         case SHOW_MOVE_ITEM
  270.           when 0 # never
  271.             Sound.play_decision
  272.             take_item(1)
  273.           when 1 # if more than one in stack
  274.             if $game_temp.temp_chest.item_number(@item, @dropped) > 1
  275.               Sound.play_decision
  276.               show_num_window(2)
  277.             else
  278.               Sound.play_decision
  279.               take_item(1)
  280.             end
  281.           when 2 # always
  282.             Sound.play_decision
  283.             show_num_window(2)
  284.         end
  285.       when 3 # dropping an item
  286.         case SHOW_MOVE_ITEM
  287.           when 0 # never
  288.             Sound.play_drop
  289.             drop_item(1)
  290.           when 1 # if more than one in stack
  291.             if $game_party.item_number(@item) > 1
  292.               Sound.play_decision
  293.               show_num_window(3)
  294.             else
  295.               Sound.play_drop
  296.               drop_item(1)
  297.             end
  298.           when 2 # always
  299.             Sound.play_decision
  300.             show_num_window(3)
  301.         end
  302.     end
  303.   end
  304.  
  305.   #--------------------------------------------------------------------------
  306.   # * Moves a number of the currently selected item to the chest
  307.   #       n : the number of items to move
  308.   #--------------------------------------------------------------------------
  309.   def leave_item(n)
  310.     # these must be determineed before the inventory and chest is modified
  311.     item_lost = true if n >= $game_party.item_number(@item)
  312.     reset_chest = $game_temp.temp_chest.empty? ? true : false
  313.    
  314.     # modifying chest and inventory...
  315.     $game_party.lose_item(@item, n)
  316.     $game_temp.temp_chest.gain_item(@item, n)
  317.    
  318.     @spoils_window.index = 0 if reset_chest
  319.     @inv_window.index -= 1 unless @inv_window.index == 0 || item_lost == false
  320.    
  321.     @inv_window.refresh
  322.     @spoils_window.refresh
  323.    
  324.     hide_drop_choice_window if !@drop_choice_window.nil?
  325.   end
  326.  
  327.   #--------------------------------------------------------------------------
  328.   # * Moves a number of the currently selected item to the inventory
  329.   #       n : the number of items to move
  330.   #--------------------------------------------------------------------------
  331.   def take_item(n)
  332.     # these must be determineed before the inventory and chest is modified
  333.     if n >= $game_temp.temp_chest.item_number(@item, @dropped)
  334.       item_lost = true
  335.       item_index = @spoils_window.index
  336.     end
  337.  
  338.     # modifying chest and inventory...
  339.     $game_party.gain_item(@item, n)
  340.     $game_temp.temp_chest.lose_item(@item, n, @dropped)
  341.    
  342.     if item_lost
  343.       @spoils_window.item_max -= 1
  344.       @spoils_window.index = item_index - 1 if item_index > (@spoils_window.item_max-1)
  345.     end
  346.    
  347.     # make inventory window active if the chest is empty
  348.     if $game_temp.temp_chest.empty?
  349.       @spoils_window.active = false
  350.       @spoils_window.index = -1
  351.       @inv_window.active = true
  352.     end
  353.  
  354.     @inv_window.refresh
  355.     @spoils_window.refresh
  356.   end
  357.  
  358.   #--------------------------------------------------------------------------
  359.   # * Drops a number of the currently selected item
  360.   #       n : the number of items to drop
  361.   #--------------------------------------------------------------------------
  362.   def drop_item(n)
  363.     # these must be determineed before the inventory and chest is modified
  364.     item_lost = true if n >= $game_party.item_number(@item)
  365.     reset_chest = $game_temp.temp_chest.empty? ? true : false
  366.    
  367.     # modifying chest and inventory...
  368.     $game_party.lose_item(@item, n)
  369.     $game_temp.temp_chest.gain_item(@item, n, true)
  370.    
  371.     @spoils_window.index = 0 if reset_chest
  372.     @inv_window.index -= 1 unless @inv_window.index == 0 || item_lost == false
  373.    
  374.     @inv_window.refresh
  375.     @spoils_window.refresh
  376.    
  377.     hide_drop_choice_window if !@drop_choice_window.nil?
  378.   end
  379.  
  380.   #--------------------------------------------------------------------------
  381.   # * Takes all of the items from the chest an puts them in the player's
  382.   #   inventory.
  383.   #--------------------------------------------------------------------------
  384.   def take_all
  385.     items = $game_temp.temp_chest.all_item_objects + $game_temp.temp_chest.all_dropped_objects
  386.     index = 0
  387.    
  388.     for i in items
  389.       index += 1 # variable is required to use item_dropped? method
  390.       dropped = @spoils_window.item_dropped?(index)
  391.       $game_party.gain_item(i, $game_temp.temp_chest.item_number(i, dropped))
  392.     end
  393.    
  394.     $game_temp.temp_chest.all_items = [-1]
  395.     $game_temp.temp_chest.all_dropped = [-1]
  396.    
  397.     @inv_window.refresh
  398.     @spoils_window.refresh
  399.     @spoils_window.active = false
  400.     @spoils_window.index = -1
  401.     @inv_window.active = true
  402.   end
  403.  
  404.   #--------------------------------------------------------------------------
  405.   # * Determines which action to take when a number is chosen from the number
  406.   #   select window.
  407.   #--------------------------------------------------------------------------
  408.   def move_num_items
  409.     case @num_window.type
  410.       when -1
  411.         Print 'ERROR:  @num_window\'s source has not been set!'
  412.       when 1
  413.         Sound.play_decision
  414.         leave_item(@num_window.number)
  415.       when 2
  416.         Sound.play_decision
  417.         take_item(@num_window.number)
  418.       when 3
  419.         Sound.play_drop
  420.         drop_item(@num_window.number)
  421.     end
  422.   end
  423.  
  424.   #--------------------------------------------------------------------------
  425.   # * Determines whether it is possible for the player to exit
  426.   #   If it is possible, then confirm_exit is called.
  427.   #--------------------------------------------------------------------------
  428.   def check_exit
  429.     f_item_names = [] # any items with the 'force' tag
  430.     for i in $game_temp.temp_chest.all_item_objects
  431.       f_item_names.push(i.name) if i.force_take?
  432.     end
  433.     if f_item_names != []
  434.       Sound.play_buzzer
  435.       show_message(5, f_item_names)
  436.       return true
  437.     end
  438.    
  439.     if !ENCUMBER
  440.       if $game_party.total_inv_size <= $max_inv_size && $game_temp.temp_chest.total_size <= $game_temp.temp_chest.max_size
  441.         Sound.play_cancel
  442.         return confirm_exit
  443.       elsif $game_party.total_inv_size > $max_inv_size
  444.         Sound.play_buzzer
  445.         show_message(2)
  446.         return true
  447.       elsif $game_temp.temp_chest.total_size > $game_temp.temp_chest.max_size
  448.         if $game_temp.temp_chest.unlimited?
  449.           Sound.play_cancel
  450.           return confirm_exit
  451.         end
  452.         if !$game_temp.temp_chest.accessable?
  453.           Sound.play_cancel
  454.           return confirm_exit
  455.         end
  456.         Sound.play_buzzer
  457.         show_message(3)
  458.         return true
  459.       end
  460.     else
  461.       Sound.play_cancel
  462.       return confirm_exit
  463.     end
  464.   end
  465.  
  466.   #--------------------------------------------------------------------------
  467.   # * Determines whether to show an exit window to player, and if so which one
  468.   #--------------------------------------------------------------------------  
  469.   def confirm_exit
  470.     # these override the value of CONFIRMATION
  471.     if !CONF_EMPTY_CHEST && $game_temp.temp_chest.total_size == 0
  472.       Sound.play_cancel
  473.       do_exit
  474.       return true
  475.     elsif CONF_MODE_ZERO && $game_temp.temp_chest.mode == 0 && $game_temp.temp_chest.total_size != 0
  476.       show_exit_window(0)
  477.     else # if neither evaluate to true, check CONFIRMATION
  478.       case CONFIRMATION
  479.         when 0 # always
  480.           show_exit_window($game_temp.temp_chest.mode)
  481.         when 1 # never
  482.           Sound.play_cancel
  483.           do_exit
  484.           return true
  485.         when 2 # only if there are 'dropped' items
  486.           if $game_temp.temp_chest.all_dropped != [-1]
  487.             show_exit_window($game_temp.temp_chest.mode)
  488.           else
  489.             Sound.play_cancel
  490.             do_exit
  491.             return true
  492.           end
  493.       end
  494.     end
  495.   end
  496.  
  497.   #--------------------------------------------------------------------------
  498.   # * Exits the scene, and makes modifications to the $chests hash as
  499.   #   necessary
  500.   #       exit : variable necessary if the player is exiting whilst
  501.   #              over_encumbered.  Since 2 exit windows are called, this is
  502.   #              used to make sure the first checks the size of the inventory.
  503.   #--------------------------------------------------------------------------  
  504.   def do_exit(exit = false)
  505.     unless exit
  506.       # this is because if ENCUMBER is true then two exit windows are called one
  507.       # after the other.
  508.       if $game_party.total_inv_size > $max_inv_size && ENCUMBER && INFORM_E_SPOILS
  509.         show_exit_window(3)
  510.         return
  511.       end
  512.     end
  513.    
  514.     # empty chest if it is mode zero
  515.     if $game_temp.temp_chest.mode == 0
  516.       $game_temp.temp_chest.all_items = [-1]
  517.       $game_temp.temp_chest.active = false
  518.     end
  519.     # empty dropped items
  520.     $game_temp.temp_chest.all_dropped = [-1]
  521.     $game_temp.temp_chest.opened = true
  522.    
  523.     if $game_temp.temp_chest.is_a?(Chest) && !@chest_id.nil?
  524.       # transfer temp_chets back to $chests hash
  525.       # This does not occur if the chest is  B_Spoils object.
  526.       $chests[@chest_id] = $game_temp.temp_chest.deep_clone
  527.     end
  528.     $game_temp.temp_chest = nil
  529.    
  530.     $scene = case @source
  531.       when 1: Scene_Map.new # from map
  532.       when 2: Scene_Menu.new # from menu
  533.       when 3: Scene_Map.new # from battle
  534.     end
  535.   end
  536.  
  537.   #--------------------------------------------------------------------------
  538.   # * Termination Processing
  539.   #--------------------------------------------------------------------------
  540.   def terminate
  541.     super
  542.     dispose_menu_background
  543.     @spoils_window.dispose
  544.     @spoils_title.dispose
  545.     @inv_window.dispose
  546.     @inv_title.dispose
  547.     @info_window.dispose
  548.    
  549.     @drop_choice_window.dispose unless @drop_choice_window.nil?
  550.     @message_window.dispose unless @message_window.nil?
  551.     @exit_window.dispose unless @exit_window.nil?
  552.     @num_window.dispose unless @num_window.nil?
  553.   end
  554.  
  555.   #--------------------------------------------------------------------------
  556.   # * Updates all the window objects
  557.   #--------------------------------------------------------------------------
  558.   def update_windows
  559.     @spoils_window.update
  560.     @spoils_title.update
  561.     @inv_window.update
  562.     @inv_title.update
  563.     @info_window.update
  564.    
  565.     @drop_choice_window.update unless @drop_choice_window.nil?
  566.     @message_window.update unless @message_window.nil?
  567.     @exit_window.update unless @exit_window.nil?
  568.     @num_window.update unless @num_window.nil?
  569.   end
  570.  
  571.   #--------------------------------------------------------------------------
  572.   # * Main frame update method
  573.   #   Checks for input, and calls the appropriate sub-update method depending on
  574.   #   which windows are open.
  575.   #--------------------------------------------------------------------------
  576.   def update
  577.     super
  578.    
  579.     # for gold message delay...
  580.     @gold_counter = 0 if @gold_counter.nil?
  581.    
  582.     if @inv_window.active || @spoils_window.active
  583.       if Input.trigger?(Input::B)
  584.         return if check_exit
  585.       elsif Input.trigger?(Input::LEFT)
  586.         move_left
  587.       elsif Input.trigger?(Input::RIGHT)
  588.         move_right
  589.       end
  590.      
  591.       # checks for gold in chest
  592.       if $game_temp.temp_chest.gold != 0 && @gold_counter == GOLD_MSG_DEL
  593.         show_message(6, $game_temp.temp_chest.gold)
  594.        
  595.         $game_party.gain_gold($game_temp.temp_chest.gold)
  596.         $game_temp.temp_chest.gold = 0
  597.       end
  598.     end
  599.    
  600.     # window-dependant updates
  601.     if @inv_window.active            # Inventory window
  602.       @item = @inv_window.item
  603.       @dropped = false
  604.       update_inv_item_selection if Input.trigger?(Input::C)
  605.     elsif @spoils_window.active      # Spoils window
  606.       @item = @spoils_window.item
  607.       @dropped = @spoils_window.item_dropped?(@spoils_window.index)
  608.       det_move_item(2) if Input.trigger?(Input::C)
  609.     elsif !@message_window.nil?      # Message window
  610.       if Input.trigger?(Input::C) or Input.trigger?(Input::B)
  611.         Sound.play_cancel
  612.         hide_message_window
  613.       end
  614.     elsif !@drop_choice_window.nil?  # 'drop choice' window
  615.       update_drop_choice_window
  616.     elsif !@exit_window.nil?         # exit confirmation window
  617.       return if update_exit_window
  618.     elsif !@num_window.nil?          # number select window (drop, take or leave)
  619.       @num_window.update_num_selection
  620.       if Input.trigger?(Input::C)
  621.         Sound.play_decision
  622.         move_num_items
  623.         hide_num_window
  624.       elsif Input.trigger?(Input::B)
  625.         Sound.play_cancel
  626.         hide_num_window
  627.       end
  628.     end
  629.    
  630.     # redefine @item and @dropped before update_infos is called
  631.     if @inv_window.active           # Inventory window
  632.       @item = @inv_window.item
  633.       @dropped = false
  634.     elsif @spoils_window.active     # Spoils window
  635.       @item = @spoils_window.item
  636.       @dropped = @spoils_window.item_dropped?(@spoils_window.index)
  637.     end
  638.    
  639.     update_infos
  640.     update_windows
  641.    
  642.     # for gold message delay...
  643.     @gold_counter += 1 unless @gold_counter >= GOLD_MSG_DEL
  644.   end
  645.  
  646.   #--------------------------------------------------------------------------
  647.   # * Update exit window option selection
  648.   #--------------------------------------------------------------------------
  649.   def update_exit_window
  650.     if Input.trigger?(Input::B)
  651.       Sound.play_cancel
  652.       hide_exit_window
  653.       return false
  654.     elsif Input.trigger?(Input::C)
  655.       if @exit_window.index == 0
  656.         Sound.play_decision
  657.         exit = (@exit_window.type == 4)
  658.         hide_exit_window
  659.         # if it is the 2nd exit_window, then don't check encumberment
  660.         do_exit(exit)
  661.         return true
  662.       elsif @exit_window.index == 1
  663.         Sound.play_cancel
  664.         hide_exit_window
  665.         return false
  666.       end
  667.     end
  668.   end
  669.  
  670.   #--------------------------------------------------------------------------
  671.   # * Update drop choice window option selection
  672.   #--------------------------------------------------------------------------
  673.   def update_drop_choice_window
  674.     if Input.trigger?(Input::B)
  675.       Sound.play_cancel
  676.       hide_drop_choice_window
  677.     elsif Input.trigger?(Input::C)
  678.       case @drop_choice_window.index
  679.         when 0 # leave item
  680.           unless $game_temp.temp_chest.accessable?
  681.             Sound.play_buzzer
  682.             unless NO_LEAVE_MSG == -1
  683.               hide_drop_choice_window
  684.               show_message(4)
  685.             end
  686.             return
  687.           end
  688.           det_move_item(1)
  689.         when 1 # drop item
  690.           det_move_item(3)
  691.       end
  692.     end
  693.   end
  694.  
  695.   #------------------------------------------------------------
Add Comment
Please, Sign In to add comment