Advertisement
DrDhoom

[RGSS3] No Party Command Window

Oct 25th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.14 KB | None | 0 0
  1. module Dhoom
  2.   module NoPartyCommandWindow
  3.     Keys = [:R,:L]
  4.   end
  5. end
  6.      
  7. class Scene_Battle < Scene_Base
  8.   def start_party_command_selection
  9.     turn_start
  10.   end
  11.      
  12.   alias dhoom_npcw_scbat_update_basic update_basic
  13.   def update_basic
  14.     dhoom_npcw_scbat_update_basic
  15.     update_escape_command if @actor_command_window.active
  16.   end
  17.  
  18.   def update_escape_command
  19.     @wait_escape = 0 if @wait_escape.nil?
  20.     @wait_escape -= 1 if @wait_escape > 0
  21.     return if @try_escape
  22.     return if @wait_escape > 0
  23.     s = 0
  24.     Dhoom::NoPartyCommandWindow::Keys.each do |symbol|
  25.       if Input.press?(symbol)
  26.         s += 1
  27.       end
  28.     end
  29.     if s == Dhoom::NoPartyCommandWindow::Keys.size
  30.       if BattleManager.can_escape?
  31.         @try_escape = true
  32.         command_escape
  33.       else
  34.         Sound.play_buzzer        
  35.       end
  36.       @wait_escape = 60
  37.     end
  38.   end
  39.    
  40.   def process_escape
  41.     if BattleManager.process_escape    
  42.       process_execute_escape
  43.     else
  44.       start_actor_command_selection if BattleManager.actor
  45.       @status_window.open
  46.       @try_escape = false
  47.     end  
  48.     turn_end  
  49.   end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement