# ▽△▽ XRXSv9. BaST-VX.BM1. クリアメッセージ ▽△▽ # # publish 2010/ 3/ 5 # update - 11/ 1/12 # #============================================================================== # カスタマイズポイント #============================================================================== module XRXSV9 # # 背景に使うウィンドウスキン(Graphics/System) # BMBackSkin = "Window" # # 下記の文章を無効化する? # (ダメージポップ使用時などで, # 「〜のダメージ!」というメッセージが不要な場合。) # BMDisableDamage = false # # 横幅サイズ # BMWidth = 496 end #============================================================================== # ■ 用語の無効化 #============================================================================== if XRXSV9::BMDisableDamage module Vocab CriticalToEnemy = "" CriticalToActor = "" ActorDamage = "" ActorLoss = "" ActorDrain = "" ActorNoDamage = "" ActorNoHit = "" ActorEvasion = "" ActorRecovery = "" EnemyDamage = "" EnemyLoss = "" EnemyDrain = "" EnemyNoDamage = "" EnemyNoHit = "" EnemyEvasion = "" EnemyRecovery = "" ActionFailure = "" end end #============================================================================== # ■ バトルメッセージ #============================================================================== class Window_BattleMessage < Window_Message #-------------------------------------------------------------------------- # ● オブジェクト初期化 * #-------------------------------------------------------------------------- def initialize super self.width = XRXSV9::BMWidth create_contents self.openness = 255 self.opacity = 0 self.y = 0 self.z = 452 @lines = [] @wait_line_count = 16 @clear_plan = false refresh end #-------------------------------------------------------------------------- # ▽ 改ページ処理 #-------------------------------------------------------------------------- def new_page super if $game_message.face_name.empty? draw_lineback(@line_count) end end #-------------------------------------------------------------------------- # ▽ 改行処理 #-------------------------------------------------------------------------- def new_line super if $game_message.face_name.empty? if @text.size >= 1 none = true for i in @line_count...Game_Message::MAX_LINE text = $game_message.texts[i] none &= (text == "") end return if none else return end draw_lineback(@line_count) end end #-------------------------------------------------------------------------- # ▽ メッセージの開始 #-------------------------------------------------------------------------- def start_message super self.opacity = ($game_message.face_name.empty? ? 0 : 255) end #-------------------------------------------------------------------------- # ▽ フレーム更新 #-------------------------------------------------------------------------- def update super if @lines.size >= 5 if @wait_line_count >= 1 @wait_line_count -= 1 else @lines.shift last_lines = @lines.dup @lines = @lines[0,4] refresh @lines = last_lines @wait_line_count = 16 end elsif @lines.size <= 4 and @clear_plan clear @clear_plan = false end end #-------------------------------------------------------------------------- # ● クリア #-------------------------------------------------------------------------- alias xrxsv9bm1_clear clear def clear if @lines.size >= 5 @clear_plan = true else xrxsv9bm1_clear self.opacity = 0 end end #-------------------------------------------------------------------------- # ● 文章の追加 * #-------------------------------------------------------------------------- def add_instant_text(text) @lines.pop while (@lines[@lines.size-1] == "") @lines.push(text) return if text.empty? if @lines.size <= 4 draw_line(@lines.size - 1) end end #-------------------------------------------------------------------------- # ● 文章の置き換え * #-------------------------------------------------------------------------- def replace_instant_text(text) unless XRXSV9::BMDisableDamage @lines.pop end @lines.pop while (@lines[@lines.size-1] == "") @lines.push(text) return if text.empty? draw_line(@lines.size - 1) end #-------------------------------------------------------------------------- # ● 行の描画 * #-------------------------------------------------------------------------- def draw_line(index) self.opacity = 0 rect = Rect.new(0, 0, 0, 0) rect.y += index * WLH + 2 rect.width = contents.width - 96 - 8 rect.height = WLH self.contents.clear_rect(rect) draw_lineback(index) rect.x += 4 self.contents.font.color = normal_color self.contents.draw_text(rect, @lines[index]) end def draw_lineback(index) rect = Rect.new(0, 0, 0, 0) rect.y += index * WLH + 2 rect.width = contents.width - 96 - 8 rect.height = WLH windowskin = Cache.system(XRXSV9::BMBackSkin) skin_rect = Rect.new(0, 24, 64, 16) self.contents.stretch_blt(rect, windowskin, skin_rect, 96) skin_rect = Rect.new(0, 88, 64, 16) self.contents.stretch_blt(rect, windowskin, skin_rect, 192) if index == 0 skin_rect = Rect.new(66, 64, 28, 2) rect2 = Rect.new(0, 0, rect.width, 2) self.contents.stretch_blt(rect2, windowskin, skin_rect, 255) end end end