设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1574|回复: 0
打印 上一主题 下一主题

[已经过期] 如何在战斗结算脚本显示获得jp?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
48
在线时间
331 小时
注册时间
2012-5-4
帖子
158
跳转到指定楼层
1
发表于 2012-12-30 13:14:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
RT,战斗结算脚本在此:
  1. #◆◇◆◇◆  アクティブレベルアップVXA ver 1.01  ◇◆◇◆◇
  2. # 開発者用・高速数字描写機構 ver 1.11 以降必須
  3. #  サポート掲示板 http://www2.ezbbs.net/21/minto-aaa/
  4. #   by みんと

  5. =begin

  6. ■ 更新履歴

  7. ○ ver 1.01(2012/01/21)
  8. 多人数PTで落ちるミスを修正

  9. ○ ver 1.00(2012/01/20)
  10. 公開

  11. ■ 説明

  12. なるべく下の方にセクションを作成し、
  13. 本スクリプトを導入してください。

  14. 戦闘終了時のリザルト表示を
  15. カシャカシャEXP獲得表示に変更します。
  16. ゲージもアクティブで変動し、
  17. いっぱいになったらレベルアップします。

  18. また、その際は専用のグラフィックに変更されます。

  19. 画像はサンプルのものを使用していただいて構いません。

  20. 演出はCボタン(Enterキー)でカットできます。

  21. =end

  22. #==============================================================================
  23. # ☆ MINTO
  24. #------------------------------------------------------------------------------
  25. #   様々なフラグを扱うメインモジュールです。
  26. #==============================================================================

  27. module MINTO
  28.   
  29.   # アクティブレベルアップVXを有効化 ( true で有効 / false で無効 )
  30.   RGSS["Active_Lv_UpVX"] = true
  31.   
  32. end

  33. # アクティブレベルアップVXが有効な場合に以降の処理を実行する
  34. if MINTO::RGSS["Active_Lv_UpVX"] == true then

  35. #==============================================================================
  36. # ☆ カスタマイズ
  37. #------------------------------------------------------------------------------
  38. #   機能のカスタマイズをここで行います。
  39. #==============================================================================

  40. module MINTO
  41.   
  42.   # 使用する顔グラグラフィックファイル名
  43.   # Face_Name[ID] = ["通常時のファイル末尾名", "LVUP時のファイル末尾名"]
  44.   # すべてピクチャーフォルダを参照します。
  45.   # ※ ファイル名は機械的に参照します。
  46.   # たとえば、Face_Name[1] = ["普", "笑"]と設定し、
  47.   # ファイル名がActor1でインデックスが0の場合、
  48.   # 実際のファイル名は Actor1_0普, Actor1_0笑 となります。
  49.   # 原則、全アクター分設定してください。
  50.   # nil の場合は「現在の設定グラフィック」を参照します。
  51.   Face_Name = [] # 変更しない
  52.   Face_Name[1] = [nil, nil]
  53.   Face_Name[2] = [nil, nil]
  54.   Face_Name[3] = [nil, nil]
  55.   Face_Name[4] = [nil, nil]
  56.   Face_Name[5] = [nil, nil]
  57.   Face_Name[6] = [nil, nil]
  58.   Face_Name[7] = [nil, nil]
  59.   Face_Name[8] = [nil, nil]
  60.   Face_Name[9] = [nil, nil]
  61.   Face_Name[12] = [nil, nil]
  62.   Face_Name[13] = [nil, nil]
  63.   Face_Name[14] = [nil, nil]
  64.   Face_Name[15] = [nil, nil]
  65.   Face_Name[16] = [nil, nil]
  66.   Face_Name[17] = [nil, nil]
  67.   Face_Name[18] = [nil, nil]
  68.   Face_Name[19] = [nil, nil]
  69.   Face_Name[20] = [nil, nil]
  70.   Face_Name[21] = [nil, nil]
  71.   Face_Name[22] = [nil, nil]
  72.   Face_Name[23] = [nil, nil]
  73.   Face_Name[24] = [nil, nil]
  74.   Face_Name[25] = [nil, nil]
  75.   Face_Name[26] = [nil, nil]
  76.   Face_Name[27] = [nil, nil]
  77.   Face_Name[28] = [nil, nil]
  78.   Face_Name[29] = [nil, nil]
  79.   Face_Name[30] = [nil, nil]
  80.   Face_Name[31] = [nil, nil]
  81.   Face_Name[32] = [nil, nil]
  82.   Face_Name[33] = [nil, nil]
  83.   Face_Name[34] = [nil, nil]
  84.   Face_Name[35] = [nil, nil]
  85.   Face_Name[36] = [nil, nil]
  86.   Face_Name[37] = [nil, nil]
  87.   Face_Name[38] = [nil, nil]
  88.   Face_Name[39] = [nil, nil]
  89.   Face_Name[40] = [nil, nil]
  90.   Face_Name[41] = [nil, nil]
  91.   Face_Name[42] = [nil, nil]
  92.   Face_Name[43] = [nil, nil]
  93.   Face_Name[44] = [nil, nil]
  94.   Face_Name[45] = [nil, nil]
  95.   Face_Name[46] = [nil, nil]
  96.   Face_Name[47] = [nil, nil]
  97.   Face_Name[48] = [nil, nil]
  98.   Face_Name[49] = [nil, nil]
  99.   Face_Name[50] = [nil, nil]
  100.   Face_Name[51] = [nil, nil]
  101.   Face_Name[52] = [nil, nil]
  102.   Face_Name[53] = [nil, nil]
  103.   Face_Name[54] = [nil, nil]
  104.   Face_Name[55] = [nil, nil]
  105.   Face_Name[56] = [nil, nil]
  106.   Face_Name[57] = [nil, nil]
  107.   Face_Name[58] = [nil, nil]
  108.   Face_Name[59] = [nil, nil]
  109.   Face_Name[60] = [nil, nil]
  110.   Face_Name[61] = [nil, nil]
  111.   Face_Name[62] = [nil, nil]
  112.   Face_Name[63] = [nil, nil]
  113.   Face_Name[64] = [nil, nil]
  114.   Face_Name[65] = [nil, nil]
  115.   Face_Name[66] = [nil, nil]
  116.   Face_Name[67] = [nil, nil]
  117.   Face_Name[68] = [nil, nil]
  118.   Face_Name[69] = [nil, nil]
  119.   
  120.   # 確保するメンバーサイズ
  121.   # 他サイトさんの戦闘メンバー拡張スクリプトを導入している場合は、
  122.   # その最大数を設定してください
  123.   Max_Size = 4
  124.   
  125.   # 演出用の最終レベル
  126.   #(他サイトさんのレベル限界変更スクリプトを導入している場合は、
  127.   # その最終値を入力してください)
  128.   Final_Level = 99
  129.   
  130.   # 空EXPゲージの名前
  131.   Base_EXP_Gauge = "gauge"
  132.   
  133.   # 本体EXPゲージの名前
  134.   A_EXP_Gauge = "gauge_exp2"
  135.   
  136.   # 演出時間フレーム
  137.   #(1秒間が基本的に60フレームです。
  138.   # ただし、入手EXPがそれ未満の場合はEXP分のフレーム時間になります)
  139.   LVUP_Frame = 300
  140.   
  141.   # ゲージ加算SE([ファイル名, ボリューム, ピッチ)
  142.   # ※ マシンスペックが高くないと、おそらく処理落ちします
  143.   #    不要な場合はSE名に "" を設定してください
  144.   Gauge_SE = ["Decision1", 80, 400]
  145.   
  146.   # LVUP時に鳴らすSE([ファイル名, ボリューム, ピッチ)
  147.   LVUP_SE = ["Up4", 100, 150]
  148.   
  149.   #--------------------------------------------------------------------------
  150.   # ● KGC Softwareスクリプトの検索
  151.   #    key : スクリプトキー
  152.   #--------------------------------------------------------------------------
  153.   def self.search_kgc(key)
  154.     # 指定されたスクリプトが有効かどうか調べる
  155.     $imported != nil and $imported[key] == true
  156.   end
  157. end
  158. #==============================================================================
  159. # ■ Mint_Picture_Number
  160. #------------------------------------------------------------------------------
  161. #  ピクチャー数字のスプライト表示を扱うクラスです。
  162. #   このクラスは数値の高速再描写に特化したクラスとなっています。
  163. #==============================================================================

  164. class Mint_Picture_Number
  165.   #--------------------------------------------------------------------------
  166.   # ● ストリングポップ
  167.   #    string : 求められた文字列のピクチャーの名前
  168.   #    x_plus : 外部からのX座標の調整用
  169.   #    y_plus : 外部からのY座標の調整用
  170.   #--------------------------------------------------------------------------
  171.   def string_pop(string = "", x_plus = 0, y_plus = 0)
  172.     # string が無効なら処理を終了
  173.     return if string == ""
  174.     # 配列の nil をなくす
  175.     #@string_pop_sprite.compact!
  176.     #@string_pop_duration.compact!
  177.     # スプライトを生成
  178.     string_pop_sprite = Sprite.new
  179.     # 画像を描写
  180.     if Scene_Menu.method_defined?("snapshot_for_background") then
  181.       string_pop_sprite.bitmap = Cache.picture(string)
  182.     else
  183.       string_pop_sprite.bitmap = RPG::Cache.picture(string)
  184.     end
  185.     # 座標データを代入
  186.     string_pop_sprite.x = @x.to_i + x_plus
  187.     string_pop_sprite.y = @y.to_i + y_plus
  188.     string_pop_sprite.z = 10001
  189.     # 配列の先頭にシフト
  190.     @string_pop_sprite.push(string_pop_sprite)
  191.     @string_pop_duration.push(40)
  192.   end
  193.   #--------------------------------------------------------------------------
  194.   # ● フレーム更新
  195.   #    battler : バトラー
  196.   #--------------------------------------------------------------------------
  197.   def update(battler = nil)
  198.     # 1つでもストリングポップが表示中の場合
  199.     if @string_pop_sprite.size >= 1
  200.       # 表示中のストリングポップを1つずつ処理する
  201.       for i in 0...@string_pop_sprite.size
  202.         # ストリングポップを代入
  203.         string = @string_pop_sprite[i]
  204.         # スプライトが無効な場合
  205.         if string.nil?
  206.           # 次の処理へ
  207.           next
  208.         end
  209.         # 不透明度が0の場合
  210.         if string.opacity <= 0
  211.           # ストリングポップを解放
  212.           #dispose_string_pop(i)
  213.           # 次の処理へ
  214.           next
  215.         end
  216.         # カウントを減らす
  217.         @string_pop_duration[i] -= 1
  218.         # 残りカウントに応じて分岐
  219.         case @string_pop_duration[i]
  220.         when 36..39
  221.           string.y -= 4
  222.           string.blend_type = 1
  223.         when 33..37
  224.           string.y -= 2
  225.           string.blend_type = 1
  226.         when 32..34
  227.           string.y += 2
  228.           string.blend_type = 0
  229.         when 25..32
  230.           string.y += 4
  231.           string.blend_type = 0
  232.         end
  233.         # 透明度をカウントに応じて下げる
  234.         string.opacity = 255 - ((12 - @string_pop_duration[i]) * 26)
  235.       end
  236.       # 配列の nil を無くす
  237.       #@string_pop_sprite.compact!
  238.       #@string_pop_duration.compact!
  239.     end
  240.   end
  241. end
  242. #==============================================================================
  243. # ■ MINTO_Number
  244. #------------------------------------------------------------------------------
  245. #  ピクチャーよる数字の表示を扱うモジュールです。
  246. #   このモジュールは数値の高速描写に特化したモジュールとなっています。
  247. #==============================================================================

  248. module MINTO_Number
  249.   #--------------------------------------------------------------------------
  250.   # ● 定数
  251.   #--------------------------------------------------------------------------
  252.   WIDHT  = -4 # 横幅調節値
  253.   HEIGHT = 24 # 1カラーの高さ
  254.   #--------------------------------------------------------------------------
  255.   # ● 数字の描写
  256.   #    x      : 描写先 X 座標
  257.   #    y      : 描写先 Y 座標
  258.   #    number : 描写する数字
  259.   #    bitmap : 使用するビットマップ
  260.   #    color  : 使用するカラーインデックス
  261.   #    text   : 使用する画像ファイル名
  262.   #--------------------------------------------------------------------------
  263.   def self.draw_number(x, y, number, bitmap, color = 0, text = "String02")
  264.     # ピクチャーの読み込み
  265.     picture = Cache.picture(text)
  266.     # ピクチャーの基本の横幅を取得する
  267.     width_base = picture.width / 10.0
  268.     # 求められた数字を一文字ずつ配列にする
  269.     array = number.to_s.split(//)
  270.     # ループ処理(イテレータ)
  271.     (0...array.size).each do |i|
  272.       # 描写座標を計算
  273.       draw_x = array[i].to_i * width_base
  274.       draw_y = HEIGHT * color
  275.       # 描写座標を取得する
  276.       rect = Rect.new(draw_x, draw_y, width_base, HEIGHT)
  277.       # 数字を描写
  278.       bitmap.blt(x + (i * (width_base + WIDHT)), y + 4, picture, rect)
  279.     end
  280.   end
  281. end
  282. #==============================================================================
  283. # ■ Mint_Gauge_System_Active
  284. #------------------------------------------------------------------------------
  285. #  ピクチャーゲージのスプライト表示を扱うクラスです。
  286. #   このクラスはゲージの高速再描写に特化したクラスとなっています。
  287. #==============================================================================

  288. class Mint_Gauge_System_Active
  289.   #--------------------------------------------------------------------------
  290.   # ● オブジェクト初期化
  291.   #    gauge : ゲージ画像
  292.   #--------------------------------------------------------------------------
  293.   def initialize(x, y, z = 500, type = 0)
  294.     # 空ゲージを読み込む
  295.     gauge_base = Cache.picture(MINTO::Base_EXP_Gauge)
  296.     # 空ゲージ用のスプライトを作成
  297.     @sprite_gauge_base = Sprite.new
  298.     # 座標を設定
  299.     @sprite_gauge_base.x = x
  300.     @sprite_gauge_base.y = y
  301.     @sprite_gauge_base.z = z
  302.     # スプライトを作成
  303.     [url=home.php?mod=space&uid=114926]@sprite[/url] = @sprite_gauge_base.dup
  304.     @sprite.x -= 16
  305.     @sprite.y -= 16
  306.     @sprite.z += 1
  307.     @sprite.bitmap = Bitmap.new(64, 32)
  308.     @sprite.bitmap.font.color.set(0, 200, 250)
  309.     # 空ゲージを描写
  310.     @sprite_gauge_base.bitmap = gauge_base
  311.     # 本体ゲージを読み込む
  312.     @gauge = gauge_initialize(type)
  313.     # 本体ゲージ用の配列を作成
  314.     @sprite_gauge = [Sprite.new]
  315.     (1..6).each do |i|
  316.       # 本体ゲージ用のスプライトを作成
  317.       @sprite_gauge[i] = Sprite.new
  318.       # 座標を設定
  319.       @sprite_gauge[i].x = (x - i) + 8
  320.       @sprite_gauge[i].y = y + i
  321.       @sprite_gauge[i].z = z
  322.     end
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # ● ゲージ用ビットマップの作成
  326.   #--------------------------------------------------------------------------
  327.   def gauge_initialize(type)
  328.     # タイプに応じて分岐
  329.     case type
  330.     when 0
  331.       # ゲージの読み込み
  332.       gauge = Cache.picture(MINTO::A_EXP_Gauge)
  333.     end
  334.     # 本体ゲージ用のスプライトを作成
  335.     sprite_gauge = []
  336.     (1..100).each do |i|
  337.       # 本体ゲージ用のビットマップを作成
  338.       sprite_gauge[i] = Bitmap.new(i, 1)
  339.       # 本体ゲージ用の描写範囲を計算
  340.       dest_rect = Rect.new(0, 0, i, 1)
  341.       sprite_gauge[i].stretch_blt(dest_rect, gauge, gauge.rect)
  342.     end
  343.     return sprite_gauge
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 解放
  347.   #--------------------------------------------------------------------------
  348.   def dispose
  349.     # スプライトを解放
  350.     for s in @sprite_gauge
  351.       s.dispose
  352.     end
  353.     @sprite_gauge_base.bitmap.dispose
  354.     @sprite_gauge_base.dispose
  355.     @sprite.bitmap.dispose
  356.     @sprite.dispose
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ● 縁文字描写
  360.   #--------------------------------------------------------------------------
  361.   def draw_frame_text(x, y, width, height, text, ag = 0)
  362.     # 元の色を保存
  363.     ori_color = @sprite.bitmap.font.color.clone
  364.     # 縁の色を定義
  365.     @sprite.bitmap.font.color.set(0, 0, 0)
  366.     # 縁文字を描写
  367.     @sprite.bitmap.draw_text(x-1, y, width, height, text, ag)
  368.     @sprite.bitmap.draw_text(x+1, y, width, height, text, ag)
  369.     @sprite.bitmap.draw_text(x, y-1, width, height, text, ag)
  370.     @sprite.bitmap.draw_text(x, y+1, width, height, text, ag)
  371.     # 元の色に戻す
  372.     @sprite.bitmap.font.color = ori_color
  373.     # 本体の文字を描写
  374.     @sprite.bitmap.draw_text(x, y, width, height, text, ag)
  375.   end
  376.   #--------------------------------------------------------------------------
  377.   # ● 可視状態の取得
  378.   #--------------------------------------------------------------------------
  379.   def visible
  380.     # 先頭の可視状態を返す
  381.     return @sprite_gauge[1].visible
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # ● 可視状態の変更
  385.   #    visible : 新しい可視状態
  386.   #--------------------------------------------------------------------------
  387.   def visible=(visible)
  388.     # 可視状態の変更(イテレータ)
  389.     (1..6).each{|i| @sprite_gauge[i].visible = visible}
  390.     @sprite_gauge_base.visible = visible
  391.   end
  392.   #--------------------------------------------------------------------------
  393.   # ● レートの設定
  394.   #    rate : ゲージの減少率
  395.   #--------------------------------------------------------------------------
  396.   def set_rate(rate)
  397.     rate = [[rate, 100].min, 0].max
  398.     # ゲージを実際に描写
  399.     @sprite_gauge[1].bitmap = @gauge[rate]
  400.     @sprite_gauge[2].bitmap = @gauge[rate]
  401.     @sprite_gauge[3].bitmap = @gauge[rate]
  402.     @sprite_gauge[4].bitmap = @gauge[rate]
  403.     @sprite_gauge[5].bitmap = @gauge[rate]
  404.     @sprite_gauge[6].bitmap = @gauge[rate]
  405.   end
  406. end
  407. #==============================================================================
  408. # ■ Game_Temp
  409. #------------------------------------------------------------------------------
  410. #  セーブデータに含まれない、一時的なデータを扱うクラスです。このクラスのイン
  411. # スタンスは $game_temp で参照されます。
  412. #==============================================================================

  413. class Game_Temp
  414.   #--------------------------------------------------------------------------
  415.   # ● 公開インスタンス変数
  416.   #--------------------------------------------------------------------------
  417.   attr_accessor :after_battle_phase       # アフターバトルフェーズ中フラグ
  418. end
  419. #==============================================================================
  420. # ■ Game_Actor
  421. #------------------------------------------------------------------------------
  422. #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
  423. # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
  424. #==============================================================================

  425. class Game_Actor < Game_Battler
  426.   #--------------------------------------------------------------------------
  427.   # ● EXPリストの取得
  428.   #--------------------------------------------------------------------------
  429.   def exp_list
  430.     return @exp_list
  431.   end
  432.   #--------------------------------------------------------------------------
  433.   # ● ゲージ用のEXP_NEXT の取得
  434.   #--------------------------------------------------------------------------
  435.   def minto_next_exp(lv, exp)
  436.     exp_rate = exp_for_level(lv + 1) - exp_for_level(lv)
  437.     next_exp = exp_for_level(lv + 1) - exp
  438.     rate = (next_exp * 100) / exp_rate
  439.     if exp_for_level(lv + 1) == 0
  440.       rate = 100
  441.     end
  442.     return 100 - rate
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # ● 次のレベルまでの EXP 取得
  446.   #--------------------------------------------------------------------------
  447.   def next_rest_exp2(lv, exp)
  448.     return exp_for_level(lv + 1) > 0 ? (exp_for_level(lv + 1) - exp) : 0
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # ● 次のレベルの経験値を取得
  452.   #--------------------------------------------------------------------------
  453.   def next_level_exp
  454.     exp_for_level([url=home.php?mod=space&uid=22147]@level[/url] + 1)
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ○ AP 獲得(KGC[EquipLearnSkill]再定義)
  458.   #    ap   : AP の増加量
  459.   #    show : マスタースキル表示フラグ
  460.   #--------------------------------------------------------------------------
  461.   def gain_ap(ap, show)
  462.     # 最終スキルを記憶
  463.     last_full_ap_skills = full_ap_skills
  464.     # 装備品により習得しているスキルに AP を加算
  465.     equipment_skills(true).each do |skill|
  466.       # APの変更
  467.       change_ap(skill, skill_ap(skill.id) + ap)
  468.     end
  469.     # マスタースキル表示フラグが有効で、且つスキル要素が異なっている場合
  470.     if show == true and (last_full_ap_skills != full_ap_skills) then
  471.       # メソッドを返す(スキル習得)
  472.       return true
  473.     end
  474.     # メソッドを返す(スキル未習得)
  475.     return false
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # ○ マスターしたスキルの表示(KGC[EquipLearnSkill]再定義)
  479.   #    new_skills : 新しくマスターしたスキルの配列
  480.   #--------------------------------------------------------------------------
  481.   def display_full_ap_skills(new_skills)
  482.     # 無効化(処理を行わない)
  483.     return
  484.   end
  485. end
  486. #==============================================================================
  487. # ■ Game_Troop
  488. #------------------------------------------------------------------------------
  489. #  敵グループおよび戦闘に関するデータを扱うクラスです。バトルイベントの処理も
  490. # 行います。このクラスのインスタンスは $game_troop で参照されます。
  491. #==============================================================================

  492. class Game_Troop < Game_Unit
  493.   #--------------------------------------------------------------------------
  494.   # ● 全滅判定の取得
  495.   #--------------------------------------------------------------------------
  496.   def all_dead?
  497.     # スーパークラスの処理に以降
  498.     bool = super
  499.     # 勝利確定の場合
  500.     if bool then
  501.       # アフターバトルフェーズ中でない場合
  502.       unless $game_temp.after_battle_phase then
  503.         # アフターバトルフェーズを予約する
  504.         $game_temp.after_battle_phase = true
  505.         # アフターバトルフェーズ準備
  506.         SceneManager.scene.reservation_after_battle_phase
  507.       end
  508.     end
  509.     # メソッドを返す
  510.     return bool
  511.   end
  512.   #--------------------------------------------------------------------------
  513.   # ● ドロップアイテムの配列作成)
  514.   #    forcing : 強制フラグ
  515.   #--------------------------------------------------------------------------
  516.   def make_drop_items(forcing = false)
  517.     # 強制フラグがオフの場合
  518.     if forcing == false then
  519.       # メソッドを返す
  520.       return []
  521.     end
  522.     return dead_members.inject([]) {|r, enemy| r += enemy.make_drop_items }
  523.   end
  524. end
  525. #==============================================================================
  526. # ■ Game_Message
  527. #------------------------------------------------------------------------------
  528. #  文章や選択肢などを表示するメッセージウィンドウの状態を扱うクラスです。この
  529. # クラスのインスタンスは $game_message で参照されます。
  530. #==============================================================================

  531. class Game_Message
  532.   #--------------------------------------------------------------------------
  533.   # ● テキストの追加
  534.   #--------------------------------------------------------------------------
  535.   alias :minto_rgss3_3_add :add
  536.   def add(text)
  537.     # アフターバトルフェーズが予約されている場合
  538.     if $game_temp.after_battle_phase
  539.       # メソッドを返す
  540.       return
  541.     end
  542.     # 元の処理を実行
  543.     minto_rgss3_3_add(text)
  544.   end
  545. end
  546. #==============================================================================
  547. # ■ Window_BattleMessage
  548. #------------------------------------------------------------------------------
  549. #  戦闘中に表示するメッセージウィンドウです。通常のメッセージウィンドウの機能
  550. # に加え、戦闘進行のナレーションを表示する機能を持ちます。
  551. #==============================================================================

  552. class Window_BattleMessage < Window_Message
  553.   #--------------------------------------------------------------------------
  554.   # ● 可視状態の変更
  555.   #    visible : 新しい可視状態
  556.   #--------------------------------------------------------------------------
  557.   def visible=(visible)
  558.     # アフターバトルフェーズ中の場合
  559.     if $game_temp.after_battle_phase == true then
  560.       # スーパークラスを実行(文章の無効化)
  561.       super(visible)
  562.       # メッセージを不可視にする
  563.       $game_message.visible = false
  564.       # メッセージとそれに係わるフラグを無効化
  565.       $game_message.texts.clear
  566.     # アフターバトルフェーズ中でない場合
  567.     else
  568.       # スーパークラスを実行(通常の処理)
  569.       super(visible)
  570.     end
  571.   end
  572.   #--------------------------------------------------------------------------
  573.   # ● フレーム更新
  574.   #--------------------------------------------------------------------------
  575.   alias :update_Active_Lv_UpVX :update
  576.   def update
  577.     # 元の処理を実行
  578.     update_Active_Lv_UpVX
  579.     # アフターバトルフェーズ中の場合
  580.     if $game_temp.after_battle_phase == true then
  581.       # ウィンドウを可視状態にする
  582.       self.visible = true
  583.     end
  584.   end
  585. end
  586. #==============================================================================
  587. # ■ Window_BattleResult
  588. #------------------------------------------------------------------------------
  589. #  バトル終了時に、獲得した EXP やゴールドなどを表示するウィンドウです。
  590. #==============================================================================

  591. class Window_BattleResult < Window_Base
  592.   #--------------------------------------------------------------------------
  593.   # ● オブジェクト初期化
  594.   #     exp       : EXP
  595.   #     gold      : ゴールド
  596.   #     treasures : トレジャー
  597.   #--------------------------------------------------------------------------
  598.   def initialize(exp, gold, treasures, ap, gage_window)
  599.     super(320, 0, 224, 416)
  600.     self.opacity = 255
  601.     self.z = 0x270f
  602.     # 各データを保管
  603.     [url=home.php?mod=space&uid=13302]@exp[/url] = [exp, 999999].min
  604.     [url=home.php?mod=space&uid=236945]@gold[/url] = [gold, 999999].min
  605.     @ap = ap
  606.     @puls = 0
  607.     @items = {}
  608.     @gage_window = gage_window
  609.     # 文字の表示形式を調節
  610.     self.contents.font.italic = true
  611.     # テキストの配列を作成
  612.     text_array = ["EXP", Vocab::currency_unit]
  613.     # APが0以外の場合
  614.     if @ap != 0 then
  615.       # 用語[AP]を追加
  616.       text_array << "AP"
  617.       @puls = 48
  618.     end
  619.     # ループ処理
  620.     for i in 0...text_array.size do
  621.       # テキストを取得
  622.       text = text_array[i]
  623.       # テキスト表示
  624.       frame_text(4, 8 + 50 * i, 224, 25, text, system_color)
  625.       # アンダーライン描写
  626.       self.contents.fill_rect(4, 40 + 50 * i, 224, 1, system_color)
  627.     end
  628.     # 文字の表示形式を戻す
  629.     self.contents.font.italic = false
  630.     # 入手アイテムが1つでも存在する場合
  631.     if treasures.to_a != [] then
  632.       # ループ処理
  633.       for item in treasures do
  634.         # 無効な個数の場合
  635.         if @items[item] == nil then
  636.           # 個数を初期化
  637.           @items[item] = 0
  638.         end
  639.         # 個数を加算
  640.         @items[item] += 1
  641.         # アイテムを入手
  642.         $game_party.gain_item(item, 1)
  643.       end
  644.       # 重複するアイテムを削除
  645.       treasures.uniq!
  646.       # トレジャー用のテキストを表示
  647.       frame_text(4, 24 * 4 + @puls, 256, 24, "入手道具", system_color)
  648.       # 入手アイテム名のY座標
  649.       y = 24 * 5 + @puls
  650.       # ループ処理
  651.       for item in treasures do
  652.         # 入手アイテムを描写
  653.         draw_item_name(item, 4, y)
  654.         y += 24
  655.       end
  656.     end
  657.     refresh
  658.   end
  659.   #--------------------------------------------------------------------------
  660.   # ● 縁文字描写
  661.   #--------------------------------------------------------------------------
  662.   def frame_text(x, y, width, height, text, color, ag = 0)
  663.     self.contents.font.color.set(0, 0, 0)
  664.     self.contents.font.shadow = false
  665.     self.contents.draw_text(x-1, y, width, height, text, ag)
  666.     self.contents.draw_text(x+1, y, width, height, text, ag)
  667.     self.contents.draw_text(x, y-1, width, height, text, ag)
  668.     self.contents.draw_text(x, y+1, width, height, text, ag)
  669.     self.contents.font.color = color
  670.     self.contents.draw_text(x, y, width, height, text, ag)
  671.   end
  672.   #--------------------------------------------------------------------------
  673.   # ● アイテム名の描画
  674.   #     item : アイテム
  675.   #     x    : 描画先 X 座標
  676.   #     y    : 描画先 Y 座標
  677.   #--------------------------------------------------------------------------
  678.   def draw_item_name(item, x, y)
  679.     # 無効なアイテムの場合
  680.     if item == nil then
  681.       # メソッドを返す
  682.       return
  683.     end
  684.     # アイテムのアイコンを描写
  685.     draw_icon(item.icon_index, x, y, true)
  686.     # アイテム名を縁取りして描写
  687.     frame_text(x + 28, y, 112, 24, item.name, normal_color)
  688.     # 対象アイテムを2つ以上入手している場合
  689.     if @items[item] >= 2 then
  690.       # アイテムの入手個数を描写
  691.       frame_text(-24, y, 188, 24, "×", normal_color, 2)
  692.       frame_text(0, y, 188, 24, @items[item].to_s, normal_color, 2)
  693.     end
  694.   end
  695.   #--------------------------------------------------------------------------
  696.   # ● リフレッシュ
  697.   #--------------------------------------------------------------------------
  698.   def refresh
  699.     self.openness = 1
  700.     @gage_window.openness = 1
  701.     @gage_window.visible = true
  702.     # 16フレーム待つ
  703.     16.times do
  704.       # ウィンドウを開く
  705.       self.openness += 16
  706.       @gage_window.openness += 16
  707.       # ゲーム画面を更新
  708.       Graphics.update
  709.     end
  710.     # EXPを描写
  711.     MINTO_Number.draw_number(96, 4, @exp, self.contents, 1)
  712.     # ゴールドを描写
  713.     MINTO_Number.draw_number(96, 52, @gold, self.contents, 1)
  714.     # APが0以外の場合
  715.     if @ap != 0 then
  716.       # APを描写
  717.       MINTO_Number.draw_number(96, 100, @ap, self.contents, 1)
  718.     end
  719.     # ゲージウィンドウをリフレッシュ
  720.     @gage_window.refresh_exp
  721.   end
  722. end
  723. #==============================================================================
  724. # ■ Window_Active_Exp
  725. #------------------------------------------------------------------------------
  726. #  獲得したEXPに応じて、ゲージを変動させるウィンドウです。
  727. #==============================================================================

  728. class Window_Active_Exp < Window_Base
  729.   #--------------------------------------------------------------------------
  730.   # ● オブジェクト初期化
  731.   #    exp : EXP
  732.   #--------------------------------------------------------------------------
  733.   def initialize(exp, skills, last_exp, last_level)
  734.     super(0, 0, 320, 416)
  735.     edge = Cache.picture("Blue_Edge")
  736.     @exp = exp
  737.     # EXP表示用の配列を作成
  738.     @text = []
  739.     # LV表示用の配列を作成
  740.     @lv = []
  741.     # EXPゲージ用の配列
  742.     @exp_gauge = []
  743.     # スキル保存用の配列
  744.     @skills = []
  745.     # 最終EXP用の配列
  746.     @last_exp = last_exp
  747.     # 最終レベル用の配列
  748.     @last_level = last_level
  749.     # ループ処理
  750.     for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  751.       # 配列を初期化
  752.       @skills[i] = []
  753.       # ループ処理
  754.       for id in 0...skills[i].size do
  755.         # スキルが有効な場合
  756.         if skills[i] != nil and skills[i][id] != nil then
  757.           # 最終スキルの配列の複製を作成
  758.           @skills[i] << skills[i][id].id
  759.         end
  760.       end
  761.     end
  762.     # 演出スキップフラグをクリア
  763.     @skip = false
  764.     self.opacity = 255
  765.     self.z = 9999
  766.     # スプライトを作成
  767.     @sprite = Sprite.new
  768.     # スプライトのビットマップを作成
  769.     @sprite.bitmap = Bitmap.new(width - 32, height - 32)
  770.     # スプライトのデータを設定
  771.     @sprite.x = self.x + 16
  772.     @sprite.y = self.y + 16
  773.     @sprite.z = 10000
  774.     # グラフィック用のスプライトを作成
  775.     @sprite3 = @sprite.dup
  776.     @sprite3.z = 9999
  777.     @sprite3.bitmap = Bitmap.new(width - 32, 416)
  778.     @sprite3.visible = false
  779.     # ループ処理
  780.     for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  781.       dest_rect = Rect.new(0, 16 + (96 * i), 352 * 81 / 100, 108 * 81 / 100)
  782.       @sprite3.bitmap.stretch_blt(dest_rect, edge, edge.rect)
  783.     end
  784.     # グラフィック用のスプライトを作成
  785.     @sprite2 = @sprite.dup
  786.     @sprite2.z = 9999
  787.     @sprite2.bitmap = Bitmap.new(width - 32, height - 32)
  788.   end
  789.   #--------------------------------------------------------------------------
  790.   # ● プラス座標の取得
  791.   #--------------------------------------------------------------------------
  792.   def puls_y
  793.     size = MINTO::Max_Size
  794.     return (96.0 * (4.0 / size.to_f)).to_i
  795.   end
  796.   #--------------------------------------------------------------------------
  797.   # ● 修正座標の取得
  798.   #    y : Y座標
  799.   #--------------------------------------------------------------------------
  800.   def y_pass(y)
  801.     size = MINTO::Max_Size
  802.     return (y * (4.0 / size.to_f)).to_i
  803.   end
  804.   #--------------------------------------------------------------------------
  805.   # ● スプライトの作成
  806.   #--------------------------------------------------------------------------
  807.   def sprite_set
  808.     # パーティー人数分だけ繰り返す
  809.     for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  810.       # アクターを取得
  811.       actor = $game_party.all_members[i]
  812.       # 座標を取得
  813.       y = i * puls_y
  814.       # アクター名を描写
  815.       frame_text(4, y, 164, 24, actor.name, normal_color)
  816.       # 用語を描写
  817.       frame_text(12, y + y_pass(36), 64, 24, "LV", system_color)
  818.       frame_text(128, y + y_pass(66), 64, 24, "NEXT", system_color, 2)
  819.     end
  820.   end
  821.   #--------------------------------------------------------------------------
  822.   # ● 顔グラフィックの描画
  823.   #     face_name  : 顔グラフィック ファイル名
  824.   #     face_index : 顔グラフィック インデックス
  825.   #     x          : 描画先 X 座標
  826.   #     y          : 描画先 Y 座標
  827.   #     size       : 表示サイズ
  828.   #--------------------------------------------------------------------------
  829.   def draw_face(face_name, face_index, x, y, size = puls_y)
  830.     rect = Rect.new(0, 0, 0, 0)
  831.     rect.x = (face_index % 4 * 96 + (96 - size) / 2)
  832.     rect.y = (face_index / 4 * 96 + (96 - size) / 2)
  833.     rect.width = puls_y.to_m(96)
  834.     rect.height = puls_y.to_m(96)
  835.     # 対象の範囲を消す
  836.     @sprite2.bitmap.fill_rect(x, y, puls_y, puls_y, Color.new(0, 0, 0, 0))
  837.     @sprite2.bitmap.blt(x + 76, y, Cache.face(face_name), rect)
  838.   end
  839.   #--------------------------------------------------------------------------
  840.   # ● グラフィックの作成
  841.   #    actor : アクター
  842.   #    x     : 描写先のX座標
  843.   #    y     : 描写先のY座標
  844.   #    index : インデックス
  845.   #    type  : 描写タイプ
  846.   #--------------------------------------------------------------------------
  847.   def graphic_set(actor, x, y, index, type)
  848.     # 顔グラフィックの配列
  849.     face = []
  850.     # 顔グラフィック末尾名が有効な場合
  851.     unless MINTO::Face_Name[actor.id][type].nil? then
  852.       # ファイル名を作成
  853.       file_name = "#{actor.face_name}_#{actor.face_index}"
  854.       # ファイル末尾名を取得
  855.       file_name += MINTO::Face_Name[actor.id][type]
  856.       # 顔グラフィックを読み込む
  857.       face[index] = Cache.picture(file_name)
  858.       # 対象の範囲を消す
  859.       rect = Rect.new(x, y, puls_y, puls_y)
  860.       @sprite2.bitmap.fill_rect(rect, Color.new(0, 0, 0, 0))
  861.       # 顔グラフィックを描写
  862.       @sprite2.bitmap.blt(x, y, face[index], Rect.new(0, 0, puls_y, puls_y))
  863.     # 顔グラフィック末尾名が無効な場合
  864.     else
  865.       # 現在の設定グラフィックを描写
  866.       draw_face(actor.face_name, actor.face_index, x, y)
  867.     end
  868.   end
  869.   #--------------------------------------------------------------------------
  870.   # ● 縁文字描写
  871.   #--------------------------------------------------------------------------
  872.   def frame_text(x, y, width, height, text, color, ag = 0)
  873.     @sprite.bitmap.font.color.set(0, 0, 0)
  874.     @sprite.bitmap.font.shadow = false
  875.     @sprite.bitmap.draw_text(x-1, y, width, height, text, ag)
  876.     @sprite.bitmap.draw_text(x+1, y, width, height, text, ag)
  877.     @sprite.bitmap.draw_text(x, y-1, width, height, text, ag)
  878.     @sprite.bitmap.draw_text(x, y+1, width, height, text, ag)
  879.     @sprite.bitmap.font.color = color
  880.     @sprite.bitmap.draw_text(x, y, width, height, text, ag)
  881.   end
  882.   #--------------------------------------------------------------------------
  883.   # ● リフレッシュEXP
  884.   #--------------------------------------------------------------------------
  885.   def refresh_exp
  886.     # 可視フラグをオン
  887.     self.visible = true
  888.     @sprite3.visible = true
  889.     # 用語を描写
  890.     sprite_set
  891.     # 更新フレーム数を作成
  892.     thyme = @exp < MINTO::LVUP_Frame ? @exp.abs : MINTO::LVUP_Frame
  893.     rate_p = @exp < MINTO::LVUP_Frame ? @exp.abs : MINTO::LVUP_Frame
  894.     # EXPの配列
  895.     exp = []
  896.     # LVの配列
  897.     last_lv = []
  898.     # 最終EXPの配列
  899.     last_exp = []
  900.     # レベルアップフラグ
  901.     level_up = []
  902.     # パーティー人数分だけ繰り返す
  903.     for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  904.       actor = $game_party.all_members[i]
  905.       # 座標を取得
  906.       x = 160
  907.       y = i * puls_y
  908.       # LV表示用のピクチャー数字を作成
  909.       @lv[i] = Mint_Picture_Number.new(52, y + y_pass(52), 2, 10000)
  910.       # NEXT_EXP表示用のピクチャー数字を作成
  911.       @text[i] = Mint_Picture_Number.new(x + 40, y + y_pass(82), 6, 10000)
  912.       # EXPゲージを作成
  913.       @exp_gauge[i] = Mint_Gauge_System_Active.new(x + 8,
  914.       y + y_pass(102), 9999)
  915.       # 最終LevelとEXPを代入
  916.       last_lv[i] = @last_level[i].to_i
  917.       last_exp[i] = @last_exp[i].to_i
  918.       # EXPの獲得が可能な場合
  919.       if actor.exist? then
  920.         # 入手EXPがLVUP_Frame以上なら、LVUP_Frameで割ってその余りを求める
  921.         if @exp > MINTO::LVUP_Frame then
  922.           last_exp[i] += @exp % MINTO::LVUP_Frame
  923.           # 経験値2倍の場合
  924.           if actor.final_exp_rate >= 2
  925.             # 倍率補正を考慮
  926.             for to_loop in 0...(actor.final_exp_rate - 1) do
  927.               last_exp[i] += @exp % MINTO::LVUP_Frame
  928.             end
  929.           end
  930.         end
  931.       end
  932.       # グラフィックを描写
  933.       graphic_set(actor, 0, y, actor.id, 0)
  934.     end
  935.     # 更新フレームがなくなるまで繰り返す
  936.     thyme.times do
  937.       # グラフィックをクリア
  938.       @sprite2.bitmap.clear
  939.       # Cボタンが押された場合
  940.       if Input.trigger?(Input::C)
  941.         # スキップフラグをオン
  942.         @skip = true
  943.       end
  944.       # スキップしない場合
  945.       if @skip != true then
  946.         # ゲージ加算SEが有効な場合
  947.         if MINTO::Gauge_SE[0] != "" then
  948.           # SEデータを代入
  949.           data = MINTO::Gauge_SE
  950.           # ゲージ加算SEを演奏
  951.           Audio.se_play("Audio/SE/#{data[0]}", data[1], data[2])
  952.         end
  953.       end
  954.       # パーティー人数分だけ繰り返す
  955.       for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  956.         # アクターを代入
  957.         actor = $game_party.all_members[i]
  958.         # EXPの獲得が可能な場合
  959.         if actor.exist? then
  960.           # 描写用のEXPを加算
  961.           last_exp[i] += (@exp / rate_p)
  962.           # 経験値倍率補正がある場合
  963.           if actor.final_exp_rate >= 2
  964.             # 倍率補正を考慮
  965.             for to_loop in 0...(actor.final_exp_rate - 1) do
  966.               last_exp[i] += (@exp / rate_p)
  967.             end
  968.           end
  969.         end
  970.         # NEXT_EXPを取得
  971.         next_p = actor.next_rest_exp2(last_lv[i], last_exp[i])
  972.         # NEXT_EXPが文字列ではない場合
  973.         if next_p.is_a?(Numeric) then
  974.           # 最低値を0に設定
  975.           next_p = next_p.to_min(0)
  976.           # アクターのマザーデータを取得
  977.           d_actor = $data_actors[actor.id]
  978.           # 最終レベルを代入
  979.           final_level = MINTO::Final_Level
  980.           # レベルアップが可能な場合
  981.           # (NEXT_EXPが0で且つ、最終レベルがMAXレベル未満の場合)
  982.           if next_p == 0 and last_lv[i] < final_level then
  983.             # 描写用のLVを加算
  984.             last_lv[i] += 1
  985.             # スキル習得判定
  986.             for skill in actor.class.learnings do
  987.               # レベル条件を満たしている場合
  988.               if last_lv[i] >= skill.level then
  989.                 # 最終スキルに存在しない場合
  990.                 unless @skills[i].include?(skill.skill_id) then
  991.                   # 最終スキルに保存
  992.                   @skills[i].push(skill.skill_id)
  993.                   # NewSkill表示
  994.                   @lv[i].string_pop("NewSkill", 144, y_pass(-32))
  995.                 end
  996.               end
  997.             end
  998.             # スキップしない場合
  999.             if @skip != true then
  1000.               # SEデータを代入
  1001.               data = MINTO::LVUP_SE
  1002.               # SEを演奏する
  1003.               Audio.se_play("Audio/SE/#{data[0]}", data[1], data[2])
  1004.             end
  1005.             # 限界レベルを取得
  1006.             last_lv[i] = [last_lv[i], final_level].min
  1007.             # LVUP表示
  1008.             @lv[i].string_pop("lvup", 144)
  1009.             # レベルアップフラグを設定
  1010.             level_up[i] = true
  1011.           end
  1012.           # レベルアップが有効な場合
  1013.           if level_up[i] == true then
  1014.             # グラフィックを描写
  1015.             graphic_set(actor, 0, (i * puls_y), actor.id, 1)
  1016.           else
  1017.             # グラフィックを描写
  1018.             graphic_set(actor, 0, (i * puls_y), actor.id, 0)
  1019.           end
  1020.         end
  1021.         # ゲージの長さを算出
  1022.         n = actor.next_rest_exp2(last_lv[i], last_exp[i])
  1023.         rate = actor.minto_next_exp(last_lv[i], last_exp[i]).to_max(0, 100)
  1024.         # ゲージを更新
  1025.         @exp_gauge[i].set_rate(rate)
  1026.         # NEXT_EXPを描写
  1027.         @text[i].set_text(n.to_min(0))
  1028.         # 最終レベルを描写
  1029.         @lv[i].set_text(last_lv[i])
  1030.         # LVUP表示を更新
  1031.         @lv[i].update
  1032.       end
  1033.       # スキップフラグがオフの場合
  1034.       if @skip == false then
  1035.         # ゲーム画面を更新
  1036.         Graphics.update
  1037.         # 入力情報を更新
  1038.         Input.update
  1039.       end
  1040.     end
  1041.     # 必須ウェイトタイム(変更しない)
  1042.     thyme = 0
  1043.     # パーティー人数分だけ繰り返す
  1044.     for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  1045.       # LVUP表示カウントを取得する
  1046.       size = @lv[i].string_pop_duration.size
  1047.       count = @lv[i].string_pop_duration[size - 1].to_i
  1048.       # thyme より count の方が高ければ thyme を上書き
  1049.       if count > thyme then
  1050.         thyme = count
  1051.       end
  1052.     end
  1053.     # 必須ウェイトタイムが1以上の限り更新する
  1054.     while thyme >= 1 do
  1055.       # パーティー人数分だけ繰り返す
  1056.       for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  1057.         # LVUP表示を更新
  1058.         @lv[i].update
  1059.       end
  1060.       # カウントを減らす
  1061.       thyme -= 1
  1062.       # ゲーム画面を更新
  1063.       Graphics.update
  1064.     end
  1065.     # 入力情報を更新
  1066.     Input.update
  1067.   end
  1068.   #--------------------------------------------------------------------------
  1069.   # ● フレーム更新(スキル習得)
  1070.   #    learning_skill : 新たにスキルを習得したかどうかのフラグ
  1071.   #--------------------------------------------------------------------------
  1072.   def update_skill(learning_skill)
  1073.     # SkillLearningSE演奏フラグ
  1074.     learning = 0
  1075.     # パーティー人数分だけ繰り返す
  1076.     for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  1077.       # アクターを代入
  1078.       actor = $game_party.all_members[i]
  1079.       # EXPの獲得が可能な場合
  1080.       if $game_party.existing_members.include?(actor) then
  1081.         # スキル数が増えている場合
  1082.         if learning_skill[actor] == true then
  1083.           # SkillLearning表示
  1084.           @lv[i].string_pop("learning", -64, y_pass(-32))
  1085.           # SEを演奏する
  1086.           learning = 1
  1087.         end
  1088.       end
  1089.     end
  1090.     # 一人でもスキルを習得した場合
  1091.     if learning == 1 then
  1092.       # SEデータを代入
  1093.       data = MINTO::LVUP_SE
  1094.       # SEを演奏する
  1095.       Audio.se_play("Audio/SE/#{data[0]}", data[1], data[2])
  1096.     end
  1097.     # 必須ウェイトタイム(変更しない)
  1098.     thyme = 0
  1099.     # パーティー人数分だけ繰り返す
  1100.     for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  1101.       # LVUP表示カウントを取得する
  1102.       count = @lv[i].string_pop_duration[0].to_i
  1103.       # thyme より count の方が高ければ thyme を上書き
  1104.       if count > thyme then
  1105.         thyme = count
  1106.       end
  1107.     end
  1108.     # ループ処理(必須ウェイトタイム)
  1109.     thyme.times do
  1110.       # パーティー人数分だけ繰り返す
  1111.       for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  1112.         # LVUP表示を更新
  1113.         @lv[i].update
  1114.       end
  1115.       # ゲーム画面を更新
  1116.       Graphics.update
  1117.     end
  1118.     # 入力情報を更新
  1119.     Input.update
  1120.   end
  1121.   #--------------------------------------------------------------------------
  1122.   # ● 解放
  1123.   #--------------------------------------------------------------------------
  1124.   def dispose
  1125.     # ループ処理
  1126.     for sprite in @text + @lv + @exp_gauge do
  1127.       # 特殊スプライトを解放
  1128.       sprite.dispose
  1129.     end
  1130.     # スプライトを解放
  1131.     @sprite.bitmap.dispose
  1132.     @sprite.dispose
  1133.     @sprite2.bitmap.dispose
  1134.     @sprite2.dispose
  1135.     @sprite3.bitmap.dispose
  1136.     @sprite3.dispose
  1137.     # スーパークラスを実行
  1138.     super
  1139.   end
  1140. end
  1141. #==============================================================================
  1142. # ■ Scene_Menu
  1143. #------------------------------------------------------------------------------
  1144. #  メニュー画面の処理を行うクラスです。
  1145. #==============================================================================

  1146. class Scene_Menu < Scene_MenuBase
  1147.   #--------------------------------------------------------------------------
  1148.   # ● 背景として使うためのスナップショット作成
  1149.   #--------------------------------------------------------------------------
  1150.   def snapshot_for_background
  1151.   end
  1152. end
  1153. #==============================================================================
  1154. # ■ Scene_Battle
  1155. #------------------------------------------------------------------------------
  1156. #  バトル画面の処理を行うクラスです。
  1157. #==============================================================================

  1158. class Scene_Battle < Scene_Base
  1159.   #--------------------------------------------------------------------------
  1160.   # ● 公開インスタンス変数
  1161.   #--------------------------------------------------------------------------
  1162.   attr_reader   :last_exp                 # 最終EXP
  1163.   attr_reader   :last_level               # 最終レベル
  1164.   attr_reader   :last_skills              # 最終スキルの配列
  1165.   attr_accessor :active_gauge_window      # ゲージウィンドウ
  1166.   #--------------------------------------------------------------------------
  1167.   # ● 終了処理
  1168.   #--------------------------------------------------------------------------
  1169.   alias :terminate_Active_Lv_UpVX :terminate
  1170.   def terminate
  1171.     # アクティブゲージウィンドウが有効な場合
  1172.     if @active_gauge_window != nil then
  1173.       # アクティブゲージウィンドウを解放
  1174.       @active_gauge_window.dispose
  1175.       # バトルリザルトウィンドウを解放
  1176.       @result_window.dispose
  1177.     end
  1178.     # アフターバトルフェーズをクリア
  1179.     $game_temp.after_battle_phase = false
  1180.     # 元の処理を実行
  1181.     terminate_Active_Lv_UpVX
  1182.   end
  1183.   #--------------------------------------------------------------------------
  1184.   # ● 終了前処理
  1185.   #--------------------------------------------------------------------------
  1186.   alias :minto_rgss3_3_pre_terminate :pre_terminate
  1187.   def pre_terminate
  1188.     # アフターバトルフェーズ中の場合
  1189.     if $game_temp.after_battle_phase == true then
  1190.       # アフターバトルフェーズの開始
  1191.       start_after_battle_phase
  1192.       # ループ処理
  1193.       loop do
  1194.         # ゲーム画面を更新
  1195.         Graphics.update
  1196.         # 入力情報を更新
  1197.         Input.update
  1198.         # C ボタンが押された場合
  1199.         if Input.trigger?(Input::C) == true then
  1200.           break
  1201.         end
  1202.       end
  1203.     end
  1204.     # 元の処理を実行
  1205.     minto_rgss3_3_pre_terminate
  1206.   end
  1207.   #--------------------------------------------------------------------------
  1208.   # ● アフターバトルフェーズの準備
  1209.   #--------------------------------------------------------------------------
  1210.   def reservation_after_battle_phase
  1211.     # 最終EXPとレベルを初期化
  1212.     @last_exp = []
  1213.     @last_level = []
  1214.     # 最終スキルの配列
  1215.     @last_skills = []
  1216.     # パーティー人数分だけ繰り返す
  1217.     for i in 0...$game_party.all_members.size.to_m(MINTO::Max_Size) do
  1218.       # アクターを取得
  1219.       actor = $game_party.all_members[i]
  1220.       # 最終EXPを保存
  1221.       @last_exp[i] = actor.exp.to_i
  1222.       # 最終レベルを保存
  1223.       @last_level[i] = actor.level.to_i
  1224.       # 最終スキルの取得
  1225.       @last_skills[i] = actor.skills.dec
  1226.     end
  1227.     # リザルトデータを記憶
  1228.     @exp = $game_troop.exp_total
  1229.     @gold = $game_troop.gold_total
  1230.     @drop_items = $game_troop.make_drop_items(true)
  1231.     @ap = 0
  1232.   end
  1233.   #--------------------------------------------------------------------------
  1234.   # ● アフターバトルフェーズの開始
  1235.   #--------------------------------------------------------------------------
  1236.   def start_after_battle_phase
  1237.     # アクティブゲージウィンドウを作成
  1238.     @active_gauge_window = Window_Active_Exp.new(@exp, @last_skills,
  1239.     @last_exp, @last_level)
  1240.     # バトルリザルトウィンドウを作成
  1241.     @result_window = Window_BattleResult.new(@exp, @gold, @drop_items, @ap,
  1242.     @active_gauge_window)
  1243.   end
  1244. end

  1245. end
复制代码
  1. #◆◇◆◇◆  レベルアップポップスクリプトVXA ver 1.01  ◇◆◇◆◇
  2. #  サポート掲示板 http://www2.ezbbs.net/21/minto-aaa/
  3. #   by みんと

  4. =begin

  5. ■ 更新履歴

  6. ○ ver 1.01(2012/01/21)
  7. 多人数PTに対応

  8. ○ ver 1.00(2012/01/21)
  9. 公開

  10. ■ 説明

  11. VX版とは違い、アクティブレベルアップVXAなしでも動作します。
  12. アクティブレベルアップVXAを導入している場合は、
  13. アクティブレベルアップVXAよりも下にセクションを作成し、導入してください。

  14. レベルアップした際の詳細な情報を1つずつ素早く表示します。
  15. スキルを習得した場合は習得したスキル名を表示します。

  16. 立ち絵の表示にも対応しています。

  17. =end

  18. #==============================================================================
  19. # ☆ MINTO
  20. #------------------------------------------------------------------------------
  21. #   様々なフラグを扱うメインモジュールです。
  22. #==============================================================================

  23. module MINTO
  24.   
  25.   # レベルアップポップスクリプトVXAを有効化 ( true で有効 / false で無効 )
  26.   RGSS["レベルアップポップスクリプトVXA"] = true
  27.   
  28. end

  29. # レベルアップポップスクリプトVXAが有効な場合に以降の処理を実行する
  30. if MINTO::RGSS["レベルアップポップスクリプトVXA"] == true then
  31.   
  32. #==============================================================================
  33. # ☆ カスタマイズ
  34. #------------------------------------------------------------------------------
  35. #   機能のカスタマイズをここで行います。
  36. #==============================================================================

  37. module MINTO
  38.   
  39.   # 使用する立ち絵グラグラフィックファイル名
  40.   # Face_Name_L[ID] = "ファイル末尾名"
  41.   # すべてピクチャーフォルダを参照します。
  42.   # ※ ファイル名は機械的に参照します。
  43.   # たとえば、Face_Name[1] = "L" と設定し、
  44.   # ファイル名がActor1でインデックスが0の場合、
  45.   # 実際のファイル名は Actor1-0L となります。
  46.   # 原則、全アクター分設定してください。
  47.   # nil の場合は「現在の設定グラフィック」を参照します。
  48.   Face_Name_L = [] # 変更しない
  49.   Face_Name_L[1] = nil
  50.   Face_Name_L[2] = nil
  51.   Face_Name_L[3] = nil
  52.   Face_Name_L[4] = nil
  53.   Face_Name_L[5] = nil
  54.   Face_Name_L[6] = "L"
  55.   Face_Name_L[7] = "L"
  56.   Face_Name_L[8] = "L"
  57.   Face_Name_L[9] = "L"
  58.   Face_Name_L[10] = "L"
  59.   Face_Name_L[11] = "L"
  60.   Face_Name_L[12] = "L"
  61.   Face_Name_L[13] = "L"
  62.   Face_Name_L[14] = "L"
  63.   Face_Name_L[15] = "L"
  64.   Face_Name_L[16] = "L"
  65.   Face_Name_L[17] = "L"
  66.   Face_Name_L[18] = "L"
  67.   Face_Name_L[19] = "L"
  68.   Face_Name_L[20] = "L"
  69.   Face_Name_L[21] = "L"
  70.   Face_Name_L[22] = "L"
  71.   Face_Name_L[23] = "L"
  72.   Face_Name_L[24] = "L"
  73.   Face_Name_L[25] = "L"
  74.   Face_Name_L[26] = "L"
  75.   Face_Name_L[27] = "L"
  76.   Face_Name_L[28] = "L"
  77.   Face_Name_L[29] = "L"
  78.   Face_Name_L[30] = "L"
  79.   Face_Name_L[31] = "L"
  80.   Face_Name_L[32] = "L"
  81.   Face_Name_L[33] = "L"
  82.   Face_Name_L[34] = "L"
  83.   Face_Name_L[35] = "L"
  84.   Face_Name_L[36] = "L"
  85.   Face_Name_L[37] = "L"
  86.   Face_Name_L[38] = "L"
  87.   Face_Name_L[39] = "L"
  88.   Face_Name_L[40] = "L"
  89.   Face_Name_L[41] = "L"
  90.   Face_Name_L[42] = "L"
  91.   Face_Name_L[43] = "L"
  92.   Face_Name_L[44] = "L"
  93.   Face_Name_L[45] = "L"
  94.   Face_Name_L[46] = "L"
  95.   Face_Name_L[47] = "L"
  96.   Face_Name_L[48] = "L"
  97.   Face_Name_L[49] = "L"
  98.   Face_Name_L[50] = "L"
  99.   Face_Name_L[51] = "L"
  100.   Face_Name_L[52] = "L"
  101.   Face_Name_L[53] = "L"
  102.   Face_Name_L[54] = "L"
  103.   Face_Name_L[55] = "L"
  104.   Face_Name_L[56] = "L"
  105.   Face_Name_L[57] = "L"
  106.   Face_Name_L[58] = "L"
  107.   Face_Name_L[59] = "L"
  108.   Face_Name_L[60] = "L"
  109.   Face_Name_L[61] = "L"
  110.   Face_Name_L[62] = "L"
  111.   Face_Name_L[63] = "L"
  112.   Face_Name_L[64] = "L"
  113.   Face_Name_L[65] = "L"
  114.   Face_Name_L[66] = "L"
  115.   Face_Name_L[67] = "L"
  116.   Face_Name_L[68] = "L"
  117.   Face_Name_L[69] = "L"
  118.   
  119.   # パラメータ上昇時のSE(名前、音量、ピッチ)
  120.   SE_Data = ["Audio/SE/Heal7", 100, 150]
  121.   
  122.   # スキル習得時のSE(名前、音量、ピッチ)
  123.   Skill_SE_Data = ["Audio/SE/Up4", 100, 150]
  124.   
  125. end
  126. #==============================================================================
  127. # ■ Bitmap
  128. #------------------------------------------------------------------------------
  129. #  画像そのものを扱う組み込みクラスです。
  130. #==============================================================================

  131. class Bitmap
  132.   #--------------------------------------------------------------------------
  133.   # ● 指定範囲のクリア
  134.   #--------------------------------------------------------------------------
  135.   def rect_clear(x, y, width, height)
  136.     # 対象の範囲を消す
  137.     rect = Rect.new(x, y, width, height)
  138.     self.fill_rect(rect, Color.new(0, 0, 0, 0))
  139.   end
  140. end
  141. #==============================================================================
  142. # ■ Window
  143. #------------------------------------------------------------------------------
  144. #  ゲーム内の全てのウィンドウのスーパークラスです。
  145. #   内部的には複数のスプライトで構成されています。
  146. #==============================================================================

  147. class Window
  148.   #--------------------------------------------------------------------------
  149.   # ● ウィンドウのセンタリング
  150.   #--------------------------------------------------------------------------
  151.   def centering
  152.     # ウィンドウを画面の中央に配置する
  153.     self.x = (Graphics.width - self.width)  / 2
  154.     self.y = (Graphics.height - self.height) / 2
  155.   end
  156. end
  157. #==============================================================================
  158. # ■ Game_Temp
  159. #------------------------------------------------------------------------------
  160. #  セーブデータに含まれない、一時的なデータを扱うクラスです。このクラスのイン
  161. # スタンスは $game_temp で参照されます。
  162. #==============================================================================

  163. class Game_Temp
  164.   #--------------------------------------------------------------------------
  165.   # ● 公開インスタンス変数
  166.   #--------------------------------------------------------------------------
  167.   attr_accessor :after_battle_phase       # アフターバトルフェーズ中フラグ
  168. end
  169. #==============================================================================
  170. # ■ Game_Actor
  171. #------------------------------------------------------------------------------
  172. #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
  173. # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
  174. #==============================================================================

  175. class Game_Actor < Game_Battler
  176.   #--------------------------------------------------------------------------
  177.   # ● 基本通常能力値の取得
  178.   #--------------------------------------------------------------------------
  179.   def base_param(param_id)
  180.     return param_base(param_id)
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # ● レベルアップメッセージの表示
  184.   #     new_skills : 新しく習得したスキルの配列
  185.   #--------------------------------------------------------------------------
  186.   def display_level_up(new_skills)
  187.     # 何もなかった事にする
  188.   end
  189. end
  190. #==============================================================================
  191. # ■ Game_Troop
  192. #------------------------------------------------------------------------------
  193. #  敵グループおよび戦闘に関するデータを扱うクラスです。バトルイベントの処理も
  194. # 行います。このクラスのインスタンスは $game_troop で参照されます。
  195. #==============================================================================

  196. class Game_Troop < Game_Unit
  197.   #--------------------------------------------------------------------------
  198.   # ● 全滅判定の取得
  199.   #--------------------------------------------------------------------------
  200.   def all_dead?
  201.     # スーパークラスの処理に以降
  202.     bool = super
  203.     # 勝利確定の場合
  204.     if bool then
  205.       # アフターバトルフェーズ中でない場合
  206.       unless $game_temp.after_battle_phase then
  207.         # アフターバトルフェーズを予約する
  208.         $game_temp.after_battle_phase = true
  209.         # アクティブレベルアップVXAが有効な場合
  210.         if MINTO::RGSS["Active_Lv_UpVX"]
  211.           # アフターバトルフェーズ準備
  212.           SceneManager.scene.reservation_after_battle_phase
  213.         end
  214.         # 第二アフターバトルフェーズ準備
  215.         SceneManager.scene.reservation_second_after_battle_phase
  216.       end
  217.     end
  218.     # メソッドを返す
  219.     return bool
  220.   end
  221. end
  222. #==============================================================================
  223. # ■ Window_Lvup_Data
  224. #------------------------------------------------------------------------------
  225. #   Lvup時のデータを表示するウィンドウです。
  226. #==============================================================================

  227. class Window_Lvup_Data < Window_Base
  228.   #--------------------------------------------------------------------------
  229.   # ● 公開インスタンス変数
  230.   #--------------------------------------------------------------------------
  231.   attr_accessor :data                     # データ
  232.   #--------------------------------------------------------------------------
  233.   # ● オブジェクト初期化
  234.   #--------------------------------------------------------------------------
  235.   def initialize
  236.     super(0, 0, 512, 320)
  237.     self.contents = Bitmap.new(width - 32, height - 32)
  238.     self.z = 10016
  239.     self.visible = false
  240.     @data = {}
  241.     centering
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ● グラフィックの作成
  245.   #    actor : アクター
  246.   #    x     : 描写先のX座標
  247.   #    y     : 描写先のY座標
  248.   #--------------------------------------------------------------------------
  249.   def graphic_set(actor, x, y)
  250.     # 顔グラフィック末尾名が有効な場合
  251.     unless MINTO::Face_Name_L[actor.id].nil? then
  252.       # ファイル名を作成
  253.       file_name = "#{actor.face_name}-#{actor.face_index}"
  254.       # ファイル末尾名を取得
  255.       file_name += MINTO::Face_Name_L[actor.id]
  256.       # 顔グラフィックを読み込む
  257.       face = Cache.picture(file_name)
  258.       # 顔グラフィックを描写
  259.       self.contents.blt(x, y, face, face.rect)
  260.     # 顔グラフィック末尾名が無効な場合
  261.     else
  262.       # 現在の設定グラフィックを描写
  263.       draw_face(actor.face_name, actor.face_index, x, y)
  264.     end
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ● リフレッシュ
  268.   #    actor : アクター
  269.   #--------------------------------------------------------------------------
  270.   def refresh(actor)
  271.     x = 160
  272.     self.contents.clear
  273.     # アクター名を描写
  274.     self.contents.font.color = normal_color
  275.     self.contents.draw_text(x * 0, 24 * 0, 224, 24, actor.name)
  276.     # アクターグラフィックを描写
  277.     graphic_set(actor, 240, 0)
  278.     # 用語を描写
  279.     self.contents.font.color = system_color
  280.     self.contents.draw_text(x * 0, 24 * 1, 96, 24, "Level")
  281.     for i in 0...8 do
  282.       self.contents.draw_text(x * 0, 24 * (i + 2), 96, 24, Vocab::param(i))
  283.     end
  284.     self.contents.font.color = normal_color
  285.     # パラメータを描写
  286.     for i in 0...@data[actor].size do
  287.       draw_status(actor, i)
  288.     end
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ● 能力の描写
  292.   #    actor : アクター
  293.   #    index : 項目
  294.   #--------------------------------------------------------------------------
  295.   def draw_status(actor, index)
  296.     # 描写座標を設定
  297.     x = 96
  298.     y = 24 + (index * 24)
  299.     # 描写範囲をクリア
  300.     self.contents.rect_clear(x, y, 48, 24)
  301.     # 能力値を描写
  302.     self.contents.draw_text(x, y, 96, 24, @data[actor][index].to_s)
  303.   end
  304. end
  305. #==============================================================================
  306. # ■ Window_BattleCenter_Help
  307. #------------------------------------------------------------------------------
  308. #  戦闘画面で任意の文章を表示するウィンドウです。
  309. #==============================================================================

  310. class Window_BattleCenter_Help < Window_Base
  311.   #--------------------------------------------------------------------------
  312.   # ● オブジェクト初期化
  313.   #--------------------------------------------------------------------------
  314.   def initialize
  315.     super(0, 0, 64, 56)
  316.     self.z = 20000
  317.     self.visible = false
  318.     create_contents
  319.     @message_duration = 0
  320.     @save_text = ""
  321.     @text = []
  322.     @text_y = 0
  323.     @text_x = 0
  324.     @text_type = 0
  325.     @text_index = 0
  326.     @text_width = []
  327.     @speed = 1
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● テキスト設定
  331.   #    text : スプライトに表示する文字列
  332.   #--------------------------------------------------------------------------
  333.   def set_text(text)
  334.     # 求められたテキストが無効な場合
  335.     if text.to_s == "" then
  336.       # 表示カウントを設定
  337.       @message_duration = 8
  338.       # メソッドを終了
  339.       return
  340.     end
  341.     self.active = true
  342.     # 終了記号を追加
  343.     text += "\\bw"
  344.     # スプライトを可視状態にする
  345.     self.visible = true
  346.     # 各データを初期化
  347.     @save_text = ""
  348.     @text = []
  349.     @text_width = []
  350.     @text_index = 0
  351.     @text_type = 0
  352.     @speed = 1
  353.     self.pause = false
  354.     self.opacity = 192
  355.     self.contents_opacity = 255
  356.     # 表示カウントを設定
  357.     @message_duration = 16
  358.     # 文字を複製
  359.     data = text.dup
  360.     # 各制御文字を仮変換
  361.     data.gsub!(/\\\\/) { "\000" }
  362.     data.gsub!(/\\[Cc]\[([0-9]+)\]/) { "" }
  363.     data.gsub!(/\\[Bb][Ww]/) { "" }
  364.     # ウィンドウのサイズを調節
  365.     self.width = 32 + (self.contents.text_size(data).width)
  366.     self.height = 56
  367.     # センター表示
  368.     centering
  369.     # ビットマップを再作成
  370.     create_contents
  371.     refresh(text.dup)
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # ● リフレッシュ
  375.   #    text : スプライトに表示する文字列
  376.   #--------------------------------------------------------------------------
  377.   def refresh(text)
  378.     # 基本情報を初期化
  379.     self.contents.clear
  380.     self.contents.font.color = normal_color
  381.     self.contents.font.bold = false
  382.     self.contents.font.italic = false
  383.     @text_x = 0
  384.     @text_y = 0
  385.     # 文章のインデックスを初期化
  386.     @text_index = 0
  387.     # 便宜上、"\\\\" を "\000" に変換
  388.     text.gsub!(/\\\\/) { "\000" }
  389.     # 各制御文字を実際のものに変換
  390.     text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  391.     text.gsub!(/\\[Bb][Ww]/) { "\017" }
  392.     @save_text = text.dup
  393.   end
  394.   #--------------------------------------------------------------------------
  395.   # ● テキストの更新
  396.   #--------------------------------------------------------------------------
  397.   def text_update
  398.     @text = @save_text.split(//)
  399.     # 無効な文字列の場合
  400.     if @text[@text_index] == nil then
  401.       # メソッドを返す
  402.       return false
  403.     end
  404.     # スプライトを可視状態にする
  405.     self.visible = true
  406.     # テキストを取得
  407.     c = @text[@text_index]
  408.     # \\ の場合
  409.     if c == "\000" then
  410.       # 本来の文字に戻す
  411.       c = "\\"
  412.     # \C[n] の場合
  413.     elsif c == "\001" then
  414.       # 制御文字を処理
  415.       @save_text.sub!(/\[([0-9]+)\]/, "")
  416.       # 文字色のIDを取得
  417.       color = $1.to_i
  418.       # 文字色のIDが有効な場合
  419.       if color >= 0 then
  420.         # 文字色を変更
  421.         self.contents.font.color = text_color(color)
  422.       end
  423.       # インデックスを進める
  424.       @text_index += 1
  425.       # メソッドを返す
  426.       return true
  427.     # \BW の場合
  428.     elsif c == "\017" then
  429.       # 文章の表示速度を初期化
  430.       @speed = 0
  431.       # ポーズサインを表示する
  432.       self.pause = true
  433.       # ボタン待ちフラグをオン
  434.       @press = true
  435.       # インデックスを進める
  436.       @text_index += 1
  437.       # メソッドを返す
  438.       return true
  439.     end
  440.     # 文字を描画
  441.     self.contents.draw_text(@text_x, 0, 40, 24, c)
  442.     # @text_x に描画した文字の幅を加算
  443.     @text_x += self.contents.text_size(c).width
  444.     # インデックスを進める
  445.     @text_index += 1
  446.     return true
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # ● ウェイトの終了
  450.   #--------------------------------------------------------------------------
  451.   def wait_end
  452.     # ボタン入力待ちフラグをオフ
  453.     @press = false
  454.     # ポーズサインを非表示にする
  455.     self.pause = false
  456.     # ウィンドウを不可視にする
  457.     self.visible = false
  458.     # ボタン入力待ちフラグをオフ
  459.     @press = false
  460.   end
  461.   #--------------------------------------------------------------------------
  462.   # ● フレーム更新
  463.   #--------------------------------------------------------------------------
  464.   def update
  465.     # ボタン入力待ちフラグがオンの場合
  466.     if @press == true then
  467.       super
  468.       # C ボタンが押された場合
  469.       if Input.trigger?(Input::C) == true then
  470.         # ウェイトの終了
  471.         wait_end
  472.       end
  473.       # メソッドを返す
  474.       return
  475.     end
  476.     # 更新が可能なフレームでない場合
  477.     if @speed != 0 and (Graphics.frame_count % @speed != 0) then
  478.       # メソッドを返す
  479.       return
  480.     end
  481.     # テロップを更新中の場合
  482.     if text_update == true then
  483.       # スピードが 0 の場合
  484.       if @speed == 0 then
  485.         update
  486.       end
  487.       # メソッドを返す
  488.       return
  489.     else
  490.       # 文章の表示速度を最速化
  491.       @speed = 1
  492.     end
  493.   end
  494. end
  495. #==============================================================================
  496. # ■ Scene_Battle
  497. #------------------------------------------------------------------------------
  498. #  バトル画面の処理を行うクラスです。
  499. #==============================================================================

  500. class Scene_Battle < Scene_Base
  501.   #--------------------------------------------------------------------------
  502.   # ● 終了処理
  503.   #--------------------------------------------------------------------------
  504.   alias :terminate_MITO_RGSS3_04 :terminate
  505.   def terminate
  506.     # 元の処理を実行
  507.     terminate_MITO_RGSS3_04
  508.     # レベルアップウィンドウが有効な場合
  509.     unless @lvup_window.nil?
  510.       # レベルアップウィンドウを解放
  511.       @lvup_window.dispose
  512.       # センターヘルプウィンドウを解放
  513.       @center_help_window.dispose
  514.     end
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ● 終了前処理
  518.   #--------------------------------------------------------------------------
  519.   alias :pre_terminate_MITO_RGSS3_04 :pre_terminate
  520.   def pre_terminate
  521.     # アフターバトルフェーズ中の場合
  522.     if $game_temp.after_battle_phase == true then
  523.       # アクティブレベルアップVXAが有効な場合
  524.       if MINTO::RGSS["Active_Lv_UpVX"]
  525.         # アフターバトルフェーズの開始
  526.         start_after_battle_phase
  527.         # ポーズサインを表示する
  528.         @active_gauge_window.pause = true
  529.         # ループ処理
  530.         loop do
  531.           # ゲーム画面を更新
  532.           Graphics.update
  533.           # 入力情報を更新
  534.           Input.update
  535.           # ウィンドウを更新
  536.           @active_gauge_window.update
  537.           # C ボタンが押された場合
  538.           if Input.trigger?(Input::C) == true then
  539.             break
  540.           end
  541.         end
  542.       end
  543.       # 第二アフターバトルフェーズの開始
  544.       start_second_after_battle_phase
  545.     end
  546.     # アフターバトルフェーズをクリア
  547.     $game_temp.after_battle_phase = false
  548.     # 元の処理を実行
  549.     pre_terminate_MITO_RGSS3_04
  550.   end
  551.   #--------------------------------------------------------------------------
  552.   # ● 第二アフターバトルフェーズの準備
  553.   #--------------------------------------------------------------------------
  554.   def reservation_second_after_battle_phase
  555.     # レベルアップウィンドウを作成
  556.     @lvup_window = Window_Lvup_Data.new
  557.     # センターヘルプウィンドウを作成
  558.     @center_help_window = Window_BattleCenter_Help.new
  559.     @last_skills_array = []
  560.     # ループ処理(パーティー)
  561.     for i in 0...$game_party.all_members.size do
  562.       # アクターを取得
  563.       actor = $game_party.all_members[i]
  564.       # 最終能力値を保存
  565.       save_last_parameter(actor)
  566.       # スキルを保存
  567.       @last_skills_array[i] = actor.skills.dup
  568.     end
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● 第二アフターバトルフェーズの開始
  572.   #--------------------------------------------------------------------------
  573.   def start_second_after_battle_phase
  574.     # レベルアップモーション
  575.     level_up_motion
  576.   end
  577.   #--------------------------------------------------------------------------
  578.   # ● 最終能力値の記憶
  579.   #    actor : アクター
  580.   #--------------------------------------------------------------------------
  581.   def save_last_parameter(actor)
  582.     @lvup_window.data[actor] = []
  583.     @lvup_window.data[actor][0] = actor.level
  584.     @lvup_window.data[actor][1] = actor.base_param(0)
  585.     @lvup_window.data[actor][2] = actor.base_param(1)
  586.     @lvup_window.data[actor][3] = actor.base_param(2)
  587.     @lvup_window.data[actor][4] = actor.base_param(3)
  588.     @lvup_window.data[actor][5] = actor.base_param(4)
  589.     @lvup_window.data[actor][6] = actor.base_param(5)
  590.     @lvup_window.data[actor][7] = actor.base_param(6)
  591.     @lvup_window.data[actor][8] = actor.base_param(7)
  592.     @lvup_window.data[actor][9] = actor.base_param(8)
  593.     @lvup_window.data[actor][10] = actor.base_param(9)
  594.     @lvup_window.data[actor][11] = actor.base_param(10)
  595.     @lvup_window.data[actor][12] = actor.base_param(11)
  596.     @lvup_window.data[actor][13] = actor.base_param(12)
  597.     @lvup_window.data[actor][14] = actor.base_param(13)
  598.     @lvup_window.data[actor][15] = actor.base_param(14)
  599.     @lvup_window.data[actor][16] = actor.base_param(15)
  600.     @lvup_window.data[actor][17] = actor.base_param(16)
  601.     @lvup_window.data[actor][18] = actor.base_param(17)
  602.     @lvup_window.data[actor][19] = actor.base_param(18)
  603.     @lvup_window.data[actor][20] = actor.base_param(19)
  604.     @lvup_window.data[actor][21] = actor.base_param(20)
  605.     @lvup_window.data[actor][22] = actor.base_param(21)
  606.     @lvup_window.data[actor][23] = actor.base_param(22)
  607.     @lvup_window.data[actor][24] = actor.base_param(23)
  608.     @lvup_window.data[actor][25] = actor.base_param(24)
  609.     @lvup_window.data[actor][26] = actor.base_param(25)
  610.     @lvup_window.data[actor][27] = actor.base_param(26)
  611.     @lvup_window.data[actor][28] = actor.base_param(27)
  612.     @lvup_window.data[actor][29] = actor.base_param(28)
  613.     @lvup_window.data[actor][30] = actor.base_param(29)
  614.     @lvup_window.data[actor][31] = actor.base_param(30)
  615.     @lvup_window.data[actor][32] = actor.base_param(31)
  616.     @lvup_window.data[actor][33] = actor.base_param(32)
  617.     @lvup_window.data[actor][34] = actor.base_param(33)
  618.     @lvup_window.data[actor][35] = actor.base_param(34)
  619.     @lvup_window.data[actor][36] = actor.base_param(35)
  620.     @lvup_window.data[actor][37] = actor.base_param(36)
  621.     @lvup_window.data[actor][38] = actor.base_param(37)
  622.     @lvup_window.data[actor][39] = actor.base_param(38)
  623.     @lvup_window.data[actor][40] = actor.base_param(39)
  624.     @lvup_window.data[actor][41] = actor.base_param(40)
  625.     @lvup_window.data[actor][42] = actor.base_param(41)
  626.     @lvup_window.data[actor][43] = actor.base_param(42)
  627.     @lvup_window.data[actor][44] = actor.base_param(43)
  628.     @lvup_window.data[actor][45] = actor.base_param(44)
  629.     @lvup_window.data[actor][46] = actor.base_param(45)
  630.     @lvup_window.data[actor][47] = actor.base_param(46)
  631.     @lvup_window.data[actor][48] = actor.base_param(47)
  632.     @lvup_window.data[actor][49] = actor.base_param(48)
  633.     @lvup_window.data[actor][50] = actor.base_param(49)
  634.     @lvup_window.data[actor][51] = actor.base_param(50)
  635.     @lvup_window.data[actor][52] = actor.base_param(51)
  636.     @lvup_window.data[actor][53] = actor.base_param(52)
  637.     @lvup_window.data[actor][54] = actor.base_param(53)
  638.     @lvup_window.data[actor][55] = actor.base_param(54)
  639.     @lvup_window.data[actor][56] = actor.base_param(55)
  640.     @lvup_window.data[actor][57] = actor.base_param(56)
  641.     @lvup_window.data[actor][58] = actor.base_param(57)
  642.     @lvup_window.data[actor][59] = actor.base_param(58)
  643.     @lvup_window.data[actor][60] = actor.base_param(59)
  644.     @lvup_window.data[actor][61] = actor.base_param(60)
  645.     @lvup_window.data[actor][62] = actor.base_param(61)
  646.     @lvup_window.data[actor][63] = actor.base_param(62)
  647.     @lvup_window.data[actor][64] = actor.base_param(63)
  648.     @lvup_window.data[actor][65] = actor.base_param(64)
  649.     @lvup_window.data[actor][66] = actor.base_param(65)
  650.     @lvup_window.data[actor][67] = actor.base_param(66)
  651.     @lvup_window.data[actor][68] = actor.base_param(67)
  652.     @lvup_window.data[actor][69] = actor.base_param(68)
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # ● 現在のパラメータの取得
  656.   #    actor : アクター
  657.   #    index : 項目
  658.   #--------------------------------------------------------------------------
  659.   def look_parameter(actor, index)
  660.     # 項目に応じて分岐
  661.     case index
  662.     when 0 then
  663.       return actor.level
  664.     else
  665.       return actor.base_param(index - 1)
  666.     end
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # ● 習得したスキルの表示
  670.   #    actor : アクター
  671.   #--------------------------------------------------------------------------
  672.   def learning_skills_pop(actor)
  673.     learning_skills = []
  674.     # ループ処理
  675.     for skill in actor.skills do
  676.       # 未収得のスキルの場合
  677.       unless @last_skills_array[actor.index].include?(skill) then
  678.         # 習得したスキルを取得
  679.         learning_skills.push(skill)
  680.       end
  681.     end
  682.     # スキルを習得していない場合
  683.     if learning_skills.empty? then
  684.       # メソッドを返す
  685.       return
  686.     end
  687.     # ループ処理
  688.     for skill in learning_skills do
  689.       wait_count = 128
  690.       # 習得MEを演奏
  691.       data = MINTO::Skill_SE_Data
  692.       Audio.se_play(data[0], data[1], data[2])
  693.       # スキル名を表示
  694.       @center_help_window.set_text("\\c[1]#{skill.name}\\c[0]技能習得!")
  695.       # 表示が終わるまでループ
  696.       while @center_help_window.visible == true do
  697.         # ゲーム画面を更新
  698.         Graphics.update
  699.         # 入力情報を更新
  700.         Input.update
  701.         # センターヘルプウィンドウを更新
  702.         @center_help_window.update
  703.         wait_count -= 1
  704.         if wait_count.zero? then
  705.           @center_help_window.wait_end
  706.         end
  707.       end
  708.     end
  709.   end
  710.   #--------------------------------------------------------------------------
  711.   # ● レベルアップモーション
  712.   #--------------------------------------------------------------------------
  713.   def level_up_motion
  714.     # ポップ作成
  715.     @pop = Mint_Pop.new
  716.     # ループ処理(パーティー)
  717.     for id in 0...$game_party.all_members.size do
  718.       # アクターを取得
  719.       actor = $game_party.all_members[id]
  720.       # レベルが上がっていない場合
  721.       if @lvup_window.data[actor][0] == actor.level then
  722.         # 次のアクターへ
  723.         next
  724.       end
  725.       # パラメータウィンドウをリフレッシュ
  726.       @lvup_window.refresh(actor)
  727.       # レベルが上がっている場合
  728.       if @lvup_window.data[actor][0] < actor.level then
  729.         # パラメータウィンドウを表示
  730.         @lvup_window.visible = true
  731.         # ループ処理
  732.         for i in (0..8) do
  733.           # 描写座標を設定
  734.           x = 144
  735.           y = 66 + (i * 24)
  736.           # 上昇したパラメータを読み込む
  737.           parameter = look_parameter(actor, i)
  738.           # 結果を収納する
  739.           string = "+#{parameter - @lvup_window.data[actor][i]}"
  740.           # 上昇後のパラメータを設定
  741.           @lvup_window.data[actor][i] = parameter
  742.           # パラメータウィンドウをリフレッシュ
  743.           @lvup_window.draw_status(actor, i)
  744.           # ポップ描写
  745.           @pop.string_pop(string, x, y)
  746.           # ウェイトカウントを設定
  747.           wait = i == 8 ? 160 : 6
  748.           # ポップSEを演奏
  749.           data = MINTO::SE_Data
  750.           Audio.se_play(data[0], data[1], data[2])
  751.           # フレーム更新
  752.           wait.times do
  753.             # ゲーム画面を更新
  754.             Graphics.update
  755.             # 入力情報を更新
  756.             Input.update
  757.             # スプライトセットを更新
  758.             @spriteset.update
  759.             # ポップを更新
  760.             @pop.update
  761.             # パラメータウィンドウを更新
  762.             @lvup_window.update
  763.             # 最終インデックスの場合
  764.             if i == 8 then
  765.               # ポーズサインを表示する
  766.               @lvup_window.pause = true
  767.               # C ボタンが押された場合
  768.               if Input.trigger?(Input::C) == true then
  769.                 # ポーズサインを非表示にする
  770.                 @lvup_window.pause = false
  771.                 # 更新を中断
  772.                 break
  773.               end
  774.             end
  775.           end
  776.         end
  777.       end
  778.       # 習得したスキルを表示
  779.       learning_skills_pop(actor)
  780.       # ポップを解放
  781.       @pop.dispose
  782.     end
  783.     # ポーズサインを表示する
  784.     @lvup_window.pause = true
  785.     # ループ処理
  786.     loop do
  787.       # ゲーム画面を更新
  788.       Graphics.update
  789.       # 入力情報を更新
  790.       Input.update
  791.       # ウィンドウを更新
  792.       @lvup_window.update
  793.       # C ボタンが押された場合
  794.       if Input.trigger?(Input::C) == true then
  795.         break
  796.       end
  797.     end
  798.     # パラメータウィンドウを閉じる
  799.     @lvup_window.visible = false
  800.   end
  801. end
  802. #==============================================================================
  803. # ■ Mint_Pop
  804. #------------------------------------------------------------------------------
  805. #  数字のスプライト表示を扱うクラスです。
  806. #==============================================================================

  807. class Mint_Pop
  808.   #--------------------------------------------------------------------------
  809.   # ● オブジェクト初期化
  810.   #--------------------------------------------------------------------------
  811.   def initialize
  812.     @string_pop_sprite = []
  813.     @string_pop_duration = []
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # ● ストリングポップ
  817.   #    string : 求められた文字列
  818.   #    x      : X座標
  819.   #    y      : Y座標
  820.   #--------------------------------------------------------------------------
  821.   def string_pop(string = "", x = 0, y = 0)
  822.     # string が無効なら処理を終了
  823.     return if string == ""
  824.     wlh = 24
  825.     # スプライトを生成
  826.     string_pop_sprite = Sprite.new
  827.     # 文字を描写
  828.     string_pop_sprite.bitmap = Bitmap.new(96, 40)
  829.     string_pop_sprite.bitmap.font.size = 17
  830.     string_pop_sprite.bitmap.font.shadow = false
  831.     string_pop_sprite.bitmap.font.color.set(0, 0, 0)
  832.     string_pop_sprite.bitmap.draw_text(-1, 12-1, 96, wlh, string, 1)
  833.     string_pop_sprite.bitmap.draw_text(+1, 12-1, 96, wlh, string, 1)
  834.     string_pop_sprite.bitmap.draw_text(-1, 12+1, 96, wlh, string, 1)
  835.     string_pop_sprite.bitmap.draw_text(+1, 12+1, 96, wlh, string, 1)
  836.     string_pop_sprite.bitmap.font.color.set(128, 255, 224)
  837.     string_pop_sprite.bitmap.draw_text(0, 12, 96, wlh, string, 1)
  838.     # 座標データを代入
  839.     string_pop_sprite.x = x
  840.     string_pop_sprite.y = y
  841.     string_pop_sprite.z = 10032
  842.     # 配列の先頭にシフト
  843.     @string_pop_sprite.unshift(string_pop_sprite)
  844.     @string_pop_duration.unshift(40)      
  845.   end
  846.   #--------------------------------------------------------------------------
  847.   # ● 解放
  848.   #--------------------------------------------------------------------------
  849.   def dispose
  850.     # ループ処理
  851.     for i in 0...@string_pop_sprite.size do
  852.       # 有効なスプライトの場合
  853.       unless @string_pop_sprite[i].nil? then
  854.         # スプライトを解放
  855.         @string_pop_sprite[i].bitmap.dispose
  856.         @string_pop_sprite[i].dispose
  857.         @string_pop_sprite[i] = nil
  858.         @string_pop_duration[i] = nil
  859.       end
  860.     end
  861.     # 配列内容をクリア
  862.     @string_pop_sprite.clear
  863.     @string_pop_duration.clear
  864.   end
  865.   #--------------------------------------------------------------------------
  866.   # ● フレーム更新
  867.   #--------------------------------------------------------------------------
  868.   def update
  869.     # 1つでもストリングポップが表示中の場合
  870.     if @string_pop_sprite.size > 0
  871.       # 表示中のストリングポップを1つずつ処理する
  872.       for i in 0...@string_pop_sprite.size
  873.         # ストリングポップを代入
  874.         string = @string_pop_sprite[i]
  875.         # カウントが0の場合
  876.         if @string_pop_duration[i] == 0
  877.           # 次の処理へ
  878.           next
  879.         end
  880.         # カウントを減らす
  881.         @string_pop_duration[i] -= 1
  882.         # 残りカウントに応じて分岐
  883.         case @string_pop_duration[i]
  884.         when 36..39
  885.           string.y -= 4
  886.           string.blend_type = 1
  887.         when 33..37
  888.           string.y -= 2
  889.           string.blend_type = 1
  890.         when 32..34
  891.           string.y += 2
  892.           string.blend_type = 0
  893.         when 25..32
  894.           string.y += 4
  895.           string.blend_type = 0
  896.         end
  897.       end
  898.     end
  899.   end
  900. end

  901. end
复制代码
这是jp管理器…………
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - JP Manager v1.00
  4. # -- Last Updated: 2012.01.07
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-JPManager"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.07 - Started Script and Finished.
  15. #
  16. #==============================================================================
  17. # ▼ Introduction
  18. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  19. # This script provides a base for JP implementation. JP is a currency similar
  20. # to EXP that's gained through performing actions and leveling up in addition
  21. # to killing enemies. This script provides modifiers that adjust the gains for
  22. # JP through rates, individual gains per skill or item, and per enemy. Though
  23. # this script provides no usage of JP by itself, future Yanfly Engine Ace
  24. # scripts may make use of it.
  25. #
  26. #==============================================================================
  27. # ▼ Instructions
  28. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. # To install this script, open up your script editor and copy/paste this script
  30. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  31. #
  32. # -----------------------------------------------------------------------------
  33. # Actor Notetags - These notetags go in the actors notebox in the database.
  34. # -----------------------------------------------------------------------------
  35. # <jp rate: x%>
  36. # Changes the JP earned rate to x%. This affects JP earned and not JP directly
  37. # gained. If this notetag isn't used, the object will default to 100%.
  38. #
  39. # -----------------------------------------------------------------------------
  40. # Class Notetags - These notetags go in the class notebox in the database.
  41. # -----------------------------------------------------------------------------
  42. # <jp rate: x%>
  43. # Changes the JP earned rate to x%. This affects JP earned and not JP directly
  44. # gained. If this notetag isn't used, the object will default to 100%.
  45. #
  46. # -----------------------------------------------------------------------------
  47. # Skill Notetags - These notetags go in the skills notebox in the database.
  48. # -----------------------------------------------------------------------------
  49. # <jp gain: x>
  50. # When the actor successfully hits an target with this action, the actor will
  51. # earn x JP. If this notetag isn't used, the amount of JP earned will equal to
  52. # the ACTION_JP constant in the module.
  53. #
  54. # -----------------------------------------------------------------------------
  55. # Item Notetags - These notetags go in the items notebox in the database.
  56. # -----------------------------------------------------------------------------
  57. # <jp gain: x>
  58. # When the actor successfully hits an target with this action, the actor will
  59. # earn x JP. If this notetag isn't used, the amount of JP earned will equal to
  60. # the ACTION_JP constant in the module.
  61. #
  62. # -----------------------------------------------------------------------------
  63. # Weapon Notetags - These notetags go in the weapon notebox in the database.
  64. # -----------------------------------------------------------------------------
  65. # <jp rate: x%>
  66. # Changes the JP earned rate to x%. This affects JP earned and not JP directly
  67. # gained. If this notetag isn't used, the object will default to 100%.
  68. #
  69. # -----------------------------------------------------------------------------
  70. # Armour Notetags - These notetags go in the armour notebox in the database.
  71. # -----------------------------------------------------------------------------
  72. # <jp rate: x%>
  73. # Changes the JP earned rate to x%. This affects JP earned and not JP directly
  74. # gained. If this notetag isn't used, the object will default to 100%.
  75. #
  76. # -----------------------------------------------------------------------------
  77. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  78. # -----------------------------------------------------------------------------
  79. # <jp gain: x>
  80. # Changes the amount of JP gained for killing the enemy to x. If this notetag
  81. # isn't used, then the default JP gain will be equal to the amount set in the
  82. # module through the constant ENEMY_KILL.
  83. #
  84. # -----------------------------------------------------------------------------
  85. # State Notetags - These notetags go in the states notebox in the database.
  86. # -----------------------------------------------------------------------------
  87. # <jp rate: x%>
  88. # Changes the JP earned rate to x%. This affects JP earned and not JP directly
  89. # gained. If this notetag isn't used, the object will default to 100%.
  90. #
  91. # -----------------------------------------------------------------------------
  92. # Script Calls - These commands are used with script calls.
  93. # -----------------------------------------------------------------------------
  94. # $game_actors[x].earn_jp(y)
  95. # $game_actors[x].earn_jp(y, z)
  96. # This will cause actor x to earn y amount of JP. JP earned will be modified by
  97. # any JP Rate traits provided through notetags. If z is used, z will be the
  98. # class the JP is earned for.
  99. #
  100. # $game_actors[x].gain_jp(y)
  101. # $game_actors[x].gain_jp(y, z)
  102. # This will cause actor x to gain y amount of JP. JP gained this way will not
  103. # be modified by any JP Rate traits provided through notetags. If z is used,
  104. # z will be the class the JP is gained for.
  105. #
  106. # $game_actors[x].lose_jp(y)
  107. # $game_actors[x].lose_jp(y, z)
  108. # This will cause actor x to lose y amount of JP. JP lost this way will not be
  109. # modified by any JP Rate traits provided through notetags. If z is used, z
  110. # will be the class the JP is lost from.
  111. #
  112. #==============================================================================
  113. # ▼ Compatibility
  114. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  115. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  116. # it will run with RPG Maker VX without adjusting.
  117. #
  118. # This script is compatible with Yanfly Engine Ace - Victory Aftermath v1.03+.
  119. # If you wish to have Victory Aftermath display JP gains, make sure the version
  120. # is 1.03+. Script placement of these two scripts don't matter.
  121. #
  122. #==============================================================================

  123. module YEA
  124.   module JP
  125.    
  126.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  127.     # - General JP Settings -
  128.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  129.     # This adjusts the way JP appears visually in your game. Change the icon
  130.     # used and the vocabulary used here. Furthermore, adjust the maximum amount
  131.     # of JP that an actor can have at a time.
  132.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  133.     ICON   = 0           # Icon index used to represent JP.
  134.     VOCAB  = "JP"        # What JP will be called in your game.
  135.     MAX_JP = 99999999    # Maximum JP an actor can have.
  136.    
  137.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  138.     # - Default JP Gain Settings -
  139.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  140.     # The following constants adjust how much JP is earned by default through
  141.     # enemy kills, leveling up, and performing actions.
  142.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  143.     ENEMY_KILL = 10     # JP earned for the whole party.
  144.     LEVEL_UP   = 50    # JP earned when leveling up!
  145.     ACTION_JP  = 1      # JP earned per successful hit.
  146.    
  147.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  148.     # - Victory Message -
  149.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  150.     # This adjusts the victory message shown for the default battle system and
  151.     # the Yanfly Engine Ace - Victory Aftermath script (if used together).
  152.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  153.     VICTORY_MESSAGE   = "%s has earned %s %s!"
  154.     VICTORY_AFTERMATH = "+%s%s"
  155.    
  156.   end # JP
  157. end # YEA

  158. #==============================================================================
  159. # ▼ Editting anything past this point may potentially result in causing
  160. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  161. # halitosis so edit at your own risk.
  162. #==============================================================================

  163. module YEA
  164.   module REGEXP
  165.   module BASEITEM
  166.    
  167.     JP_RATE = /<(?:JP_RATE|jp rate):[ ](\d+)([%%])>/i
  168.    
  169.   end # BASEITEM
  170.   module USABLEITEM
  171.    
  172.     JP_GAIN = /<(?:JP_GAIN|jp gain):[ ](\d+)>/i
  173.    
  174.   end # USABLEITEM
  175.   module ENEMY
  176.    
  177.     JP_GAIN = /<(?:JP_GAIN|jp gain):[ ](\d+)>/i
  178.    
  179.   end # ENEMY
  180.   end # REGEXP
  181. end # YEA

  182. #==============================================================================
  183. # ■ Vocab
  184. #==============================================================================

  185. module Vocab
  186.   
  187.   #--------------------------------------------------------------------------
  188.   # new method: self.jp
  189.   #--------------------------------------------------------------------------
  190.   def self.jp
  191.     return YEA::JP::VOCAB
  192.   end
  193.   
  194. end # Vocab

  195. #==============================================================================
  196. # ■ Icon
  197. #==============================================================================

  198. module Icon
  199.   
  200.   #--------------------------------------------------------------------------
  201.   # self.jp
  202.   #--------------------------------------------------------------------------
  203.   def self.jp; return YEA::JP::ICON; end
  204.    
  205. end # Icon

  206. #==============================================================================
  207. # ■ Numeric
  208. #==============================================================================

  209. class Numeric
  210.   
  211.   #--------------------------------------------------------------------------
  212.   # new method: group_digits
  213.   #--------------------------------------------------------------------------
  214.   unless $imported["YEA-CoreEngine"]
  215.   def group; return self.to_s; end
  216.   end # $imported["YEA-CoreEngine"]
  217.    
  218. end # Numeric

  219. #==============================================================================
  220. # ■ DataManager
  221. #==============================================================================

  222. module DataManager
  223.   
  224.   #--------------------------------------------------------------------------
  225.   # alias method: load_database
  226.   #--------------------------------------------------------------------------
  227.   class <<self; alias load_database_jp load_database; end
  228.   def self.load_database
  229.     load_database_jp
  230.     load_notetags_jp
  231.   end
  232.   
  233.   #--------------------------------------------------------------------------
  234.   # new method: load_notetags_jp
  235.   #--------------------------------------------------------------------------
  236.   def self.load_notetags_jp
  237.     groups = [$data_actors, $data_classes, $data_weapons, $data_armors,
  238.       $data_states, $data_enemies, $data_items, $data_skills]
  239.     for group in groups
  240.       for obj in group
  241.         next if obj.nil?
  242.         obj.load_notetags_jp
  243.       end
  244.     end
  245.   end
  246.   
  247. end # DataManager

  248. #==============================================================================
  249. # ■ RPG::BaseItem
  250. #==============================================================================

  251. class RPG::BaseItem
  252.   
  253.   #--------------------------------------------------------------------------
  254.   # public instance variables
  255.   #--------------------------------------------------------------------------
  256.   attr_accessor :jp_rate
  257.   
  258.   #--------------------------------------------------------------------------
  259.   # common cache: load_notetags_jp
  260.   #--------------------------------------------------------------------------
  261.   def load_notetags_jp
  262.     @jp_rate = 1.0
  263.     #---
  264.     self.note.split(/[\r\n]+/).each { |line|
  265.       case line
  266.       #---
  267.       when YEA::REGEXP::BASEITEM::JP_RATE
  268.         @jp_rate = $1.to_i * 0.01
  269.       #---
  270.       end
  271.     } # self.note.split
  272.     #---
  273.   end
  274.   
  275. end # RPG::BaseItem

  276. #==============================================================================
  277. # ■ RPG::UsableItem
  278. #==============================================================================

  279. class RPG::UsableItem < RPG::BaseItem
  280.   
  281.   #--------------------------------------------------------------------------
  282.   # public instance variables
  283.   #--------------------------------------------------------------------------
  284.   attr_accessor :jp_gain
  285.   
  286.   #--------------------------------------------------------------------------
  287.   # common cache: load_notetags_jp
  288.   #--------------------------------------------------------------------------
  289.   def load_notetags_jp
  290.     @jp_gain = YEA::JP::ACTION_JP
  291.     #---
  292.     self.note.split(/[\r\n]+/).each { |line|
  293.       case line
  294.       #---
  295.       when YEA::REGEXP::USABLEITEM::JP_GAIN
  296.         @jp_gain = $1.to_i
  297.       #---
  298.       end
  299.     } # self.note.split
  300.     #---
  301.   end
  302.   
  303. end # RPG::UsableItem

  304. #==============================================================================
  305. # ■ RPG::Enemy
  306. #==============================================================================

  307. class RPG::Enemy < RPG::BaseItem
  308.   
  309.   #--------------------------------------------------------------------------
  310.   # public instance variables
  311.   #--------------------------------------------------------------------------
  312.   attr_accessor :jp_gain
  313.   
  314.   #--------------------------------------------------------------------------
  315.   # common cache: load_notetags_jp
  316.   #--------------------------------------------------------------------------
  317.   def load_notetags_jp
  318.     @jp_gain = YEA::JP::ENEMY_KILL
  319.     #---
  320.     self.note.split(/[\r\n]+/).each { |line|
  321.       case line
  322.       #---
  323.       when YEA::REGEXP::ENEMY::JP_GAIN
  324.         @jp_gain = $1.to_i
  325.       #---
  326.       end
  327.     } # self.note.split
  328.     #---
  329.   end
  330.   
  331. end # RPG::Enemy

  332. #==============================================================================
  333. # ■ BattleManager
  334. #==============================================================================

  335. module BattleManager
  336.   
  337.   #--------------------------------------------------------------------------
  338.   # alias method: display_exp
  339.   #--------------------------------------------------------------------------
  340.   unless $imported["YEA-VictoryAftermath"]
  341.   class <<self; alias battlemanager_display_exp_jp display_exp; end
  342.   def self.display_exp
  343.     battlemanager_display_exp_jp
  344.     gain_jp
  345.   end
  346.   end # $imported["YEA-VictoryAftermath"]
  347.   
  348.   #--------------------------------------------------------------------------
  349.   # new method: gain_jp
  350.   #--------------------------------------------------------------------------
  351.   def self.gain_jp
  352.     amount = $game_troop.jp_total
  353.     fmt = YEA::JP::VICTORY_MESSAGE
  354.     for member in $game_party.members
  355.       member.earn_jp(amount)
  356.       next if $imported["YEA-VictoryAftermath"]
  357.       value = member.battle_jp_earned.group
  358.       $game_message.add('\.' + sprintf(fmt, member.name, value, Vocab::jp))
  359.     end
  360.     wait_for_message unless $imported["YEA-VictoryAftermath"]
  361.   end
  362.   
  363. end # BattleManager

  364. #==============================================================================
  365. # ■ Game_BattlerBase
  366. #==============================================================================

  367. class Game_BattlerBase
  368.   
  369.   #--------------------------------------------------------------------------
  370.   # new method: jpr
  371.   #--------------------------------------------------------------------------
  372.   def jpr
  373.     n = 1.0
  374.     if actor?
  375.       n *= self.actor.jp_rate
  376.       n *= self.class.jp_rate
  377.       for equip in equips
  378.         next if equip.nil?
  379.         n *= equip.jp_rate
  380.       end
  381.     end
  382.     for state in states
  383.       next if state.nil?
  384.       n *= state.jp_rate
  385.     end
  386.     return n
  387.   end
  388.   
  389. end # Game_BattlerBase

  390. #==============================================================================
  391. # ■ Game_Battler
  392. #==============================================================================

  393. class Game_Battler < Game_BattlerBase
  394.   
  395.   #--------------------------------------------------------------------------
  396.   # public instance variables
  397.   #--------------------------------------------------------------------------
  398.   attr_accessor :battle_jp_earned
  399.   
  400.   #--------------------------------------------------------------------------
  401.   # alias method: on_battle_start
  402.   #--------------------------------------------------------------------------
  403.   alias game_battler_on_battle_start_jp on_battle_start
  404.   def on_battle_start
  405.     game_battler_on_battle_start_jp
  406.     @battle_jp_earned = 0
  407.   end
  408.   
  409.   #--------------------------------------------------------------------------
  410.   # alias method: on_battle_end
  411.   #--------------------------------------------------------------------------
  412.   alias game_battler_on_battle_end_jp on_battle_end
  413.   def on_battle_end
  414.     game_battler_on_battle_end_jp
  415.     @battle_jp_earned = 0
  416.   end
  417.   
  418.   #--------------------------------------------------------------------------
  419.   # alias method: item_user_effect
  420.   #--------------------------------------------------------------------------
  421.   alias game_battler_item_user_effect_jp item_user_effect
  422.   def item_user_effect(user, item)
  423.     game_battler_item_user_effect_jp(user, item)
  424.     user.earn_jp(item.jp_gain) if user.actor?
  425.   end
  426.   
  427. end # Game_Battler

  428. #==============================================================================
  429. # ■ Game_Actor
  430. #==============================================================================

  431. class Game_Actor < Game_Battler
  432.   
  433.   #--------------------------------------------------------------------------
  434.   # alias method: setup
  435.   #--------------------------------------------------------------------------
  436.   alias game_actor_setup_jp setup
  437.   def setup(actor_id)
  438.     game_actor_setup_jp(actor_id)
  439.     init_jp
  440.   end
  441.   
  442.   #--------------------------------------------------------------------------
  443.   # new method: init_jp
  444.   #--------------------------------------------------------------------------
  445.   def init_jp
  446.     @jp = {}
  447.     @jp[@class_id] = 0
  448.   end
  449.   
  450.   #--------------------------------------------------------------------------
  451.   # new method: earn_jp
  452.   #--------------------------------------------------------------------------
  453.   def earn_jp(jp, class_id = nil)
  454.     gain_jp(jp * jpr, class_id)
  455.   end
  456.   
  457.   #--------------------------------------------------------------------------
  458.   # new method: gain_jp
  459.   #--------------------------------------------------------------------------
  460.   def gain_jp(jp, class_id = nil)
  461.     init_jp if @jp.nil?
  462.     class_id = @class_id if class_id.nil?
  463.     @jp[class_id] = 0 if @jp[class_id].nil?
  464.     @jp[class_id] += jp.to_i
  465.     @jp[class_id] = [[@jp[class_id], YEA::JP::MAX_JP].min, 0].max
  466.     @battle_jp_earned = 0 if @battle_jp_earned.nil? && $game_party.in_battle
  467.     @battle_jp_earned += jp.to_i if $game_party.in_battle
  468.   end
  469.   
  470.   #--------------------------------------------------------------------------
  471.   # new method: lose_jp
  472.   #--------------------------------------------------------------------------
  473.   def lose_jp(jp, class_id = nil)
  474.     gain_jp(-jp, class_id)
  475.   end
  476.   
  477.   #--------------------------------------------------------------------------
  478.   # new method: jp
  479.   #--------------------------------------------------------------------------
  480.   def jp(class_id = nil)
  481.     class_id = @class_id if class_id.nil?
  482.     @jp[class_id] = 0 if @jp[class_id].nil?
  483.     return @jp[class_id]
  484.   end
  485.   
  486.   #--------------------------------------------------------------------------
  487.   # alias method: level_up
  488.   #--------------------------------------------------------------------------
  489.   alias game_actor_level_up_jp level_up
  490.   def level_up
  491.     game_actor_level_up_jp
  492.     earn_jp(YEA::JP::LEVEL_UP)
  493.   end
  494.   
  495. end # Game_Actor

  496. #==============================================================================
  497. # ■ Game_Enemy
  498. #==============================================================================

  499. class Game_Enemy < Game_Battler
  500.   
  501.   #--------------------------------------------------------------------------
  502.   # new method: jp
  503.   #--------------------------------------------------------------------------
  504.   def jp
  505.     return enemy.jp_gain
  506.   end
  507.   
  508. end # Game_Enemy

  509. #==============================================================================
  510. # ■ Game_Troop
  511. #==============================================================================

  512. class Game_Troop < Game_Unit
  513.   
  514.   #--------------------------------------------------------------------------
  515.   # new method: jp_total
  516.   #--------------------------------------------------------------------------
  517.   def jp_total
  518.     dead_members.inject(0) {|r, enemy| r += enemy.jp }
  519.   end
  520.   
  521. end # Game_Troop

  522. #==============================================================================
  523. # ■ Window_Base
  524. #==============================================================================

  525. class Window_Base < Window
  526.   
  527.   #--------------------------------------------------------------------------
  528.   # new method: draw_actor_jp
  529.   #--------------------------------------------------------------------------
  530.   def draw_actor_jp(actor, dx, dy, dw = 112)
  531.     draw_icon(Icon.jp, dx + dw - 24, dy) if Icon.jp > 0
  532.     dw -= 24 if Icon.jp > 0
  533.     change_color(system_color)
  534.     draw_text(dx, dy, dw, line_height, Vocab::jp, 2)
  535.     dw -= text_size(Vocab::jp).width
  536.     change_color(normal_color)
  537.     draw_text(dx, dy, dw, line_height, actor.jp.group, 2)
  538.   end
  539.   
  540.   #--------------------------------------------------------------------------
  541.   # new method: draw_actor_jp_class
  542.   #--------------------------------------------------------------------------
  543.   def draw_actor_jp_class(actor, class_id, dx, dy, dw = 112)
  544.     draw_icon(Icon.jp, dx + dw - 24, dy) if Icon.jp > 0
  545.     dw -= 24 if Icon.jp > 0
  546.     change_color(system_color)
  547.     draw_text(dx, dy, dw, line_height, Vocab::jp, 2)
  548.     dw -= text_size(Vocab::jp).width
  549.     change_color(normal_color)
  550.     draw_text(dx, dy, dw, line_height, actor.jp(class_id).group, 2)
  551.   end
  552.   
  553. end # Window_Base

  554. #==============================================================================
  555. #
  556. # ▼ End of File
  557. #
  558. #==============================================================================
复制代码
麻烦大大帮忙撒………………
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-14 16:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表