=begin RGSS3 VX風バトルログ+ Ver.1.003 mo-to  初公開 2012/02/19 最終更新 2017/12/03 TKOOL COOL http://mototkool.blog.fc2.com/ ★使用法★ スクリプトの▼ 素材 以下 ▼ メイン 以上にこれをコピーして張り付ける。 再定義を多用していますので上部挿入推薦 カスタマイズポインツを弄っていろいろと調整できます。 VXデフォ戦闘のようなシンプルにしたい場合は真偽値をすべてfalseにしてみてください。 ★概要★ 戦闘中のバトルログをVX風に変更します。 ★更新履歴★ ver.0.01 最低限の機能で公開 ver.1.00 カスタマイズ機能を実装し正式版へ      ソースの見直し修正      戦闘中のゴールドウィンドウ位置の変更       ver.1.001 シンプルステータスの描画方法をMVと同様の仕様に書き直した      高解像度変更に対応した ver.1.002 シンプルステータスの名前欄に受けたステート異常を表示する機能を追加 var.1.003 ログ表示を独立させバトルメッセージを自由に表示できるようにした =end #============================================================================== # ★ カスタマイズポインツ #============================================================================== module MOTO SIMPLE_STATUS_WINDOW = true #true:上部に簡易ステータス表示 false:なし #↓上のカスタマイズでtrueを選んだときのみいじること TP_GAGE = true #true:TPゲージを表示 false:なし PARTY_COMMAND_RIGHT = true #true:パーティコマンドを右側に表示 false:デフォ ACTOR_COMMAND_LEFT = false #true:アクターコマンドを左側に表示 false:デフォ #シンプルステータスの名前欄に受けたステート異常を表示 STATE_ICON = true #true:する false:しない end class << BattleManager #-------------------------------------------------------------------------- # ○ セットアップ #-------------------------------------------------------------------------- alias ori_moto_setup setup def setup(troop_id, can_escape = true, can_lose = false) ori_moto_setup(troop_id, can_escape = true, can_lose = false) @battlelog_window = nil end #-------------------------------------------------------------------------- # ☆ バトルログの取得 #-------------------------------------------------------------------------- def set_battle_log(battlelog) @battlelog_window = battlelog end #-------------------------------------------------------------------------- # ○ 勝敗判定 #-------------------------------------------------------------------------- alias ori_moto_judge_win_loss judge_win_loss def judge_win_loss @battlelog_window.close if @phase && @battlelog_window ori_moto_judge_win_loss end end #============================================================================== # ☆ Window_Simple_Status #============================================================================== #  戦闘中に上部へ表示する簡易式のステータスウィンドウです。 #============================================================================== class Window_Simple_Status < Window_Selectable #-------------------------------------------------------------------------- # ☆ オブジェクト初期化 #-------------------------------------------------------------------------- def initialize width = self.window_width width = 0 if $game_party.members.size == 0 hight = MOTO::TP_GAGE ? fitting_height(4) : fitting_height(3) super(0, 0, width, hight) self.openness = 0 refresh end #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width return Graphics.width / 4 * item_max end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max return 4 end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max return $game_party.battle_members.size end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) actor = $game_party.members[index] rect = item_rect(index) x = rect.x y = rect.y width = rect.width - (spacing / 2) if MOTO::TP_GAGE draw_actor_simple_status(actor, x, y, width) else draw_actor_simple_status_notp(actor, x, y, width) end end #-------------------------------------------------------------------------- # ● ステートおよび強化/弱体のアイコンを描画 #-------------------------------------------------------------------------- def draw_actor_icons(actor, x, y, width = 96) icons = (actor.state_icons + actor.buff_icons)[0, width / 24] icons.each_with_index {|n, i| draw_icon(n, x + width - 24 - (24 * i), y) } end #-------------------------------------------------------------------------- # ● シンプルなステータスの描画 #-------------------------------------------------------------------------- def draw_actor_simple_status(actor, x, y, width) draw_actor_icons(actor, x, y, width) if MOTO::STATE_ICON draw_actor_name(actor, x, y) draw_actor_hp(actor, x, y + line_height * 1, width) draw_actor_mp(actor, x, y + line_height * 2, width) draw_actor_tp(actor, x, y + line_height * 3, width) end #-------------------------------------------------------------------------- # ● シンプルなステータスの描画(TPなし) #-------------------------------------------------------------------------- def draw_actor_simple_status_notp(actor, x, y, width) draw_actor_icons(actor, x, y, width) if MOTO::STATE_ICON draw_actor_name(actor, x, y) draw_actor_hp(actor, x, y + line_height * 1, width) draw_actor_mp(actor, x, y + line_height * 2, width) end #-------------------------------------------------------------------------- # ● 項目を描画する矩形の取得 #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new col_max = item_max rect.width = (window_width / item_max) - ((4 - item_max) * 4) rect.height = item_height rect.x = index % col_max * (rect.width - spacing / 8 ) rect.y = 0 return rect end end class Window_BattleLog < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 ※再定義 #-------------------------------------------------------------------------- def initialize super(0, Graphics.height - window_height, window_width, window_height) self.z = 0 @lines = [] @num_wait = 0 create_back_bitmap create_back_sprite self.close refresh end #-------------------------------------------------------------------------- # ● 最大行数の取得 ※再定義 #-------------------------------------------------------------------------- def max_line_number return 4 end #-------------------------------------------------------------------------- # ● 背景の不透明度を取得 ※再定義 #-------------------------------------------------------------------------- def back_opacity return 0 end #-------------------------------------------------------------------------- # ○ 行の描画 ※エイリアス定義 #-------------------------------------------------------------------------- alias ori_moto_draw_line draw_line def draw_line(line_number) self.open ori_moto_draw_line(line_number) end end class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ○ 全ウィンドウの作成 ※エイリアス定義 #-------------------------------------------------------------------------- alias ori_moto_create_all_windows create_all_windows def create_all_windows ori_moto_create_all_windows create_simple_status_window end #-------------------------------------------------------------------------- # ☆ 簡易ステータスウィンドウの作成  #-------------------------------------------------------------------------- def create_simple_status_window @simple_status_window = Window_Simple_Status.new end #-------------------------------------------------------------------------- # ○ ログウィンドウの作成 #-------------------------------------------------------------------------- alias ori_moto_create_create_log_window create_log_window def create_log_window ori_moto_create_create_log_window BattleManager.set_battle_log(@log_window) end #-------------------------------------------------------------------------- # ○ パーティコマンドウィンドウの作成 ※エイリアス定義 #-------------------------------------------------------------------------- alias oro_moto_create_party_command_window create_party_command_window def create_party_command_window oro_moto_create_party_command_window @party_command_window.x = Graphics.width if MOTO::PARTY_COMMAND_RIGHT end #-------------------------------------------------------------------------- # ○ アクターコマンドウィンドウの作成 ※エイリアス定義 #-------------------------------------------------------------------------- alias oro_moto_create_actor_command_window create_actor_command_window def create_actor_command_window oro_moto_create_actor_command_window @actor_command_window.x -= Graphics.width if MOTO::ACTOR_COMMAND_LEFT end #-------------------------------------------------------------------------- # ● 情報表示ビューポートの更新 ※再定義 #-------------------------------------------------------------------------- def update_info_viewport i = MOTO::PARTY_COMMAND_RIGHT ? 128 : 0 j = MOTO::ACTOR_COMMAND_LEFT ? 0 : 128 move_info_viewport(i) if @party_command_window.active move_info_viewport(j) if @actor_command_window.active move_info_viewport(64) if BattleManager.in_turn? end #-------------------------------------------------------------------------- # ○ ステータスウィンドウの情報を更新 ※エイリアス定義 #-------------------------------------------------------------------------- alias ori_moto_refresh_status refresh_status def refresh_status ori_moto_refresh_status @simple_status_window.refresh end #-------------------------------------------------------------------------- # ○ ターン開始 ※エイリアス定義 #-------------------------------------------------------------------------- alias ori_moto_turn_start turn_start def turn_start @status_window.close @simple_status_window.open if MOTO::SIMPLE_STATUS_WINDOW ori_moto_turn_start end #-------------------------------------------------------------------------- # ● ターン終了 ※再定義 #-------------------------------------------------------------------------- def turn_end all_battle_members.each do |battler| battler.on_turn_end refresh_status @log_window.display_auto_affected_status(battler) @log_window.wait_and_clear end BattleManager.turn_end process_event @log_window.close @simple_status_window.close if MOTO::SIMPLE_STATUS_WINDOW start_party_command_selection end #-------------------------------------------------------------------------- # ● 戦闘行動の処理 ※再定義 #-------------------------------------------------------------------------- def process_action return if scene_changing? if !@subject || !@subject.current_action @subject = BattleManager.next_subject end return turn_end unless @subject if @subject.current_action @subject.current_action.prepare if @subject.current_action.valid? execute_action end @subject.remove_current_action end process_action_end unless @subject.current_action end end