#============================================================================== # ■ XP-RGSS-53 バトル背景変更-Option [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # 戦闘時のステータス表示を変更します。 #============================================================================== class Bitmap #-------------------------------------------------------------------------- # ● ゲージ表示 # x : 描画先 X 座標 # y : 描画先 Y 座標 # current : 表示率(%) # file : 表示ファイル名(Graphics/Windowskins) #-------------------------------------------------------------------------- def draw_win_bar(x, y, current, file) bitmap = RPG::Cache.windowskin(file) cw = bitmap.width * current / 100.00 ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) blt(x, y, bitmap, src_rect, 180) end end class Window_Base < Window #-------------------------------------------------------------------------- # ● HP描画 #-------------------------------------------------------------------------- def draw_actor_hp_bar(actor, x, y, width) current = (actor.hp * 100.00) / actor.maxhp self.contents.draw_win_bar(x, y+20, current, "hp_bar") draw_actor_hp(actor, x, y, width) end #-------------------------------------------------------------------------- # ● SP描画 #-------------------------------------------------------------------------- def draw_actor_sp_bar(actor, x, y, width) current = (actor.sp * 100.00) / actor.maxsp self.contents.draw_win_bar(x, y+20, current, "sp_bar") draw_actor_sp(actor, x, y, width) end end #============================================================================== # ■ Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 320, 640, 160) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 @level_up_flags = [false, false, false, false] refresh end #-------------------------------------------------------------------------- # ● レベルアップフラグの設定 # actor_index : アクターインデックス #-------------------------------------------------------------------------- def level_up(actor_index) @level_up_flags[actor_index] = true end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size actor = $game_party.actors[i] actor_x = i * 160 + 4 if @level_up_flags[i] self.contents.font.color = normal_color self.contents.draw_text(actor_x, 32, 120, 32, "LEVEL UP!") end draw_actor_hp_bar(actor, actor_x, 64, 120) draw_actor_sp_bar(actor, actor_x, 88, 120) end end end