Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  2. #
  3. #Creates a normal attack button.
  4. #
  5. #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  6.  
  7. module MARU__attack_command
  8.  
  9.   #Setting
  10.  
  11.   ATTACK_BOTTAN = :X                      #Normal attack button
  12.   WINDOW_OPEN  = true                     #Whether to show a help window
  13.   WINDOW_TEXT  = "X(A key) Normal Attack" #Text content
  14.  
  15.   #End of setting
  16.  
  17. end  
  18.  
  19. #==============================================================================
  20. # ■ Window_PartyCommand
  21. #------------------------------------------------------------------------------
  22. #  This window is for selecting whether to fight or escape on the battle screen.
  23. #==============================================================================
  24. class Window_PartyCommand < Window_Command
  25.   #--------------------------------------------------------------------------
  26.   # ● Handling process such as decision and cancellation
  27.   #--------------------------------------------------------------------------
  28.   alias ma__process_handling process_handling
  29.   def process_handling
  30.     return unless open? && active
  31.     ma__process_handling
  32.     return process_a if handle?(:X) && Input.trigger?(MARU__attack_command::ATTACK_BOTTAN)
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● A key is pressed
  36.   #--------------------------------------------------------------------------
  37.   def process_a
  38.     Sound.play_ok
  39.     Input.update
  40.     deactivate
  41.     call_handler(:X)
  42.   end
  43. end
  44.  
  45. #==============================================================================
  46. # ■ Scene_Battle
  47. #------------------------------------------------------------------------------
  48. #  Class for battle screen processing.
  49. #==============================================================================
  50.  
  51. class Scene_Battle < Scene_Base
  52.   #--------------------------------------------------------------------------
  53.   # ● Create party command window
  54.   #--------------------------------------------------------------------------
  55.   alias ma__create_party_command_window create_party_command_window
  56.   def create_party_command_window
  57.     ma__create_party_command_window
  58.     @party_command_window.set_handler(:X,      method(:command_attack_all))
  59.     if MARU__attack_command::WINDOW_OPEN
  60.     @help_bot_window = Window_Selectable.new(0,Graphics.height-@party_command_window.height-48,250,48)
  61.     @help_bot_window.draw_text(0,0,232,24,MARU__attack_command::WINDOW_TEXT,1)
  62.     @help_bot_window.hide
  63.     end
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # ● Start actor command
  67.   #--------------------------------------------------------------------------
  68.   alias ma__start_actor_command_selection start_actor_command_selection
  69.   def start_actor_command_selection
  70.     @help_bot_window.hide if MARU__attack_command::WINDOW_OPEN
  71.     ma__start_actor_command_selection
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● Start party command
  75.   #--------------------------------------------------------------------------
  76.   alias ma_start_party_command_selection start_party_command_selection
  77.   def start_party_command_selection
  78.     @help_bot_window.show if MARU__attack_command::WINDOW_OPEN
  79.     ma_start_party_command_selection
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ● Command for run away
  83.   #--------------------------------------------------------------------------
  84.   alias ma__command_escape command_escape
  85.   def command_escape
  86.     @help_bot_window.hide if MARU__attack_command::WINDOW_OPEN
  87.     ma__command_escape
  88.   end
  89.   #--------------------------------------------------------------------------
  90.   # ● Command for attack all
  91.   #--------------------------------------------------------------------------
  92.   def command_attack_all
  93.     @help_bot_window.hide if MARU__attack_command::WINDOW_OPEN
  94.     x = $game_party.battle_members.size
  95.     x.times{|i|$game_party.members[i].input.set_attack if $game_party.members[i].attack_usable?}
  96.     turn_start
  97.   end
  98. end