#◆◇◆◇◆ レベルアップポップスクリプトVX ver 1.03 ◇◆◇◆◇ # サポート掲示板 http://www2.ezbbs.net/21/minto-aaa/ # by みんと =begin ■ 更新履歴 ○ ver 1.03(2012/01/17) ドーピングアイテムの効果が2倍になるミスを修正 ○ ver 1.02(2010/11/21) ドーピングアイテムに対応 ○ ver 1.01(2009/04/26) 習得済みのスキルも習得したと表示されるミスを修正 ○ ver 1.00(2009/04/26) 公開 ■ 説明 このスクリプトは、 アクティブレベルアップVX専用のオプションスクリプトです。 このスクリプトのご使用には、 アクティブレベルアップVXの導入が別途必要となります。 レベルアップした際の詳細な情報を1つずつ素早く表示します。 スキルを習得した場合は習得したスキル名を表示します。 立ち絵の表示にも対応しています。 =end #============================================================================== # ☆ MINTO #------------------------------------------------------------------------------ # 様々なフラグを扱うメインモジュールです。 #============================================================================== module MINTO # レベルアップポップスクリプトを有効化 ( true で有効 / false で無効 ) RGSS["レベルアップポップスクリプト"] = true end # レベルアップポップスクリプトが有効な場合に以降の処理を実行する if MINTO::RGSS["レベルアップポップスクリプト"] == true then #============================================================================== # ☆ カスタマイズ #------------------------------------------------------------------------------ # 機能のカスタマイズをここで行います。 #============================================================================== module MINTO # 使用する立ち絵グラグラフィックファイル名 # Face_Name_L[ID] = "ファイル末尾名" # すべてピクチャーフォルダを参照します。 # ※ ファイル名は機械的に参照します。 # たとえば、Face_Name[1] = "L" と設定し、 # ファイル名がActor1でインデックスが0の場合、 # 実際のファイル名は Actor1-0L となります。 # 原則、全アクター分設定してください。 # nil の場合は「現在の設定グラフィック」を参照します。 Face_Name_L = [] # 変更しない Face_Name_L[1] = "L" Face_Name_L[2] = "L" Face_Name_L[3] = "L" Face_Name_L[4] = "L" Face_Name_L[5] = "L" Face_Name_L[6] = "L" Face_Name_L[7] = "L" Face_Name_L[8] = "L" # パラメータ上昇時のSE(名前、音量、ピッチ) SE_Data = ["Audio/SE/Heal7", 100, 150] # スキル習得時のSE(名前、音量、ピッチ) Skill_SE_Data = ["Audio/SE/Ice7", 100, 200] end #============================================================================== # ■ Object #------------------------------------------------------------------------------ #  全てのクラスのスーパークラス。オブジェクトの一般的な振舞いを定義します。 #============================================================================== class Object #-------------------------------------------------------------------------- # ● 深い複製の作成 #-------------------------------------------------------------------------- def dec # Marshalモジュールを経由して、完全な複製を作成 return Marshal.load(Marshal.dump(self)) end end #============================================================================== # ■ Bitmap #------------------------------------------------------------------------------ #  画像そのものを扱う組み込みクラスです。 #============================================================================== class Bitmap #-------------------------------------------------------------------------- # ● 指定範囲のクリア #-------------------------------------------------------------------------- def rect_clear(x, y, width, height) # 対象の範囲を消す rect = Rect.new(x, y, width, height) self.fill_rect(rect, Color.new(0, 0, 0, 0)) end end #============================================================================== # ■ Window #------------------------------------------------------------------------------ #  ゲーム内の全てのウィンドウのスーパークラスです。 # 内部的には複数のスプライトで構成されています。 #============================================================================== class Window #-------------------------------------------------------------------------- # ● ウィンドウのセンタリング #-------------------------------------------------------------------------- def centering # ウィンドウを画面の中央に配置する self.x = (Graphics.width - self.width) / 2 self.y = (Graphics.height - self.height) / 2 end end #============================================================================== # ■ Game_Actor #------------------------------------------------------------------------------ #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors) # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。 #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 基本 MaxHP の取得 #-------------------------------------------------------------------------- def base_maxhp2 n = actor.parameters[0, @level] n += @maxhp_plus return n end #-------------------------------------------------------------------------- # ● 基本 MaxMP の取得 #-------------------------------------------------------------------------- def base_maxmp2 n = actor.parameters[1, @level] n += @maxmp_plus return n end #-------------------------------------------------------------------------- # ● 基本攻撃力の取得 #-------------------------------------------------------------------------- def base_atk2 n = actor.parameters[2, @level] for item in equips.compact do n += item.atk end n += @atk_plus return n end #-------------------------------------------------------------------------- # ● 基本防御力の取得 #-------------------------------------------------------------------------- def base_def2 n = actor.parameters[3, @level] for item in equips.compact do n += item.def end n += @def_plus return n end #-------------------------------------------------------------------------- # ● 基本精神力の取得 #-------------------------------------------------------------------------- def base_spi2 n = actor.parameters[4, @level] for item in equips.compact do n += item.spi end n += @spi_plus return n end #-------------------------------------------------------------------------- # ● 基本敏捷性の取得 #-------------------------------------------------------------------------- def base_agi2 n = actor.parameters[5, @level] for item in equips.compact do n += item.agi end n += @agi_plus return n end end #============================================================================== # ■ Window_Active_Exp #------------------------------------------------------------------------------ #  獲得したEXPに応じて、ゲージを変動させるウィンドウです。 #============================================================================== class Window_Active_Exp < Window_Base #-------------------------------------------------------------------------- # ● フレーム更新(スキル習得) # learning_skill : 新たにスキルを習得したかどうかのフラグ #-------------------------------------------------------------------------- def update_skill(learning_skill) end end #============================================================================== # ■ Window_Lvup_Data #------------------------------------------------------------------------------ # Lvup時のデータを表示するウィンドウです。 #============================================================================== class Window_Lvup_Data < Window_Base #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :data # データ #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 512, 320) self.contents = Bitmap.new(width - 32, height - 32) self.z = 10016 self.visible = false @data = {} centering end #-------------------------------------------------------------------------- # ● グラフィックの作成 # actor : アクター # x : 描写先のX座標 # y : 描写先のY座標 #-------------------------------------------------------------------------- def graphic_set(actor, x, y) # 顔グラフィック末尾名が有効な場合 unless MINTO::Face_Name_L[actor.id].nil? then # ファイル名を作成 file_name = "#{actor.face_name}-#{actor.face_index}" # ファイル末尾名を取得 file_name += MINTO::Face_Name_L[actor.id] # 顔グラフィックを読み込む face = Cache.picture(file_name) # 顔グラフィックを描写 self.contents.blt(x, y, face, face.rect) # 顔グラフィック末尾名が無効な場合 else # 現在の設定グラフィックを描写 draw_face(actor.face_name, actor.face_index, x, y) end end #-------------------------------------------------------------------------- # ● リフレッシュ # actor : アクター #-------------------------------------------------------------------------- def refresh(actor) x = 160 self.contents.clear # アクター名を描写 self.contents.font.color = normal_color self.contents.draw_text(x * 0, WLH * 0, 224, WLH, actor.name) # アクターグラフィックを描写 graphic_set(actor, 240, 0) # 用語を描写 self.contents.font.color = system_color self.contents.draw_text(x * 0, WLH * 1, 96, WLH, "Level") self.contents.draw_text(x * 0, WLH * 2, 96, WLH, Vocab.hp) self.contents.draw_text(x * 0, WLH * 3, 96, WLH, Vocab.mp) self.contents.draw_text(x * 0, WLH * 4, 96, WLH, Vocab.atk) self.contents.draw_text(x * 0, WLH * 5, 96, WLH, Vocab.def) self.contents.draw_text(x * 0, WLH * 6, 96, WLH, Vocab.spi) self.contents.draw_text(x * 0, WLH * 7, 96, WLH, Vocab.agi) self.contents.font.color = normal_color # パラメータを描写 for i in 0...@data[actor].size do draw_status(actor, i) end end #-------------------------------------------------------------------------- # ● 能力の描写 # actor : アクター # index : 項目 #-------------------------------------------------------------------------- def draw_status(actor, index) # 描写座標を設定 x = 60 y = WLH + (index * WLH) # 描写範囲をクリア self.contents.rect_clear(x, y, 48, WLH) # 能力値を描写 self.contents.draw_text(x, y, 96, WLH, @data[actor][index].to_s) end end #============================================================================== # ■ Window_BattleCenter_Help #------------------------------------------------------------------------------ #  戦闘画面で任意の文章を表示するウィンドウです。 #============================================================================== class Window_BattleCenter_Help < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 64, 56) self.z = 20000 self.visible = false create_contents @message_duration = 0 @save_text = "" @text = [] @text_y = 0 @text_x = 0 @text_type = 0 @text_index = 0 @text_width = [] @speed = 1 end #-------------------------------------------------------------------------- # ● テキスト設定 # text : スプライトに表示する文字列 #-------------------------------------------------------------------------- def set_text(text) # 求められたテキストが無効な場合 if text.to_s == "" then # 表示カウントを設定 @message_duration = 8 # メソッドを終了 return end self.active = true # 終了記号を追加 text += "\\bw" # スプライトを可視状態にする self.visible = true # 各データを初期化 @save_text = "" @text = [] @text_width = [] @text_index = 0 @text_type = 0 @speed = 1 self.pause = false self.opacity = 192 self.contents_opacity = 255 # 表示カウントを設定 @message_duration = 16 # 文字を複製 data = text.dup # 各制御文字を仮変換 data.gsub!(/\\\\/) { "\000" } data.gsub!(/\\[Cc]\[([0-9]+)\]/) { "" } data.gsub!(/\\[Bb][Ww]/) { "" } # ウィンドウのサイズを調節 self.width = 32 + (self.contents.text_size(data).width) self.height = 56 # センター表示 centering # ビットマップを再作成 create_contents refresh(text.dup) end #-------------------------------------------------------------------------- # ● リフレッシュ # text : スプライトに表示する文字列 #-------------------------------------------------------------------------- def refresh(text) # 基本情報を初期化 self.contents.clear self.contents.font.color = normal_color self.contents.font.bold = false self.contents.font.italic = false @text_x = 0 @text_y = 0 # 文章のインデックスを初期化 @text_index = 0 # 便宜上、"\\\\" を "\000" に変換 text.gsub!(/\\\\/) { "\000" } # 各制御文字を実際のものに変換 text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" } text.gsub!(/\\[Bb][Ww]/) { "\017" } @save_text = text.dup end #-------------------------------------------------------------------------- # ● テキストの更新 #-------------------------------------------------------------------------- def text_update @text = @save_text.split(//) # 無効な文字列の場合 if @text[@text_index] == nil then # メソッドを返す return false end # スプライトを可視状態にする self.visible = true # テキストを取得 c = @text[@text_index] # \\ の場合 if c == "\000" then # 本来の文字に戻す c = "\\" # \C[n] の場合 elsif c == "\001" then # 制御文字を処理 @save_text.sub!(/\[([0-9]+)\]/, "") # 文字色のIDを取得 color = $1.to_i # 文字色のIDが有効な場合 if color >= 0 then # 文字色を変更 self.contents.font.color = text_color(color) end # インデックスを進める @text_index += 1 # メソッドを返す return true # \BW の場合 elsif c == "\017" then # 文章の表示速度を初期化 @speed = 0 # ポーズサインを表示する self.pause = true # ボタン待ちフラグをオン @press = true # インデックスを進める @text_index += 1 # メソッドを返す return true end # 文字を描画 self.contents.draw_text(@text_x, 0, 40, 24, c) # @text_x に描画した文字の幅を加算 @text_x += self.contents.text_size(c).width # インデックスを進める @text_index += 1 return true end #-------------------------------------------------------------------------- # ● ウェイトの終了 #-------------------------------------------------------------------------- def wait_end # ボタン入力待ちフラグをオフ @press = false # ポーズサインを非表示にする self.pause = false # ウィンドウを不可視にする self.visible = false # ボタン入力待ちフラグをオフ @press = false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update # ボタン入力待ちフラグがオンの場合 if @press == true then super # C ボタンが押された場合 if Input.trigger?(Input::C) == true then # ウェイトの終了 wait_end end # メソッドを返す return end # 更新が可能なフレームでない場合 if @speed != 0 and (Graphics.frame_count % @speed != 0) then # メソッドを返す return end # テロップを更新中の場合 if text_update == true then # スピードが 0 の場合 if @speed == 0 then update end # メソッドを返す return else # 文章の表示速度を最速化 @speed = 1 end end end #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  バトル画面の処理を行うクラスです。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- alias terminate_MITO_RGSS_120 terminate def terminate # 元の処理を実行 terminate_MITO_RGSS_120 # レベルアップウィンドウが有効な場合 unless @lvup_window.nil? # レベルアップウィンドウを解放 @lvup_window.dispose # センターヘルプウィンドウを解放 @center_help_window.dispose end end #-------------------------------------------------------------------------- # ● 獲得した経験値とお金の表示 #-------------------------------------------------------------------------- alias :display_exp_and_gold_MITO_RGSS_120 :display_exp_and_gold def display_exp_and_gold # 元の処理を実行 display_exp_and_gold_MITO_RGSS_120 end #-------------------------------------------------------------------------- # ● アフターバトルフェーズの準備 #-------------------------------------------------------------------------- alias after_battle_phase_MITO_RGSS_120 reservation_after_battle_phase def reservation_after_battle_phase # レベルアップウィンドウを作成 @lvup_window = Window_Lvup_Data.new # センターヘルプウィンドウを作成 @center_help_window = Window_BattleCenter_Help.new @last_skills_array = [] # ループ処理(パーティー) for i in 0...$game_party.members.size do # アクターを取得 actor = $game_party.members[i] # 最終能力値を保存 save_last_parameter(actor) # スキルを保存 @last_skills_array[i] = actor.skills.dup end # 元の処理を実行 after_battle_phase_MITO_RGSS_120 end #-------------------------------------------------------------------------- # ● アフターバトルフェーズの開始 #-------------------------------------------------------------------------- alias start_after_battle_phase_MITO_RGSS_120 start_after_battle_phase def start_after_battle_phase # 元の処理を実行 start_after_battle_phase_MITO_RGSS_120 # レベルアップモーション level_up_motion end #-------------------------------------------------------------------------- # ● 最終能力値の記憶 # actor : アクター #-------------------------------------------------------------------------- def save_last_parameter(actor) @lvup_window.data[actor] = [] @lvup_window.data[actor][0] = actor.level @lvup_window.data[actor][1] = actor.base_maxhp2 @lvup_window.data[actor][2] = actor.base_maxmp2 @lvup_window.data[actor][3] = actor.base_atk2 @lvup_window.data[actor][4] = actor.base_def2 @lvup_window.data[actor][5] = actor.base_spi2 @lvup_window.data[actor][6] = actor.base_agi2 end #-------------------------------------------------------------------------- # ● 現在のパラメータの取得 # actor : アクター # index : 項目 #-------------------------------------------------------------------------- def look_parameter(actor, index) # 項目に応じて分岐 case index when 0 then return actor.level when 1 then return actor.base_maxhp2 when 2 then return actor.base_maxmp2 when 3 then return actor.base_atk2 when 4 then return actor.base_def2 when 5 then return actor.base_spi2 when 6 then return actor.base_agi2 end end #-------------------------------------------------------------------------- # ● 習得したスキルの表示 # actor : アクター #-------------------------------------------------------------------------- def learning_skills_pop(actor) # AP加算(KGC[スキル習得装備]) display_master_equipment_skill(true) learning_skills = [] # ループ処理 for skill in actor.skills do # 未収得のスキルの場合 unless @last_skills_array[actor.index].include?(skill) then # 習得したスキルを取得 learning_skills.push(skill) end end # スキルを習得していない場合 if learning_skills.empty? then # メソッドを返す return end # ループ処理 for skill in learning_skills do wait_count = 128 # 習得MEを演奏 data = MINTO::Skill_SE_Data Audio.se_play(data[0], data[1], data[2]) # スキル名を表示 @center_help_window.set_text("\\c[1]#{skill.name}\\c[0]を習得した!") # 表示が終わるまでループ while @center_help_window.visible == true do # ゲーム画面を更新 Graphics.update # 入力情報を更新 Input.update # センターヘルプウィンドウを更新 @center_help_window.update wait_count -= 1 if wait_count.zero? then @center_help_window.wait_end end end end end #-------------------------------------------------------------------------- # ● レベルアップモーション #-------------------------------------------------------------------------- def level_up_motion # ポップ作成 @pop = Mint_Pop.new # ループ処理(パーティー) for id in 0...$game_party.members.size do # アクターを取得 actor = $game_party.members[id] # パラメータウィンドウをリフレッシュ @lvup_window.refresh(actor) # レベルが上がっている場合 if @lvup_window.data[actor][0] < actor.level then # パラメータウィンドウを表示 @lvup_window.visible = true # ループ処理 for i in (0..6) do # 描写座標を設定 x = 112 y = 66 + (i * Window_Base::WLH) # 上昇したパラメータを読み込む parameter = look_parameter(actor, i) # 結果を収納する string = "+#{parameter - @lvup_window.data[actor][i]}" # 上昇後のパラメータを設定 @lvup_window.data[actor][i] = parameter # パラメータウィンドウをリフレッシュ @lvup_window.draw_status(actor, i) # ポップ描写 @pop.string_pop(string, x, y) # ウェイトカウントを設定 wait = i == 6 ? 160 : 6 # ポップSEを演奏 data = MINTO::SE_Data Audio.se_play(data[0], data[1], data[2]) # フレーム更新 wait.times do # ゲーム画面を更新 Graphics.update # 入力情報を更新 Input.update # スプライトセットを更新 @spriteset.update # ポップを更新 @pop.update # パラメータウィンドウを更新 @lvup_window.update # 最終インデックスの場合 if i == 6 then # ポーズサインを表示する @lvup_window.pause = true # C ボタンが押された場合 if Input.trigger?(Input::C) == true then # ポーズサインを非表示にする @lvup_window.pause = false # 更新を中断 break end end end end end # 習得したスキルを表示 learning_skills_pop(actor) # ポップを解放 @pop.dispose # パラメータウィンドウを閉じる @lvup_window.visible = false end end end #============================================================================== # ■ Mint_Pop #------------------------------------------------------------------------------ #  数字のスプライト表示を扱うクラスです。 #============================================================================== class Mint_Pop #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @string_pop_sprite = [] @string_pop_duration = [] end #-------------------------------------------------------------------------- # ● ストリングポップ # string : 求められた文字列 # x : X座標 # y : Y座標 #-------------------------------------------------------------------------- def string_pop(string = "", x = 0, y = 0) # string が無効なら処理を終了 return if string == "" wlh = Window_Base::WLH # スプライトを生成 string_pop_sprite = Sprite.new # 文字を描写 string_pop_sprite.bitmap = Bitmap.new(96, 40) string_pop_sprite.bitmap.font.size = 17 string_pop_sprite.bitmap.font.shadow = false string_pop_sprite.bitmap.font.color.set(0, 0, 0) string_pop_sprite.bitmap.draw_text(-1, 12-1, 96, wlh, string, 1) string_pop_sprite.bitmap.draw_text(+1, 12-1, 96, wlh, string, 1) string_pop_sprite.bitmap.draw_text(-1, 12+1, 96, wlh, string, 1) string_pop_sprite.bitmap.draw_text(+1, 12+1, 96, wlh, string, 1) string_pop_sprite.bitmap.font.color.set(176, 255, 144) string_pop_sprite.bitmap.draw_text(0, 12, 96, wlh, string, 1) # 座標データを代入 string_pop_sprite.x = x string_pop_sprite.y = y string_pop_sprite.z = 10032 # 配列の先頭にシフト @string_pop_sprite.unshift(string_pop_sprite) @string_pop_duration.unshift(40) end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- def dispose # ループ処理 for i in 0...@string_pop_sprite.size do # 有効なスプライトの場合 unless @string_pop_sprite[i].nil? then # スプライトを解放 @string_pop_sprite[i].bitmap.dispose @string_pop_sprite[i].dispose @string_pop_sprite[i] = nil @string_pop_duration[i] = nil end end # 配列内容をクリア @string_pop_sprite.clear @string_pop_duration.clear end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update # 1つでもストリングポップが表示中の場合 if @string_pop_sprite.size > 0 # 表示中のストリングポップを1つずつ処理する for i in 0...@string_pop_sprite.size # ストリングポップを代入 string = @string_pop_sprite[i] # カウントが0の場合 if @string_pop_duration[i] == 0 # 次の処理へ next end # カウントを減らす @string_pop_duration[i] -= 1 # 残りカウントに応じて分岐 case @string_pop_duration[i] when 36..39 string.y -= 4 when 33..37 string.y -= 2 when 32..34 string.y += 2 when 25..32 string.y += 4 end end end end end end