#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ # #通常攻撃ボタンを作ります。 # #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ module MARU__attack_command #設定項目 ATTACK_BOTTAN = :X #通常攻撃ボタンの指定 WINDOW_OPEN = true #ヘルプウインドウを表示するかどうか WINDOW_TEXT = "X(Aキー)で全員通常攻撃" #テキストの中身 #設定終わり end #============================================================================== # ■ Window_PartyCommand #------------------------------------------------------------------------------ #  バトル画面で、戦うか逃げるかを選択するウィンドウです。 #============================================================================== class Window_PartyCommand < Window_Command #-------------------------------------------------------------------------- # ● 決定やキャンセルなどのハンドリング処理 #-------------------------------------------------------------------------- alias ma__process_handling process_handling def process_handling return unless open? && active ma__process_handling return process_a if handle?(:X) && Input.trigger?(MARU__attack_command::ATTACK_BOTTAN) end #-------------------------------------------------------------------------- # ● Aが押されたときの処理 #-------------------------------------------------------------------------- def process_a Sound.play_ok Input.update deactivate call_handler(:X) end end #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  バトル画面の処理を行うクラスです。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● パーティコマンドウィンドウの作成 #-------------------------------------------------------------------------- alias ma__create_party_command_window create_party_command_window def create_party_command_window ma__create_party_command_window @party_command_window.set_handler(:X, method(:command_attack_all)) if MARU__attack_command::WINDOW_OPEN @help_bot_window = Window_Selectable.new(0,Graphics.height-@party_command_window.height-48,250,48) @help_bot_window.draw_text(0,0,232,24,MARU__attack_command::WINDOW_TEXT,1) @help_bot_window.hide end end #-------------------------------------------------------------------------- # ● アクターコマンド選択の開始 #-------------------------------------------------------------------------- alias ma__start_actor_command_selection start_actor_command_selection def start_actor_command_selection @help_bot_window.hide if MARU__attack_command::WINDOW_OPEN ma__start_actor_command_selection end #-------------------------------------------------------------------------- # ● パーティコマンド選択の開始 #-------------------------------------------------------------------------- alias ma_start_party_command_selection start_party_command_selection def start_party_command_selection @help_bot_window.show if MARU__attack_command::WINDOW_OPEN ma_start_party_command_selection end #-------------------------------------------------------------------------- # ● コマンド[逃げる] #-------------------------------------------------------------------------- alias ma__command_escape command_escape def command_escape @help_bot_window.hide if MARU__attack_command::WINDOW_OPEN ma__command_escape end #-------------------------------------------------------------------------- # ● コマンド[一斉攻撃] #-------------------------------------------------------------------------- def command_attack_all @help_bot_window.hide if MARU__attack_command::WINDOW_OPEN x = $game_party.battle_members.size x.times{|i|$game_party.members[i].input.set_attack if $game_party.members[i].attack_usable?} turn_start end end