#============================================================================== # ■ XP-RGSS-41 個別戦闘ステータス [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # ・バトル画面でパーティメンバーのステータスを表示するウィンドウを個別化。 # ・1〜4人まで対応。右つめ式。戦闘位置調整には未対応。 #============================================================================== #============================================================================== # ■ Window_BattleStatus【再構築】 #------------------------------------------------------------------------------ #  バトル画面でパーティメンバーのステータスを表示するウィンドウです。 #------------------------------------------------------------------------------ # パーティ個別のウィンドウを一元管理するクラス。 # 一元管理させることで、Scene_Battleへの変更をなくす(導入を容易化させる) # ウィンドウクラスとしているが実質はウィンドウではない(ウィンドウ管理クラス) #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @bs_window = [] for i in 0...$game_party.actors.size @bs_window[i] = Window_BattleActorStatus.new(i) end # メンバー入れ替えにも耐えうるようにパーティ記憶 @battle_party = $game_party.dup end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- def dispose for i in 0...@battle_party.actors.size @bs_window[i].dispose end end #-------------------------------------------------------------------------- # ● レベルアップフラグの設定 # actor_index : アクターインデックス #-------------------------------------------------------------------------- def level_up(actor_index) @bs_window[actor_index].level_up end #-------------------------------------------------------------------------- # ● リフレッシュ(ALL) #-------------------------------------------------------------------------- def refresh # パーティ入れ替えを検出 if @battle_party.actors != $game_party.actors # 全ウィンドウを再構築する dispose initialize else # 通常更新 for i in 0...@battle_party.actors.size @bs_window[i].refresh end end end #-------------------------------------------------------------------------- # ● リフレッシュ(1ウィンドウ) # 全てのウィンドウ更新は負荷がかかる場合に使用する軽量処理用リフレッシュ # 指定ウィンドウ以外のパーティ入れ替えには対応してない。 #-------------------------------------------------------------------------- def one_refresh(actor_index) # パーティ入れ替えを検出 if @battle_party.actors[actor_index] != $game_party.actors[actor_index] # 入れ替え @battle_party.actors[actor_index] = $game_party.actors[actor_index].dup # 指定ウィンドウを再構築する @bs_window[actor_index].dispose @bs_window[actor_index] = Window_BattleActorStatus.new(actor_index) else # 通常更新 @bs_window[actor_index].refresh end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update for i in 0...@battle_party.actors.size @bs_window[i].update end end end #============================================================================== # ■ Window_BattleActorStatus #------------------------------------------------------------------------------ # アクター単位でウィンドウを分割するために用意したウィンドウ。 # Window_BattleStatus内で一元管理させる。 # 当然、4人以上のパーティには未対応(スペース足りない) #============================================================================== class Window_BattleActorStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(actor_index) super(actor_index * 640/4, 320, 640/4, 160) @actor = $game_party.actors[actor_index] @actor_index = actor_index self.contents = Bitmap.new(width - 32, height - 32) @level_up_flags = false @item_max = 1 refresh end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- def dispose super end #-------------------------------------------------------------------------- # ● レベルアップフラグの設定 # actor_index : アクターインデックス #-------------------------------------------------------------------------- def level_up @level_up_flags = true end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear actor_x = 4 draw_actor_name(@actor, actor_x, 0) draw_actor_hp(@actor, actor_x, 32, 120) draw_actor_sp(@actor, actor_x, 64, 120) if @level_up_flags self.contents.font.color = normal_color self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!") else draw_actor_state(@actor, actor_x, 96) end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super # メインフェーズのときは不透明度をやや下げる if $game_temp.battle_main_phase self.contents_opacity -= 4 if self.contents_opacity > 191 else self.contents_opacity += 4 if self.contents_opacity < 255 end end end