#=========================================================================== # ◆ A1 Scripts ◆ # フェイスステータスウィンドウ(RGSS3) # # バージョン : 1.01 (2020/07/09) # 作者 : A1 # URL     : http://a1tktk.web.fc2.com/ #--------------------------------------------------------------------------- # 機能: # ・顔グラフィックを表示するバトルステータスウィンドウです #--------------------------------------------------------------------------- # 更新履歴   :2012/01/18 Ver1.00 リリース #    :2020/07/09 Ver1.01 SRPGシステムに対応 #--------------------------------------------------------------------------- # 設置場所 # A1バトル共通スクリプト以下 # (戦闘中入れ替えスクリプト以下) # # 必要スクリプト # A1バトル共通スクリプト #--------------------------------------------------------------------------- # 使い方 # 導入することで適用されます #============================================================================== $imported ||= {} if $imported["A1_BattleCommonScript"] $imported["A1_FaceStatusWindow"] = true old_common_script("フェイスステータスウィンドウ", "3.90") if common_version < 3.90 #============================================================================== # ■ Window_FaceStatus #============================================================================== class Window_FaceStatus < Window_Base #-------------------------------------------------------------------------- # ○ オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @actors = $game_party.battle_members super(0, 0, 0, 0) setup_window_pos self.openness = 0 self.contents.font.size = 21 end #-------------------------------------------------------------------------- # ○ 項目数の取得 #-------------------------------------------------------------------------- def item_max @actors.size end #-------------------------------------------------------------------------- # ○ ウィンドウ位置のセットアップ #-------------------------------------------------------------------------- def setup_window_pos self.width = actor_width * @actors.size + standard_padding * 1.5 self.height = 96 + standard_padding * 2 self.y = Graphics.height - height self.x = Graphics.width - width create_contents end #-------------------------------------------------------------------------- # ○ アクターの設定 #-------------------------------------------------------------------------- def actors=(actors) @actors = actors setup_window_pos end #-------------------------------------------------------------------------- # ○ 一人のアクターにかける幅 #-------------------------------------------------------------------------- def actor_width return 96 + standard_padding / 2 end #-------------------------------------------------------------------------- # ○ 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) actor = @actors[index] x = actor_width * index draw_face(actor.face_name, actor.face_index, x, 0, false) draw_text(x, line_height * 0, actor_width - (standard_padding / 2), line_height, actor.name, 1) draw_actor_icons(actor, x, 0 + line_height * 3) draw_actor_hp(actor, x, 0 + line_height * 1, 95) draw_actor_mp(actor, x, 0 + line_height * 2, 48) draw_actor_tp(actor, x + 50, 0 + line_height * 2, 45) if $data_system.opt_display_tp end #-------------------------------------------------------------------------- # ○ 全項目の描画 #-------------------------------------------------------------------------- def draw_all_items item_max.times {|i| draw_item(i) } end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh return unless self.visible contents.clear draw_all_items end #-------------------------------------------------------------------------- # ○ フレーム更新 #-------------------------------------------------------------------------- def update return unless self.visible super self.visible = false if self.openness == 0 end #-------------------------------------------------------------------------- # ○ オープン #-------------------------------------------------------------------------- def open self.visible = true refresh super end #-------------------------------------------------------------------------- # ○ 顔グラフィックの描画 #-------------------------------------------------------------------------- def draw_face(face_name, face_index, x, y, enabled = true) draw_face_no_dispose(face_name, face_index, x, y, enabled) end end #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  バトル画面の処理を行うクラスです。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ☆ 全ウィンドウの作成 #-------------------------------------------------------------------------- alias a1_face_status_window_sb_create_all_windows create_all_windows def create_all_windows create_face_status_window create_personal_status_window a1_face_status_window_sb_create_all_windows end #-------------------------------------------------------------------------- # ○ ステータスウィンドウ作成の後処理 #-------------------------------------------------------------------------- def post_create_status_window @status_window.visible = false end #-------------------------------------------------------------------------- # ○ フェイスステータスウィンドウの作成 #-------------------------------------------------------------------------- def create_face_status_window @face_status_window = Window_FaceStatus.new end #-------------------------------------------------------------------------- # ○ 個人ステータスウィンドウの作成 #-------------------------------------------------------------------------- def create_personal_status_window @personal_status_window = Window_PersonalStatus.new(0, Graphics.height - 120, 0) end #-------------------------------------------------------------------------- # ☆ ステータスウィンドウがリフレッシュされた時の処理 #-------------------------------------------------------------------------- alias a1_face_status_window_sb_refresh_statsu_window refresh_statsu_window def refresh_statsu_window a1_face_status_window_sb_refresh_statsu_window @face_status_window.refresh @personal_status_window.refresh end #-------------------------------------------------------------------------- # ☆ ステータスウィンドウがクローズされた時の処理 #-------------------------------------------------------------------------- alias a1_face_status_window_sb_close_status_window close_status_window def close_status_window a1_face_status_window_sb_close_status_window @face_status_window.close end #-------------------------------------------------------------------------- # ○ 個人ステータスウィンドウのアクター設定 #-------------------------------------------------------------------------- def setup_personal_status_actor actor = BattleManager.actor actor ? @personal_status_window.actor = actor : @personal_status_window.close @personal_status_window.open if actor end #-------------------------------------------------------------------------- # ○ パーティコマンド選択の開始の後処理 #-------------------------------------------------------------------------- alias a1_face_status_window_sb_post_start_party_command_selection post_start_party_command_selection def post_start_party_command_selection a1_face_status_window_sb_post_start_party_command_selection $game_srpg.started ? @face_status_window.close : @face_status_window.open end #-------------------------------------------------------------------------- # ☆ 次のコマンド入力への後処理 #-------------------------------------------------------------------------- alias a1_face_status_window_sb_post_next_command post_next_command def post_next_command a1_face_status_window_sb_post_next_command @face_status_window.close setup_personal_status_actor end #-------------------------------------------------------------------------- # ☆ 前のコマンド入力への後処理 #-------------------------------------------------------------------------- alias a1_face_status_window_sb_post_prior_command post_prior_command def post_prior_command a1_face_status_window_sb_post_prior_command setup_personal_status_actor end #-------------------------------------------------------------------------- # ☆ ターン開始の前処理 #-------------------------------------------------------------------------- alias a1_face_status_window_sb_prev_turn_start prev_turn_start def prev_turn_start a1_face_status_window_sb_prev_turn_start #@personal_status_window.close #@face_status_window.open #@face_status_window.refresh end #-------------------------------------------------------------------------- # ○ バトルメンバーの追加後の処理 #-------------------------------------------------------------------------- alias a1_face_status_window_sb_post_add_battler post_add_battler def post_add_battler(member) a1_face_status_window_sb_post_add_battler(member) @face_status_window.actors = $game_party.battle_members end #-------------------------------------------------------------------------- # ○ バトルメンバーの削除後の処理 #-------------------------------------------------------------------------- alias a1_face_status_window_sb_post_remove_battler post_remove_battler def post_remove_battler a1_face_status_window_sb_post_remove_battler @face_status_window.actors = $game_party.battle_members end #============================================================================== # ■ 戦闘中入れ替えインポート時処理 #============================================================================== if $imported["A1_ChangeMember"] #-------------------------------------------------------------------------- # ○ メンバーチェンジ[キャンセル] #-------------------------------------------------------------------------- alias a1_face_status_window_sb_on_member_change_cancel on_member_change_cancel def on_member_change_cancel a1_face_status_window_sb_on_member_change_cancel @face_status_window.actors = $game_party.battle_members end;end end #============================================================================== # ■ ポップアップダメージインポート時処理 #============================================================================== if $imported["A1_DamagePopUp"] #============================================================================== # ■ Window_BattleLog #------------------------------------------------------------------------------ #  戦闘の進行を実況表示するウィンドウです。枠は表示しませんが、便宜上ウィンド # ウとして扱います。 #============================================================================== class Window_BattleLog < Window_Selectable #-------------------------------------------------------------------------- # ★ ポップアップの位置取得・アクター #-------------------------------------------------------------------------- def popup_pos_actor(target) y = (Graphics.height - (96 + standard_padding * 2) / 2 ) actor_width = (96 + standard_padding / 2) width = actor_width * $game_party.battle_members.size + standard_padding * 1.5 x = Graphics.width - width x = x + actor_width * target.index + actor_width / 2 return [x, y] end end;end end