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

Project1

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

[已经解决] 求这种样子战斗脚本

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1407
在线时间
889 小时
注册时间
2011-3-4
帖子
839
跳转到指定楼层
1
发表于 2013-8-15 12:22:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1星屑

如图

最佳答案

查看完整内容

是要這種戰鬥風格嗎? 之前我也問過類似的問題(謝謝喵嗚喵大!) http://rpg.blue/forum.php?mod=viewthread&tid=324509&fromuid=356025 腳本連結 LNX11a_XP戰鬥風格: http://peachround.blog.fc2.com/blog-entry-9.html 如果這是樓主要的,有實裝上的困難的話,我會全部整理好然後打包給樓主。
全民制作人们,大家好,我是练习时长两年半的黄油制作人绿坝,喜欢唱、跳、rap、篮球,music!欢迎加群:107335249

Lv3.寻梦者

梦石
0
星屑
1124
在线时间
209 小时
注册时间
2013-6-19
帖子
138
2
发表于 2013-8-15 12:22:47 | 只看该作者
本帖最后由 a0936459772 于 2013-8-17 03:58 编辑



是要這種戰鬥風格嗎?

之前我也問過類似的問題(謝謝喵嗚喵大!)
http://rpg.blue/forum.php?mod=vi ... &fromuid=356025

腳本連結 LNX11a_XP戰鬥風格:
http://peachround.blog.fc2.com/blog-entry-9.html

如果這是樓主要的,有實裝上的困難的話,我會全部整理好然後打包給樓主。


点评

就是这个!但是代理打开的不是这个脚本?  发表于 2013-8-17 10:27
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
276 小时
注册时间
2011-6-5
帖子
133
3
发表于 2013-8-15 13:15:06 | 只看该作者
这是什么战斗系统。。
日式女主HRPG?立绘+爆衣功能?
不过反正我是做不出来~LZ最好把特征描述清楚哦~
研表究明,汉字的序顺并不定一能影阅响读,比如当你看完这话句后,才发这现里的字全是都乱的
回复

使用道具 举报

Lv1.梦旅人

天才琪露诺

梦石
0
星屑
54
在线时间
276 小时
注册时间
2013-6-24
帖子
1741
4
发表于 2013-8-15 16:44:30 | 只看该作者
LZ能说详细点么?

说人家是笨蛋的自己才是笨蛋,我最强了,最最最强!
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
521 小时
注册时间
2011-12-7
帖子
305
5
发表于 2013-8-15 16:56:35 | 只看该作者
本帖最后由 Ceopal 于 2013-8-15 17:08 编辑



看怪的大小与位置,个人判断其实就是Sideview战斗脚本
战斗与逃跑 是改变位置、大小并打横菜单的结果
男主和女主是同样的,女主只是使用一个巨型图片,巨型图片的目的可能在于遮挡Sideview的角色行走图
HPBAR 也是自行修改的
如果大家都没有见过,只能说明这是Sideview的玩家自行改造版界面,并非一个什么另外的战斗脚本





回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1407
在线时间
889 小时
注册时间
2011-3-4
帖子
839
6
 楼主| 发表于 2013-8-15 17:30:51 | 只看该作者
是默认横板战斗 我只想要下面的血条蓝条那些,有人知道大概是哪个脚本吗?

点评

它有4種SKIN 你說的那個血條是其中一種  发表于 2013-8-17 15:50
全民制作人们,大家好,我是练习时长两年半的黄油制作人绿坝,喜欢唱、跳、rap、篮球,music!欢迎加群:107335249
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
327
在线时间
1291 小时
注册时间
2013-1-12
帖子
3590

贵宾

7
发表于 2013-8-17 03:23:40 | 只看该作者
http://yanflychannel.wordpress.c ... ts/visual-battlers/

介个如何?  英文沒有問題吧?  如果看不懂我可以幫你翻

点评

打不开,在线代理也不行。  发表于 2013-8-17 10:26

回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
327
在线时间
1291 小时
注册时间
2013-1-12
帖子
3590

贵宾

8
发表于 2013-8-17 12:07:43 | 只看该作者
本帖最后由 76213585 于 2013-8-16 21:31 编辑

幫你拿出來了~
這是樓上的
RUBY 代码复制
  1. #==============================================================================
  2. # ★ RGSS3-Extension
  3. # LNX11aconf_XPスタイルバトル#コンフィグ
  4. #  このスクリプトは LNX11a_XPスタイルバトル の設定スクリプトです。
  5. #  単体では何の機能も持ちませんのでご注意ください。
  6. #
  7. #  version   : 1.10 (12/11/18)
  8. #  author    : ももまる
  9. #  reference : [url]http://peachround.blog.fc2.com/blog-entry-9.html[/url]
  10. #
  11. #==============================================================================
  12.  
  13. module LNX11
  14.   #--------------------------------------------------------------------------
  15.   # ■ Index
  16.   #
  17.   # line 026 : 基本設定              line 244 : パーティコマンド
  18.   # line 048 : アクターエリアの背景  line 259 : ターゲットカーソル
  19.   # line 065 : バトルログ            line 289 : ターゲットヘルプ
  20.   # line 118 : バトルメッセージ      line 305 : ポップアップ
  21.   # line 159 : バトラーグラフィック  line 507 : ユーザビリティ
  22.   # line 182 : バトルステータス      line 535 : その他
  23.   # line 212 : アクターコマンド      
  24.   #
  25.   #--------------------------------------------------------------------------
  26.   # ● 基本設定
  27.   #--------------------------------------------------------------------------
  28.   # デフォルトで表示するアクターのバトラーグラフィック
  29.   #  0 = 顔グラフィック / 1 = 歩行グラフィック
  30.   DEFAULT_BATTLER_GRAPHIC = 0  # 規定値:0
  31.  
  32.   # デフォルトバトラーグラフィックの背景グラデーション色([Color1, Color2])
  33.   DEFAULT_BG_COLOR        = [Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  34.                    # 規定値:[Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  35.  
  36.   # 画面の色調変更をアクターに適用する true = 有効 / false = 無効
  37.   # * true にするとアクターエリアの背景にも適用されます
  38.   ACTOR_SCREEN_TONE       = false  # 規定値:false
  39.  
  40.   # TP のポップアップ設定
  41.   #  0 = すべてポップアップする / 1 = アクターのみ / 2 = ポップアップしない
  42.   TP_POPUP_TYPE           = 1      # 規定値:1
  43.  
  44.   # アイコン無しのステートをポップアップしない true = 有効 / false = 無効
  45.   INDEXZERO_NO_POPUP      = true   # 規定値:true
  46.  
  47.   #--------------------------------------------------------------------------
  48.   # ● 設定:アクターエリアの背景
  49.   #--------------------------------------------------------------------------
  50.   # アクターエリアの背景のタイプ
  51.   #  0 = 無し / 1 = グラデーション / 2 = ウィンドウ / "文字列" = 画像
  52.   ACTOR_BACKGROUND        = 2   # 規定値:2
  53.  
  54.   # アクターエリア背景の高さ
  55.   ACTOR_BACKGROUND_HEIGHT = 112 # 規定値:112
  56.  
  57.     #------------------------------------------------------------------------
  58.     # ○ タイプ [1:グラデーション] の設定
  59.     #------------------------------------------------------------------------
  60.     # グラデーションの色([Color1, Color2])
  61.     ACTOR_BG_GRADIENT_COLOR = [Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  62.                      # 規定値:[Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  63.  
  64.   #--------------------------------------------------------------------------
  65.   # ● 設定:バトルログ
  66.   #--------------------------------------------------------------------------
  67.   # バトルログ(戦闘進行の実況)のタイプ
  68.   # 0 = VXAceデフォルト / 1 = 蓄積型 / 2 = ヘルプ表示
  69.   BATTLELOG_TYPE  =  1  # 規定値:1
  70.  
  71.     #------------------------------------------------------------------------
  72.     # ○ バトルログタイプ [1:蓄積型] の設定
  73.     #------------------------------------------------------------------------
  74.     # 一度に表示する行数
  75.     STORAGE_LINE_NUMBER     = 6     # 規定値:6
  76.  
  77.     # 一行の高さ
  78.     STORAGE_LINE_HEIGHT     = 20    # 規定値:20
  79.  
  80.     # 自動的にログが進行する時間(フレーム)
  81.     STORAGE_UP_MESSAGE_TIME = 90    # 規定値:90
  82.  
  83.     # ターン終了時にバトルログを消去する true = 有効 / false = 無効
  84.     STORAGE_TURNEND_CLEAR   = true  # 規定値:true
  85.  
  86.     # 座標の調整 :x = X座標 / :y = Y座標
  87.     STORAGE_OFFSET = {:x => 0, :y => 6}  # 規定値:{:x => 0, :y => 6}
  88.  
  89.     # フォント :size = フォントサイズ / :out_color = テキストの縁取り色
  90.     STORAGE_FONT   = {:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  91.             # 規定値:{:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  92.  
  93.     # 背景のグラデーションの色([Color1, Color2])
  94.     STORAGE_GRADIENT_COLOR = [Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  95.                     # 規定値:[Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  96.  
  97.     #------------------------------------------------------------------------
  98.     # ○ バトルログタイプ [2:ヘルプ表示] の設定
  99.     #------------------------------------------------------------------------
  100.     # ポップアップのウェイト
  101.     POPUP_ADD_WAIT          = 6     # 規定値:6
  102.  
  103.     # 行動の表示形式 0 = アイコン+名前 / 1 = 名前のみ
  104.     HELPDISPLAY_TYPE        = 1     # 規定値:1
  105.  
  106.     # 行動の表示始めの追加ウェイト
  107.     HELPDISPLAT_WAIT        = 20    # 規定値:20
  108.  
  109.     # 行動の表示終了までの追加ウェイト
  110.     HELPDISPLAT_END_WAIT    = 24    # 規定値:24
  111.  
  112.     # 行動の簡易説明文
  113.     # :size = フォントサイズ :delimiter = 名前と簡易説明文の区切り文字
  114.     HELPDISPLAY_DESCRIPTION = {:size => 20, :delimiter => " "}
  115.                      # 規定値:{:size => 20, :delimiter => " "}
  116.  
  117.   #--------------------------------------------------------------------------
  118.   # ● 設定:バトルメッセージ
  119.   #--------------------------------------------------------------------------
  120.   # バトルメッセージ(戦闘開始・逃走・リザルト等)の表示先
  121.   # 0 = メッセージウィンドウ / 1 = バトルログ / 2 = ヘルプ
  122.   MESSAGE_TYPE  =  2   # 規定値:2
  123.  
  124.     #------------------------------------------------------------------------
  125.     # ○ バトルメッセージタイプ [0:メッセージウィンドウ] の設定
  126.     #------------------------------------------------------------------------
  127.     # メッセージウィンドウの背景 0 = ウィンドウ / 1 = 背景を暗くする / 2 = 透明
  128.     MESSAGE_WINDOW_BACKGROUND  = 1     # 規定値:1
  129.  
  130.     # メッセージウィンドウの位置 0 = 上 / 1 = 中 / 2 = 下
  131.     MESSAGE_WINDOW_POSITION    = 0     # 規定値:0
  132.  
  133.     #------------------------------------------------------------------------
  134.     # ○ バトルメッセージタイプ [2:ヘルプ] の設定
  135.     #------------------------------------------------------------------------
  136.     # ヘルプバトルメッセージのウェイト
  137.     #   [ウェイト(フレーム), キー入力を待つ(true = 有効 / false = 無効)]
  138.     #  :battle_start = 戦闘開始      :victory = 勝利
  139.     #  :escape       = 逃走          :defeat  = 敗北
  140.     #  :drop_item    = アイテム獲得 :levelup = レベルアップ
  141.     MESSAGE_WAIT = {:battle_start => [120, false], :victory   => [ 60, false],
  142.                     :defeat       => [120, false], :escape    => [120, false],
  143.                     :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  144.           # 規定値:{:battle_start => [120, false], :victory   => [ 60, false],
  145.           #         :defeat       => [120, false], :escape    => [120, false],
  146.           #         :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  147.  
  148.   # 戦闘開始時の敵出現メッセージを表示する
  149.   MESSAGE_WINDOW_ENEMY_NAMES = false # 規定値:false
  150.  
  151.   # レベルアップ SE  RPG::SE.new("ファイル名", 音量, ピッチ)
  152.   LEVELUP_SE  = RPG::SE.new("Up4", 90, 100)   # 規定値:("Up4", 90, 100)
  153.  
  154.   # ドロップアイテム獲得 SE  RPG::SE.new("ファイル名", 音量, ピッチ)
  155.   # * バトルメッセージタイプが 0 以外の場合のみ再生されます。
  156.   DROPITEM_SE = RPG::SE.new("Item3", 80, 125) # 規定値:("Item3", 80, 125)
  157.  
  158.   #--------------------------------------------------------------------------
  159.   # ● 設定:アクターのバトラーグラフィック
  160.   #--------------------------------------------------------------------------
  161.   # アクター表示を中央揃えにする true = 有効 / false = 左揃え
  162.   ACTOR_CENTERING  =  true    # 規定値:true
  163.  
  164.     #------------------------------------------------------------------------
  165.     # ○ アクター表示中央揃えの設定
  166.     #------------------------------------------------------------------------
  167.     # アクター間のスペースの大きさ補正
  168.     ACTOR_SPACING_ADJUST = 32 # 規定値:32
  169.  
  170.   # 座標の調整 :x = X座標 / :y = Y座標
  171.   # * アクターコマンドのX座標には影響しません。
  172.   ACTOR_OFFSET  = {:x => -16, :y => 0}       # 規定値:{:x => -16, :y => 0}
  173.  
  174.   # アクターエリアと画面端との余白 :side = 左右の余白 / :bottom = 下の余白
  175.   ACTOR_PADDING = {:side => 4, :bottom => 8} # 規定値:{:side => 4, :bottom => 8}
  176.  
  177.   # パーティに対する画面アニメーションのY座標修正
  178.   #  位置が[画面]のアニメーションをパーティの中心に表示されるようにします。
  179.   SCREEN_ANIMATION_OFFSET = 128  # 規定値:128
  180.  
  181.   #--------------------------------------------------------------------------
  182.   # ● 設定:バトルステータス
  183.   #--------------------------------------------------------------------------
  184.   # 座標の調整  :x = X座標 / :y = Y座標
  185.   #  X 座標はアクターの中心を基準とします。
  186.   # * パーティメンバーの数やステータス幅によっては、X 座標が自動的に
  187.   # 調整される場合があります。
  188.   STATUS_OFFSET = {:x => 64, :y => -12} # 規定値:{:x => 64, :y => -12}
  189.  
  190.   # 画面左右端の余白
  191.   STATUS_SIDE_PADDING   = 6     # 規定値:6
  192.  
  193.   # アクター1人あたりのステータス幅
  194.   STATUS_WIDTH          = 72    # 規定値:72
  195.  
  196.   # ステータス幅の自動調整を行う
  197.   STATUS_AUTOADJUST     = true  # 規定値:true
  198.  
  199.   # 行の高さ
  200.   STATUS_LINE_HEIGHT    = 22    # 規定値:22
  201.  
  202.   # アクターの名前のフォントサイズ 値を 0 にすると非表示になる
  203.   STATUS_NAME_SIZE      = 20    # 規定値:20
  204.  
  205.   # HP/MP/TPのフォントサイズ
  206.   STATUS_PARAM_SIZE     = 23    # 規定値:23
  207.  
  208.   # HP/MP/TPゲージの不透明度 (0-255)
  209.   STATUS_GAUGE_OPACITY  = 192   # 規定値:192
  210.  
  211.   #--------------------------------------------------------------------------
  212.   # ● 設定:アクターコマンド
  213.   #--------------------------------------------------------------------------
  214.   # コマンドの項目数が 4 を超える場合、項目がすべて見えるように
  215.   # コマンドウィンドウの高さを拡張する true = 有効 / false = 無効
  216.   ACTOR_COMMAND_NOSCROLL   = true  # 規定値:true
  217.  
  218.   # コマンドを横並びにする true = 横並び / false = 縦並び
  219.   ACTOR_COMMAND_HORIZON    = false # 規定値:false
  220.  
  221.   # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  222.   ACTOR_COMMAND_ALIGNMENT  = 0     # 規定値:0
  223.  
  224.   # ウィンドウの横幅
  225.   #  コマンドを横並びにする場合、大きめの値を設定してください。
  226.   ACTOR_COMMAND_WIDTH      = 128   # 規定値:128
  227.  
  228.   # ウィンドウの位置
  229.   #  0 = アクターの頭上 / 1 = Y座標を固定 / 2 = XY座標を固定
  230.   ACTOR_COMMAND_POSITION   = 0     # 規定値:0
  231.  
  232.     #------------------------------------------------------------------------
  233.     # ○ ウィンドウの位置 [1:Y座標固定 2:XY座標] の設定
  234.     #------------------------------------------------------------------------
  235.     # 固定Y座標の基準位置
  236.     # 0 = 画面下端 - ウィンドウの高さ / 画面上端
  237.     ACTOR_COMMAND_Y_POSITION = 0   # 規定値:0
  238.  
  239.     # ウィンドウのXY座標修正 :x = X座標 / :y = Y座標
  240.     # * コマンド位置が 1 or 2 の場合、ここで設定した値で座標を固定します。
  241.     ACTOR_COMMAND_OFFSET  = {:x => 0, :y => -16} # 規定値:{:x => 0, :y => -16}
  242.  
  243.   #--------------------------------------------------------------------------
  244.   # ● 設定:パーティコマンド
  245.   #--------------------------------------------------------------------------
  246.   # コマンドを横並びにする true = 横並び / false = 縦並び
  247.   PARTY_COMMAND_HORIZON   = true  # 規定値:true
  248.  
  249.   # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  250.   PARTY_COMMAND_ALIGNMENT = 1     # 規定値:1
  251.  
  252.   # ウィンドウの幅
  253.   PARTY_COMMAND_WIDTH     = Graphics.width     # 規定値:Graphics.width
  254.  
  255.   # ウィンドウの座標 :x = X座標 / :y = Y座標
  256.   PARTY_COMMAND_XY        = {:x => 0, :y => 0} # 規定値:{:x => 0, :y => 0}
  257.  
  258.   #--------------------------------------------------------------------------
  259.   # ● 設定:ターゲットカーソル
  260.   #--------------------------------------------------------------------------
  261.   # カーソルグラフィックのファイル名 (Graphics/System/*)
  262.   #  "" を設定した場合、Bitmap の機能でカーソルを自動生成します。
  263.   CURSOR_NAME       = ""    # 規定値:""
  264.  
  265.     #------------------------------------------------------------------------
  266.     # ○ 自動生成のカーソルグラフィックの設定
  267.     #------------------------------------------------------------------------
  268.     # カーソルの色調 (Red, Green, Blue)
  269.     #  nil を設定した場合、データベースのウィンドウカラーと同じになります。
  270.     CURSOR_TONE     = Tone.new(-34, 0, 68)  # 規定値:Tone.new(-34, 0, 68)
  271.  
  272.   # アニメーションスピード
  273.   CURSOR_ANI_SPEED  = 3     # 規定値:3
  274.  
  275.   # 移動スピード
  276.   CURSOR_SPEED      = 3     # 規定値:3
  277.  
  278.   # 対象選択時にカーソルを点滅させる
  279.   CURSOR_BLINK      = true  # 規定値:true
  280.  
  281.   # カーソルのY座標の制限 :min = 最小値 / :max = 最大値
  282.   CURSOR_MINMAX     = {:min => 48, :max => Graphics.height}
  283.              # 規定値:{:min => 48, :max => Graphics.height}
  284.  
  285.   # カーソル位置のXY座標修正 :x = X座標 / :y = Y座標
  286.   CURSOR_OFFSET     = {:x => 0, :y => 0} # 規定値:{:x => 0, :y => 0}
  287.  
  288.   #--------------------------------------------------------------------------
  289.   # ● 設定:ターゲットヘルプ
  290.   #--------------------------------------------------------------------------
  291.   # バトラーの各パラメータ表示 true = 表示 / false = 非表示
  292.   HELP_ACTOR_PARAM = {:hp => true ,:mp => true ,:tp => true ,:state => true }
  293.   HELP_ENEMY_PARAM = {:hp => false,:mp => false,:tp => false,:state => true }
  294.     # アクター規定値:{:hp => true ,:mp => true ,:tp => true ,:state => true }
  295.     # 敵キャラ規定値:{:hp => false,:mp => false,:tp => false,:state => true }
  296.  
  297.   # HP/MP/TP ゲージの幅
  298.   HELP_PARAM_WIDTH    = 72  # 規定値:72
  299.  
  300.   # 敵ランダムの表示形式
  301.   # 0 = 敵全体 ランダム / 1 = 敵n体 ランダム
  302.   RANDOMSCOPE_DISPLAY = 1   # 規定値:1
  303.  
  304.   #--------------------------------------------------------------------------
  305.   # ● 設定:ポップアップ
  306.   #--------------------------------------------------------------------------
  307.   # ポップアップ位置 0 = 足元 / 1 = 中心 / 2 = 頭上 / 3 = 一定(アクターのみ)
  308.   ACTOR_POPUP_POSITION   = 3  # アクター     規定値:3
  309.   ENEMY_POPUP_POSITION   = 1  # 敵キャラ     規定値:1
  310.   LEVELUP_POPUP_POSITION = 3  # レベルアップ 規定値:3
  311.  
  312.     #------------------------------------------------------------------------
  313.     # ○ ポップアップ位置 [3:一定(アクターのみ)] の設定
  314.     #------------------------------------------------------------------------
  315.     # アクターのポップアップの Y 座標
  316.     #  ゲーム画面の高さ(Graphics.height)を基準とします。
  317.     ACTOR_POPUP_Y     =  -100  # 規定値:-100
  318.  
  319.     # レベルアップのポップアップの Y 座標
  320.     #  ゲーム画面の高さ(Graphics.height)を基準とします。
  321.     LEVELUP_POPUP_Y   =  -112  # 規定値:-112
  322.  
  323.   # 数字のフォント
  324.   NUMBER_FONT   =  ["Arial Black", "VL Gothic"] # ["Arial Black", "VL Gothic"]
  325.  
  326.   # ステート等のテキストのフォント
  327.   TEXT_FONT     =  ["Arial Black", "VL Gothic"] # ["Arial Black", "VL Gothic"]
  328.   TEXT_FONT_MCS =  ["VL Gothic"]       #日本語を含む場合。規定値:["VL Gothic"]
  329.  
  330.   # 画像フォントのファイル名 (Graphics/System/*) <<ver1.10>>
  331.   #  "" を設定した場合、通常のフォントを利用します。
  332.   # 数字
  333.   LARGE_NUMBER_NAME = ""       # 規定値:""
  334.   SMALL_NUMBER_NAME = ""       # 規定値:""
  335.   # 能力強化/弱体
  336.   LARGE_BUFFS_NAME  = ""       # 規定値:""
  337.   SMALL_BUFFS_NAME  = ""       # 規定値:""
  338.  
  339.   # 数字のサイズ・字間
  340.   #  :fontsize = フォントサイズ / :spacing = 字間
  341.   #  :width    = 一字あたりの幅 / :height = 一字あたりの高さ
  342.   LARGE_NUMBER  =  {:fontsize => 38, :spacing => -4, :line_height => 26}
  343.   SMALL_NUMBER  =  {:fontsize => 28, :spacing => -4, :line_height => 20}
  344.   # 大サイズ規定値:{:fontsize => 38, :spacing => -4, :line_height => 26}
  345.   # 小サイズ規定値:{:fontsize => 28, :spacing => -4, :line_height => 20}
  346.  
  347.   # テキストのフォントサイズ倍率
  348.   #   :normal     = テキスト単体
  349.   #   :left_right = ダメージ左右   :top_bottom = ダメージ上下
  350.   # * 数字のフォントサイズからの割合で指定します。
  351.   TEXT_SIZERATE     = {:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  352.              # 規定値:{:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  353.  
  354.   # 日本語を含むテキストのフォントサイズ倍率
  355.   # * 通常のテキストフォントサイズからの倍率で指定します。
  356.   TEXT_SIZERATE_MCS = 0.9   # 規定値:0.9
  357.  
  358.   # ポップアップの修飾文字
  359.   # ["テキスト", 修飾文字の位置(2 = 下 / 4 = 左 / 6 = 右 / 8 = 上)]
  360.   # * 文字列中の \mp \tp はデータベースで設定した用語(短)に置き換わります
  361.   DECORATION_NUMBER = {            # 規定値
  362.   :critical    => ["CRITICAL", 8], # ["CRITICAL", 8] / クリティカル
  363.   :weakness    => ["WEAKNESS", 8], # ["WEAKNESS", 8] / 弱点ダメージ
  364.   :resist      => ["RESIST"  , 8], # ["RESIST"  , 8] / 耐性ダメージ
  365.   :mp_damage   => ["\mp"     , 4], # ["\mp"     , 4] / MP ダメージ・回復
  366.   :mp_plus     => ["\mp+"    , 4], # ["\mp+"    , 4] / MP 再生
  367.   :mp_minus    => ["\mp-"    , 4], # ["\mp-"    , 4] / MP 消費
  368.   :tp_plus     => ["\tp+"    , 4], # ["\tp+"    , 4] / TP 増加
  369.   :tp_minus    => ["\tp-"    , 4], # ["\tp-"    , 4] / TP 減少
  370.   }
  371.   # ステートや能力強化/弱体のポップアップの修飾文字
  372.   #  %s にステート・能力名が入る
  373.   DECORATION_TEXT = {              # 規定値
  374.   :add_state   => "+%s",           # "+%s"           / ステート付加
  375.   :rem_state   => "-%s",           # "-%s"           / ステート解除
  376.   :add_buff    => "%s UP",         # "%s UP"         / 能力強化付加
  377.   :add_debuff  => "%s DOWN",       # "%s DOWN"       / 能力弱体付加
  378.   :rem_buff    => "-%s Buff",      # "-%s Buff"      / 能力強化/弱体解除
  379.   }
  380.   # ポップアップの表示用語
  381.   POPUP_VOCAB = {                  # 規定値
  382.   :miss        => "MISS!",         # "MISS!"         / ミス
  383.   :counter     => "Counter",       # "Counter"       / 反撃
  384.   :reflection  => "Reflection",    # "Reflection"    / 反射
  385.   :substitute  => "Substitute",    # "Substitute"    / 身代わり
  386.   :levelup     => "LEVELUP!",      # "LEVELUP!"      / レベルアップ
  387.   }
  388.   # 能力強化/弱体ポップアップのパラメータ表記
  389.   # * 文字列中の \hp \mp はデータベースで設定した用語(短)に置き換わります
  390.   POPUP_VOCAB_PARAMS = [ # 規定値
  391.   "MAX\hp",              # "MAX\hp"  / 最大HP    MAXimum Hit Point
  392.   "MAX\mp",              # "MAX\mp"  / 最大MP    MAXimum Magic Point
  393.   "ATK",                 # "ATK"     / 攻撃力    ATtacK power
  394.   "DEF",                 # "MATK"    / 防御力    DEFense power
  395.   "MATK",                # "MDEF"    / 魔法力    Magic ATtacK power
  396.   "MDEF",                # "MDEF"    / 魔法防御  Magic DEFense power
  397.   "AGI",                 # "AGI"     / 敏捷性    AGIlity
  398.   "LUCK",                # "LUCK"    / 運        LUCK
  399.   ]
  400.   # ポップアップの色([Color1, Color2])
  401.   # * ハッシュの順序を変更しないこと
  402.   POPUP_COLOR = {
  403.   # HP ダメージ(ミス)
  404.   :hp_damage     => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  405.   # クリティカルダメージ
  406.   :critical      => [Color.new(255, 255,  80), Color.new(224,  32,   0)],
  407.   # 弱点ダメージ
  408.   :weakness      => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  409.   # 耐性ダメージ
  410.   :resist        => [Color.new(232, 224, 216), Color.new( 56,  48,  40)],
  411.   # HP 回復(再生,吸収)
  412.   :hp_recovery   => [Color.new( 96, 255, 128), Color.new(  0,  64,  32)],
  413.   # MP ダメージ
  414.   :mp_damage     => [Color.new(248,  80, 172), Color.new( 48,   0,  32)],
  415.   # MP 回復(再生,吸収)
  416.   :mp_recovery   => [Color.new(160, 240, 255), Color.new( 32,  48, 144)],
  417.   # TP 増減
  418.   :tp_damage     => [Color.new(248, 240,  64), Color.new(  0,  80,  40)],
  419.   # 有利なステートの付加
  420.   :add_state     => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  421.   # 有利なステートの解除
  422.   :rem_state     => [Color.new(224, 232, 240), Color.new( 32,  64, 128, 128)],
  423.   # ステートの付加
  424.   :add_badstate  => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  425.   # ステートの解除
  426.   :rem_badstate  => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  427.   # 能力強化の付加
  428.   :add_buff      => [Color.new(255, 255, 192), Color.new( 96,  64,   0)],
  429.   # 能力弱体の付加
  430.   :add_debuff    => [Color.new(200, 224, 232), Color.new( 40,  48,  56)],
  431.   # 能力強化/弱体の解除
  432.   :rem_buff      => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  433.   # 反撃
  434.   :counter       => [Color.new(255, 255, 224), Color.new(128,  96,   0)],
  435.   # 反射
  436.   :reflection    => [Color.new(224, 255, 255), Color.new(  0,  96, 128)],
  437.   # 身代わり
  438.   :substitute    => [Color.new(224, 255, 224), Color.new(  0, 128,  64)],
  439.   # レベルアップ
  440.   :levelup       => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  441.   }
  442.   # ポップアップのタイプ        -1 = ポップアップしない
  443.   #  0 = 跳ねるポップアップ(大)  4 = スライド(大)
  444.   #  1 = 跳ねるポップアップ(小)  5 = スライド(小)
  445.   #  2 = ゆっくり上昇(大)        6 = オーバーレイ(大)
  446.   #  3 = ゆっくり上昇(小)        7 = オーバーレイ(小)
  447.   POPUP_TYPE = {          # 規定値
  448.   :miss          =>   0,  #   0 / ミス
  449.   :hp_damage     =>   0,  #   0 / HP ダメージ
  450.   :hp_slipdamage =>   1,  #   1 / HP スリップダメージ
  451.   :hp_recovery   =>   0,  #   0 / HP 回復
  452.   :hp_regenerate =>   1,  #   1 / HP 再生
  453.   :hp_drain      =>   0,  #   0 / HP 被吸収
  454.   :hp_drainrecv  =>   0,  #   0 / HP 吸収回復
  455.   :mp_damage     =>   0,  #   0 / MP ダメージ
  456.   :mp_slipdamage =>   1,  #   1 / MP スリップダメージ
  457.   :mp_recovery   =>   0,  #   0 / MP 回復
  458.   :mp_regenerate =>   1,  #   1 / MP 再生
  459.   :mp_drain      =>   0,  #   0 / MP 被吸収
  460.   :mp_drainrecv  =>   0,  #   0 / MP 吸収回復
  461.   :mp_paycost    =>  -1,  #  -1 / MP 消費
  462.   :tp_damage     =>   1,  #   1 / TP 増加(ダメージ)
  463.   :tp_charge     =>  -1,  #  -1 / TP チャージ(被ダメージ時の TP 増加)
  464.   :tp_gain       =>   7,  #   7 / TP 得
  465.   :tp_regenerate =>   1,  #   1 / TP 再生(スリップダメージ)
  466.   :tp_paycost    =>  -1,  #  -1 / TP 消費
  467.   # ステート/能力
  468.   :add_state     =>   2,  #   2 / 有利なステートの付加
  469.   :rem_state     =>   2,  #   2 / 有利なステートの解除
  470.   :add_badstate  =>   2,  #   2 / 不利なステートの付加
  471.   :rem_badstate  =>   2,  #   2 / 不利なステートの解除
  472.   :add_buff      =>   3,  #   3 / 能力強化の付加
  473.   :add_debuff    =>   3,  #   3 / 能力弱体の付加
  474.   :rem_buff      =>   3,  #   3 / 能力強化/弱体の解除
  475.   # 特殊
  476.   :counter       =>   6,  #   6 / 反撃
  477.   :reflection    =>   6,  #   6 / 反射
  478.   :substitute    =>   4,  #   4 / 身代わり
  479.   }
  480.   # 0:跳ねるポップアップの動き(大)
  481.   LARGE_MOVEMENT = {
  482.   :inirate    => 6.4,  :gravity      => 0.68,  :side_scatter => 1.2,
  483.   :ref_height =>  32,  :ref_factor   => 0.60,  :ref_count    =>   2,
  484.                        :duration     =>   40,  :fadeout      =>  20 }
  485.   # 1:跳ねるポップアップの動き(小)
  486.   SMALL_MOVEMENT = {
  487.   :inirate    => 4.4,  :gravity      => 0.60,  :side_scatter => 0.0,
  488.   :ref_height =>  12,  :ref_factor   => 0.70,  :ref_count    =>   0,
  489.                        :duration     =>   60,  :fadeout      =>  16 }
  490.   # 2,3:上昇ポップアップの動き
  491.   RISE_MOVEMENT     = {:rising_speed => 0.75,  :line_spacing => 0.9,
  492.                        :duration     =>   40,  :fadeout      =>   8 }
  493.   # 4,5:スライドポップアップの動き
  494.   SLIDE_MOVEMENT    = {:x_speed      =>    2,  :line_spacing => 0.9,
  495.                        :duration     =>   50,  :fadeout      =>  32 }
  496.   # 6,7:オーバーレイポップアップの動き
  497.   OVERLAY_MOVEMENT  = {:duration     =>   36,  :fadeout      =>  32 }
  498.  
  499.   # :inirate      = 初速度                :gravity    = 重力加速度
  500.   # :side_scatter = 左右移動のばらつき    :ref_height = 跳ね返り位置
  501.   # :ref_factor   = 反発係数              :ref_count  = 跳ね返り回数
  502.   # :duration     = 消え始めるまでの時間  :fadeout    = 消える速度
  503.   # :rising_speed = 上昇速度              :x_speed    = 横移動速度
  504.   # :line_spacing = ポップアップの行間
  505.  
  506.   #--------------------------------------------------------------------------
  507.   # ● 設定:ユーザビリティ
  508.   #--------------------------------------------------------------------------  
  509.   # 効果範囲が 使用者/全体/ランダム のスキル・アイテムの対象確認を行う
  510.   #  true = 有効 / false = 無効
  511.   FIX_TARGET_CHECKE     = true   # 規定値:true
  512.  
  513.   # 防御コマンドの対象確認を行う     true = 有効 / false = 無効
  514.   GUARD_TARGET_CHECKE   = true   # 規定値:true
  515.  
  516.   # アクターの対象選択を最適化する   true = 有効 / false = 無効
  517.   SMART_TARGET_SELECT   = true   # 規定値:true
  518.  
  519.   # 対象選択のカーソル位置を記憶する true = 有効 / false = 無効
  520.   LAST_TARGET           = true   # 規定値:true
  521.  
  522.   # パーティコマンドのカーソル位置を記憶する    true = 有効 / false = 無効
  523.   LAST_PARTY_COMMAND    = true   # 規定値:true
  524.  
  525.   # アクターコマンドのカーソル位置を記憶する    true = 有効 / false = 無効
  526.   LAST_ACTOR_COMMAND    = true   # 規定値:true
  527.  
  528.   # 敵キャラのインデックスを X 座標でソートする true = 有効 / false = 無効
  529.   TROOP_X_SORT          = true   # 規定値:true
  530.  
  531.   # パーティコマンド入力回数を最適化する        true = 有効 / false = 無効
  532.   PARTY_COMMAND_SKIP    = true   # 規定値:true
  533.  
  534.   #--------------------------------------------------------------------------
  535.   # ● 設定:その他
  536.   #--------------------------------------------------------------------------
  537.   # スキルリストとアイテムリストを項目数に合わせてリサイズする
  538.   #  true = 有効 / false = 無効
  539.   FITTING_LIST          = true   # 規定値:true
  540.  
  541.   # バトラーの行動時の白フラッシュを強める          true = 有効 / false = 無効
  542.   ENHANCED_WHITEN       = true   # 規定値:true
  543.  
  544.   # ダメージを受けた時の画面のシェイクを行わない    true = 有効 / false = 無効
  545.   DISABLED_DAMAGE_SHAKE = true   # 規定値:true
  546.  
  547.   # 敵キャラの X 座標を画面サイズに合わせて修正する true = 有効 / false = 無効
  548.   TROOP_X_SCREEN_FIX    = true   # 規定値:true
  549.  
  550.   # 敵キャラの Y 座標の調整
  551.   TROOP_Y_OFFSET        = 0      # 規定値:0
  552.  
  553.   #
  554.   # 設定ここまで お疲れ様でした。
  555.   #
  556. end
  557. #==============================================================================
  558. # ■ LNXスクリプト導入情報
  559. #==============================================================================
  560. $lnx_include = {} if $lnx_include == nil
  561. $lnx_include[:lnx11aconf] = 110 # version
  562. p "OK:LNX11aconf_XPスタイルバトル#コンフィグ"


RUBY 代码复制
  1. #==============================================================================
  2. # ★ RGSS3-Extension
  3. # LNX11a_XPスタイルバトル
  4. #  戦闘画面をRPGツクールXP準拠のものに変更します。
  5. #
  6. #  version   : 1.11 (13/06/19)
  7. #  author    : ももまる
  8. #  reference : [url]http://peachround.blog.fc2.com/blog-entry-9.html[/url]
  9. #
  10. #==============================================================================
  11.  
  12. #==============================================================================
  13. # ■ LNXスクリプト導入情報
  14. #==============================================================================
  15. $lnx_include = {} if $lnx_include == nil
  16. $lnx_include[:lnx11a] = 111 # version
  17. p "OK:LNX11a_XPスタイルバトル ver1.11"
  18.  
  19. module LNX11
  20.   #--------------------------------------------------------------------------
  21.   # ● 正規表現
  22.   #--------------------------------------------------------------------------
  23.   # アクター:バトラーグラフィック = "ファイル名"
  24.   RE_BATTLER = /(?:バトラーグラフィック|battler_graphic)\s*=\s*"([^"]*)"/i
  25.   # アイテム/スキル:使用時アニメ = アニメーションID
  26.   RE_USE_ANIMATION = /(?:使用時アニメ|use_animation)\s*=\s*(\d+)/i
  27.   # アイテム/スキル:ヘルプ説明 = "説明文"
  28.   RE_SHORT_DESCRIPTION =/(?:ヘルプ説明|short_description)\s*=\s*"([^"]*)"/i
  29.   # アイテム/スキル:ヘルプ非表示
  30.   RE_USABLEITEM_NO_DISPLAY = /(?:ヘルプ非表示|no_display)/i
  31.   # アイテム/スキル:使用時追加ウェイト = duration
  32.   RE_DISPLAY_WAIT = /(?:使用時追加ウェイト|display_wait)\s*=\s*(\d+)/i
  33.   # アイテム/スキル:終了時追加ウェイト = duration
  34.   RE_END_WAIT = /(?:終了時追加ウェイト|end_wait)\s*=\s*(\d+)/i
  35.   # 敵キャラ:通常攻撃アニメ = アニメーションID
  36.   RE_ATK_ANIMATION = /(?:通常攻撃アニメ|atk_animation)\s*=\s*(\d+)/i
  37.   # ステート:ステートアニメ = アニメーションID
  38.   RE_STATE_ANIMATION = /(?:ステートアニメ|state_animation)\s*=\s*(\d+)/i
  39.   # ステート:ポップアップ表示名 = "表示名"
  40.   RE_STATE_DISPLAY = /(?:ポップアップ表示名|display_name)\s*=\s*"([^"]*)"/i
  41.   # ステート:ポップアップ非表示
  42.   RE_STATE_NO_DISPLAY = /(?:ポップアップ非表示|no_display)/i
  43.   # ステート:付加ポップアップ非表示
  44.   RE_STATE_ADD_NO_DISPLAY = /(?:付加ポップアップ非表示|add_no_display)/i
  45.   # ステート:解除ポップアップ非表示
  46.   RE_STATE_REM_NO_DISPLAY = /(?:解除ポップアップ非表示|remove_no_display)/i
  47.   # ステート:有利なステート
  48.   RE_STATE_ADVANTAGE = /(?:有利なステート|advantage_state)/i
  49.   # ステート:ポップアップタイプ = type_id
  50.   RE_STATE_TYPE = /(?:ポップアップタイプ|popup_type)\s*=\s*(\d+)/i
  51.   # ステート:付加ポップアップタイプ = type_id
  52.   RE_STATE_ADD_TYPE = /(?:付加ポップアップタイプ|add_popup_type)\s*=\s*(\d+)/i
  53.   # ステート:解除ポップアップタイプ = type_id
  54.   RE_STATE_REM_TYPE=/(?:解除ポップアップタイプ|remove_popup_type)\s*=\s*(\d+)/i
  55.   # ステート:修飾文字非表示
  56.   RE_STATE_NO_DECORATION = /(?:修飾文字非表示|no_decoration)/i
  57.   # ステート:付加修飾文字非表示
  58.   RE_STATE_ADD_NO_DECORATION = /(?:付加修飾文字非表示|add_no_decoration)/i
  59.   # ステート:解除修飾文字非表示
  60.   RE_STATE_REM_NO_DECORATION = /(?:解除修飾文字非表示|remove_no_decoration)/i
  61.   # <<ver1.10>>
  62.   # ステート:付加ポップアップ表示名 = "表示名"
  63.   RE_STATE_ADD_DISPLAY =
  64.   /(?:付加ポップアップ表示名|add_display_name)\s*=\s*"([^"]*)"/i
  65.   # ステート:解除ポップアップ表示名 = "表示名"
  66.   RE_STATE_REM_DISPLAY =
  67.   /(?:解除ポップアップ表示名|remove_display_name)\s*=\s*"([^"]*)"/i
  68.   #--------------------------------------------------------------------------
  69.   # ● バトルステータス更新
  70.   #--------------------------------------------------------------------------
  71.   # LNX11.バトルステータス更新
  72.   def self.battle_status_refresh
  73.     $game_temp.battle_status_refresh
  74.   end
  75.   def self.バトルステータス更新
  76.     self.battle_status_refresh
  77.   end  
  78.   #--------------------------------------------------------------------------
  79.   # ● アクターエリア表示/非表示
  80.   #--------------------------------------------------------------------------
  81.   # LNX11.アクターエリア表示
  82.   def self.actor_area_show
  83.     self.actor_show
  84.     self.status_show
  85.     self.actor_bg_show
  86.   end
  87.   def self.アクターエリア表示
  88.     self.actor_area_show
  89.   end
  90.   # LNX11.アクターエリア非表示
  91.   def self.actor_area_hide
  92.     self.actor_hide
  93.     self.status_hide
  94.     self.actor_bg_hide
  95.   end
  96.   def self.アクターエリア非表示
  97.     self.actor_area_hide
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● アクター表示/非表示
  101.   #--------------------------------------------------------------------------
  102.   # LNX11.アクター表示
  103.   def self.actor_show
  104.     $game_party.actor_invisible = false
  105.   end
  106.   def self.アクター表示
  107.     self.actor_show
  108.   end
  109.   # LNX11.アクター非表示
  110.   def self.actor_hide
  111.     $game_party.actor_invisible = true
  112.   end
  113.   def self.アクター非表示
  114.     self.actor_hide
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ● バトルステータス表示/非表示
  118.   #--------------------------------------------------------------------------
  119.   # LNX11.バトルステータス表示
  120.   def self.status_show
  121.     $game_party.status_invisible = false
  122.     self.battle_status_refresh
  123.   end
  124.   def self.バトルステータス表示
  125.     self.status_show
  126.   end
  127.   # LNX11.バトルステータス非表示
  128.   def self.status_hide
  129.     $game_party.status_invisible = true
  130.     self.battle_status_refresh
  131.   end
  132.   def self.バトルステータス非表示
  133.     self.status_hide
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● アクター背景表示/非表示
  137.   #--------------------------------------------------------------------------
  138.   # LNX11.アクター背景表示
  139.   def self.actor_bg_show
  140.     $game_party.actor_bg_invisible = false
  141.   end
  142.   def self.アクター背景表示
  143.     self.actor_bg_show
  144.   end
  145.   # LNX11.アクター背景非表示
  146.   def self.actor_bg_hide
  147.     $game_party.actor_bg_invisible = true
  148.   end
  149.   def self.アクター背景非表示
  150.     self.actor_bg_hide
  151.   end  
  152.   #--------------------------------------------------------------------------
  153.   # ● バトラーグラフィックのスクリプト指定
  154.   #--------------------------------------------------------------------------
  155.   # LNX11.バトラーグラフィック(id, filename)
  156.   def self.battler_graphic(id ,filename)
  157.     if id.is_a?(Numeric) && filename.is_a?(String)
  158.       p "LNX11a:バトラーグラフィックを変更しました:ID#{id} #{filename}"
  159.       $game_actors[id].battler_graphic_name = filename
  160.     else
  161.       errormes =  "LNX11a:バトラーグラフィック指定の引数が正しくありません。"
  162.       p errormes, "LNX11a:バトラーグラフィックの指定は行われませんでした。"
  163.       msgbox errormes
  164.     end
  165.   end
  166.   def self.バトラーグラフィック(id ,filename)
  167.     self.battler_graphic(id ,filename)
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 任意のポップアップを生成
  171.   #--------------------------------------------------------------------------
  172.   # LNX11.ポップアップ(battler, popup, type, color, deco)
  173.   def self.make_popup(battler, popup, type = 0, color = :hp_damage, deco = nil)
  174.     return unless $game_party.in_battle
  175.     target = self.battler_search(battler)
  176.     unless target.is_a?(Game_Battler)
  177.       p "LNX11a:任意のポップアップの生成に失敗しました。バトラー指定が"
  178.       p "LNX11a:間違っているか、バトラーが存在していない可能性があります。"
  179.       return
  180.     end
  181.     $game_temp.popup_data.popup_custom(target, popup, type, color, deco)   
  182.   end
  183.   def self.ポップアップ(battler, popup, type=0, color=:hp_damage, deco=nil)
  184.     self.make_popup(battler, popup, type, color, deco)
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● バトラー指定
  188.   #--------------------------------------------------------------------------
  189.   def self.battler_search(val)
  190.     if val.is_a?(String)
  191.       # 名前指定
  192.       a = ($game_party.members + $game_troop.members).find {|b| b.name == val }
  193.       return a
  194.     elsif val.is_a?(Array)
  195.       # インデックス指定
  196.       case val[0]
  197.       when :actor ; return $game_party.members[val[1]]
  198.       when :enemy ; return $game_troop.members[val[1]]
  199.       else        ; return nil
  200.       end
  201.     else
  202.       # オブジェクト
  203.       return val
  204.     end
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ● バトルログプッシュ
  208.   #--------------------------------------------------------------------------
  209.   # LNX11.バトルログ(text)
  210.   def self.battle_log_push(text)
  211.     return unless $game_party.in_battle
  212.     case BATTLELOG_TYPE
  213.     when 0..1 # バトルログ
  214.       BattleManager.log_window.add_text(text)
  215.     when 2 # 簡易ヘルプ表示
  216.       BattleManager.helpdisplay_set(text, 0)
  217.     end
  218.   end
  219.   def self.バトルログ(text)
  220.     self.battle_log_push(text)
  221.   end
  222.   #--------------------------------------------------------------------------
  223.   # ● バトルログ消去
  224.   #--------------------------------------------------------------------------
  225.   # LNX11.バトルログ消去
  226.   def self.battle_log_clear
  227.     return unless $game_party.in_battle
  228.     case BATTLELOG_TYPE
  229.     when 0 # バトルログ
  230.       BattleManager.log_window.clear
  231.     when 1 # 蓄積型
  232.       BattleManager.log_window.clear
  233.       $game_temp.battlelog_clear = true
  234.       self.battle_wait(1)
  235.     when 2 # 簡易ヘルプ
  236.       BattleManager.helpdisplay_clear(0)
  237.     end
  238.   end
  239.   def self.バトルログ消去
  240.     self.battle_log_clear
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● バトルウェイト
  244.   #--------------------------------------------------------------------------
  245.   # LNX11.バトルウェイト(duration)
  246.   def self.battle_wait(duration)
  247.     return unless $game_party.in_battle
  248.     BattleManager.log_window.abs_wait(duration)
  249.   end
  250.   def self.バトルウェイト(duration)
  251.     self.battle_wait(duration)
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● 設定値
  255.   #  ※ 設定を変更する場合、LNX11aconf を使用してください。
  256.   #--------------------------------------------------------------------------
  257.   # <<ver1.00>>
  258.   if !$lnx_include[:lnx11aconf] ||
  259.      $lnx_include[:lnx11aconf] && $lnx_include[:lnx11aconf] < 100
  260.   DEFAULT_BATTLER_GRAPHIC = 0
  261.   DEFAULT_BG_COLOR        = [Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  262.   ACTOR_SCREEN_TONE       = false
  263.   TP_POPUP_TYPE           = 1
  264.   INDEXZERO_NO_POPUP      = true
  265.   ACTOR_BACKGROUND        = 2
  266.   ACTOR_BACKGROUND_HEIGHT = 112
  267.   ACTOR_BG_GRADIENT_COLOR = [Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  268.   BATTLELOG_TYPE  =  1
  269.   STORAGE_LINE_NUMBER     = 6
  270.   STORAGE_LINE_HEIGHT     = 20
  271.   STORAGE_UP_MESSAGE_TIME = 90
  272.   STORAGE_TURNEND_CLEAR   = true
  273.   STORAGE_OFFSET = {:x => 0, :y => 6}
  274.   STORAGE_FONT   = {:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  275.   STORAGE_GRADIENT_COLOR = [Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  276.   POPUP_ADD_WAIT          = 6
  277.   HELPDISPLAY_TYPE        = 1
  278.   HELPDISPLAT_WAIT        = 20
  279.   HELPDISPLAT_END_WAIT    = 24
  280.   HELPDISPLAY_DESCRIPTION = {:size => 20, :delimiter => " "}
  281.   MESSAGE_TYPE  =  2
  282.   MESSAGE_WINDOW_BACKGROUND  = 1
  283.   MESSAGE_WINDOW_POSITION    = 0
  284.   MESSAGE_WAIT = {:battle_start => [120, false], :victory   => [ 60, false],
  285.                   :defeat       => [120, false], :escape    => [120, false],
  286.                   :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  287.   MESSAGE_WINDOW_ENEMY_NAMES = false
  288.   LEVELUP_SE  = RPG::SE.new("Up4", 90, 100)
  289.   DROPITEM_SE = RPG::SE.new("Item3", 80, 125)
  290.   ACTOR_CENTERING  =  true
  291.   ACTOR_SPACING_ADJUST = 32
  292.   ACTOR_OFFSET  = {:x => -16, :y => 0}
  293.   ACTOR_PADDING = {:side => 4, :bottom => 8}
  294.   SCREEN_ANIMATION_OFFSET = 128
  295.   STATUS_OFFSET = {:x => 64, :y => -12}
  296.   STATUS_SIDE_PADDING   = 6
  297.   STATUS_WIDTH          = 72
  298.   STATUS_AUTOADJUST     = true
  299.   STATUS_LINE_HEIGHT    = 22
  300.   STATUS_NAME_SIZE      = 20
  301.   STATUS_PARAM_SIZE     = 23
  302.   STATUS_GAUGE_OPACITY  = 192
  303.   ACTOR_COMMAND_NOSCROLL   = true
  304.   ACTOR_COMMAND_HORIZON    = false
  305.   ACTOR_COMMAND_ALIGNMENT  = 0
  306.   ACTOR_COMMAND_WIDTH      = 128
  307.   ACTOR_COMMAND_POSITION   = 0
  308.   ACTOR_COMMAND_Y_POSITION = 0
  309.   ACTOR_COMMAND_OFFSET  = {:x => 0, :y => -16}
  310.   PARTY_COMMAND_HORIZON   = true
  311.   PARTY_COMMAND_ALIGNMENT = 1
  312.   PARTY_COMMAND_WIDTH     = Graphics.width
  313.   PARTY_COMMAND_XY        = {:x => 0, :y => 0}
  314.   CURSOR_NAME       = ""
  315.   CURSOR_TONE     = Tone.new(-34, 0, 68)
  316.   CURSOR_ANI_SPEED  = 3
  317.   CURSOR_SPEED      = 3
  318.   CURSOR_BLINK      = true
  319.   CURSOR_MINMAX     = {:min => 48, :max => Graphics.height}
  320.   CURSOR_OFFSET     = {:x => 0, :y => 0}
  321.   HELP_ACTOR_PARAM = {:hp => true ,:mp => true ,:tp => true ,:state => true }
  322.   HELP_ENEMY_PARAM = {:hp => false,:mp => false,:tp => false,:state => true }
  323.   HELP_PARAM_WIDTH    = 72
  324.   RANDOMSCOPE_DISPLAY = 1
  325.   ACTOR_POPUP_POSITION   = 3
  326.   ENEMY_POPUP_POSITION   = 1
  327.   LEVELUP_POPUP_POSITION = 3
  328.   ACTOR_POPUP_Y     =  -100
  329.   LEVELUP_POPUP_Y   =  -112
  330.   NUMBER_FONT   =  ["Arial Black", "VL Gothic"]
  331.   TEXT_FONT     =  ["Arial Black", "VL Gothic"]
  332.   TEXT_FONT_MCS =  ["VL Gothic"]
  333.   LARGE_NUMBER  =  {:fontsize => 38, :spacing => -4, :line_height => 26}
  334.   SMALL_NUMBER  =  {:fontsize => 28, :spacing => -4, :line_height => 20}
  335.   TEXT_SIZERATE     = {:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  336.   TEXT_SIZERATE_MCS = 0.9
  337.   DECORATION_NUMBER = {
  338.   :critical    => ["CRITICAL", 8], :weakness    => ["WEAKNESS", 8],
  339.   :resist      => ["RESIST"  , 8], :mp_damage   => ["\mp"     , 4],
  340.   :mp_plus     => ["\mp+"    , 4], :mp_minus    => ["\mp-"    , 4],
  341.   :tp_plus     => ["\tp+"    , 4], :tp_minus    => ["\tp-"    , 4]}
  342.   DECORATION_TEXT = {
  343.   :add_state   => "+%s",      :rem_state   => "-%s",
  344.   :add_buff    => "%s UP",    :add_debuff  => "%s DOWN",
  345.   :rem_buff    => "-%s Buff"}
  346.   POPUP_VOCAB = {
  347.   :miss        => "MISS!",      :counter     => "Counter",
  348.   :reflection  => "Reflection", :substitute  => "Substitute",
  349.   :levelup     => "LEVELUP!"}
  350.   POPUP_VOCAB_PARAMS = [
  351.   "MAX\hp","MAX\mp","ATK","DEF","MATK","MDEF","AGI","LUCK"]
  352.   POPUP_COLOR = {
  353.   :hp_damage     => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  354.   :critical      => [Color.new(255, 255,  80), Color.new(224,  32,   0)],
  355.   :weakness      => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  356.   :resist        => [Color.new(232, 224, 216), Color.new( 56,  48,  40)],
  357.   :hp_recovery   => [Color.new( 96, 255, 128), Color.new(  0,  64,  32)],
  358.   :mp_damage     => [Color.new(248,  80, 172), Color.new( 48,   0,  32)],
  359.   :mp_recovery   => [Color.new(160, 240, 255), Color.new( 32,  48, 144)],
  360.   :tp_damage     => [Color.new(248, 240,  64), Color.new(  0,  80,  40)],
  361.   :add_state     => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  362.   :rem_state     => [Color.new(224, 232, 240), Color.new( 32,  64, 128, 128)],
  363.   :add_badstate  => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  364.   :rem_badstate  => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  365.   :add_buff      => [Color.new(255, 255, 192), Color.new( 96,  64,   0)],
  366.   :add_debuff    => [Color.new(200, 224, 232), Color.new( 40,  48,  56)],
  367.   :rem_buff      => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  368.   :counter       => [Color.new(255, 255, 224), Color.new(128,  96,   0)],
  369.   :reflection    => [Color.new(224, 255, 255), Color.new(  0,  96, 128)],
  370.   :substitute    => [Color.new(224, 255, 224), Color.new(  0, 128,  64)],
  371.   :levelup       => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  372.   }
  373.   POPUP_TYPE = {
  374.   :miss          =>   0,:hp_damage     =>   0,:hp_slipdamage =>   1,
  375.   :hp_recovery   =>   0,:hp_regenerate =>   1,:hp_drain      =>   0,
  376.   :hp_drainrecv  =>   0,:mp_damage     =>   0,:mp_slipdamage =>   1,
  377.   :mp_recovery   =>   0,:mp_regenerate =>   1,:mp_drain      =>   0,
  378.   :mp_drainrecv  =>   0,:mp_paycost    =>  -1,:tp_damage     =>   1,
  379.   :tp_charge     =>  -1,:tp_gain       =>   7,:tp_regenerate =>   1,
  380.   :tp_paycost    =>  -1,:add_state     =>   2,:rem_state     =>   2,
  381.   :add_badstate  =>   2,:rem_badstate  =>   2,:add_debuff    =>   3,
  382.   :rem_buff      =>   3,:counter       =>   6,:reflection    =>   6,
  383.   :substitute    =>   4,}
  384.   LARGE_MOVEMENT = {
  385.   :inirate    => 6.4,  :gravity      => 0.68,  :side_scatter => 1.2,
  386.   :ref_height =>  32,  :ref_factor   => 0.60,  :ref_count    =>   2,
  387.                        :duration     =>   40,  :fadeout      =>  20 }
  388.   SMALL_MOVEMENT = {
  389.   :inirate    => 4.4,  :gravity      => 0.60,  :side_scatter => 0.0,
  390.   :ref_height =>  12,  :ref_factor   => 0.70,  :ref_count    =>   0,
  391.                        :duration     =>   60,  :fadeout      =>  16 }
  392.   RISE_MOVEMENT     = {:rising_speed => 0.75,  :line_spacing => 0.9,
  393.                        :duration     =>   40,  :fadeout      =>   8 }
  394.   SLIDE_MOVEMENT    = {:x_speed      =>    2,  :line_spacing => 0.9,
  395.                        :duration     =>   50,  :fadeout      =>  32 }
  396.   OVERLAY_MOVEMENT  = {:duration     =>   36,  :fadeout      =>  32 }
  397.   FIX_TARGET_CHECKE     = true
  398.   GUARD_TARGET_CHECKE   = true
  399.   SMART_TARGET_SELECT   = true
  400.   LAST_TARGET           = true
  401.   LAST_PARTY_COMMAND    = true
  402.   LAST_ACTOR_COMMAND    = true
  403.   TROOP_X_SORT          = true
  404.   PARTY_COMMAND_SKIP    = true
  405.   FITTING_LIST          = true
  406.   ENHANCED_WHITEN       = true
  407.   DISABLED_DAMAGE_SHAKE = true
  408.   TROOP_X_SCREEN_FIX    = true
  409.   TROOP_Y_OFFSET        = 0
  410.   end
  411.   # <<ver1.10>>
  412.   if !$lnx_include[:lnx11aconf] ||
  413.     $lnx_include[:lnx11aconf] && $lnx_include[:lnx11aconf] < 110
  414.   LARGE_NUMBER_NAME = ""
  415.   SMALL_NUMBER_NAME = ""
  416.   LARGE_BUFFS_NAME  = ""
  417.   SMALL_BUFFS_NAME  = ""
  418.   end
  419. end
  420.  
  421. #==============================================================================
  422. # ■ [追加]:Popup_Data
  423. #------------------------------------------------------------------------------
  424. #  戦闘中のポップアップをまとめて扱うクラス。ポップアップスプライトの
  425. # initialize 時に自身を参照させて、ポップアップ内容を定義する際にも使います。
  426. #==============================================================================
  427.  
  428. class Popup_Data
  429.   #--------------------------------------------------------------------------
  430.   # ● クラス変数
  431.   #--------------------------------------------------------------------------
  432.   @@make_methods = {} # ポップアップ作成メソッドのハッシュ
  433.   #--------------------------------------------------------------------------
  434.   # ● 定数(ポップアップのタイプID)
  435.   #--------------------------------------------------------------------------
  436.   SPRING_LARGE  = 0
  437.   SPRING_SMALL  = 1
  438.   RISING_LARGE  = 2
  439.   RISING_SMALL  = 3
  440.   SLIDING_LARGE = 4
  441.   SLIDING_SMALL = 5
  442.   OVERLAY_LARGE = 6
  443.   OVERLAY_SMALL = 7
  444.   LEVELUP       = :levelup
  445.   #--------------------------------------------------------------------------
  446.   # ● 公開インスタンス変数
  447.   #--------------------------------------------------------------------------
  448.   attr_accessor :type       # ポップアップのタイプ
  449.   attr_accessor :popup      # 表示する内容
  450.   attr_accessor :popup_size # ポップアップの大きさ
  451.   attr_accessor :color      # 色
  452.   attr_accessor :deco       # 修飾文字
  453.   attr_accessor :battler    # ポップアップするバトラー
  454.   attr_accessor :delay      # 表示開始までの時間
  455.   attr_accessor :viewport   # ビューポート
  456.   attr_accessor :popup_wait # ポップアップウェイト
  457.   attr_accessor :buff_data  # 能力強化/弱体 <<ver1.10>>
  458.   #--------------------------------------------------------------------------
  459.   # ● オブジェクト初期化
  460.   #--------------------------------------------------------------------------
  461.   def initialize
  462.     @sprites = []
  463.     @viewport = Viewport.new
  464.     @viewport.z = 120 # ポップアップの Z 座標
  465.     spb = Sprite_PopupBase.new
  466.     spb.create_number
  467.     spb.dispose
  468.     set_methods
  469.     refresh
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # ● ポップアップ生成メソッドの登録
  473.   #--------------------------------------------------------------------------
  474.   def set_methods
  475.     @@make_methods[SPRING_LARGE]  = method(:makeup_spring_large)
  476.     @@make_methods[SPRING_SMALL]  = method(:makeup_spring_small)
  477.     @@make_methods[RISING_LARGE]  = method(:makeup_rising_large)
  478.     @@make_methods[RISING_SMALL]  = method(:makeup_rising_small)
  479.     @@make_methods[SLIDING_LARGE] = method(:makeup_sliding_large)
  480.     @@make_methods[SLIDING_SMALL] = method(:makeup_sliding_small)
  481.     @@make_methods[OVERLAY_LARGE] = method(:makeup_overlay_large)
  482.     @@make_methods[OVERLAY_SMALL] = method(:makeup_overlay_small)
  483.     @@make_methods[LEVELUP]       = method(:makeup_levelup)
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● スプライト解放
  487.   #--------------------------------------------------------------------------
  488.   def dispose
  489.     @sprites.each {|sprite| sprite.dispose}
  490.     @viewport.dispose
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● フレーム更新
  494.   #--------------------------------------------------------------------------
  495.   def update
  496.     @sprites.each do |sprite|
  497.       sprite.update
  498.       @sprites.delete(sprite) if sprite.disposed?
  499.     end
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ● リフレッシュ
  503.   #--------------------------------------------------------------------------
  504.   def refresh
  505.     @type  = 0
  506.     @popup = nil
  507.     @popup_size = :large
  508.     [url=home.php?mod=space&uid=10453]@color[/url] = :hp_damage
  509.     @deco = ["", -1] # [テキスト, テキストの位置]
  510.     [url=home.php?mod=space&uid=133701]@battler[/url] = nil
  511.     @delay = 0
  512.     @popup_wait = false
  513.     # <<ver1.10>> 能力強化/弱体ポップアップを画像で表示する際に利用
  514.     @buff_data = [-1, -1] # [能力, 強化or弱体or解除]
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ● ポップアップを生成
  518.   #--------------------------------------------------------------------------
  519.   def makeup
  520.     if @@make_methods[@type]
  521.       @@make_methods[@type].call
  522.       @popup_wait = true
  523.     end
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ● ポップアップウェイト
  527.   #  バトルログタイプが [2:ヘルプ表示] の場合のみ実行されます。
  528.   #--------------------------------------------------------------------------
  529.   def add_wait
  530.     return if LNX11::BATTLELOG_TYPE != 2 || !@popup_wait
  531.     LNX11::POPUP_ADD_WAIT.times {BattleManager.log_window.abs_wait(1)}
  532.     @popup_wait = false
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ● ポップアップ生成メソッド
  536.   #  これらのメソッドを @@make_methods に登録して呼び出します。
  537.   # これはポップアップタイプの拡張を容易にするための仕様です。
  538.   #--------------------------------------------------------------------------
  539.   def makeup_spring_large
  540.     # @type   0 : 跳ねるポップアップ(大)
  541.     @popup_size = :large
  542.     @sprites.push(Sprite_PopupSpring.new(self))
  543.   end
  544.   def makeup_spring_small
  545.     # @type   1 : 跳ねるポップアップ(小)
  546.     @popup_size = :small
  547.     @delay = @battler.popup_delay[1]
  548.     @sprites.push(Sprite_PopupSpring.new(self))
  549.   end
  550.   def makeup_rising_large
  551.     # @type   2 : ゆっくり上昇(大)
  552.     @popup_size = :large
  553.     @delay = @battler.popup_delay[2]
  554.     @sprites.push(Sprite_PopupRising.new(self))
  555.   end
  556.   def makeup_rising_small
  557.     # @type   3 : ゆっくり上昇(小)
  558.     @popup_size = :small      
  559.     @delay = @battler.popup_delay[2]
  560.     @sprites.push(Sprite_PopupRising.new(self))
  561.   end
  562.   def makeup_sliding_large
  563.     # @type   4 : スライド(大)
  564.     @popup_size = :large
  565.     @delay = @battler.popup_delay[3]
  566.     @sprites.push(Sprite_PopupSliding.new(self))
  567.   end
  568.   def makeup_sliding_small
  569.     # @type   5 : スライド(小)
  570.     @popup_size = :small
  571.     @delay = @battler.popup_delay[3]
  572.     @sprites.push(Sprite_PopupSliding.new(self))      
  573.   end
  574.   def makeup_overlay_large
  575.     # @type   6 : オーバーレイ(大)
  576.     @popup_size = :large
  577.     @sprites.push(Sprite_PopupOverlay.new(self))
  578.   end
  579.   def makeup_overlay_small
  580.     # @type   7 : オーバーレイ(小)
  581.     @popup_size = :small
  582.     @sprites.push(Sprite_PopupOverlay.new(self))
  583.   end
  584.   def makeup_levelup
  585.     # @type :levelup : レベルアップ
  586.     @battler.popup_delay[3] = 0
  587.     @popup_size = :large
  588.     @sprites.push(Sprite_PopupLevelUp.new(self))
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # ● TP のポップアップが有効か?
  592.   #--------------------------------------------------------------------------
  593.   def tp_popup_enabled?(target)
  594.     return false if !$data_system.opt_display_tp
  595.     return true  if LNX11::TP_POPUP_TYPE == 0 # すべてポップアップ
  596.     return true  if LNX11::TP_POPUP_TYPE == 1 && target.actor? # アクターのみ
  597.     false # ポップアップしない
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ● 任意のポップアップ
  601.   #--------------------------------------------------------------------------
  602.   def popup_custom(target, popup, type = 0, color = :hp_damage, deco = nil)
  603.     refresh
  604.     [url=home.php?mod=space&uid=133701]@battler[/url] = target
  605.     @popup = popup
  606.     type = LNX11::POPUP_TYPE[type] if type.is_a?(Symbol)
  607.     @type = type
  608.     [url=home.php?mod=space&uid=10453]@color[/url] = color
  609.     @deco = LNX11::DECORATION_NUMBER[deco] if deco.is_a?(Symbol)
  610.     # ポップアップ作成
  611.     makeup
  612.   end
  613.   #--------------------------------------------------------------------------
  614.   # ● レベルアップのポップアップ
  615.   #--------------------------------------------------------------------------
  616.   def popup_levelup(target)
  617.     # 戦闘に参加している場合のみポップアップ
  618.     return unless $game_party.battle_members.include?(target)
  619.     refresh
  620.     @type = :levelup
  621.     @battler = target
  622.     @popup = LNX11::POPUP_VOCAB[:levelup]
  623.     @color = :levelup
  624.     # ポップアップ作成
  625.     makeup
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ● 単一テキストのポップアップ
  629.   #--------------------------------------------------------------------------
  630.   def popup_text(target, type)
  631.     refresh
  632.     @type = LNX11::POPUP_TYPE[type]
  633.     @battler = target
  634.     @popup = LNX11::POPUP_VOCAB[type]
  635.     @color = type
  636.     # ポップアップ作成
  637.     makeup
  638.   end
  639.   #--------------------------------------------------------------------------
  640.   # ● ミスのポップアップ
  641.   #--------------------------------------------------------------------------
  642.   def popup_miss(target, item)
  643.     refresh
  644.     @type = LNX11::POPUP_TYPE[:miss]
  645.     @battler = target
  646.     @popup = LNX11::POPUP_VOCAB[:miss]
  647.     @color = :hp_damage
  648.     # ポップアップ作成
  649.     makeup
  650.   end
  651.   #--------------------------------------------------------------------------
  652.   # ● HP ダメージポップアップ
  653.   #--------------------------------------------------------------------------
  654.   def popup_hp_damage(target, item)
  655.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  656.     refresh
  657.     @popup = target.result.hp_damage
  658.     @battler = target
  659.     if target.result.hp_drain > 0
  660.       # 被吸収
  661.       @type = LNX11::POPUP_TYPE[:hp_drain]
  662.       # 弱点/耐性
  663.       if target.result.element_rate > 1
  664.         @deco = LNX11::DECORATION_NUMBER[:weakness]
  665.         @color = :weakness
  666.       elsif target.result.element_rate < 1
  667.         @deco = LNX11::DECORATION_NUMBER[:resist]
  668.         @color = :resist
  669.       else
  670.         @color = :hp_damage
  671.       end
  672.     elsif target.result.hp_damage > 0
  673.       # ダメージ
  674.       @type = LNX11::POPUP_TYPE[:hp_damage]
  675.       @color = :hp_damage
  676.       if target.result.critical
  677.         # クリティカル
  678.         @deco = LNX11::DECORATION_NUMBER[:critical]
  679.         @color = :critical
  680.       end
  681.       # 弱点/耐性
  682.       if target.result.element_rate > 1
  683.         @deco = LNX11::DECORATION_NUMBER[:weakness]
  684.         @color = :weakness if @color != :critical
  685.       elsif target.result.element_rate < 1
  686.         @deco = LNX11::DECORATION_NUMBER[:resist]
  687.         @color = :resist if @color != :critical
  688.       end
  689.     elsif target.result.hp_damage < 0
  690.       # 回復
  691.       @type = LNX11::POPUP_TYPE[:hp_recovery]
  692.       @color = :hp_recovery
  693.     else
  694.       # 0 ダメージ
  695.       @type = LNX11::POPUP_TYPE[:hp_damage]
  696.       @color = :hp_damage
  697.     end
  698.     # ポップアップ作成
  699.     makeup
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # ● MP ダメージポップアップ
  703.   #--------------------------------------------------------------------------
  704.   def popup_mp_damage(target, item)
  705.     return if target.dead? || target.result.mp_damage == 0
  706.     refresh
  707.     @popup = target.result.mp_damage
  708.     @battler = target
  709.     @deco = LNX11::DECORATION_NUMBER[:mp_damage]
  710.     if target.result.mp_drain > 0
  711.       # 被吸収
  712.       @type = LNX11::POPUP_TYPE[:mp_drain]
  713.       @color = :mp_damage
  714.     elsif target.result.mp_damage > 0
  715.       # ダメージ
  716.       @type = LNX11::POPUP_TYPE[:mp_damage]
  717.       @color = :mp_damage
  718.     elsif target.result.mp_damage < 0
  719.       # 回復
  720.       @type = LNX11::POPUP_TYPE[:mp_recovery]
  721.       @color = :mp_recovery
  722.     end
  723.     # ポップアップ作成
  724.     makeup
  725.   end
  726.   #--------------------------------------------------------------------------
  727.   # ● TP ダメージポップアップ
  728.   #--------------------------------------------------------------------------
  729.   def popup_tp_damage(target, item)
  730.     return unless tp_popup_enabled?(target)
  731.     return if target.dead? || target.result.tp_damage == 0
  732.     refresh
  733.     @popup = target.result.tp_damage
  734.     @battler = target
  735.     deco = target.result.tp_damage > 0 ? :tp_minus : :tp_plus
  736.     @deco = LNX11::DECORATION_NUMBER[deco]
  737.     @type = LNX11::POPUP_TYPE[:tp_damage]
  738.     @color = :tp_damage
  739.     # ポップアップ作成
  740.     makeup
  741.   end
  742.   #--------------------------------------------------------------------------
  743.   # ● HP 吸収回復
  744.   #--------------------------------------------------------------------------
  745.   def popup_hp_drain(target, hp_drain)
  746.     return if hp_drain == 0
  747.     refresh
  748.     @popup = hp_drain
  749.     @battler = target
  750.     @type = LNX11::POPUP_TYPE[:hp_drainrecv]
  751.     @color = :hp_recovery
  752.     # ポップアップ作成
  753.     makeup
  754.   end
  755.   #--------------------------------------------------------------------------
  756.   # ● MP 吸収回復
  757.   #--------------------------------------------------------------------------
  758.   def popup_mp_drain(target, mp_drain)
  759.     return if mp_drain == 0
  760.     refresh
  761.     @popup = mp_drain
  762.     @battler = target
  763.     @deco = LNX11::DECORATION_NUMBER[:mp_damage]
  764.     @type = LNX11::POPUP_TYPE[:mp_drainrecv]
  765.     @color = :mp_recovery
  766.     # ポップアップ作成
  767.     makeup
  768.   end
  769.   #--------------------------------------------------------------------------
  770.   # ● ステート付加のポップアップ
  771.   #--------------------------------------------------------------------------
  772.   def popup_added_states(target)
  773.     refresh
  774.     @battler = target
  775.     target.result.added_state_objects.each do |state|
  776.       next if state.id == target.death_state_id
  777.       next if state.icon_index == 0 && LNX11::INDEXZERO_NO_POPUP
  778.       next if state.add_no_display?      
  779.       if state.add_no_decoration?
  780.         @popup = state.add_display_name
  781.       else
  782.         @popup = sprintf(LNX11::DECORATION_TEXT[:add_state],
  783.                          state.add_display_name)
  784.       end
  785.       type = state.advantage? ? :add_state : :add_badstate
  786.       if state.add_popup_type
  787.         @type = state.add_popup_type
  788.       else
  789.         @type = LNX11::POPUP_TYPE[type]
  790.       end
  791.       @color = type
  792.       # ポップアップ作成
  793.       makeup
  794.     end
  795.   end
  796.   #--------------------------------------------------------------------------
  797.   # ● ステート解除のポップアップ
  798.   #--------------------------------------------------------------------------
  799.   def popup_removed_states(target)
  800.     refresh
  801.     @type = LNX11::POPUP_TYPE[:rem_badstate]
  802.     @battler = target
  803.     target.result.removed_state_objects.each do |state|
  804.       next if state.id == target.death_state_id
  805.       next if state.icon_index == 0 && LNX11::INDEXZERO_NO_POPUP
  806.       next if state.remove_no_display?
  807.       if state.remove_no_decoration?
  808.         @popup = state.remove_display_name
  809.       else
  810.         @popup = sprintf(LNX11::DECORATION_TEXT[:rem_state],
  811.                          state.remove_display_name)
  812.       end
  813.       type = state.advantage? ? :rem_state : :rem_badstate
  814.       if state.remove_popup_type
  815.         @type = state.remove_popup_type
  816.       else
  817.         @type = LNX11::POPUP_TYPE[type]
  818.       end
  819.       @color = type
  820.       # ポップアップ作成
  821.       makeup
  822.     end
  823.   end
  824.   #--------------------------------------------------------------------------
  825.   # ● 能力強化/弱体のポップアップ
  826.   #--------------------------------------------------------------------------
  827.   def popup_buffs(target, buffs, fmt)
  828.     return if buffs.empty?
  829.     refresh
  830.     @battler = target
  831.     case fmt
  832.     when Vocab::BuffAdd
  833.       buffdeco = LNX11::DECORATION_TEXT[:add_buff]
  834.       @type = LNX11::POPUP_TYPE[:add_buff]
  835.       @color = :add_buff
  836.       @buff_data[1] = 0
  837.     when Vocab::DebuffAdd
  838.       buffdeco = LNX11::DECORATION_TEXT[:add_debuff]
  839.       @type = LNX11::POPUP_TYPE[:add_debuff]
  840.       @color = :add_debuff
  841.       @buff_data[1] = 1
  842.     when Vocab::BuffRemove
  843.       buffdeco = LNX11::DECORATION_TEXT[:rem_buff]
  844.       @type = LNX11::POPUP_TYPE[:rem_buff]
  845.       @color = :rem_buff
  846.       @buff_data[1] = 2
  847.     end
  848.     buffs.each do |param_id|
  849.       @popup = sprintf(buffdeco, LNX11::POPUP_VOCAB_PARAMS[param_id])
  850.       @buff_data[0] = param_id
  851.       # ポップアップ作成
  852.       makeup
  853.       @popup_wait = false
  854.     end
  855.   end
  856.   #--------------------------------------------------------------------------
  857.   # ● HP 再生
  858.   #--------------------------------------------------------------------------
  859.   def popup_regenerate_hp(target, hp_damage, paycost = false)
  860.     return if hp_damage == 0
  861.     refresh
  862.     @popup = hp_damage
  863.     @battler = target
  864.     if hp_damage > 0
  865.       # ダメージ
  866.       @type = LNX11::POPUP_TYPE[:hp_slipdamage]
  867.       @color = :hp_damage
  868.     elsif hp_damage < 0
  869.       # 回復
  870.       @type = LNX11::POPUP_TYPE[:hp_regenerate]
  871.       @color = :hp_recovery
  872.     end
  873.     # ポップアップ作成
  874.     makeup
  875.   end
  876.   #--------------------------------------------------------------------------
  877.   # ● MP 再生
  878.   #--------------------------------------------------------------------------
  879.   def popup_regenerate_mp(target, mp_damage, paycost = false)
  880.     return if mp_damage == 0
  881.     refresh
  882.     @popup = mp_damage
  883.     @battler = target
  884.     @deco = LNX11::DECORATION_NUMBER[mp_damage > 0 ? :mp_minus : :mp_plus]
  885.     if mp_damage > 0
  886.       # ダメージ
  887.       @type = LNX11::POPUP_TYPE[paycost ? :mp_paycost : :mp_slipdamage]
  888.       @color = :mp_damage
  889.     elsif mp_damage < 0
  890.       # 回復
  891.       @type = LNX11::POPUP_TYPE[paycost ? :mp_paycost : :mp_regenerate]
  892.       @color = :mp_recovery
  893.     end
  894.     # ポップアップ作成
  895.     makeup
  896.   end
  897.   #--------------------------------------------------------------------------
  898.   # ● TP 再生
  899.   #--------------------------------------------------------------------------
  900.   def popup_regenerate_tp(target, tp_damage, paycost = false)
  901.     return unless tp_popup_enabled?(target)
  902.     return if tp_damage == 0
  903.     refresh
  904.     @popup = tp_damage
  905.     @battler = target
  906.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  907.     @type = LNX11::POPUP_TYPE[paycost ? :tp_paycost : :tp_regenerate]
  908.     @color = :tp_damage
  909.     # ポップアップ作成
  910.     makeup
  911.   end
  912.   #--------------------------------------------------------------------------
  913.   # ● TP チャージ
  914.   #--------------------------------------------------------------------------
  915.   def popup_tp_charge(target, tp_damage)
  916.     return unless tp_popup_enabled?(target)
  917.     return if tp_damage == 0
  918.     refresh
  919.     @popup = tp_damage
  920.     @battler = target
  921.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  922.     @type = LNX11::POPUP_TYPE[:tp_charge]
  923.     @color = :tp_damage
  924.     # ポップアップ作成
  925.     makeup
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● TP 得
  929.   #--------------------------------------------------------------------------
  930.   def popup_tp_gain(target, tp_damage)
  931.     return unless tp_popup_enabled?(target)
  932.     return if tp_damage == 0
  933.     refresh
  934.     @popup = tp_damage
  935.     @battler = target
  936.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  937.     @type = LNX11::POPUP_TYPE[:tp_gain]
  938.     @color = :tp_damage
  939.     # ポップアップ作成
  940.     makeup
  941.   end
  942. end
  943.  
  944. #==============================================================================
  945. # ■ [追加]:Sprite_PopupBase
  946. #------------------------------------------------------------------------------
  947. #  戦闘中のダメージ表示等をポップアップ表示するためのスプライトの
  948. # スーパークラス。サブクラスで細かい動きを定義します。
  949. #==============================================================================
  950.  
  951. class Sprite_PopupBase < Sprite
  952.   #--------------------------------------------------------------------------
  953.   # ● クラス変数
  954.   #--------------------------------------------------------------------------
  955.   @@cache_number = []
  956.   @@cache_text   = {}
  957.   @@w = []
  958.   @@h = []
  959.   @@priority = 0
  960.   @@count    = 0
  961.   @@buf_bitmap = nil
  962.   #--------------------------------------------------------------------------
  963.   # ● 定数
  964.   #--------------------------------------------------------------------------
  965.   NUMBER_COLOR_SIZE = 8
  966.   NUMBERS    = [0,1,2,3,4,5,6,7,8,9]
  967.   COLOR_KEYS = LNX11::POPUP_COLOR.keys
  968.   #--------------------------------------------------------------------------
  969.   # ● オブジェクト初期化
  970.   #     data : ポップアップデータ
  971.   #--------------------------------------------------------------------------
  972.   def initialize(data = nil)
  973.     if data == nil || !data.battler.battle_member?
  974.       # 非表示のポップアップ
  975.       super(nil)
  976.       @remove = true
  977.       return
  978.     end
  979.     # ポップアップデータを適用
  980.     super(data.viewport)
  981.     @battler = data.battler # ポップアップを表示するバトラー
  982.     @delay   = data.delay   # ディレイ(遅延) ※サブクラスによって扱いが違います
  983.     @popup_size = data.popup_size # ポップアップの大きさ 大/小
  984.     # 基本設定
  985.     @duration = 60  # 消え始める時間
  986.     @fadeout  = 16  # 消える速さ
  987.     @rx = ry  = 0   # XY座標
  988.     # Z座標
  989.     @rz = base_z * 128 + priority
  990.     popup_add
  991.     self.visible = false
  992.     # ポップアップデータからビットマップを作成
  993.     if data.popup.is_a?(Numeric)
  994.       # ダメージ値
  995.       self.bitmap = number(data.popup, data.color, data.popup_size, data.deco)
  996.     elsif data.popup.is_a?(String)
  997.       # テキスト
  998.       self.bitmap = text(data.popup, data.color,
  999.                          data.popup_size, data.buff_data)
  1000.     end
  1001.     # 位置設定
  1002.     self.ox = self.width  / 2
  1003.     self.oy = self.height / 2
  1004.     set_position
  1005.     start
  1006.   end
  1007.   #--------------------------------------------------------------------------
  1008.   # ● 解放
  1009.   #--------------------------------------------------------------------------
  1010.   def dispose
  1011.     popup_remove
  1012.     terminate
  1013.     self.bitmap.dispose if self.bitmap
  1014.     super
  1015.   end
  1016.   #--------------------------------------------------------------------------
  1017.   # ● フレーム更新
  1018.   #--------------------------------------------------------------------------
  1019.   def update
  1020.     return if removed? || delay?
  1021.     update_popup
  1022.     update_xy
  1023.     @duration -= 1
  1024.     self.opacity -= @fadeout if @duration <= 0
  1025.     dispose if self.opacity == 0
  1026.   end
  1027.   #--------------------------------------------------------------------------
  1028.   # ● 開始処理(サブクラスで定義)
  1029.   #--------------------------------------------------------------------------
  1030.   def start
  1031.   end
  1032.   #--------------------------------------------------------------------------
  1033.   # ● 終了処理(サブクラスで定義)
  1034.   #--------------------------------------------------------------------------
  1035.   def terminate
  1036.   end
  1037.   #--------------------------------------------------------------------------
  1038.   # ● フレーム更新(サブクラスで定義)
  1039.   #--------------------------------------------------------------------------
  1040.   def update_popup
  1041.   end
  1042.   #--------------------------------------------------------------------------
  1043.   # ● ポップアップ Z 座標
  1044.   #--------------------------------------------------------------------------
  1045.   def base_z
  1046.     0
  1047.   end
  1048.   #--------------------------------------------------------------------------
  1049.   # ● ポップアップのプライオリティを返す
  1050.   #  同一Z座標のポップアップで、後から生成されたものが手前に表示されるように
  1051.   # Z座標の修正値をクラス変数で管理しています。
  1052.   #--------------------------------------------------------------------------
  1053.   def priority
  1054.     @@priority * 2
  1055.   end
  1056.   #--------------------------------------------------------------------------
  1057.   # ● ポップアップ追加
  1058.   #--------------------------------------------------------------------------
  1059.   def popup_add
  1060.     @@priority += 1
  1061.     @@count += 1
  1062.   end
  1063.   #--------------------------------------------------------------------------
  1064.   # ● ポップアップ消去
  1065.   #--------------------------------------------------------------------------
  1066.   def popup_remove
  1067.     @remove = true
  1068.     @@count -= 1
  1069.     @@priority = 0 if @@count <= 0
  1070.   end
  1071.   #--------------------------------------------------------------------------
  1072.   # ● ディレイが残っている?
  1073.   #  サブクラスの update メソッドで使用します。
  1074.   #--------------------------------------------------------------------------
  1075.   def delay?
  1076.     @delay -= 1
  1077.     self.visible = (@delay <= 0)
  1078.     !self.visible
  1079.   end
  1080.   #--------------------------------------------------------------------------
  1081.   # ● ポップアップ消去済み?
  1082.   #--------------------------------------------------------------------------
  1083.   def removed?
  1084.     @remove
  1085.   end  
  1086.   #--------------------------------------------------------------------------
  1087.   # ● 座標更新
  1088.   #--------------------------------------------------------------------------
  1089.   def update_xy
  1090.     self.x = @rx
  1091.     self.y = @ry
  1092.     self.z = @rz
  1093.   end
  1094.   #--------------------------------------------------------------------------
  1095.   # ● ポップアップ位置の設定
  1096.   #--------------------------------------------------------------------------
  1097.   def set_position
  1098.     @rx = @battler.screen_x
  1099.     if @battler.actor?
  1100.       pos = LNX11::ACTOR_POPUP_POSITION
  1101.     else
  1102.       pos = [LNX11::ENEMY_POPUP_POSITION, 2].min
  1103.     end
  1104.     case pos
  1105.     when 0 ; @ry = @battler.screen_y        # 足元
  1106.     when 1 ; @ry = @battler.screen_y_center # 中心
  1107.     when 2 ; @ry = @battler.screen_y_top    # 頭上
  1108.     when 3 ; @ry = Graphics.height + LNX11::ACTOR_POPUP_Y # Y座標統一(アクター)
  1109.     end
  1110.   end
  1111.   #--------------------------------------------------------------------------
  1112.   # ● 描画するテキストの矩形を取得
  1113.   #--------------------------------------------------------------------------
  1114.   def text_size(str, name, size, bold = false)
  1115.     @@buf_bitmap = Bitmap.new(4, 4) if !@@buf_bitmap || @@buf_bitmap.disposed?
  1116.     @@buf_bitmap.font.name = name
  1117.     @@buf_bitmap.font.size = size
  1118.     @@buf_bitmap.font.bold = bold
  1119.     return @@buf_bitmap.text_size(str)
  1120.   end
  1121.   #--------------------------------------------------------------------------
  1122.   # ● 数字ビットマップの取得
  1123.   #--------------------------------------------------------------------------
  1124.   def bitmap_number(size = :large)
  1125.     return @@cache_number[size == :large ? 0 : 1]
  1126.   end
  1127.   #--------------------------------------------------------------------------
  1128.   # ● 数字ビットマップキャッシュの作成
  1129.   #--------------------------------------------------------------------------
  1130.   def create_number
  1131.     return if @@cache_number[0] && !@@cache_number[0].disposed?
  1132.     n_index = NUMBER_COLOR_SIZE
  1133.     @@cache_number.clear
  1134.     colors = LNX11::POPUP_COLOR.values # 色
  1135.     name = LNX11::NUMBER_FONT
  1136.     # 大・小の 2 パターンを作成する(ループ)
  1137.     [LNX11::LARGE_NUMBER, LNX11::SMALL_NUMBER].each_with_index do |n_size, i|
  1138.       next if get_number(i)
  1139.       size = n_size[:fontsize]
  1140.       # 数字の幅・高さ
  1141.       w = NUMBERS.collect{|n| text_size(n.to_s, name, size).width}.max + 4
  1142.       nh = NUMBERS.collect{|n| text_size(n.to_s, name, size).height}.max
  1143.       h = n_size[:line_height]
  1144.       @@w[i] = w
  1145.       @@h[i] = h
  1146.       # ビットマップ作成
  1147.       bitmap = Bitmap.new(w * NUMBERS.size, h * [colors.size, n_index].min)
  1148.       bitmap.font.name = LNX11::NUMBER_FONT
  1149.       bitmap.font.size = n_size[:fontsize]
  1150.       y = ((h - nh) / 2) - 1
  1151.       # 色ごとに分けて描画する(ループ)
  1152.       n_index.times do |col|
  1153.         # 色を変更
  1154.         bitmap.font.color.set(colors[col][0])
  1155.         bitmap.font.out_color.set(colors[col][1])
  1156.         # 文字ごとに分けて描画(ループ)
  1157.         NUMBERS.size.times do |num|
  1158.           bitmap.draw_text(num * w, (col * h) + y, w, nh, NUMBERS[num], 2)
  1159.         end
  1160.       end
  1161.       @@cache_number.push(bitmap)
  1162.     end
  1163.     p "LNX11a:数字ビットマップのキャッシュを作成しました。"
  1164.     # 数字ビットマップを表示する(テスト用)
  1165.     # s = Sprite.new
  1166.     # s.z = 1000000
  1167.     # s.bitmap = @@cache_number[1] # 0 or 1
  1168.     # loop do Graphics.update end
  1169.   end
  1170.   #--------------------------------------------------------------------------
  1171.   # ● 数字ビットマップの取得
  1172.   #--------------------------------------------------------------------------
  1173.   def get_number(i)
  1174.     case i
  1175.     when 0 # 大
  1176.       return false if LNX11::LARGE_NUMBER_NAME.empty?
  1177.       bitmap = Cache.system(LNX11::LARGE_NUMBER_NAME)
  1178.     when 1 # 小
  1179.       return false if LNX11::SMALL_NUMBER_NAME.empty?
  1180.       bitmap = Cache.system(LNX11::SMALL_NUMBER_NAME)
  1181.     end
  1182.     @@cache_number.push(bitmap)
  1183.     @@w[i] = bitmap.width / NUMBERS.size
  1184.     @@h[i] = bitmap.height / NUMBER_COLOR_SIZE
  1185.     true
  1186.   end
  1187.   #--------------------------------------------------------------------------
  1188.   # ● ダメージ数を描画したビットマップの取得
  1189.   #--------------------------------------------------------------------------
  1190.   def number(num, color, size = :large, deco = nil)
  1191.     # 数値を文字列の配列にする
  1192.     numbers = (num.abs.to_s).split(//)
  1193.     # 色番号を取得
  1194.     color_index = COLOR_KEYS.index(color)
  1195.     # ポップアップサイズを設定
  1196.     n_bitmap = bitmap_number(size)
  1197.     if size == :large
  1198.       n_size = LNX11::LARGE_NUMBER
  1199.       i = 0
  1200.     else
  1201.       n_size = LNX11::SMALL_NUMBER
  1202.       i = 1
  1203.     end
  1204.     spacing = n_size[:spacing]
  1205.     w = @@w[i]
  1206.     h = @@h[i]
  1207.     # ダメージ値のビットマップサイズ
  1208.     @bw = w * numbers.size + spacing * (numbers.size - 1)
  1209.     @bh = h
  1210.     # 修飾文字の描画
  1211.     @offset_x = @offset_y = 0
  1212.     text_bitmap = deco_text(deco,color,n_size[:fontsize]) if deco[1] >= 0
  1213.     # ビットマップを作成
  1214.     bitmap = Bitmap.new(@bw, @bh)
  1215.     # 塗りつぶし(テスト用)
  1216.     # bitmap.fill_rect(bitmap.rect, Color.new(0,0,0,128))
  1217.     # ダメージ値を描画
  1218.     rect = Rect.new(0, h * color_index, w, h)
  1219.     numbers.size.times do |n|
  1220.       rect.x = numbers[n].to_i * w
  1221.       bitmap.blt(w * n + spacing * n + @offset_x, @offset_y, n_bitmap, rect)
  1222.     end
  1223.     # 修飾文字の描画をコールバック
  1224.     @decoblt.call(bitmap) if @decoblt
  1225.     @decoblt = nil
  1226.     # ビットマップを返す
  1227.     bitmap
  1228.   end
  1229.   #--------------------------------------------------------------------------
  1230.   # ● 修飾文字の描画
  1231.   #--------------------------------------------------------------------------
  1232.   def deco_text(deco, color, sizerate)
  1233.     # 元の幅・高さ
  1234.     ow = @bw
  1235.     oh = @bh
  1236.     case deco[1]   
  1237.     when 2 # ダメージ値の下
  1238.       # テキストのビットマップを取得
  1239.       size = decosize(deco[0], sizerate, :top_bottom)
  1240.       text_bitmap = text(deco[0], color, size)
  1241.       # テキストの幅・高さ
  1242.       tw = text_bitmap.width
  1243.       th = text_bitmap.height * 0.8
  1244.       # 最終的なビットマップのサイズ
  1245.       @bw = [@bw, tw].max
  1246.       @bh += th
  1247.       # ダメージ値の描画位置の修正
  1248.       @offset_x = (@bw - ow) / 2
  1249.       @offset_y = 0
  1250.       # 修飾文字の描画位置を設定
  1251.       x = (@bw - tw) / 2
  1252.       y = oh * 0.8
  1253.     when 4 # ダメージ値の左
  1254.       # テキストのビットマップを取得
  1255.       size = decosize(deco[0], sizerate, :left_right)
  1256.       text_bitmap = text(deco[0], color, size)
  1257.       # テキストの幅・高さ
  1258.       tw = text_bitmap.width
  1259.       th = text_bitmap.height
  1260.       # 最終的なビットマップのサイズ
  1261.       @bw += tw
  1262.       @bh = [@bh, th].max
  1263.       # ダメージ値の描画位置の修正
  1264.       @offset_x = tw
  1265.       @offset_y = (@bh - oh) / 2
  1266.       # 修飾文字の描画位置を設定
  1267.       x = 2
  1268.       y = (@bh - th) / 2
  1269.     when 6 # ダメージ値の右
  1270.       # テキストのビットマップを取得
  1271.       size = decosize(deco[0], sizerate, :left_right)
  1272.       text_bitmap = text(deco[0], color, size)
  1273.       # テキストの幅・高さ
  1274.       tw = text_bitmap.width
  1275.       th = text_bitmap.height
  1276.       # 最終的なビットマップのサイズ
  1277.       @bw += tw
  1278.       @bh = [@bh, th].max
  1279.       # ダメージ値の描画位置の修正
  1280.       @offset_x = 0
  1281.       @offset_y = (@bh - oh) / 2
  1282.       # 修飾文字の描画位置を設定
  1283.       x = ow
  1284.       y = (@bh - th) / 2
  1285.     when 8 # ダメージ値の上
  1286.       # テキストのビットマップを取得
  1287.       size = decosize(deco[0], sizerate, :top_bottom)
  1288.       text_bitmap = text(deco[0], color, size)
  1289.       # テキストの幅・高さ
  1290.       tw = text_bitmap.width
  1291.       th = text_bitmap.height * 0.8
  1292.       # 最終的なビットマップのサイズ
  1293.       @bw = [@bw, tw].max
  1294.       @bh += th
  1295.       # ダメージ値の描画位置の修正
  1296.       @offset_x = (@bw - ow) / 2
  1297.       @offset_y = @bh - oh
  1298.       # 修飾文字の描画位置を設定
  1299.       x = (@bw - tw) / 2
  1300.       y = 0
  1301.     end
  1302.     # 修飾文字の描画(コールバック)
  1303.     @decoblt = Proc.new {|bitmap|
  1304.     bitmap.blt(x, y, text_bitmap, text_bitmap.rect)
  1305.     text_bitmap.dispose}
  1306.     return text_bitmap
  1307.   end
  1308.   #--------------------------------------------------------------------------
  1309.   # ● 修飾文字のサイズ
  1310.   #--------------------------------------------------------------------------
  1311.   def decosize(text, size, pos)
  1312.     if text.length != text.bytesize
  1313.       return size * LNX11::TEXT_SIZERATE[pos] * LNX11::TEXT_SIZERATE_MCS
  1314.     else
  1315.       return size * LNX11::TEXT_SIZERATE[pos]
  1316.     end
  1317.   end
  1318.   #--------------------------------------------------------------------------
  1319.   # ● テキストを描画したビットマップの取得
  1320.   #  ステートやダメージ値の修飾文字の描画に使用します。
  1321.   #--------------------------------------------------------------------------
  1322.   def text(text, color, size = :large, buff_data = [-1, -1])
  1323.     # キャッシュがあればそれを返す(無ければ作成)
  1324.     key = text + color.to_s + size.to_s
  1325.     if @@cache_text[key] && !@@cache_text[key].disposed?
  1326.       return @@cache_text[key].clone
  1327.     end
  1328.     # 用語の置き換え
  1329.     text.gsub!("\hp") { Vocab::hp_a } if text.include?("\hp")
  1330.     text.gsub!("\mp") { Vocab::mp_a } if text.include?("\mp")
  1331.     text.gsub!("\tp") { Vocab::tp_a } if text.include?("\tp")
  1332.     # <<ver1.10>> テキストの頭に _ があれば対応する画像ファイルを参照する
  1333.     if text[/^[\_]./]
  1334.       bitmap = get_text_bitmap(text, color, size)
  1335.       # キャッシュに保存
  1336.       @@cache_text[key] = bitmap
  1337.       # ビットマップを返す
  1338.       return bitmap.clone
  1339.     end
  1340.     # <<ver1.10>>
  1341.     # 能力強化/弱体のポップアップで、ファイル名が指定されていればそれを返す
  1342.     if buff_data[0] >= 0 &&
  1343.       (size == :large && !LNX11::LARGE_BUFFS_NAME.empty?) ||
  1344.       (size == :small && !LNX11::SMALL_BUFFS_NAME.empty?)
  1345.       bitmap = get_buff_bitmap(buff_data, size)
  1346.       # キャッシュに保存
  1347.       @@cache_text[key] = bitmap
  1348.       # ビットマップを返す
  1349.       return bitmap.clone
  1350.     end
  1351.     # テキストにマルチバイト文字があれば日本語用フォントを使う
  1352.     if text.length != text.bytesize
  1353.       fontname = LNX11::TEXT_FONT_MCS
  1354.       sizerate = LNX11::TEXT_SIZERATE[:normal] * LNX11::TEXT_SIZERATE_MCS
  1355.     else
  1356.       fontname = LNX11::TEXT_FONT
  1357.       sizerate = LNX11::TEXT_SIZERATE[:normal]
  1358.     end
  1359.     # ポップアップサイズを設定
  1360.     case size
  1361.     when :large ; fontsize = LNX11::LARGE_NUMBER[:fontsize] * sizerate
  1362.     when :small ; fontsize = LNX11::SMALL_NUMBER[:fontsize] * sizerate
  1363.     else        ; fontsize = size
  1364.     end
  1365.     # テキストサイズ計算
  1366.     rect = text_size(text, fontname, fontsize)
  1367.     rect.width += 2
  1368.     # ビットマップを作成
  1369.     bitmap = Bitmap.new(rect.width, rect.height)
  1370.     # 塗りつぶし(テスト用)
  1371.     # bitmap.fill_rect(bitmap.rect, Color.new(0,0,0,128))
  1372.     # フォント設定
  1373.     bitmap.font.name = fontname
  1374.     bitmap.font.size = fontsize
  1375.     bitmap.font.color.set(LNX11::POPUP_COLOR[color][0])
  1376.     bitmap.font.out_color.set(LNX11::POPUP_COLOR[color][1])
  1377.     # テキスト描画
  1378.     bitmap.draw_text(rect, text, 1)
  1379.     # キャッシュに保存
  1380.     @@cache_text[key] = bitmap
  1381.     # ビットマップを返す
  1382.     bitmap.clone
  1383.   end
  1384.   #--------------------------------------------------------------------------
  1385.   # ● 能力強化/弱体ビットマップの取得 <<ver1.10>>
  1386.   #--------------------------------------------------------------------------
  1387.   def get_buff_bitmap(buff_data, size)
  1388.     case size
  1389.     when :large ; src_bitmap = Cache.system(LNX11::LARGE_BUFFS_NAME)
  1390.     when :small ; src_bitmap = Cache.system(LNX11::SMALL_BUFFS_NAME)
  1391.     end
  1392.     src_rect = Rect.new
  1393.     src_rect.width  = src_bitmap.width  / 2
  1394.     src_rect.height = src_bitmap.height / 12
  1395.     src_rect.x = (buff_data[0] / 4) * src_rect.width
  1396.     src_rect.y = (buff_data[0] % 4) * src_rect.height * 3 +
  1397.                   buff_data[1] * src_rect.height
  1398.     bitmap = Bitmap.new(src_rect.width, src_rect.height)
  1399.     bitmap.blt(0, 0, src_bitmap, src_rect)
  1400.     bitmap
  1401.   end
  1402.   #--------------------------------------------------------------------------
  1403.   # ● テキストビットマップの取得 <<ver1.10>>
  1404.   #--------------------------------------------------------------------------
  1405.   def get_text_bitmap(text, color, size)
  1406.     # クリティカルカラーかつ、弱点/耐性なら参照するビットマップを変更
  1407.     if LNX11::POPUP_COLOR[color] == LNX11::POPUP_COLOR[:critical] &&
  1408.       (text == LNX11::DECORATION_NUMBER[:weakness][0] ||
  1409.        text == LNX11::DECORATION_NUMBER[:resist][0])
  1410.       # ファイル名に _critcolor を加える
  1411.       text += "_critcolor"
  1412.     end
  1413.     # MPダメージ/回復(符号なし)なら参照するビットマップを変更
  1414.     if text == LNX11::DECORATION_NUMBER[:mp_damage][0]
  1415.       # カラーに応じてファイル名を変更
  1416.       case LNX11::POPUP_COLOR[color]
  1417.       when LNX11::POPUP_COLOR[:mp_damage]   ; text += "_damage"
  1418.       when LNX11::POPUP_COLOR[:mp_recovery] ; text += "_recovery"
  1419.       end
  1420.     end
  1421.     # popup_xxxxxx_(large or small)
  1422.     Cache.system("popup" + text + (size == :large ? "_large" : "_small"))
  1423.   end
  1424. end
  1425.  
  1426. #==============================================================================
  1427. # ■ [追加]:Sprite_PopupSpring
  1428. #------------------------------------------------------------------------------
  1429. #  通常の跳ねるポップアップ。
  1430. #==============================================================================
  1431.  
  1432. class Sprite_PopupSpring < Sprite_PopupBase
  1433.   #--------------------------------------------------------------------------
  1434.   # ● ポップアップ Z 座標
  1435.   #--------------------------------------------------------------------------
  1436.   def base_z
  1437.     14
  1438.   end
  1439.   #--------------------------------------------------------------------------
  1440.   # ● 開始処理
  1441.   #--------------------------------------------------------------------------
  1442.   def start
  1443.     # 動き設定
  1444.     set_movement
  1445.     # ディレイ設定 同じタイプのポップアップが重ならないようにする
  1446.     if @popup_size == :small
  1447.       self.oy -= @battler.popup_delay[1]
  1448.       @delay_clear = (@delay == 0)
  1449.       dy = self.bitmap.height * 0.8
  1450.       @battler.popup_delay[1] += dy
  1451.       @delay = 0
  1452.     end
  1453.   end
  1454.   #--------------------------------------------------------------------------
  1455.   # ● 終了処理
  1456.   #--------------------------------------------------------------------------  
  1457.   def terminate
  1458.     # 一番上のポップアップなら、ディレイを初期化する
  1459.     @battler.popup_delay[1] = 0 if @delay_clear
  1460.   end
  1461.   #--------------------------------------------------------------------------
  1462.   # ● 投射運動の設定
  1463.   #--------------------------------------------------------------------------
  1464.   def set_movement
  1465.     if @popup_size == :large
  1466.       movement = LNX11::LARGE_MOVEMENT
  1467.     else
  1468.       movement = LNX11::SMALL_MOVEMENT
  1469.     end
  1470.     [url=home.php?mod=space&uid=287440]@fall[/url]       = -movement[:inirate]
  1471.     @gravity    =  movement[:gravity]
  1472.     @side       =  movement[:side_scatter] * rand(0) * (rand(2) == 0 ? -1 : 1)
  1473.     @ref_move   =  movement[:ref_height]
  1474.     @ref_factor =  movement[:ref_factor]
  1475.     @ref_count  =  movement[:ref_count]
  1476.     @duration   =  movement[:duration]
  1477.     @fadeout    =  movement[:fadeout]
  1478.   end
  1479.   #--------------------------------------------------------------------------
  1480.   # ● フレーム更新
  1481.   #--------------------------------------------------------------------------
  1482.   def update_popup
  1483.     update_freefall
  1484.   end
  1485.   #--------------------------------------------------------------------------
  1486.   # ● 投射運動の更新
  1487.   #--------------------------------------------------------------------------
  1488.   def update_freefall
  1489.     if @ref_count >= 0
  1490.       # X:左右移動
  1491.       @rx += @side
  1492.       # Y:自由落下
  1493.       @ry += @fall
  1494.       @ref_move -= @fall
  1495.       [url=home.php?mod=space&uid=287440]@fall[/url] += @gravity
  1496.       # 跳ね返り
  1497.       if @ref_move <= 0 && @fall >= 0
  1498.         @ref_count -= 1
  1499.         @fall = -@fall * @ref_factor
  1500.       end      
  1501.     end
  1502.   end
  1503. end
  1504.  
  1505. #==============================================================================
  1506. # ■ [追加]:Sprite_PopupRising
  1507. #------------------------------------------------------------------------------
  1508. #  少しずつ上昇するポップアップ。
  1509. #==============================================================================
  1510.  
  1511. class Sprite_PopupRising < Sprite_PopupBase
  1512.   #--------------------------------------------------------------------------
  1513.   # ● ポップアップ Z 座標
  1514.   #--------------------------------------------------------------------------
  1515.   def base_z
  1516.     6
  1517.   end
  1518.   #--------------------------------------------------------------------------
  1519.   # ● 開始処理
  1520.   #--------------------------------------------------------------------------
  1521.   def start
  1522.     # 動き設定
  1523.     set_movement
  1524.     self.opacity = 0
  1525.     d = self.bitmap.height * LNX11::RISE_MOVEMENT[:line_spacing]
  1526.     @delay_count = d / @rising_speed
  1527.     @battler.popup_delay[2] += @delay_count
  1528.   end
  1529.   #--------------------------------------------------------------------------
  1530.   # ● 動きの設定
  1531.   #--------------------------------------------------------------------------
  1532.   def set_movement
  1533.     @rising_speed = LNX11::RISE_MOVEMENT[:rising_speed]
  1534.     @duration = LNX11::RISE_MOVEMENT[:duration]
  1535.     @fadeout  = LNX11::RISE_MOVEMENT[:fadeout]
  1536.   end
  1537.   #--------------------------------------------------------------------------
  1538.   # ● フレーム更新
  1539.   #--------------------------------------------------------------------------
  1540.   def update_popup
  1541.     @delay_count -= 1
  1542.     @battler.popup_delay[2] -= 1 if @delay_count >= 0
  1543.     @ry -= @rising_speed # すこしずつ上昇
  1544.     self.opacity += 32 if @duration > 0
  1545.   end
  1546. end
  1547.  
  1548. #==============================================================================
  1549. # ■ [追加]:Sprite_PopupSliding
  1550. #------------------------------------------------------------------------------
  1551. #  スライド表示するポップアップ。
  1552. #==============================================================================
  1553.  
  1554. class Sprite_PopupSliding < Sprite_PopupBase
  1555.   #--------------------------------------------------------------------------
  1556.   # ● ポップアップ Z 座標
  1557.   #--------------------------------------------------------------------------
  1558.   def base_z
  1559.     8
  1560.   end
  1561.   #--------------------------------------------------------------------------
  1562.   # ● 開始処理
  1563.   #--------------------------------------------------------------------------
  1564.   def start
  1565.     # 動き設定
  1566.     set_movement
  1567.     d = self.bitmap.height * LNX11::SLIDE_MOVEMENT[:line_spacing]
  1568.     self.oy += @delay + d / 2 if @delay > 0
  1569.     self.opacity = 0
  1570.     # ディレイ設定 同じタイプのポップアップが重ならないようにする
  1571.     @delay_clear = (@delay == 0)
  1572.     @battler.popup_delay[3] += (@delay <= 0 ? d / 2 : d)
  1573.     @delay = 0
  1574.   end
  1575.   #--------------------------------------------------------------------------
  1576.   # ● 終了処理
  1577.   #--------------------------------------------------------------------------  
  1578.   def terminate
  1579.     # 一番下のポップアップなら、ディレイを初期化する
  1580.     @battler.popup_delay[3] = 0 if @delay_clear
  1581.   end
  1582.   #--------------------------------------------------------------------------
  1583.   # ● 動きの設定
  1584.   #--------------------------------------------------------------------------
  1585.   def set_movement
  1586.     @x_speed  = LNX11::SLIDE_MOVEMENT[:x_speed]
  1587.     @duration = LNX11::SLIDE_MOVEMENT[:duration]
  1588.     @fadeout  = LNX11::SLIDE_MOVEMENT[:fadeout]
  1589.     # フェードインのスライド分だけ X を移動
  1590.     @rx -= @x_speed * 255.0 / @fadeout
  1591.   end
  1592.   #--------------------------------------------------------------------------
  1593.   # ● フレーム更新
  1594.   #--------------------------------------------------------------------------
  1595.   def update_popup
  1596.     @rx += @x_speed if opacity != 255 # スライド
  1597.     self.opacity += @fadeout if @duration > 0
  1598.   end
  1599. end
  1600.  
  1601. #==============================================================================
  1602. # ■ [追加]:Sprite_PopupOverlay
  1603. #------------------------------------------------------------------------------
  1604. #  オーバーレイポップアップ。自身の複製を加算合成で重ね合わせます。
  1605. #==============================================================================
  1606.  
  1607. class Sprite_PopupOverlay < Sprite_PopupBase
  1608.   #--------------------------------------------------------------------------
  1609.   # ● ポップアップ Z 座標
  1610.   #--------------------------------------------------------------------------
  1611.   def base_z
  1612.     10
  1613.   end
  1614.   #--------------------------------------------------------------------------
  1615.   # ● 開始処理
  1616.   #--------------------------------------------------------------------------
  1617.   def start
  1618.     @duration = LNX11::OVERLAY_MOVEMENT[:duration]
  1619.     @fadeout  = LNX11::OVERLAY_MOVEMENT[:fadeout]
  1620.     # オーバーレイの作成
  1621.     create_overlay
  1622.   end
  1623.   #--------------------------------------------------------------------------
  1624.   # ● 終了処理
  1625.   #--------------------------------------------------------------------------
  1626.   def terminate
  1627.     @overlay.dispose
  1628.     @overlay = nil
  1629.   end
  1630.   #--------------------------------------------------------------------------
  1631.   # ● オーバーレイ(複製)の作成
  1632.   #--------------------------------------------------------------------------
  1633.   def create_overlay
  1634.     @overlay = Sprite.new
  1635.     @overlay.bitmap   = self.bitmap
  1636.     @overlay.viewport = self.viewport
  1637.     @overlay.ox = self.ox
  1638.     @overlay.oy = self.oy
  1639.     @overlay.visible = false
  1640.     @overlay.blend_type = 1
  1641.   end
  1642.   #--------------------------------------------------------------------------
  1643.   # ● フレーム更新
  1644.   #--------------------------------------------------------------------------
  1645.   def update_popup
  1646.     self.opacity += @fadeout * 2 if @duration > 0
  1647.   end
  1648.   #--------------------------------------------------------------------------
  1649.   # ● フレーム更新
  1650.   #--------------------------------------------------------------------------
  1651.   def update
  1652.     super
  1653.     update_overlay
  1654.   end
  1655.   #--------------------------------------------------------------------------
  1656.   # ● オーバーレイの更新
  1657.   #--------------------------------------------------------------------------
  1658.   def update_overlay
  1659.     return if self.disposed? || @overlay.opacity == 0
  1660.     @overlay.x = self.x
  1661.     @overlay.y = self.y
  1662.     @overlay.z = self.z
  1663.     # 拡大・消去
  1664.     @overlay.zoom_x += 0.16
  1665.     @overlay.zoom_y += 0.12
  1666.     @overlay.opacity -= 20
  1667.     @overlay.visible = (@overlay.opacity != 0)
  1668.   end
  1669. end
  1670.  
  1671. #==============================================================================
  1672. # ■ [追加]:Sprite_PopupLevelUp
  1673. #------------------------------------------------------------------------------
  1674. #  レベルアップのポップアップ。スライドポップアップを継承しています。
  1675. #==============================================================================
  1676.  
  1677. class Sprite_PopupLevelUp < Sprite_PopupSliding
  1678.   #--------------------------------------------------------------------------
  1679.   # ● ポップアップ Z 座標
  1680.   #--------------------------------------------------------------------------
  1681.   def base_z
  1682.     32
  1683.   end
  1684.   #--------------------------------------------------------------------------
  1685.   # ● ポップアップ位置の設定
  1686.   #--------------------------------------------------------------------------
  1687.   def set_position
  1688.     @rx = @battler.screen_x - LNX11::ACTOR_OFFSET[:x]
  1689.     case LNX11::LEVELUP_POPUP_POSITION
  1690.     when 0 ; @ry = @battler.screen_y        # 足元
  1691.     when 1 ; @ry = @battler.screen_y_center # 中心
  1692.     when 2 ; @ry = @battler.screen_y_top    # 頭上
  1693.     when 3 ; @ry = Graphics.height + LNX11::LEVELUP_POPUP_Y # Y座標統一
  1694.     end
  1695.   end
  1696.   #--------------------------------------------------------------------------
  1697.   # ● フレーム更新
  1698.   #--------------------------------------------------------------------------
  1699.   def update_popup
  1700.     super
  1701.     # リザルト中なら自動的に消去しない
  1702.     @duration += 1 if $game_troop.all_dead? || $game_message.busy?
  1703.   end
  1704. end
  1705.  
  1706. #==============================================================================
  1707. # ■ Bitmap
  1708. #==============================================================================
  1709.  
  1710. class Bitmap
  1711.   #--------------------------------------------------------------------------
  1712.   # ● [追加]:カーソル用三角形の描画
  1713.   #--------------------------------------------------------------------------
  1714.   def lnx_cursor_triangle(size, color, oy = 0, grad = 1)
  1715.     color = color.clone
  1716.     x = (self.width - size) / 2
  1717.     y = (self.height - size) / 2 + oy
  1718.     rect = Rect.new(x, y, size, 1)
  1719.     count = size / 2
  1720.     minus = 128 / count / 2
  1721.     count.times do
  1722.       clear_rect(rect)
  1723.       fill_rect(rect, color)
  1724.       color.red   = [color.red   - minus * grad, 0].max
  1725.       color.green = [color.green - minus * grad, 0].max
  1726.       color.blue  = [color.blue  - minus * grad, 0].max
  1727.       rect.y += rect.height
  1728.       clear_rect(rect)
  1729.       fill_rect(rect, color)
  1730.       color.red   = [color.red   - minus * grad, 0].max
  1731.       color.green = [color.green - minus * grad, 0].max
  1732.       color.blue  = [color.blue  - minus * grad, 0].max
  1733.       rect.x += 1
  1734.       rect.y += rect.height
  1735.       rect.width -= 2
  1736.     end
  1737.   end
  1738. end
  1739.  
  1740. #==============================================================================
  1741. # ■ [追加]:Sprite_TargetCursor
  1742. #------------------------------------------------------------------------------
  1743. #  対象選択されているバトラーや行動選択中のアクターを示すアローカーソルです。
  1744. #==============================================================================
  1745. class Sprite_TargetCursor < Sprite
  1746.   #--------------------------------------------------------------------------
  1747.   # ● クラス変数
  1748.   #--------------------------------------------------------------------------
  1749.   @@cursor_cache = nil
  1750.   #--------------------------------------------------------------------------
  1751.   # ● 公開インスタンス変数
  1752.   #--------------------------------------------------------------------------
  1753.   attr_accessor :battler     # バトラー
  1754.   attr_accessor :blink       # 点滅(対象の選択中)
  1755.   #--------------------------------------------------------------------------
  1756.   # ● オブジェクト初期化
  1757.   #--------------------------------------------------------------------------
  1758.   def initialize(viewport = nil)
  1759.     super(viewport)
  1760.     @wait = LNX11::CURSOR_ANI_SPEED
  1761.     @speed = [LNX11::CURSOR_SPEED, 1].max
  1762.     @battler = nil
  1763.     @sub_cursor = []
  1764.     @blink = false
  1765.     self.bitmap = cursor_bitmap
  1766.     partition = self.bitmap.width / self.height
  1767.     self.src_rect.set(0, 0, self.width / partition, self.height)
  1768.     self.ox = self.width / 2
  1769.     self.oy = self.height / 2
  1770.     self.x = @rx = @tx = 0
  1771.     self.y = @ry = @ty = 0
  1772.     self.z = 98
  1773.     self.visible = false
  1774.   end
  1775.   #--------------------------------------------------------------------------
  1776.   # ● 解放
  1777.   #--------------------------------------------------------------------------  
  1778.   def dispose
  1779.     dispose_subcursor
  1780.     super
  1781.   end
  1782.   #--------------------------------------------------------------------------
  1783.   # ● サブカーソル作成
  1784.   #  メンバー全体にカーソルを表示するために複数のカーソルを作成します。
  1785.   #--------------------------------------------------------------------------  
  1786.   def create_subcursor(members)
  1787.     return unless @sub_cursor.empty?
  1788.     members.each_with_index do |battler, i|
  1789.       @sub_cursor[i] = Sprite_TargetCursor.new(self.viewport)
  1790.       @sub_cursor[i].set(@rx, @ry)
  1791.       @sub_cursor[i].set(battler, true)
  1792.     end
  1793.   end
  1794.   #--------------------------------------------------------------------------
  1795.   # ● サブカーソル解放
  1796.   #--------------------------------------------------------------------------  
  1797.   def dispose_subcursor
  1798.     @sub_cursor.each {|sprite| sprite.dispose }
  1799.     @sub_cursor = []
  1800.   end
  1801.   #--------------------------------------------------------------------------
  1802.   # ● サブカーソル更新
  1803.   #--------------------------------------------------------------------------  
  1804.   def update_subcursor
  1805.     @sub_cursor.each {|sprite| sprite.update }
  1806.   end
  1807.   #--------------------------------------------------------------------------
  1808.   # ● ビットマップの設定
  1809.   #--------------------------------------------------------------------------
  1810.   def cursor_bitmap
  1811.     if !LNX11::CURSOR_NAME.empty?
  1812.       return Cache.system(LNX11::CURSOR_NAME)
  1813.     else
  1814.       # カーソルファイル名が指定されていなければRGSS側で生成
  1815.       return @@cursor_cache if @@cursor_cache && !@@cursor_cache.disposed?
  1816.       @@cursor_cache = Bitmap.new(32, 32)
  1817.       color = Color.new(0, 0, 0)
  1818.       @@cursor_cache.lnx_cursor_triangle(26, color, 2)
  1819.       2.times {@@cursor_cache.blur}
  1820.       color.set(255, 255, 255)
  1821.       @@cursor_cache.lnx_cursor_triangle(24, color, 1, 0.5)
  1822.       tone = LNX11::CURSOR_TONE ? LNX11::CURSOR_TONE : $game_system.window_tone
  1823.       r = 118 + tone.red
  1824.       g = 118 + tone.green
  1825.       b = 118 + tone.blue
  1826.       color.set(r, g, b, 232)
  1827.       @@cursor_cache.lnx_cursor_triangle(20, color,  0)
  1828.       @@cursor_cache.lnx_cursor_triangle(20, color,  1)
  1829.       p "LNX11a:カーソルビットマップを作成しました。"
  1830.       return @@cursor_cache
  1831.     end
  1832.   end
  1833.   #--------------------------------------------------------------------------
  1834.   # ● カーソルの表示
  1835.   #--------------------------------------------------------------------------
  1836.   def show
  1837.     self.x = @rx = @tx
  1838.     self.y = @ry = @ty
  1839.     self.visible = true
  1840.   end
  1841.   #--------------------------------------------------------------------------
  1842.   # ● カーソルの非表示
  1843.   #--------------------------------------------------------------------------
  1844.   def hide
  1845.     dispose_subcursor
  1846.     @battler = nil
  1847.     self.visible = false
  1848.   end
  1849.   #--------------------------------------------------------------------------
  1850.   # ● 移動平均
  1851.   #--------------------------------------------------------------------------
  1852.   def sma(a, b, p)
  1853.     # a = 目標位置 b = 現在地
  1854.     return a if a == b || (a - b).abs < 0.3 || p == 1
  1855.     result = ((a + b * (p.to_f - 1)) / p.to_f)
  1856.     return (a - result).abs <= 1.0 ? (b < a ? b + 0.3 : b - 0.3) : result
  1857.   end
  1858.   #--------------------------------------------------------------------------
  1859.   # ● フレーム更新
  1860.   #--------------------------------------------------------------------------
  1861.   def update
  1862.     update_subcursor
  1863.     self.opacity = @sub_cursor.empty? ? 255 : 0
  1864.     return if !visible || !@sub_cursor.empty?
  1865.     super
  1866.     # 点滅
  1867.     if LNX11::CURSOR_BLINK
  1868.       self.blend_type = @blink && Graphics.frame_count / 3 % 2 == 0 ? 1 : 0
  1869.     end
  1870.     # アニメーションを進める
  1871.     @wait -= 1
  1872.     if @wait <= 0
  1873.       @wait += LNX11::CURSOR_ANI_SPEED
  1874.       self.src_rect.x += self.width
  1875.       self.src_rect.x = 0 if self.src_rect.x >= self.bitmap.width
  1876.     end
  1877.     # カーソルの座標を更新
  1878.     set_xy if @battler && @sub_cursor.empty?
  1879.     self.x = @rx = sma(@tx, @rx, @speed)
  1880.     self.y = @ry = sma(@ty, @ry, @speed)
  1881.   end
  1882.   #--------------------------------------------------------------------------
  1883.   # ● カーソル位置の設定
  1884.   #--------------------------------------------------------------------------
  1885.   def set(*args)
  1886.     if args[0].is_a?(Numeric)
  1887.       # 引数一つ目が数値なら、XY指定
  1888.       @battler = nil
  1889.       set_xy(args[0], args[1])
  1890.       @blink = args[2] ? args[2] : false
  1891.     else
  1892.       # バトラーorシンボル指定
  1893.       if @battler != args[0]
  1894.         @battler = args[0]
  1895.         dispose_subcursor
  1896.         case args[0]
  1897.         when :party        ; create_subcursor($game_party.members)
  1898.         when :troop        ; create_subcursor($game_troop.alive_members)
  1899.         when :troop_random ; create_subcursor($game_troop.alive_members)
  1900.         else ; args[0] ? set_xy : hide
  1901.         end
  1902.       end
  1903.       @blink = args[1] ? args[1] : false
  1904.     end
  1905.     # スピードが1かカーソルが非表示なら表示に変える
  1906.     show if @sub_cursor.empty? && (@speed == 1 || !visible)
  1907.   end
  1908.   #--------------------------------------------------------------------------
  1909.   # ● カーソル位置をバトラーの位置に設定
  1910.   #--------------------------------------------------------------------------
  1911.   def set_xy(x = nil, y = nil)
  1912.     if x
  1913.       # 直接指定
  1914.       x += LNX11::CURSOR_OFFSET[:x]
  1915.       y += LNX11::CURSOR_OFFSET[:y]
  1916.     else
  1917.       # バトラーの座標
  1918.       x = @battler.screen_x + LNX11::CURSOR_OFFSET[:x]
  1919.       y = @battler.screen_y_top + LNX11::CURSOR_OFFSET[:y]
  1920.     end
  1921.     @tx = x
  1922.     minmax = LNX11::CURSOR_MINMAX
  1923.     @ty = [[y, minmax[:min] + self.oy].max, minmax[:max]].min
  1924.   end
  1925. end
  1926.  
  1927. #==============================================================================
  1928. # ■ [追加]:Sprite_OneLine_BattleLog
  1929. #------------------------------------------------------------------------------
  1930. #  バトルログを動的に表示するスプライトです。単体では1行しか表示できませんが、
  1931. # 複数同時に扱うことで複数行の表示を実装しています。
  1932. #==============================================================================
  1933.  
  1934. class Sprite_OneLine_BattleLog < Sprite
  1935.   @@grad_cache = nil
  1936.   #--------------------------------------------------------------------------
  1937.   # ● 公開インスタンス変数
  1938.   #--------------------------------------------------------------------------
  1939.   attr_accessor   :position # 表示位置(行)
  1940.   #--------------------------------------------------------------------------
  1941.   # ● オブジェクト初期化
  1942.   #--------------------------------------------------------------------------
  1943.   def initialize(width, height, max_line_number)
  1944.     super(nil)
  1945.     @rx = @ry = 0
  1946.     @line_height = height
  1947.     @max_line_number = max_line_number
  1948.     @position = -1
  1949.     @visible = true
  1950.     self.ox = -LNX11::STORAGE_OFFSET[:x]
  1951.     self.oy = -LNX11::STORAGE_OFFSET[:y]
  1952.     self.opacity = 0
  1953.     self.z = 96
  1954.     self.bitmap = Bitmap.new(width * 0.75, height)
  1955.   end
  1956.   #--------------------------------------------------------------------------
  1957.   # ● 解放
  1958.   #--------------------------------------------------------------------------  
  1959.   def dispose
  1960.     self.bitmap.dispose
  1961.     super
  1962.   end
  1963.   #--------------------------------------------------------------------------
  1964.   # ● スプライトの表示
  1965.   #--------------------------------------------------------------------------  
  1966.   def show
  1967.     @visible = true
  1968.   end
  1969.   #--------------------------------------------------------------------------
  1970.   # ● スプライトの非表示
  1971.   #--------------------------------------------------------------------------  
  1972.   def hide
  1973.     @visible = false
  1974.     @position = -1
  1975.   end
  1976.   #--------------------------------------------------------------------------
  1977.   # ● 表示しているか?
  1978.   #--------------------------------------------------------------------------  
  1979.   def visible?
  1980.     @visible
  1981.   end
  1982.   #--------------------------------------------------------------------------
  1983.   # ● フレーム更新
  1984.   #--------------------------------------------------------------------------
  1985.   def update
  1986.     return if self.opacity == 0
  1987.     self.opacity += @visible && @position >= 0 ? 24 : -24
  1988.     self.visible = self.opacity > 0
  1989.     return unless @visible # 不可視状態なら座標を更新しない
  1990.     @ry = (target_y + (@ry * 5)) / 6.0 if target_y < @ry
  1991.     @rx += 2 if @rx < 0
  1992.     self.x = @rx
  1993.     self.y = @ry
  1994.   end
  1995.   #--------------------------------------------------------------------------
  1996.   # ● テキストの描画
  1997.   #  自身が持つ Bitmap で描画するのではなく、Window の contents から
  1998.   # コピーします(Sprite からでは Window_Base#draw_text_ex が扱えないため)。
  1999.   #--------------------------------------------------------------------------
  2000.   def set_text(window, position)
  2001.     self.bitmap.clear
  2002.     # 横グラデーション
  2003.     if @@grad_cache && !@@grad_cache.disposed?
  2004.       self.bitmap.blt(0, 0, @@grad_cache, self.bitmap.rect)
  2005.     else
  2006.       color = LNX11::STORAGE_GRADIENT_COLOR
  2007.       fillrect = self.bitmap.rect
  2008.       fillrect.width /= 2
  2009.       self.bitmap.gradient_fill_rect(fillrect, color[0], color[1])
  2010.       @@grad_cache = self.bitmap.clone
  2011.     end
  2012.     # contents からコピー
  2013.     self.bitmap.blt(4, 0, window.contents, self.bitmap.rect)
  2014.     self.opacity = 1
  2015.     @rx = -8
  2016.     @position = position
  2017.     @ry = target_y
  2018.   end
  2019.   #--------------------------------------------------------------------------
  2020.   # ● 位置の繰り上げ
  2021.   #--------------------------------------------------------------------------
  2022.   def up_position
  2023.     @position -= 1
  2024.   end
  2025.   #--------------------------------------------------------------------------
  2026.   # ● メッセージが空か?(表示待ち)
  2027.   #--------------------------------------------------------------------------
  2028.   def mes_empty?
  2029.     @position < 0
  2030.   end
  2031.   #--------------------------------------------------------------------------
  2032.   # ● 移動するべき Y 座標
  2033.   #--------------------------------------------------------------------------
  2034.   def target_y
  2035.     @position * @line_height
  2036.   end
  2037. end
  2038.  
  2039. #==============================================================================
  2040. # ■ Window_BattleLog
  2041. #------------------------------------------------------------------------------
  2042. #  戦闘の進行を実況表示するウィンドウです。
  2043. #==============================================================================
  2044.  
  2045. class Window_BattleLog < Window_Selectable
  2046.   #--------------------------------------------------------------------------
  2047.   # ● [エイリアス]:オブジェクト初期化
  2048.   #--------------------------------------------------------------------------
  2049.   alias :lnx11a_initialize :initialize
  2050.   def initialize
  2051.     lnx11a_initialize
  2052.     # バトルログタイプが 1 以上なら非表示にする
  2053.     @storage_number = 0
  2054.     hide if LNX11::BATTLELOG_TYPE >= 1
  2055.     BattleManager.log_window = self
  2056.   end
  2057.   #--------------------------------------------------------------------------
  2058.   # ● [追加]:文章の配列のクリア
  2059.   #--------------------------------------------------------------------------
  2060.   def lines_clear
  2061.     @lines.clear if LNX11::BATTLELOG_TYPE == 1
  2062.   end
  2063.   #--------------------------------------------------------------------------
  2064.   # ● [追加]:指定ウェイト
  2065.   #--------------------------------------------------------------------------
  2066.   def abs_wait(wait)
  2067.     @method_wait.call(wait) if @method_wait
  2068.   end
  2069.   #--------------------------------------------------------------------------
  2070.   # ● [再定義]:メッセージ速度の取得
  2071.   #--------------------------------------------------------------------------
  2072.   def message_speed
  2073.     return 20
  2074.   end
  2075.   #--------------------------------------------------------------------------
  2076.   # ● [再定義]:エフェクト実行が終わるまでウェイト
  2077.   #--------------------------------------------------------------------------
  2078.   def wait_for_effect
  2079.     return if LNX11::BATTLELOG_TYPE > 0
  2080.     @method_wait_for_effect.call if @method_wait_for_effect
  2081.   end
  2082.   #--------------------------------------------------------------------------
  2083.   # ● [追加]:アニメーションのウェイト用メソッドの設定
  2084.   #--------------------------------------------------------------------------
  2085.   def method_wait_for_animation=(method)
  2086.     @method_wait_for_animation = method
  2087.   end
  2088.   #--------------------------------------------------------------------------
  2089.   # ● [追加]:アニメーション再生が終わるまでウェイト
  2090.   #--------------------------------------------------------------------------
  2091.   def wait_for_animation
  2092.     @method_wait_for_animation.call if @method_wait_for_animation
  2093.   end
  2094.  
  2095.   #--------------------------------------------------------------------------
  2096.   # ● [エイリアス]:ウィンドウ高さの取得
  2097.   #--------------------------------------------------------------------------
  2098.   alias :lnx11a_window_height :window_height
  2099.   def window_height
  2100.     LNX11::BATTLELOG_TYPE == 1 ? fitting_height(1) : lnx11a_window_height
  2101.   end
  2102.   #--------------------------------------------------------------------------
  2103.   # ● [エイリアス]:最大行数の取得
  2104.   #--------------------------------------------------------------------------
  2105.   alias :lnx11a_max_line_number :max_line_number
  2106.   def max_line_number
  2107.     num = LNX11::STORAGE_LINE_NUMBER
  2108.     LNX11::BATTLELOG_TYPE == 1 ? num : lnx11a_max_line_number
  2109.   end
  2110.   #--------------------------------------------------------------------------
  2111.   # ● [オーバーライド]:行の高さを取得
  2112.   #--------------------------------------------------------------------------
  2113.   def line_height
  2114.     LNX11::BATTLELOG_TYPE == 1 ? LNX11::STORAGE_LINE_HEIGHT : super
  2115.   end
  2116.   #--------------------------------------------------------------------------
  2117.   # ● [オーバーライド]:フォント設定のリセット
  2118.   #--------------------------------------------------------------------------
  2119.   def reset_font_settings
  2120.     super
  2121.     return unless LNX11::BATTLELOG_TYPE == 1
  2122.     contents.font.size = LNX11::STORAGE_FONT[:size]
  2123.     contents.font.out_color.set(LNX11::STORAGE_FONT[:out_color])
  2124.   end
  2125.   #--------------------------------------------------------------------------
  2126.   # ● [エイリアス]:データ行数の取得
  2127.   #--------------------------------------------------------------------------
  2128.   alias :lnx11a_line_number :line_number
  2129.   def line_number
  2130.     return 0 if LNX11::BATTLELOG_TYPE == 2
  2131.     LNX11::BATTLELOG_TYPE == 1 ? @storage_number : lnx11a_line_number
  2132.   end
  2133.   #--------------------------------------------------------------------------
  2134.   # ● [再定義]:背景スプライトの作成
  2135.   #--------------------------------------------------------------------------
  2136.   alias :lnx11a_create_back_sprite :create_back_sprite
  2137.   def create_back_sprite
  2138.     if LNX11::BATTLELOG_TYPE == 1
  2139.       # 蓄積型
  2140.       create_message_sprite
  2141.     else
  2142.       # 背景
  2143.       lnx11a_create_back_sprite
  2144.     end
  2145.   end
  2146.   #--------------------------------------------------------------------------
  2147.   # ● [再定義]:背景スプライトの解放
  2148.   #--------------------------------------------------------------------------
  2149.   alias :lnx11a_dispose_back_sprite :dispose_back_sprite
  2150.   def dispose_back_sprite
  2151.     if LNX11::BATTLELOG_TYPE == 1
  2152.       # 蓄積型
  2153.       dispose_message_sprite
  2154.     else
  2155.       # 背景
  2156.       lnx11a_dispose_back_sprite
  2157.     end
  2158.   end
  2159.   #--------------------------------------------------------------------------
  2160.   # ● [追加]:メッセージスプライトの作成
  2161.   #--------------------------------------------------------------------------
  2162.   def create_message_sprite
  2163.     # メッセージスプライト 行数分だけ作成する
  2164.     @mes_position = 0 # 次にメッセージを表示させる位置
  2165.     @mesup_count = LNX11::STORAGE_UP_MESSAGE_TIME # ログが進行するまでの時間
  2166.     @mes_sprites = Array.new(max_line_number + 1) {
  2167.     Sprite_OneLine_BattleLog.new(self.width, line_height, max_line_number)}
  2168.   end
  2169.   #--------------------------------------------------------------------------
  2170.   # ● [追加]:メッセージスプライトの解放
  2171.   #--------------------------------------------------------------------------
  2172.   def dispose_message_sprite
  2173.     @mes_sprites.each {|sprite| sprite.dispose }
  2174.   end
  2175.   #--------------------------------------------------------------------------
  2176.   # ● [追加]:メッセージスプライトを表示
  2177.   #--------------------------------------------------------------------------
  2178.   def show_message_sprite
  2179.     @mes_sprites.each {|sprite| sprite.show }
  2180.   end
  2181.   #--------------------------------------------------------------------------
  2182.   # ● [追加]:メッセージスプライトを非表示
  2183.   #--------------------------------------------------------------------------
  2184.   def hide_message_sprite
  2185.     @mes_sprites.each {|sprite| sprite.hide }
  2186.     @mes_position = 0
  2187.   end
  2188.   #--------------------------------------------------------------------------
  2189.   # ● [追加]:メッセージスプライトを一つ進める
  2190.   #--------------------------------------------------------------------------
  2191.   def up_message_sprite
  2192.     @mes_sprites.each {|sprite| sprite.up_position }
  2193.   end
  2194.   #--------------------------------------------------------------------------
  2195.   # ● [追加]:空のメッセージスプライトを返す
  2196.   #--------------------------------------------------------------------------
  2197.   def empty_message_sprite
  2198.     @mes_sprites.each {|sprite| return sprite if sprite.mes_empty? }
  2199.     @mes_sprites[0]
  2200.   end
  2201.   #--------------------------------------------------------------------------
  2202.   # ● [追加]:メッセージスプライトの更新
  2203.   #--------------------------------------------------------------------------
  2204.   def update_message_sprite
  2205.     # バトルログ消去フラグが有効
  2206.     if $game_temp.battlelog_clear
  2207.       $game_temp.battlelog_clear = false
  2208.       # スプライトが表示されていれば非表示にする
  2209.       if @mes_sprites[0].visible?
  2210.         hide_message_sprite
  2211.         lines_clear
  2212.       end
  2213.     end
  2214.     # ログの自動進行
  2215.     @mesup_count -= 1
  2216.     if @mesup_count <= 0 && @mes_position > 0
  2217.       up_message_sprite
  2218.       @mes_position -= 1
  2219.       @mesup_count = LNX11::STORAGE_UP_MESSAGE_TIME
  2220.     end
  2221.     @mes_sprites.each {|sprite| sprite.update }
  2222.   end
  2223.   #--------------------------------------------------------------------------
  2224.   # ● [追加]:メッセージスプライトのリフレッシュ
  2225.   #--------------------------------------------------------------------------
  2226.   def refresh_message_sprite
  2227.     # 文章が無ければ何もしない
  2228.     return if @lines.empty?
  2229.     # スプライトを表示する
  2230.     show_message_sprite unless @mes_sprites[0].visible?
  2231.     # 文章の描画
  2232.     contents.clear
  2233.     @lines[0] = last_text
  2234.     return if @lines[0].empty?
  2235.     draw_line(0)
  2236.     @storage_number += 1
  2237.     # ウィンドウの内容をスプライトにコピー
  2238.     empty_message_sprite.set_text(self, @mes_position)
  2239.     # スプライト位置の変動   
  2240.     if @mes_position < max_line_number
  2241.       @mes_position += 1
  2242.     elsif @mesup_count > 0
  2243.       up_message_sprite
  2244.     end
  2245.     @mesup_count = (LNX11::STORAGE_UP_MESSAGE_TIME * 1.5).truncate
  2246.   end  
  2247.   #--------------------------------------------------------------------------
  2248.   # ● [オーバーライド]:フレーム更新
  2249.   #--------------------------------------------------------------------------
  2250.   def update
  2251.     super
  2252.     update_message_sprite if LNX11::BATTLELOG_TYPE == 1
  2253.   end
  2254.   #--------------------------------------------------------------------------
  2255.   # ● [エイリアス]:リフレッシュ
  2256.   #--------------------------------------------------------------------------
  2257.   alias :lnx11a_refresh :refresh
  2258.   def refresh
  2259.     return if LNX11::BATTLELOG_TYPE == 2
  2260.     LNX11::BATTLELOG_TYPE == 1 ? refresh_message_sprite : lnx11a_refresh
  2261.   end
  2262.   #--------------------------------------------------------------------------
  2263.   # ● [エイリアス]:クリア
  2264.   #--------------------------------------------------------------------------
  2265.   alias :lnx11a_clear :clear
  2266.   def clear
  2267.     return if LNX11::BATTLELOG_TYPE == 2
  2268.     LNX11::BATTLELOG_TYPE == 1 ? @storage_number = 0 : lnx11a_clear
  2269.   end
  2270.   #--------------------------------------------------------------------------
  2271.   # ● [エイリアス]:一行戻る
  2272.   #--------------------------------------------------------------------------
  2273.   alias :lnx11a_back_one :back_one
  2274.   def back_one
  2275.     if LNX11::BATTLELOG_TYPE == 1
  2276.       # 蓄積型
  2277.       @storage_number = [@storage_number - 1, 0].max
  2278.     else
  2279.       # 通常
  2280.       lnx11a_back_one
  2281.     end
  2282.   end
  2283.   #--------------------------------------------------------------------------
  2284.   # ● [エイリアス]:指定した行に戻る
  2285.   #--------------------------------------------------------------------------
  2286.   alias :lnx11a_back_to :back_to
  2287.   def back_to(line_number)
  2288.     if LNX11::BATTLELOG_TYPE == 1
  2289.       # 蓄積型
  2290.       @storage_number -= 1 while @storage_number > line_number
  2291.     else
  2292.       # 通常
  2293.       lnx11a_back_to(line_number)
  2294.     end
  2295.   end
  2296.   #--------------------------------------------------------------------------
  2297.   # ● [エイリアス]:ウェイト
  2298.   #--------------------------------------------------------------------------
  2299.   alias :lnx11a_wait :wait
  2300.   def wait
  2301.     return if LNX11::BATTLELOG_TYPE == 2
  2302.     # 元のメソッドを呼ぶ
  2303.     lnx11a_wait
  2304.   end
  2305.   #--------------------------------------------------------------------------
  2306.   # ● [エイリアス]:スキル/アイテム使用の表示
  2307.   #  使用時アニメーションの処理を追加します。
  2308.   #--------------------------------------------------------------------------
  2309.   alias :lnx11a_display_use_item :display_use_item
  2310.   def display_use_item(subject, item)
  2311.     if item.use_animation > 0
  2312.       # 使用時アニメーションが設定されていれば再生
  2313.       subject.animation_id = item.use_animation
  2314.       subject.animation_mirror = false
  2315.     end
  2316.     # 元のメソッドを呼ぶ
  2317.     lnx11a_display_use_item(subject, item)
  2318.     # アニメーションのウェイト
  2319.     wait_for_animation if item.use_animation > 0
  2320.   end
  2321.   #--------------------------------------------------------------------------
  2322.   # ● [追加]:ポップアップデータの取得
  2323.   #--------------------------------------------------------------------------
  2324.   def popup_data
  2325.     $game_temp.popup_data
  2326.   end
  2327.   #--------------------------------------------------------------------------
  2328.   # ● [エイリアス]:反撃の表示
  2329.   #--------------------------------------------------------------------------
  2330.   alias :lnx11a_display_counter :display_counter
  2331.   def display_counter(target, item)
  2332.     # ポップアップ
  2333.     popup_data.popup_text(target, :counter)
  2334.     # 元のメソッドを呼ぶ
  2335.     lnx11a_display_counter(target, item)
  2336.     # ポップアップウェイト
  2337.     popup_data.add_wait
  2338.   end
  2339.   #--------------------------------------------------------------------------
  2340.   # ● [エイリアス]:反射の表示
  2341.   #--------------------------------------------------------------------------
  2342.   alias :lnx11a_display_reflection :display_reflection
  2343.   def display_reflection(target, item)
  2344.     # ポップアップ
  2345.     popup_data.popup_text(target, :reflection)
  2346.     # 元のメソッドを呼ぶ
  2347.     lnx11a_display_reflection(target, item)
  2348.     # ポップアップウェイト
  2349.     popup_data.add_wait
  2350.   end
  2351.   #--------------------------------------------------------------------------
  2352.   # ● [エイリアス]:身代わりの表示
  2353.   #--------------------------------------------------------------------------
  2354.   alias :lnx11a_display_substitute :display_substitute
  2355.   def display_substitute(substitute, target)
  2356.     # ポップアップ
  2357.     popup_data.popup_text(substitute, :substitute)
  2358.     # 元のメソッドを呼ぶ
  2359.     lnx11a_display_substitute(substitute, target)
  2360.     # ポップアップウェイト
  2361.     popup_data.add_wait
  2362.   end
  2363.   #--------------------------------------------------------------------------
  2364.   # ● [エイリアス]:失敗の表示
  2365.   #--------------------------------------------------------------------------
  2366.   alias :lnx11a_display_failure :display_failure
  2367.   def display_failure(target, item)
  2368.     if target.result.hit? && !target.result.success
  2369.       # ポップアップ (ミスと同じ扱いにする)
  2370.       popup_data.popup_miss(target, item)
  2371.     end
  2372.     # 元のメソッドを呼ぶ
  2373.     lnx11a_display_failure(target, item)
  2374.     # ポップアップウェイト
  2375.     popup_data.add_wait
  2376.   end
  2377.   #--------------------------------------------------------------------------
  2378.   # ● [エイリアス]:ミスの表示
  2379.   #--------------------------------------------------------------------------
  2380.   alias :lnx11a_display_miss :display_miss
  2381.   def display_miss(target, item)
  2382.     # ポップアップ
  2383.     popup_data.popup_miss(target, item)
  2384.     # 元のメソッドを呼ぶ   
  2385.     lnx11a_display_miss(target, item)
  2386.     # ポップアップウェイト
  2387.     popup_data.add_wait
  2388.   end
  2389.   #--------------------------------------------------------------------------
  2390.   # ● [エイリアス]:回避の表示
  2391.   #--------------------------------------------------------------------------
  2392.   alias :lnx11a_display_evasion :display_evasion
  2393.   def display_evasion(target, item)
  2394.     # ポップアップ (ミスと同じ扱いにする)
  2395.     popup_data.popup_miss(target, item)
  2396.     # 元のメソッドを呼ぶ   
  2397.     lnx11a_display_evasion(target, item)
  2398.     # ポップアップウェイト
  2399.     popup_data.add_wait
  2400.   end
  2401.   #--------------------------------------------------------------------------
  2402.   # ● [エイリアス]:HP ダメージ表示
  2403.   #--------------------------------------------------------------------------
  2404.   alias :lnx11a_display_hp_damage :display_hp_damage
  2405.   def display_hp_damage(target, item)
  2406.     # ポップアップ
  2407.     popup_data.popup_hp_damage(target, item)
  2408.     # 元のメソッドを呼ぶ
  2409.     lnx11a_display_hp_damage(target, item)
  2410.     # ポップアップウェイト
  2411.     popup_data.add_wait
  2412.   end
  2413.   #--------------------------------------------------------------------------
  2414.   # ● [エイリアス]:MP ダメージ表示
  2415.   #--------------------------------------------------------------------------
  2416.   alias :lnx11a_display_mp_damage :display_mp_damage
  2417.   def display_mp_damage(target, item)
  2418.     # ポップアップ
  2419.     popup_data.popup_mp_damage(target, item)
  2420.     # 元のメソッドを呼ぶ
  2421.     lnx11a_display_mp_damage(target, item)
  2422.     # ポップアップウェイト
  2423.     popup_data.add_wait
  2424.   end
  2425.   #--------------------------------------------------------------------------
  2426.   # ● [エイリアス]:TP ダメージ表示
  2427.   #--------------------------------------------------------------------------
  2428.   alias :lnx11a_display_tp_damage :display_tp_damage
  2429.   def display_tp_damage(target, item)
  2430.     # ポップアップ
  2431.     popup_data.popup_tp_damage(target, item)
  2432.     # 元のメソッドを呼ぶ
  2433.     lnx11a_display_tp_damage(target, item)
  2434.     # ポップアップウェイト
  2435.     popup_data.add_wait
  2436.   end
  2437.   #--------------------------------------------------------------------------
  2438.   # ● [エイリアス]:ステート付加の表示
  2439.   #--------------------------------------------------------------------------
  2440.   alias :lnx11a_display_added_states :display_added_states
  2441.   def display_added_states(target)
  2442.     # ポップアップ
  2443.     popup_data.popup_added_states(target)
  2444.     # 元のメソッドを呼ぶ
  2445.     lnx11a_display_added_states(target)
  2446.   end
  2447.   #--------------------------------------------------------------------------
  2448.   # ● [エイリアス]:ステート解除の表示
  2449.   #--------------------------------------------------------------------------
  2450.   alias :lnx11a_display_removed_states :display_removed_states
  2451.   def display_removed_states(target)
  2452.     # ポップアップ
  2453.     popup_data.popup_removed_states(target)
  2454.     # 元のメソッドを呼ぶ
  2455.     lnx11a_display_removed_states(target)
  2456.   end
  2457.   #--------------------------------------------------------------------------
  2458.   # ● [エイリアス]:能力強化/弱体の表示(個別)
  2459.   #--------------------------------------------------------------------------
  2460.   alias :lnx11a_display_buffs :display_buffs
  2461.   def display_buffs(target, buffs, fmt)
  2462.     # ポップアップ
  2463.     popup_data.popup_buffs(target, buffs, fmt)
  2464.     # 元のメソッドを呼ぶ
  2465.     lnx11a_display_buffs(target, buffs, fmt)
  2466.   end
  2467. end
  2468.  
  2469. #==============================================================================
  2470. # ■ RPG::BaseItem
  2471. #------------------------------------------------------------------------------
  2472. #  アクター、職業、スキル、アイテム、武器、防具、敵キャラ、およびステートの
  2473. # スーパークラス。
  2474. #==============================================================================
  2475.  
  2476. class RPG::BaseItem  
  2477.   #--------------------------------------------------------------------------
  2478.   # ● [追加]:バトラーグラフィックファイル名を取得
  2479.   #--------------------------------------------------------------------------
  2480.   def default_battler_graphic
  2481.     # キャッシュがある場合、それを返す
  2482.     return @default_battler_graphic if @default_battler_graphic
  2483.     # メモ取得
  2484.     re = LNX11::RE_BATTLER =~ note
  2485.     @default_battler_graphic = re ? $1 : ""
  2486.   end
  2487.   #--------------------------------------------------------------------------
  2488.   # ● [追加]:敵キャラの通常攻撃アニメの取得
  2489.   #--------------------------------------------------------------------------
  2490.   def atk_animation
  2491.     # キャッシュがある場合、それを返す
  2492.     return @atk_animation if @atk_animation
  2493.     # メモ取得
  2494.     re = LNX11::RE_ATK_ANIMATION =~ note
  2495.     @atk_animation = re ? $1.to_i : 1
  2496.   end
  2497. end
  2498.  
  2499. #==============================================================================
  2500. # ■ RPG::UsableItem
  2501. #------------------------------------------------------------------------------
  2502. #  スキルとアイテムのスーパークラス。
  2503. #==============================================================================
  2504. class RPG::UsableItem < RPG::BaseItem
  2505.   #--------------------------------------------------------------------------
  2506.   # ● [エイリアス]:対象の選択操作が必要か否かを取得
  2507.   #--------------------------------------------------------------------------
  2508.   alias :lnx11a_need_selection? :need_selection?
  2509.   def need_selection?
  2510.     LNX11::FIX_TARGET_CHECKE && scope > 0 ? true : lnx11a_need_selection?
  2511.   end
  2512.   #--------------------------------------------------------------------------
  2513.   # ● [追加]:使用時アニメの取得
  2514.   #--------------------------------------------------------------------------
  2515.   def use_animation
  2516.     # キャッシュがある場合、それを返す
  2517.     return @use_animation if @use_animation
  2518.     # メモ取得
  2519.     re = LNX11::RE_USE_ANIMATION =~ note
  2520.     @use_animation = re ? $1.to_i : 0
  2521.   end
  2522.   #--------------------------------------------------------------------------
  2523.   # ● [追加]:簡易ヘルプ非表示の取得
  2524.   #--------------------------------------------------------------------------
  2525.   def no_display
  2526.     # キャッシュがある場合、それを返す
  2527.     return @no_display if @no_display
  2528.     # メモ取得
  2529.     re = LNX11::RE_USABLEITEM_NO_DISPLAY =~ note
  2530.     @no_display = re ? true : false
  2531.   end
  2532.   #--------------------------------------------------------------------------
  2533.   # ● [追加]:使用時追加ウェイトの取得
  2534.   #--------------------------------------------------------------------------
  2535.   def display_wait
  2536.     # キャッシュがある場合、それを返す
  2537.     return @display_wait if @display_wait
  2538.     # メモ取得
  2539.     re = LNX11::RE_DISPLAY_WAIT =~ note
  2540.     @display_wait = re ? $1.to_i : LNX11::HELPDISPLAT_WAIT
  2541.   end
  2542.   #--------------------------------------------------------------------------
  2543.   # ● [追加]:終了時追加ウェイトの取得
  2544.   #--------------------------------------------------------------------------
  2545.   def end_wait
  2546.     # キャッシュがある場合、それを返す
  2547.     return @end_wait if @end_wait
  2548.     # メモ取得
  2549.     re = LNX11::RE_END_WAIT =~ note
  2550.     @end_wait = re ? $1.to_i : LNX11::HELPDISPLAT_END_WAIT
  2551.   end
  2552.   #--------------------------------------------------------------------------
  2553.   # ● [追加]:簡易ヘルプ説明を取得
  2554.   #--------------------------------------------------------------------------
  2555.   def short_description
  2556.     # キャッシュがある場合、それを返す
  2557.     return @short_description if @short_description
  2558.     # メモ取得
  2559.     re = LNX11::RE_SHORT_DESCRIPTION =~ note
  2560.     @short_description = re ? $1 : ""
  2561.   end
  2562. end
  2563.  
  2564. #==============================================================================
  2565. # ■ RPG::State
  2566. #------------------------------------------------------------------------------
  2567. #  ステートのデータクラス。
  2568. #==============================================================================
  2569.  
  2570. class RPG::State < RPG::BaseItem
  2571.   #--------------------------------------------------------------------------
  2572.   # ● [追加]:ステートアニメの取得
  2573.   #--------------------------------------------------------------------------
  2574.   def state_animation
  2575.     # キャッシュがある場合、それを返す
  2576.     return @state_animation if @state_animation
  2577.     # メモ取得
  2578.     re = LNX11::RE_STATE_ANIMATION =~ note
  2579.     @state_animation = re ? $1.to_i : 0
  2580.   end
  2581.   #--------------------------------------------------------------------------
  2582.   # ● [追加]:ポップアップ表示名の取得
  2583.   # <<ver1.10>>
  2584.   #  このメソッドは付加/解除ポップアップ表示名が設定されていない場合のみ
  2585.   # 呼び出されるようになりました。
  2586.   #--------------------------------------------------------------------------
  2587.   def display_name
  2588.     # キャッシュがある場合、それを返す
  2589.     return @display_name if @display_name
  2590.     # メモ取得
  2591.     re = LNX11::RE_STATE_DISPLAY =~ note
  2592.     @display_name = re ? $1 : name
  2593.   end
  2594.   #--------------------------------------------------------------------------
  2595.   # ● [追加]:付加ポップアップ表示名の取得 <<ver1.10>>
  2596.   #--------------------------------------------------------------------------
  2597.   def add_display_name
  2598.     # キャッシュがある場合、それを返す
  2599.     return @add_display_name if @add_display_name
  2600.     # メモ取得
  2601.     re = LNX11::RE_STATE_ADD_DISPLAY =~ note
  2602.     @add_display_name = re ? $1 : display_name
  2603.   end
  2604.   #--------------------------------------------------------------------------
  2605.   # ● [追加]:解除ポップアップ表示名の取得 <<ver1.10>>
  2606.   #--------------------------------------------------------------------------
  2607.   def remove_display_name
  2608.     # キャッシュがある場合、それを返す
  2609.     return @remove_display_name if @remove_display_name
  2610.     # メモ取得
  2611.     re = LNX11::RE_STATE_REM_DISPLAY =~ note
  2612.     @remove_display_name = re ? $1 : display_name
  2613.   end
  2614.   #--------------------------------------------------------------------------
  2615.   # ● [追加]:ポップアップ非表示の取得
  2616.   #--------------------------------------------------------------------------
  2617.   def no_display?
  2618.     # キャッシュがある場合、それを返す
  2619.     return @no_display if @no_display
  2620.     # 付加/解除のどちらかで設定されていれば無視する
  2621.     if LNX11::RE_STATE_ADD_NO_DISPLAY =~ note ||
  2622.        LNX11::RE_STATE_REM_NO_DISPLAY =~ note
  2623.       return @no_display = false
  2624.     end
  2625.     # メモ取得
  2626.     re = LNX11::RE_STATE_NO_DISPLAY =~ note
  2627.     @no_display = re ? true : false
  2628.   end
  2629.   #--------------------------------------------------------------------------
  2630.   # ● [追加]:付加ポップアップ非表示の取得
  2631.   #--------------------------------------------------------------------------
  2632.   def add_no_display?
  2633.     return true if no_display?
  2634.     # キャッシュがある場合、それを返す
  2635.     return @add_no_display if @add_no_display
  2636.     # メモ取得
  2637.     re = LNX11::RE_STATE_ADD_NO_DISPLAY =~ note
  2638.     @add_no_display = re ? true : false
  2639.   end
  2640.   #--------------------------------------------------------------------------
  2641.   # ● [追加]:解除ポップアップ非表示の取得
  2642.   #--------------------------------------------------------------------------
  2643.   def remove_no_display?
  2644.     return true if no_display?
  2645.     # キャッシュがある場合、それを返す
  2646.     return @remove_no_display if @remove_no_display
  2647.     # メモ取得
  2648.     re = LNX11::RE_STATE_REM_NO_DISPLAY =~ note
  2649.     @remove_no_display = re ? true : false
  2650.   end
  2651.   #--------------------------------------------------------------------------
  2652.   # ● [追加]:有利なステートの取得
  2653.   #--------------------------------------------------------------------------
  2654.   def advantage?
  2655.     # キャッシュがある場合、それを返す
  2656.     return @advantage if @advantage
  2657.     # メモ取得
  2658.     re = LNX11::RE_STATE_ADVANTAGE =~ note
  2659.     @advantage = re ? true : false
  2660.   end
  2661.   #--------------------------------------------------------------------------
  2662.   # ● [追加]:ポップアップタイプの取得
  2663.   #--------------------------------------------------------------------------
  2664.   def popup_type
  2665.     # キャッシュがある場合、それを返す
  2666.     return @popup_type if @popup_type != nil
  2667.     # 付加/解除のどちらかで設定されていれば無視する
  2668.     if LNX11::RE_STATE_ADD_TYPE =~ note ||
  2669.        LNX11::RE_STATE_REM_TYPE =~ note
  2670.       return @popup_type = false
  2671.     end
  2672.     # メモ取得
  2673.     re = LNX11::RE_STATE_TYPE =~ note
  2674.     @popup_type = re ? $1.to_i : false
  2675.   end
  2676.   #--------------------------------------------------------------------------
  2677.   # ● [追加]:付加ポップアップタイプの取得
  2678.   #--------------------------------------------------------------------------
  2679.   def add_popup_type
  2680.     return popup_type if popup_type
  2681.     # キャッシュがある場合、それを返す
  2682.     return @add_popup_type if @add_popup_type != nil
  2683.     # メモ取得
  2684.     re = LNX11::RE_STATE_ADD_TYPE =~ note
  2685.     @add_popup_type = re ? $1.to_i : false
  2686.   end
  2687.   #--------------------------------------------------------------------------
  2688.   # ● [追加]:解除ポップアップタイプの取得
  2689.   #--------------------------------------------------------------------------
  2690.   def remove_popup_type
  2691.     return popup_type if popup_type
  2692.     # キャッシュがある場合、それを返す
  2693.     return @remove_popup_type if @remove_popup_type != nil
  2694.     # メモ取得
  2695.     re = LNX11::RE_STATE_REM_TYPE =~ note
  2696.     @remove_popup_type = re ? $1.to_i : false
  2697.   end
  2698.   #--------------------------------------------------------------------------
  2699.   # ● [追加]:修飾文字非表示の取得
  2700.   #--------------------------------------------------------------------------
  2701.   def no_decoration?
  2702.     # キャッシュがある場合、それを返す
  2703.     return @no_decoration if @no_decoration
  2704.     # 付加/解除のどちらかで設定されていれば無視する
  2705.     if LNX11::RE_STATE_ADD_NO_DECORATION =~ note ||
  2706.        LNX11::RE_STATE_REM_NO_DECORATION =~ note
  2707.       return @no_decoration = false
  2708.     end
  2709.     # メモ取得
  2710.     re = LNX11::RE_STATE_NO_DECORATION =~ note
  2711.     @no_decoration = re ? true : false
  2712.   end
  2713.   #--------------------------------------------------------------------------
  2714.   # ● [追加]:付加修飾文字非表示の取得
  2715.   #--------------------------------------------------------------------------
  2716.   def add_no_decoration?
  2717.     return true if no_decoration?
  2718.     # キャッシュがある場合、それを返す
  2719.     return @add_no_decoration if @add_no_decoration
  2720.     # メモ取得
  2721.     re = LNX11::RE_STATE_ADD_NO_DECORATION =~ note
  2722.     @add_no_decoration = re ? true : false
  2723.   end
  2724.   #--------------------------------------------------------------------------
  2725.   # ● [追加]:解除修飾文字非表示の取得
  2726.   #--------------------------------------------------------------------------
  2727.   def remove_no_decoration?
  2728.     return true if no_decoration?
  2729.     # キャッシュがある場合、それを返す
  2730.     return @remove_no_decoration if @remove_no_decoration
  2731.     # メモ取得
  2732.     re = LNX11::RE_STATE_REM_NO_DECORATION =~ note
  2733.     @remove_no_decoration = re ? true : false
  2734.   end
  2735. end
  2736.  
  2737. #==============================================================================
  2738. # ■ BattleManager
  2739. #------------------------------------------------------------------------------
  2740. #  戦闘の進行を管理するモジュールです。
  2741. #==============================================================================
  2742.  
  2743. class << BattleManager
  2744.   #--------------------------------------------------------------------------
  2745.   # ● [追加]:公開インスタンス変数
  2746.   #--------------------------------------------------------------------------
  2747.   attr_reader   :preemptive             # 先制攻撃フラグ
  2748.   attr_reader   :surprise               # 不意打ちフラグ
  2749.   attr_accessor :log_window             # バトルログウィンドウ
  2750.   attr_accessor :update_for_wait_method # ウェイト中のフレーム更新
  2751.   attr_accessor :helpdisplay_set_method        # 簡易ヘルプ表示
  2752.   attr_accessor :helpdisplay_clear_method      # 簡易ヘルプ消去
  2753.   attr_accessor :helpdisplay_wait_short_method # 簡易ヘルプ・短時間ウェイト
  2754.   #--------------------------------------------------------------------------
  2755.   # ● [追加]:簡易ヘルプ表示
  2756.   #--------------------------------------------------------------------------
  2757.   def helpdisplay_set(*args)
  2758.     @helpdisplay_set_method.call(*args) if @helpdisplay_set_method
  2759.   end
  2760.   #--------------------------------------------------------------------------
  2761.   # ● [追加]:簡易ヘルプ消去
  2762.   #--------------------------------------------------------------------------
  2763.   def helpdisplay_clear(*args)
  2764.     @helpdisplay_clear_method.call(*args) if @helpdisplay_clear_method
  2765.   end
  2766.   #--------------------------------------------------------------------------
  2767.   # ● [追加]:簡易ヘルプ・短時間ウェイト
  2768.   #--------------------------------------------------------------------------
  2769.   def helpdisplay_wait_short
  2770.     @helpdisplay_wait_short_method.call if @helpdisplay_wait_short_method
  2771.   end
  2772.   #--------------------------------------------------------------------------
  2773.   # ● [追加]:キー入力待ち
  2774.   #--------------------------------------------------------------------------
  2775.   def helpdisplay_wait_input
  2776.     return if $game_message.helpdisplay_texts.empty?
  2777.     return if LNX11::MESSAGE_TYPE == 0
  2778.     return if !@helpdisplay_wait_input || !@update_for_wait_method
  2779.     update_for_wait_method.call while !Input.press?(:B) && !Input.press?(:C)
  2780.   end
  2781.   #--------------------------------------------------------------------------
  2782.   # ● [追加]:メッセージ進行の SE 再生
  2783.   #--------------------------------------------------------------------------
  2784.   def messagedisplay_se_play
  2785.     return if !@helpdisplay_se
  2786.     @helpdisplay_se.play  
  2787.     @helpdisplay_se = nil if @helpdisplay_se == LNX11::LEVELUP_SE
  2788.   end
  2789.   #--------------------------------------------------------------------------
  2790.   # ● [追加]:メッセージ進行
  2791.   #--------------------------------------------------------------------------
  2792.   def process_messagedisplay(wait)
  2793.     return if $game_message.helpdisplay_texts.empty?
  2794.     return if LNX11::MESSAGE_TYPE == 0
  2795.     $game_temp.battlelog_clear = true
  2796.     BattleManager.log_window.update
  2797.     if LNX11::BATTLELOG_TYPE == 2 || LNX11::MESSAGE_TYPE == 2
  2798.       # 簡易ヘルプ
  2799.       $game_message.helpdisplay_texts.each do |text|
  2800.         helpdisplay_wait_short
  2801.         messagedisplay_se_play
  2802.         helpdisplay_set(text, wait)
  2803.         helpdisplay_wait_input
  2804.       end
  2805.       helpdisplay_clear
  2806.     elsif LNX11::BATTLELOG_TYPE == 0
  2807.       # VXAceデフォルト
  2808.       BattleManager.log_window.clear
  2809.       $game_message.helpdisplay_texts.each do |text|
  2810.         messagedisplay_se_play
  2811.         BattleManager.log_window.add_text(text)
  2812.         BattleManager.log_window.abs_wait(wait)
  2813.         helpdisplay_wait_input
  2814.         max = BattleManager.log_window.max_line_number
  2815.         # 表示がいっぱいになったら消去
  2816.         if BattleManager.log_window.line_number >= max
  2817.           BattleManager.log_window.clear
  2818.         end
  2819.       end
  2820.       BattleManager.log_window.clear
  2821.     elsif LNX11::BATTLELOG_TYPE == 1
  2822.       # 蓄積型
  2823.       $game_message.helpdisplay_texts.each do |text|
  2824.         messagedisplay_se_play
  2825.         BattleManager.log_window.add_text(text)
  2826.         BattleManager.log_window.abs_wait(wait)
  2827.         helpdisplay_wait_input
  2828.       end
  2829.       $game_temp.battlelog_clear = true
  2830.       BattleManager.log_window.update
  2831.     end
  2832.     $game_message.helpdisplay_texts.clear
  2833.   end
  2834.   #--------------------------------------------------------------------------
  2835.   # ● [エイリアス]:メッセージ表示が終わるまでウェイト
  2836.   #--------------------------------------------------------------------------
  2837.   alias :lnx11a_wait_for_message :wait_for_message
  2838.   def wait_for_message
  2839.     # 簡易ヘルプ表示
  2840.     process_messagedisplay(@helpdisplay_wait ? @helpdisplay_wait : 60)
  2841.     return if $game_message.texts.empty?
  2842.     # 元のメソッドを呼ぶ
  2843.     lnx11a_wait_for_message
  2844.   end  
  2845.   #--------------------------------------------------------------------------
  2846.   # ● [エイリアス]:戦闘開始
  2847.   #--------------------------------------------------------------------------
  2848.   alias :lnx11a_battle_start :battle_start
  2849.   def battle_start   
  2850.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:battle_start][0]
  2851.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:battle_start][1]
  2852.     # メッセージウィンドウへのテキスト追加を禁止する
  2853.     $game_message.add_disabled
  2854.     # 元のメソッドを呼ぶ
  2855.     lnx11a_battle_start
  2856.     # メッセージウィンドウへのテキスト追加を許可する
  2857.     $game_message.add_enabled
  2858.     @helpdisplay_wait = nil
  2859.     @helpdisplay_wait_input = nil
  2860.   end
  2861.   #--------------------------------------------------------------------------
  2862.   # ● [エイリアス]:勝利の処理
  2863.   #--------------------------------------------------------------------------
  2864.   alias :lnx11a_process_victory :process_victory
  2865.   def process_victory
  2866.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:victory][0]
  2867.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:victory][1]
  2868.     # メッセージウィンドウへのテキスト追加を禁止する
  2869.     $game_message.add_disabled
  2870.     # 元のメソッドを呼ぶ
  2871.     success = lnx11a_process_victory
  2872.     # メッセージウィンドウへのテキスト追加を許可する
  2873.     $game_message.add_enabled
  2874.     @helpdisplay_wait = nil
  2875.     @helpdisplay_wait_input = nil
  2876.     return success
  2877.   end
  2878.   #--------------------------------------------------------------------------
  2879.   # ● [エイリアス]:逃走の処理
  2880.   #--------------------------------------------------------------------------
  2881.   alias :lnx11a_process_escape :process_escape
  2882.   def process_escape
  2883.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:escape][0]
  2884.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:escape][1]
  2885.     # メッセージウィンドウへのテキスト追加を禁止する
  2886.     $game_message.add_disabled
  2887.     # 元のメソッドを呼ぶ
  2888.     success = lnx11a_process_escape
  2889.     # メッセージウィンドウへのテキスト追加を許可する
  2890.     $game_message.add_enabled
  2891.     @helpdisplay_wait = nil
  2892.     @helpdisplay_wait_input = nil
  2893.     return success
  2894.   end
  2895.   #--------------------------------------------------------------------------
  2896.   # ● [エイリアス]:敗北の処理
  2897.   #--------------------------------------------------------------------------
  2898.   alias :lnx11a_process_defeat :process_defeat
  2899.   def process_defeat
  2900.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:defeat][0]
  2901.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:defeat][1]
  2902.     # メッセージウィンドウへのテキスト追加を禁止する
  2903.     $game_message.add_disabled
  2904.     # 元のメソッドを呼ぶ
  2905.     success = lnx11a_process_defeat
  2906.     # メッセージウィンドウへのテキスト追加を許可する
  2907.     $game_message.add_enabled
  2908.     @helpdisplay_wait = nil
  2909.     @helpdisplay_wait_input = nil
  2910.     return success
  2911.   end
  2912.   #--------------------------------------------------------------------------
  2913.   # ● [エイリアス]:ドロップアイテムの獲得と表示
  2914.   #--------------------------------------------------------------------------
  2915.   alias :lnx11a_gain_drop_items :gain_drop_items
  2916.   def gain_drop_items
  2917.     helpdisplay_clear
  2918.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:drop_item][0]
  2919.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:drop_item][1]
  2920.     @helpdisplay_se = LNX11::DROPITEM_SE
  2921.     # 元のメソッドを呼ぶ
  2922.     lnx11a_gain_drop_items
  2923.     @helpdisplay_wait = nil
  2924.     @helpdisplay_wait_input = nil
  2925.     @helpdisplay_se = nil
  2926.   end
  2927.   #--------------------------------------------------------------------------
  2928.   # ● [再定義]:経験値の獲得とレベルアップの表示
  2929.   #--------------------------------------------------------------------------
  2930.   def gain_exp
  2931.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:levelup][0]
  2932.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:levelup][1]
  2933.     $game_party.all_members.each do |actor|
  2934.       @helpdisplay_se = LNX11::LEVELUP_SE
  2935.       actor.gain_exp($game_troop.exp_total)
  2936.       # レベルアップ毎にメッセージ表示ウェイト
  2937.       wait_for_message
  2938.     end
  2939.     @helpdisplay_wait = nil
  2940.     @helpdisplay_wait_input = nil
  2941.     @helpdisplay_se = nil
  2942.   end
  2943. end
  2944.  
  2945. #==============================================================================
  2946. # ■ Game_Temp
  2947. #------------------------------------------------------------------------------
  2948. #  セーブデータに含まれない、一時的なデータを扱うクラスです。このクラスのイン
  2949. # スタンスは $game_temp で参照されます。
  2950. #==============================================================================
  2951.  
  2952. class Game_Temp
  2953.   #--------------------------------------------------------------------------
  2954.   # ● [追加]:公開インスタンス変数
  2955.   #--------------------------------------------------------------------------
  2956.   attr_accessor :popup_data            # ポップアップスプライト
  2957.   attr_accessor :actor_battler_graphic # アクターのバトラーグラフィック
  2958.   attr_accessor :battlelog_clear       # バトルログ消去フラグ
  2959.   attr_accessor :target_cursor_sprite  # ターゲットカーソルスプライト
  2960.   attr_accessor :last_target_cursor    # 対象選択のカーソル記憶
  2961.   #--------------------------------------------------------------------------
  2962.   # ● [エイリアス]:オブジェクト初期化
  2963.   #--------------------------------------------------------------------------
  2964.   alias :lnx11a_initialize :initialize
  2965.   def initialize
  2966.     # 元のメソッドを呼ぶ
  2967.     lnx11a_initialize
  2968.     # 追加
  2969.     @popup_data = nil
  2970.     @actor_battler_graphic = []
  2971.     @battlelog_clear = false
  2972.     @battle_status_refresh = nil
  2973.     @target_cursor_sprite = nil
  2974.     clear_last_target_cursor
  2975.   end
  2976.   #--------------------------------------------------------------------------
  2977.   # ● [追加]:バトルステータス更新メソッドの設定
  2978.   #--------------------------------------------------------------------------
  2979.   def method_battle_status_refresh=(method)
  2980.     @battle_status_refresh = method
  2981.   end
  2982.   #--------------------------------------------------------------------------
  2983.   # ● [追加]:バトルステータス更新
  2984.   #--------------------------------------------------------------------------
  2985.   def battle_status_refresh
  2986.     return unless $game_party.in_battle
  2987.     @battle_status_refresh.call if @battle_status_refresh
  2988.   end
  2989.   #--------------------------------------------------------------------------
  2990.   # ● [追加]:対象選択のカーソル記憶をクリア
  2991.   #--------------------------------------------------------------------------
  2992.   def clear_last_target_cursor
  2993.     @last_target_cursor = {:actor => nil, :enemy => nil}
  2994.   end
  2995. end
  2996.  
  2997. #==============================================================================
  2998. # ■ Game_Action
  2999. #------------------------------------------------------------------------------
  3000. #  戦闘行動を扱うクラスです。
  3001. #==============================================================================
  3002.  
  3003. class Game_Action
  3004.   #--------------------------------------------------------------------------
  3005.   # ● [エイリアス]:ターゲットの配列作成
  3006.   #--------------------------------------------------------------------------
  3007.   alias :lnx11a_make_targets :make_targets
  3008.   def make_targets   
  3009.     if LNX11::TROOP_X_SORT
  3010.       # 元のメソッドを呼んでソート
  3011.       return lnx11a_make_targets.sort {|a,b| a.screen_x <=> b.screen_x}
  3012.     else
  3013.       return lnx11a_make_targets
  3014.     end
  3015.   end
  3016. end
  3017.  
  3018. #==============================================================================
  3019. # ■ Game_ActionResult
  3020. #------------------------------------------------------------------------------
  3021. #  戦闘行動の結果を扱うクラスです。属性に関する結果を追加します。
  3022. #==============================================================================
  3023.  
  3024. class Game_ActionResult
  3025.   #--------------------------------------------------------------------------
  3026.   # ● 公開インスタンス変数
  3027.   #--------------------------------------------------------------------------
  3028.   attr_accessor :element_rate               # 属性修正値
  3029.   #--------------------------------------------------------------------------
  3030.   # ● ダメージ値のクリア
  3031.   #--------------------------------------------------------------------------
  3032.   alias :lnx11a_clear_damage_values :clear_damage_values
  3033.   def clear_damage_values
  3034.     # 元のメソッドを呼ぶ
  3035.     lnx11a_clear_damage_values
  3036.     # 属性修正値をクリア
  3037.     @element_rate = 1.0
  3038.   end
  3039.   #--------------------------------------------------------------------------
  3040.   # ● [追加]:属性修正値の取得
  3041.   #--------------------------------------------------------------------------
  3042.   def element_rate
  3043.     return @element_rate if @element_rate
  3044.     @element_rate = 1.0
  3045.   end
  3046. end
  3047.  
  3048. #==============================================================================
  3049. # ■ Game_BattlerBase
  3050. #------------------------------------------------------------------------------
  3051. #  バトラーを扱う基本のクラスです。
  3052. #==============================================================================
  3053.  
  3054. class Game_BattlerBase
  3055.   #--------------------------------------------------------------------------
  3056.   # ● [追加]:ポップアップデータの取得
  3057.   #--------------------------------------------------------------------------
  3058.   def popup_data
  3059.     $game_temp.popup_data
  3060.   end
  3061.   #--------------------------------------------------------------------------
  3062.   # ● [エイリアス]:スキル使用コストの支払い
  3063.   #--------------------------------------------------------------------------
  3064.   alias :lnx11a_pay_skill_cost :pay_skill_cost
  3065.   def pay_skill_cost(skill)
  3066.     rmp = self.mp
  3067.     rtp = self.tp
  3068.     # 元のメソッドを呼ぶ   
  3069.     lnx11a_pay_skill_cost(skill)
  3070.     return unless $game_party.in_battle
  3071.     # ポップアップ
  3072.     popup_data.popup_regenerate_mp(self, (rmp - self.mp).truncate, true)
  3073.     popup_data.popup_regenerate_tp(self, (rtp - self.tp).truncate, true)
  3074.   end
  3075. end
  3076.  
  3077. #==============================================================================
  3078. # ■ Game_Battler
  3079. #------------------------------------------------------------------------------
  3080. #  スプライトに関するメソッドを追加したバトラーのクラスです。
  3081. #==============================================================================
  3082.  
  3083. class Game_Battler < Game_BattlerBase
  3084.   #--------------------------------------------------------------------------
  3085.   # ● 公開インスタンス変数
  3086.   #--------------------------------------------------------------------------
  3087.   attr_accessor :loop_animation_id     # ループアニメーション ID
  3088.   attr_accessor :loop_animation_mirror # ループアニメーション 左右反転フラグ
  3089.   #--------------------------------------------------------------------------
  3090.   # ● [エイリアス]:スプライトのエフェクトをクリア
  3091.   #--------------------------------------------------------------------------
  3092.   alias :lnx11a_clear_sprite_effects :clear_sprite_effects
  3093.   def clear_sprite_effects
  3094.     # 元のメソッドを呼ぶ
  3095.     lnx11a_clear_sprite_effects
  3096.     @loop_animation_id = 0
  3097.     @loop_animation_mirror = false
  3098.   end
  3099.   #--------------------------------------------------------------------------
  3100.   # ● [再定義]:アニメーション ID の設定
  3101.   #--------------------------------------------------------------------------  
  3102.   def animation_id=(id)
  3103.     return unless battle_member?
  3104.     @animation_id = id
  3105.   end
  3106.   #--------------------------------------------------------------------------
  3107.   # ● [追加]:ステートのループアニメーションの設定
  3108.   #--------------------------------------------------------------------------
  3109.   def set_state_animation
  3110.     # 表示優先度が高いステートを優先
  3111.     sort_states
  3112.     anime = @states.collect {|id| $data_states[id].state_animation }
  3113.     anime.delete(0)
  3114.     @loop_animation_id = anime[0] ? anime[0] : 0
  3115.   end
  3116.   #--------------------------------------------------------------------------
  3117.   # ● [エイリアス]:ステート情報をクリア
  3118.   #--------------------------------------------------------------------------
  3119.   alias :lnx11a_clear_states :clear_states
  3120.   def clear_states
  3121.     # 元のメソッドを呼ぶ
  3122.     lnx11a_clear_states
  3123.     # ステートアニメ設定
  3124.     set_state_animation
  3125.   end
  3126.   #--------------------------------------------------------------------------
  3127.   # ● [エイリアス]:ステートの付加
  3128.   #--------------------------------------------------------------------------
  3129.   alias :lnx11a_add_state :add_state
  3130.   def add_state(state_id)
  3131.     # 元のメソッドを呼ぶ
  3132.     lnx11a_add_state(state_id)
  3133.     # ステートアニメ設定
  3134.     set_state_animation
  3135.   end
  3136.   #--------------------------------------------------------------------------
  3137.   # ● [エイリアス]:ステートの解除
  3138.   #--------------------------------------------------------------------------
  3139.   alias :lnx11a_remove_state :remove_state
  3140.   def remove_state(state_id)
  3141.     # 元のメソッドを呼ぶ
  3142.     lnx11a_remove_state(state_id)
  3143.     # ステートアニメ設定
  3144.     set_state_animation
  3145.   end
  3146.   #--------------------------------------------------------------------------
  3147.   # ● [追加]:ポップアップディレイの取得
  3148.   #--------------------------------------------------------------------------
  3149.   def popup_delay
  3150.     return @popup_delay if @popup_delay
  3151.     popup_delay_clear
  3152.   end
  3153.   #--------------------------------------------------------------------------
  3154.   # ● [追加]:ポップアップディレイの設定
  3155.   #--------------------------------------------------------------------------
  3156.   def popup_delay=(delay)
  3157.     @popup_delay = delay
  3158.   end
  3159.   #--------------------------------------------------------------------------
  3160.   # ● [追加]:ポップアップディレイの設定
  3161.   #--------------------------------------------------------------------------
  3162.   def popup_delay_clear
  3163.     @popup_delay = Array.new(16) { 0 }
  3164.   end
  3165.   #--------------------------------------------------------------------------
  3166.   # ● [エイリアス]:スキル/アイテムの属性修正値を取得
  3167.   #  弱点/耐性の判定を追加します。
  3168.   #--------------------------------------------------------------------------
  3169.   alias :lnx11a_item_element_rate :item_element_rate
  3170.   def item_element_rate(user, item)
  3171.     # 元のメソッドを呼ぶ
  3172.     rate = lnx11a_item_element_rate(user, item)
  3173.     return rate unless $game_party.in_battle
  3174.     # レートを結果に保存する
  3175.     @result.element_rate = rate
  3176.     rate
  3177.   end
  3178.   #--------------------------------------------------------------------------
  3179.   # ● [エイリアス]:ダメージの処理
  3180.   #  吸収による回復のポップアップを生成します。
  3181.   #--------------------------------------------------------------------------
  3182.   alias :lnx11a_execute_damage :execute_damage
  3183.   def execute_damage(user)
  3184.     # 元のメソッドを呼ぶ
  3185.     lnx11a_execute_damage(user)
  3186.     return unless $game_party.in_battle
  3187.     # ポップアップ
  3188.     popup_data.popup_hp_drain(user, @result.hp_drain)
  3189.     popup_data.popup_mp_drain(user, @result.mp_drain)
  3190.   end
  3191.   #--------------------------------------------------------------------------
  3192.   # ● [エイリアス]:HP の再生
  3193.   #--------------------------------------------------------------------------
  3194.   alias :lnx11a_regenerate_hp :regenerate_hp
  3195.   def regenerate_hp
  3196.     # 元のメソッドを呼ぶ
  3197.     lnx11a_regenerate_hp
  3198.     return unless $game_party.in_battle
  3199.     # ポップアップ
  3200.     popup_data.popup_regenerate_hp(self, @result.hp_damage)
  3201.   end
  3202.   #--------------------------------------------------------------------------
  3203.   # ● [エイリアス]:MP の再生
  3204.   #--------------------------------------------------------------------------
  3205.   alias :lnx11a_regenerate_mp :regenerate_mp
  3206.   def regenerate_mp
  3207.     # 元のメソッドを呼ぶ
  3208.     lnx11a_regenerate_mp
  3209.     return unless $game_party.in_battle
  3210.     # ポップアップ
  3211.     popup_data.popup_regenerate_mp(self, @result.mp_damage)
  3212.   end
  3213.   #--------------------------------------------------------------------------
  3214.   # ● [エイリアス]:TP の再生
  3215.   #--------------------------------------------------------------------------
  3216.   alias :lnx11a_regenerate_tp :regenerate_tp
  3217.   def regenerate_tp
  3218.     rtp = self.tp.to_i
  3219.     # 元のメソッドを呼ぶ
  3220.     lnx11a_regenerate_tp
  3221.     return unless $game_party.in_battle
  3222.     # ポップアップ
  3223.     popup_data.popup_regenerate_tp(self, rtp - self.tp.to_i)
  3224.   end
  3225.   #--------------------------------------------------------------------------
  3226.   # ● 被ダメージによる TP チャージ
  3227.   #--------------------------------------------------------------------------
  3228.   alias :lnx11a_charge_tp_by_damage :charge_tp_by_damage
  3229.   def charge_tp_by_damage(damage_rate)
  3230.     rtp = self.tp.to_i
  3231.     # 元のメソッドを呼ぶ
  3232.     lnx11a_charge_tp_by_damage(damage_rate)
  3233.     return unless $game_party.in_battle
  3234.     # ポップアップ
  3235.     popup_data.popup_tp_charge(self, rtp - self.tp.to_i)
  3236.   end
  3237.   #--------------------------------------------------------------------------
  3238.   # ● [エイリアス]:スキル/アイテムの使用者側への効果(TP 得)
  3239.   #--------------------------------------------------------------------------
  3240.   alias :lnx11a_item_user_effect :item_user_effect
  3241.   def item_user_effect(user, item)
  3242.     rtp = user.tp.to_i
  3243.     # 元のメソッドを呼ぶ
  3244.     lnx11a_item_user_effect(user, item)
  3245.     return unless $game_party.in_battle
  3246.     # ポップアップ
  3247.     popup_data.popup_tp_gain(user, rtp - user.tp.to_i)
  3248.   end
  3249.   #--------------------------------------------------------------------------
  3250.   # ● [追加]:高さの取得
  3251.   #--------------------------------------------------------------------------
  3252.   def bitmap_height
  3253.     return @bitmap_height if @bitmap_height
  3254.     @bitmap_height = 0
  3255.   end
  3256.   #--------------------------------------------------------------------------
  3257.   # ● [追加]:高さの設定
  3258.   #--------------------------------------------------------------------------
  3259.   def bitmap_height=(y)
  3260.     @bitmap_height = y
  3261.   end
  3262.   #--------------------------------------------------------------------------
  3263.   # ● [追加]:バトル画面 Y 座標(頭上)の取得
  3264.   #--------------------------------------------------------------------------
  3265.   def screen_y_top
  3266.     screen_y - @bitmap_height
  3267.   end
  3268.   #--------------------------------------------------------------------------
  3269.   # ● [追加]:バトル画面 Y 座標(中心)の取得
  3270.   #--------------------------------------------------------------------------
  3271.   def screen_y_center
  3272.     screen_y - @bitmap_height / 2
  3273.   end
  3274. end
  3275.  
  3276. #==============================================================================
  3277. # ■ Game_Actor
  3278. #------------------------------------------------------------------------------
  3279. #  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors)
  3280. # の内部で使用され、Game_Party クラス($game_party)からも参照されます。
  3281. #==============================================================================
  3282.  
  3283. class Game_Actor < Game_Battler
  3284.   #--------------------------------------------------------------------------
  3285.   # ● [追加]:公開インスタンス変数
  3286.   #--------------------------------------------------------------------------
  3287.   attr_accessor :battler_graphic_name    # 後指定のバトラーグラフィック
  3288.   attr_accessor :refresh_battler_graphic # バトラーグラフィックの更新フラグ
  3289.   attr_accessor :screen_x                # バトル画面 X 座標
  3290.   attr_accessor :screen_y                # バトル画面 Y 座標
  3291.   attr_accessor :last_actor_command      # 最後に選択したコマンド
  3292.   #--------------------------------------------------------------------------
  3293.   # ● [再定義]:スプライトを使うか?
  3294.   #--------------------------------------------------------------------------
  3295.   def use_sprite?
  3296.     return true # 使う
  3297.   end
  3298.   #--------------------------------------------------------------------------
  3299.   # ● [追加]:バトル画面 Z 座標の取得
  3300.   #--------------------------------------------------------------------------
  3301.   def screen_z
  3302.     return $game_party.members_screen_z[0] if index == nil
  3303.     return $game_party.members_screen_z[index] # Game_EnemyのZ座標は100
  3304.   end
  3305.   #--------------------------------------------------------------------------
  3306.   # ● [エイリアス]:ダメージ効果の実行
  3307.   #--------------------------------------------------------------------------
  3308.   alias :lnx11a_perform_damage_effect :perform_damage_effect
  3309.   def perform_damage_effect
  3310.     # 元のメソッドを呼ぶ
  3311.     lnx11a_perform_damage_effect
  3312.     # シェイクを無効にしている場合、シェイクをクリア
  3313.     $game_troop.screen.clear_shake if LNX11::DISABLED_DAMAGE_SHAKE
  3314.   end
  3315.   #--------------------------------------------------------------------------
  3316.   # ● [再定義]:コラプス効果の実行
  3317.   #  アクターの[特徴>その他>消滅エフェクト]の設定を適用するようにします。
  3318.   #  処理内容は Game_Enemy のものとほぼ同一です。
  3319.   #--------------------------------------------------------------------------
  3320.   def perform_collapse_effect
  3321.     if $game_party.in_battle
  3322.       case collapse_type
  3323.       when 0
  3324.         @sprite_effect_type = :collapse
  3325.         Sound.play_actor_collapse
  3326.       when 1
  3327.         @sprite_effect_type = :boss_collapse
  3328.         Sound.play_boss_collapse1
  3329.       when 2
  3330.         @sprite_effect_type = :instant_collapse
  3331.       end
  3332.     end
  3333.   end
  3334.   #--------------------------------------------------------------------------
  3335.   # ● [追加]:グラフィック設定の配列を返す
  3336.   #--------------------------------------------------------------------------
  3337.   def graphic_name_index
  3338.     case LNX11::DEFAULT_BATTLER_GRAPHIC
  3339.     when 0 ; [@face_name, @face_index]
  3340.     when 1 ; [@character_name, @character_index]
  3341.     end
  3342.   end
  3343.   #--------------------------------------------------------------------------
  3344.   # ● [エイリアス]:グラフィックの変更
  3345.   #--------------------------------------------------------------------------
  3346.   alias :lnx11a_set_graphic :set_graphic
  3347.   def set_graphic(*args)
  3348.     face = graphic_name_index
  3349.     # 元のメソッドを呼ぶ
  3350.     lnx11a_set_graphic(*args)
  3351.     @refresh_battler_graphic = (face != graphic_name_index)
  3352.   end
  3353.   #--------------------------------------------------------------------------
  3354.   # ● [追加]:デフォルトバトラーグラフィックの取得
  3355.   #--------------------------------------------------------------------------
  3356.   def facebattler
  3357.     $game_temp.actor_battler_graphic[id]
  3358.   end
  3359.   def facebattler=(bitmap)
  3360.     facebattler.dispose if facebattler && !facebattler.disposed?
  3361.     $game_temp.actor_battler_graphic[id] = bitmap
  3362.   end
  3363.   #--------------------------------------------------------------------------
  3364.   # ● [追加]:後指定のバトラーグラフィックファイル名の取得
  3365.   #--------------------------------------------------------------------------
  3366.   def battler_graphic_name
  3367.     return @battler_graphic_name if @battler_graphic_name != nil
  3368.     @battler_graphic_name = ""
  3369.   end
  3370.   #--------------------------------------------------------------------------
  3371.   # ● [追加]:後指定のバトラーグラフィックファイル名の指定
  3372.   #--------------------------------------------------------------------------
  3373.   def battler_graphic_name=(filename)
  3374.     @battler_graphic_name = filename
  3375.     @refresh_battler_graphic = true
  3376.   end
  3377.   #--------------------------------------------------------------------------
  3378.   # ● [追加]:顔グラフィックを描画して返す
  3379.   #  処理内容は Window_Base の draw_face に準じたものです。
  3380.   #--------------------------------------------------------------------------
  3381.   def draw_face(face_name, face_index, enabled = true)
  3382.     fw = 96
  3383.     fh = 96
  3384.     # ビットマップを作成して返す
  3385.     bitmap = Cache.face(face_name)
  3386.     rect = Rect.new(face_index % 4 * fw, face_index / 4 * fh, fw, fh)
  3387.     face = Bitmap.new(fw, fh)
  3388.     color = LNX11::DEFAULT_BG_COLOR
  3389.     face.gradient_fill_rect(face.rect, color[0], color[1], true)
  3390.     face.blt(0, 0, bitmap, rect)
  3391.     bitmap.dispose
  3392.     face
  3393.   end
  3394.   #--------------------------------------------------------------------------
  3395.   # ● [追加]:歩行グラフィックを描画して返す
  3396.   #  処理内容は Window_Base の draw_character に準じたものです。
  3397.   #--------------------------------------------------------------------------
  3398.   def draw_character(character_name, character_index)
  3399.     return unless character_name
  3400.     bitmap = Cache.character(character_name)
  3401.     sign = character_name[/^[\!\$]./]
  3402.     if sign && sign.include?('$')
  3403.       cw = bitmap.width / 3
  3404.       ch = bitmap.height / 4
  3405.     else
  3406.       cw = bitmap.width / 12
  3407.       ch = bitmap.height / 8
  3408.     end
  3409.     n = character_index
  3410.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  3411.     character = Bitmap.new(cw, ch)
  3412.     color = LNX11::DEFAULT_BG_COLOR
  3413.     character.gradient_fill_rect(character.rect, color[0], color[1], true)
  3414.     character.blt(0, 0, bitmap, src_rect)
  3415.     character
  3416.   end
  3417.   #--------------------------------------------------------------------------
  3418.   # ● [追加]:デフォルトバトラーグラフィック設定
  3419.   #--------------------------------------------------------------------------
  3420.   def default_battler_graphic
  3421.     case LNX11::DEFAULT_BATTLER_GRAPHIC
  3422.     when 0 # 顔グラフィック
  3423.       self.facebattler = draw_face(@face_name, @face_index)
  3424.     when 1 # 歩行グラフィック
  3425.       self.facebattler = draw_character(@character_name, @character_index)
  3426.     end
  3427.   end
  3428.   #--------------------------------------------------------------------------
  3429.   # ● [追加]:バトラーグラフィックの更新
  3430.   #  Sprite_Batter が利用するオブジェクトを更新します。
  3431.   #--------------------------------------------------------------------------
  3432.   def update_battler_graphic
  3433.     @battler_hue = 0
  3434.     if !battler_graphic_name.empty?
  3435.       # スクリプトで指定されている
  3436.       @battler_name = @battler_graphic_name
  3437.       dispose_facebattler
  3438.     elsif !actor.default_battler_graphic.empty?
  3439.       # メモで指定されている
  3440.       @battler_name = actor.default_battler_graphic
  3441.       dispose_facebattler
  3442.     else
  3443.       # 何も指定されていない
  3444.       @battler_name = ""
  3445.       default_battler_graphic
  3446.     end
  3447.     # 更新したので更新フラグを取り消す
  3448.     @refresh_battler_graphic = false
  3449.   end
  3450.   #--------------------------------------------------------------------------
  3451.   # ● [追加]:バトラー用顔グラフィックの解放
  3452.   #--------------------------------------------------------------------------
  3453.   def dispose_facebattler
  3454.     return if self.facebattler == nil
  3455.     self.facebattler.dispose
  3456.     self.facebattler = nil
  3457.   end
  3458.   #--------------------------------------------------------------------------
  3459.   # ● [エイリアス]:レベルアップメッセージの表示
  3460.   #   レベルアップのポップアップを追加します。
  3461.   #--------------------------------------------------------------------------
  3462.   alias :lnx11a_display_level_up :display_level_up
  3463.   def display_level_up(new_skills)
  3464.     popup_data.popup_levelup(self) if $game_party.in_battle
  3465.     lnx11a_display_level_up(new_skills)
  3466.   end
  3467. end
  3468.  
  3469. #==============================================================================
  3470. # ■ Game_Enemy
  3471. #------------------------------------------------------------------------------
  3472. #  敵キャラを扱うクラスです。
  3473. #==============================================================================
  3474.  
  3475. class Game_Enemy < Game_Battler
  3476.   #--------------------------------------------------------------------------
  3477.   # ● [追加]:バトルメンバー判定
  3478.   #--------------------------------------------------------------------------
  3479.   def battle_member?
  3480.     true
  3481.   end
  3482.   #--------------------------------------------------------------------------
  3483.   # ● [追加]:通常攻撃 アニメーション ID の取得
  3484.   #--------------------------------------------------------------------------
  3485.   def atk_animation
  3486.     # メモを参照
  3487.     enemy.atk_animation
  3488.   end
  3489. end
  3490.  
  3491. #==============================================================================
  3492. # ■ Game_Party
  3493. #------------------------------------------------------------------------------
  3494. #  パーティを扱うクラスです。所持金やアイテムなどの情報が含まれます。このクラ
  3495. # スのインスタンスは $game_party で参照されます。
  3496. #==============================================================================
  3497.  
  3498. class Game_Party < Game_Unit
  3499.   #--------------------------------------------------------------------------
  3500.   # ● [追加]:公開インスタンス変数
  3501.   #--------------------------------------------------------------------------
  3502.   attr_accessor :actor_invisible     # アクター非表示
  3503.   attr_accessor :status_invisible    # バトルステータス非表示
  3504.   attr_accessor :actor_bg_invisible  # アクター背景非表示
  3505.   attr_accessor :last_party_command  # 最後に選択したパーティコマンド
  3506.   attr_accessor :members_screen_x          # バトルメンバー分のX座標配列
  3507.   attr_accessor :members_screen_x_nooffset # X:オフセットなし
  3508.   attr_accessor :members_screen_y          # バトルメンバー分のY座標配列
  3509.   attr_accessor :members_screen_z          # バトルメンバー分のZ座標配列
  3510.   #--------------------------------------------------------------------------
  3511.   # ● [追加]:バトルメンバーの座標設定
  3512.   #--------------------------------------------------------------------------
  3513.   def set_members_xyz
  3514.     return if members.size == 0
  3515.     # 座標をまとめて設定
  3516.     set_screen_x
  3517.     set_screen_y
  3518.     set_screen_z
  3519.   end
  3520.   #--------------------------------------------------------------------------
  3521.   # ● [追加]:バトルメンバーの座標設定
  3522.   #--------------------------------------------------------------------------
  3523.   def set_members_battle_graphic
  3524.     $game_party.battle_members.each {|actor| actor.update_battler_graphic}
  3525.   end
  3526.   #--------------------------------------------------------------------------
  3527.   # ● [追加]:バトル画面 X 座標の設定
  3528.   #  ここで設定した座標は Game_Actor や ステータス表示等で利用されます。
  3529.   #--------------------------------------------------------------------------
  3530.   def set_screen_x
  3531.     @members_screen_x = []
  3532.     @members_screen_x_nooffset = []
  3533.     padding = LNX11::ACTOR_PADDING[:side]
  3534.     if LNX11::ACTOR_CENTERING
  3535.       # アクターのセンタリングが有効
  3536.       a_spacing = LNX11::ACTOR_SPACING_ADJUST
  3537.       padding += (max_battle_members - battle_members.size) * a_spacing
  3538.       width = (Graphics.width - padding * 2) / battle_members.size
  3539.     else
  3540.       # アクターのセンタリングが無効
  3541.       width = (Graphics.width - padding * 2) / max_battle_members
  3542.     end
  3543.     battle_members.each_with_index do |actor, i|
  3544.       offset = LNX11::ACTOR_OFFSET[:x]
  3545.       @members_screen_x_nooffset[i] = width * i + width / 2 + padding
  3546.       @members_screen_x[i] = @members_screen_x_nooffset[i] + offset
  3547.       actor.screen_x = @members_screen_x[i]
  3548.     end
  3549.   end
  3550.   #--------------------------------------------------------------------------
  3551.   # ● [追加]:バトル画面 Y 座標の設定
  3552.   #  ここで設定した座標は Game_Actor や ステータス表示等で利用されます。
  3553.   #--------------------------------------------------------------------------
  3554.   def set_screen_y
  3555.     offset = LNX11::ACTOR_OFFSET[:y]
  3556.     ay = Graphics.height - LNX11::ACTOR_PADDING[:bottom] + offset
  3557.     @members_screen_y = Array.new(max_battle_members) {ay}
  3558.     battle_members.each {|actor| actor.screen_y = ay}
  3559.   end
  3560.   #--------------------------------------------------------------------------
  3561.   # ● [追加]:バトル画面 Z 座標の設定
  3562.   #--------------------------------------------------------------------------
  3563.   def set_screen_z
  3564.     # 便宜上、XYと同じように配列を作成しておく
  3565.     az = LNX11::ACTOR_SCREEN_TONE ? 150 : -10
  3566.     @members_screen_z = Array.new(max_battle_members) {az}
  3567.   end
  3568.   #--------------------------------------------------------------------------
  3569.   # ● [オーバーライド]:戦闘開始処理
  3570.   #--------------------------------------------------------------------------
  3571.   def on_battle_start
  3572.     super
  3573.     # バトルステータスの更新
  3574.     $game_temp.battle_status_refresh
  3575.   end
  3576. end
  3577.  
  3578. #==============================================================================
  3579. # ■ Game_Troop
  3580. #------------------------------------------------------------------------------
  3581. #  敵グループおよび戦闘に関するデータを扱うクラスです。
  3582. #==============================================================================
  3583.  
  3584. class Game_Troop < Game_Unit
  3585.   #--------------------------------------------------------------------------
  3586.   # ● [エイリアス]:セットアップ
  3587.   #  敵グループの座標修正処理を追加します。
  3588.   #--------------------------------------------------------------------------
  3589.   alias :lnx11a_setup :setup
  3590.   def setup(*args)
  3591.     # 元のメソッドを呼ぶ
  3592.     lnx11a_setup(*args)
  3593.     # 敵グループの座標修正
  3594.     @enemies.each do |enemy|
  3595.       # X:解像度がデフォルトでない場合に位置を補正する
  3596.       if LNX11::TROOP_X_SCREEN_FIX
  3597.         enemy.screen_x *= Graphics.width.to_f / 544
  3598.         enemy.screen_x.truncate
  3599.       end
  3600.       enemy.screen_y += LNX11::TROOP_Y_OFFSET
  3601.     end
  3602.   end
  3603.   #--------------------------------------------------------------------------
  3604.   # ● [エイリアス]:敵キャラ名の配列取得
  3605.   #--------------------------------------------------------------------------
  3606.   alias :lnx11a_enemy_names :enemy_names
  3607.   def enemy_names
  3608.     LNX11::MESSAGE_WINDOW_ENEMY_NAMES ? lnx11a_enemy_names : []
  3609.   end
  3610. end
  3611.  
  3612. #==============================================================================
  3613. # ■ Game_Message
  3614. #------------------------------------------------------------------------------
  3615. #  文章や選択肢などを表示するメッセージウィンドウの状態を扱うクラスです。
  3616. #==============================================================================
  3617.  
  3618. class Game_Message
  3619.   #--------------------------------------------------------------------------
  3620.   # ● [追加]:公開インスタンス変数
  3621.   #--------------------------------------------------------------------------
  3622.   attr_reader   :helpdisplay_texts        # 簡易ヘルプ配列
  3623.   #--------------------------------------------------------------------------
  3624.   # ● [追加]:簡易ヘルプ配列の取得
  3625.   #--------------------------------------------------------------------------
  3626.   def helpdisplay_texts
  3627.     return @helpdisplay_texts if @helpdisplay_texts
  3628.     @helpdisplay_texts = []
  3629.   end
  3630.   #--------------------------------------------------------------------------
  3631.   # ● [エイリアス]:クリア
  3632.   #--------------------------------------------------------------------------
  3633.   alias :lnx11a_clear :clear
  3634.   def clear
  3635.     # 元のメソッドを呼ぶ
  3636.     lnx11a_clear
  3637.     @helpdisplay_texts = []
  3638.     @add_disabled = false
  3639.   end
  3640.   #--------------------------------------------------------------------------
  3641.   # ● [エイリアス]:テキストの追加
  3642.   #--------------------------------------------------------------------------
  3643.   alias :lnx11a_add :add
  3644.   def add(text)
  3645.     # テキストの追加が禁止されてる場合、簡易ヘルプ表示用の配列に追加する
  3646.     if @add_disabled
  3647.       @helpdisplay_texts = [] unless @helpdisplay_texts
  3648.       @helpdisplay_texts.push(text)
  3649.     else
  3650.       # 元のメソッドを呼ぶ
  3651.       lnx11a_add(text)
  3652.     end
  3653.   end
  3654.   #--------------------------------------------------------------------------
  3655.   # ● [追加]:テキスト追加の禁止
  3656.   #--------------------------------------------------------------------------
  3657.   def add_disabled
  3658.     return if LNX11::MESSAGE_TYPE == 0
  3659.     @add_disabled = true
  3660.   end
  3661.   #--------------------------------------------------------------------------
  3662.   # ● [追加]:テキスト追加の禁止
  3663.   #--------------------------------------------------------------------------
  3664.   def add_enabled
  3665.     return if LNX11::MESSAGE_TYPE == 0
  3666.     @add_disabled = false
  3667.   end
  3668. end
  3669.  
  3670. #==============================================================================
  3671. # ■ Sprite_Battler
  3672. #------------------------------------------------------------------------------
  3673. #  バトラー表示用のスプライトです。
  3674. #==============================================================================
  3675.  
  3676. class Sprite_Battler < Sprite_Base
  3677.   #--------------------------------------------------------------------------
  3678.   # ● [追加]:ターゲットカーソルのバトラーの取得
  3679.   #--------------------------------------------------------------------------
  3680.   def cursor_battler
  3681.     $game_temp.target_cursor_sprite.battler
  3682.   end
  3683.   #--------------------------------------------------------------------------
  3684.   # ● [追加]:ターゲットカーソルの点滅状態に対応したシンボルを返す
  3685.   #--------------------------------------------------------------------------
  3686.   def cursor_effect
  3687.     $game_temp.target_cursor_sprite.blink ? :target_whiten : :command_whiten
  3688.   end
  3689.   #--------------------------------------------------------------------------
  3690.   # ● [追加]:対象選択フラッシュの設定
  3691.   #--------------------------------------------------------------------------
  3692.   def setup_cursor_effect
  3693.     if cursor_battler == @battler ||
  3694.        (cursor_battler == :party && @battler.actor?) ||
  3695.        ([:troop, :troop_random].include?(cursor_battler) && !@battler.actor?)
  3696.       if @effect_type == nil || @effect_type != cursor_effect
  3697.         start_effect(cursor_effect)
  3698.       end
  3699.     else
  3700.       # フラッシュエフェクト終了
  3701.       end_cursor_effect
  3702.     end
  3703.   end
  3704.   #--------------------------------------------------------------------------
  3705.   # ● [追加]:対象選択フラッシュの終了
  3706.   #--------------------------------------------------------------------------
  3707.   def end_cursor_effect
  3708.     if [:target_whiten, :command_whiten].include?(@effect_type)
  3709.       @effect_type = nil
  3710.       @effect_duration = 0
  3711.       revert_to_normal
  3712.     end
  3713.   end
  3714.   #--------------------------------------------------------------------------
  3715.   # ● [オーバーライド]:アニメーションスプライトの設定
  3716.   #--------------------------------------------------------------------------
  3717.   def animation_set_sprites(frame)
  3718.     o = self.opacity
  3719.     self.opacity = 255 if !@battler_visible || @effect_duration > 0
  3720.     # スーパークラスのメソッドを呼ぶ
  3721.     super(frame)
  3722.     self.opacity = o
  3723.   end
  3724.   #--------------------------------------------------------------------------
  3725.   # ● [オーバーライド]:アニメーションの原点設定
  3726.   #--------------------------------------------------------------------------
  3727.   def set_animation_origin
  3728.     # スーパークラスのメソッドを呼ぶ
  3729.     super
  3730.     # 画面アニメーションがアクターに再生されたら
  3731.     if @animation.position == 3 && @battler != nil && @battler.actor?
  3732.       # アニメーションのY座標を修正
  3733.       @ani_oy += LNX11::SCREEN_ANIMATION_OFFSET
  3734.     end
  3735.   end
  3736.   #--------------------------------------------------------------------------
  3737.   # ● [エイリアス]:転送元ビットマップの更新
  3738.   #--------------------------------------------------------------------------
  3739.   alias :lnx11a_update_bitmap :update_bitmap
  3740.   def update_bitmap
  3741.     if @battler.actor? && @battler.refresh_battler_graphic
  3742.       # バトラーグラフィックが変更されていれば更新する
  3743.       @battler.update_battler_graphic
  3744.     end
  3745.     if @battler.actor? && @battler.facebattler != nil
  3746.       # バトラー用顔グラフィックが作成されていれば、
  3747.       # それを Sprite の Bitmap とする
  3748.       new_bitmap = @battler.facebattler
  3749.       if bitmap != new_bitmap
  3750.         self.bitmap = new_bitmap
  3751.         init_visibility
  3752.       end
  3753.     else
  3754.       # 元のメソッドを呼ぶ
  3755.       lnx11a_update_bitmap
  3756.     end
  3757.   end
  3758.   #--------------------------------------------------------------------------
  3759.   # ● [エイリアス]:新しいアニメーションの設定
  3760.   #--------------------------------------------------------------------------
  3761.   alias :lnx11a_setup_new_animation :setup_new_animation
  3762.   def setup_new_animation
  3763.     lnx11a_setup_new_animation
  3764.     # ループアニメーションの設定
  3765.     if @battler.loop_animation_id > 0 && (@loop_animation == nil ||
  3766.        @battler.loop_animation_id != @loop_animation.id)
  3767.       animation = $data_animations[@battler.loop_animation_id]
  3768.       mirror = @battler.loop_animation_mirror
  3769.       start_loop_animation(animation, mirror)
  3770.     elsif @battler.loop_animation_id == 0 && @loop_animation
  3771.       end_loop_animation
  3772.     end
  3773.   end
  3774.   #--------------------------------------------------------------------------
  3775.   # ● [エイリアス]:新しいエフェクトの設定
  3776.   #--------------------------------------------------------------------------
  3777.   alias :lnx11a_setup_new_effect :setup_new_effect
  3778.   def setup_new_effect
  3779.     # 元のメソッドを呼ぶ
  3780.     lnx11a_setup_new_effect
  3781.     # フラッシュエフェクト設定
  3782.     if @battler_visible && cursor_battler
  3783.       setup_cursor_effect
  3784.     else
  3785.       # フラッシュエフェクト終了
  3786.       end_cursor_effect
  3787.     end
  3788.   end
  3789.   #--------------------------------------------------------------------------
  3790.   # ● [エイリアス]:エフェクトの開始
  3791.   #--------------------------------------------------------------------------
  3792.   alias :lnx11a_start_effect :start_effect
  3793.   def start_effect(effect_type)
  3794.     # エフェクト開始の追加
  3795.     @effect_type = effect_type
  3796.     case @effect_type
  3797.     when :target_whiten
  3798.       @effect_duration = 40
  3799.       @battler_visible = true
  3800.     when :command_whiten
  3801.       @effect_duration = 80
  3802.       @battler_visible = true
  3803.     end
  3804.     # 元のメソッドを呼ぶ
  3805.     lnx11a_start_effect(effect_type)
  3806.   end
  3807.   #--------------------------------------------------------------------------
  3808.   # ● [エイリアス]:エフェクトの更新
  3809.   #--------------------------------------------------------------------------
  3810.   alias :lnx11a_update_effect :update_effect
  3811.   def update_effect
  3812.     # エフェクト更新の追加
  3813.     if @effect_duration > 0
  3814.       @effect_duration -= 1
  3815.       case @effect_type
  3816.       when :target_whiten
  3817.         update_target_whiten
  3818.       when :command_whiten
  3819.         update_command_whiten
  3820.       end
  3821.       @effect_duration += 1
  3822.     end
  3823.     # 元のメソッドを呼ぶ
  3824.     lnx11a_update_effect
  3825.   end
  3826.   #--------------------------------------------------------------------------
  3827.   # ● [追加]:対象選択フラッシュエフェクトの更新
  3828.   #--------------------------------------------------------------------------
  3829.   def update_target_whiten
  3830.     alpha = @effect_duration < 20 ? @effect_duration : 40 - @effect_duration
  3831.     self.color.set(255, 255, 255, 0)
  3832.     self.color.alpha = (alpha + 1) * 2
  3833.   end
  3834.   #--------------------------------------------------------------------------
  3835.   # ● [追加]:コマンド選択フラッシュエフェクトの更新
  3836.   #--------------------------------------------------------------------------
  3837.   def update_command_whiten
  3838.     alpha = @effect_duration < 40 ? @effect_duration : 80 - @effect_duration
  3839.     self.color.set(255, 255, 255, 0)
  3840.     self.color.alpha = alpha * 2
  3841.   end
  3842.   #--------------------------------------------------------------------------
  3843.   # ● [追加]:高さの取得
  3844.   #--------------------------------------------------------------------------
  3845.   def bitmap_height
  3846.     self.bitmap.height
  3847.   end
  3848.   #--------------------------------------------------------------------------
  3849.   # ● [エイリアス]:位置の更新
  3850.   #--------------------------------------------------------------------------
  3851.   alias :lnx11a_update_position :update_position
  3852.   def update_position
  3853.     # 元のメソッドを呼ぶ
  3854.     lnx11a_update_position
  3855.     # 高さを更新
  3856.     @battler.bitmap_height = bitmap_height
  3857.     # 可視状態を更新
  3858.     self.visible = !$game_party.actor_invisible if @battler.actor?
  3859.   end
  3860.   if LNX11::ENHANCED_WHITEN
  3861.     # 白フラッシュを強めにする
  3862.     #------------------------------------------------------------------------
  3863.     # ● [再定義]:白フラッシュエフェクトの更新
  3864.     #------------------------------------------------------------------------
  3865.     def update_whiten
  3866.       self.color.set(255, 255, 255, 0)
  3867.       self.color.alpha = 192 - (16 - @effect_duration) * 12
  3868.     end
  3869.   end
  3870.   #--------------------------------------------------------------------------
  3871.   # ● ループアニメーションの追加
  3872.   #--------------------------------------------------------------------------
  3873.   #--------------------------------------------------------------------------
  3874.   # ● [追加]:クラス変数
  3875.   #--------------------------------------------------------------------------
  3876.   @@loop_ani_checker = []
  3877.   @@loop_ani_spr_checker = []
  3878.   #--------------------------------------------------------------------------
  3879.   # ● [エイリアス]:オブジェクト初期化
  3880.   #--------------------------------------------------------------------------
  3881.   alias :lnx11a_initialize :initialize
  3882.   def initialize(viewport, battler = nil)
  3883.     # 元のメソッドを呼ぶ
  3884.     lnx11a_initialize(viewport, battler)
  3885.     # ループアニメの残り時間
  3886.     @loop_ani_duration = 0
  3887.   end
  3888.   #--------------------------------------------------------------------------
  3889.   # ● [エイリアス]:解放
  3890.   #--------------------------------------------------------------------------
  3891.   alias :lnx11a_dispose :dispose
  3892.   def dispose
  3893.     # 元のメソッドを呼ぶ
  3894.     lnx11a_dispose
  3895.     # ループアニメを解放
  3896.     dispose_loop_animation
  3897.   end
  3898.   #--------------------------------------------------------------------------
  3899.   # ● [エイリアス]:フレーム更新
  3900.   #--------------------------------------------------------------------------
  3901.   alias :lnx11a_update :update
  3902.   def update
  3903.     # 元のメソッドを呼ぶ
  3904.     lnx11a_update
  3905.     update_loop_animation
  3906.     @@loop_ani_checker.clear
  3907.     @@loop_ani_spr_checker.clear
  3908.   end
  3909.   #--------------------------------------------------------------------------
  3910.   # ● [追加]:ループアニメーション表示中判定
  3911.   #--------------------------------------------------------------------------
  3912.   def loop_animation?
  3913.     @loop_animation != nil
  3914.   end
  3915.   #--------------------------------------------------------------------------
  3916.   # ● [追加]:ループアニメーションの開始
  3917.   #--------------------------------------------------------------------------
  3918.   def start_loop_animation(animation, mirror = false)
  3919.     dispose_loop_animation
  3920.     @loop_animation = animation
  3921.     if @loop_animation
  3922.       @loop_ani_mirror = mirror
  3923.       set_loop_animation_rate
  3924.       @loop_ani_duration = @loop_animation.frame_max * @loop_ani_rate + 1
  3925.       load_loop_animation_bitmap
  3926.       make_loop_animation_sprites
  3927.       set_loop_animation_origin
  3928.     end
  3929.   end
  3930.   #--------------------------------------------------------------------------
  3931.   # ● [追加]:ループアニメーションの速度を設定
  3932.   #--------------------------------------------------------------------------
  3933.   def set_loop_animation_rate
  3934.     if $lnx_include[:lnx09]
  3935.       # LNX09 を導入している
  3936.       default = LNX09::DEFAULT_BATTLE_SPEED_RATE
  3937.       if @loop_animation.speed_rate
  3938.         @loop_ani_rate = @loop_animation.speed_rate
  3939.       else
  3940.         @loop_ani_rate = default
  3941.       end
  3942.     else
  3943.       @loop_ani_rate = 4
  3944.     end
  3945.   end
  3946.   #--------------------------------------------------------------------------
  3947.   # ● [追加]:ループアニメーション グラフィックの読み込み
  3948.   #--------------------------------------------------------------------------
  3949.   def load_loop_animation_bitmap
  3950.     animation1_name = @loop_animation.animation1_name
  3951.     animation1_hue = @loop_animation.animation1_hue
  3952.     animation2_name = @loop_animation.animation2_name
  3953.     animation2_hue = @loop_animation.animation2_hue
  3954.     @loop_ani_bitmap1 = Cache.animation(animation1_name, animation1_hue)
  3955.     @loop_ani_bitmap2 = Cache.animation(animation2_name, animation2_hue)
  3956.     if @@_reference_count.include?(@loop_ani_bitmap1)
  3957.       @@_reference_count[@loop_ani_bitmap1] += 1
  3958.     else
  3959.       @@_reference_count[@loop_ani_bitmap1] = 1
  3960.     end
  3961.     if @@_reference_count.include?(@loop_ani_bitmap2)
  3962.       @@_reference_count[@loop_ani_bitmap2] += 1
  3963.     else
  3964.       @@_reference_count[@loop_ani_bitmap2] = 1
  3965.     end
  3966.     Graphics.frame_reset
  3967.   end
  3968.   #--------------------------------------------------------------------------
  3969.   # ● [追加]:ループアニメーションスプライトの作成
  3970.   #--------------------------------------------------------------------------
  3971.   def make_loop_animation_sprites
  3972.     @loop_ani_sprites = []
  3973.     if @use_sprite && !@@loop_ani_spr_checker.include?(@loop_animation)
  3974.       16.times do
  3975.         sprite = ::Sprite.new(viewport)
  3976.         sprite.visible = false
  3977.         @loop_ani_sprites.push(sprite)
  3978.       end
  3979.       if @loop_animation.position == 3
  3980.         @@loop_ani_spr_checker.push(@loop_animation)
  3981.       end
  3982.     end
  3983.     @loop_ani_duplicated = @@loop_ani_checker.include?(@loop_animation)
  3984.     if !@loop_ani_duplicated && @loop_animation.position == 3
  3985.       @@loop_ani_checker.push(@loop_animation)
  3986.     end
  3987.   end
  3988.   #--------------------------------------------------------------------------
  3989.   # ● [追加]:ループアニメーションの原点設定
  3990.   #--------------------------------------------------------------------------
  3991.   def set_loop_animation_origin
  3992.     if @loop_animation.position == 3
  3993.       if viewport == nil
  3994.         @loop_ani_ox = Graphics.width / 2
  3995.         @loop_ani_oy = Graphics.height / 2
  3996.       else
  3997.         @loop_ani_ox = viewport.rect.width / 2
  3998.         @loop_ani_oy = viewport.rect.height / 2
  3999.       end
  4000.     else
  4001.       @loop_ani_ox = x - ox + width / 2
  4002.       @loop_ani_oy = y - oy + height / 2
  4003.       if @loop_animation.position == 0
  4004.         @loop_ani_oy -= height / 2
  4005.       elsif @loop_animation.position == 2
  4006.         @loop_ani_oy += height / 2
  4007.       end
  4008.     end
  4009.   end
  4010.   #--------------------------------------------------------------------------
  4011.   # ● [追加]:ループアニメーションの解放
  4012.   #--------------------------------------------------------------------------
  4013.   def dispose_loop_animation
  4014.     if @loop_ani_bitmap1
  4015.       @@_reference_count[@loop_ani_bitmap1] -= 1
  4016.       if @@_reference_count[@loop_ani_bitmap1] == 0
  4017.         @loop_ani_bitmap1.dispose
  4018.       end
  4019.     end
  4020.     if @loop_ani_bitmap2
  4021.       @@_reference_count[@loop_ani_bitmap2] -= 1
  4022.       if @@_reference_count[@loop_ani_bitmap2] == 0
  4023.         @loop_ani_bitmap2.dispose
  4024.       end
  4025.     end
  4026.     if @loop_ani_sprites
  4027.       @loop_ani_sprites.each {|sprite| sprite.dispose }
  4028.       @loop_ani_sprites = nil
  4029.       @loop_animation = nil
  4030.     end
  4031.     @loop_ani_bitmap1 = nil
  4032.     @loop_ani_bitmap2 = nil
  4033.   end
  4034.   #--------------------------------------------------------------------------
  4035.   # ● [追加]:ループアニメーションの更新
  4036.   #--------------------------------------------------------------------------
  4037.   def update_loop_animation
  4038.     return unless loop_animation?
  4039.     @loop_ani_duration -= 1
  4040.     if @loop_ani_duration % @loop_ani_rate == 0
  4041.       if @loop_ani_duration > 0
  4042.         frame_index = @loop_animation.frame_max
  4043.         speed = (@loop_ani_duration + @loop_ani_rate - 1) / @loop_ani_rate
  4044.         frame_index -= speed
  4045.         loop_animation_set_sprites(@loop_animation.frames[frame_index])
  4046.         @loop_animation.timings.each do |timing|
  4047.           loop_animation_process_timing(timing) if timing.frame == frame_index
  4048.         end
  4049.       else
  4050.         # 残り時間を再設定してループ
  4051.         @loop_ani_duration = @loop_animation.frame_max * @loop_ani_rate + 1
  4052.       end
  4053.     end
  4054.   end
  4055.   #--------------------------------------------------------------------------
  4056.   # ● [追加]:ループアニメーションの終了
  4057.   #--------------------------------------------------------------------------
  4058.   def end_loop_animation
  4059.     dispose_loop_animation
  4060.   end
  4061.   #--------------------------------------------------------------------------
  4062.   # ● [追加]:ループアニメーションスプライトの設定
  4063.   #     frame : フレームデータ(RPG::Animation::Frame)
  4064.   #--------------------------------------------------------------------------
  4065.   def loop_animation_set_sprites(frame)
  4066.     cell_data = frame.cell_data
  4067.     @loop_ani_sprites.each_with_index do |sprite, i|
  4068.       next unless sprite
  4069.       pattern = cell_data[i, 0]
  4070.       if !pattern || pattern < 0
  4071.         sprite.visible = false
  4072.         next
  4073.       end
  4074.       sprite.bitmap = pattern < 100 ? @loop_ani_bitmap1 : @loop_ani_bitmap2
  4075.       sprite.visible = true
  4076.       sprite.src_rect.set(pattern % 5 * 192,
  4077.         pattern % 100 / 5 * 192, 192, 192)
  4078.       if @loop_ani_mirror
  4079.         sprite.x = @loop_ani_ox - cell_data[i, 1]
  4080.         sprite.y = @loop_ani_oy + cell_data[i, 2]
  4081.         sprite.angle = (360 - cell_data[i, 4])
  4082.         sprite.mirror = (cell_data[i, 5] == 0)
  4083.       else
  4084.         sprite.x = @loop_ani_ox + cell_data[i, 1]
  4085.         sprite.y = @loop_ani_oy + cell_data[i, 2]
  4086.         sprite.angle = cell_data[i, 4]
  4087.         sprite.mirror = (cell_data[i, 5] == 1)
  4088.       end
  4089.       sprite.z = self.z + 316 + i
  4090.       sprite.ox = 96
  4091.       sprite.oy = 96
  4092.       sprite.zoom_x = cell_data[i, 3] / 100.0
  4093.       sprite.zoom_y = cell_data[i, 3] / 100.0
  4094.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  4095.       sprite.blend_type = cell_data[i, 7]
  4096.     end
  4097.   end
  4098.   #--------------------------------------------------------------------------
  4099.   # ● [追加]:SE とフラッシュのタイミング処理
  4100.   #     timing : タイミングデータ(RPG::Animation::Timing)
  4101.   #--------------------------------------------------------------------------
  4102.   def loop_animation_process_timing(timing)
  4103.     timing.se.play unless @loop_ani_duplicated
  4104.     case timing.flash_scope
  4105.     when 1
  4106.       self.flash(timing.flash_color, timing.flash_duration * @loop_ani_rate)
  4107.     when 2
  4108.       if viewport && !@loop_ani_duplicated
  4109.         duration = timing.flash_duration * @loop_ani_rate
  4110.         viewport.flash(timing.flash_color, duration)
  4111.       end
  4112.     when 3
  4113.       self.flash(nil, timing.flash_duration * @loop_ani_rate)
  4114.     end
  4115.   end
  4116. end
  4117.  
  4118. #==============================================================================
  4119. # ■ Spriteset_Battle
  4120. #------------------------------------------------------------------------------
  4121. #  バトル画面のスプライトをまとめたクラスです。
  4122. #==============================================================================
  4123.  
  4124. class Spriteset_Battle
  4125.   #--------------------------------------------------------------------------
  4126.   # ● [エイリアス]:オブジェクト初期化
  4127.   #--------------------------------------------------------------------------
  4128.   alias :lnx11a_initialize :initialize
  4129.   def initialize
  4130.     # 元のメソッドを呼ぶ
  4131.     lnx11a_initialize
  4132.     # アクターエリアの背景の作成
  4133.     create_actor_background
  4134.   end
  4135.   #--------------------------------------------------------------------------
  4136.   # ● [エイリアス]:解放
  4137.   #--------------------------------------------------------------------------
  4138.   alias :lnx11a_dispose :dispose
  4139.   def dispose
  4140.     # 元のメソッドを呼ぶ
  4141.     lnx11a_dispose
  4142.     # アクターエリアの背景の解放
  4143.     dispose_actor_background
  4144.   end
  4145.   #--------------------------------------------------------------------------
  4146.   # ● [エイリアス]:フレーム更新
  4147.   #--------------------------------------------------------------------------
  4148.   alias :lnx11a_update :update
  4149.   def update
  4150.     # 元のメソッドを呼ぶ
  4151.     lnx11a_update
  4152.     # アクターエリアの背景の更新
  4153.     update_actor_background
  4154.   end
  4155.   #--------------------------------------------------------------------------
  4156.   # ● [追加]:アクターのビューポート
  4157.   #--------------------------------------------------------------------------
  4158.   def actor_viewport
  4159.     LNX11::ACTOR_SCREEN_TONE ? @viewport1 : @viewport2
  4160.   end
  4161.   #--------------------------------------------------------------------------
  4162.   # ● [追加]:アクターエリアの背景の作成
  4163.   #--------------------------------------------------------------------------
  4164.   def create_actor_background
  4165.     return if LNX11::ACTOR_BACKGROUND == 0
  4166.     viewport = actor_viewport
  4167.     height = LNX11::ACTOR_BACKGROUND_HEIGHT
  4168.     case LNX11::ACTOR_BACKGROUND
  4169.     when 1
  4170.       # グラデーション
  4171.       @actor_background = Sprite.new
  4172.       back = Bitmap.new(Graphics.width, height)
  4173.       color = LNX11::ACTOR_BG_GRADIENT_COLOR
  4174.       back.gradient_fill_rect(back.rect, color[0], color[1], true)
  4175.       @actor_background.bitmap = back
  4176.     when 2
  4177.       # ウィンドウ
  4178.       @actor_background = Window_Base.new(0, 0, Graphics.width, height)
  4179.     else
  4180.       if LNX11::ACTOR_BACKGROUND.is_a?(String)
  4181.         # ファイル指定
  4182.         @actor_background = Sprite.new
  4183.         @actor_background.bitmap = Cache.system(LNX11::ACTOR_BACKGROUND)
  4184.         @actor_background.x = Graphics.width / 2
  4185.         @actor_background.ox = @actor_background.bitmap.width / 2
  4186.         height = @actor_background.bitmap.height
  4187.       end
  4188.     end
  4189.     @actor_background.viewport = viewport
  4190.     @actor_background.y = Graphics.height - height
  4191.     @actor_background.z = viewport == @viewport1 ? 120 : -20
  4192.     update_actor_background
  4193.   end
  4194.   #--------------------------------------------------------------------------
  4195.   # ● [追加]:アクターエリアの背景の解放
  4196.   #--------------------------------------------------------------------------
  4197.   def dispose_actor_background
  4198.     return unless @actor_background
  4199.     @actor_background.bitmap.dispose if @actor_background.is_a?(Sprite)
  4200.     @actor_background.dispose
  4201.   end
  4202.   #--------------------------------------------------------------------------
  4203.   # ● [追加]:アクターエリアの背景の更新
  4204.   #--------------------------------------------------------------------------
  4205.   def update_actor_background
  4206.     return unless @actor_background
  4207.     @actor_background.visible = !$game_party.actor_bg_invisible
  4208.   end
  4209.   #--------------------------------------------------------------------------
  4210.   # ● [再定義]:アクタースプライトの作成
  4211.   #--------------------------------------------------------------------------
  4212.   def create_actors
  4213.     # 座標とグラフィックの設定
  4214.     $game_party.set_members_xyz
  4215.     $game_party.set_members_battle_graphic
  4216.     # スプライトの作成
  4217.     viewport = actor_viewport
  4218.     @actor_sprites = $game_party.battle_members.collect do |actor|
  4219.       Sprite_Battler.new(viewport, actor)
  4220.     end
  4221.   end
  4222.   #--------------------------------------------------------------------------
  4223.   # ● [再定義]:アクタースプライトの更新
  4224.   #--------------------------------------------------------------------------
  4225.   def update_actors
  4226.     @actor_sprites.each {|sprite| sprite.update }
  4227.   end
  4228. end
  4229.  
  4230. #==============================================================================
  4231. # ■ Scene_Battle
  4232. #------------------------------------------------------------------------------
  4233. #  バトル画面の処理を行うクラスです。
  4234. #==============================================================================
  4235.  
  4236. class Scene_Battle < Scene_Base
  4237.   #--------------------------------------------------------------------------
  4238.   # ● [追加]:簡易ヘルプのメソッド設定
  4239.   #--------------------------------------------------------------------------
  4240.   def set_helpdisplay_methods
  4241.     BattleManager.update_for_wait_method = method(:update_for_wait)
  4242.     BattleManager.helpdisplay_set_method = method(:helpdisplay_set)
  4243.     BattleManager.helpdisplay_clear_method = method(:helpdisplay_clear)
  4244.     BattleManager.helpdisplay_wait_short_method=method(:helpdisplay_wait_short)
  4245.   end
  4246.   #--------------------------------------------------------------------------
  4247.   # ● [追加]:簡易ヘルプ表示
  4248.   #--------------------------------------------------------------------------
  4249.   def helpdisplay_set(item, duration = nil)
  4250.     @wait_short_disabled = false
  4251.     @targethelp_window.show.set_item(item)
  4252.     @targethelp_window.update
  4253.     wait(duration ? duration : 20)
  4254.   end
  4255.   #--------------------------------------------------------------------------
  4256.   # ● [追加]:簡易ヘルプ消去
  4257.   #--------------------------------------------------------------------------
  4258.   def helpdisplay_clear(duration = nil)
  4259.     return if !@targethelp_window.visible
  4260.     @wait_short_disabled = false
  4261.     @targethelp_window.clear
  4262.     @targethelp_window.hide
  4263.     wait(duration ? duration : 10)
  4264.   end
  4265.   #--------------------------------------------------------------------------
  4266.   # ● [追加]:簡易ヘルプ・短時間ウェイト
  4267.   #--------------------------------------------------------------------------
  4268.   def helpdisplay_wait_short
  4269.     return if !@targethelp_window.visible || @wait_short_disabled
  4270.     @wait_short_disabled = true # 連続で短時間ウェイトが実行されないように
  4271.     @targethelp_window.clear
  4272.     abs_wait_short
  4273.   end
  4274.   #--------------------------------------------------------------------------
  4275.   # ● [追加]:バトラーのエフェクト実行中?
  4276.   #--------------------------------------------------------------------------
  4277.   def battler_effect?
  4278.     @spriteset.effect?
  4279.   end
  4280.   #--------------------------------------------------------------------------
  4281.   # ● [エイリアス]:コマンド[逃げる]
  4282.   #--------------------------------------------------------------------------
  4283.   alias :lnx11a_command_escape :command_escape
  4284.   def command_escape
  4285.     @party_command_window.close
  4286.     @party_command_window.openness = 0 if LNX11::MESSAGE_TYPE == 2
  4287.     @status_window.unselect
  4288.     # 元のメソッドを呼ぶ
  4289.     lnx11a_command_escape
  4290.   end
  4291.   #--------------------------------------------------------------------------
  4292.   # ● [エイリアス]:スキル/アイテムの使用
  4293.   #--------------------------------------------------------------------------
  4294.   alias :lnx11a_use_item :use_item
  4295.   def use_item
  4296.     # 簡易ヘルプ表示
  4297.     item = @subject.current_action.item
  4298.     if LNX11::BATTLELOG_TYPE == 2 && !item.no_display
  4299.       helpdisplay_set(item, item.display_wait)
  4300.     end
  4301.     # 元のメソッドを呼ぶ
  4302.     lnx11a_use_item
  4303.     # 簡易ヘルプ消去・エフェクトが終わるまで待つ
  4304.     if LNX11::BATTLELOG_TYPE == 2
  4305.       wait(item.end_wait)
  4306.       helpdisplay_clear
  4307.     end
  4308.     wait_for_effect
  4309.   end
  4310.   #--------------------------------------------------------------------------
  4311.   # ● [エイリアス]:開始処理
  4312.   #--------------------------------------------------------------------------
  4313.   alias :lnx11a_start :start
  4314.   def start
  4315.     set_helpdisplay_methods
  4316.     @last_party_members = party_members
  4317.     $game_temp.method_battle_status_refresh = method(:refresh_status)
  4318.     $game_temp.clear_last_target_cursor
  4319.     $game_party.all_members.each {|actor| actor.last_actor_command = 0 }
  4320.     reset_sprite_effects
  4321.     standby_message_window_position
  4322.     create_targetcursor
  4323.     create_popup
  4324.     #元のメソッドを呼ぶ
  4325.     lnx11a_start
  4326.   end
  4327.   #--------------------------------------------------------------------------
  4328.   # ● [エイリアス]:終了処理
  4329.   #--------------------------------------------------------------------------
  4330.   alias :lnx11a_terminate :terminate
  4331.   def terminate
  4332.     $game_message.clear
  4333.     dispose_targetcursor
  4334.     dispose_popup
  4335.     # 元のメソッドを呼ぶ
  4336.     lnx11a_terminate
  4337.   end
  4338.   #--------------------------------------------------------------------------
  4339.   # ● [追加]:アクターのスプライト情報の初期化
  4340.   #--------------------------------------------------------------------------
  4341.   def reset_sprite_effects
  4342.     $game_party.battle_members.each do |actor|
  4343.       actor.popup_delay_clear
  4344.       actor.set_state_animation
  4345.     end
  4346.   end
  4347.   #--------------------------------------------------------------------------
  4348.   # ● [エイリアス]:全ウィンドウの作成
  4349.   #--------------------------------------------------------------------------
  4350.   alias :lnx11a_create_all_windows :create_all_windows
  4351.   def create_all_windows
  4352.     # 元のメソッドを呼ぶ
  4353.     lnx11a_create_all_windows
  4354.     create_targethelp_window
  4355.   end
  4356.   #--------------------------------------------------------------------------
  4357.   # ● [エイリアス]:ステータスウィンドウの作成
  4358.   #--------------------------------------------------------------------------
  4359.   alias :lnx11a_create_status_window :create_status_window
  4360.   def create_status_window
  4361.     # 元のメソッドを呼ぶ
  4362.     lnx11a_create_status_window
  4363.     @status_window.set_xy
  4364.   end
  4365.   #--------------------------------------------------------------------------
  4366.   # ● [エイリアス]:情報表示ビューポートの作成
  4367.   #--------------------------------------------------------------------------
  4368.   alias :lnx11a_create_info_viewport :create_info_viewport
  4369.   def create_info_viewport
  4370.     # 元のメソッドを呼ぶ
  4371.     lnx11a_create_info_viewport
  4372.     # ビューポートを修正
  4373.     @info_viewport.rect.y = Graphics.height - LNX11::ACTOR_BACKGROUND_HEIGHT
  4374.     @info_viewport.rect.height = LNX11::ACTOR_BACKGROUND_HEIGHT
  4375.     @status_window.viewport = nil
  4376.   end
  4377.   #--------------------------------------------------------------------------
  4378.   # ● [エイリアス]:パーティコマンドウィンドウの作成
  4379.   #--------------------------------------------------------------------------
  4380.   alias :lnx11a_create_party_command_window :create_party_command_window
  4381.   def create_party_command_window
  4382.     # 元のメソッドを呼ぶ
  4383.     lnx11a_create_party_command_window
  4384.     @party_command_window.viewport = nil
  4385.   end
  4386.   #--------------------------------------------------------------------------
  4387.   # ● [エイリアス]:アクターコマンドウィンドウの作成
  4388.   #--------------------------------------------------------------------------
  4389.   alias :lnx11a_create_actor_command_window :create_actor_command_window
  4390.   def create_actor_command_window
  4391.     # 元のメソッドを呼ぶ
  4392.     lnx11a_create_actor_command_window
  4393.     @actor_command_window.viewport = nil
  4394.   end
  4395.   #--------------------------------------------------------------------------
  4396.   # ● [エイリアス]:ログウィンドウの作成
  4397.   #--------------------------------------------------------------------------
  4398.   alias :lnx11a_create_log_window :create_log_window
  4399.   def create_log_window
  4400.     # 元のメソッドを呼ぶ
  4401.     lnx11a_create_log_window
  4402.     # ウェイトメソッド
  4403.     @log_window.method_wait_for_animation = method(:wait_for_animation)
  4404.   end  
  4405.   #--------------------------------------------------------------------------
  4406.   # ● [追加]:ターゲットカーソルの作成
  4407.   #--------------------------------------------------------------------------
  4408.   def create_targetcursor
  4409.     @targetcursor = Sprite_TargetCursor.new
  4410.     $game_temp.target_cursor_sprite = @targetcursor
  4411.   end
  4412.   #--------------------------------------------------------------------------
  4413.   # ● [追加]:ターゲットカーソルの解放
  4414.   #--------------------------------------------------------------------------
  4415.   def dispose_targetcursor
  4416.     @targetcursor.dispose
  4417.   end
  4418.   #--------------------------------------------------------------------------
  4419.   # ● [追加]:ターゲットヘルプウィンドウの作成
  4420.   #--------------------------------------------------------------------------
  4421.   def create_targethelp_window
  4422.     @targethelp_window = Window_TargetHelp.new
  4423.     @targethelp_window.visible = false
  4424.     # ターゲット選択ウィンドウに関連付ける
  4425.     @actor_window.help_window = @targethelp_window
  4426.     @enemy_window.help_window = @targethelp_window
  4427.   end
  4428.   #--------------------------------------------------------------------------
  4429.   # ● [追加]:ポップアップの作成
  4430.   #--------------------------------------------------------------------------
  4431.   def create_popup
  4432.     $game_temp.popup_data = Popup_Data.new
  4433.   end
  4434.   #--------------------------------------------------------------------------
  4435.   # ● [追加]:ポップアップの解放
  4436.   #--------------------------------------------------------------------------
  4437.   def dispose_popup
  4438.     $game_temp.popup_data.dispose
  4439.   end
  4440.   #--------------------------------------------------------------------------
  4441.   # ● [追加]:ポップアップデータの取得
  4442.   #--------------------------------------------------------------------------
  4443.   def popup_data
  4444.     $game_temp.popup_data
  4445.   end
  4446.   #--------------------------------------------------------------------------
  4447.   # ● [エイリアス]:フレーム更新(基本)
  4448.   #--------------------------------------------------------------------------
  4449.   alias :lnx11a_update_basic :update_basic
  4450.   def update_basic
  4451.     # 元のメソッドを呼ぶ
  4452.     lnx11a_update_basic
  4453.     # 追加したオブジェクトの更新
  4454.     update_targetcursor
  4455.     update_popup
  4456.     refresh_actors
  4457.   end
  4458.   #--------------------------------------------------------------------------
  4459.   # ● [追加]:パーティメンバーの ID 配列の取得
  4460.   #--------------------------------------------------------------------------
  4461.   def party_members
  4462.     $game_party.battle_members.collect {|actor| actor.id }
  4463.   end
  4464.   #--------------------------------------------------------------------------
  4465.   # ● [追加]:メンバーが入れ替わったらオブジェクトを再作成する
  4466.   #--------------------------------------------------------------------------
  4467.   def refresh_actors
  4468.     a_party_members = party_members
  4469.     return if @last_party_members == a_party_members
  4470.     @last_party_members = a_party_members
  4471.     $game_party.battle_members.each {|actor| actor.sprite_effect_type=:appear }
  4472.     reset_sprite_effects
  4473.     @spriteset.dispose_actors
  4474.     @spriteset.create_actors
  4475.     status_clear
  4476.     refresh_status
  4477.     Graphics.frame_reset
  4478.   end
  4479.   #--------------------------------------------------------------------------
  4480.   # ● [追加]:ステータスウィンドウの情報を更新(メンバー交代用)
  4481.   #--------------------------------------------------------------------------
  4482.   def status_clear
  4483.     @status_window.all_clear
  4484.   end
  4485.   #--------------------------------------------------------------------------
  4486.   # ● [追加]:メッセージウィンドウの位置の初期化
  4487.   #  毎フレーム呼び出すことで、イベントコマンド以外のメッセージの位置を
  4488.   # 固定します。
  4489.   #--------------------------------------------------------------------------
  4490.   def standby_message_window_position
  4491.     $game_message.background = LNX11::MESSAGE_WINDOW_BACKGROUND
  4492.     $game_message.position = LNX11::MESSAGE_WINDOW_POSITION
  4493.   end
  4494.   #--------------------------------------------------------------------------
  4495.   # ● [再定義]:メッセージウィンドウを開く処理の更新
  4496.   #    ステータスウィンドウなどが閉じ終わるまでオープン度を 0 にする。
  4497.   #--------------------------------------------------------------------------
  4498.   def update_message_open
  4499.     if $game_message.busy?
  4500.       @party_command_window.close
  4501.       @actor_command_window.close
  4502.       $game_temp.battlelog_clear = true
  4503.     else
  4504.       standby_message_window_position
  4505.     end
  4506.   end
  4507.   #--------------------------------------------------------------------------
  4508.   # ● [追加]:ターゲットカーソル更新
  4509.   #--------------------------------------------------------------------------
  4510.   def update_targetcursor
  4511.     # 選択中のバトラーの座標を設定する
  4512.     if @actor_window.active
  4513.       # アクター選択ウィンドウがアクティブ
  4514.       @targetcursor.set(@actor_window.targetcursor, true)
  4515.     elsif @enemy_window.active
  4516.       # 敵キャラ選択ウィンドウがアクティブ
  4517.       @targetcursor.set(@enemy_window.targetcursor, true)
  4518.     elsif @status_window.index >= 0
  4519.       # ステータスウィンドウがアクティブ
  4520.       @targetcursor.set(@status_window.actor)
  4521.     else
  4522.       # どれもアクティブでない場合は非表示
  4523.       @targetcursor.hide
  4524.     end
  4525.     @targetcursor.update
  4526.   end
  4527.   #--------------------------------------------------------------------------
  4528.   # ● [追加]:ポップアップ更新
  4529.   #--------------------------------------------------------------------------
  4530.   def update_popup
  4531.     # ポップアップスプライトの更新
  4532.     popup_data.update
  4533.   end  
  4534.   #--------------------------------------------------------------------------
  4535.   # ● [エイリアス]:パーティコマンド選択の開始
  4536.   #--------------------------------------------------------------------------
  4537.   alias :lnx11a_start_party_command_selection :start_party_command_selection
  4538.   def start_party_command_selection
  4539.     # 元のメソッドを呼ぶ
  4540.     lnx11a_start_party_command_selection
  4541.     # バトルログ削除
  4542.     @log_window.lines_clear
  4543.     $game_temp.battlelog_clear = LNX11::STORAGE_TURNEND_CLEAR
  4544.     @actor_command = false
  4545.     # 2ターン目以降のパーテイコマンドスキップ
  4546.     return unless @party_command_skip
  4547.     @party_command_skip = false
  4548.     command_fight if !scene_changing? && @party_command_window.active
  4549.   end
  4550.   #--------------------------------------------------------------------------
  4551.   # ● [エイリアス]:アクターコマンド選択の開始
  4552.   #--------------------------------------------------------------------------
  4553.   alias :lnx11a_start_actor_command_selection :start_actor_command_selection
  4554.   def start_actor_command_selection
  4555.     # 元のメソッドを呼ぶ
  4556.     lnx11a_start_actor_command_selection
  4557.     @actor_command = true
  4558.   end
  4559.   #--------------------------------------------------------------------------
  4560.   # ● [エイリアス]:ターン終了
  4561.   #--------------------------------------------------------------------------
  4562.   alias :lnx11a_turn_end :turn_end
  4563.   def turn_end
  4564.     @party_command_skip = (LNX11::PARTY_COMMAND_SKIP && @actor_command)
  4565.     @actor_command = false
  4566.     # 元のメソッドを呼ぶ
  4567.     lnx11a_turn_end
  4568.   end
  4569.   #--------------------------------------------------------------------------
  4570.   # ● [追加]:アクターの選択したアイテム・スキルを返す
  4571.   #--------------------------------------------------------------------------
  4572.   def actor_selection_item
  4573.     case @actor_command_window.current_symbol
  4574.     when :attack ; $data_skills[BattleManager.actor.attack_skill_id]
  4575.     when :skill  ; @skill
  4576.     when :item   ; @item
  4577.     when :guard  ; $data_skills[BattleManager.actor.guard_skill_id]
  4578.     else ; nil
  4579.     end
  4580.   end
  4581.   #--------------------------------------------------------------------------
  4582.   # ● [エイリアス]:コマンド[防御]
  4583.   #--------------------------------------------------------------------------
  4584.   alias :lnx11a_command_guard :command_guard
  4585.   def command_guard
  4586.     if LNX11::GUARD_TARGET_CHECKE
  4587.       BattleManager.actor.input.set_guard
  4588.       # アクター選択
  4589.       select_actor_selection
  4590.     else
  4591.       # 元のメソッドを呼ぶ
  4592.       lnx11a_command_guard
  4593.     end
  4594.   end
  4595.   #--------------------------------------------------------------------------
  4596.   # ● [エイリアス]:アクター選択の開始
  4597.   #--------------------------------------------------------------------------
  4598.   alias :lnx11a_select_actor_selection :select_actor_selection
  4599.   def select_actor_selection
  4600.     # ターゲットチェック
  4601.     @actor_window.set_target(actor_selection_item)
  4602.     # 元のメソッドを呼ぶ
  4603.     lnx11a_select_actor_selection
  4604.     # ターゲットチェック
  4605.     @actor_window.set_target_refresh(actor_selection_item, BattleManager.actor)
  4606.   end
  4607.   #--------------------------------------------------------------------------
  4608.   # ● [エイリアス]:敵キャラ選択の開始
  4609.   #--------------------------------------------------------------------------
  4610.   alias :lnx11a_select_enemy_selection :select_enemy_selection
  4611.   def select_enemy_selection
  4612.     # ターゲットチェック
  4613.     @enemy_window.set_target(actor_selection_item)
  4614.     # 元のメソッドを呼ぶ
  4615.     lnx11a_select_enemy_selection
  4616.     # ターゲットチェック
  4617.     @enemy_window.set_target_refresh(actor_selection_item, BattleManager.actor)
  4618.   end
  4619.   #--------------------------------------------------------------------------
  4620.   # ● [エイリアス]アクター[キャンセル]
  4621.   #--------------------------------------------------------------------------
  4622.   alias :lnx11a_on_actor_cancel :on_actor_cancel
  4623.   def on_actor_cancel
  4624.     # 元のメソッドを呼ぶ
  4625.     lnx11a_on_actor_cancel
  4626.     # 防御の場合
  4627.     case @actor_command_window.current_symbol
  4628.     when :guard
  4629.       @actor_command_window.activate
  4630.     end   
  4631.   end
  4632.   #--------------------------------------------------------------------------
  4633.   # ● [エイリアス]:攻撃アニメーションの表示
  4634.   #--------------------------------------------------------------------------
  4635.   alias :lnx11a_show_attack_animation :show_attack_animation
  4636.   def show_attack_animation(targets)
  4637.     if @subject.actor?
  4638.       lnx11a_show_attack_animation(targets)
  4639.     else
  4640.       # 敵の通常攻撃アニメーション
  4641.       show_normal_animation(targets, @subject.atk_animation, false)
  4642.     end
  4643.   end
  4644. end
  4645.  
  4646. #==============================================================================
  4647. # ■ LNX11_Window_ActiveVisible
  4648. #------------------------------------------------------------------------------
  4649. #  バトル画面でターゲット選択中にウィンドウを非表示にするための
  4650. # ウィンドウ用モジュールです。
  4651. # ウィンドウの active と visible を連動させる役割があります。
  4652. # Window_ActorCommand,Window_BattleSkill, Window_BattleItem で
  4653. # インクルードされます。
  4654. #==============================================================================
  4655.  
  4656. module LNX11_Window_ActiveVisible
  4657.   #--------------------------------------------------------------------------
  4658.   # ● [オーバーライド]:ウィンドウのアクティブ化
  4659.   #--------------------------------------------------------------------------
  4660.   def activate
  4661.     self.show
  4662.     super
  4663.   end
  4664.   #--------------------------------------------------------------------------
  4665.   # ● [オーバーライド]:ウィンドウの非アクティブ化
  4666.   #--------------------------------------------------------------------------
  4667.   def deactivate
  4668.     @help_window != nil ? self.hide : self.visible = false
  4669.     super
  4670.   end
  4671. end
  4672.  
  4673. #==============================================================================
  4674. # ■ LNX11_Window_FittingList
  4675. #------------------------------------------------------------------------------
  4676. #  バトル画面のスキルリスト・アイテムリストを項目数に合わせてリサイズする
  4677. # ウィンドウ用モジュールです。
  4678. # Window_BattleSkill, Window_BattleItem でインクルードされます。
  4679. #==============================================================================
  4680.  
  4681. module LNX11_Window_FittingList
  4682.   #--------------------------------------------------------------------------
  4683.   # ● [追加]:ウィンドウの高さ(最大)
  4684.   #--------------------------------------------------------------------------
  4685.   def max_height
  4686.     @info_viewport.rect.y - @help_window.height
  4687.   end
  4688.   #--------------------------------------------------------------------------
  4689.   # ● [オーバーライド]:リフレッシュ
  4690.   #--------------------------------------------------------------------------
  4691.   def refresh
  4692.     make_item_list
  4693.     self.height = [fitting_height(row_max), max_height].min
  4694.     super
  4695.     self.oy = 0
  4696.   end
  4697. end
  4698.  
  4699. #==============================================================================
  4700. # ■ LNX11_Window_TargetHelp
  4701. #------------------------------------------------------------------------------
  4702. #  バトル画面で、ターゲット選択中にヘルプウィンドウを表示するための
  4703. # ウィンドウ用モジュールです。
  4704. # Window_BattleActor, Window_BattleEnemy でインクルードされます。
  4705. #==============================================================================
  4706.  
  4707. module LNX11_Window_TargetHelp
  4708.   #--------------------------------------------------------------------------
  4709.   # ● [追加]:ターゲットチェック
  4710.   #--------------------------------------------------------------------------
  4711.   def set_target(actor_selection_item)
  4712.     @cursor_fix = @cursor_all = @cursor_random = false
  4713.     item = actor_selection_item
  4714.     if actor_selection_item && !item.lnx11a_need_selection?
  4715.       # カーソルを固定
  4716.       @cursor_fix = true
  4717.       # 全体
  4718.       @cursor_all = item.for_all?
  4719.       # ランダム
  4720.       if item.for_random?
  4721.         @cursor_all = true
  4722.         @cursor_random = true
  4723.         @random_number = item.number_of_targets
  4724.       end
  4725.     end
  4726.     # 戦闘不能の味方が対象か?
  4727.     @dead_friend = item.for_dead_friend?
  4728.   end
  4729.   #--------------------------------------------------------------------------
  4730.   # ● [追加]:ターゲットチェック(リフレッシュ後)
  4731.   #--------------------------------------------------------------------------
  4732.   def set_target_refresh(actor_selection_item, actor)
  4733.     item = actor_selection_item
  4734.     # 使用者が対象なら、使用者にカーソルを合わせる
  4735.     select($game_party.members.index(actor)) if @cursor_fix && item.for_user?
  4736.   end
  4737.   #--------------------------------------------------------------------------
  4738.   # ● [オーバーライド]:ウィンドウの表示
  4739.   #--------------------------------------------------------------------------
  4740.   def show
  4741.     @help_window.show
  4742.     super
  4743.   end
  4744.   #--------------------------------------------------------------------------
  4745.   # ● [オーバーライド]:ウィンドウの非表示
  4746.   #--------------------------------------------------------------------------
  4747.   def hide
  4748.     @help_window.hide
  4749.     super
  4750.   end
  4751. end
  4752.  
  4753. #==============================================================================
  4754. # ■ [追加]:Window_TargetHelp
  4755. #------------------------------------------------------------------------------
  4756. #  ターゲットの名前情報やスキルやアイテムの名前を表示します。
  4757. #==============================================================================
  4758.  
  4759. class Window_TargetHelp < Window_Help
  4760.   #--------------------------------------------------------------------------
  4761.   # ● 公開インスタンス変数
  4762.   #--------------------------------------------------------------------------
  4763.   attr_accessor :random_number  # 効果範囲ランダムの数
  4764.   #--------------------------------------------------------------------------
  4765.   # ● [オーバーライド]:オブジェクト初期化
  4766.   #--------------------------------------------------------------------------
  4767.   def initialize
  4768.     super(1) # 1行ヘルプ
  4769.   end
  4770.   #--------------------------------------------------------------------------
  4771.   # ● [オーバーライド]:ウィンドウの非表示
  4772.   #--------------------------------------------------------------------------
  4773.   def hide
  4774.     super
  4775.     clear
  4776.   end
  4777.   #--------------------------------------------------------------------------
  4778.   # ● [オーバーライド]:アイテム名設定
  4779.   #     item : スキル、アイテム、バトラー等
  4780.   #--------------------------------------------------------------------------
  4781.   def set_item(item)
  4782.     set_text(item ? item : "") # itemの説明ではなく、item自体を渡すようにする
  4783.   end
  4784.   #--------------------------------------------------------------------------
  4785.   # ● ゲージ幅
  4786.   #--------------------------------------------------------------------------
  4787.   def gauge_width
  4788.     LNX11::HELP_PARAM_WIDTH
  4789.   end
  4790.   #--------------------------------------------------------------------------
  4791.   # ● ゲージ幅(余白を含む)
  4792.   #--------------------------------------------------------------------------  
  4793.   def gauge_width_spacing
  4794.     LNX11::HELP_PARAM_WIDTH + 4
  4795.   end
  4796.   #--------------------------------------------------------------------------
  4797.   # ● パラメータエリアの幅
  4798.   #--------------------------------------------------------------------------  
  4799.   def param_width(size)
  4800.     gauge_width_spacing * size
  4801.   end
  4802.   #--------------------------------------------------------------------------
  4803.   # ● 効果範囲ランダムの数の取得
  4804.   #--------------------------------------------------------------------------
  4805.   def random_number
  4806.     # 全角にして返す
  4807.     @random_number.to_s.tr('0-9','0-9')
  4808.   end
  4809.   #--------------------------------------------------------------------------
  4810.   # ● [オーバーライド]:リフレッシュ
  4811.   #--------------------------------------------------------------------------
  4812.   def refresh
  4813.     contents.clear
  4814.     if @text == :party
  4815.       draw_text(contents.rect, "味方全体", 1)
  4816.     elsif @text == :troop
  4817.       draw_text(contents.rect, "敵全体", 1)
  4818.     elsif @text == :troop_random
  4819.       case LNX11::RANDOMSCOPE_DISPLAY
  4820.       when 0 ; draw_text(contents.rect, "敵全体 ランダム", 1)
  4821.       when 1 ; draw_text(contents.rect, "敵#{random_number}体 ランダム", 1)
  4822.       end
  4823.     elsif @text.is_a?(Game_Battler)
  4824.       # 選択対象の情報を描画
  4825.       draw_target_info
  4826.     elsif @text.is_a?(RPG::UsableItem)
  4827.       # アイテムかスキルならアイテム名を描画
  4828.       draw_item_name_help(@text)
  4829.     else
  4830.       # 通常のテキスト
  4831.       super
  4832.     end
  4833.   end
  4834.   #--------------------------------------------------------------------------
  4835.   # ● 選択対象の情報の描画
  4836.   #--------------------------------------------------------------------------
  4837.   def draw_target_info
  4838.     # バトラー情報の描画
  4839.     param = @text.actor? ? LNX11::HELP_ACTOR_PARAM : LNX11::HELP_ENEMY_PARAM
  4840.     # ゲージ付きステータス配列
  4841.     status = [param[:hp],param[:mp],param[:tp]&&$data_system.opt_display_tp]
  4842.     # 名前
  4843.     x = contents_width / 2 - contents.text_size(@text.name).width / 2
  4844.     name_width = contents.text_size(@text.name).width + 4
  4845.     if !status.include?(true)
  4846.       # ゲージ付きステータスを描画しない場合
  4847.       draw_targethelp_name(@text, x, name_width, param[:hp])
  4848.       x += name_width
  4849.       state_width = contents_width - x
  4850.     else
  4851.       # ゲージ付きステータスを描画する場合
  4852.       status.delete(false)
  4853.       x -= param_width(status.size) / 2
  4854.       draw_targethelp_name(@text, x, name_width, param[:hp])
  4855.       x += name_width
  4856.       state_width = contents_width - x - param_width(status.size)
  4857.     end
  4858.     # ステートアイコン
  4859.     if param[:state]
  4860.       draw_actor_icons(@text, x, 0, state_width)
  4861.     end
  4862.     # パラメータの描画
  4863.     x = contents_width - param_width(status.size)
  4864.     # HP
  4865.     if param[:hp]
  4866.       draw_actor_hp(@text, x, 0, gauge_width)
  4867.       x += gauge_width_spacing
  4868.     end
  4869.     # MP
  4870.     if param[:mp]
  4871.       draw_actor_mp(@text, x, 0, gauge_width)
  4872.       x += gauge_width_spacing
  4873.     end
  4874.     # TP
  4875.     if param[:tp] && $data_system.opt_display_tp
  4876.       draw_actor_tp(@text, x, 0, gauge_width)
  4877.       x += gauge_width_spacing
  4878.     end
  4879.   end
  4880.   #--------------------------------------------------------------------------
  4881.   # ● ターゲットの名前描画
  4882.   #--------------------------------------------------------------------------
  4883.   def draw_targethelp_name(actor, x, name_width, hp)
  4884.     if hp
  4885.       # HPゲージを伴う場合(HPが少ない場合、名前の色が変化する)
  4886.       draw_actor_name(actor, x, 0, name_width)
  4887.     else
  4888.       text = actor.name
  4889.       draw_text(x, 0, text_size(text).width + 4, line_height, text)
  4890.     end
  4891.   end
  4892.   #--------------------------------------------------------------------------
  4893.   # ● アイテムの描画(中央揃え)
  4894.   #--------------------------------------------------------------------------
  4895.   def draw_item_name_help(item)
  4896.     case LNX11::HELPDISPLAY_TYPE
  4897.     when 0 # アイコン+名前
  4898.       w = contents.text_size(@text.name).width + 28
  4899.     when 1 # 名前のみ
  4900.       w = contents.text_size(@text.name).width + 4
  4901.     end
  4902.     # 簡易説明文の描画
  4903.     if !@text.short_description.empty?
  4904.       des = LNX11::HELPDISPLAY_DESCRIPTION
  4905.       contents.font.size = des[:size]
  4906.       text = des[:delimiter] + @text.short_description
  4907.       rect = contents.text_size(text)
  4908.       w += rect.width
  4909.       x = (contents_width - w) / 2
  4910.       y = (line_height - rect.height) / 2
  4911.       draw_text(x, y, w, line_height, text, 2)
  4912.       reset_font_settings
  4913.     end
  4914.     # 名前の描画
  4915.     x = (contents_width - w) / 2
  4916.     case LNX11::HELPDISPLAY_TYPE
  4917.     when 0 # アイコン+名前
  4918.       draw_item_name(@text, x, 0, true, w)
  4919.     when 1 # 名前のみ
  4920.       draw_text(x, 0, contents_width, line_height, @text.name)
  4921.     end
  4922.   end
  4923. end
  4924.  
  4925. #==============================================================================
  4926. # ■ Window_PartyCommand
  4927. #------------------------------------------------------------------------------
  4928. #  バトル画面で、戦うか逃げるかを選択するウィンドウです。
  4929. #==============================================================================
  4930.  
  4931. class Window_PartyCommand < Window_Command
  4932.   #--------------------------------------------------------------------------
  4933.   # ● [エイリアス]:オブジェクト初期化
  4934.   #--------------------------------------------------------------------------
  4935.   alias :lnx11a_initialize :initialize
  4936.   def initialize
  4937.     $game_party.last_party_command = nil
  4938.     # 元のメソッドを呼ぶ
  4939.     lnx11a_initialize
  4940.     # 座標を設定
  4941.     self.x = LNX11::PARTY_COMMAND_XY[:x]
  4942.     self.y = LNX11::PARTY_COMMAND_XY[:y]
  4943.   end
  4944.   #--------------------------------------------------------------------------
  4945.   # ● [オーバーライド]:ウィンドウ幅の取得
  4946.   #--------------------------------------------------------------------------
  4947.   def window_width
  4948.     return LNX11::PARTY_COMMAND_WIDTH
  4949.   end
  4950.   #--------------------------------------------------------------------------
  4951.   # ● [オーバーライド]:表示行数の取得
  4952.   #--------------------------------------------------------------------------
  4953.   def visible_line_number
  4954.     return LNX11::PARTY_COMMAND_HORIZON ? 1 : @list.size
  4955.   end
  4956.   #--------------------------------------------------------------------------
  4957.   # ● [オーバーライド]:桁数の取得
  4958.   #--------------------------------------------------------------------------
  4959.   def col_max
  4960.     return LNX11::PARTY_COMMAND_HORIZON ? @list.size : 1
  4961.   end
  4962.   #--------------------------------------------------------------------------
  4963.   # ● [オーバーライド]:アライメントの取得
  4964.   #--------------------------------------------------------------------------
  4965.   def alignment
  4966.     return LNX11::PARTY_COMMAND_ALIGNMENT
  4967.   end
  4968.   #--------------------------------------------------------------------------
  4969.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  4970.   #--------------------------------------------------------------------------
  4971.   def spacing
  4972.     return 8
  4973.   end
  4974.   #--------------------------------------------------------------------------
  4975.   # ● [オーバーライド]:ウィンドウを開く
  4976.   #--------------------------------------------------------------------------
  4977.   def open
  4978.     super
  4979.     # 最後に選択したコマンドを選択
  4980.     return self unless LNX11::LAST_PARTY_COMMAND
  4981.     last_command = $game_party.last_party_command
  4982.     if last_command && @list.include?(last_command)
  4983.       select(@list.index(last_command))
  4984.     end
  4985.     self
  4986.   end
  4987.   #--------------------------------------------------------------------------
  4988.   # ● [エイリアス]:ウィンドウを閉じる
  4989.   #--------------------------------------------------------------------------
  4990.   def close
  4991.     super
  4992.     # 選択したコマンドを記憶
  4993.     $game_party.last_party_command = @list[index] if index >= 0
  4994.     self
  4995.   end
  4996. end
  4997.  
  4998. #==============================================================================
  4999. # ■ Window_ActorCommand
  5000. #------------------------------------------------------------------------------
  5001. #  バトル画面で、アクターの行動を選択するウィンドウです。
  5002. #==============================================================================
  5003.  
  5004. class Window_ActorCommand < Window_Command
  5005.   include LNX11_Window_ActiveVisible
  5006.   #--------------------------------------------------------------------------
  5007.   # ● [オーバーライド]:ウィンドウ幅の取得
  5008.   #--------------------------------------------------------------------------
  5009.   def window_width
  5010.     return LNX11::ACTOR_COMMAND_WIDTH
  5011.   end
  5012.   #--------------------------------------------------------------------------
  5013.   # ● [オーバーライド]:表示行数の取得
  5014.   #--------------------------------------------------------------------------
  5015.   def visible_line_number
  5016.     list_size = LNX11::ACTOR_COMMAND_NOSCROLL ? @list.size : 4
  5017.     return LNX11::ACTOR_COMMAND_HORIZON ? 1 : list_size
  5018.   end
  5019.   #--------------------------------------------------------------------------
  5020.   # ● [オーバーライド]:桁数の取得
  5021.   #--------------------------------------------------------------------------
  5022.   def col_max
  5023.     return LNX11::ACTOR_COMMAND_HORIZON ? [@list.size, 1].max :  1
  5024.   end
  5025.   #--------------------------------------------------------------------------
  5026.   # ● [オーバーライド]:アライメントの取得
  5027.   #--------------------------------------------------------------------------
  5028.   def alignment
  5029.     return LNX11::ACTOR_COMMAND_ALIGNMENT
  5030.   end
  5031.   #--------------------------------------------------------------------------
  5032.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  5033.   #--------------------------------------------------------------------------
  5034.   def spacing
  5035.     return 8
  5036.   end
  5037.   #--------------------------------------------------------------------------
  5038.   # ● [追加]:X 座標をアクターに合わせる
  5039.   #--------------------------------------------------------------------------
  5040.   def actor_x(actor)
  5041.     ax = $game_party.members_screen_x_nooffset[actor.index] - self.width / 2
  5042.     pad = LNX11::STATUS_SIDE_PADDING / 2
  5043.     # 画面内に収める
  5044.     self.x = [[ax, pad].max, Graphics.width - pad - self.width].min
  5045.     self.x += LNX11::ACTOR_COMMAND_OFFSET[:x]
  5046.   end
  5047.   #--------------------------------------------------------------------------
  5048.   # ● [追加]:Y 座標をアクターに合わせる
  5049.   #--------------------------------------------------------------------------
  5050.   def actor_y(actor)
  5051.     self.y = actor.screen_y_top - self.height
  5052.     self.y += LNX11::ACTOR_COMMAND_OFFSET[:y]
  5053.   end
  5054.   #--------------------------------------------------------------------------
  5055.   # ● [追加]:固定 Y 座標
  5056.   #--------------------------------------------------------------------------
  5057.   def screen_y
  5058.     if LNX11::ACTOR_COMMAND_Y_POSITION == 0
  5059.       self.y = Graphics.height - self.height + LNX11::ACTOR_COMMAND_OFFSET[:y]
  5060.     else
  5061.       self.y = LNX11::ACTOR_COMMAND_OFFSET[:y]
  5062.     end
  5063.   end
  5064.   #--------------------------------------------------------------------------
  5065.   # ● [エイリアス]:セットアップ
  5066.   #--------------------------------------------------------------------------
  5067.   alias :lnx11a_setup :setup
  5068.   def setup(actor)
  5069.     # 前のアクターのコマンドを記憶
  5070.     @actor.last_actor_command = @list[index] if @actor
  5071.     # 元のメソッドを呼ぶ
  5072.     lnx11a_setup(actor)
  5073.     self.arrows_visible = !LNX11::ACTOR_COMMAND_NOSCROLL
  5074.     self.height = window_height
  5075.     self.oy = 0
  5076.     # アクターコマンドの表示位置で分岐
  5077.     case LNX11::ACTOR_COMMAND_POSITION
  5078.     when 0
  5079.       # アクターの頭上
  5080.       actor_x(actor)
  5081.       actor_y(actor)
  5082.     when 1
  5083.       # Y 座標固定
  5084.       actor_x(actor)
  5085.       screen_y
  5086.     when 2
  5087.       # XY固定
  5088.       self.x = LNX11::ACTOR_COMMAND_OFFSET[:x]
  5089.       screen_y
  5090.     end
  5091.     # 最後に選択したコマンドを選択
  5092.     return unless LNX11::LAST_ACTOR_COMMAND
  5093.     last_command = @actor.last_actor_command
  5094.     if last_command && @list.include?(last_command)
  5095.       select(@list.index(last_command))
  5096.     end
  5097.   end
  5098. end
  5099.  
  5100. #==============================================================================
  5101. # ■ Window_BattleStatus
  5102. #------------------------------------------------------------------------------
  5103. #  バトル画面で、パーティメンバーのステータスを表示するウィンドウです。
  5104. #==============================================================================
  5105.  
  5106. class Window_BattleStatus < Window_Selectable
  5107.   #--------------------------------------------------------------------------
  5108.   # ● [追加]:公開インスタンス変数
  5109.   #--------------------------------------------------------------------------
  5110.   attr_reader :min_offset   # ステータス描画 X 座標の位置修正
  5111.   #--------------------------------------------------------------------------
  5112.   # ● [エイリアス]:オブジェクト初期化
  5113.   #--------------------------------------------------------------------------
  5114.   alias :lnx11a_initialize :initialize
  5115.   def initialize
  5116.     @actor_last_status = Array.new($game_party.max_battle_members) { nil }   
  5117.     # 元のメソッドを呼ぶ
  5118.     lnx11a_initialize
  5119.     # ウィンドウを最初から表示
  5120.     self.openness = 255
  5121.     self.opacity = 0
  5122.     update_invisible
  5123.   end
  5124.   #--------------------------------------------------------------------------
  5125.   # ● [オーバーライド]:行の高さを取得
  5126.   #--------------------------------------------------------------------------
  5127.   def line_height
  5128.     return LNX11::STATUS_LINE_HEIGHT
  5129.   end
  5130.   #--------------------------------------------------------------------------
  5131.   # ● [オーバーライド]:標準パディングサイズの取得
  5132.   #--------------------------------------------------------------------------
  5133.   def standard_padding
  5134.     return 0
  5135.   end
  5136.   #--------------------------------------------------------------------------
  5137.   # ● [オーバーライド]:表示行数の取得
  5138.   #--------------------------------------------------------------------------
  5139.   def visible_line_number
  5140.     return $data_system.opt_display_tp ? 4 : 3
  5141.   end
  5142.   #--------------------------------------------------------------------------
  5143.   # ● [オーバーライド]:桁数の取得
  5144.   #--------------------------------------------------------------------------
  5145.   def col_max
  5146.     return [item_max, 1].max
  5147.   end
  5148.   #--------------------------------------------------------------------------
  5149.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  5150.   #--------------------------------------------------------------------------
  5151.   def spacing
  5152.     return 0
  5153.   end
  5154.   #--------------------------------------------------------------------------
  5155.   # ● [オーバーライド]:項目の高さを取得
  5156.   #--------------------------------------------------------------------------
  5157.   def item_height
  5158.     self.height
  5159.   end  
  5160.   #--------------------------------------------------------------------------
  5161.   # ● [再定義]:ウィンドウ幅の取得
  5162.   #--------------------------------------------------------------------------
  5163.   def window_width
  5164.     Graphics.width
  5165.   end
  5166.   #--------------------------------------------------------------------------
  5167.   # ● [エイリアス]:ウィンドウ高さの取得
  5168.   #--------------------------------------------------------------------------
  5169.   alias :lnx11a_window_height :window_height
  5170.   def window_height
  5171.     # 一行目(名前・ステート)の高さを確保する
  5172.     lnx11a_window_height - line_height + [24, line_height].max
  5173.   end
  5174.   #--------------------------------------------------------------------------
  5175.   # ● [オーバーライド]:カーソルの更新
  5176.   #--------------------------------------------------------------------------
  5177.   def update_cursor
  5178.     # カーソルを表示しない
  5179.     cursor_rect.empty
  5180.   end
  5181.   #--------------------------------------------------------------------------
  5182.   # ● [オーバーライド]:システム色の取得
  5183.   #  ゲージ幅が短すぎる場合、HP,MP,TP の文字を非表示にします。
  5184.   #--------------------------------------------------------------------------
  5185.   def system_color
  5186.     gauge_area_width - @min_offset >= 52 ? super : Color.new
  5187.   end  
  5188.   #--------------------------------------------------------------------------
  5189.   # ● [オーバーライド]:ゲージ背景色の取得
  5190.   #   ゲージの透明度を適用します。  
  5191.   #--------------------------------------------------------------------------
  5192.   def gauge_back_color
  5193.     color = super
  5194.     color.alpha *= LNX11::STATUS_GAUGE_OPACITY / 255.0
  5195.     color
  5196.   end
  5197.   #--------------------------------------------------------------------------
  5198.   # ● [オーバーライド]:ゲージの描画
  5199.   #   ゲージの透明度を適用します。
  5200.   #--------------------------------------------------------------------------
  5201.   def draw_gauge(x, y, width, rate, color1, color2)
  5202.     oparate = LNX11::STATUS_GAUGE_OPACITY / 255.0
  5203.     color1.alpha *= oparate
  5204.     color2.alpha *= oparate
  5205.     super
  5206.   end
  5207.   #--------------------------------------------------------------------------
  5208.   # ● [オーバーライド]:フレーム更新
  5209.   #--------------------------------------------------------------------------
  5210.   def update
  5211.     super
  5212.     update_invisible
  5213.   end
  5214.   #--------------------------------------------------------------------------
  5215.   # ● [追加]:表示状態更新
  5216.   #--------------------------------------------------------------------------
  5217.   def update_invisible
  5218.     self.contents_opacity = $game_party.status_invisible ? 0 : 255
  5219.   end  
  5220.   #--------------------------------------------------------------------------
  5221.   # ● [追加]:アクターオブジェクト取得
  5222.   #--------------------------------------------------------------------------
  5223.   def actor
  5224.     $game_party.members[@index]
  5225.   end
  5226.   #--------------------------------------------------------------------------
  5227.   # ● [追加]:座標の設定
  5228.   #--------------------------------------------------------------------------
  5229.   def set_xy
  5230.     # ステータス位置の調整:画面からはみ出ないようにする
  5231.     pw = $game_party.members_screen_x.last + LNX11::STATUS_OFFSET[:x]
  5232.     pw += gauge_area_width / 2
  5233.     right_end = Graphics.width - LNX11::STATUS_SIDE_PADDING
  5234.     min_offset = pw > right_end ? pw - right_end : 0
  5235.     # ステータスのオフセットを適用
  5236.     self.x = LNX11::STATUS_OFFSET[:x] - min_offset
  5237.     self.y = LNX11::STATUS_OFFSET[:y] + Graphics.height - self.height
  5238.     # ステータス幅の自動調整:位置を調整した分だけ幅を縮める
  5239.     @min_offset = LNX11::STATUS_AUTOADJUST ? min_offset : 0
  5240.   end
  5241.   #--------------------------------------------------------------------------
  5242.   # ● [再定義]:ゲージエリアの幅を取得
  5243.   #--------------------------------------------------------------------------
  5244.   def gauge_area_width
  5245.     return LNX11::STATUS_WIDTH
  5246.   end
  5247.   #--------------------------------------------------------------------------
  5248.   # ● [追加]:表示するステート数の取得
  5249.   #--------------------------------------------------------------------------
  5250.   def states(actor, width)
  5251.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  5252.     icons.size
  5253.   end
  5254.   #--------------------------------------------------------------------------
  5255.   # ● [追加]:名前とステートの描画(1行表示)
  5256.   #  width の範囲で名前を左揃え、ステートアイコンを右揃えで描画します。
  5257.   # ステートを優先して表示するため、アイコンが多すぎて名前の表示領域が
  5258.   # 極端に狭くなる場合は名前を描画しません。
  5259.   #--------------------------------------------------------------------------
  5260.   def draw_actor_name_with_icons(actor, x, y, width = 128, draw_name = true)
  5261.     # アイコンのY座標補正
  5262.     iy = ([line_height, 24].max - 24) / 2
  5263.     # 名前のY座標補正
  5264.     ny = ([line_height, 24].max - LNX11::STATUS_NAME_SIZE) / 2
  5265.     # 表示するステート数を取得
  5266.     icon = states(actor, width)
  5267.     if icon > 0
  5268.       # 表示するべきステートがある場合
  5269.       name_width = width - icon * 24
  5270.       ix = x + width - icon * 24
  5271.       if name_width >= contents.font.size * 2 && draw_name
  5272.         # 名前の表示領域(width) が フォントサイズ * 2 以上なら両方を描画
  5273.         draw_actor_name(actor, x, y + ny,  name_width)
  5274.         iw = width - name_width
  5275.         draw_actor_icons(actor, ix, y + iy, iw)
  5276.       else
  5277.         # ステートのみ描画
  5278.         draw_actor_icons(actor, ix, y + iy, width)
  5279.       end
  5280.     elsif draw_name
  5281.       # ない場合、名前のみ描画
  5282.       draw_actor_name(actor, x, y + ny, width)
  5283.     end
  5284.   end
  5285.   #--------------------------------------------------------------------------
  5286.   # ● [再定義]:リフレッシュ
  5287.   #--------------------------------------------------------------------------
  5288.   def refresh
  5289.     set_xy
  5290.     draw_all_items
  5291.   end
  5292.   #--------------------------------------------------------------------------
  5293.   # ● [オーバーライド]:項目を描画する矩形の取得
  5294.   #--------------------------------------------------------------------------
  5295.   def item_rect(index)
  5296.     rect = super
  5297.     rect.x = $game_party.members_screen_x[index] - gauge_area_width / 2
  5298.     rect.width = gauge_area_width
  5299.     rect
  5300.   end
  5301.   #--------------------------------------------------------------------------
  5302.   # ● [再定義]:基本エリアの矩形を取得
  5303.   #--------------------------------------------------------------------------
  5304.   def basic_area_rect(index)
  5305.     rect = item_rect(index)
  5306.     rect
  5307.   end
  5308.   #--------------------------------------------------------------------------
  5309.   # ● [再定義]:ゲージエリアの矩形を取得
  5310.   #--------------------------------------------------------------------------
  5311.   def gauge_area_rect(index)
  5312.     rect = basic_area_rect(index)
  5313.     rect.y += [24, line_height].max
  5314.     rect.x += @min_offset
  5315.     rect
  5316.   end
  5317.   #--------------------------------------------------------------------------
  5318.   # ● [再定義]:基本エリアの描画
  5319.   #--------------------------------------------------------------------------
  5320.   def draw_basic_area(rect, actor)
  5321.     # フォントサイズ変更
  5322.     contents.font.size = [LNX11::STATUS_NAME_SIZE, 8].max
  5323.     # 名前とステートを描画
  5324.     dn = LNX11::STATUS_NAME_SIZE > 0 # 名前を描画するか?
  5325.     width = gauge_area_width - @min_offset
  5326.     rest  = width % 24
  5327.     width += 24 - rest if rest > 0
  5328.     draw_actor_name_with_icons(actor, rect.x, rect.y, width, dn)
  5329.     # フォントサイズを元に戻す
  5330.     reset_font_settings
  5331.   end
  5332.   #--------------------------------------------------------------------------
  5333.   # ● [エイリアス]:ゲージエリアの描画
  5334.   #--------------------------------------------------------------------------
  5335.   alias :lnx11a_draw_gauge_area :draw_gauge_area
  5336.   def draw_gauge_area(*args)
  5337.     # フォントサイズ変更
  5338.     contents.font.size = LNX11::STATUS_PARAM_SIZE
  5339.     # 元のメソッドを呼ぶ
  5340.     lnx11a_draw_gauge_area(*args)
  5341.     # フォントサイズを元に戻す
  5342.     reset_font_settings
  5343.   end
  5344.   #--------------------------------------------------------------------------
  5345.   # ● [再定義]:ゲージエリアの描画(TP あり)
  5346.   #--------------------------------------------------------------------------
  5347.   def draw_gauge_area_with_tp(rect, actor)
  5348.     width = gauge_area_width - @min_offset
  5349.     draw_actor_hp(actor, rect.x, rect.y,                   width)
  5350.     draw_actor_mp(actor, rect.x, rect.y + line_height,     width)
  5351.     draw_actor_tp(actor, rect.x, rect.y + line_height * 2, width)
  5352.   end
  5353.   #--------------------------------------------------------------------------
  5354.   # ● [再定義]:ゲージエリアの描画(TP なし)
  5355.   #--------------------------------------------------------------------------
  5356.   def draw_gauge_area_without_tp(rect, actor)
  5357.     draw_actor_hp(actor, rect.x, rect.y,               gauge_area_width)
  5358.     draw_actor_mp(actor, rect.x, rect.y + line_height, gauge_area_width)
  5359.   end
  5360.   #--------------------------------------------------------------------------
  5361.   # ● [再定義]:項目の描画
  5362.   #--------------------------------------------------------------------------
  5363.   def draw_item(index)
  5364.     actor = $game_party.battle_members[index]
  5365.     a_status = status(actor)
  5366.     # ステータスが変化した場合のみ描画する
  5367.     return if @actor_last_status[index] == a_status
  5368.     @actor_last_status[index] = a_status
  5369.     contents.clear_rect(item_rect(index))
  5370.     draw_basic_area(basic_area_rect(index), actor)
  5371.     draw_gauge_area(gauge_area_rect(index), actor)
  5372.   end
  5373.   #--------------------------------------------------------------------------
  5374.   # ● [追加]:アクターのステータス配列を返す
  5375.   #--------------------------------------------------------------------------
  5376.   def status(actor)
  5377.     if $data_system.opt_display_tp
  5378.       return [actor.name, actor.state_icons + actor.buff_icons,
  5379.               actor.mhp, actor.hp, actor.mmp, actor.mp, actor.max_tp, actor.tp]
  5380.     else
  5381.       # TP を除くステータス配列
  5382.       return [actor.name, actor.state_icons + actor.buff_icons,
  5383.               actor.mhp, actor.hp, actor.mmp, actor.mp]
  5384.     end
  5385.   end
  5386.   #--------------------------------------------------------------------------
  5387.   # ● [追加]:内容の消去
  5388.   #--------------------------------------------------------------------------
  5389.   def all_clear
  5390.     contents.clear
  5391.     @actor_last_status = Array.new($game_party.max_battle_members) { nil }   
  5392.   end
  5393. end
  5394.  
  5395. #==============================================================================
  5396. # ■ Window_BattleActor
  5397. #------------------------------------------------------------------------------
  5398. #  バトル画面で、行動対象のアクターを選択するウィンドウです。
  5399. # XPスタイルバトルではバトルステータスを非表示にしないため、
  5400. # 選択機能だけを持つ不可視のウィンドウとして扱います。
  5401. #==============================================================================
  5402.  
  5403. class Window_BattleActor < Window_BattleStatus
  5404.   include LNX11_Window_TargetHelp
  5405.   #--------------------------------------------------------------------------
  5406.   # ● [エイリアス]:オブジェクト初期化
  5407.   #--------------------------------------------------------------------------
  5408.   alias :lnx11a_wba_initialize :initialize
  5409.   def initialize(info_viewport)
  5410.     # 元のメソッドを呼ぶ
  5411.     lnx11a_wba_initialize(info_viewport)
  5412.     # ウィンドウを画面外に移動
  5413.     self.y = Graphics.height
  5414.   end
  5415.   #--------------------------------------------------------------------------
  5416.   # ● [オーバーライド]:ヘルプテキスト更新
  5417.   #--------------------------------------------------------------------------
  5418.   def update_help
  5419.     @help_window.set_item(targetcursor)
  5420.   end
  5421.   #--------------------------------------------------------------------------
  5422.   # ● [追加]:ターゲットカーソルに渡すオブジェクト
  5423.   #--------------------------------------------------------------------------
  5424.   def targetcursor
  5425.     @cursor_all ? :party : actor
  5426.   end
  5427.   #--------------------------------------------------------------------------
  5428.   # ● [オーバーライド]:ウィンドウ幅の取得
  5429.   #--------------------------------------------------------------------------
  5430.   def window_width
  5431.     64
  5432.   end
  5433.   #--------------------------------------------------------------------------
  5434.   # ● [オーバーライド]:全項目の描画
  5435.   #--------------------------------------------------------------------------
  5436.   def draw_all_items
  5437.     # 何もしない   
  5438.   end
  5439.   #--------------------------------------------------------------------------
  5440.   # ● [オーバーライド]:項目の描画
  5441.   #--------------------------------------------------------------------------
  5442.   def draw_item(index)
  5443.     # 何もしない
  5444.   end
  5445.   #--------------------------------------------------------------------------
  5446.   # ● [オーバーライド]:リフレッシュ
  5447.   #--------------------------------------------------------------------------
  5448.   def refresh
  5449.     # 何もしない
  5450.   end
  5451.   #--------------------------------------------------------------------------
  5452.   # ● [エイリアス]:ウィンドウの表示
  5453.   #--------------------------------------------------------------------------
  5454.   alias :lnx11a_show :show
  5455.   def show
  5456.     # 元のメソッドを呼ぶ
  5457.     lnx11a_show
  5458.     # 最後に選択したアクターを選択
  5459.     last_target = $game_temp.last_target_cursor[:actor]
  5460.     if last_target && $game_party.members.include?(last_target) &&
  5461.        LNX11::LAST_TARGET
  5462.       select($game_party.members.index(last_target))
  5463.     end
  5464.     # スマートターゲットセレクト
  5465.     if LNX11::SMART_TARGET_SELECT && !@cursor_fix
  5466.       if @dead_friend && (!last_target || last_target && last_target.alive?)
  5467.         dead_actor = $game_party.dead_members[0]
  5468.         select($game_party.members.index(dead_actor)) if dead_actor
  5469.       elsif !@dead_friend && (!last_target || last_target && last_target.dead?)
  5470.         alive_actor = $game_party.alive_members[0]
  5471.         select($game_party.members.index(alive_actor)) if alive_actor
  5472.       end
  5473.     end
  5474.     self
  5475.   end
  5476.   #--------------------------------------------------------------------------
  5477.   # ● [エイリアス]:ウィンドウの非表示
  5478.   #--------------------------------------------------------------------------
  5479.   alias :lnx11a_hide :hide
  5480.   def hide
  5481.     # 元のメソッドを呼ぶ
  5482.     lnx11a_hide
  5483.     # 選択したアクターを記憶
  5484.     $game_temp.last_target_cursor[:actor] = actor
  5485.     self
  5486.   end
  5487. end
  5488.  
  5489. #==============================================================================
  5490. # ■ Window_BattleEnemy
  5491. #------------------------------------------------------------------------------
  5492. #  バトル画面で、行動対象の敵キャラを選択するウィンドウです。
  5493. # 横並びの不可視のウィンドウとして扱います。
  5494. #==============================================================================
  5495.  
  5496. class Window_BattleEnemy < Window_Selectable
  5497.   include LNX11_Window_TargetHelp
  5498.   #--------------------------------------------------------------------------
  5499.   # ● [エイリアス]:オブジェクト初期化
  5500.   #--------------------------------------------------------------------------
  5501.   alias :lnx11a_initialize :initialize
  5502.   def initialize(info_viewport)
  5503.     # 敵キャラオブジェクトの設定
  5504.     set_enemy
  5505.     # 元のメソッドを呼ぶ
  5506.     lnx11a_initialize(info_viewport)
  5507.     # ウィンドウを画面外に移動
  5508.     self.y = Graphics.height
  5509.   end
  5510.   #--------------------------------------------------------------------------
  5511.   # ● [追加]:敵キャラオブジェクトの設定
  5512.   #--------------------------------------------------------------------------
  5513.   def set_enemy
  5514.     if LNX11::TROOP_X_SORT
  5515.       @troop = $game_troop.alive_members.sort {|a,b| a.screen_x <=> b.screen_x}
  5516.     else
  5517.       @troop = $game_troop.alive_members
  5518.     end
  5519.   end
  5520.   #--------------------------------------------------------------------------
  5521.   # ● [再定義]:敵キャラオブジェクト取得
  5522.   #--------------------------------------------------------------------------
  5523.   def enemy
  5524.     @troop[@index]
  5525.   end
  5526.   #--------------------------------------------------------------------------
  5527.   # ● [オーバーライド]:ウィンドウ幅の取得
  5528.   #--------------------------------------------------------------------------
  5529.   def window_width
  5530.     64
  5531.   end
  5532.   #--------------------------------------------------------------------------
  5533.   # ● [オーバーライド]:指定行数に適合するウィンドウの高さを計算
  5534.   #--------------------------------------------------------------------------
  5535.   def fitting_height(line_number)
  5536.     super(1)
  5537.   end
  5538.   #--------------------------------------------------------------------------
  5539.   # ● [オーバーライド]:桁数の取得
  5540.   #--------------------------------------------------------------------------
  5541.   def col_max
  5542.     return item_max
  5543.   end
  5544.   #--------------------------------------------------------------------------
  5545.   # ● [オーバーライド]:ヘルプテキスト更新
  5546.   #--------------------------------------------------------------------------
  5547.   def update_help
  5548.     @help_window.random_number = @random_number
  5549.     @help_window.set_item(targetcursor)
  5550.   end
  5551.   #--------------------------------------------------------------------------
  5552.   # ● [追加]:ターゲットカーソルに渡すオブジェクト
  5553.   #--------------------------------------------------------------------------
  5554.   def targetcursor
  5555.     @cursor_all ? (@cursor_random ? :troop_random : :troop) : enemy
  5556.   end
  5557.   #--------------------------------------------------------------------------
  5558.   # ● [エイリアス]:ウィンドウの表示
  5559.   #--------------------------------------------------------------------------
  5560.   alias :lnx11a_show :show
  5561.   def show
  5562.     # 元のメソッドを呼ぶ
  5563.     lnx11a_show
  5564.     # 敵キャラオブジェクトの設定
  5565.     set_enemy
  5566.     return self unless LNX11::LAST_TARGET
  5567.     # 最後に選択した敵キャラを選択
  5568.     last_target = $game_temp.last_target_cursor[:enemy]
  5569.     if last_target && @troop.include?(last_target)
  5570.       select(@troop.index(last_target))
  5571.     end
  5572.     self
  5573.   end
  5574.   #--------------------------------------------------------------------------
  5575.   # ● [エイリアス]:ウィンドウの非表示
  5576.   #--------------------------------------------------------------------------
  5577.   alias :lnx11a_hide :hide
  5578.   def hide
  5579.     # 元のメソッドを呼ぶ
  5580.     lnx11a_hide
  5581.     # 選択した敵キャラを記憶
  5582.     $game_temp.last_target_cursor[:enemy] = enemy
  5583.     self
  5584.   end
  5585. end
  5586.  
  5587. #==============================================================================
  5588. # ■ Window_BattleSkill
  5589. #------------------------------------------------------------------------------
  5590. #  いくつかのモジュールをインクルードします。
  5591. #==============================================================================
  5592.  
  5593. class Window_BattleSkill < Window_SkillList
  5594.   include LNX11_Window_ActiveVisible
  5595.   include LNX11_Window_FittingList if LNX11::FITTING_LIST
  5596. end
  5597.  
  5598. #==============================================================================
  5599. # ■ Window_BattleItem
  5600. #------------------------------------------------------------------------------
  5601. #  いくつかのモジュールをインクルードします。
  5602. #==============================================================================
  5603.  
  5604. class Window_BattleItem < Window_ItemList
  5605.   include LNX11_Window_ActiveVisible
  5606.   include LNX11_Window_FittingList if LNX11::FITTING_LIST
  5607. end
  5608. # l:5608


然後是我提供的
RUBY 代码复制
  1. #==============================================================================
  2. #
  3. #  Yanfly Engine Ace - Visual Battlers v1.01
  4. # -- Last Updated: 2012.07.24
  5. # -- Level: Easy
  6. # -- Requires: n/a
  7. #
  8. #  Modified by:
  9. # -- Yami
  10. # -- Kread-Ex
  11. # -- Archeia_Nessiah
  12. #==============================================================================
  13.  
  14. $imported = {} if $imported.nil?
  15. $imported["YEA-VisualBattlers"] = true
  16.  
  17. #==============================================================================
  18. #  Updates
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # 2012.12.18 - Added preset views and able to change direction in-game.
  21. # 2012.07.24 - Finished Script.
  22. # 2012.01.05 - Started Script.
  23. #
  24. #==============================================================================
  25. #  Introduction
  26. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # This script provides a visual for all actors by default charsets. The actions
  28. # and movements are alike Final Fantasy 1, only move forward and backward when
  29. # start and finish actions.
  30. #
  31. #==============================================================================
  32. #  Instructions
  33. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  34. # To change the player direction in-game, use the snippet below in a script
  35. # call:
  36. #
  37. # $game_system.party_direction = n
  38. #
  39. # To install this script, open up your script editor and copy/paste this script
  40. # to an open slot below  Materials but above  Main. Remember to save.
  41. #
  42. #==============================================================================
  43. #  Compatibility
  44. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  45. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  46. # it will run with RPG Maker VX without adjusting.
  47. #
  48. #==============================================================================
  49.  
  50. module YEA
  51.   module VISUAL_BATTLERS
  52.  
  53.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  54.     # - Party Location Setting -
  55.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  56.     # These settings are adjusted for Party Location. Each Actor will have
  57.     # coordinates calculated by below formula. There are two samples coordinates
  58.     # below, change PARTY_DIRECTION to the base index you want to use.
  59.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  60.     PARTY_DIRECTION = 6 # This direction is opposite from actual direction.
  61.  
  62.     PARTY_LOCATION_BASE_COORDINATES ={
  63.     # Index => [base_x, base_y, mod_x, mod_y],
  64.           2 => [   250,    290,    40,     0], #UP
  65.           4 => [   150,    280,    20,   -20], #LEFT
  66.           3 => [   460,    280,    30,   -10], #RIGHT
  67.           6 => [   460,    230,    20,    20], #DEFAULT RIGHT
  68.           8 => [   260,    230,    40,     0], #DOWN
  69.     } # Do not remove this.
  70.  
  71.     PARTY_LOCATION_FORMULA_X = "base_x + index * mod_x"
  72.     PARTY_LOCATION_FORMULA_Y = "base_y + index * mod_y"
  73.  
  74.   end # VISUAL_BATTLERS
  75. end # YEA
  76.  
  77. #==============================================================================
  78. #    Editting anything past this point may potentially result in causing
  79. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  80. # halitosis so edit at your own risk.
  81. #==============================================================================
  82.  
  83. #==============================================================================
  84. # ?   Direction
  85. #==============================================================================
  86.  
  87. module Direction
  88.  
  89.   #--------------------------------------------------------------------------
  90.   # self.correct
  91.   #--------------------------------------------------------------------------
  92.   def self.correct(direction)
  93.     case direction
  94.     when 1; return 4
  95.     when 3; return 6
  96.     when 7; return 4
  97.     when 9; return 6
  98.     else; return direction
  99.     end
  100.   end
  101.  
  102.   #--------------------------------------------------------------------------
  103.   # self.opposite
  104.   #--------------------------------------------------------------------------
  105.   def self.opposite(direction)
  106.     case direction
  107.     when 1; return 6
  108.     when 2; return 8
  109.     when 3; return 4
  110.     when 4; return 6
  111.     when 6; return 4
  112.     when 7; return 6
  113.     when 8; return 2
  114.     when 9; return 4
  115.     else; return direction
  116.     end
  117.   end
  118.  
  119. end # Direction
  120.  
  121. #==============================================================================
  122. # ?   Game_System
  123. #==============================================================================
  124.  
  125. class Game_System; attr_accessor :party_direction; end
  126.  
  127. #==============================================================================
  128. # ?   Game_BattleCharacter
  129. #==============================================================================
  130.  
  131. class Game_BattleCharacter < Game_Character
  132.  
  133.   #--------------------------------------------------------------------------
  134.   # initialize
  135.   #--------------------------------------------------------------------------
  136.   def initialize(actor)
  137.     super()
  138.     setup_actor(actor)
  139.     @move_x_rate = 0
  140.     @move_y_rate = 0
  141.   end
  142.  
  143.   #--------------------------------------------------------------------------
  144.   # setup_actor
  145.   #--------------------------------------------------------------------------
  146.   def setup_actor(actor)
  147.     @actor = actor
  148.     @step_anime = true
  149.     set_graphic(@actor.character_name, @actor.character_index)
  150.     setup_coordinates
  151.     dr = $game_system.party_direction || YEA::VISUAL_BATTLERS::PARTY_DIRECTION
  152.     direction = Direction.opposite(dr)
  153.     set_direction(Direction.correct(direction))
  154.   end
  155.  
  156.   #--------------------------------------------------------------------------
  157.   # sprite=
  158.   #--------------------------------------------------------------------------
  159.   def sprite=(sprite)
  160.     @sprite = sprite
  161.   end
  162.  
  163.   #--------------------------------------------------------------------------
  164.   # setup_coordinates
  165.   #--------------------------------------------------------------------------
  166.   def setup_coordinates
  167.     location = ($game_system.party_direction ||
  168.     YEA::VISUAL_BATTLERS::PARTY_DIRECTION)
  169.     base_x = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][0]
  170.     base_y = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][1]
  171.     mod_x = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][2]
  172.     mod_y = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][3]
  173.     @actor.screen_x = eval(YEA::VISUAL_BATTLERS::PARTY_LOCATION_FORMULA_X)
  174.     @actor.screen_y = eval(YEA::VISUAL_BATTLERS::PARTY_LOCATION_FORMULA_Y)
  175.     @actor.origin_x = @actor.screen_x
  176.     @actor.origin_y = @actor.screen_y
  177.     @actor.create_move_to(screen_x, screen_y, 1)
  178.   end
  179.  
  180.   #--------------------------------------------------------------------------
  181.   # index
  182.   #--------------------------------------------------------------------------
  183.   def index
  184.     return @actor.index
  185.   end
  186.  
  187.   #--------------------------------------------------------------------------
  188.   # screen_x
  189.   #--------------------------------------------------------------------------
  190.   def screen_x
  191.     return @actor.screen_x
  192.   end
  193.  
  194.   #--------------------------------------------------------------------------
  195.   # screen_y
  196.   #--------------------------------------------------------------------------
  197.   def screen_y
  198.     return @actor.screen_y
  199.   end
  200.  
  201.   #--------------------------------------------------------------------------
  202.   # screen_z
  203.   #--------------------------------------------------------------------------
  204.   def screen_z
  205.     return @actor.screen_z
  206.   end
  207.  
  208. end # Game_BattleCharacter
  209.  
  210. #==============================================================================
  211. # ?   Game_Battler
  212. #==============================================================================
  213.  
  214. class Game_Battler < Game_BattlerBase
  215.  
  216.   #--------------------------------------------------------------------------
  217.   # public instance variables
  218.   #--------------------------------------------------------------------------
  219.   attr_accessor :moved_back
  220.   attr_accessor :origin_x
  221.   attr_accessor :origin_y
  222.   attr_accessor :screen_x
  223.   attr_accessor :screen_y
  224.   attr_accessor :started_turn
  225.  
  226.   #--------------------------------------------------------------------------
  227.   # alias method: execute_damage
  228.   #--------------------------------------------------------------------------
  229.   alias game_battler_execute_damage_vb execute_damage
  230.   def execute_damage(user)
  231.     game_battler_execute_damage_vb(user)
  232.     if @result.hp_damage > 0
  233.       move_backward(24, 6) unless @moved_back
  234.       @moved_back = true
  235.     end
  236.   end
  237.  
  238.   #--------------------------------------------------------------------------
  239.   # face_opposing_party
  240.   #--------------------------------------------------------------------------
  241.   def face_opposing_party
  242.     direction = ($game_system.party_direction ||
  243.     YEA::VISUAL_BATTLERS::PARTY_DIRECTION)
  244.     character.set_direction(Direction.correct(direction)) rescue 0
  245.   end
  246.  
  247.   #--------------------------------------------------------------------------
  248.   # new method: face_coordinate
  249.   #--------------------------------------------------------------------------
  250.   def face_coordinate(destination_x, destination_y)
  251.     x1 = Integer(@screen_x)
  252.     x2 = Integer(destination_x)
  253.     y1 = Graphics.height - Integer(@screen_y)
  254.     y2 = Graphics.height - Integer(destination_y)
  255.     return if x1 == x2 and y1 == y2
  256.     #---
  257.     angle = Integer(Math.atan2((y2-y1),(x2-x1)) * 1800 / Math::PI)
  258.     if (0..225) === angle or (-225..0) === angle
  259.       direction = 6
  260.     elsif (226..675) === angle
  261.       direction = 9
  262.     elsif (676..1125) === angle
  263.       direction = 8
  264.     elsif (1126..1575) === angle
  265.       direction = 7
  266.     elsif (1576..1800) === angle or (-1800..-1576) === angle
  267.       direction = 4
  268.     elsif (-1575..-1126) === angle
  269.       direction = 1
  270.     elsif (-1125..-676) === angle
  271.       direction = 2
  272.     elsif (-675..-226) === angle
  273.       direction = 3
  274.     end
  275.     #---
  276.     character.set_direction(Direction.correct(direction)) rescue 0
  277.   end
  278.  
  279.   #--------------------------------------------------------------------------
  280.   # create_move_to
  281.   #--------------------------------------------------------------------------
  282.   def create_move_to(destination_x, destination_y, frames = 12)
  283.     @destination_x = destination_x
  284.     @destination_y = destination_y
  285.     frames = [frames, 1].max
  286.     @move_x_rate = [(@screen_x - @destination_x).abs / frames, 2].max
  287.     @move_y_rate = [(@screen_y - @destination_y).abs / frames, 2].max
  288.   end
  289.  
  290.   #--------------------------------------------------------------------------
  291.   # update_move_to
  292.   #--------------------------------------------------------------------------
  293.   def update_move_to
  294.     @move_x_rate = 0 if @screen_x == @destination_x || @move_x_rate.nil?
  295.     @move_y_rate = 0 if @screen_y == @destination_y || @move_y_rate.nil?
  296.     value = [(@screen_x - @destination_x).abs, @move_x_rate].min
  297.     @screen_x += (@destination_x > @screen_x) ? value : -value
  298.     value = [(@screen_y - @destination_y).abs, @move_y_rate].min
  299.     @screen_y += (@destination_y > @screen_y) ? value : -value
  300.   end
  301.  
  302.   #--------------------------------------------------------------------------
  303.   # move_forward
  304.   #--------------------------------------------------------------------------
  305.   def move_forward(distance = 24, frames = 12)
  306.     direction = forward_direction
  307.     move_direction(direction, distance, frames)
  308.   end
  309.  
  310.   #--------------------------------------------------------------------------
  311.   # move_backward
  312.   #--------------------------------------------------------------------------
  313.   def move_backward(distance = 24, frames = 12)
  314.     direction = Direction.opposite(forward_direction)
  315.     move_direction(direction, distance, frames)
  316.   end
  317.  
  318.   #--------------------------------------------------------------------------
  319.   # move_direction
  320.   #--------------------------------------------------------------------------
  321.   def move_direction(direction, distance = 24, frames = 12)
  322.     case direction
  323.     when 1; move_x = distance / -2; move_y = distance /  2
  324.     when 2; move_x = distance *  0; move_y = distance *  1
  325.     when 3; move_x = distance / -2; move_y = distance /  2
  326.     when 4; move_x = distance * -1; move_y = distance *  0
  327.     when 6; move_x = distance *  1; move_y = distance *  0
  328.     when 7; move_x = distance / -2; move_y = distance / -2
  329.     when 8; move_x = distance *  0; move_y = distance * -1
  330.     when 9; move_x = distance /  2; move_y = distance / -2
  331.     else; return
  332.     end
  333.     destination_x = @screen_x + move_x
  334.     destination_y = @screen_y + move_y
  335.     create_move_to(destination_x, destination_y, frames)
  336.   end
  337.  
  338.   #--------------------------------------------------------------------------
  339.   # forward_direction
  340.   #--------------------------------------------------------------------------
  341.   def forward_direction
  342.     return ($game_system.party_direction ||
  343.     YEA::VISUAL_BATTLERS::PARTY_DIRECTION)
  344.   end
  345.  
  346.   #--------------------------------------------------------------------------
  347.   # move_origin
  348.   #--------------------------------------------------------------------------
  349.   def move_origin
  350.     create_move_to(@origin_x, @origin_y)
  351.     face_coordinate(@origin_x, @origin_y)
  352.     @moved_back = false
  353.   end
  354.  
  355.   #--------------------------------------------------------------------------
  356.   # moving?
  357.   #--------------------------------------------------------------------------
  358.   def moving?
  359.     return false if dead? || !exist?
  360.     return @move_x_rate != 0 || @move_y_rate != 0
  361.   end
  362.  
  363. end # Game_Battler
  364.  
  365. #==============================================================================
  366. # ?   Game_Actor
  367. #==============================================================================
  368.  
  369. class Game_Actor < Game_Battler
  370.  
  371.   #--------------------------------------------------------------------------
  372.   # overwrite method: use_sprite?
  373.   #--------------------------------------------------------------------------
  374.   def use_sprite?
  375.     return true
  376.   end
  377.  
  378.   #--------------------------------------------------------------------------
  379.   # new method: screen_x
  380.   #--------------------------------------------------------------------------
  381.   def screen_x
  382.     return @screen_x rescue 0
  383.   end
  384.  
  385.   #--------------------------------------------------------------------------
  386.   # new method: screen_y
  387.   #--------------------------------------------------------------------------
  388.   def screen_y
  389.     return @screen_y rescue 0
  390.   end
  391.  
  392.   #--------------------------------------------------------------------------
  393.   # new method: screen_z
  394.   #--------------------------------------------------------------------------
  395.   def screen_z
  396.     return 100
  397.   end
  398.  
  399.   #--------------------------------------------------------------------------
  400.   # new method: sprite
  401.   #--------------------------------------------------------------------------
  402.   def sprite
  403.     index = $game_party.battle_members.index(self)
  404.     return SceneManager.scene.spriteset.actor_sprites[index]
  405.   end
  406.  
  407.   #--------------------------------------------------------------------------
  408.   # new method: character
  409.   #--------------------------------------------------------------------------
  410.   def character
  411.     return sprite.character_base
  412.   end
  413.  
  414.   #--------------------------------------------------------------------------
  415.   # face_opposing_party
  416.   #--------------------------------------------------------------------------
  417.   def face_opposing_party
  418.     dr = $game_system.party_direction || YEA::VISUAL_BATTLERS::PARTY_DIRECTION
  419.     direction = Direction.opposite(dr)
  420.     character.set_direction(Direction.correct(direction)) rescue 0
  421.   end
  422.  
  423.   #--------------------------------------------------------------------------
  424.   # forward_direction
  425.   #--------------------------------------------------------------------------
  426.   def forward_direction
  427.     return Direction.opposite(($game_system.party_direction ||
  428.     YEA::VISUAL_BATTLERS::PARTY_DIRECTION))
  429.   end
  430.  
  431. end # Game_Actor
  432.  
  433. #==============================================================================
  434. # ?   Game_Enemy
  435. #==============================================================================
  436.  
  437. class Game_Enemy < Game_Battler
  438.  
  439.   #--------------------------------------------------------------------------
  440.   # new method: sprite
  441.   #--------------------------------------------------------------------------
  442.   def sprite
  443.     return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  444.   end
  445.  
  446.   #--------------------------------------------------------------------------
  447.   # new method: character
  448.   #--------------------------------------------------------------------------
  449.   def character
  450.     return sprite
  451.   end
  452.  
  453. end # Game_Enemy
  454.  
  455. #==============================================================================
  456. # ?   Game_Troop
  457. #==============================================================================
  458.  
  459. class Game_Troop < Game_Unit
  460.  
  461.   #--------------------------------------------------------------------------
  462.   # alias method: setup
  463.   #--------------------------------------------------------------------------
  464.   alias game_troop_setup_vb setup
  465.   def setup(troop_id)
  466.     game_troop_setup_vb(troop_id)
  467.     set_coordinates
  468.   end
  469.  
  470.   #--------------------------------------------------------------------------
  471.   # new method: set_coordinates
  472.   #--------------------------------------------------------------------------
  473.   def set_coordinates
  474.     for member in members
  475.       member.origin_x = member.screen_x
  476.       member.origin_y = member.screen_y
  477.       member.create_move_to(member.screen_x, member.screen_y, 1)
  478.     end
  479.   end
  480.  
  481. end # Game_Troop
  482.  
  483. #==============================================================================
  484. # ?   Sprite_Battler
  485. #==============================================================================
  486.  
  487. class Sprite_Battler < Sprite_Base
  488.  
  489.   #--------------------------------------------------------------------------
  490.   # public instance_variable
  491.   #--------------------------------------------------------------------------
  492.   attr_accessor :character_base
  493.   attr_accessor :character_sprite
  494.  
  495.   #--------------------------------------------------------------------------
  496.   # alias method: dispose
  497.   #--------------------------------------------------------------------------
  498.   alias sprite_battler_dispose_vb dispose
  499.   def dispose
  500.     dispose_character_sprite
  501.     sprite_battler_dispose_vb
  502.   end
  503.  
  504.   #--------------------------------------------------------------------------
  505.   # new method: dispose_character_sprite
  506.   #--------------------------------------------------------------------------
  507.   def dispose_character_sprite
  508.     @character_sprite.dispose unless @character_sprite.nil?
  509.   end
  510.  
  511.   #--------------------------------------------------------------------------
  512.   # alias method: update
  513.   #--------------------------------------------------------------------------
  514.   alias sprite_battler_update_vb update
  515.   def update
  516.     sprite_battler_update_vb
  517.     return if @battler.nil?
  518.     update_move_to
  519.     update_character_base
  520.     update_character_sprite
  521.   end
  522.  
  523.   #--------------------------------------------------------------------------
  524.   # new method: update_character_base
  525.   #--------------------------------------------------------------------------
  526.   def update_character_base
  527.     return if @character_base.nil?
  528.     @character_base.update
  529.   end
  530.  
  531.   #--------------------------------------------------------------------------
  532.   # new method: update_character_sprite
  533.   #--------------------------------------------------------------------------
  534.   def update_character_sprite
  535.     return if @character_sprite.nil?
  536.     @character_sprite.update
  537.   end
  538.  
  539.   #--------------------------------------------------------------------------
  540.   # new method: update_move_to
  541.   #--------------------------------------------------------------------------
  542.   def update_move_to
  543.     @battler.update_move_to
  544.   end
  545.  
  546.   #--------------------------------------------------------------------------
  547.   # new method: moving?
  548.   #--------------------------------------------------------------------------
  549.   def moving?
  550.     return false if @battler.nil?
  551.     return @battler.moving?
  552.   end
  553.  
  554. end # Sprite_Battler
  555.  
  556. #==============================================================================
  557. # ?   Sprite_BattleCharacter
  558. #==============================================================================
  559.  
  560. class Sprite_BattleCharacter < Sprite_Character
  561.  
  562.   #--------------------------------------------------------------------------
  563.   # initialize
  564.   #--------------------------------------------------------------------------
  565.   def initialize(viewport, character = nil)
  566.     super(viewport, character)
  567.     character.sprite = self
  568.   end
  569.  
  570. end # Sprite_BattleCharacter
  571.  
  572. #==============================================================================
  573. # ?   Spriteset_Battle
  574. #==============================================================================
  575.  
  576. class Spriteset_Battle
  577.  
  578.   #--------------------------------------------------------------------------
  579.   # public instance_variable
  580.   #--------------------------------------------------------------------------
  581.   attr_accessor :actor_sprites
  582.   attr_accessor :enemy_sprites
  583.  
  584.   #--------------------------------------------------------------------------
  585.   # overwrite method: create_actors
  586.   #--------------------------------------------------------------------------
  587.   def create_actors
  588.     total = $game_party.max_battle_members
  589.     @current_party = $game_party.battle_members.clone
  590.     @actor_sprites = Array.new(total) { Sprite_Battler.new(@viewport1) }
  591.     for actor in $game_party.battle_members
  592.       @actor_sprites[actor.index].battler = actor
  593.       create_actor_sprite(actor)
  594.     end
  595.   end
  596.  
  597.   #--------------------------------------------------------------------------
  598.   # new method: create_actor_sprite
  599.   #--------------------------------------------------------------------------
  600.   def create_actor_sprite(actor)
  601.     character = Game_BattleCharacter.new(actor)
  602.     character_sprite = Sprite_BattleCharacter.new(@viewport1, character)
  603.     @actor_sprites[actor.index].character_base = character
  604.     @actor_sprites[actor.index].character_sprite = character_sprite
  605.     actor.face_opposing_party
  606.   end
  607.  
  608.   #--------------------------------------------------------------------------
  609.   # alias method: update_actors
  610.   #--------------------------------------------------------------------------
  611.   alias spriteset_battle_update_actors_vb update_actors
  612.   def update_actors
  613.     if @current_party != $game_party.battle_members
  614.       dispose_actors
  615.       create_actors
  616.     end
  617.     spriteset_battle_update_actors_vb
  618.   end
  619.  
  620.   #--------------------------------------------------------------------------
  621.   # new method: moving?
  622.   #--------------------------------------------------------------------------
  623.   def moving?
  624.     return battler_sprites.any? {|sprite| sprite.moving? }
  625.   end
  626.  
  627. end # Spriteset_Battle
  628.  
  629. #==============================================================================
  630. # ?   Scene_Battle
  631. #==============================================================================
  632.  
  633. class Scene_Battle < Scene_Base
  634.  
  635.   #--------------------------------------------------------------------------
  636.   # public instance variables
  637.   #--------------------------------------------------------------------------
  638.   attr_accessor :spriteset
  639.  
  640.   #--------------------------------------------------------------------------
  641.   # alias method: process_action_end
  642.   #--------------------------------------------------------------------------
  643.   alias scene_battle_process_action_end_vb process_action_end
  644.   def process_action_end
  645.     start_battler_move_origin
  646.     scene_battle_process_action_end_vb
  647.   end
  648.  
  649.   #--------------------------------------------------------------------------
  650.   # alias method: execute_action
  651.   #--------------------------------------------------------------------------
  652.   alias scene_battle_execute_action_vb execute_action
  653.   def execute_action
  654.     start_battler_move_forward
  655.     scene_battle_execute_action_vb
  656.   end
  657.  
  658.   #--------------------------------------------------------------------------
  659.   # new method: start_battler_move_forward
  660.   #--------------------------------------------------------------------------
  661.   def start_battler_move_forward
  662.     return if @subject.started_turn
  663.     @subject.started_turn = true
  664.     @subject.move_forward
  665.     wait_for_moving
  666.   end
  667.  
  668.   #--------------------------------------------------------------------------
  669.   # new method: start_battler_move_origin
  670.   #--------------------------------------------------------------------------
  671.   def start_battler_move_origin
  672.     @subject.started_turn = nil
  673.     move_battlers_origin
  674.     wait_for_moving
  675.     @subject.face_opposing_party rescue 0
  676.   end
  677.  
  678.   #--------------------------------------------------------------------------
  679.   # new method: move_battlers_origin
  680.   #--------------------------------------------------------------------------
  681.   def move_battlers_origin
  682.     for member in all_battle_members
  683.       next if member.dead?
  684.       next unless member.exist?
  685.       member.move_origin
  686.     end
  687.   end
  688.  
  689.   #--------------------------------------------------------------------------
  690.   # new method: wait_for_moving
  691.   #--------------------------------------------------------------------------
  692.   def wait_for_moving
  693.     update_for_wait
  694.     update_for_wait while @spriteset.moving?
  695.   end
  696.  
  697. end # Scene_Battle
  698.  
  699. #==============================================================================
  700. #
  701. #    End of File
  702. #
  703. #==============================================================================


然後下面是樓上腳本需要的素材~  

lnx11a_popup.zip

549.97 KB, 下载次数: 10

第3.zip

868.99 KB, 下载次数: 10

lnx11a_cursor7.zip

20.15 KB, 下载次数: 12

点评

我說...總共有四個腳本,你只提供基礎的LNX11aconf_XP、LNX11a_XP,樓主是要其中的血條SKIN... 這神回覆我都無語了...  发表于 2013-8-18 01:24

回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
327
在线时间
1291 小时
注册时间
2013-1-12
帖子
3590

贵宾

9
发表于 2013-8-17 13:04:25 | 只看该作者
本帖最后由 76213585 于 2013-8-16 22:29 编辑

说明翻譯:  (請版主予許連帖)
完成了的說~
RUBY 代码复制
  1. module LNX11
  2.   #--------------------------------------------------------------------------
  3.   # ● 基本設定
  4.   #--------------------------------------------------------------------------
  5.   # デフォルトで表示するアクターのバトラーグラフィック
  6.   #  0 = 人物脸图 / 1 = 行走图
  7.   DEFAULT_BATTLER_GRAPHIC = 0  
  8.  
  9.   # 背景颜色([Color1, Color2])
  10.   DEFAULT_BG_COLOR        = [Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  11.                    # 規定値:[Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  12.  
  13.   # 事件中的“改变画面色调”在战斗中有没有用 true = 有效 / false = 無效
  14.   ACTOR_SCREEN_TONE       = false  
  15.  
  16.   # TP加减的弹出设定
  17.   # 0 = 都不弹出
  18.   # 1 = 角色弹出
  19.   # 2 = 都會弹出
  20.   TP_POPUP_TYPE           = 1      
  21.  
  22.   # 无伤害时不弹出伤害 true = 是 / false = 無
  23.   INDEXZERO_NO_POPUP      = true   # 所以true時是為0不會彈出 false則相反
  24.  
  25.   #--------------------------------------------------------------------------
  26.   # ● 人物状态区的背景
  27.   #--------------------------------------------------------------------------
  28.   # 人物状态区背景类型
  29.   # 0 = 沒有
  30.   # 1 = 特定颜色 (下面设定)
  31.   # 2 = window文件的样式(像是对话框)
  32.   # "文字列" = 画像
  33.   ACTOR_BACKGROUND        = 2   #背景类型
  34.  
  35.   # 人物状态区的高度
  36.   ACTOR_BACKGROUND_HEIGHT = 112
  37.  
  38.     #------------------------------------------------------------------------
  39.     # 如果选则了1: 特定颜色 在这设定颜色
  40.     #------------------------------------------------------------------------
  41.     ACTOR_BG_GRADIENT_COLOR = [Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  42.     # 原本的:[Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  43.  
  44.   #--------------------------------------------------------------------------
  45.   # ● 战斗记录設定
  46.   #--------------------------------------------------------------------------
  47.   # 战斗记录类型
  48.   # 0 = VXAce默认
  49.   # 1 = 积累型
  50.   # 2 = 帮助显示 (ヘルプ表示) (不太懂)
  51.   BATTLELOG_TYPE  =  1
  52.  
  53.     #------------------------------------------------------------------------
  54.     # 如果选则了1: 积累型 在这设定
  55.     #------------------------------------------------------------------------
  56.     # 一次最多显示行数
  57.     STORAGE_LINE_NUMBER     = 6   
  58.  
  59.     # 一行高度
  60.     STORAGE_LINE_HEIGHT     = 20   
  61.  
  62.     # 自动记录的时间(帧数)
  63.     STORAGE_UP_MESSAGE_TIME = 90   
  64.  
  65.     # 自动记录的时间一到就消除(不等到滿一次最多显示的行数)
  66.     # true = 是
  67.     # false = 不是
  68.     STORAGE_TURNEND_CLEAR   = true
  69.  
  70.     # 座標調整 :x = X座標 / :y = Y座標
  71.     STORAGE_OFFSET = {:x => 0, :y => 6}  # 規定値:{:x => 0, :y => 6}
  72.  
  73.  
  74.     # :size = 框的大小
  75.     # :out_color = 框的顏色
  76.     STORAGE_FONT   = {:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  77.             # 原本:{:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  78.  
  79.     # 背景顏色([Color1, Color2])
  80.     STORAGE_GRADIENT_COLOR = [Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  81.                     # 規定値:[Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  82.  
  83.     #------------------------------------------------------------------------
  84.     # 如果选则了 2 : 帮助显示 在这设定
  85.     #------------------------------------------------------------------------
  86.     # 弹出时等待时间(帧数)
  87.     POPUP_ADD_WAIT          = 6   
  88.  
  89.     # 行動的表示形式
  90.     # 0 = 图标+名字
  91.     # 1 = 只有名字
  92.     HELPDISPLAY_TYPE        = 1   
  93.  
  94.     # 行動の表示始めの追加ウェイト (不懂)
  95.     HELPDISPLAT_WAIT        = 20    # 規定値:20
  96.  
  97.     # 行動の表示終了までの追加ウェイト (不懂)
  98.     HELPDISPLAT_END_WAIT    = 24    # 規定値:24
  99.  
  100.     # 行動の簡易説明文
  101.     # :size = フォントサイズ :delimiter = 名前と簡易説明文の区切り文字  (不懂)
  102.     HELPDISPLAY_DESCRIPTION = {:size => 20, :delimiter => " "}
  103.                      # 規定値:{:size => 20, :delimiter => " "}
  104. #============================================
  105. #  
  106. #
  107. #  下面这段感觉不是很重要......就不翻了
  108. #
  109. #============================================
  110.   #--------------------------------------------------------------------------
  111.   # ● 战斗消息設定
  112.   #--------------------------------------------------------------------------
  113.   # 战斗消息显示目标(战斗开始  逃跑,结果)
  114.   # 0 = メッセージウィンドウ / 1 = バトルログ / 2 = ヘルプ
  115.   MESSAGE_TYPE  =  2   # 規定値:2
  116.  
  117.     #------------------------------------------------------------------------
  118.     # ○ バトルメッセージタイプ [0:メッセージウィンドウ] の設定
  119.     #------------------------------------------------------------------------
  120.     # メッセージウィンドウの背景 0 = ウィンドウ / 1 = 背景を暗くする / 2 = 透明
  121.     MESSAGE_WINDOW_BACKGROUND  = 1     # 規定値:1
  122.  
  123.     # メッセージウィンドウの位置 0 = 上 / 1 = 中 / 2 = 下
  124.     MESSAGE_WINDOW_POSITION    = 0     # 規定値:0
  125.  
  126.     #------------------------------------------------------------------------
  127.     # ○ バトルメッセージタイプ [2:ヘルプ] の設定
  128.     #------------------------------------------------------------------------
  129.     # ヘルプバトルメッセージのウェイト
  130.     #   [ウェイト(フレーム), キー入力を待つ(true = 有効 / false = 無効)]
  131.     #  :battle_start = 戦闘開始      :victory = 勝利
  132.     #  :escape       = 逃走          :defeat  = 敗北
  133.     #  :drop_item    = アイテム獲得 :levelup = レベルアップ
  134.     MESSAGE_WAIT = {:battle_start => [120, false], :victory   => [ 60, false],
  135.                     :defeat       => [120, false], :escape    => [120, false],
  136.                     :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  137.           # 規定値:{:battle_start => [120, false], :victory   => [ 60, false],
  138.           #         :defeat       => [120, false], :escape    => [120, false],
  139.           #         :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  140.  
  141.   # 戦闘開始時の敵出現メッセージを表示する
  142.   MESSAGE_WINDOW_ENEMY_NAMES = false # 規定値:false
  143.  
  144.   # レベルアップ SE  RPG::SE.new("ファイル名", 音量, ピッチ)
  145.   LEVELUP_SE  = RPG::SE.new("Up4", 90, 100)   # 規定値:("Up4", 90, 100)
  146.  
  147.   # ドロップアイテム獲得 SE  RPG::SE.new("ファイル名", 音量, ピッチ)
  148.   # * バトルメッセージタイプが 0 以外の場合のみ再生されます。
  149.   DROPITEM_SE = RPG::SE.new("Item3", 80, 125) # 規定値:("Item3", 80, 125)
  150.  
  151.   #--------------------------------------------------------------------------
  152.   # ● 立繪設定
  153.   #--------------------------------------------------------------------------
  154.   # 在中間顯示 true = 是 / false = 不是
  155.   ACTOR_CENTERING  =  true   
  156.  
  157.     #------------------------------------------------------------------------
  158.     # 在中間顯示的設定
  159.     #------------------------------------------------------------------------
  160.     # 空間補正
  161.     ACTOR_SPACING_ADJUST = 32 # 規定値:32
  162.  
  163.   # 座標調整 :x = X座標 / :y = Y座標
  164.   # * アクターコマンドのX座標には影響しません。
  165.   ACTOR_OFFSET  = {:x => -16, :y => 0}       # 原本:{:x => -16, :y => 0}
  166.  
  167.   # 画面旁留白 :side = 左右留白 / :bottom = 下方留白
  168.   ACTOR_PADDING = {:side => 4, :bottom => 8} # 原本:{:side => 4, :bottom => 8}
  169.  
  170.   #动画位置修正
  171.   #
  172.   SCREEN_ANIMATION_OFFSET = 128  # 規定値:128
  173.  
  174.   #--------------------------------------------------------------------------
  175.   # ● 战斗状态顯示設定
  176.   #--------------------------------------------------------------------------
  177.   # 座標的調整  :x = X座標 / :y = Y座標
  178.   # 调整位置。
  179.   STATUS_OFFSET = {:x => 64, :y => -12} # 規定値:{:x => 64, :y => -12}
  180.  
  181.   # 左右留白
  182.   STATUS_SIDE_PADDING   = 6     # 規定値:6
  183.  
  184.   # 一个人状态区的宽度
  185.   STATUS_WIDTH          = 72    # 規定値:72
  186.  
  187.   #自动调整
  188.   STATUS_AUTOADJUST     = true  # 規定値:true
  189.  
  190.   # 最高
  191.   STATUS_LINE_HEIGHT    = 22    # 規定値:22
  192.  
  193.   # 名字大小
  194.   STATUS_NAME_SIZE      = 20    # 規定値:20
  195.  
  196.   # 血條的大小
  197.   STATUS_PARAM_SIZE     = 23    # 規定値:23
  198.  
  199.   # 血條的不透明度
  200.   STATUS_GAUGE_OPACITY  = 192   # 規定値:192
  201.  
  202.   #--------------------------------------------------------------------------
  203.   # ● 演员指令設定
  204.   #--------------------------------------------------------------------------
  205.   # 超过4个可能指令(像是攻击 物品 等等的)時 true = 是 / false = 不是
  206.   ACTOR_COMMAND_NOSCROLL   = true  # 規定値:true
  207.  
  208.   # コマンドを横並びにする true = 横並び / false = 縦並び  (不是很懂)
  209.   ACTOR_COMMAND_HORIZON    = false # 規定値:false
  210.  
  211.   # 文字對齊
  212.   #0 = 向左
  213.   #1 = 向右
  214.   #2 = 向中間
  215.   ACTOR_COMMAND_ALIGNMENT  = 0     # 規定値:0
  216.  
  217.   #窗口的宽度
  218.   ACTOR_COMMAND_WIDTH      = 128   # 規定値:128
  219.  
  220.   # 窗口的位置
  221.   #  0 = 角色的頭上
  222.   #  1 = 固定的Y座標
  223.   #  2 = 固定的XY座標
  224.   ACTOR_COMMAND_POSITION   = 0     
  225.  
  226.     #------------------------------------------------------------------------
  227.     #  固定的Y座標 &固定的XY座標的設定
  228.     #------------------------------------------------------------------------
  229.     # 固定Y座標の基準位置
  230.     ACTOR_COMMAND_Y_POSITION = 0   # 規定値:0
  231.  
  232.     # XY座標修正 :x = X座標 / :y = Y座標
  233.     ACTOR_COMMAND_OFFSET  = {:x => 0, :y => -16} # 規定値:{:x => 0, :y => -16}
  234. #===========================================
  235. #
  236. # 不是很重要
  237. #
  238. #===========================================
  239.   #--------------------------------------------------------------------------
  240.   # ● 設定:パーティコマンド
  241.   #--------------------------------------------------------------------------
  242.   # コマンドを横並びにする true = 横並び / false = 縦並び
  243.   PARTY_COMMAND_HORIZON   = true  # 規定値:true
  244.  
  245.   # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  246.   PARTY_COMMAND_ALIGNMENT = 1     # 規定値:1
  247.  
  248.   # ウィンドウの幅
  249.   PARTY_COMMAND_WIDTH     = Graphics.width     # 規定値:Graphics.width
  250.  
  251.   # ウィンドウの座標 :x = X座標 / :y = Y座標
  252.   PARTY_COMMAND_XY        = {:x => 0, :y => 0} # 規定値:{:x => 0, :y => 0}
  253.  
  254.   #--------------------------------------------------------------------------
  255.   # ●目标光标
  256.   #--------------------------------------------------------------------------
  257.   # 图片位置 (Graphics/System/*)
  258.   #  "" 為空的時候自動生成
  259.   CURSOR_NAME       = ""   
  260.  
  261.     #------------------------------------------------------------------------
  262.     # 自動生成的設定
  263.     #------------------------------------------------------------------------
  264.     # 可以用三色調出來 (Red, Green, Blue)
  265.     #如果要看效果可以用数据库内的对话框颜色调配试试
  266.     CURSOR_TONE     = Tone.new(-34, 0, 68)  # 規定値:Tone.new(-34, 0, 68)
  267.  
  268.   # 动画速度
  269.   CURSOR_ANI_SPEED  = 3     # 規定値:3
  270.  
  271.   # 移动速度
  272.   CURSOR_SPEED      = 3     # 規定値:3
  273.  
  274.   # 光标是否闪动
  275.   CURSOR_BLINK      = true  
  276.  
  277.   # 光标Y座標上限 :min = 最小値 / :max = 最大値
  278.   CURSOR_MINMAX     = {:min => 48, :max => Graphics.height}
  279.              # 規定値:{:min => 48, :max => Graphics.height}
  280.  
  281.   # 光标位置XY座標修正 :x = X座標 / :y = Y座標
  282.   CURSOR_OFFSET     = {:x => 0, :y => 0} # 規定値:{:x => 0, :y => 0}
  283. #====================================
  284. #
  285. #  不是很重要
  286. #
  287. #====================================
  288.  
  289.   #--------------------------------------------------------------------------
  290.   # ● 設定:ターゲットヘルプ
  291.   #--------------------------------------------------------------------------
  292.   # バトラーの各パラメータ表示 true = 表示 / false = 非表示
  293.   HELP_ACTOR_PARAM = {:hp => true ,:mp => true ,:tp => true ,:state => true }
  294.   HELP_ENEMY_PARAM = {:hp => false,:mp => false,:tp => false,:state => true }
  295.     # アクター規定値:{:hp => true ,:mp => true ,:tp => true ,:state => true }
  296.     # 敵キャラ規定値:{:hp => false,:mp => false,:tp => false,:state => true }
  297.  
  298.   # HP/MP/TP ゲージの幅
  299.   HELP_PARAM_WIDTH    = 72  # 規定値:72
  300.  
  301.   # 敵ランダムの表示形式
  302.   # 0 = 敵全体 ランダム / 1 = 敵n体 ランダム
  303.   RANDOMSCOPE_DISPLAY = 1   # 規定値:1
  304.  
  305.   #--------------------------------------------------------------------------
  306.   # ● 伤害弹出设定
  307.   #--------------------------------------------------------------------------
  308.   # 弹出位置
  309.   #0 = 脚下
  310.   #1 = 中間
  311.   #2 = 頭上
  312.   #3 = 固定 (怪物不可用)
  313.   ACTOR_POPUP_POSITION   = 3  # 人物的     
  314.   ENEMY_POPUP_POSITION   = 1  # 敵人的     
  315.   LEVELUP_POPUP_POSITION = 3  # 升等彈出位置  
  316.  
  317.     #------------------------------------------------------------------------
  318.     # 3 = 固定(人物使用)的設定
  319.     #------------------------------------------------------------------------
  320.     # 人物彈出的Y 座標
  321.     # 游戏画面的高度(Graphics.height)為基準
  322.     ACTOR_POPUP_Y     =  -100  
  323.  
  324.     # 升級彈出的Y 座標
  325.     # 游戏画面的高度(Graphics.height)為基準
  326.     LEVELUP_POPUP_Y   =  -112
  327.  
  328.   #数字字体
  329.   NUMBER_FONT   =  ["Arial Black", "VL Gothic"] # ["Arial Black", "VL Gothic"]
  330.  
  331.   # 本文字体
  332.   TEXT_FONT     =  ["Arial Black", "VL Gothic"] # ["Arial Black", "VL Gothic"]
  333.   TEXT_FONT_MCS =  ["VL Gothic"]       #日本語を含む場合。規定値:["VL Gothic"]
  334.  
  335.   # 字体文件名 (Graphics/System/*) <<ver1.10>>
  336.   #  "" 如為空則用正常的字。
  337.   # 正常時的字体文件名
  338.   LARGE_NUMBER_NAME = ""       # 規定値:""
  339.   SMALL_NUMBER_NAME = ""       # 規定値:""
  340.   # 克別人/被克時的字体文件名
  341.   LARGE_BUFFS_NAME  = ""       # 規定値:""
  342.   SMALL_BUFFS_NAME  = ""       # 規定値:""
  343.  
  344.   # 数字中的空格
  345.   #  :fontsize = 字体大小 / :spacing = 空几个字
  346.   #  :width    = 每一个字的寬度 / :height = 每一个字的高度
  347.   LARGE_NUMBER  =  {:fontsize => 38, :spacing => -4, :line_height => 26}
  348.   SMALL_NUMBER  =  {:fontsize => 28, :spacing => -4, :line_height => 20}
  349.   # 原本:{:fontsize => 38, :spacing => -4, :line_height => 26}
  350.   # 原本:{:fontsize => 28, :spacing => -4, :line_height => 20}
  351.  
  352.   # テキストのフォントサイズ倍率 (不懂)
  353.   #   :normal     = テキスト単体 (不懂)
  354.   #   :left_right = ダメージ左右   :top_bottom = ダメージ上下 (不懂)
  355.   # * 数字のフォントサイズからの割合で指定します。 (不懂)
  356.   TEXT_SIZERATE     = {:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  357.     # 原本:{:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  358.  
  359.   # 有日文時的倍率
  360.   TEXT_SIZERATE_MCS = 0.9   # 規定値:0.9
  361. #===============
  362. # 有点像是Vocab的東東
  363. #===============
  364.   DECORATION_NUMBER = {            # 規定値
  365.   :critical    => ["CRITICAL", 8], # ["CRITICAL", 8] / クリティカル
  366.   :weakness    => ["WEAKNESS", 8], # ["WEAKNESS", 8] / 弱点ダメージ
  367.   :resist      => ["RESIST"  , 8], # ["RESIST"  , 8] / 耐性ダメージ
  368.   :mp_damage   => ["\mp"     , 4], # ["\mp"     , 4] / MP ダメージ・回復
  369.   :mp_plus     => ["\mp+"    , 4], # ["\mp+"    , 4] / MP 再生
  370.   :mp_minus    => ["\mp-"    , 4], # ["\mp-"    , 4] / MP 消費
  371.   :tp_plus     => ["\tp+"    , 4], # ["\tp+"    , 4] / TP 増加
  372.   :tp_minus    => ["\tp-"    , 4], # ["\tp-"    , 4] / TP 減少
  373.   }
  374.   # ステートや能力強化/弱体のポップアップの修飾文字
  375.   #  %s にステート・能力名が入る
  376.   DECORATION_TEXT = {              # 規定値
  377.   :add_state   => "+%s",           # "+%s"           / ステート付加
  378.   :rem_state   => "-%s",           # "-%s"           / ステート解除
  379.   :add_buff    => "%s UP",         # "%s UP"         / 能力強化付加
  380.   :add_debuff  => "%s DOWN",       # "%s DOWN"       / 能力弱体付加
  381.   :rem_buff    => "-%s Buff",      # "-%s Buff"      / 能力強化/弱体解除
  382.   }
  383.   # ポップアップの表示用語
  384.   POPUP_VOCAB = {                  # 規定値
  385.   :miss        => "MISS!",         # "MISS!"         / ミス
  386.   :counter     => "Counter",       # "Counter"       / 反撃
  387.   :reflection  => "Reflection",    # "Reflection"    / 反射
  388.   :substitute  => "Substitute",    # "Substitute"    / 身代わり
  389.   :levelup     => "LEVELUP!",      # "LEVELUP!"      / レベルアップ
  390.   }
  391.   # 能力強化/弱体ポップアップのパラメータ表記
  392.   # * 文字列中の \hp \mp はデータベースで設定した用語(短)に置き換わります
  393.   POPUP_VOCAB_PARAMS = [ # 規定値
  394.   "MAX\hp",              # "MAX\hp"  / 最大HP    MAXimum Hit Point
  395.   "MAX\mp",              # "MAX\mp"  / 最大MP    MAXimum Magic Point
  396.   "ATK",                 # "ATK"     / 攻撃力    ATtacK power
  397.   "DEF",                 # "MATK"    / 防御力    DEFense power
  398.   "MATK",                # "MDEF"    / 魔法力    Magic ATtacK power
  399.   "MDEF",                # "MDEF"    / 魔法防御  Magic DEFense power
  400.   "AGI",                 # "AGI"     / 敏捷性    AGIlity
  401.   "LUCK",                # "LUCK"    / 運        LUCK
  402.   ]
  403.   # ポップアップの色([Color1, Color2])
  404.   # * ハッシュの順序を変更しないこと
  405.   POPUP_COLOR = {
  406.   # HP ダメージ(ミス)
  407.   :hp_damage     => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  408.   # クリティカルダメージ
  409.   :critical      => [Color.new(255, 255,  80), Color.new(224,  32,   0)],
  410.   # 弱点ダメージ
  411.   :weakness      => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  412.   # 耐性ダメージ
  413.   :resist        => [Color.new(232, 224, 216), Color.new( 56,  48,  40)],
  414.   # HP 回復(再生,吸収)
  415.   :hp_recovery   => [Color.new( 96, 255, 128), Color.new(  0,  64,  32)],
  416.   # MP ダメージ
  417.   :mp_damage     => [Color.new(248,  80, 172), Color.new( 48,   0,  32)],
  418.   # MP 回復(再生,吸収)
  419.   :mp_recovery   => [Color.new(160, 240, 255), Color.new( 32,  48, 144)],
  420.   # TP 増減
  421.   :tp_damage     => [Color.new(248, 240,  64), Color.new(  0,  80,  40)],
  422.   # 有利なステートの付加
  423.   :add_state     => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  424.   # 有利なステートの解除
  425.   :rem_state     => [Color.new(224, 232, 240), Color.new( 32,  64, 128, 128)],
  426.   # ステートの付加
  427.   :add_badstate  => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  428.   # ステートの解除
  429.   :rem_badstate  => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  430.   # 能力強化の付加
  431.   :add_buff      => [Color.new(255, 255, 192), Color.new( 96,  64,   0)],
  432.   # 能力弱体の付加
  433.   :add_debuff    => [Color.new(200, 224, 232), Color.new( 40,  48,  56)],
  434.   # 能力強化/弱体の解除
  435.   :rem_buff      => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  436.   # 反撃
  437.   :counter       => [Color.new(255, 255, 224), Color.new(128,  96,   0)],
  438.   # 反射
  439.   :reflection    => [Color.new(224, 255, 255), Color.new(  0,  96, 128)],
  440.   # 身代わり
  441.   :substitute    => [Color.new(224, 255, 224), Color.new(  0, 128,  64)],
  442.   # レベルアップ
  443.   :levelup       => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  444.   }
  445.   # ポップアップのタイプ        -1 = ポップアップしない
  446.   #  0 = 跳ねるポップアップ(大)  4 = スライド(大)
  447.   #  1 = 跳ねるポップアップ(小)  5 = スライド(小)
  448.   #  2 = ゆっくり上昇(大)        6 = オーバーレイ(大)
  449.   #  3 = ゆっくり上昇(小)        7 = オーバーレイ(小)
  450.   POPUP_TYPE = {          # 規定値
  451.   :miss          =>   0,  #   0 / ミス
  452.   :hp_damage     =>   0,  #   0 / HP ダメージ
  453.   :hp_slipdamage =>   1,  #   1 / HP スリップダメージ
  454.   :hp_recovery   =>   0,  #   0 / HP 回復
  455.   :hp_regenerate =>   1,  #   1 / HP 再生
  456.   :hp_drain      =>   0,  #   0 / HP 被吸収
  457.   :hp_drainrecv  =>   0,  #   0 / HP 吸収回復
  458.   :mp_damage     =>   0,  #   0 / MP ダメージ
  459.   :mp_slipdamage =>   1,  #   1 / MP スリップダメージ
  460.   :mp_recovery   =>   0,  #   0 / MP 回復
  461.   :mp_regenerate =>   1,  #   1 / MP 再生
  462.   :mp_drain      =>   0,  #   0 / MP 被吸収
  463.   :mp_drainrecv  =>   0,  #   0 / MP 吸収回復
  464.   :mp_paycost    =>  -1,  #  -1 / MP 消費
  465.   :tp_damage     =>   1,  #   1 / TP 増加(ダメージ)
  466.   :tp_charge     =>  -1,  #  -1 / TP チャージ(被ダメージ時の TP 増加)
  467.   :tp_gain       =>   7,  #   7 / TP 得
  468.   :tp_regenerate =>   1,  #   1 / TP 再生(スリップダメージ)
  469.   :tp_paycost    =>  -1,  #  -1 / TP 消費
  470.   # ステート/能力
  471.   :add_state     =>   2,  #   2 / 有利なステートの付加
  472.   :rem_state     =>   2,  #   2 / 有利なステートの解除
  473.   :add_badstate  =>   2,  #   2 / 不利なステートの付加
  474.   :rem_badstate  =>   2,  #   2 / 不利なステートの解除
  475.   :add_buff      =>   3,  #   3 / 能力強化の付加
  476.   :add_debuff    =>   3,  #   3 / 能力弱体の付加
  477.   :rem_buff      =>   3,  #   3 / 能力強化/弱体の解除
  478.   # 特殊
  479.   :counter       =>   6,  #   6 / 反撃
  480.   :reflection    =>   6,  #   6 / 反射
  481.   :substitute    =>   4,  #   4 / 身代わり
  482.   }
  483.   # 0:跳ねるポップアップの動き(大)
  484.   LARGE_MOVEMENT = {
  485.   :inirate    => 6.4,  :gravity      => 0.68,  :side_scatter => 1.2,
  486.   :ref_height =>  32,  :ref_factor   => 0.60,  :ref_count    =>   2,
  487.                        :duration     =>   40,  :fadeout      =>  20 }
  488.   # 1:跳ねるポップアップの動き(小)
  489.   SMALL_MOVEMENT = {
  490.   :inirate    => 4.4,  :gravity      => 0.60,  :side_scatter => 0.0,
  491.   :ref_height =>  12,  :ref_factor   => 0.70,  :ref_count    =>   0,
  492.                        :duration     =>   60,  :fadeout      =>  16 }
  493.   # 2,3:上昇ポップアップの動き
  494.   RISE_MOVEMENT     = {:rising_speed => 0.75,  :line_spacing => 0.9,
  495.                        :duration     =>   40,  :fadeout      =>   8 }
  496.   # 4,5:スライドポップアップの動き
  497.   SLIDE_MOVEMENT    = {:x_speed      =>    2,  :line_spacing => 0.9,
  498.                        :duration     =>   50,  :fadeout      =>  32 }
  499.   # 6,7:オーバーレイポップアップの動き
  500.   OVERLAY_MOVEMENT  = {:duration     =>   36,  :fadeout      =>  32 }
  501.  
  502.   # :inirate      = 初速度                :gravity    = 重力加速度
  503.   # :side_scatter = 左右移動のばらつき    :ref_height = 跳ね返り位置
  504.   # :ref_factor   = 反発係数              :ref_count  = 跳ね返り回数
  505.   # :duration     = 消え始めるまでの時間  :fadeout    = 消える速度
  506.   # :rising_speed = 上昇速度              :x_speed    = 横移動速度
  507.   # :line_spacing = ポップアップの行間
  508. #
  509. #
  510. #
  511. #  一般人不會用到的說~
  512. #
  513. #
  514. #
  515.   #--------------------------------------------------------------------------
  516.   # ● 設定:ユーザビリティ
  517.   #--------------------------------------------------------------------------  
  518.   # 効果範囲が 使用者/全体/ランダム のスキル・アイテムの対象確認を行う
  519.   #  true = 有効 / false = 無効
  520.   FIX_TARGET_CHECKE     = true   # 規定値:true
  521.  
  522.   # 防御コマンドの対象確認を行う     true = 有効 / false = 無効
  523.   GUARD_TARGET_CHECKE   = true   # 規定値:true
  524.  
  525.   # アクターの対象選択を最適化する   true = 有効 / false = 無効
  526.   SMART_TARGET_SELECT   = true   # 規定値:true
  527.  
  528.   # 対象選択のカーソル位置を記憶する true = 有効 / false = 無効
  529.   LAST_TARGET           = true   # 規定値:true
  530.  
  531.   # パーティコマンドのカーソル位置を記憶する    true = 有効 / false = 無効
  532.   LAST_PARTY_COMMAND    = true   # 規定値:true
  533.  
  534.   # アクターコマンドのカーソル位置を記憶する    true = 有効 / false = 無効
  535.   LAST_ACTOR_COMMAND    = true   # 規定値:true
  536.  
  537.   # 敵キャラのインデックスを X 座標でソートする true = 有効 / false = 無効
  538.   TROOP_X_SORT          = true   # 規定値:true
  539.  
  540.   # パーティコマンド入力回数を最適化する        true = 有効 / false = 無効
  541.   PARTY_COMMAND_SKIP    = true   # 規定値:true
  542.  
  543.   #--------------------------------------------------------------------------
  544.   # ● 設定:その他
  545.   #--------------------------------------------------------------------------
  546.   # スキルリストとアイテムリストを項目数に合わせてリサイズする
  547.   #  true = 有効 / false = 無効
  548.   FITTING_LIST          = true   # 規定値:true
  549.  
  550.   # バトラーの行動時の白フラッシュを強める          true = 有効 / false = 無効
  551.   ENHANCED_WHITEN       = true   # 規定値:true
  552.  
  553.   # ダメージを受けた時の画面のシェイクを行わない    true = 有効 / false = 無効
  554.   DISABLED_DAMAGE_SHAKE = true   # 規定値:true
  555.  
  556.   # 敵キャラの X 座標を画面サイズに合わせて修正する true = 有効 / false = 無効
  557.   TROOP_X_SCREEN_FIX    = true   # 規定値:true
  558.  
  559.   # 敵キャラの Y 座標の調整
  560.   TROOP_Y_OFFSET        = 0      # 規定値:0
  561.  
  562.   #
  563.   # 設定ここまで お疲れ様でした。
  564.   #
  565. end
  566. #==============================================================================
  567. # ■ LNXスクリプト導入情報
  568. #==============================================================================
  569. $lnx_include = {} if $lnx_include == nil
  570. $lnx_include[:lnx11aconf] = 110 # version
  571. p "OK:LNX11aconf_XPスタイルバトル#コンフィグ"

点评

好东西……  发表于 2013-8-17 14:11
累死我了喵................. 谁見过600多行的設定...  发表于 2013-8-17 13:30

回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1124
在线时间
209 小时
注册时间
2013-6-19
帖子
138
10
发表于 2013-8-17 16:39:04 | 只看该作者
我再確定一次,樓主是要這個戰鬥風格的血條SKIN嗎?


如果確定無誤
把下面的檔案覆蓋到你的工程
或者,把裡面全部的圖片導入到Graphics/System
Graphics.rar (238.81 KB, 下载次数: 12)

接著再把下面四頁代碼貼到你的工程(已經幫你設定完畢,包括血條SKIN)
代碼極長,請耐心等候
一、
RUBY 代码复制
  1. #==============================================================================
  2. # ★ RGSS3-Extension
  3. # LNX11aconf_XPスタイルバトル#コンフィグ
  4. #  このスクリプトは LNX11a_XPスタイルバトル の設定スクリプトです。
  5. #  単体では何の機能も持ちませんのでご注意ください。
  6. #
  7. #  version   : 1.10 (12/11/18)
  8. #  author    : ももまる
  9. #  reference : [url]http://peachround.blog.fc2.com/blog-entry-9.html[/url]
  10. #
  11. #==============================================================================
  12.  
  13. module LNX11
  14.   #--------------------------------------------------------------------------
  15.   # ■ Index
  16.   #
  17.   # line 026 : 基本設定              line 244 : パーティコマンド
  18.   # line 048 : アクターエリアの背景  line 259 : ターゲットカーソル
  19.   # line 065 : バトルログ            line 289 : ターゲットヘルプ
  20.   # line 118 : バトルメッセージ      line 305 : ポップアップ
  21.   # line 159 : バトラーグラフィック  line 507 : ユーザビリティ
  22.   # line 182 : バトルステータス      line 535 : その他
  23.   # line 212 : アクターコマンド      
  24.   #
  25.   #--------------------------------------------------------------------------
  26.   # ● 基本設定
  27.   #--------------------------------------------------------------------------
  28.   # デフォルトで表示するアクターのバトラーグラフィック
  29.   #  0 = 顔グラフィック / 1 = 歩行グラフィック
  30.   DEFAULT_BATTLER_GRAPHIC = 0  # 規定値:0
  31.  
  32.   # デフォルトバトラーグラフィックの背景グラデーション色([Color1, Color2])
  33.   DEFAULT_BG_COLOR        = [Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  34.                    # 規定値:[Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  35.  
  36.   # 画面の色調変更をアクターに適用する true = 有効 / false = 無効
  37.   # * true にするとアクターエリアの背景にも適用されます
  38.   ACTOR_SCREEN_TONE       = false # 規定値:false
  39.  
  40.   # TP のポップアップ設定
  41.   #  0 = すべてポップアップする / 1 = アクターのみ / 2 = ポップアップしない
  42.   TP_POPUP_TYPE           = 1      # 規定値:1
  43.  
  44.   # アイコン無しのステートをポップアップしない true = 有効 / false = 無効
  45.   INDEXZERO_NO_POPUP      = true   # 規定値:true
  46.  
  47.   #--------------------------------------------------------------------------
  48.   # ● 設定:アクターエリアの背景
  49.   #--------------------------------------------------------------------------
  50.   # アクターエリアの背景のタイプ
  51.   #  0 = 無し / 1 = グラデーション / 2 = ウィンドウ / "文字列" = 画像
  52.   ACTOR_BACKGROUND        = 1   # 規定値:2
  53.  
  54.   # アクターエリア背景の高さ
  55.   ACTOR_BACKGROUND_HEIGHT = 112# 規定値:112
  56.  
  57.     #------------------------------------------------------------------------
  58.     # ○ タイプ [1:グラデーション] の設定
  59.     #------------------------------------------------------------------------
  60.     # グラデーションの色([Color1, Color2])
  61.     ACTOR_BG_GRADIENT_COLOR = [Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  62.                      # 規定値:[Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  63.  
  64.   #--------------------------------------------------------------------------
  65.   # ● 設定:バトルログ
  66.   #--------------------------------------------------------------------------
  67.   # バトルログ(戦闘進行の実況)のタイプ
  68.   # 0 = VXAceデフォルト / 1 = 蓄積型 / 2 = ヘルプ表示
  69.   BATTLELOG_TYPE  =  1  # 規定値:1
  70.  
  71.     #------------------------------------------------------------------------
  72.     # ○ バトルログタイプ [1:蓄積型] の設定
  73.     #------------------------------------------------------------------------
  74.     # 一度に表示する行数
  75.     STORAGE_LINE_NUMBER     = 6     # 規定値:6
  76.  
  77.     # 一行の高さ
  78.     STORAGE_LINE_HEIGHT     = 20    # 規定値:20
  79.  
  80.     # 自動的にログが進行する時間(フレーム)
  81.     STORAGE_UP_MESSAGE_TIME = 90    # 規定値:90
  82.  
  83.     # ターン終了時にバトルログを消去する true = 有効 / false = 無効
  84.     STORAGE_TURNEND_CLEAR   = true  # 規定値:true
  85.  
  86.     # 座標の調整 :x = X座標 / :y = Y座標
  87.     STORAGE_OFFSET = {:x => 0, :y => 6}  # 規定値:{:x => 0, :y => 6}
  88.  
  89.     # フォント :size = フォントサイズ / :out_color = テキストの縁取り色
  90.     STORAGE_FONT   = {:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  91.             # 規定値:{:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  92.  
  93.     # 背景のグラデーションの色([Color1, Color2])
  94.     STORAGE_GRADIENT_COLOR = [Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  95.                     # 規定値:[Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  96.  
  97.     #------------------------------------------------------------------------
  98.     # ○ バトルログタイプ [2:ヘルプ表示] の設定
  99.     #------------------------------------------------------------------------
  100.     # ポップアップのウェイト
  101.     POPUP_ADD_WAIT          = 6     # 規定値:6
  102.  
  103.     # 行動の表示形式 0 = アイコン+名前 / 1 = 名前のみ
  104.     HELPDISPLAY_TYPE        = 1     # 規定値:1
  105.  
  106.     # 行動の表示始めの追加ウェイト
  107.     HELPDISPLAT_WAIT        = 20    # 規定値:20
  108.  
  109.     # 行動の表示終了までの追加ウェイト
  110.     HELPDISPLAT_END_WAIT    = 24    # 規定値:24
  111.  
  112.     # 行動の簡易説明文
  113.     # :size = フォントサイズ :delimiter = 名前と簡易説明文の区切り文字
  114.     HELPDISPLAY_DESCRIPTION = {:size => 20, :delimiter => " "}
  115.                      # 規定値:{:size => 20, :delimiter => " "}
  116.  
  117.   #--------------------------------------------------------------------------
  118.   # ● 設定:バトルメッセージ
  119.   #--------------------------------------------------------------------------
  120.   # バトルメッセージ(戦闘開始・逃走・リザルト等)の表示先
  121.   # 0 = メッセージウィンドウ / 1 = バトルログ / 2 = ヘルプ
  122.   MESSAGE_TYPE  =  0   # 規定値:2
  123.  
  124.     #------------------------------------------------------------------------
  125.     # ○ バトルメッセージタイプ [0:メッセージウィンドウ] の設定
  126.     #------------------------------------------------------------------------
  127.     # メッセージウィンドウの背景 0 = ウィンドウ / 1 = 背景を暗くする / 2 = 透明
  128.     MESSAGE_WINDOW_BACKGROUND  = 1     # 規定値:1
  129.  
  130.     # メッセージウィンドウの位置 0 = 上 / 1 = 中 / 2 = 下
  131.     MESSAGE_WINDOW_POSITION    = 0     # 規定値:0
  132.  
  133.     #------------------------------------------------------------------------
  134.     # ○ バトルメッセージタイプ [2:ヘルプ] の設定
  135.     #------------------------------------------------------------------------
  136.     # ヘルプバトルメッセージのウェイト
  137.     #   [ウェイト(フレーム), キー入力を待つ(true = 有効 / false = 無効)]
  138.     #  :battle_start = 戦闘開始      :victory = 勝利
  139.     #  :escape       = 逃走          :defeat  = 敗北
  140.     #  :drop_item    = アイテム獲得 :levelup = レベルアップ
  141.     MESSAGE_WAIT = {:battle_start => [120, false], :victory   => [ 60, false],
  142.                     :defeat       => [120, false], :escape    => [120, false],
  143.                     :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  144.           # 規定値:{:battle_start => [120, false], :victory   => [ 60, false],
  145.           #         :defeat       => [120, false], :escape    => [120, false],
  146.           #         :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  147.  
  148.   # 戦闘開始時の敵出現メッセージを表示する
  149.   MESSAGE_WINDOW_ENEMY_NAMES = false # 規定値:false
  150.  
  151.   # レベルアップ SE  RPG::SE.new("ファイル名", 音量, ピッチ)
  152.   LEVELUP_SE  = RPG::SE.new("Up4", 90, 100)   # 規定値:("Up4", 90, 100)
  153.  
  154.   # ドロップアイテム獲得 SE  RPG::SE.new("ファイル名", 音量, ピッチ)
  155.   # * バトルメッセージタイプが 0 以外の場合のみ再生されます。
  156.   DROPITEM_SE = RPG::SE.new("Item3", 80, 125) # 規定値:("Item3", 80, 125)
  157.  
  158.   #--------------------------------------------------------------------------
  159.   # ● 設定:アクターのバトラーグラフィック
  160.   #--------------------------------------------------------------------------
  161.   # アクター表示を中央揃えにする true = 有効 / false = 左揃え
  162.   ACTOR_CENTERING  =  true    # 規定値:true
  163.  
  164.     #------------------------------------------------------------------------
  165.     # ○ アクター表示中央揃えの設定
  166.     #------------------------------------------------------------------------
  167.     # アクター間のスペースの大きさ補正
  168.     ACTOR_SPACING_ADJUST = 32 # 規定値:32
  169.  
  170.   # 座標の調整 :x = X座標 / :y = Y座標
  171.   # * アクターコマンドのX座標には影響しません。
  172.   ACTOR_OFFSET  = {:x => -16, :y => 0}       # 規定値:{:x => -16, :y => 0}
  173.  
  174.   # アクターエリアと画面端との余白 :side = 左右の余白 / :bottom = 下の余白
  175.   ACTOR_PADDING = {:side => 4, :bottom => 8} # 規定値:{:side => 4, :bottom => 8}
  176.  
  177.   # パーティに対する画面アニメーションのY座標修正
  178.   #  位置が[画面]のアニメーションをパーティの中心に表示されるようにします。
  179.   SCREEN_ANIMATION_OFFSET = 128  # 規定値:128
  180.  
  181.   #--------------------------------------------------------------------------
  182.   # ● 設定:バトルステータス
  183.   #--------------------------------------------------------------------------
  184.   # 座標の調整  :x = X座標 / :y = Y座標
  185.   #  X 座標はアクターの中心を基準とします。
  186.   # * パーティメンバーの数やステータス幅によっては、X 座標が自動的に
  187.   # 調整される場合があります。
  188.   STATUS_OFFSET = {:x => 64, :y => -12} # 規定値:{:x => 64, :y => -12}
  189.  
  190.   # 画面左右端の余白
  191.   STATUS_SIDE_PADDING   = 6     # 規定値:6
  192.  
  193.   # アクター1人あたりのステータス幅
  194.   STATUS_WIDTH          = 72    # 規定値:72
  195.  
  196.   # ステータス幅の自動調整を行う
  197.   STATUS_AUTOADJUST     = true  # 規定値:true
  198.  
  199.   # 行の高さ
  200.   STATUS_LINE_HEIGHT    = 22    # 規定値:22
  201.  
  202.   # アクターの名前のフォントサイズ 値を 0 にすると非表示になる
  203.   STATUS_NAME_SIZE      = 20    # 規定値:20
  204.  
  205.   # HP/MP/TPのフォントサイズ
  206.   STATUS_PARAM_SIZE     = 23    # 規定値:23
  207.  
  208.   # HP/MP/TPゲージの不透明度 (0-255)
  209.   STATUS_GAUGE_OPACITY  = 192   # 規定値:192
  210.  
  211.   #--------------------------------------------------------------------------
  212.   # ● 設定:アクターコマンド
  213.   #--------------------------------------------------------------------------
  214.   # コマンドの項目数が 4 を超える場合、項目がすべて見えるように
  215.   # コマンドウィンドウの高さを拡張する true = 有効 / false = 無効
  216.   ACTOR_COMMAND_NOSCROLL   = true  # 規定値:true
  217.  
  218.   # コマンドを横並びにする true = 横並び / false = 縦並び
  219.   ACTOR_COMMAND_HORIZON    = false # 規定値:false
  220.  
  221.   # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  222.   ACTOR_COMMAND_ALIGNMENT  = 0     # 規定値:0
  223.  
  224.   # ウィンドウの横幅
  225.   #  コマンドを横並びにする場合、大きめの値を設定してください。
  226.   ACTOR_COMMAND_WIDTH      = 128   # 規定値:128
  227.  
  228.   # ウィンドウの位置
  229.   #  0 = アクターの頭上 / 1 = Y座標を固定 / 2 = XY座標を固定
  230.   ACTOR_COMMAND_POSITION   = 0     # 規定値:0
  231.  
  232.     #------------------------------------------------------------------------
  233.     # ○ ウィンドウの位置 [1:Y座標固定 2:XY座標] の設定
  234.     #------------------------------------------------------------------------
  235.     # 固定Y座標の基準位置
  236.     # 0 = 画面下端 - ウィンドウの高さ / 画面上端
  237.     ACTOR_COMMAND_Y_POSITION = 0   # 規定値:0
  238.  
  239.     # ウィンドウのXY座標修正 :x = X座標 / :y = Y座標
  240.     # * コマンド位置が 1 or 2 の場合、ここで設定した値で座標を固定します。
  241.     ACTOR_COMMAND_OFFSET  = {:x => 0, :y => -16} # 規定値:{:x => 0, :y => -16}
  242.  
  243.   #--------------------------------------------------------------------------
  244.   # ● 設定:パーティコマンド
  245.   #--------------------------------------------------------------------------
  246.   # コマンドを横並びにする true = 横並び / false = 縦並び
  247.   PARTY_COMMAND_HORIZON   = true  # 規定値:true
  248.  
  249.   # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  250.   PARTY_COMMAND_ALIGNMENT = 1     # 規定値:1
  251.  
  252.   # ウィンドウの幅
  253.  
  254.   PARTY_COMMAND_WIDTH = Graphics.width # 規定値:Graphics.width 這裡很弔詭
  255.  
  256.   # ウィンドウの座標 :x = X座標 / :y = Y座標
  257.   PARTY_COMMAND_XY        = {:x => 0, :y => 0} # 規定値:{:x => 0, :y => 0}
  258.  
  259.   #--------------------------------------------------------------------------
  260.   # ● 設定:ターゲットカーソル
  261.   #--------------------------------------------------------------------------
  262.   # カーソルグラフィックのファイル名 (Graphics/System/*)
  263.   #  "" を設定した場合、Bitmap の機能でカーソルを自動生成します。
  264.   CURSOR_NAME       = ""    # 規定値:""
  265.  
  266.     #------------------------------------------------------------------------
  267.     # ○ 自動生成のカーソルグラフィックの設定
  268.     #------------------------------------------------------------------------
  269.     # カーソルの色調 (Red, Green, Blue)
  270.     #  nil を設定した場合、データベースのウィンドウカラーと同じになります。
  271.     CURSOR_TONE     = Tone.new(-34, 0, 68)  # 規定値:Tone.new(-34, 0, 68)
  272.  
  273.   # アニメーションスピード
  274.   CURSOR_ANI_SPEED  = 3     # 規定値:3
  275.  
  276.   # 移動スピード
  277.   CURSOR_SPEED      = 3     # 規定値:3
  278.  
  279.   # 対象選択時にカーソルを点滅させる
  280.   CURSOR_BLINK      = true  # 規定値:true
  281.  
  282.   # カーソルのY座標の制限 :min = 最小値 / :max = 最大値
  283.   CURSOR_MINMAX     = {:min => 48, :max => Graphics.height}
  284.              # 規定値:{:min => 48, :max => Graphics.height}
  285.  
  286.   # カーソル位置のXY座標修正 :x = X座標 / :y = Y座標
  287.   CURSOR_OFFSET     = {:x => 0, :y => 0} # 規定値:{:x => 0, :y => 0}
  288.  
  289.   #--------------------------------------------------------------------------
  290.   # ● 設定:ターゲットヘルプ
  291.   #--------------------------------------------------------------------------
  292.   # バトラーの各パラメータ表示 true = 表示 / false = 非表示
  293.   HELP_ACTOR_PARAM = {:hp => true ,:mp => true ,:tp => true ,:state => true }
  294.   HELP_ENEMY_PARAM = {:hp => false,:mp => false,:tp => false,:state => true }
  295.     # アクター規定値:{:hp => true ,:mp => true ,:tp => true ,:state => true }
  296.     # 敵キャラ規定値:{:hp => false,:mp => false,:tp => false,:state => true }
  297.  
  298.   # HP/MP/TP ゲージの幅
  299.   HELP_PARAM_WIDTH    = 72  # 規定値:72
  300.  
  301.   # 敵ランダムの表示形式
  302.   # 0 = 敵全体 ランダム / 1 = 敵n体 ランダム
  303.   RANDOMSCOPE_DISPLAY = 1   # 規定値:1
  304.  
  305.   #--------------------------------------------------------------------------
  306.   # ● 設定:ポップアップ
  307.   #--------------------------------------------------------------------------
  308.   # ポップアップ位置 0 = 足元 / 1 = 中心 / 2 = 頭上 / 3 = 一定(アクターのみ)
  309.   ACTOR_POPUP_POSITION   = 3  # アクター     規定値:3
  310.   ENEMY_POPUP_POSITION   = 1  # 敵キャラ     規定値:1
  311.   LEVELUP_POPUP_POSITION = 3  # レベルアップ 規定値:3
  312.  
  313.     #------------------------------------------------------------------------
  314.     # ○ ポップアップ位置 [3:一定(アクターのみ)] の設定
  315.     #------------------------------------------------------------------------
  316.     # アクターのポップアップの Y 座標
  317.     #  ゲーム画面の高さ(Graphics.height)を基準とします。
  318.     ACTOR_POPUP_Y     =  -100  # 規定値:-100
  319.  
  320.     # レベルアップのポップアップの Y 座標
  321.     #  ゲーム画面の高さ(Graphics.height)を基準とします。
  322.     LEVELUP_POPUP_Y   =  -112  # 規定値:-112
  323.  
  324.   # 数字のフォント
  325.   NUMBER_FONT   =  ["Arial Black", "VL Gothic"] # ["Arial Black", "VL Gothic"]
  326.  
  327.   # ステート等のテキストのフォント
  328.   TEXT_FONT     =  ["Arial Black", "VL Gothic"] # ["Arial Black", "VL Gothic"]
  329.   TEXT_FONT_MCS =  ["VL Gothic"]       #日本語を含む場合。規定値:["VL Gothic"]
  330.  
  331.   # 画像フォントのファイル名 (Graphics/System/*) <<ver1.10>>
  332.   #  "" を設定した場合、通常のフォントを利用します。
  333.   # 数字
  334.   LARGE_NUMBER_NAME = "popup_number02_large"       # 規定値:""
  335.   SMALL_NUMBER_NAME = "popup_number02_small"       # 規定値:""
  336.   # 能力強化/弱体
  337.   LARGE_BUFFS_NAME  = "popup_buffs_large"       # 規定値:""
  338.   SMALL_BUFFS_NAME  = "popup_buffs_small"       # 規定値:""
  339.  
  340.   # 数字のサイズ・字間
  341.   #  :fontsize = フォントサイズ / :spacing = 字間
  342.   #  :width    = 一字あたりの幅 / :height = 一字あたりの高さ
  343.   LARGE_NUMBER  =  {:fontsize => 38, :spacing => -4, :line_height => 26}
  344.   SMALL_NUMBER  =  {:fontsize => 28, :spacing => -4, :line_height => 20}
  345.   # 大サイズ規定値:{:fontsize => 38, :spacing => -4, :line_height => 26}
  346.   # 小サイズ規定値:{:fontsize => 28, :spacing => -4, :line_height => 20}
  347.  
  348.   # テキストのフォントサイズ倍率
  349.   #   :normal     = テキスト単体
  350.   #   :left_right = ダメージ左右   :top_bottom = ダメージ上下
  351.   # * 数字のフォントサイズからの割合で指定します。
  352.   TEXT_SIZERATE     = {:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  353.              # 規定値:{:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  354.  
  355.   # 日本語を含むテキストのフォントサイズ倍率
  356.   # * 通常のテキストフォントサイズからの倍率で指定します。
  357.   TEXT_SIZERATE_MCS = 0.9   # 規定値:0.9
  358.  
  359.   # ポップアップの修飾文字
  360.   # ["テキスト", 修飾文字の位置(2 = 下 / 4 = 左 / 6 = 右 / 8 = 上)]
  361.   # * 文字列中の \mp \tp はデータベースで設定した用語(短)に置き換わります
  362.   DECORATION_NUMBER = {            # 規定値
  363.   :critical    => ["_CRITICAL", 8], # ["CRITICAL", 8] / クリティカル
  364.   :weakness    => ["_WEAKNESS", 8], # ["WEAKNESS", 8] / 弱点ダメージ
  365.   :resist      => ["_RESIST"  , 8], # ["RESIST"  , 8] / 耐性ダメージ
  366.   :mp_damage   => ["_\mp"     , 4], # ["\mp"     , 4] / MP ダメージ・回復
  367.   :mp_plus     => ["_\mp+"    , 4], # ["\mp+"    , 4] / MP 再生
  368.   :mp_minus    => ["_\mp-"    , 4], # ["\mp-"    , 4] / MP 消費
  369.   :tp_plus     => ["_\tp+"    , 4], # ["\tp+"    , 4] / TP 増加
  370.   :tp_minus    => ["_\tp-"    , 4], # ["\tp-"    , 4] / TP 減少
  371.   }
  372.   # ステートや能力強化/弱体のポップアップの修飾文字
  373.   #  %s にステート・能力名が入る
  374.   DECORATION_TEXT = {              # 規定値
  375.   :add_state   => "+%s",           # "+%s"           / ステート付加
  376.   :rem_state   => "-%s",           # "-%s"           / ステート解除
  377.   :add_buff    => "%s UP",         # "%s UP"         / 能力強化付加
  378.   :add_debuff  => "%s DOWN",       # "%s DOWN"       / 能力弱体付加
  379.   :rem_buff    => "-%s Buff",      # "-%s Buff"      / 能力強化/弱体解除
  380.   }
  381.   # ポップアップの表示用語
  382.   POPUP_VOCAB = {                  # 規定値
  383.   :miss        => "_MISS",         # "MISS!"         / ミス
  384.   :counter     => "_Counter",       # "Counter"       / 反撃
  385.   :reflection  => "_Reflection",    # "Reflection"    / 反射
  386.   :substitute  => "_Substitute",    # "Substitute"    / 身代わり
  387.   :levelup     => "_LEVELUP",      # "LEVELUP!"      / レベルアップ
  388.   }
  389.   # 能力強化/弱体ポップアップのパラメータ表記
  390.   # * 文字列中の \hp \mp はデータベースで設定した用語(短)に置き換わります
  391.   POPUP_VOCAB_PARAMS = [ # 規定値
  392.   "MAX\hp",              # "MAX\hp"  / 最大HP    MAXimum Hit Point
  393.   "MAX\mp",              # "MAX\mp"  / 最大MP    MAXimum Magic Point
  394.   "ATK",                 # "ATK"     / 攻撃力    ATtacK power
  395.   "DEF",                 # "MATK"    / 防御力    DEFense power
  396.   "MATK",                # "MDEF"    / 魔法力    Magic ATtacK power
  397.   "MDEF",                # "MDEF"    / 魔法防御  Magic DEFense power
  398.   "AGI",                 # "AGI"     / 敏捷性    AGIlity
  399.   "LUCK",                # "LUCK"    / 運        LUCK
  400.   ]
  401.   # ポップアップの色([Color1, Color2])
  402.   # * ハッシュの順序を変更しないこと
  403.   POPUP_COLOR = {
  404.   # HP ダメージ(ミス)
  405.   :hp_damage     => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  406.   # クリティカルダメージ
  407.   :critical      => [Color.new(255, 255,  80), Color.new(224,  32,   0)],
  408.   # 弱点ダメージ
  409.   :weakness      => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  410.   # 耐性ダメージ
  411.   :resist        => [Color.new(232, 224, 216), Color.new( 56,  48,  40)],
  412.   # HP 回復(再生,吸収)
  413.   :hp_recovery   => [Color.new( 96, 255, 128), Color.new(  0,  64,  32)],
  414.   # MP ダメージ
  415.   :mp_damage     => [Color.new(248,  80, 172), Color.new( 48,   0,  32)],
  416.   # MP 回復(再生,吸収)
  417.   :mp_recovery   => [Color.new(160, 240, 255), Color.new( 32,  48, 144)],
  418.   # TP 増減
  419.   :tp_damage     => [Color.new(248, 240,  64), Color.new(  0,  80,  40)],
  420.   # 有利なステートの付加
  421.   :add_state     => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  422.   # 有利なステートの解除
  423.   :rem_state     => [Color.new(224, 232, 240), Color.new( 32,  64, 128, 128)],
  424.   # ステートの付加
  425.   :add_badstate  => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  426.   # ステートの解除
  427.   :rem_badstate  => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  428.   # 能力強化の付加
  429.   :add_buff      => [Color.new(255, 255, 192), Color.new( 96,  64,   0)],
  430.   # 能力弱体の付加
  431.   :add_debuff    => [Color.new(200, 224, 232), Color.new( 40,  48,  56)],
  432.   # 能力強化/弱体の解除
  433.   :rem_buff      => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  434.   # 反撃
  435.   :counter       => [Color.new(255, 255, 224), Color.new(128,  96,   0)],
  436.   # 反射
  437.   :reflection    => [Color.new(224, 255, 255), Color.new(  0,  96, 128)],
  438.   # 身代わり
  439.   :substitute    => [Color.new(224, 255, 224), Color.new(  0, 128,  64)],
  440.   # レベルアップ
  441.   :levelup       => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  442.   }
  443.   # ポップアップのタイプ        -1 = ポップアップしない
  444.   #  0 = 跳ねるポップアップ(大)  4 = スライド(大)
  445.   #  1 = 跳ねるポップアップ(小)  5 = スライド(小)
  446.   #  2 = ゆっくり上昇(大)        6 = オーバーレイ(大)
  447.   #  3 = ゆっくり上昇(小)        7 = オーバーレイ(小)
  448.   POPUP_TYPE = {          # 規定値
  449.   :miss          =>   0,  #   0 / ミス
  450.   :hp_damage     =>   0,  #   0 / HP ダメージ
  451.   :hp_slipdamage =>   1,  #   1 / HP スリップダメージ
  452.   :hp_recovery   =>   0,  #   0 / HP 回復
  453.   :hp_regenerate =>   1,  #   1 / HP 再生
  454.   :hp_drain      =>   0,  #   0 / HP 被吸収
  455.   :hp_drainrecv  =>   0,  #   0 / HP 吸収回復
  456.   :mp_damage     =>   0,  #   0 / MP ダメージ
  457.   :mp_slipdamage =>   1,  #   1 / MP スリップダメージ
  458.   :mp_recovery   =>   0,  #   0 / MP 回復
  459.   :mp_regenerate =>   1,  #   1 / MP 再生
  460.   :mp_drain      =>   0,  #   0 / MP 被吸収
  461.   :mp_drainrecv  =>   0,  #   0 / MP 吸収回復
  462.   :mp_paycost    =>  -1,  #  -1 / MP 消費
  463.   :tp_damage     =>   1,  #   1 / TP 増加(ダメージ)
  464.   :tp_charge     =>  -1,  #  -1 / TP チャージ(被ダメージ時の TP 増加)
  465.   :tp_gain       =>   7,  #   7 / TP 得
  466.   :tp_regenerate =>   1,  #   1 / TP 再生(スリップダメージ)
  467.   :tp_paycost    =>  -1,  #  -1 / TP 消費
  468.   # ステート/能力
  469.   :add_state     =>   2,  #   2 / 有利なステートの付加
  470.   :rem_state     =>   2,  #   2 / 有利なステートの解除
  471.   :add_badstate  =>   2,  #   2 / 不利なステートの付加
  472.   :rem_badstate  =>   2,  #   2 / 不利なステートの解除
  473.   :add_buff      =>   3,  #   3 / 能力強化の付加
  474.   :add_debuff    =>   3,  #   3 / 能力弱体の付加
  475.   :rem_buff      =>   3,  #   3 / 能力強化/弱体の解除
  476.   # 特殊
  477.   :counter       =>   6,  #   6 / 反撃
  478.   :reflection    =>   6,  #   6 / 反射
  479.   :substitute    =>   4,  #   4 / 身代わり
  480.   }
  481.   # 0:跳ねるポップアップの動き(大)
  482.   LARGE_MOVEMENT = {
  483.   :inirate    => 6.4,  :gravity      => 0.68,  :side_scatter => 1.2,
  484.   :ref_height =>  32,  :ref_factor   => 0.60,  :ref_count    =>   2,
  485.                        :duration     =>   40,  :fadeout      =>  20 }
  486.   # 1:跳ねるポップアップの動き(小)
  487.   SMALL_MOVEMENT = {
  488.   :inirate    => 4.4,  :gravity      => 0.60,  :side_scatter => 0.0,
  489.   :ref_height =>  12,  :ref_factor   => 0.70,  :ref_count    =>   0,
  490.                        :duration     =>   60,  :fadeout      =>  16 }
  491.   # 2,3:上昇ポップアップの動き
  492.   RISE_MOVEMENT     = {:rising_speed => 0.75,  :line_spacing => 0.9,
  493.                        :duration     =>   40,  :fadeout      =>   8 }
  494.   # 4,5:スライドポップアップの動き
  495.   SLIDE_MOVEMENT    = {:x_speed      =>    2,  :line_spacing => 0.9,
  496.                        :duration     =>   50,  :fadeout      =>  32 }
  497.   # 6,7:オーバーレイポップアップの動き
  498.   OVERLAY_MOVEMENT  = {:duration     =>   36,  :fadeout      =>  32 }
  499.  
  500.   # :inirate      = 初速度                :gravity    = 重力加速度
  501.   # :side_scatter = 左右移動のばらつき    :ref_height = 跳ね返り位置
  502.   # :ref_factor   = 反発係数              :ref_count  = 跳ね返り回数
  503.   # :duration     = 消え始めるまでの時間  :fadeout    = 消える速度
  504.   # :rising_speed = 上昇速度              :x_speed    = 横移動速度
  505.   # :line_spacing = ポップアップの行間
  506.  
  507.   #--------------------------------------------------------------------------
  508.   # ● 設定:ユーザビリティ
  509.   #--------------------------------------------------------------------------  
  510.   # 効果範囲が 使用者/全体/ランダム のスキル・アイテムの対象確認を行う
  511.   #  true = 有効 / false = 無効
  512.   FIX_TARGET_CHECKE     = true   # 規定値:true
  513.  
  514.   # 防御コマンドの対象確認を行う     true = 有効 / false = 無効
  515.   GUARD_TARGET_CHECKE   = true   # 規定値:true
  516.  
  517.   # アクターの対象選択を最適化する   true = 有効 / false = 無効
  518.   SMART_TARGET_SELECT   = true   # 規定値:true
  519.  
  520.   # 対象選択のカーソル位置を記憶する true = 有効 / false = 無効
  521.   LAST_TARGET           = true   # 規定値:true
  522.  
  523.   # パーティコマンドのカーソル位置を記憶する    true = 有効 / false = 無効
  524.   LAST_PARTY_COMMAND    = true   # 規定値:true
  525.  
  526.   # アクターコマンドのカーソル位置を記憶する    true = 有効 / false = 無効
  527.   LAST_ACTOR_COMMAND    = true   # 規定値:true
  528.  
  529.   # 敵キャラのインデックスを X 座標でソートする true = 有効 / false = 無効
  530.   TROOP_X_SORT          = true   # 規定値:true
  531.  
  532.   # パーティコマンド入力回数を最適化する        true = 有効 / false = 無効
  533.   PARTY_COMMAND_SKIP    = true   # 規定値:true
  534.  
  535.   #--------------------------------------------------------------------------
  536.   # ● 設定:その他
  537.   #--------------------------------------------------------------------------
  538.   # スキルリストとアイテムリストを項目数に合わせてリサイズする
  539.   #  true = 有効 / false = 無効
  540.   FITTING_LIST          = true   # 規定値:true
  541.  
  542.   # バトラーの行動時の白フラッシュを強める          true = 有効 / false = 無効
  543.   ENHANCED_WHITEN       = true   # 規定値:true
  544.  
  545.   # ダメージを受けた時の画面のシェイクを行わない    true = 有効 / false = 無効
  546.   DISABLED_DAMAGE_SHAKE = true   # 規定値:true
  547.  
  548.   # 敵キャラの X 座標を画面サイズに合わせて修正する true = 有効 / false = 無効
  549.   TROOP_X_SCREEN_FIX    = true   # 規定値:true
  550.  
  551.   # 敵キャラの Y 座標の調整
  552.   TROOP_Y_OFFSET        = 0      # 規定値:0
  553.  
  554.   #
  555.   # 設定ここまで お疲れ様でした。
  556.   #
  557. end
  558. #==============================================================================
  559. # ■ LNXスクリプト導入情報
  560. #==============================================================================
  561. $lnx_include = {} if $lnx_include == nil
  562. $lnx_include[:lnx11aconf] = 110 # version
  563. p "OK:LNX11aconf_XPスタイルバトル#コンフィグ"


二、
RUBY 代码复制
  1. #==============================================================================
  2. # ★ RGSS3-Extension
  3. # LNX11a_XPスタイルバトル
  4. #  戦闘画面をRPGツクールXP準拠のものに変更します。
  5. #
  6. #  version   : 1.11 (13/06/19)
  7. #  author    : ももまる
  8. #  reference : [url]http://peachround.blog.fc2.com/blog-entry-9.html[/url]
  9. #
  10. #==============================================================================
  11.  
  12. #==============================================================================
  13. # ■ LNXスクリプト導入情報
  14. #==============================================================================
  15. $lnx_include = {} if $lnx_include == nil
  16. $lnx_include[:lnx11a] = 111 # version
  17. p "OK:LNX11a_XPスタイルバトル ver1.11"
  18.  
  19. module LNX11
  20.   #--------------------------------------------------------------------------
  21.   # ● 正規表現
  22.   #--------------------------------------------------------------------------
  23.   # アクター:バトラーグラフィック = "ファイル名"
  24.   RE_BATTLER = /(?:バトラーグラフィック|battler_graphic)\s*=\s*"([^"]*)"/i
  25.   # アイテム/スキル:使用時アニメ = アニメーションID
  26.   RE_USE_ANIMATION = /(?:使用時アニメ|use_animation)\s*=\s*(\d+)/i
  27.   # アイテム/スキル:ヘルプ説明 = "説明文"
  28.   RE_SHORT_DESCRIPTION =/(?:ヘルプ説明|short_description)\s*=\s*"([^"]*)"/i
  29.   # アイテム/スキル:ヘルプ非表示
  30.   RE_USABLEITEM_NO_DISPLAY = /(?:ヘルプ非表示|no_display)/i
  31.   # アイテム/スキル:使用時追加ウェイト = duration
  32.   RE_DISPLAY_WAIT = /(?:使用時追加ウェイト|display_wait)\s*=\s*(\d+)/i
  33.   # アイテム/スキル:終了時追加ウェイト = duration
  34.   RE_END_WAIT = /(?:終了時追加ウェイト|end_wait)\s*=\s*(\d+)/i
  35.   # 敵キャラ:通常攻撃アニメ = アニメーションID
  36.   RE_ATK_ANIMATION = /(?:通常攻撃アニメ|atk_animation)\s*=\s*(\d+)/i
  37.   # ステート:ステートアニメ = アニメーションID
  38.   RE_STATE_ANIMATION = /(?:ステートアニメ|state_animation)\s*=\s*(\d+)/i
  39.   # ステート:ポップアップ表示名 = "表示名"
  40.   RE_STATE_DISPLAY = /(?:ポップアップ表示名|display_name)\s*=\s*"([^"]*)"/i
  41.   # ステート:ポップアップ非表示
  42.   RE_STATE_NO_DISPLAY = /(?:ポップアップ非表示|no_display)/i
  43.   # ステート:付加ポップアップ非表示
  44.   RE_STATE_ADD_NO_DISPLAY = /(?:付加ポップアップ非表示|add_no_display)/i
  45.   # ステート:解除ポップアップ非表示
  46.   RE_STATE_REM_NO_DISPLAY = /(?:解除ポップアップ非表示|remove_no_display)/i
  47.   # ステート:有利なステート
  48.   RE_STATE_ADVANTAGE = /(?:有利なステート|advantage_state)/i
  49.   # ステート:ポップアップタイプ = type_id
  50.   RE_STATE_TYPE = /(?:ポップアップタイプ|popup_type)\s*=\s*(\d+)/i
  51.   # ステート:付加ポップアップタイプ = type_id
  52.   RE_STATE_ADD_TYPE = /(?:付加ポップアップタイプ|add_popup_type)\s*=\s*(\d+)/i
  53.   # ステート:解除ポップアップタイプ = type_id
  54.   RE_STATE_REM_TYPE=/(?:解除ポップアップタイプ|remove_popup_type)\s*=\s*(\d+)/i
  55.   # ステート:修飾文字非表示
  56.   RE_STATE_NO_DECORATION = /(?:修飾文字非表示|no_decoration)/i
  57.   # ステート:付加修飾文字非表示
  58.   RE_STATE_ADD_NO_DECORATION = /(?:付加修飾文字非表示|add_no_decoration)/i
  59.   # ステート:解除修飾文字非表示
  60.   RE_STATE_REM_NO_DECORATION = /(?:解除修飾文字非表示|remove_no_decoration)/i
  61.   # <<ver1.10>>
  62.   # ステート:付加ポップアップ表示名 = "表示名"
  63.   RE_STATE_ADD_DISPLAY =
  64.   /(?:付加ポップアップ表示名|add_display_name)\s*=\s*"([^"]*)"/i
  65.   # ステート:解除ポップアップ表示名 = "表示名"
  66.   RE_STATE_REM_DISPLAY =
  67.   /(?:解除ポップアップ表示名|remove_display_name)\s*=\s*"([^"]*)"/i
  68.   #--------------------------------------------------------------------------
  69.   # ● バトルステータス更新
  70.   #--------------------------------------------------------------------------
  71.   # LNX11.バトルステータス更新
  72.   def self.battle_status_refresh
  73.     $game_temp.battle_status_refresh
  74.   end
  75.   def self.バトルステータス更新
  76.     self.battle_status_refresh
  77.   end  
  78.   #--------------------------------------------------------------------------
  79.   # ● アクターエリア表示/非表示
  80.   #--------------------------------------------------------------------------
  81.   # LNX11.アクターエリア表示
  82.   def self.actor_area_show
  83.     self.actor_show
  84.     self.status_show
  85.     self.actor_bg_show
  86.   end
  87.   def self.アクターエリア表示
  88.     self.actor_area_show
  89.   end
  90.   # LNX11.アクターエリア非表示
  91.   def self.actor_area_hide
  92.     self.actor_hide
  93.     self.status_hide
  94.     self.actor_bg_hide
  95.   end
  96.   def self.アクターエリア非表示
  97.     self.actor_area_hide
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● アクター表示/非表示
  101.   #--------------------------------------------------------------------------
  102.   # LNX11.アクター表示
  103.   def self.actor_show
  104.     $game_party.actor_invisible = false
  105.   end
  106.   def self.アクター表示
  107.     self.actor_show
  108.   end
  109.   # LNX11.アクター非表示
  110.   def self.actor_hide
  111.     $game_party.actor_invisible = true
  112.   end
  113.   def self.アクター非表示
  114.     self.actor_hide
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ● バトルステータス表示/非表示
  118.   #--------------------------------------------------------------------------
  119.   # LNX11.バトルステータス表示
  120.   def self.status_show
  121.     $game_party.status_invisible = false
  122.     self.battle_status_refresh
  123.   end
  124.   def self.バトルステータス表示
  125.     self.status_show
  126.   end
  127.   # LNX11.バトルステータス非表示
  128.   def self.status_hide
  129.     $game_party.status_invisible = true
  130.     self.battle_status_refresh
  131.   end
  132.   def self.バトルステータス非表示
  133.     self.status_hide
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● アクター背景表示/非表示
  137.   #--------------------------------------------------------------------------
  138.   # LNX11.アクター背景表示
  139.   def self.actor_bg_show
  140.     $game_party.actor_bg_invisible = false
  141.   end
  142.   def self.アクター背景表示
  143.     self.actor_bg_show
  144.   end
  145.   # LNX11.アクター背景非表示
  146.   def self.actor_bg_hide
  147.     $game_party.actor_bg_invisible = true
  148.   end
  149.   def self.アクター背景非表示
  150.     self.actor_bg_hide
  151.   end  
  152.   #--------------------------------------------------------------------------
  153.   # ● バトラーグラフィックのスクリプト指定
  154.   #--------------------------------------------------------------------------
  155.   # LNX11.バトラーグラフィック(id, filename)
  156.   def self.battler_graphic(id ,filename)
  157.     if id.is_a?(Numeric) && filename.is_a?(String)
  158.       p "LNX11a:バトラーグラフィックを変更しました:ID#{id} #{filename}"
  159.       $game_actors[id].battler_graphic_name = filename
  160.     else
  161.       errormes =  "LNX11a:バトラーグラフィック指定の引数が正しくありません。"
  162.       p errormes, "LNX11a:バトラーグラフィックの指定は行われませんでした。"
  163.       msgbox errormes
  164.     end
  165.   end
  166.   def self.バトラーグラフィック(id ,filename)
  167.     self.battler_graphic(id ,filename)
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 任意のポップアップを生成
  171.   #--------------------------------------------------------------------------
  172.   # LNX11.ポップアップ(battler, popup, type, color, deco)
  173.   def self.make_popup(battler, popup, type = 0, color = :hp_damage, deco = nil)
  174.     return unless $game_party.in_battle
  175.     target = self.battler_search(battler)
  176.     unless target.is_a?(Game_Battler)
  177.       p "LNX11a:任意のポップアップの生成に失敗しました。バトラー指定が"
  178.       p "LNX11a:間違っているか、バトラーが存在していない可能性があります。"
  179.       return
  180.     end
  181.     $game_temp.popup_data.popup_custom(target, popup, type, color, deco)   
  182.   end
  183.   def self.ポップアップ(battler, popup, type=0, color=:hp_damage, deco=nil)
  184.     self.make_popup(battler, popup, type, color, deco)
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● バトラー指定
  188.   #--------------------------------------------------------------------------
  189.   def self.battler_search(val)
  190.     if val.is_a?(String)
  191.       # 名前指定
  192.       a = ($game_party.members + $game_troop.members).find {|b| b.name == val }
  193.       return a
  194.     elsif val.is_a?(Array)
  195.       # インデックス指定
  196.       case val[0]
  197.       when :actor ; return $game_party.members[val[1]]
  198.       when :enemy ; return $game_troop.members[val[1]]
  199.       else        ; return nil
  200.       end
  201.     else
  202.       # オブジェクト
  203.       return val
  204.     end
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ● バトルログプッシュ
  208.   #--------------------------------------------------------------------------
  209.   # LNX11.バトルログ(text)
  210.   def self.battle_log_push(text)
  211.     return unless $game_party.in_battle
  212.     case BATTLELOG_TYPE
  213.     when 0..1 # バトルログ
  214.       BattleManager.log_window.add_text(text)
  215.     when 2 # 簡易ヘルプ表示
  216.       BattleManager.helpdisplay_set(text, 0)
  217.     end
  218.   end
  219.   def self.バトルログ(text)
  220.     self.battle_log_push(text)
  221.   end
  222.   #--------------------------------------------------------------------------
  223.   # ● バトルログ消去
  224.   #--------------------------------------------------------------------------
  225.   # LNX11.バトルログ消去
  226.   def self.battle_log_clear
  227.     return unless $game_party.in_battle
  228.     case BATTLELOG_TYPE
  229.     when 0 # バトルログ
  230.       BattleManager.log_window.clear
  231.     when 1 # 蓄積型
  232.       BattleManager.log_window.clear
  233.       $game_temp.battlelog_clear = true
  234.       self.battle_wait(1)
  235.     when 2 # 簡易ヘルプ
  236.       BattleManager.helpdisplay_clear(0)
  237.     end
  238.   end
  239.   def self.バトルログ消去
  240.     self.battle_log_clear
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● バトルウェイト
  244.   #--------------------------------------------------------------------------
  245.   # LNX11.バトルウェイト(duration)
  246.   def self.battle_wait(duration)
  247.     return unless $game_party.in_battle
  248.     BattleManager.log_window.abs_wait(duration)
  249.   end
  250.   def self.バトルウェイト(duration)
  251.     self.battle_wait(duration)
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● 設定値
  255.   #  ※ 設定を変更する場合、LNX11aconf を使用してください。
  256.   #--------------------------------------------------------------------------
  257.   # <<ver1.00>>
  258.   if !$lnx_include[:lnx11aconf] ||
  259.      $lnx_include[:lnx11aconf] && $lnx_include[:lnx11aconf] < 100
  260.   DEFAULT_BATTLER_GRAPHIC = 0
  261.   DEFAULT_BG_COLOR        = [Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  262.   ACTOR_SCREEN_TONE       = false
  263.   TP_POPUP_TYPE           = 1
  264.   INDEXZERO_NO_POPUP      = true
  265.   ACTOR_BACKGROUND        = 2
  266.   ACTOR_BACKGROUND_HEIGHT = 112
  267.   ACTOR_BG_GRADIENT_COLOR = [Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  268.   BATTLELOG_TYPE  =  1
  269.   STORAGE_LINE_NUMBER     = 6
  270.   STORAGE_LINE_HEIGHT     = 20
  271.   STORAGE_UP_MESSAGE_TIME = 90
  272.   STORAGE_TURNEND_CLEAR   = true
  273.   STORAGE_OFFSET = {:x => 0, :y => 6}
  274.   STORAGE_FONT   = {:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  275.   STORAGE_GRADIENT_COLOR = [Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  276.   POPUP_ADD_WAIT          = 6
  277.   HELPDISPLAY_TYPE        = 1
  278.   HELPDISPLAT_WAIT        = 20
  279.   HELPDISPLAT_END_WAIT    = 24
  280.   HELPDISPLAY_DESCRIPTION = {:size => 20, :delimiter => " "}
  281.   MESSAGE_TYPE  =  2
  282.   MESSAGE_WINDOW_BACKGROUND  = 1
  283.   MESSAGE_WINDOW_POSITION    = 0
  284.   MESSAGE_WAIT = {:battle_start => [120, false], :victory   => [ 60, false],
  285.                   :defeat       => [120, false], :escape    => [120, false],
  286.                   :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  287.   MESSAGE_WINDOW_ENEMY_NAMES = false
  288.   LEVELUP_SE  = RPG::SE.new("Up4", 90, 100)
  289.   DROPITEM_SE = RPG::SE.new("Item3", 80, 125)
  290.   ACTOR_CENTERING  =  true
  291.   ACTOR_SPACING_ADJUST = 32
  292.   ACTOR_OFFSET  = {:x => -16, :y => 0}
  293.   ACTOR_PADDING = {:side => 4, :bottom => 8}
  294.   SCREEN_ANIMATION_OFFSET = 128
  295.   STATUS_OFFSET = {:x => 64, :y => -12}
  296.   STATUS_SIDE_PADDING   = 6
  297.   STATUS_WIDTH          = 72
  298.   STATUS_AUTOADJUST     = true
  299.   STATUS_LINE_HEIGHT    = 22
  300.   STATUS_NAME_SIZE      = 20
  301.   STATUS_PARAM_SIZE     = 23
  302.   STATUS_GAUGE_OPACITY  = 192
  303.   ACTOR_COMMAND_NOSCROLL   = true
  304.   ACTOR_COMMAND_HORIZON    = false
  305.   ACTOR_COMMAND_ALIGNMENT  = 0
  306.   ACTOR_COMMAND_WIDTH      = 128
  307.   ACTOR_COMMAND_POSITION   = 0
  308.   ACTOR_COMMAND_Y_POSITION = 0
  309.   ACTOR_COMMAND_OFFSET  = {:x => 0, :y => -16}
  310.   PARTY_COMMAND_HORIZON   = true
  311.   PARTY_COMMAND_ALIGNMENT = 1
  312.   PARTY_COMMAND_WIDTH = Graphics.width
  313.   PARTY_COMMAND_XY        = {:x => 0, :y => 0}
  314.   CURSOR_NAME       = ""
  315.   CURSOR_TONE     = Tone.new(-34, 0, 68)
  316.   CURSOR_ANI_SPEED  = 3
  317.   CURSOR_SPEED      = 3
  318.   CURSOR_BLINK      = true
  319.   CURSOR_MINMAX     = {:min => 48, :max => Graphics.height}
  320.   CURSOR_OFFSET     = {:x => 0, :y => 0}
  321.   HELP_ACTOR_PARAM = {:hp => true ,:mp => true ,:tp => true ,:state => true }
  322.   HELP_ENEMY_PARAM = {:hp => false,:mp => false,:tp => false,:state => true }
  323.   HELP_PARAM_WIDTH    = 72
  324.   RANDOMSCOPE_DISPLAY = 1
  325.   ACTOR_POPUP_POSITION   = 3
  326.   ENEMY_POPUP_POSITION   = 1
  327.   LEVELUP_POPUP_POSITION = 3
  328.   ACTOR_POPUP_Y     =  -100
  329.   LEVELUP_POPUP_Y   =  -112
  330.   NUMBER_FONT   =  ["Arial Black", "VL Gothic"]
  331.   TEXT_FONT     =  ["Arial Black", "VL Gothic"]
  332.   TEXT_FONT_MCS =  ["VL Gothic"]
  333.   LARGE_NUMBER  =  {:fontsize => 38, :spacing => -4, :line_height => 26}
  334.   SMALL_NUMBER  =  {:fontsize => 28, :spacing => -4, :line_height => 20}
  335.   TEXT_SIZERATE     = {:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  336.   TEXT_SIZERATE_MCS = 0.9
  337.   DECORATION_NUMBER = {
  338.   :critical    => ["CRITICAL", 8], :weakness    => ["WEAKNESS", 8],
  339.   :resist      => ["RESIST"  , 8], :mp_damage   => ["\mp"     , 4],
  340.   :mp_plus     => ["\mp+"    , 4], :mp_minus    => ["\mp-"    , 4],
  341.   :tp_plus     => ["\tp+"    , 4], :tp_minus    => ["\tp-"    , 4]}
  342.   DECORATION_TEXT = {
  343.   :add_state   => "+%s",      :rem_state   => "-%s",
  344.   :add_buff    => "%s UP",    :add_debuff  => "%s DOWN",
  345.   :rem_buff    => "-%s Buff"}
  346.   POPUP_VOCAB = {
  347.   :miss        => "MISS!",      :counter     => "Counter",
  348.   :reflection  => "Reflection", :substitute  => "Substitute",
  349.   :levelup     => "LEVELUP!"}
  350.   POPUP_VOCAB_PARAMS = [
  351.   "MAX\hp","MAX\mp","ATK","DEF","MATK","MDEF","AGI","LUCK"]
  352.   POPUP_COLOR = {
  353.   :hp_damage     => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  354.   :critical      => [Color.new(255, 255,  80), Color.new(224,  32,   0)],
  355.   :weakness      => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  356.   :resist        => [Color.new(232, 224, 216), Color.new( 56,  48,  40)],
  357.   :hp_recovery   => [Color.new( 96, 255, 128), Color.new(  0,  64,  32)],
  358.   :mp_damage     => [Color.new(248,  80, 172), Color.new( 48,   0,  32)],
  359.   :mp_recovery   => [Color.new(160, 240, 255), Color.new( 32,  48, 144)],
  360.   :tp_damage     => [Color.new(248, 240,  64), Color.new(  0,  80,  40)],
  361.   :add_state     => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  362.   :rem_state     => [Color.new(224, 232, 240), Color.new( 32,  64, 128, 128)],
  363.   :add_badstate  => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  364.   :rem_badstate  => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  365.   :add_buff      => [Color.new(255, 255, 192), Color.new( 96,  64,   0)],
  366.   :add_debuff    => [Color.new(200, 224, 232), Color.new( 40,  48,  56)],
  367.   :rem_buff      => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  368.   :counter       => [Color.new(255, 255, 224), Color.new(128,  96,   0)],
  369.   :reflection    => [Color.new(224, 255, 255), Color.new(  0,  96, 128)],
  370.   :substitute    => [Color.new(224, 255, 224), Color.new(  0, 128,  64)],
  371.   :levelup       => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  372.   }
  373.   POPUP_TYPE = {
  374.   :miss          =>   0,:hp_damage     =>   0,:hp_slipdamage =>   1,
  375.   :hp_recovery   =>   0,:hp_regenerate =>   1,:hp_drain      =>   0,
  376.   :hp_drainrecv  =>   0,:mp_damage     =>   0,:mp_slipdamage =>   1,
  377.   :mp_recovery   =>   0,:mp_regenerate =>   1,:mp_drain      =>   0,
  378.   :mp_drainrecv  =>   0,:mp_paycost    =>  -1,:tp_damage     =>   1,
  379.   :tp_charge     =>  -1,:tp_gain       =>   7,:tp_regenerate =>   1,
  380.   :tp_paycost    =>  -1,:add_state     =>   2,:rem_state     =>   2,
  381.   :add_badstate  =>   2,:rem_badstate  =>   2,:add_debuff    =>   3,
  382.   :rem_buff      =>   3,:counter       =>   6,:reflection    =>   6,
  383.   :substitute    =>   4,}
  384.   LARGE_MOVEMENT = {
  385.   :inirate    => 6.4,  :gravity      => 0.68,  :side_scatter => 1.2,
  386.   :ref_height =>  32,  :ref_factor   => 0.60,  :ref_count    =>   2,
  387.                        :duration     =>   40,  :fadeout      =>  20 }
  388.   SMALL_MOVEMENT = {
  389.   :inirate    => 4.4,  :gravity      => 0.60,  :side_scatter => 0.0,
  390.   :ref_height =>  12,  :ref_factor   => 0.70,  :ref_count    =>   0,
  391.                        :duration     =>   60,  :fadeout      =>  16 }
  392.   RISE_MOVEMENT     = {:rising_speed => 0.75,  :line_spacing => 0.9,
  393.                        :duration     =>   40,  :fadeout      =>   8 }
  394.   SLIDE_MOVEMENT    = {:x_speed      =>    2,  :line_spacing => 0.9,
  395.                        :duration     =>   50,  :fadeout      =>  32 }
  396.   OVERLAY_MOVEMENT  = {:duration     =>   36,  :fadeout      =>  32 }
  397.   FIX_TARGET_CHECKE     = true
  398.   GUARD_TARGET_CHECKE   = true
  399.   SMART_TARGET_SELECT   = true
  400.   LAST_TARGET           = true
  401.   LAST_PARTY_COMMAND    = true
  402.   LAST_ACTOR_COMMAND    = true
  403.   TROOP_X_SORT          = true
  404.   PARTY_COMMAND_SKIP    = true
  405.   FITTING_LIST          = true
  406.   ENHANCED_WHITEN       = true
  407.   DISABLED_DAMAGE_SHAKE = true
  408.   TROOP_X_SCREEN_FIX    = true
  409.   TROOP_Y_OFFSET        = 0
  410.   end
  411.   # <<ver1.10>>
  412.   if !$lnx_include[:lnx11aconf] ||
  413.     $lnx_include[:lnx11aconf] && $lnx_include[:lnx11aconf] < 110
  414.   LARGE_NUMBER_NAME = ""
  415.   SMALL_NUMBER_NAME = ""
  416.   LARGE_BUFFS_NAME  = ""
  417.   SMALL_BUFFS_NAME  = ""
  418.   end
  419. end
  420.  
  421. #==============================================================================
  422. # ■ [追加]:Popup_Data
  423. #------------------------------------------------------------------------------
  424. #  戦闘中のポップアップをまとめて扱うクラス。ポップアップスプライトの
  425. # initialize 時に自身を参照させて、ポップアップ内容を定義する際にも使います。
  426. #==============================================================================
  427.  
  428. class Popup_Data
  429.   #--------------------------------------------------------------------------
  430.   # ● クラス変数
  431.   #--------------------------------------------------------------------------
  432.   @@make_methods = {} # ポップアップ作成メソッドのハッシュ
  433.   #--------------------------------------------------------------------------
  434.   # ● 定数(ポップアップのタイプID)
  435.   #--------------------------------------------------------------------------
  436.   SPRING_LARGE  = 0
  437.   SPRING_SMALL  = 1
  438.   RISING_LARGE  = 2
  439.   RISING_SMALL  = 3
  440.   SLIDING_LARGE = 4
  441.   SLIDING_SMALL = 5
  442.   OVERLAY_LARGE = 6
  443.   OVERLAY_SMALL = 7
  444.   LEVELUP       = :levelup
  445.   #--------------------------------------------------------------------------
  446.   # ● 公開インスタンス変数
  447.   #--------------------------------------------------------------------------
  448.   attr_accessor :type       # ポップアップのタイプ
  449.   attr_accessor :popup      # 表示する内容
  450.   attr_accessor :popup_size # ポップアップの大きさ
  451.   attr_accessor :color      # 色
  452.   attr_accessor :deco       # 修飾文字
  453.   attr_accessor :battler    # ポップアップするバトラー
  454.   attr_accessor :delay      # 表示開始までの時間
  455.   attr_accessor :viewport   # ビューポート
  456.   attr_accessor :popup_wait # ポップアップウェイト
  457.   attr_accessor :buff_data  # 能力強化/弱体 <<ver1.10>>
  458.   #--------------------------------------------------------------------------
  459.   # ● オブジェクト初期化
  460.   #--------------------------------------------------------------------------
  461.   def initialize
  462.     @sprites = []
  463.     @viewport = Viewport.new
  464.     @viewport.z = 120 # ポップアップの Z 座標
  465.     spb = Sprite_PopupBase.new
  466.     spb.create_number
  467.     spb.dispose
  468.     set_methods
  469.     refresh
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # ● ポップアップ生成メソッドの登録
  473.   #--------------------------------------------------------------------------
  474.   def set_methods
  475.     @@make_methods[SPRING_LARGE]  = method(:makeup_spring_large)
  476.     @@make_methods[SPRING_SMALL]  = method(:makeup_spring_small)
  477.     @@make_methods[RISING_LARGE]  = method(:makeup_rising_large)
  478.     @@make_methods[RISING_SMALL]  = method(:makeup_rising_small)
  479.     @@make_methods[SLIDING_LARGE] = method(:makeup_sliding_large)
  480.     @@make_methods[SLIDING_SMALL] = method(:makeup_sliding_small)
  481.     @@make_methods[OVERLAY_LARGE] = method(:makeup_overlay_large)
  482.     @@make_methods[OVERLAY_SMALL] = method(:makeup_overlay_small)
  483.     @@make_methods[LEVELUP]       = method(:makeup_levelup)
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● スプライト解放
  487.   #--------------------------------------------------------------------------
  488.   def dispose
  489.     @sprites.each {|sprite| sprite.dispose}
  490.     @viewport.dispose
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● フレーム更新
  494.   #--------------------------------------------------------------------------
  495.   def update
  496.     @sprites.each do |sprite|
  497.       sprite.update
  498.       @sprites.delete(sprite) if sprite.disposed?
  499.     end
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ● リフレッシュ
  503.   #--------------------------------------------------------------------------
  504.   def refresh
  505.     @type  = 0
  506.     @popup = nil
  507.     @popup_size = :large
  508.     [url=home.php?mod=space&uid=10453]@color[/url] = :hp_damage
  509.     @deco = ["", -1] # [テキスト, テキストの位置]
  510.     [url=home.php?mod=space&uid=133701]@battler[/url] = nil
  511.     @delay = 0
  512.     @popup_wait = false
  513.     # <<ver1.10>> 能力強化/弱体ポップアップを画像で表示する際に利用
  514.     @buff_data = [-1, -1] # [能力, 強化or弱体or解除]
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ● ポップアップを生成
  518.   #--------------------------------------------------------------------------
  519.   def makeup
  520.     if @@make_methods[@type]
  521.       @@make_methods[@type].call
  522.       @popup_wait = true
  523.     end
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ● ポップアップウェイト
  527.   #  バトルログタイプが [2:ヘルプ表示] の場合のみ実行されます。
  528.   #--------------------------------------------------------------------------
  529.   def add_wait
  530.     return if LNX11::BATTLELOG_TYPE != 2 || !@popup_wait
  531.     LNX11::POPUP_ADD_WAIT.times {BattleManager.log_window.abs_wait(1)}
  532.     @popup_wait = false
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ● ポップアップ生成メソッド
  536.   #  これらのメソッドを @@make_methods に登録して呼び出します。
  537.   # これはポップアップタイプの拡張を容易にするための仕様です。
  538.   #--------------------------------------------------------------------------
  539.   def makeup_spring_large
  540.     # @type   0 : 跳ねるポップアップ(大)
  541.     @popup_size = :large
  542.     @sprites.push(Sprite_PopupSpring.new(self))
  543.   end
  544.   def makeup_spring_small
  545.     # @type   1 : 跳ねるポップアップ(小)
  546.     @popup_size = :small
  547.     @delay = @battler.popup_delay[1]
  548.     @sprites.push(Sprite_PopupSpring.new(self))
  549.   end
  550.   def makeup_rising_large
  551.     # @type   2 : ゆっくり上昇(大)
  552.     @popup_size = :large
  553.     @delay = @battler.popup_delay[2]
  554.     @sprites.push(Sprite_PopupRising.new(self))
  555.   end
  556.   def makeup_rising_small
  557.     # @type   3 : ゆっくり上昇(小)
  558.     @popup_size = :small      
  559.     @delay = @battler.popup_delay[2]
  560.     @sprites.push(Sprite_PopupRising.new(self))
  561.   end
  562.   def makeup_sliding_large
  563.     # @type   4 : スライド(大)
  564.     @popup_size = :large
  565.     @delay = @battler.popup_delay[3]
  566.     @sprites.push(Sprite_PopupSliding.new(self))
  567.   end
  568.   def makeup_sliding_small
  569.     # @type   5 : スライド(小)
  570.     @popup_size = :small
  571.     @delay = @battler.popup_delay[3]
  572.     @sprites.push(Sprite_PopupSliding.new(self))      
  573.   end
  574.   def makeup_overlay_large
  575.     # @type   6 : オーバーレイ(大)
  576.     @popup_size = :large
  577.     @sprites.push(Sprite_PopupOverlay.new(self))
  578.   end
  579.   def makeup_overlay_small
  580.     # @type   7 : オーバーレイ(小)
  581.     @popup_size = :small
  582.     @sprites.push(Sprite_PopupOverlay.new(self))
  583.   end
  584.   def makeup_levelup
  585.     # @type :levelup : レベルアップ
  586.     @battler.popup_delay[3] = 0
  587.     @popup_size = :large
  588.     @sprites.push(Sprite_PopupLevelUp.new(self))
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # ● TP のポップアップが有効か?
  592.   #--------------------------------------------------------------------------
  593.   def tp_popup_enabled?(target)
  594.     return false if !$data_system.opt_display_tp
  595.     return true  if LNX11::TP_POPUP_TYPE == 0 # すべてポップアップ
  596.     return true  if LNX11::TP_POPUP_TYPE == 1 && target.actor? # アクターのみ
  597.     false # ポップアップしない
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ● 任意のポップアップ
  601.   #--------------------------------------------------------------------------
  602.   def popup_custom(target, popup, type = 0, color = :hp_damage, deco = nil)
  603.     refresh
  604.     @battler = target
  605.     @popup = popup
  606.     type = LNX11::POPUP_TYPE[type] if type.is_a?(Symbol)
  607.     @type = type
  608.     @color = color
  609.     @deco = LNX11::DECORATION_NUMBER[deco] if deco.is_a?(Symbol)
  610.     # ポップアップ作成
  611.     makeup
  612.   end
  613.   #--------------------------------------------------------------------------
  614.   # ● レベルアップのポップアップ
  615.   #--------------------------------------------------------------------------
  616.   def popup_levelup(target)
  617.     # 戦闘に参加している場合のみポップアップ
  618.     return unless $game_party.battle_members.include?(target)
  619.     refresh
  620.     @type = :levelup
  621.     @battler = target
  622.     @popup = LNX11::POPUP_VOCAB[:levelup]
  623.     @color = :levelup
  624.     # ポップアップ作成
  625.     makeup
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ● 単一テキストのポップアップ
  629.   #--------------------------------------------------------------------------
  630.   def popup_text(target, type)
  631.     refresh
  632.     @type = LNX11::POPUP_TYPE[type]
  633.     @battler = target
  634.     @popup = LNX11::POPUP_VOCAB[type]
  635.     @color = type
  636.     # ポップアップ作成
  637.     makeup
  638.   end
  639.   #--------------------------------------------------------------------------
  640.   # ● ミスのポップアップ
  641.   #--------------------------------------------------------------------------
  642.   def popup_miss(target, item)
  643.     refresh
  644.     @type = LNX11::POPUP_TYPE[:miss]
  645.     @battler = target
  646.     @popup = LNX11::POPUP_VOCAB[:miss]
  647.     @color = :hp_damage
  648.     # ポップアップ作成
  649.     makeup
  650.   end
  651.   #--------------------------------------------------------------------------
  652.   # ● HP ダメージポップアップ
  653.   #--------------------------------------------------------------------------
  654.   def popup_hp_damage(target, item)
  655.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  656.     refresh
  657.     @popup = target.result.hp_damage
  658.     @battler = target
  659.     if target.result.hp_drain > 0
  660.       # 被吸収
  661.       @type = LNX11::POPUP_TYPE[:hp_drain]
  662.       # 弱点/耐性
  663.       if target.result.element_rate > 1
  664.         @deco = LNX11::DECORATION_NUMBER[:weakness]
  665.         @color = :weakness
  666.       elsif target.result.element_rate < 1
  667.         @deco = LNX11::DECORATION_NUMBER[:resist]
  668.         @color = :resist
  669.       else
  670.         @color = :hp_damage
  671.       end
  672.     elsif target.result.hp_damage > 0
  673.       # ダメージ
  674.       @type = LNX11::POPUP_TYPE[:hp_damage]
  675.       @color = :hp_damage
  676.       if target.result.critical
  677.         # クリティカル
  678.         @deco = LNX11::DECORATION_NUMBER[:critical]
  679.         @color = :critical
  680.       end
  681.       # 弱点/耐性
  682.       if target.result.element_rate > 1
  683.         @deco = LNX11::DECORATION_NUMBER[:weakness]
  684.         @color = :weakness if @color != :critical
  685.       elsif target.result.element_rate < 1
  686.         @deco = LNX11::DECORATION_NUMBER[:resist]
  687.         @color = :resist if @color != :critical
  688.       end
  689.     elsif target.result.hp_damage < 0
  690.       # 回復
  691.       @type = LNX11::POPUP_TYPE[:hp_recovery]
  692.       @color = :hp_recovery
  693.     else
  694.       # 0 ダメージ
  695.       @type = LNX11::POPUP_TYPE[:hp_damage]
  696.       @color = :hp_damage
  697.     end
  698.     # ポップアップ作成
  699.     makeup
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # ● MP ダメージポップアップ
  703.   #--------------------------------------------------------------------------
  704.   def popup_mp_damage(target, item)
  705.     return if target.dead? || target.result.mp_damage == 0
  706.     refresh
  707.     @popup = target.result.mp_damage
  708.     @battler = target
  709.     @deco = LNX11::DECORATION_NUMBER[:mp_damage]
  710.     if target.result.mp_drain > 0
  711.       # 被吸収
  712.       @type = LNX11::POPUP_TYPE[:mp_drain]
  713.       @color = :mp_damage
  714.     elsif target.result.mp_damage > 0
  715.       # ダメージ
  716.       @type = LNX11::POPUP_TYPE[:mp_damage]
  717.       @color = :mp_damage
  718.     elsif target.result.mp_damage < 0
  719.       # 回復
  720.       @type = LNX11::POPUP_TYPE[:mp_recovery]
  721.       @color = :mp_recovery
  722.     end
  723.     # ポップアップ作成
  724.     makeup
  725.   end
  726.   #--------------------------------------------------------------------------
  727.   # ● TP ダメージポップアップ
  728.   #--------------------------------------------------------------------------
  729.   def popup_tp_damage(target, item)
  730.     return unless tp_popup_enabled?(target)
  731.     return if target.dead? || target.result.tp_damage == 0
  732.     refresh
  733.     @popup = target.result.tp_damage
  734.     @battler = target
  735.     deco = target.result.tp_damage > 0 ? :tp_minus : :tp_plus
  736.     @deco = LNX11::DECORATION_NUMBER[deco]
  737.     @type = LNX11::POPUP_TYPE[:tp_damage]
  738.     @color = :tp_damage
  739.     # ポップアップ作成
  740.     makeup
  741.   end
  742.   #--------------------------------------------------------------------------
  743.   # ● HP 吸収回復
  744.   #--------------------------------------------------------------------------
  745.   def popup_hp_drain(target, hp_drain)
  746.     return if hp_drain == 0
  747.     refresh
  748.     @popup = hp_drain
  749.     @battler = target
  750.     @type = LNX11::POPUP_TYPE[:hp_drainrecv]
  751.     @color = :hp_recovery
  752.     # ポップアップ作成
  753.     makeup
  754.   end
  755.   #--------------------------------------------------------------------------
  756.   # ● MP 吸収回復
  757.   #--------------------------------------------------------------------------
  758.   def popup_mp_drain(target, mp_drain)
  759.     return if mp_drain == 0
  760.     refresh
  761.     @popup = mp_drain
  762.     @battler = target
  763.     @deco = LNX11::DECORATION_NUMBER[:mp_damage]
  764.     @type = LNX11::POPUP_TYPE[:mp_drainrecv]
  765.     @color = :mp_recovery
  766.     # ポップアップ作成
  767.     makeup
  768.   end
  769.   #--------------------------------------------------------------------------
  770.   # ● ステート付加のポップアップ
  771.   #--------------------------------------------------------------------------
  772.   def popup_added_states(target)
  773.     refresh
  774.     @battler = target
  775.     target.result.added_state_objects.each do |state|
  776.       next if state.id == target.death_state_id
  777.       next if state.icon_index == 0 && LNX11::INDEXZERO_NO_POPUP
  778.       next if state.add_no_display?      
  779.       if state.add_no_decoration?
  780.         @popup = state.add_display_name
  781.       else
  782.         @popup = sprintf(LNX11::DECORATION_TEXT[:add_state],
  783.                          state.add_display_name)
  784.       end
  785.       type = state.advantage? ? :add_state : :add_badstate
  786.       if state.add_popup_type
  787.         @type = state.add_popup_type
  788.       else
  789.         @type = LNX11::POPUP_TYPE[type]
  790.       end
  791.       @color = type
  792.       # ポップアップ作成
  793.       makeup
  794.     end
  795.   end
  796.   #--------------------------------------------------------------------------
  797.   # ● ステート解除のポップアップ
  798.   #--------------------------------------------------------------------------
  799.   def popup_removed_states(target)
  800.     refresh
  801.     @type = LNX11::POPUP_TYPE[:rem_badstate]
  802.     @battler = target
  803.     target.result.removed_state_objects.each do |state|
  804.       next if state.id == target.death_state_id
  805.       next if state.icon_index == 0 && LNX11::INDEXZERO_NO_POPUP
  806.       next if state.remove_no_display?
  807.       if state.remove_no_decoration?
  808.         @popup = state.remove_display_name
  809.       else
  810.         @popup = sprintf(LNX11::DECORATION_TEXT[:rem_state],
  811.                          state.remove_display_name)
  812.       end
  813.       type = state.advantage? ? :rem_state : :rem_badstate
  814.       if state.remove_popup_type
  815.         @type = state.remove_popup_type
  816.       else
  817.         @type = LNX11::POPUP_TYPE[type]
  818.       end
  819.       @color = type
  820.       # ポップアップ作成
  821.       makeup
  822.     end
  823.   end
  824.   #--------------------------------------------------------------------------
  825.   # ● 能力強化/弱体のポップアップ
  826.   #--------------------------------------------------------------------------
  827.   def popup_buffs(target, buffs, fmt)
  828.     return if buffs.empty?
  829.     refresh
  830.     @battler = target
  831.     case fmt
  832.     when Vocab::BuffAdd
  833.       buffdeco = LNX11::DECORATION_TEXT[:add_buff]
  834.       @type = LNX11::POPUP_TYPE[:add_buff]
  835.       @color = :add_buff
  836.       @buff_data[1] = 0
  837.     when Vocab::DebuffAdd
  838.       buffdeco = LNX11::DECORATION_TEXT[:add_debuff]
  839.       @type = LNX11::POPUP_TYPE[:add_debuff]
  840.       @color = :add_debuff
  841.       @buff_data[1] = 1
  842.     when Vocab::BuffRemove
  843.       buffdeco = LNX11::DECORATION_TEXT[:rem_buff]
  844.       @type = LNX11::POPUP_TYPE[:rem_buff]
  845.       @color = :rem_buff
  846.       @buff_data[1] = 2
  847.     end
  848.     buffs.each do |param_id|
  849.       @popup = sprintf(buffdeco, LNX11::POPUP_VOCAB_PARAMS[param_id])
  850.       @buff_data[0] = param_id
  851.       # ポップアップ作成
  852.       makeup
  853.       @popup_wait = false
  854.     end
  855.   end
  856.   #--------------------------------------------------------------------------
  857.   # ● HP 再生
  858.   #--------------------------------------------------------------------------
  859.   def popup_regenerate_hp(target, hp_damage, paycost = false)
  860.     return if hp_damage == 0
  861.     refresh
  862.     @popup = hp_damage
  863.     @battler = target
  864.     if hp_damage > 0
  865.       # ダメージ
  866.       @type = LNX11::POPUP_TYPE[:hp_slipdamage]
  867.       @color = :hp_damage
  868.     elsif hp_damage < 0
  869.       # 回復
  870.       @type = LNX11::POPUP_TYPE[:hp_regenerate]
  871.       @color = :hp_recovery
  872.     end
  873.     # ポップアップ作成
  874.     makeup
  875.   end
  876.   #--------------------------------------------------------------------------
  877.   # ● MP 再生
  878.   #--------------------------------------------------------------------------
  879.   def popup_regenerate_mp(target, mp_damage, paycost = false)
  880.     return if mp_damage == 0
  881.     refresh
  882.     @popup = mp_damage
  883.     @battler = target
  884.     @deco = LNX11::DECORATION_NUMBER[mp_damage > 0 ? :mp_minus : :mp_plus]
  885.     if mp_damage > 0
  886.       # ダメージ
  887.       @type = LNX11::POPUP_TYPE[paycost ? :mp_paycost : :mp_slipdamage]
  888.       @color = :mp_damage
  889.     elsif mp_damage < 0
  890.       # 回復
  891.       @type = LNX11::POPUP_TYPE[paycost ? :mp_paycost : :mp_regenerate]
  892.       @color = :mp_recovery
  893.     end
  894.     # ポップアップ作成
  895.     makeup
  896.   end
  897.   #--------------------------------------------------------------------------
  898.   # ● TP 再生
  899.   #--------------------------------------------------------------------------
  900.   def popup_regenerate_tp(target, tp_damage, paycost = false)
  901.     return unless tp_popup_enabled?(target)
  902.     return if tp_damage == 0
  903.     refresh
  904.     @popup = tp_damage
  905.     @battler = target
  906.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  907.     @type = LNX11::POPUP_TYPE[paycost ? :tp_paycost : :tp_regenerate]
  908.     @color = :tp_damage
  909.     # ポップアップ作成
  910.     makeup
  911.   end
  912.   #--------------------------------------------------------------------------
  913.   # ● TP チャージ
  914.   #--------------------------------------------------------------------------
  915.   def popup_tp_charge(target, tp_damage)
  916.     return unless tp_popup_enabled?(target)
  917.     return if tp_damage == 0
  918.     refresh
  919.     @popup = tp_damage
  920.     @battler = target
  921.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  922.     @type = LNX11::POPUP_TYPE[:tp_charge]
  923.     @color = :tp_damage
  924.     # ポップアップ作成
  925.     makeup
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● TP 得
  929.   #--------------------------------------------------------------------------
  930.   def popup_tp_gain(target, tp_damage)
  931.     return unless tp_popup_enabled?(target)
  932.     return if tp_damage == 0
  933.     refresh
  934.     @popup = tp_damage
  935.     @battler = target
  936.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  937.     @type = LNX11::POPUP_TYPE[:tp_gain]
  938.     @color = :tp_damage
  939.     # ポップアップ作成
  940.     makeup
  941.   end
  942. end
  943.  
  944. #==============================================================================
  945. # ■ [追加]:Sprite_PopupBase
  946. #------------------------------------------------------------------------------
  947. #  戦闘中のダメージ表示等をポップアップ表示するためのスプライトの
  948. # スーパークラス。サブクラスで細かい動きを定義します。
  949. #==============================================================================
  950.  
  951. class Sprite_PopupBase < Sprite
  952.   #--------------------------------------------------------------------------
  953.   # ● クラス変数
  954.   #--------------------------------------------------------------------------
  955.   @@cache_number = []
  956.   @@cache_text   = {}
  957.   @@w = []
  958.   @@h = []
  959.   @@priority = 0
  960.   @@count    = 0
  961.   @@buf_bitmap = nil
  962.   #--------------------------------------------------------------------------
  963.   # ● 定数
  964.   #--------------------------------------------------------------------------
  965.   NUMBER_COLOR_SIZE = 8
  966.   NUMBERS    = [0,1,2,3,4,5,6,7,8,9]
  967.   COLOR_KEYS = LNX11::POPUP_COLOR.keys
  968.   #--------------------------------------------------------------------------
  969.   # ● オブジェクト初期化
  970.   #     data : ポップアップデータ
  971.   #--------------------------------------------------------------------------
  972.   def initialize(data = nil)
  973.     if data == nil || !data.battler.battle_member?
  974.       # 非表示のポップアップ
  975.       super(nil)
  976.       @remove = true
  977.       return
  978.     end
  979.     # ポップアップデータを適用
  980.     super(data.viewport)
  981.     @battler = data.battler # ポップアップを表示するバトラー
  982.     @delay   = data.delay   # ディレイ(遅延) ※サブクラスによって扱いが違います
  983.     @popup_size = data.popup_size # ポップアップの大きさ 大/小
  984.     # 基本設定
  985.     @duration = 60  # 消え始める時間
  986.     @fadeout  = 16  # 消える速さ
  987.     @rx = ry  = 0   # XY座標
  988.     # Z座標
  989.     @rz = base_z * 128 + priority
  990.     popup_add
  991.     self.visible = false
  992.     # ポップアップデータからビットマップを作成
  993.     if data.popup.is_a?(Numeric)
  994.       # ダメージ値
  995.       self.bitmap = number(data.popup, data.color, data.popup_size, data.deco)
  996.     elsif data.popup.is_a?(String)
  997.       # テキスト
  998.       self.bitmap = text(data.popup, data.color,
  999.                          data.popup_size, data.buff_data)
  1000.     end
  1001.     # 位置設定
  1002.     self.ox = self.width  / 2
  1003.     self.oy = self.height / 2
  1004.     set_position
  1005.     start
  1006.   end
  1007.   #--------------------------------------------------------------------------
  1008.   # ● 解放
  1009.   #--------------------------------------------------------------------------
  1010.   def dispose
  1011.     popup_remove
  1012.     terminate
  1013.     self.bitmap.dispose if self.bitmap
  1014.     super
  1015.   end
  1016.   #--------------------------------------------------------------------------
  1017.   # ● フレーム更新
  1018.   #--------------------------------------------------------------------------
  1019.   def update
  1020.     return if removed? || delay?
  1021.     update_popup
  1022.     update_xy
  1023.     @duration -= 1
  1024.     self.opacity -= @fadeout if @duration <= 0
  1025.     dispose if self.opacity == 0
  1026.   end
  1027.   #--------------------------------------------------------------------------
  1028.   # ● 開始処理(サブクラスで定義)
  1029.   #--------------------------------------------------------------------------
  1030.   def start
  1031.   end
  1032.   #--------------------------------------------------------------------------
  1033.   # ● 終了処理(サブクラスで定義)
  1034.   #--------------------------------------------------------------------------
  1035.   def terminate
  1036.   end
  1037.   #--------------------------------------------------------------------------
  1038.   # ● フレーム更新(サブクラスで定義)
  1039.   #--------------------------------------------------------------------------
  1040.   def update_popup
  1041.   end
  1042.   #--------------------------------------------------------------------------
  1043.   # ● ポップアップ Z 座標
  1044.   #--------------------------------------------------------------------------
  1045.   def base_z
  1046.     0
  1047.   end
  1048.   #--------------------------------------------------------------------------
  1049.   # ● ポップアップのプライオリティを返す
  1050.   #  同一Z座標のポップアップで、後から生成されたものが手前に表示されるように
  1051.   # Z座標の修正値をクラス変数で管理しています。
  1052.   #--------------------------------------------------------------------------
  1053.   def priority
  1054.     @@priority * 2
  1055.   end
  1056.   #--------------------------------------------------------------------------
  1057.   # ● ポップアップ追加
  1058.   #--------------------------------------------------------------------------
  1059.   def popup_add
  1060.     @@priority += 1
  1061.     @@count += 1
  1062.   end
  1063.   #--------------------------------------------------------------------------
  1064.   # ● ポップアップ消去
  1065.   #--------------------------------------------------------------------------
  1066.   def popup_remove
  1067.     @remove = true
  1068.     @@count -= 1
  1069.     @@priority = 0 if @@count <= 0
  1070.   end
  1071.   #--------------------------------------------------------------------------
  1072.   # ● ディレイが残っている?
  1073.   #  サブクラスの update メソッドで使用します。
  1074.   #--------------------------------------------------------------------------
  1075.   def delay?
  1076.     @delay -= 1
  1077.     self.visible = (@delay <= 0)
  1078.     !self.visible
  1079.   end
  1080.   #--------------------------------------------------------------------------
  1081.   # ● ポップアップ消去済み?
  1082.   #--------------------------------------------------------------------------
  1083.   def removed?
  1084.     @remove
  1085.   end  
  1086.   #--------------------------------------------------------------------------
  1087.   # ● 座標更新
  1088.   #--------------------------------------------------------------------------
  1089.   def update_xy
  1090.     self.x = @rx
  1091.     self.y = @ry
  1092.     self.z = @rz
  1093.   end
  1094.   #--------------------------------------------------------------------------
  1095.   # ● ポップアップ位置の設定
  1096.   #--------------------------------------------------------------------------
  1097.   def set_position
  1098.     @rx = @battler.screen_x
  1099.     if @battler.actor?
  1100.       pos = LNX11::ACTOR_POPUP_POSITION
  1101.     else
  1102.       pos = [LNX11::ENEMY_POPUP_POSITION, 2].min
  1103.     end
  1104.     case pos
  1105.     when 0 ; @ry = @battler.screen_y        # 足元
  1106.     when 1 ; @ry = @battler.screen_y_center # 中心
  1107.     when 2 ; @ry = @battler.screen_y_top    # 頭上
  1108.     when 3 ; @ry = Graphics.height + LNX11::ACTOR_POPUP_Y # Y座標統一(アクター)
  1109.     end
  1110.   end
  1111.   #--------------------------------------------------------------------------
  1112.   # ● 描画するテキストの矩形を取得
  1113.   #--------------------------------------------------------------------------
  1114.   def text_size(str, name, size, bold = false)
  1115.     @@buf_bitmap = Bitmap.new(4, 4) if !@@buf_bitmap || @@buf_bitmap.disposed?
  1116.     @@buf_bitmap.font.name = name
  1117.     @@buf_bitmap.font.size = size
  1118.     @@buf_bitmap.font.bold = bold
  1119.     return @@buf_bitmap.text_size(str)
  1120.   end
  1121.   #--------------------------------------------------------------------------
  1122.   # ● 数字ビットマップの取得
  1123.   #--------------------------------------------------------------------------
  1124.   def bitmap_number(size = :large)
  1125.     return @@cache_number[size == :large ? 0 : 1]
  1126.   end
  1127.   #--------------------------------------------------------------------------
  1128.   # ● 数字ビットマップキャッシュの作成
  1129.   #--------------------------------------------------------------------------
  1130.   def create_number
  1131.     return if @@cache_number[0] && !@@cache_number[0].disposed?
  1132.     n_index = NUMBER_COLOR_SIZE
  1133.     @@cache_number.clear
  1134.     colors = LNX11::POPUP_COLOR.values # 色
  1135.     name = LNX11::NUMBER_FONT
  1136.     # 大・小の 2 パターンを作成する(ループ)
  1137.     [LNX11::LARGE_NUMBER, LNX11::SMALL_NUMBER].each_with_index do |n_size, i|
  1138.       next if get_number(i)
  1139.       size = n_size[:fontsize]
  1140.       # 数字の幅・高さ
  1141.       w = NUMBERS.collect{|n| text_size(n.to_s, name, size).width}.max + 4
  1142.       nh = NUMBERS.collect{|n| text_size(n.to_s, name, size).height}.max
  1143.       h = n_size[:line_height]
  1144.       @@w[i] = w
  1145.       @@h[i] = h
  1146.       # ビットマップ作成
  1147.       bitmap = Bitmap.new(w * NUMBERS.size, h * [colors.size, n_index].min)
  1148.       bitmap.font.name = LNX11::NUMBER_FONT
  1149.       bitmap.font.size = n_size[:fontsize]
  1150.       y = ((h - nh) / 2) - 1
  1151.       # 色ごとに分けて描画する(ループ)
  1152.       n_index.times do |col|
  1153.         # 色を変更
  1154.         bitmap.font.color.set(colors[col][0])
  1155.         bitmap.font.out_color.set(colors[col][1])
  1156.         # 文字ごとに分けて描画(ループ)
  1157.         NUMBERS.size.times do |num|
  1158.           bitmap.draw_text(num * w, (col * h) + y, w, nh, NUMBERS[num], 2)
  1159.         end
  1160.       end
  1161.       @@cache_number.push(bitmap)
  1162.     end
  1163.     p "LNX11a:数字ビットマップのキャッシュを作成しました。"
  1164.     # 数字ビットマップを表示する(テスト用)
  1165.     # s = Sprite.new
  1166.     # s.z = 1000000
  1167.     # s.bitmap = @@cache_number[1] # 0 or 1
  1168.     # loop do Graphics.update end
  1169.   end
  1170.   #--------------------------------------------------------------------------
  1171.   # ● 数字ビットマップの取得
  1172.   #--------------------------------------------------------------------------
  1173.   def get_number(i)
  1174.     case i
  1175.     when 0 # 大
  1176.       return false if LNX11::LARGE_NUMBER_NAME.empty?
  1177.       bitmap = Cache.system(LNX11::LARGE_NUMBER_NAME)
  1178.     when 1 # 小
  1179.       return false if LNX11::SMALL_NUMBER_NAME.empty?
  1180.       bitmap = Cache.system(LNX11::SMALL_NUMBER_NAME)
  1181.     end
  1182.     @@cache_number.push(bitmap)
  1183.     @@w[i] = bitmap.width / NUMBERS.size
  1184.     @@h[i] = bitmap.height / NUMBER_COLOR_SIZE
  1185.     true
  1186.   end
  1187.   #--------------------------------------------------------------------------
  1188.   # ● ダメージ数を描画したビットマップの取得
  1189.   #--------------------------------------------------------------------------
  1190.   def number(num, color, size = :large, deco = nil)
  1191.     # 数値を文字列の配列にする
  1192.     numbers = (num.abs.to_s).split(//)
  1193.     # 色番号を取得
  1194.     color_index = COLOR_KEYS.index(color)
  1195.     # ポップアップサイズを設定
  1196.     n_bitmap = bitmap_number(size)
  1197.     if size == :large
  1198.       n_size = LNX11::LARGE_NUMBER
  1199.       i = 0
  1200.     else
  1201.       n_size = LNX11::SMALL_NUMBER
  1202.       i = 1
  1203.     end
  1204.     spacing = n_size[:spacing]
  1205.     w = @@w[i]
  1206.     h = @@h[i]
  1207.     # ダメージ値のビットマップサイズ
  1208.     @bw = w * numbers.size + spacing * (numbers.size - 1)
  1209.     @bh = h
  1210.     # 修飾文字の描画
  1211.     @offset_x = @offset_y = 0
  1212.     text_bitmap = deco_text(deco,color,n_size[:fontsize]) if deco[1] >= 0
  1213.     # ビットマップを作成
  1214.     bitmap = Bitmap.new(@bw, @bh)
  1215.     # 塗りつぶし(テスト用)
  1216.     # bitmap.fill_rect(bitmap.rect, Color.new(0,0,0,128))
  1217.     # ダメージ値を描画
  1218.     rect = Rect.new(0, h * color_index, w, h)
  1219.     numbers.size.times do |n|
  1220.       rect.x = numbers[n].to_i * w
  1221.       bitmap.blt(w * n + spacing * n + @offset_x, @offset_y, n_bitmap, rect)
  1222.     end
  1223.     # 修飾文字の描画をコールバック
  1224.     @decoblt.call(bitmap) if @decoblt
  1225.     @decoblt = nil
  1226.     # ビットマップを返す
  1227.     bitmap
  1228.   end
  1229.   #--------------------------------------------------------------------------
  1230.   # ● 修飾文字の描画
  1231.   #--------------------------------------------------------------------------
  1232.   def deco_text(deco, color, sizerate)
  1233.     # 元の幅・高さ
  1234.     ow = @bw
  1235.     oh = @bh
  1236.     case deco[1]   
  1237.     when 2 # ダメージ値の下
  1238.       # テキストのビットマップを取得
  1239.       size = decosize(deco[0], sizerate, :top_bottom)
  1240.       text_bitmap = text(deco[0], color, size)
  1241.       # テキストの幅・高さ
  1242.       tw = text_bitmap.width
  1243.       th = text_bitmap.height * 0.8
  1244.       # 最終的なビットマップのサイズ
  1245.       @bw = [@bw, tw].max
  1246.       @bh += th
  1247.       # ダメージ値の描画位置の修正
  1248.       @offset_x = (@bw - ow) / 2
  1249.       @offset_y = 0
  1250.       # 修飾文字の描画位置を設定
  1251.       x = (@bw - tw) / 2
  1252.       y = oh * 0.8
  1253.     when 4 # ダメージ値の左
  1254.       # テキストのビットマップを取得
  1255.       size = decosize(deco[0], sizerate, :left_right)
  1256.       text_bitmap = text(deco[0], color, size)
  1257.       # テキストの幅・高さ
  1258.       tw = text_bitmap.width
  1259.       th = text_bitmap.height
  1260.       # 最終的なビットマップのサイズ
  1261.       @bw += tw
  1262.       @bh = [@bh, th].max
  1263.       # ダメージ値の描画位置の修正
  1264.       @offset_x = tw
  1265.       @offset_y = (@bh - oh) / 2
  1266.       # 修飾文字の描画位置を設定
  1267.       x = 2
  1268.       y = (@bh - th) / 2
  1269.     when 6 # ダメージ値の右
  1270.       # テキストのビットマップを取得
  1271.       size = decosize(deco[0], sizerate, :left_right)
  1272.       text_bitmap = text(deco[0], color, size)
  1273.       # テキストの幅・高さ
  1274.       tw = text_bitmap.width
  1275.       th = text_bitmap.height
  1276.       # 最終的なビットマップのサイズ
  1277.       @bw += tw
  1278.       @bh = [@bh, th].max
  1279.       # ダメージ値の描画位置の修正
  1280.       @offset_x = 0
  1281.       @offset_y = (@bh - oh) / 2
  1282.       # 修飾文字の描画位置を設定
  1283.       x = ow
  1284.       y = (@bh - th) / 2
  1285.     when 8 # ダメージ値の上
  1286.       # テキストのビットマップを取得
  1287.       size = decosize(deco[0], sizerate, :top_bottom)
  1288.       text_bitmap = text(deco[0], color, size)
  1289.       # テキストの幅・高さ
  1290.       tw = text_bitmap.width
  1291.       th = text_bitmap.height * 0.8
  1292.       # 最終的なビットマップのサイズ
  1293.       @bw = [@bw, tw].max
  1294.       @bh += th
  1295.       # ダメージ値の描画位置の修正
  1296.       @offset_x = (@bw - ow) / 2
  1297.       @offset_y = @bh - oh
  1298.       # 修飾文字の描画位置を設定
  1299.       x = (@bw - tw) / 2
  1300.       y = 0
  1301.     end
  1302.     # 修飾文字の描画(コールバック)
  1303.     @decoblt = Proc.new {|bitmap|
  1304.     bitmap.blt(x, y, text_bitmap, text_bitmap.rect)
  1305.     text_bitmap.dispose}
  1306.     return text_bitmap
  1307.   end
  1308.   #--------------------------------------------------------------------------
  1309.   # ● 修飾文字のサイズ
  1310.   #--------------------------------------------------------------------------
  1311.   def decosize(text, size, pos)
  1312.     if text.length != text.bytesize
  1313.       return size * LNX11::TEXT_SIZERATE[pos] * LNX11::TEXT_SIZERATE_MCS
  1314.     else
  1315.       return size * LNX11::TEXT_SIZERATE[pos]
  1316.     end
  1317.   end
  1318.   #--------------------------------------------------------------------------
  1319.   # ● テキストを描画したビットマップの取得
  1320.   #  ステートやダメージ値の修飾文字の描画に使用します。
  1321.   #--------------------------------------------------------------------------
  1322.   def text(text, color, size = :large, buff_data = [-1, -1])
  1323.     # キャッシュがあればそれを返す(無ければ作成)
  1324.     key = text + color.to_s + size.to_s
  1325.     if @@cache_text[key] && !@@cache_text[key].disposed?
  1326.       return @@cache_text[key].clone
  1327.     end
  1328.     # 用語の置き換え
  1329.     text.gsub!("\hp") { Vocab::hp_a } if text.include?("\hp")
  1330.     text.gsub!("\mp") { Vocab::mp_a } if text.include?("\mp")
  1331.     text.gsub!("\tp") { Vocab::tp_a } if text.include?("\tp")
  1332.     # <<ver1.10>> テキストの頭に _ があれば対応する画像ファイルを参照する
  1333.     if text[/^[\_]./]
  1334.       bitmap = get_text_bitmap(text, color, size)
  1335.       # キャッシュに保存
  1336.       @@cache_text[key] = bitmap
  1337.       # ビットマップを返す
  1338.       return bitmap.clone
  1339.     end
  1340.     # <<ver1.10>>
  1341.     # 能力強化/弱体のポップアップで、ファイル名が指定されていればそれを返す
  1342.     if buff_data[0] >= 0 &&
  1343.       (size == :large && !LNX11::LARGE_BUFFS_NAME.empty?) ||
  1344.       (size == :small && !LNX11::SMALL_BUFFS_NAME.empty?)
  1345.       bitmap = get_buff_bitmap(buff_data, size)
  1346.       # キャッシュに保存
  1347.       @@cache_text[key] = bitmap
  1348.       # ビットマップを返す
  1349.       return bitmap.clone
  1350.     end
  1351.     # テキストにマルチバイト文字があれば日本語用フォントを使う
  1352.     if text.length != text.bytesize
  1353.       fontname = LNX11::TEXT_FONT_MCS
  1354.       sizerate = LNX11::TEXT_SIZERATE[:normal] * LNX11::TEXT_SIZERATE_MCS
  1355.     else
  1356.       fontname = LNX11::TEXT_FONT
  1357.       sizerate = LNX11::TEXT_SIZERATE[:normal]
  1358.     end
  1359.     # ポップアップサイズを設定
  1360.     case size
  1361.     when :large ; fontsize = LNX11::LARGE_NUMBER[:fontsize] * sizerate
  1362.     when :small ; fontsize = LNX11::SMALL_NUMBER[:fontsize] * sizerate
  1363.     else        ; fontsize = size
  1364.     end
  1365.     # テキストサイズ計算
  1366.     rect = text_size(text, fontname, fontsize)
  1367.     rect.width += 2
  1368.     # ビットマップを作成
  1369.     bitmap = Bitmap.new(rect.width, rect.height)
  1370.     # 塗りつぶし(テスト用)
  1371.     # bitmap.fill_rect(bitmap.rect, Color.new(0,0,0,128))
  1372.     # フォント設定
  1373.     bitmap.font.name = fontname
  1374.     bitmap.font.size = fontsize
  1375.     bitmap.font.color.set(LNX11::POPUP_COLOR[color][0])
  1376.     bitmap.font.out_color.set(LNX11::POPUP_COLOR[color][1])
  1377.     # テキスト描画
  1378.     bitmap.draw_text(rect, text, 1)
  1379.     # キャッシュに保存
  1380.     @@cache_text[key] = bitmap
  1381.     # ビットマップを返す
  1382.     bitmap.clone
  1383.   end
  1384.   #--------------------------------------------------------------------------
  1385.   # ● 能力強化/弱体ビットマップの取得 <<ver1.10>>
  1386.   #--------------------------------------------------------------------------
  1387.   def get_buff_bitmap(buff_data, size)
  1388.     case size
  1389.     when :large ; src_bitmap = Cache.system(LNX11::LARGE_BUFFS_NAME)
  1390.     when :small ; src_bitmap = Cache.system(LNX11::SMALL_BUFFS_NAME)
  1391.     end
  1392.     src_rect = Rect.new
  1393.     src_rect.width  = src_bitmap.width  / 2
  1394.     src_rect.height = src_bitmap.height / 12
  1395.     src_rect.x = (buff_data[0] / 4) * src_rect.width
  1396.     src_rect.y = (buff_data[0] % 4) * src_rect.height * 3 +
  1397.                   buff_data[1] * src_rect.height
  1398.     bitmap = Bitmap.new(src_rect.width, src_rect.height)
  1399.     bitmap.blt(0, 0, src_bitmap, src_rect)
  1400.     bitmap
  1401.   end
  1402.   #--------------------------------------------------------------------------
  1403.   # ● テキストビットマップの取得 <<ver1.10>>
  1404.   #--------------------------------------------------------------------------
  1405.   def get_text_bitmap(text, color, size)
  1406.     # クリティカルカラーかつ、弱点/耐性なら参照するビットマップを変更
  1407.     if LNX11::POPUP_COLOR[color] == LNX11::POPUP_COLOR[:critical] &&
  1408.       (text == LNX11::DECORATION_NUMBER[:weakness][0] ||
  1409.        text == LNX11::DECORATION_NUMBER[:resist][0])
  1410.       # ファイル名に _critcolor を加える
  1411.       text += "_critcolor"
  1412.     end
  1413.     # MPダメージ/回復(符号なし)なら参照するビットマップを変更
  1414.     if text == LNX11::DECORATION_NUMBER[:mp_damage][0]
  1415.       # カラーに応じてファイル名を変更
  1416.       case LNX11::POPUP_COLOR[color]
  1417.       when LNX11::POPUP_COLOR[:mp_damage]   ; text += "_damage"
  1418.       when LNX11::POPUP_COLOR[:mp_recovery] ; text += "_recovery"
  1419.       end
  1420.     end
  1421.     # popup_xxxxxx_(large or small)
  1422.     Cache.system("popup" + text + (size == :large ? "_large" : "_small"))
  1423.   end
  1424. end
  1425.  
  1426. #==============================================================================
  1427. # ■ [追加]:Sprite_PopupSpring
  1428. #------------------------------------------------------------------------------
  1429. #  通常の跳ねるポップアップ。
  1430. #==============================================================================
  1431.  
  1432. class Sprite_PopupSpring < Sprite_PopupBase
  1433.   #--------------------------------------------------------------------------
  1434.   # ● ポップアップ Z 座標
  1435.   #--------------------------------------------------------------------------
  1436.   def base_z
  1437.     14
  1438.   end
  1439.   #--------------------------------------------------------------------------
  1440.   # ● 開始処理
  1441.   #--------------------------------------------------------------------------
  1442.   def start
  1443.     # 動き設定
  1444.     set_movement
  1445.     # ディレイ設定 同じタイプのポップアップが重ならないようにする
  1446.     if @popup_size == :small
  1447.       self.oy -= @battler.popup_delay[1]
  1448.       @delay_clear = (@delay == 0)
  1449.       dy = self.bitmap.height * 0.8
  1450.       @battler.popup_delay[1] += dy
  1451.       @delay = 0
  1452.     end
  1453.   end
  1454.   #--------------------------------------------------------------------------
  1455.   # ● 終了処理
  1456.   #--------------------------------------------------------------------------  
  1457.   def terminate
  1458.     # 一番上のポップアップなら、ディレイを初期化する
  1459.     @battler.popup_delay[1] = 0 if @delay_clear
  1460.   end
  1461.   #--------------------------------------------------------------------------
  1462.   # ● 投射運動の設定
  1463.   #--------------------------------------------------------------------------
  1464.   def set_movement
  1465.     if @popup_size == :large
  1466.       movement = LNX11::LARGE_MOVEMENT
  1467.     else
  1468.       movement = LNX11::SMALL_MOVEMENT
  1469.     end
  1470.     [url=home.php?mod=space&uid=287440]@fall[/url]       = -movement[:inirate]
  1471.     @gravity    =  movement[:gravity]
  1472.     @side       =  movement[:side_scatter] * rand(0) * (rand(2) == 0 ? -1 : 1)
  1473.     @ref_move   =  movement[:ref_height]
  1474.     @ref_factor =  movement[:ref_factor]
  1475.     @ref_count  =  movement[:ref_count]
  1476.     @duration   =  movement[:duration]
  1477.     @fadeout    =  movement[:fadeout]
  1478.   end
  1479.   #--------------------------------------------------------------------------
  1480.   # ● フレーム更新
  1481.   #--------------------------------------------------------------------------
  1482.   def update_popup
  1483.     update_freefall
  1484.   end
  1485.   #--------------------------------------------------------------------------
  1486.   # ● 投射運動の更新
  1487.   #--------------------------------------------------------------------------
  1488.   def update_freefall
  1489.     if @ref_count >= 0
  1490.       # X:左右移動
  1491.       @rx += @side
  1492.       # Y:自由落下
  1493.       @ry += @fall
  1494.       @ref_move -= @fall
  1495.       @fall += @gravity
  1496.       # 跳ね返り
  1497.       if @ref_move <= 0 && @fall >= 0
  1498.         @ref_count -= 1
  1499.         @fall = -@fall * @ref_factor
  1500.       end      
  1501.     end
  1502.   end
  1503. end
  1504.  
  1505. #==============================================================================
  1506. # ■ [追加]:Sprite_PopupRising
  1507. #------------------------------------------------------------------------------
  1508. #  少しずつ上昇するポップアップ。
  1509. #==============================================================================
  1510.  
  1511. class Sprite_PopupRising < Sprite_PopupBase
  1512.   #--------------------------------------------------------------------------
  1513.   # ● ポップアップ Z 座標
  1514.   #--------------------------------------------------------------------------
  1515.   def base_z
  1516.     6
  1517.   end
  1518.   #--------------------------------------------------------------------------
  1519.   # ● 開始処理
  1520.   #--------------------------------------------------------------------------
  1521.   def start
  1522.     # 動き設定
  1523.     set_movement
  1524.     self.opacity = 0
  1525.     d = self.bitmap.height * LNX11::RISE_MOVEMENT[:line_spacing]
  1526.     @delay_count = d / @rising_speed
  1527.     @battler.popup_delay[2] += @delay_count
  1528.   end
  1529.   #--------------------------------------------------------------------------
  1530.   # ● 動きの設定
  1531.   #--------------------------------------------------------------------------
  1532.   def set_movement
  1533.     @rising_speed = LNX11::RISE_MOVEMENT[:rising_speed]
  1534.     @duration = LNX11::RISE_MOVEMENT[:duration]
  1535.     @fadeout  = LNX11::RISE_MOVEMENT[:fadeout]
  1536.   end
  1537.   #--------------------------------------------------------------------------
  1538.   # ● フレーム更新
  1539.   #--------------------------------------------------------------------------
  1540.   def update_popup
  1541.     @delay_count -= 1
  1542.     @battler.popup_delay[2] -= 1 if @delay_count >= 0
  1543.     @ry -= @rising_speed # すこしずつ上昇
  1544.     self.opacity += 32 if @duration > 0
  1545.   end
  1546. end
  1547.  
  1548. #==============================================================================
  1549. # ■ [追加]:Sprite_PopupSliding
  1550. #------------------------------------------------------------------------------
  1551. #  スライド表示するポップアップ。
  1552. #==============================================================================
  1553.  
  1554. class Sprite_PopupSliding < Sprite_PopupBase
  1555.   #--------------------------------------------------------------------------
  1556.   # ● ポップアップ Z 座標
  1557.   #--------------------------------------------------------------------------
  1558.   def base_z
  1559.     8
  1560.   end
  1561.   #--------------------------------------------------------------------------
  1562.   # ● 開始処理
  1563.   #--------------------------------------------------------------------------
  1564.   def start
  1565.     # 動き設定
  1566.     set_movement
  1567.     d = self.bitmap.height * LNX11::SLIDE_MOVEMENT[:line_spacing]
  1568.     self.oy += @delay + d / 2 if @delay > 0
  1569.     self.opacity = 0
  1570.     # ディレイ設定 同じタイプのポップアップが重ならないようにする
  1571.     @delay_clear = (@delay == 0)
  1572.     @battler.popup_delay[3] += (@delay <= 0 ? d / 2 : d)
  1573.     @delay = 0
  1574.   end
  1575.   #--------------------------------------------------------------------------
  1576.   # ● 終了処理
  1577.   #--------------------------------------------------------------------------  
  1578.   def terminate
  1579.     # 一番下のポップアップなら、ディレイを初期化する
  1580.     @battler.popup_delay[3] = 0 if @delay_clear
  1581.   end
  1582.   #--------------------------------------------------------------------------
  1583.   # ● 動きの設定
  1584.   #--------------------------------------------------------------------------
  1585.   def set_movement
  1586.     @x_speed  = LNX11::SLIDE_MOVEMENT[:x_speed]
  1587.     @duration = LNX11::SLIDE_MOVEMENT[:duration]
  1588.     @fadeout  = LNX11::SLIDE_MOVEMENT[:fadeout]
  1589.     # フェードインのスライド分だけ X を移動
  1590.     @rx -= @x_speed * 255.0 / @fadeout
  1591.   end
  1592.   #--------------------------------------------------------------------------
  1593.   # ● フレーム更新
  1594.   #--------------------------------------------------------------------------
  1595.   def update_popup
  1596.     @rx += @x_speed if opacity != 255 # スライド
  1597.     self.opacity += @fadeout if @duration > 0
  1598.   end
  1599. end
  1600.  
  1601. #==============================================================================
  1602. # ■ [追加]:Sprite_PopupOverlay
  1603. #------------------------------------------------------------------------------
  1604. #  オーバーレイポップアップ。自身の複製を加算合成で重ね合わせます。
  1605. #==============================================================================
  1606.  
  1607. class Sprite_PopupOverlay < Sprite_PopupBase
  1608.   #--------------------------------------------------------------------------
  1609.   # ● ポップアップ Z 座標
  1610.   #--------------------------------------------------------------------------
  1611.   def base_z
  1612.     10
  1613.   end
  1614.   #--------------------------------------------------------------------------
  1615.   # ● 開始処理
  1616.   #--------------------------------------------------------------------------
  1617.   def start
  1618.     @duration = LNX11::OVERLAY_MOVEMENT[:duration]
  1619.     @fadeout  = LNX11::OVERLAY_MOVEMENT[:fadeout]
  1620.     # オーバーレイの作成
  1621.     create_overlay
  1622.   end
  1623.   #--------------------------------------------------------------------------
  1624.   # ● 終了処理
  1625.   #--------------------------------------------------------------------------
  1626.   def terminate
  1627.     @overlay.dispose
  1628.     @overlay = nil
  1629.   end
  1630.   #--------------------------------------------------------------------------
  1631.   # ● オーバーレイ(複製)の作成
  1632.   #--------------------------------------------------------------------------
  1633.   def create_overlay
  1634.     @overlay = Sprite.new
  1635.     @overlay.bitmap   = self.bitmap
  1636.     @overlay.viewport = self.viewport
  1637.     @overlay.ox = self.ox
  1638.     @overlay.oy = self.oy
  1639.     @overlay.visible = false
  1640.     @overlay.blend_type = 1
  1641.   end
  1642.   #--------------------------------------------------------------------------
  1643.   # ● フレーム更新
  1644.   #--------------------------------------------------------------------------
  1645.   def update_popup
  1646.     self.opacity += @fadeout * 2 if @duration > 0
  1647.   end
  1648.   #--------------------------------------------------------------------------
  1649.   # ● フレーム更新
  1650.   #--------------------------------------------------------------------------
  1651.   def update
  1652.     super
  1653.     update_overlay
  1654.   end
  1655.   #--------------------------------------------------------------------------
  1656.   # ● オーバーレイの更新
  1657.   #--------------------------------------------------------------------------
  1658.   def update_overlay
  1659.     return if self.disposed? || @overlay.opacity == 0
  1660.     @overlay.x = self.x
  1661.     @overlay.y = self.y
  1662.     @overlay.z = self.z
  1663.     # 拡大・消去
  1664.     @overlay.zoom_x += 0.16
  1665.     @overlay.zoom_y += 0.12
  1666.     @overlay.opacity -= 20
  1667.     @overlay.visible = (@overlay.opacity != 0)
  1668.   end
  1669. end
  1670.  
  1671. #==============================================================================
  1672. # ■ [追加]:Sprite_PopupLevelUp
  1673. #------------------------------------------------------------------------------
  1674. #  レベルアップのポップアップ。スライドポップアップを継承しています。
  1675. #==============================================================================
  1676.  
  1677. class Sprite_PopupLevelUp < Sprite_PopupSliding
  1678.   #--------------------------------------------------------------------------
  1679.   # ● ポップアップ Z 座標
  1680.   #--------------------------------------------------------------------------
  1681.   def base_z
  1682.     32
  1683.   end
  1684.   #--------------------------------------------------------------------------
  1685.   # ● ポップアップ位置の設定
  1686.   #--------------------------------------------------------------------------
  1687.   def set_position
  1688.     @rx = @battler.screen_x - LNX11::ACTOR_OFFSET[:x]
  1689.     case LNX11::LEVELUP_POPUP_POSITION
  1690.     when 0 ; @ry = @battler.screen_y        # 足元
  1691.     when 1 ; @ry = @battler.screen_y_center # 中心
  1692.     when 2 ; @ry = @battler.screen_y_top    # 頭上
  1693.     when 3 ; @ry = Graphics.height + LNX11::LEVELUP_POPUP_Y # Y座標統一
  1694.     end
  1695.   end
  1696.   #--------------------------------------------------------------------------
  1697.   # ● フレーム更新
  1698.   #--------------------------------------------------------------------------
  1699.   def update_popup
  1700.     super
  1701.     # リザルト中なら自動的に消去しない
  1702.     @duration += 1 if $game_troop.all_dead? || $game_message.busy?
  1703.   end
  1704. end
  1705.  
  1706. #==============================================================================
  1707. # ■ Bitmap
  1708. #==============================================================================
  1709.  
  1710. class Bitmap
  1711.   #--------------------------------------------------------------------------
  1712.   # ● [追加]:カーソル用三角形の描画
  1713.   #--------------------------------------------------------------------------
  1714.   def lnx_cursor_triangle(size, color, oy = 0, grad = 1)
  1715.     color = color.clone
  1716.     x = (self.width - size) / 2
  1717.     y = (self.height - size) / 2 + oy
  1718.     rect = Rect.new(x, y, size, 1)
  1719.     count = size / 2
  1720.     minus = 128 / count / 2
  1721.     count.times do
  1722.       clear_rect(rect)
  1723.       fill_rect(rect, color)
  1724.       color.red   = [color.red   - minus * grad, 0].max
  1725.       color.green = [color.green - minus * grad, 0].max
  1726.       color.blue  = [color.blue  - minus * grad, 0].max
  1727.       rect.y += rect.height
  1728.       clear_rect(rect)
  1729.       fill_rect(rect, color)
  1730.       color.red   = [color.red   - minus * grad, 0].max
  1731.       color.green = [color.green - minus * grad, 0].max
  1732.       color.blue  = [color.blue  - minus * grad, 0].max
  1733.       rect.x += 1
  1734.       rect.y += rect.height
  1735.       rect.width -= 2
  1736.     end
  1737.   end
  1738. end
  1739.  
  1740. #==============================================================================
  1741. # ■ [追加]:Sprite_TargetCursor
  1742. #------------------------------------------------------------------------------
  1743. #  対象選択されているバトラーや行動選択中のアクターを示すアローカーソルです。
  1744. #==============================================================================
  1745. class Sprite_TargetCursor < Sprite
  1746.   #--------------------------------------------------------------------------
  1747.   # ● クラス変数
  1748.   #--------------------------------------------------------------------------
  1749.   @@cursor_cache = nil
  1750.   #--------------------------------------------------------------------------
  1751.   # ● 公開インスタンス変数
  1752.   #--------------------------------------------------------------------------
  1753.   attr_accessor :battler     # バトラー
  1754.   attr_accessor :blink       # 点滅(対象の選択中)
  1755.   #--------------------------------------------------------------------------
  1756.   # ● オブジェクト初期化
  1757.   #--------------------------------------------------------------------------
  1758.   def initialize(viewport = nil)
  1759.     super(viewport)
  1760.     @wait = LNX11::CURSOR_ANI_SPEED
  1761.     @speed = [LNX11::CURSOR_SPEED, 1].max
  1762.     @battler = nil
  1763.     @sub_cursor = []
  1764.     @blink = false
  1765.     self.bitmap = cursor_bitmap
  1766.     partition = self.bitmap.width / self.height
  1767.     self.src_rect.set(0, 0, self.width / partition, self.height)
  1768.     self.ox = self.width / 2
  1769.     self.oy = self.height / 2
  1770.     self.x = @rx = @tx = 0
  1771.     self.y = @ry = @ty = 0
  1772.     self.z = 98
  1773.     self.visible = false
  1774.   end
  1775.   #--------------------------------------------------------------------------
  1776.   # ● 解放
  1777.   #--------------------------------------------------------------------------  
  1778.   def dispose
  1779.     dispose_subcursor
  1780.     super
  1781.   end
  1782.   #--------------------------------------------------------------------------
  1783.   # ● サブカーソル作成
  1784.   #  メンバー全体にカーソルを表示するために複数のカーソルを作成します。
  1785.   #--------------------------------------------------------------------------  
  1786.   def create_subcursor(members)
  1787.     return unless @sub_cursor.empty?
  1788.     members.each_with_index do |battler, i|
  1789.       @sub_cursor[i] = Sprite_TargetCursor.new(self.viewport)
  1790.       @sub_cursor[i].set(@rx, @ry)
  1791.       @sub_cursor[i].set(battler, true)
  1792.     end
  1793.   end
  1794.   #--------------------------------------------------------------------------
  1795.   # ● サブカーソル解放
  1796.   #--------------------------------------------------------------------------  
  1797.   def dispose_subcursor
  1798.     @sub_cursor.each {|sprite| sprite.dispose }
  1799.     @sub_cursor = []
  1800.   end
  1801.   #--------------------------------------------------------------------------
  1802.   # ● サブカーソル更新
  1803.   #--------------------------------------------------------------------------  
  1804.   def update_subcursor
  1805.     @sub_cursor.each {|sprite| sprite.update }
  1806.   end
  1807.   #--------------------------------------------------------------------------
  1808.   # ● ビットマップの設定
  1809.   #--------------------------------------------------------------------------
  1810.   def cursor_bitmap
  1811.     if !LNX11::CURSOR_NAME.empty?
  1812.       return Cache.system(LNX11::CURSOR_NAME)
  1813.     else
  1814.       # カーソルファイル名が指定されていなければRGSS側で生成
  1815.       return @@cursor_cache if @@cursor_cache && !@@cursor_cache.disposed?
  1816.       @@cursor_cache = Bitmap.new(32, 32)
  1817.       color = Color.new(0, 0, 0)
  1818.       @@cursor_cache.lnx_cursor_triangle(26, color, 2)
  1819.       2.times {@@cursor_cache.blur}
  1820.       color.set(255, 255, 255)
  1821.       @@cursor_cache.lnx_cursor_triangle(24, color, 1, 0.5)
  1822.       tone = LNX11::CURSOR_TONE ? LNX11::CURSOR_TONE : $game_system.window_tone
  1823.       r = 118 + tone.red
  1824.       g = 118 + tone.green
  1825.       b = 118 + tone.blue
  1826.       color.set(r, g, b, 232)
  1827.       @@cursor_cache.lnx_cursor_triangle(20, color,  0)
  1828.       @@cursor_cache.lnx_cursor_triangle(20, color,  1)
  1829.       p "LNX11a:カーソルビットマップを作成しました。"
  1830.       return @@cursor_cache
  1831.     end
  1832.   end
  1833.   #--------------------------------------------------------------------------
  1834.   # ● カーソルの表示
  1835.   #--------------------------------------------------------------------------
  1836.   def show
  1837.     self.x = @rx = @tx
  1838.     self.y = @ry = @ty
  1839.     self.visible = true
  1840.   end
  1841.   #--------------------------------------------------------------------------
  1842.   # ● カーソルの非表示
  1843.   #--------------------------------------------------------------------------
  1844.   def hide
  1845.     dispose_subcursor
  1846.     @battler = nil
  1847.     self.visible = false
  1848.   end
  1849.   #--------------------------------------------------------------------------
  1850.   # ● 移動平均
  1851.   #--------------------------------------------------------------------------
  1852.   def sma(a, b, p)
  1853.     # a = 目標位置 b = 現在地
  1854.     return a if a == b || (a - b).abs < 0.3 || p == 1
  1855.     result = ((a + b * (p.to_f - 1)) / p.to_f)
  1856.     return (a - result).abs <= 1.0 ? (b < a ? b + 0.3 : b - 0.3) : result
  1857.   end
  1858.   #--------------------------------------------------------------------------
  1859.   # ● フレーム更新
  1860.   #--------------------------------------------------------------------------
  1861.   def update
  1862.     update_subcursor
  1863.     self.opacity = @sub_cursor.empty? ? 255 : 0
  1864.     return if !visible || !@sub_cursor.empty?
  1865.     super
  1866.     # 点滅
  1867.     if LNX11::CURSOR_BLINK
  1868.       self.blend_type = @blink && Graphics.frame_count / 3 % 2 == 0 ? 1 : 0
  1869.     end
  1870.     # アニメーションを進める
  1871.     @wait -= 1
  1872.     if @wait <= 0
  1873.       @wait += LNX11::CURSOR_ANI_SPEED
  1874.       self.src_rect.x += self.width
  1875.       self.src_rect.x = 0 if self.src_rect.x >= self.bitmap.width
  1876.     end
  1877.     # カーソルの座標を更新
  1878.     set_xy if @battler && @sub_cursor.empty?
  1879.     self.x = @rx = sma(@tx, @rx, @speed)
  1880.     self.y = @ry = sma(@ty, @ry, @speed)
  1881.   end
  1882.   #--------------------------------------------------------------------------
  1883.   # ● カーソル位置の設定
  1884.   #--------------------------------------------------------------------------
  1885.   def set(*args)
  1886.     if args[0].is_a?(Numeric)
  1887.       # 引数一つ目が数値なら、XY指定
  1888.       @battler = nil
  1889.       set_xy(args[0], args[1])
  1890.       @blink = args[2] ? args[2] : false
  1891.     else
  1892.       # バトラーorシンボル指定
  1893.       if @battler != args[0]
  1894.         @battler = args[0]
  1895.         dispose_subcursor
  1896.         case args[0]
  1897.         when :party        ; create_subcursor($game_party.members)
  1898.         when :troop        ; create_subcursor($game_troop.alive_members)
  1899.         when :troop_random ; create_subcursor($game_troop.alive_members)
  1900.         else ; args[0] ? set_xy : hide
  1901.         end
  1902.       end
  1903.       @blink = args[1] ? args[1] : false
  1904.     end
  1905.     # スピードが1かカーソルが非表示なら表示に変える
  1906.     show if @sub_cursor.empty? && (@speed == 1 || !visible)
  1907.   end
  1908.   #--------------------------------------------------------------------------
  1909.   # ● カーソル位置をバトラーの位置に設定
  1910.   #--------------------------------------------------------------------------
  1911.   def set_xy(x = nil, y = nil)
  1912.     if x
  1913.       # 直接指定
  1914.       x += LNX11::CURSOR_OFFSET[:x]
  1915.       y += LNX11::CURSOR_OFFSET[:y]
  1916.     else
  1917.       # バトラーの座標
  1918.       x = @battler.screen_x + LNX11::CURSOR_OFFSET[:x]
  1919.       y = @battler.screen_y_top + LNX11::CURSOR_OFFSET[:y]
  1920.     end
  1921.     @tx = x
  1922.     minmax = LNX11::CURSOR_MINMAX
  1923.     @ty = [[y, minmax[:min] + self.oy].max, minmax[:max]].min
  1924.   end
  1925. end
  1926.  
  1927. #==============================================================================
  1928. # ■ [追加]:Sprite_OneLine_BattleLog
  1929. #------------------------------------------------------------------------------
  1930. #  バトルログを動的に表示するスプライトです。単体では1行しか表示できませんが、
  1931. # 複数同時に扱うことで複数行の表示を実装しています。
  1932. #==============================================================================
  1933.  
  1934. class Sprite_OneLine_BattleLog < Sprite
  1935.   @@grad_cache = nil
  1936.   #--------------------------------------------------------------------------
  1937.   # ● 公開インスタンス変数
  1938.   #--------------------------------------------------------------------------
  1939.   attr_accessor   :position # 表示位置(行)
  1940.   #--------------------------------------------------------------------------
  1941.   # ● オブジェクト初期化
  1942.   #--------------------------------------------------------------------------
  1943.   def initialize(width, height, max_line_number)
  1944.     super(nil)
  1945.     @rx = @ry = 0
  1946.     @line_height = height
  1947.     @max_line_number = max_line_number
  1948.     @position = -1
  1949.     @visible = true
  1950.     self.ox = -LNX11::STORAGE_OFFSET[:x]
  1951.     self.oy = -LNX11::STORAGE_OFFSET[:y]
  1952.     self.opacity = 0
  1953.     self.z = 96
  1954.     self.bitmap = Bitmap.new(width * 0.75, height)
  1955.   end
  1956.   #--------------------------------------------------------------------------
  1957.   # ● 解放
  1958.   #--------------------------------------------------------------------------  
  1959.   def dispose
  1960.     self.bitmap.dispose
  1961.     super
  1962.   end
  1963.   #--------------------------------------------------------------------------
  1964.   # ● スプライトの表示
  1965.   #--------------------------------------------------------------------------  
  1966.   def show
  1967.     @visible = true
  1968.   end
  1969.   #--------------------------------------------------------------------------
  1970.   # ● スプライトの非表示
  1971.   #--------------------------------------------------------------------------  
  1972.   def hide
  1973.     @visible = false
  1974.     @position = -1
  1975.   end
  1976.   #--------------------------------------------------------------------------
  1977.   # ● 表示しているか?
  1978.   #--------------------------------------------------------------------------  
  1979.   def visible?
  1980.     @visible
  1981.   end
  1982.   #--------------------------------------------------------------------------
  1983.   # ● フレーム更新
  1984.   #--------------------------------------------------------------------------
  1985.   def update
  1986.     return if self.opacity == 0
  1987.     self.opacity += @visible && @position >= 0 ? 24 : -24
  1988.     self.visible = self.opacity > 0
  1989.     return unless @visible # 不可視状態なら座標を更新しない
  1990.     @ry = (target_y + (@ry * 5)) / 6.0 if target_y < @ry
  1991.     @rx += 2 if @rx < 0
  1992.     self.x = @rx
  1993.     self.y = @ry
  1994.   end
  1995.   #--------------------------------------------------------------------------
  1996.   # ● テキストの描画
  1997.   #  自身が持つ Bitmap で描画するのではなく、Window の contents から
  1998.   # コピーします(Sprite からでは Window_Base#draw_text_ex が扱えないため)。
  1999.   #--------------------------------------------------------------------------
  2000.   def set_text(window, position)
  2001.     self.bitmap.clear
  2002.     # 横グラデーション
  2003.     if @@grad_cache && !@@grad_cache.disposed?
  2004.       self.bitmap.blt(0, 0, @@grad_cache, self.bitmap.rect)
  2005.     else
  2006.       color = LNX11::STORAGE_GRADIENT_COLOR
  2007.       fillrect = self.bitmap.rect
  2008.       fillrect.width /= 2
  2009.       self.bitmap.gradient_fill_rect(fillrect, color[0], color[1])
  2010.       @@grad_cache = self.bitmap.clone
  2011.     end
  2012.     # contents からコピー
  2013.     self.bitmap.blt(4, 0, window.contents, self.bitmap.rect)
  2014.     self.opacity = 1
  2015.     @rx = -8
  2016.     @position = position
  2017.     @ry = target_y
  2018.   end
  2019.   #--------------------------------------------------------------------------
  2020.   # ● 位置の繰り上げ
  2021.   #--------------------------------------------------------------------------
  2022.   def up_position
  2023.     @position -= 1
  2024.   end
  2025.   #--------------------------------------------------------------------------
  2026.   # ● メッセージが空か?(表示待ち)
  2027.   #--------------------------------------------------------------------------
  2028.   def mes_empty?
  2029.     @position < 0
  2030.   end
  2031.   #--------------------------------------------------------------------------
  2032.   # ● 移動するべき Y 座標
  2033.   #--------------------------------------------------------------------------
  2034.   def target_y
  2035.     @position * @line_height
  2036.   end
  2037. end
  2038.  
  2039. #==============================================================================
  2040. # ■ Window_BattleLog
  2041. #------------------------------------------------------------------------------
  2042. #  戦闘の進行を実況表示するウィンドウです。
  2043. #==============================================================================
  2044.  
  2045. class Window_BattleLog < Window_Selectable
  2046.   #--------------------------------------------------------------------------
  2047.   # ● [エイリアス]:オブジェクト初期化
  2048.   #--------------------------------------------------------------------------
  2049.   alias :lnx11a_initialize :initialize
  2050.   def initialize
  2051.     lnx11a_initialize
  2052.     # バトルログタイプが 1 以上なら非表示にする
  2053.     @storage_number = 0
  2054.     hide if LNX11::BATTLELOG_TYPE >= 1
  2055.     BattleManager.log_window = self
  2056.   end
  2057.   #--------------------------------------------------------------------------
  2058.   # ● [追加]:文章の配列のクリア
  2059.   #--------------------------------------------------------------------------
  2060.   def lines_clear
  2061.     @lines.clear if LNX11::BATTLELOG_TYPE == 1
  2062.   end
  2063.   #--------------------------------------------------------------------------
  2064.   # ● [追加]:指定ウェイト
  2065.   #--------------------------------------------------------------------------
  2066.   def abs_wait(wait)
  2067.     @method_wait.call(wait) if @method_wait
  2068.   end
  2069.   #--------------------------------------------------------------------------
  2070.   # ● [再定義]:メッセージ速度の取得
  2071.   #--------------------------------------------------------------------------
  2072.   def message_speed
  2073.     return 20
  2074.   end
  2075.   #--------------------------------------------------------------------------
  2076.   # ● [再定義]:エフェクト実行が終わるまでウェイト
  2077.   #--------------------------------------------------------------------------
  2078.   def wait_for_effect
  2079.     return if LNX11::BATTLELOG_TYPE > 0
  2080.     @method_wait_for_effect.call if @method_wait_for_effect
  2081.   end
  2082.   #--------------------------------------------------------------------------
  2083.   # ● [追加]:アニメーションのウェイト用メソッドの設定
  2084.   #--------------------------------------------------------------------------
  2085.   def method_wait_for_animation=(method)
  2086.     @method_wait_for_animation = method
  2087.   end
  2088.   #--------------------------------------------------------------------------
  2089.   # ● [追加]:アニメーション再生が終わるまでウェイト
  2090.   #--------------------------------------------------------------------------
  2091.   def wait_for_animation
  2092.     @method_wait_for_animation.call if @method_wait_for_animation
  2093.   end
  2094.  
  2095.   #--------------------------------------------------------------------------
  2096.   # ● [エイリアス]:ウィンドウ高さの取得
  2097.   #--------------------------------------------------------------------------
  2098.   alias :lnx11a_window_height :window_height
  2099.   def window_height
  2100.     LNX11::BATTLELOG_TYPE == 1 ? fitting_height(1) : lnx11a_window_height
  2101.   end
  2102.   #--------------------------------------------------------------------------
  2103.   # ● [エイリアス]:最大行数の取得
  2104.   #--------------------------------------------------------------------------
  2105.   alias :lnx11a_max_line_number :max_line_number
  2106.   def max_line_number
  2107.     num = LNX11::STORAGE_LINE_NUMBER
  2108.     LNX11::BATTLELOG_TYPE == 1 ? num : lnx11a_max_line_number
  2109.   end
  2110.   #--------------------------------------------------------------------------
  2111.   # ● [オーバーライド]:行の高さを取得
  2112.   #--------------------------------------------------------------------------
  2113.   def line_height
  2114.     LNX11::BATTLELOG_TYPE == 1 ? LNX11::STORAGE_LINE_HEIGHT : super
  2115.   end
  2116.   #--------------------------------------------------------------------------
  2117.   # ● [オーバーライド]:フォント設定のリセット
  2118.   #--------------------------------------------------------------------------
  2119.   def reset_font_settings
  2120.     super
  2121.     return unless LNX11::BATTLELOG_TYPE == 1
  2122.     contents.font.size = LNX11::STORAGE_FONT[:size]
  2123.     contents.font.out_color.set(LNX11::STORAGE_FONT[:out_color])
  2124.   end
  2125.   #--------------------------------------------------------------------------
  2126.   # ● [エイリアス]:データ行数の取得
  2127.   #--------------------------------------------------------------------------
  2128.   alias :lnx11a_line_number :line_number
  2129.   def line_number
  2130.     return 0 if LNX11::BATTLELOG_TYPE == 2
  2131.     LNX11::BATTLELOG_TYPE == 1 ? @storage_number : lnx11a_line_number
  2132.   end
  2133.   #--------------------------------------------------------------------------
  2134.   # ● [再定義]:背景スプライトの作成
  2135.   #--------------------------------------------------------------------------
  2136.   alias :lnx11a_create_back_sprite :create_back_sprite
  2137.   def create_back_sprite
  2138.     if LNX11::BATTLELOG_TYPE == 1
  2139.       # 蓄積型
  2140.       create_message_sprite
  2141.     else
  2142.       # 背景
  2143.       lnx11a_create_back_sprite
  2144.     end
  2145.   end
  2146.   #--------------------------------------------------------------------------
  2147.   # ● [再定義]:背景スプライトの解放
  2148.   #--------------------------------------------------------------------------
  2149.   alias :lnx11a_dispose_back_sprite :dispose_back_sprite
  2150.   def dispose_back_sprite
  2151.     if LNX11::BATTLELOG_TYPE == 1
  2152.       # 蓄積型
  2153.       dispose_message_sprite
  2154.     else
  2155.       # 背景
  2156.       lnx11a_dispose_back_sprite
  2157.     end
  2158.   end
  2159.   #--------------------------------------------------------------------------
  2160.   # ● [追加]:メッセージスプライトの作成
  2161.   #--------------------------------------------------------------------------
  2162.   def create_message_sprite
  2163.     # メッセージスプライト 行数分だけ作成する
  2164.     @mes_position = 0 # 次にメッセージを表示させる位置
  2165.     @mesup_count = LNX11::STORAGE_UP_MESSAGE_TIME # ログが進行するまでの時間
  2166.     @mes_sprites = Array.new(max_line_number + 1) {
  2167.     Sprite_OneLine_BattleLog.new(self.width, line_height, max_line_number)}
  2168.   end
  2169.   #--------------------------------------------------------------------------
  2170.   # ● [追加]:メッセージスプライトの解放
  2171.   #--------------------------------------------------------------------------
  2172.   def dispose_message_sprite
  2173.     @mes_sprites.each {|sprite| sprite.dispose }
  2174.   end
  2175.   #--------------------------------------------------------------------------
  2176.   # ● [追加]:メッセージスプライトを表示
  2177.   #--------------------------------------------------------------------------
  2178.   def show_message_sprite
  2179.     @mes_sprites.each {|sprite| sprite.show }
  2180.   end
  2181.   #--------------------------------------------------------------------------
  2182.   # ● [追加]:メッセージスプライトを非表示
  2183.   #--------------------------------------------------------------------------
  2184.   def hide_message_sprite
  2185.     @mes_sprites.each {|sprite| sprite.hide }
  2186.     @mes_position = 0
  2187.   end
  2188.   #--------------------------------------------------------------------------
  2189.   # ● [追加]:メッセージスプライトを一つ進める
  2190.   #--------------------------------------------------------------------------
  2191.   def up_message_sprite
  2192.     @mes_sprites.each {|sprite| sprite.up_position }
  2193.   end
  2194.   #--------------------------------------------------------------------------
  2195.   # ● [追加]:空のメッセージスプライトを返す
  2196.   #--------------------------------------------------------------------------
  2197.   def empty_message_sprite
  2198.     @mes_sprites.each {|sprite| return sprite if sprite.mes_empty? }
  2199.     @mes_sprites[0]
  2200.   end
  2201.   #--------------------------------------------------------------------------
  2202.   # ● [追加]:メッセージスプライトの更新
  2203.   #--------------------------------------------------------------------------
  2204.   def update_message_sprite
  2205.     # バトルログ消去フラグが有効
  2206.     if $game_temp.battlelog_clear
  2207.       $game_temp.battlelog_clear = false
  2208.       # スプライトが表示されていれば非表示にする
  2209.       if @mes_sprites[0].visible?
  2210.         hide_message_sprite
  2211.         lines_clear
  2212.       end
  2213.     end
  2214.     # ログの自動進行
  2215.     @mesup_count -= 1
  2216.     if @mesup_count <= 0 && @mes_position > 0
  2217.       up_message_sprite
  2218.       @mes_position -= 1
  2219.       @mesup_count = LNX11::STORAGE_UP_MESSAGE_TIME
  2220.     end
  2221.     @mes_sprites.each {|sprite| sprite.update }
  2222.   end
  2223.   #--------------------------------------------------------------------------
  2224.   # ● [追加]:メッセージスプライトのリフレッシュ
  2225.   #--------------------------------------------------------------------------
  2226.   def refresh_message_sprite
  2227.     # 文章が無ければ何もしない
  2228.     return if @lines.empty?
  2229.     # スプライトを表示する
  2230.     show_message_sprite unless @mes_sprites[0].visible?
  2231.     # 文章の描画
  2232.     contents.clear
  2233.     @lines[0] = last_text
  2234.     return if @lines[0].empty?
  2235.     draw_line(0)
  2236.     @storage_number += 1
  2237.     # ウィンドウの内容をスプライトにコピー
  2238.     empty_message_sprite.set_text(self, @mes_position)
  2239.     # スプライト位置の変動   
  2240.     if @mes_position < max_line_number
  2241.       @mes_position += 1
  2242.     elsif @mesup_count > 0
  2243.       up_message_sprite
  2244.     end
  2245.     @mesup_count = (LNX11::STORAGE_UP_MESSAGE_TIME * 1.5).truncate
  2246.   end  
  2247.   #--------------------------------------------------------------------------
  2248.   # ● [オーバーライド]:フレーム更新
  2249.   #--------------------------------------------------------------------------
  2250.   def update
  2251.     super
  2252.     update_message_sprite if LNX11::BATTLELOG_TYPE == 1
  2253.   end
  2254.   #--------------------------------------------------------------------------
  2255.   # ● [エイリアス]:リフレッシュ
  2256.   #--------------------------------------------------------------------------
  2257.   alias :lnx11a_refresh :refresh
  2258.   def refresh
  2259.     return if LNX11::BATTLELOG_TYPE == 2
  2260.     LNX11::BATTLELOG_TYPE == 1 ? refresh_message_sprite : lnx11a_refresh
  2261.   end
  2262.   #--------------------------------------------------------------------------
  2263.   # ● [エイリアス]:クリア
  2264.   #--------------------------------------------------------------------------
  2265.   alias :lnx11a_clear :clear
  2266.   def clear
  2267.     return if LNX11::BATTLELOG_TYPE == 2
  2268.     LNX11::BATTLELOG_TYPE == 1 ? @storage_number = 0 : lnx11a_clear
  2269.   end
  2270.   #--------------------------------------------------------------------------
  2271.   # ● [エイリアス]:一行戻る
  2272.   #--------------------------------------------------------------------------
  2273.   alias :lnx11a_back_one :back_one
  2274.   def back_one
  2275.     if LNX11::BATTLELOG_TYPE == 1
  2276.       # 蓄積型
  2277.       @storage_number = [@storage_number - 1, 0].max
  2278.     else
  2279.       # 通常
  2280.       lnx11a_back_one
  2281.     end
  2282.   end
  2283.   #--------------------------------------------------------------------------
  2284.   # ● [エイリアス]:指定した行に戻る
  2285.   #--------------------------------------------------------------------------
  2286.   alias :lnx11a_back_to :back_to
  2287.   def back_to(line_number)
  2288.     if LNX11::BATTLELOG_TYPE == 1
  2289.       # 蓄積型
  2290.       @storage_number -= 1 while @storage_number > line_number
  2291.     else
  2292.       # 通常
  2293.       lnx11a_back_to(line_number)
  2294.     end
  2295.   end
  2296.   #--------------------------------------------------------------------------
  2297.   # ● [エイリアス]:ウェイト
  2298.   #--------------------------------------------------------------------------
  2299.   alias :lnx11a_wait :wait
  2300.   def wait
  2301.     return if LNX11::BATTLELOG_TYPE == 2
  2302.     # 元のメソッドを呼ぶ
  2303.     lnx11a_wait
  2304.   end
  2305.   #--------------------------------------------------------------------------
  2306.   # ● [エイリアス]:スキル/アイテム使用の表示
  2307.   #  使用時アニメーションの処理を追加します。
  2308.   #--------------------------------------------------------------------------
  2309.   alias :lnx11a_display_use_item :display_use_item
  2310.   def display_use_item(subject, item)
  2311.     if item.use_animation > 0
  2312.       # 使用時アニメーションが設定されていれば再生
  2313.       subject.animation_id = item.use_animation
  2314.       subject.animation_mirror = false
  2315.     end
  2316.     # 元のメソッドを呼ぶ
  2317.     lnx11a_display_use_item(subject, item)
  2318.     # アニメーションのウェイト
  2319.     wait_for_animation if item.use_animation > 0
  2320.   end
  2321.   #--------------------------------------------------------------------------
  2322.   # ● [追加]:ポップアップデータの取得
  2323.   #--------------------------------------------------------------------------
  2324.   def popup_data
  2325.     $game_temp.popup_data
  2326.   end
  2327.   #--------------------------------------------------------------------------
  2328.   # ● [エイリアス]:反撃の表示
  2329.   #--------------------------------------------------------------------------
  2330.   alias :lnx11a_display_counter :display_counter
  2331.   def display_counter(target, item)
  2332.     # ポップアップ
  2333.     popup_data.popup_text(target, :counter)
  2334.     # 元のメソッドを呼ぶ
  2335.     lnx11a_display_counter(target, item)
  2336.     # ポップアップウェイト
  2337.     popup_data.add_wait
  2338.   end
  2339.   #--------------------------------------------------------------------------
  2340.   # ● [エイリアス]:反射の表示
  2341.   #--------------------------------------------------------------------------
  2342.   alias :lnx11a_display_reflection :display_reflection
  2343.   def display_reflection(target, item)
  2344.     # ポップアップ
  2345.     popup_data.popup_text(target, :reflection)
  2346.     # 元のメソッドを呼ぶ
  2347.     lnx11a_display_reflection(target, item)
  2348.     # ポップアップウェイト
  2349.     popup_data.add_wait
  2350.   end
  2351.   #--------------------------------------------------------------------------
  2352.   # ● [エイリアス]:身代わりの表示
  2353.   #--------------------------------------------------------------------------
  2354.   alias :lnx11a_display_substitute :display_substitute
  2355.   def display_substitute(substitute, target)
  2356.     # ポップアップ
  2357.     popup_data.popup_text(substitute, :substitute)
  2358.     # 元のメソッドを呼ぶ
  2359.     lnx11a_display_substitute(substitute, target)
  2360.     # ポップアップウェイト
  2361.     popup_data.add_wait
  2362.   end
  2363.   #--------------------------------------------------------------------------
  2364.   # ● [エイリアス]:失敗の表示
  2365.   #--------------------------------------------------------------------------
  2366.   alias :lnx11a_display_failure :display_failure
  2367.   def display_failure(target, item)
  2368.     if target.result.hit? && !target.result.success
  2369.       # ポップアップ (ミスと同じ扱いにする)
  2370.       popup_data.popup_miss(target, item)
  2371.     end
  2372.     # 元のメソッドを呼ぶ
  2373.     lnx11a_display_failure(target, item)
  2374.     # ポップアップウェイト
  2375.     popup_data.add_wait
  2376.   end
  2377.   #--------------------------------------------------------------------------
  2378.   # ● [エイリアス]:ミスの表示
  2379.   #--------------------------------------------------------------------------
  2380.   alias :lnx11a_display_miss :display_miss
  2381.   def display_miss(target, item)
  2382.     # ポップアップ
  2383.     popup_data.popup_miss(target, item)
  2384.     # 元のメソッドを呼ぶ   
  2385.     lnx11a_display_miss(target, item)
  2386.     # ポップアップウェイト
  2387.     popup_data.add_wait
  2388.   end
  2389.   #--------------------------------------------------------------------------
  2390.   # ● [エイリアス]:回避の表示
  2391.   #--------------------------------------------------------------------------
  2392.   alias :lnx11a_display_evasion :display_evasion
  2393.   def display_evasion(target, item)
  2394.     # ポップアップ (ミスと同じ扱いにする)
  2395.     popup_data.popup_miss(target, item)
  2396.     # 元のメソッドを呼ぶ   
  2397.     lnx11a_display_evasion(target, item)
  2398.     # ポップアップウェイト
  2399.     popup_data.add_wait
  2400.   end
  2401.   #--------------------------------------------------------------------------
  2402.   # ● [エイリアス]:HP ダメージ表示
  2403.   #--------------------------------------------------------------------------
  2404.   alias :lnx11a_display_hp_damage :display_hp_damage
  2405.   def display_hp_damage(target, item)
  2406.     # ポップアップ
  2407.     popup_data.popup_hp_damage(target, item)
  2408.     # 元のメソッドを呼ぶ
  2409.     lnx11a_display_hp_damage(target, item)
  2410.     # ポップアップウェイト
  2411.     popup_data.add_wait
  2412.   end
  2413.   #--------------------------------------------------------------------------
  2414.   # ● [エイリアス]:MP ダメージ表示
  2415.   #--------------------------------------------------------------------------
  2416.   alias :lnx11a_display_mp_damage :display_mp_damage
  2417.   def display_mp_damage(target, item)
  2418.     # ポップアップ
  2419.     popup_data.popup_mp_damage(target, item)
  2420.     # 元のメソッドを呼ぶ
  2421.     lnx11a_display_mp_damage(target, item)
  2422.     # ポップアップウェイト
  2423.     popup_data.add_wait
  2424.   end
  2425.   #--------------------------------------------------------------------------
  2426.   # ● [エイリアス]:TP ダメージ表示
  2427.   #--------------------------------------------------------------------------
  2428.   alias :lnx11a_display_tp_damage :display_tp_damage
  2429.   def display_tp_damage(target, item)
  2430.     # ポップアップ
  2431.     popup_data.popup_tp_damage(target, item)
  2432.     # 元のメソッドを呼ぶ
  2433.     lnx11a_display_tp_damage(target, item)
  2434.     # ポップアップウェイト
  2435.     popup_data.add_wait
  2436.   end
  2437.   #--------------------------------------------------------------------------
  2438.   # ● [エイリアス]:ステート付加の表示
  2439.   #--------------------------------------------------------------------------
  2440.   alias :lnx11a_display_added_states :display_added_states
  2441.   def display_added_states(target)
  2442.     # ポップアップ
  2443.     popup_data.popup_added_states(target)
  2444.     # 元のメソッドを呼ぶ
  2445.     lnx11a_display_added_states(target)
  2446.   end
  2447.   #--------------------------------------------------------------------------
  2448.   # ● [エイリアス]:ステート解除の表示
  2449.   #--------------------------------------------------------------------------
  2450.   alias :lnx11a_display_removed_states :display_removed_states
  2451.   def display_removed_states(target)
  2452.     # ポップアップ
  2453.     popup_data.popup_removed_states(target)
  2454.     # 元のメソッドを呼ぶ
  2455.     lnx11a_display_removed_states(target)
  2456.   end
  2457.   #--------------------------------------------------------------------------
  2458.   # ● [エイリアス]:能力強化/弱体の表示(個別)
  2459.   #--------------------------------------------------------------------------
  2460.   alias :lnx11a_display_buffs :display_buffs
  2461.   def display_buffs(target, buffs, fmt)
  2462.     # ポップアップ
  2463.     popup_data.popup_buffs(target, buffs, fmt)
  2464.     # 元のメソッドを呼ぶ
  2465.     lnx11a_display_buffs(target, buffs, fmt)
  2466.   end
  2467. end
  2468.  
  2469. #==============================================================================
  2470. # ■ RPG::BaseItem
  2471. #------------------------------------------------------------------------------
  2472. #  アクター、職業、スキル、アイテム、武器、防具、敵キャラ、およびステートの
  2473. # スーパークラス。
  2474. #==============================================================================
  2475.  
  2476. class RPG::BaseItem  
  2477.   #--------------------------------------------------------------------------
  2478.   # ● [追加]:バトラーグラフィックファイル名を取得
  2479.   #--------------------------------------------------------------------------
  2480.   def default_battler_graphic
  2481.     # キャッシュがある場合、それを返す
  2482.     return @default_battler_graphic if @default_battler_graphic
  2483.     # メモ取得
  2484.     re = LNX11::RE_BATTLER =~ note
  2485.     @default_battler_graphic = re ? $1 : ""
  2486.   end
  2487.   #--------------------------------------------------------------------------
  2488.   # ● [追加]:敵キャラの通常攻撃アニメの取得
  2489.   #--------------------------------------------------------------------------
  2490.   def atk_animation
  2491.     # キャッシュがある場合、それを返す
  2492.     return @atk_animation if @atk_animation
  2493.     # メモ取得
  2494.     re = LNX11::RE_ATK_ANIMATION =~ note
  2495.     @atk_animation = re ? $1.to_i : 0 #1
  2496.   end
  2497. end
  2498.  
  2499. #==============================================================================
  2500. # ■ RPG::UsableItem
  2501. #------------------------------------------------------------------------------
  2502. #  スキルとアイテムのスーパークラス。
  2503. #==============================================================================
  2504. class RPG::UsableItem < RPG::BaseItem
  2505.   #--------------------------------------------------------------------------
  2506.   # ● [エイリアス]:対象の選択操作が必要か否かを取得
  2507.   #--------------------------------------------------------------------------
  2508.   alias :lnx11a_need_selection? :need_selection?
  2509.   def need_selection?
  2510.     LNX11::FIX_TARGET_CHECKE && scope > 0 ? true : lnx11a_need_selection?
  2511.   end
  2512.   #--------------------------------------------------------------------------
  2513.   # ● [追加]:使用時アニメの取得
  2514.   #--------------------------------------------------------------------------
  2515.   def use_animation
  2516.     # キャッシュがある場合、それを返す
  2517.     return @use_animation if @use_animation
  2518.     # メモ取得
  2519.     re = LNX11::RE_USE_ANIMATION =~ note
  2520.     @use_animation = re ? $1.to_i : 0
  2521.   end
  2522.   #--------------------------------------------------------------------------
  2523.   # ● [追加]:簡易ヘルプ非表示の取得
  2524.   #--------------------------------------------------------------------------
  2525.   def no_display
  2526.     # キャッシュがある場合、それを返す
  2527.     return @no_display if @no_display
  2528.     # メモ取得
  2529.     re = LNX11::RE_USABLEITEM_NO_DISPLAY =~ note
  2530.     @no_display = re ? true : false
  2531.   end
  2532.   #--------------------------------------------------------------------------
  2533.   # ● [追加]:使用時追加ウェイトの取得
  2534.   #--------------------------------------------------------------------------
  2535.   def display_wait
  2536.     # キャッシュがある場合、それを返す
  2537.     return @display_wait if @display_wait
  2538.     # メモ取得
  2539.     re = LNX11::RE_DISPLAY_WAIT =~ note
  2540.     @display_wait = re ? $1.to_i : LNX11::HELPDISPLAT_WAIT
  2541.   end
  2542.   #--------------------------------------------------------------------------
  2543.   # ● [追加]:終了時追加ウェイトの取得
  2544.   #--------------------------------------------------------------------------
  2545.   def end_wait
  2546.     # キャッシュがある場合、それを返す
  2547.     return @end_wait if @end_wait
  2548.     # メモ取得
  2549.     re = LNX11::RE_END_WAIT =~ note
  2550.     @end_wait = re ? $1.to_i : LNX11::HELPDISPLAT_END_WAIT
  2551.   end
  2552.   #--------------------------------------------------------------------------
  2553.   # ● [追加]:簡易ヘルプ説明を取得
  2554.   #--------------------------------------------------------------------------
  2555.   def short_description
  2556.     # キャッシュがある場合、それを返す
  2557.     return @short_description if @short_description
  2558.     # メモ取得
  2559.     re = LNX11::RE_SHORT_DESCRIPTION =~ note
  2560.     @short_description = re ? $1 : ""
  2561.   end
  2562. end
  2563.  
  2564. #==============================================================================
  2565. # ■ RPG::State
  2566. #------------------------------------------------------------------------------
  2567. #  ステートのデータクラス。
  2568. #==============================================================================
  2569.  
  2570. class RPG::State < RPG::BaseItem
  2571.   #--------------------------------------------------------------------------
  2572.   # ● [追加]:ステートアニメの取得
  2573.   #--------------------------------------------------------------------------
  2574.   def state_animation
  2575.     # キャッシュがある場合、それを返す
  2576.     return @state_animation if @state_animation
  2577.     # メモ取得
  2578.     re = LNX11::RE_STATE_ANIMATION =~ note
  2579.     @state_animation = re ? $1.to_i : 0
  2580.   end
  2581.   #--------------------------------------------------------------------------
  2582.   # ● [追加]:ポップアップ表示名の取得
  2583.   # <<ver1.10>>
  2584.   #  このメソッドは付加/解除ポップアップ表示名が設定されていない場合のみ
  2585.   # 呼び出されるようになりました。
  2586.   #--------------------------------------------------------------------------
  2587.   def display_name
  2588.     # キャッシュがある場合、それを返す
  2589.     return @display_name if @display_name
  2590.     # メモ取得
  2591.     re = LNX11::RE_STATE_DISPLAY =~ note
  2592.     @display_name = re ? $1 : name
  2593.   end
  2594.   #--------------------------------------------------------------------------
  2595.   # ● [追加]:付加ポップアップ表示名の取得 <<ver1.10>>
  2596.   #--------------------------------------------------------------------------
  2597.   def add_display_name
  2598.     # キャッシュがある場合、それを返す
  2599.     return @add_display_name if @add_display_name
  2600.     # メモ取得
  2601.     re = LNX11::RE_STATE_ADD_DISPLAY =~ note
  2602.     @add_display_name = re ? $1 : display_name
  2603.   end
  2604.   #--------------------------------------------------------------------------
  2605.   # ● [追加]:解除ポップアップ表示名の取得 <<ver1.10>>
  2606.   #--------------------------------------------------------------------------
  2607.   def remove_display_name
  2608.     # キャッシュがある場合、それを返す
  2609.     return @remove_display_name if @remove_display_name
  2610.     # メモ取得
  2611.     re = LNX11::RE_STATE_REM_DISPLAY =~ note
  2612.     @remove_display_name = re ? $1 : display_name
  2613.   end
  2614.   #--------------------------------------------------------------------------
  2615.   # ● [追加]:ポップアップ非表示の取得
  2616.   #--------------------------------------------------------------------------
  2617.   def no_display?
  2618.     # キャッシュがある場合、それを返す
  2619.     return @no_display if @no_display
  2620.     # 付加/解除のどちらかで設定されていれば無視する
  2621.     if LNX11::RE_STATE_ADD_NO_DISPLAY =~ note ||
  2622.        LNX11::RE_STATE_REM_NO_DISPLAY =~ note
  2623.       return @no_display = false
  2624.     end
  2625.     # メモ取得
  2626.     re = LNX11::RE_STATE_NO_DISPLAY =~ note
  2627.     @no_display = re ? true : false
  2628.   end
  2629.   #--------------------------------------------------------------------------
  2630.   # ● [追加]:付加ポップアップ非表示の取得
  2631.   #--------------------------------------------------------------------------
  2632.   def add_no_display?
  2633.     return true if no_display?
  2634.     # キャッシュがある場合、それを返す
  2635.     return @add_no_display if @add_no_display
  2636.     # メモ取得
  2637.     re = LNX11::RE_STATE_ADD_NO_DISPLAY =~ note
  2638.     @add_no_display = re ? true : false
  2639.   end
  2640.   #--------------------------------------------------------------------------
  2641.   # ● [追加]:解除ポップアップ非表示の取得
  2642.   #--------------------------------------------------------------------------
  2643.   def remove_no_display?
  2644.     return true if no_display?
  2645.     # キャッシュがある場合、それを返す
  2646.     return @remove_no_display if @remove_no_display
  2647.     # メモ取得
  2648.     re = LNX11::RE_STATE_REM_NO_DISPLAY =~ note
  2649.     @remove_no_display = re ? true : false
  2650.   end
  2651.   #--------------------------------------------------------------------------
  2652.   # ● [追加]:有利なステートの取得
  2653.   #--------------------------------------------------------------------------
  2654.   def advantage?
  2655.     # キャッシュがある場合、それを返す
  2656.     return @advantage if @advantage
  2657.     # メモ取得
  2658.     re = LNX11::RE_STATE_ADVANTAGE =~ note
  2659.     @advantage = re ? true : false
  2660.   end
  2661.   #--------------------------------------------------------------------------
  2662.   # ● [追加]:ポップアップタイプの取得
  2663.   #--------------------------------------------------------------------------
  2664.   def popup_type
  2665.     # キャッシュがある場合、それを返す
  2666.     return @popup_type if @popup_type != nil
  2667.     # 付加/解除のどちらかで設定されていれば無視する
  2668.     if LNX11::RE_STATE_ADD_TYPE =~ note ||
  2669.        LNX11::RE_STATE_REM_TYPE =~ note
  2670.       return @popup_type = false
  2671.     end
  2672.     # メモ取得
  2673.     re = LNX11::RE_STATE_TYPE =~ note
  2674.     @popup_type = re ? $1.to_i : false
  2675.   end
  2676.   #--------------------------------------------------------------------------
  2677.   # ● [追加]:付加ポップアップタイプの取得
  2678.   #--------------------------------------------------------------------------
  2679.   def add_popup_type
  2680.     return popup_type if popup_type
  2681.     # キャッシュがある場合、それを返す
  2682.     return @add_popup_type if @add_popup_type != nil
  2683.     # メモ取得
  2684.     re = LNX11::RE_STATE_ADD_TYPE =~ note
  2685.     @add_popup_type = re ? $1.to_i : false
  2686.   end
  2687.   #--------------------------------------------------------------------------
  2688.   # ● [追加]:解除ポップアップタイプの取得
  2689.   #--------------------------------------------------------------------------
  2690.   def remove_popup_type
  2691.     return popup_type if popup_type
  2692.     # キャッシュがある場合、それを返す
  2693.     return @remove_popup_type if @remove_popup_type != nil
  2694.     # メモ取得
  2695.     re = LNX11::RE_STATE_REM_TYPE =~ note
  2696.     @remove_popup_type = re ? $1.to_i : false
  2697.   end
  2698.   #--------------------------------------------------------------------------
  2699.   # ● [追加]:修飾文字非表示の取得
  2700.   #--------------------------------------------------------------------------
  2701.   def no_decoration?
  2702.     # キャッシュがある場合、それを返す
  2703.     return @no_decoration if @no_decoration
  2704.     # 付加/解除のどちらかで設定されていれば無視する
  2705.     if LNX11::RE_STATE_ADD_NO_DECORATION =~ note ||
  2706.        LNX11::RE_STATE_REM_NO_DECORATION =~ note
  2707.       return @no_decoration = false
  2708.     end
  2709.     # メモ取得
  2710.     re = LNX11::RE_STATE_NO_DECORATION =~ note
  2711.     @no_decoration = re ? true : false
  2712.   end
  2713.   #--------------------------------------------------------------------------
  2714.   # ● [追加]:付加修飾文字非表示の取得
  2715.   #--------------------------------------------------------------------------
  2716.   def add_no_decoration?
  2717.     return true if no_decoration?
  2718.     # キャッシュがある場合、それを返す
  2719.     return @add_no_decoration if @add_no_decoration
  2720.     # メモ取得
  2721.     re = LNX11::RE_STATE_ADD_NO_DECORATION =~ note
  2722.     @add_no_decoration = re ? true : false
  2723.   end
  2724.   #--------------------------------------------------------------------------
  2725.   # ● [追加]:解除修飾文字非表示の取得
  2726.   #--------------------------------------------------------------------------
  2727.   def remove_no_decoration?
  2728.     return true if no_decoration?
  2729.     # キャッシュがある場合、それを返す
  2730.     return @remove_no_decoration if @remove_no_decoration
  2731.     # メモ取得
  2732.     re = LNX11::RE_STATE_REM_NO_DECORATION =~ note
  2733.     @remove_no_decoration = re ? true : false
  2734.   end
  2735. end
  2736.  
  2737. #==============================================================================
  2738. # ■ BattleManager
  2739. #------------------------------------------------------------------------------
  2740. #  戦闘の進行を管理するモジュールです。
  2741. #==============================================================================
  2742.  
  2743. class << BattleManager
  2744.   #--------------------------------------------------------------------------
  2745.   # ● [追加]:公開インスタンス変数
  2746.   #--------------------------------------------------------------------------
  2747.   attr_reader   :preemptive             # 先制攻撃フラグ
  2748.   attr_reader   :surprise               # 不意打ちフラグ
  2749.   attr_accessor :log_window             # バトルログウィンドウ
  2750.   attr_accessor :update_for_wait_method # ウェイト中のフレーム更新
  2751.   attr_accessor :helpdisplay_set_method        # 簡易ヘルプ表示
  2752.   attr_accessor :helpdisplay_clear_method      # 簡易ヘルプ消去
  2753.   attr_accessor :helpdisplay_wait_short_method # 簡易ヘルプ・短時間ウェイト
  2754.   #--------------------------------------------------------------------------
  2755.   # ● [追加]:簡易ヘルプ表示
  2756.   #--------------------------------------------------------------------------
  2757.   def helpdisplay_set(*args)
  2758.     @helpdisplay_set_method.call(*args) if @helpdisplay_set_method
  2759.   end
  2760.   #--------------------------------------------------------------------------
  2761.   # ● [追加]:簡易ヘルプ消去
  2762.   #--------------------------------------------------------------------------
  2763.   def helpdisplay_clear(*args)
  2764.     @helpdisplay_clear_method.call(*args) if @helpdisplay_clear_method
  2765.   end
  2766.   #--------------------------------------------------------------------------
  2767.   # ● [追加]:簡易ヘルプ・短時間ウェイト
  2768.   #--------------------------------------------------------------------------
  2769.   def helpdisplay_wait_short
  2770.     @helpdisplay_wait_short_method.call if @helpdisplay_wait_short_method
  2771.   end
  2772.   #--------------------------------------------------------------------------
  2773.   # ● [追加]:キー入力待ち
  2774.   #--------------------------------------------------------------------------
  2775.   def helpdisplay_wait_input
  2776.     return if $game_message.helpdisplay_texts.empty?
  2777.     return if LNX11::MESSAGE_TYPE == 0
  2778.     return if !@helpdisplay_wait_input || !@update_for_wait_method
  2779.     update_for_wait_method.call while !Input.press?(:B) && !Input.press?(:C)
  2780.   end
  2781.   #--------------------------------------------------------------------------
  2782.   # ● [追加]:メッセージ進行の SE 再生
  2783.   #--------------------------------------------------------------------------
  2784.   def messagedisplay_se_play
  2785.     return if !@helpdisplay_se
  2786.     @helpdisplay_se.play  
  2787.     @helpdisplay_se = nil if @helpdisplay_se == LNX11::LEVELUP_SE
  2788.   end
  2789.   #--------------------------------------------------------------------------
  2790.   # ● [追加]:メッセージ進行
  2791.   #--------------------------------------------------------------------------
  2792.   def process_messagedisplay(wait)
  2793.     return if $game_message.helpdisplay_texts.empty?
  2794.     return if LNX11::MESSAGE_TYPE == 0
  2795.     $game_temp.battlelog_clear = true
  2796.     BattleManager.log_window.update
  2797.     if LNX11::BATTLELOG_TYPE == 2 || LNX11::MESSAGE_TYPE == 2
  2798.       # 簡易ヘルプ
  2799.       $game_message.helpdisplay_texts.each do |text|
  2800.         helpdisplay_wait_short
  2801.         messagedisplay_se_play
  2802.         helpdisplay_set(text, wait)
  2803.         helpdisplay_wait_input
  2804.       end
  2805.       helpdisplay_clear
  2806.     elsif LNX11::BATTLELOG_TYPE == 0
  2807.       # VXAceデフォルト
  2808.       BattleManager.log_window.clear
  2809.       $game_message.helpdisplay_texts.each do |text|
  2810.         messagedisplay_se_play
  2811.         BattleManager.log_window.add_text(text)
  2812.         BattleManager.log_window.abs_wait(wait)
  2813.         helpdisplay_wait_input
  2814.         max = BattleManager.log_window.max_line_number
  2815.         # 表示がいっぱいになったら消去
  2816.         if BattleManager.log_window.line_number >= max
  2817.           BattleManager.log_window.clear
  2818.         end
  2819.       end
  2820.       BattleManager.log_window.clear
  2821.     elsif LNX11::BATTLELOG_TYPE == 1
  2822.       # 蓄積型
  2823.       $game_message.helpdisplay_texts.each do |text|
  2824.         messagedisplay_se_play
  2825.         BattleManager.log_window.add_text(text)
  2826.         BattleManager.log_window.abs_wait(wait)
  2827.         helpdisplay_wait_input
  2828.       end
  2829.       $game_temp.battlelog_clear = true
  2830.       BattleManager.log_window.update
  2831.     end
  2832.     $game_message.helpdisplay_texts.clear
  2833.   end
  2834.   #--------------------------------------------------------------------------
  2835.   # ● [エイリアス]:メッセージ表示が終わるまでウェイト
  2836.   #--------------------------------------------------------------------------
  2837.   alias :lnx11a_wait_for_message :wait_for_message
  2838.   def wait_for_message
  2839.     # 簡易ヘルプ表示
  2840.     process_messagedisplay(@helpdisplay_wait ? @helpdisplay_wait : 60)
  2841.     return if $game_message.texts.empty?
  2842.     # 元のメソッドを呼ぶ
  2843.     lnx11a_wait_for_message
  2844.   end  
  2845.   #--------------------------------------------------------------------------
  2846.   # ● [エイリアス]:戦闘開始
  2847.   #--------------------------------------------------------------------------
  2848.   alias :lnx11a_battle_start :battle_start
  2849.   def battle_start   
  2850.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:battle_start][0]
  2851.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:battle_start][1]
  2852.     # メッセージウィンドウへのテキスト追加を禁止する
  2853.     $game_message.add_disabled
  2854.     # 元のメソッドを呼ぶ
  2855.     lnx11a_battle_start
  2856.     # メッセージウィンドウへのテキスト追加を許可する
  2857.     $game_message.add_enabled
  2858.     @helpdisplay_wait = nil
  2859.     @helpdisplay_wait_input = nil
  2860.   end
  2861.   #--------------------------------------------------------------------------
  2862.   # ● [エイリアス]:勝利の処理
  2863.   #--------------------------------------------------------------------------
  2864.   alias :lnx11a_process_victory :process_victory
  2865.   def process_victory
  2866.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:victory][0]
  2867.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:victory][1]
  2868.     # メッセージウィンドウへのテキスト追加を禁止する
  2869.     $game_message.add_disabled
  2870.     # 元のメソッドを呼ぶ
  2871.     success = lnx11a_process_victory
  2872.     # メッセージウィンドウへのテキスト追加を許可する
  2873.     $game_message.add_enabled
  2874.     @helpdisplay_wait = nil
  2875.     @helpdisplay_wait_input = nil
  2876.     return success
  2877.   end
  2878.   #--------------------------------------------------------------------------
  2879.   # ● [エイリアス]:逃走の処理
  2880.   #--------------------------------------------------------------------------
  2881.   alias :lnx11a_process_escape :process_escape
  2882.   def process_escape
  2883.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:escape][0]
  2884.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:escape][1]
  2885.     # メッセージウィンドウへのテキスト追加を禁止する
  2886.     $game_message.add_disabled
  2887.     # 元のメソッドを呼ぶ
  2888.     success = lnx11a_process_escape
  2889.     # メッセージウィンドウへのテキスト追加を許可する
  2890.     $game_message.add_enabled
  2891.     @helpdisplay_wait = nil
  2892.     @helpdisplay_wait_input = nil
  2893.     return success
  2894.   end
  2895.   #--------------------------------------------------------------------------
  2896.   # ● [エイリアス]:敗北の処理
  2897.   #--------------------------------------------------------------------------
  2898.   alias :lnx11a_process_defeat :process_defeat
  2899.   def process_defeat
  2900.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:defeat][0]
  2901.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:defeat][1]
  2902.     # メッセージウィンドウへのテキスト追加を禁止する
  2903.     $game_message.add_disabled
  2904.     # 元のメソッドを呼ぶ
  2905.     success = lnx11a_process_defeat
  2906.     # メッセージウィンドウへのテキスト追加を許可する
  2907.     $game_message.add_enabled
  2908.     @helpdisplay_wait = nil
  2909.     @helpdisplay_wait_input = nil
  2910.     return success
  2911.   end
  2912.   #--------------------------------------------------------------------------
  2913.   # ● [エイリアス]:ドロップアイテムの獲得と表示
  2914.   #--------------------------------------------------------------------------
  2915.   alias :lnx11a_gain_drop_items :gain_drop_items
  2916.   def gain_drop_items
  2917.     helpdisplay_clear
  2918.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:drop_item][0]
  2919.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:drop_item][1]
  2920.     @helpdisplay_se = LNX11::DROPITEM_SE
  2921.     # 元のメソッドを呼ぶ
  2922.     lnx11a_gain_drop_items
  2923.     @helpdisplay_wait = nil
  2924.     @helpdisplay_wait_input = nil
  2925.     @helpdisplay_se = nil
  2926.   end
  2927.   #--------------------------------------------------------------------------
  2928.   # ● [再定義]:経験値の獲得とレベルアップの表示
  2929.   #--------------------------------------------------------------------------
  2930.   def gain_exp
  2931.     count = 0 #
  2932.     $game_party.battle_members.each do |actor| #
  2933.       count += 1 if actor.alive? #
  2934.     end #
  2935.  
  2936.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:levelup][0]
  2937.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:levelup][1]
  2938.     $game_party.all_members.each do |actor|
  2939.       @helpdisplay_se = LNX11::LEVELUP_SE
  2940.       actor.gain_exp(($game_troop.exp_total.to_f/count).ceil.to_i)
  2941.       #actor.gain_exp($game_troop.exp_total)
  2942.       # レベルアップ毎にメッセージ表示ウェイト
  2943.       wait_for_message
  2944.     end
  2945.     @helpdisplay_wait = nil
  2946.     @helpdisplay_wait_input = nil
  2947.     @helpdisplay_se = nil
  2948.   end
  2949. end
  2950.  
  2951. #==============================================================================
  2952. # ■ Game_Temp
  2953. #------------------------------------------------------------------------------
  2954. #  セーブデータに含まれない、一時的なデータを扱うクラスです。このクラスのイン
  2955. # スタンスは $game_temp で参照されます。
  2956. #==============================================================================
  2957.  
  2958. class Game_Temp
  2959.   #--------------------------------------------------------------------------
  2960.   # ● [追加]:公開インスタンス変数
  2961.   #--------------------------------------------------------------------------
  2962.   attr_accessor :popup_data            # ポップアップスプライト
  2963.   attr_accessor :actor_battler_graphic # アクターのバトラーグラフィック
  2964.   attr_accessor :battlelog_clear       # バトルログ消去フラグ
  2965.   attr_accessor :target_cursor_sprite  # ターゲットカーソルスプライト
  2966.   attr_accessor :last_target_cursor    # 対象選択のカーソル記憶
  2967.   #--------------------------------------------------------------------------
  2968.   # ● [エイリアス]:オブジェクト初期化
  2969.   #--------------------------------------------------------------------------
  2970.   alias :lnx11a_initialize :initialize
  2971.   def initialize
  2972.     # 元のメソッドを呼ぶ
  2973.     lnx11a_initialize
  2974.     # 追加
  2975.     @popup_data = nil
  2976.     @actor_battler_graphic = []
  2977.     @battlelog_clear = false
  2978.     @battle_status_refresh = nil
  2979.     @target_cursor_sprite = nil
  2980.     clear_last_target_cursor
  2981.   end
  2982.   #--------------------------------------------------------------------------
  2983.   # ● [追加]:バトルステータス更新メソッドの設定
  2984.   #--------------------------------------------------------------------------
  2985.   def method_battle_status_refresh=(method)
  2986.     @battle_status_refresh = method
  2987.   end
  2988.   #--------------------------------------------------------------------------
  2989.   # ● [追加]:バトルステータス更新
  2990.   #--------------------------------------------------------------------------
  2991.   def battle_status_refresh
  2992.     return unless $game_party.in_battle
  2993.     @battle_status_refresh.call if @battle_status_refresh
  2994.   end
  2995.   #--------------------------------------------------------------------------
  2996.   # ● [追加]:対象選択のカーソル記憶をクリア
  2997.   #--------------------------------------------------------------------------
  2998.   def clear_last_target_cursor
  2999.     @last_target_cursor = {:actor => nil, :enemy => nil}
  3000.   end
  3001. end
  3002.  
  3003. #==============================================================================
  3004. # ■ Game_Action
  3005. #------------------------------------------------------------------------------
  3006. #  戦闘行動を扱うクラスです。
  3007. #==============================================================================
  3008.  
  3009. class Game_Action
  3010.   #--------------------------------------------------------------------------
  3011.   # ● [エイリアス]:ターゲットの配列作成
  3012.   #--------------------------------------------------------------------------
  3013.   alias :lnx11a_make_targets :make_targets
  3014.   def make_targets   
  3015.     if LNX11::TROOP_X_SORT
  3016.       # 元のメソッドを呼んでソート
  3017.       return lnx11a_make_targets.sort {|a,b| a.screen_x <=> b.screen_x}
  3018.     else
  3019.       return lnx11a_make_targets
  3020.     end
  3021.   end
  3022. end
  3023.  
  3024. #==============================================================================
  3025. # ■ Game_ActionResult
  3026. #------------------------------------------------------------------------------
  3027. #  戦闘行動の結果を扱うクラスです。属性に関する結果を追加します。
  3028. #==============================================================================
  3029.  
  3030. class Game_ActionResult
  3031.   #--------------------------------------------------------------------------
  3032.   # ● 公開インスタンス変数
  3033.   #--------------------------------------------------------------------------
  3034.   attr_accessor :element_rate               # 属性修正値
  3035.   #--------------------------------------------------------------------------
  3036.   # ● ダメージ値のクリア
  3037.   #--------------------------------------------------------------------------
  3038.   alias :lnx11a_clear_damage_values :clear_damage_values
  3039.   def clear_damage_values
  3040.     # 元のメソッドを呼ぶ
  3041.     lnx11a_clear_damage_values
  3042.     # 属性修正値をクリア
  3043.     @element_rate = 1.0
  3044.   end
  3045.   #--------------------------------------------------------------------------
  3046.   # ● [追加]:属性修正値の取得
  3047.   #--------------------------------------------------------------------------
  3048.   def element_rate
  3049.     return @element_rate if @element_rate
  3050.     @element_rate = 1.0
  3051.   end
  3052. end
  3053.  
  3054. #==============================================================================
  3055. # ■ Game_BattlerBase
  3056. #------------------------------------------------------------------------------
  3057. #  バトラーを扱う基本のクラスです。
  3058. #==============================================================================
  3059.  
  3060. class Game_BattlerBase
  3061.   #--------------------------------------------------------------------------
  3062.   # ● [追加]:ポップアップデータの取得
  3063.   #--------------------------------------------------------------------------
  3064.   def popup_data
  3065.     $game_temp.popup_data
  3066.   end
  3067.   #--------------------------------------------------------------------------
  3068.   # ● [エイリアス]:スキル使用コストの支払い
  3069.   #--------------------------------------------------------------------------
  3070.   alias :lnx11a_pay_skill_cost :pay_skill_cost
  3071.   def pay_skill_cost(skill)
  3072.     rmp = self.mp
  3073.     rtp = self.tp
  3074.     # 元のメソッドを呼ぶ   
  3075.     lnx11a_pay_skill_cost(skill)
  3076.     return unless $game_party.in_battle
  3077.     # ポップアップ
  3078.     popup_data.popup_regenerate_mp(self, (rmp - self.mp).truncate, true)
  3079.     popup_data.popup_regenerate_tp(self, (rtp - self.tp).truncate, true)
  3080.   end
  3081. end
  3082.  
  3083. #==============================================================================
  3084. # ■ Game_Battler
  3085. #------------------------------------------------------------------------------
  3086. #  スプライトに関するメソッドを追加したバトラーのクラスです。
  3087. #==============================================================================
  3088.  
  3089. class Game_Battler < Game_BattlerBase
  3090.   #--------------------------------------------------------------------------
  3091.   # ● 公開インスタンス変数
  3092.   #--------------------------------------------------------------------------
  3093.   attr_accessor :loop_animation_id     # ループアニメーション ID
  3094.   attr_accessor :loop_animation_mirror # ループアニメーション 左右反転フラグ
  3095.   #--------------------------------------------------------------------------
  3096.   # ● [エイリアス]:スプライトのエフェクトをクリア
  3097.   #--------------------------------------------------------------------------
  3098.   alias :lnx11a_clear_sprite_effects :clear_sprite_effects
  3099.   def clear_sprite_effects
  3100.     # 元のメソッドを呼ぶ
  3101.     lnx11a_clear_sprite_effects
  3102.     @loop_animation_id = 0
  3103.     @loop_animation_mirror = false
  3104.   end
  3105.   #--------------------------------------------------------------------------
  3106.   # ● [再定義]:アニメーション ID の設定
  3107.   #--------------------------------------------------------------------------  
  3108.   def animation_id=(id)
  3109.     return unless battle_member?
  3110.     @animation_id = id
  3111.   end
  3112.   #--------------------------------------------------------------------------
  3113.   # ● [追加]:ステートのループアニメーションの設定
  3114.   #--------------------------------------------------------------------------
  3115.   def set_state_animation
  3116.     # 表示優先度が高いステートを優先
  3117.     sort_states
  3118.     anime = @states.collect {|id| $data_states[id].state_animation }
  3119.     anime.delete(0)
  3120.     @loop_animation_id = anime[0] ? anime[0] : 0
  3121.   end
  3122.   #--------------------------------------------------------------------------
  3123.   # ● [エイリアス]:ステート情報をクリア
  3124.   #--------------------------------------------------------------------------
  3125.   alias :lnx11a_clear_states :clear_states
  3126.   def clear_states
  3127.     # 元のメソッドを呼ぶ
  3128.     lnx11a_clear_states
  3129.     # ステートアニメ設定
  3130.     set_state_animation
  3131.   end
  3132.   #--------------------------------------------------------------------------
  3133.   # ● [エイリアス]:ステートの付加
  3134.   #--------------------------------------------------------------------------
  3135.   alias :lnx11a_add_state :add_state
  3136.   def add_state(state_id)
  3137.     # 元のメソッドを呼ぶ
  3138.     lnx11a_add_state(state_id)
  3139.     # ステートアニメ設定
  3140.     set_state_animation
  3141.   end
  3142.   #--------------------------------------------------------------------------
  3143.   # ● [エイリアス]:ステートの解除
  3144.   #--------------------------------------------------------------------------
  3145.   alias :lnx11a_remove_state :remove_state
  3146.   def remove_state(state_id)
  3147.     # 元のメソッドを呼ぶ
  3148.     lnx11a_remove_state(state_id)
  3149.     # ステートアニメ設定
  3150.     set_state_animation
  3151.   end
  3152.   #--------------------------------------------------------------------------
  3153.   # ● [追加]:ポップアップディレイの取得
  3154.   #--------------------------------------------------------------------------
  3155.   def popup_delay
  3156.     return @popup_delay if @popup_delay
  3157.     popup_delay_clear
  3158.   end
  3159.   #--------------------------------------------------------------------------
  3160.   # ● [追加]:ポップアップディレイの設定
  3161.   #--------------------------------------------------------------------------
  3162.   def popup_delay=(delay)
  3163.     @popup_delay = delay
  3164.   end
  3165.   #--------------------------------------------------------------------------
  3166.   # ● [追加]:ポップアップディレイの設定
  3167.   #--------------------------------------------------------------------------
  3168.   def popup_delay_clear
  3169.     @popup_delay = Array.new(16) { 0 }
  3170.   end
  3171.   #--------------------------------------------------------------------------
  3172.   # ● [エイリアス]:スキル/アイテムの属性修正値を取得
  3173.   #  弱点/耐性の判定を追加します。
  3174.   #--------------------------------------------------------------------------
  3175.   alias :lnx11a_item_element_rate :item_element_rate
  3176.   def item_element_rate(user, item)
  3177.     # 元のメソッドを呼ぶ
  3178.     rate = lnx11a_item_element_rate(user, item)
  3179.     return rate unless $game_party.in_battle
  3180.     # レートを結果に保存する
  3181.     @result.element_rate = rate
  3182.     rate
  3183.   end
  3184.   #--------------------------------------------------------------------------
  3185.   # ● [エイリアス]:ダメージの処理
  3186.   #  吸収による回復のポップアップを生成します。
  3187.   #--------------------------------------------------------------------------
  3188.   alias :lnx11a_execute_damage :execute_damage
  3189.   def execute_damage(user)
  3190.     # 元のメソッドを呼ぶ
  3191.     lnx11a_execute_damage(user)
  3192.     return unless $game_party.in_battle
  3193.     # ポップアップ
  3194.     popup_data.popup_hp_drain(user, @result.hp_drain)
  3195.     popup_data.popup_mp_drain(user, @result.mp_drain)
  3196.   end
  3197.   #--------------------------------------------------------------------------
  3198.   # ● [エイリアス]:HP の再生
  3199.   #--------------------------------------------------------------------------
  3200.   alias :lnx11a_regenerate_hp :regenerate_hp
  3201.   def regenerate_hp
  3202.     # 元のメソッドを呼ぶ
  3203.     lnx11a_regenerate_hp
  3204.     return unless $game_party.in_battle
  3205.     # ポップアップ
  3206.     popup_data.popup_regenerate_hp(self, @result.hp_damage)
  3207.   end
  3208.   #--------------------------------------------------------------------------
  3209.   # ● [エイリアス]:MP の再生
  3210.   #--------------------------------------------------------------------------
  3211.   alias :lnx11a_regenerate_mp :regenerate_mp
  3212.   def regenerate_mp
  3213.     # 元のメソッドを呼ぶ
  3214.     lnx11a_regenerate_mp
  3215.     return unless $game_party.in_battle
  3216.     # ポップアップ
  3217.     popup_data.popup_regenerate_mp(self, @result.mp_damage)
  3218.   end
  3219.   #--------------------------------------------------------------------------
  3220.   # ● [エイリアス]:TP の再生
  3221.   #--------------------------------------------------------------------------
  3222.   alias :lnx11a_regenerate_tp :regenerate_tp
  3223.   def regenerate_tp
  3224.     rtp = self.tp.to_i
  3225.     # 元のメソッドを呼ぶ
  3226.     lnx11a_regenerate_tp
  3227.     return unless $game_party.in_battle
  3228.     # ポップアップ
  3229.     popup_data.popup_regenerate_tp(self, rtp - self.tp.to_i)
  3230.   end
  3231.   #--------------------------------------------------------------------------
  3232.   # ● 被ダメージによる TP チャージ
  3233.   #--------------------------------------------------------------------------
  3234.   alias :lnx11a_charge_tp_by_damage :charge_tp_by_damage
  3235.   def charge_tp_by_damage(damage_rate)
  3236.     rtp = self.tp.to_i
  3237.     # 元のメソッドを呼ぶ
  3238.     lnx11a_charge_tp_by_damage(damage_rate)
  3239.     return unless $game_party.in_battle
  3240.     # ポップアップ
  3241.     popup_data.popup_tp_charge(self, rtp - self.tp.to_i)
  3242.   end
  3243.   #--------------------------------------------------------------------------
  3244.   # ● [エイリアス]:スキル/アイテムの使用者側への効果(TP 得)
  3245.   #--------------------------------------------------------------------------
  3246.   alias :lnx11a_item_user_effect :item_user_effect
  3247.   def item_user_effect(user, item)
  3248.     rtp = user.tp.to_i
  3249.     # 元のメソッドを呼ぶ
  3250.     lnx11a_item_user_effect(user, item)
  3251.     return unless $game_party.in_battle
  3252.     # ポップアップ
  3253.     popup_data.popup_tp_gain(user, rtp - user.tp.to_i)
  3254.   end
  3255.   #--------------------------------------------------------------------------
  3256.   # ● [追加]:高さの取得
  3257.   #--------------------------------------------------------------------------
  3258.   def bitmap_height
  3259.     return @bitmap_height if @bitmap_height
  3260.     @bitmap_height = 0
  3261.   end
  3262.   #--------------------------------------------------------------------------
  3263.   # ● [追加]:高さの設定
  3264.   #--------------------------------------------------------------------------
  3265.   def bitmap_height=(y)
  3266.     @bitmap_height = y
  3267.   end
  3268.   #--------------------------------------------------------------------------
  3269.   # ● [追加]:バトル画面 Y 座標(頭上)の取得
  3270.   #--------------------------------------------------------------------------
  3271.   def screen_y_top
  3272.     screen_y - @bitmap_height
  3273.   end
  3274.   #--------------------------------------------------------------------------
  3275.   # ● [追加]:バトル画面 Y 座標(中心)の取得
  3276.   #--------------------------------------------------------------------------
  3277.   def screen_y_center
  3278.     screen_y - @bitmap_height / 2
  3279.   end
  3280. end
  3281.  
  3282. #==============================================================================
  3283. # ■ Game_Actor
  3284. #------------------------------------------------------------------------------
  3285. #  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors)
  3286. # の内部で使用され、Game_Party クラス($game_party)からも参照されます。
  3287. #==============================================================================
  3288.  
  3289. class Game_Actor < Game_Battler
  3290.   #--------------------------------------------------------------------------
  3291.   # ● [追加]:公開インスタンス変数
  3292.   #--------------------------------------------------------------------------
  3293.   attr_accessor :battler_graphic_name    # 後指定のバトラーグラフィック
  3294.   attr_accessor :refresh_battler_graphic # バトラーグラフィックの更新フラグ
  3295.   attr_accessor :screen_x                # バトル画面 X 座標
  3296.   attr_accessor :screen_y                # バトル画面 Y 座標
  3297.   attr_accessor :last_actor_command      # 最後に選択したコマンド
  3298.   #--------------------------------------------------------------------------
  3299.   # ● [再定義]:スプライトを使うか?
  3300.   #--------------------------------------------------------------------------
  3301.   def use_sprite?
  3302.     return true # 使う
  3303.   end
  3304.   #--------------------------------------------------------------------------
  3305.   # ● [追加]:バトル画面 Z 座標の取得
  3306.   #--------------------------------------------------------------------------
  3307.   def screen_z
  3308.     return $game_party.members_screen_z[0] if index == nil
  3309.     return $game_party.members_screen_z[index] # Game_EnemyのZ座標は100
  3310.   end
  3311.   #--------------------------------------------------------------------------
  3312.   # ● [エイリアス]:ダメージ効果の実行
  3313.   #--------------------------------------------------------------------------
  3314.   alias :lnx11a_perform_damage_effect :perform_damage_effect
  3315.   def perform_damage_effect
  3316.     # 元のメソッドを呼ぶ
  3317.     lnx11a_perform_damage_effect
  3318.     # シェイクを無効にしている場合、シェイクをクリア
  3319.     $game_troop.screen.clear_shake if LNX11::DISABLED_DAMAGE_SHAKE
  3320.   end
  3321.   #--------------------------------------------------------------------------
  3322.   # ● [再定義]:コラプス効果の実行
  3323.   #  アクターの[特徴>その他>消滅エフェクト]の設定を適用するようにします。
  3324.   #  処理内容は Game_Enemy のものとほぼ同一です。
  3325.   #--------------------------------------------------------------------------
  3326.   def perform_collapse_effect
  3327.     if $game_party.in_battle
  3328.       case collapse_type
  3329.       when 0
  3330.         @sprite_effect_type = :collapse
  3331.         Sound.play_actor_collapse
  3332.       when 1
  3333.         @sprite_effect_type = :boss_collapse
  3334.         Sound.play_boss_collapse1
  3335.       when 2
  3336.         @sprite_effect_type = :instant_collapse
  3337.       end
  3338.     end
  3339.   end
  3340.   #--------------------------------------------------------------------------
  3341.   # ● [追加]:グラフィック設定の配列を返す
  3342.   #--------------------------------------------------------------------------
  3343.   def graphic_name_index
  3344.     case LNX11::DEFAULT_BATTLER_GRAPHIC
  3345.     when 0 ; [@face_name, @face_index]
  3346.     when 1 ; [@character_name, @character_index]
  3347.     end
  3348.   end
  3349.   #--------------------------------------------------------------------------
  3350.   # ● [エイリアス]:グラフィックの変更
  3351.   #--------------------------------------------------------------------------
  3352.   alias :lnx11a_set_graphic :set_graphic
  3353.   def set_graphic(*args)
  3354.     face = graphic_name_index
  3355.     # 元のメソッドを呼ぶ
  3356.     lnx11a_set_graphic(*args)
  3357.     @refresh_battler_graphic = (face != graphic_name_index)
  3358.   end
  3359.   #--------------------------------------------------------------------------
  3360.   # ● [追加]:デフォルトバトラーグラフィックの取得
  3361.   #--------------------------------------------------------------------------
  3362.   def facebattler
  3363.     $game_temp.actor_battler_graphic[id]
  3364.   end
  3365.   def facebattler=(bitmap)
  3366.     facebattler.dispose if facebattler && !facebattler.disposed?
  3367.     $game_temp.actor_battler_graphic[id] = bitmap
  3368.   end
  3369.   #--------------------------------------------------------------------------
  3370.   # ● [追加]:後指定のバトラーグラフィックファイル名の取得
  3371.   #--------------------------------------------------------------------------
  3372.   def battler_graphic_name
  3373.     return @battler_graphic_name if @battler_graphic_name != nil
  3374.     @battler_graphic_name = ""
  3375.   end
  3376.   #--------------------------------------------------------------------------
  3377.   # ● [追加]:後指定のバトラーグラフィックファイル名の指定
  3378.   #--------------------------------------------------------------------------
  3379.   def battler_graphic_name=(filename)
  3380.     @battler_graphic_name = filename
  3381.     @refresh_battler_graphic = true
  3382.   end
  3383.   #--------------------------------------------------------------------------
  3384.   # ● [追加]:顔グラフィックを描画して返す
  3385.   #  処理内容は Window_Base の draw_face に準じたものです。
  3386.   #--------------------------------------------------------------------------
  3387.   def draw_face(face_name, face_index, enabled = true)
  3388.     fw = 96
  3389.     fh = 96
  3390.     # ビットマップを作成して返す
  3391.     bitmap = Cache.face(face_name)
  3392.     rect = Rect.new(face_index % 4 * fw, face_index / 4 * fh, fw, fh)
  3393.     face = Bitmap.new(fw, fh)
  3394.     color = LNX11::DEFAULT_BG_COLOR
  3395.     face.gradient_fill_rect(face.rect, color[0], color[1], true)
  3396.     face.blt(0, 0, bitmap, rect)
  3397.     bitmap.dispose
  3398.     face
  3399.   end
  3400.   #--------------------------------------------------------------------------
  3401.   # ● [追加]:歩行グラフィックを描画して返す
  3402.   #  処理内容は Window_Base の draw_character に準じたものです。
  3403.   #--------------------------------------------------------------------------
  3404.   def draw_character(character_name, character_index)
  3405.     return unless character_name
  3406.     bitmap = Cache.character(character_name)
  3407.     sign = character_name[/^[\!\$]./]
  3408.     if sign && sign.include?('$')
  3409.       cw = bitmap.width / 3
  3410.       ch = bitmap.height / 4
  3411.     else
  3412.       cw = bitmap.width / 12
  3413.       ch = bitmap.height / 8
  3414.     end
  3415.     n = character_index
  3416.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  3417.     character = Bitmap.new(cw, ch)
  3418.     color = LNX11::DEFAULT_BG_COLOR
  3419.     character.gradient_fill_rect(character.rect, color[0], color[1], true)
  3420.     character.blt(0, 0, bitmap, src_rect)
  3421.     character
  3422.   end
  3423.   #--------------------------------------------------------------------------
  3424.   # ● [追加]:デフォルトバトラーグラフィック設定
  3425.   #--------------------------------------------------------------------------
  3426.   def default_battler_graphic
  3427.     case LNX11::DEFAULT_BATTLER_GRAPHIC
  3428.     when 0 # 顔グラフィック
  3429.       self.facebattler = draw_face(@face_name, @face_index)
  3430.     when 1 # 歩行グラフィック
  3431.       self.facebattler = draw_character(@character_name, @character_index)
  3432.     end
  3433.   end
  3434.   #--------------------------------------------------------------------------
  3435.   # ● [追加]:バトラーグラフィックの更新
  3436.   #  Sprite_Batter が利用するオブジェクトを更新します。
  3437.   #--------------------------------------------------------------------------
  3438.   def update_battler_graphic
  3439.     @battler_hue = 0
  3440.     if !battler_graphic_name.empty?
  3441.       # スクリプトで指定されている
  3442.       @battler_name = @battler_graphic_name
  3443.       dispose_facebattler
  3444.     elsif !actor.default_battler_graphic.empty?
  3445.       # メモで指定されている
  3446.       @battler_name = actor.default_battler_graphic
  3447.       dispose_facebattler
  3448.     else
  3449.       # 何も指定されていない
  3450.       @battler_name = ""
  3451.       default_battler_graphic
  3452.     end
  3453.     # 更新したので更新フラグを取り消す
  3454.     @refresh_battler_graphic = false
  3455.   end
  3456.   #--------------------------------------------------------------------------
  3457.   # ● [追加]:バトラー用顔グラフィックの解放
  3458.   #--------------------------------------------------------------------------
  3459.   def dispose_facebattler
  3460.     return if self.facebattler == nil
  3461.     self.facebattler.dispose
  3462.     self.facebattler = nil
  3463.   end
  3464.   #--------------------------------------------------------------------------
  3465.   # ● [エイリアス]:レベルアップメッセージの表示
  3466.   #   レベルアップのポップアップを追加します。
  3467.   #--------------------------------------------------------------------------
  3468.   alias :lnx11a_display_level_up :display_level_up
  3469.   def display_level_up(new_skills)
  3470.     popup_data.popup_levelup(self) if $game_party.in_battle
  3471.     lnx11a_display_level_up(new_skills)
  3472.   end
  3473. end
  3474.  
  3475. #==============================================================================
  3476. # ■ Game_Enemy
  3477. #------------------------------------------------------------------------------
  3478. #  敵キャラを扱うクラスです。
  3479. #==============================================================================
  3480.  
  3481. class Game_Enemy < Game_Battler
  3482.   #--------------------------------------------------------------------------
  3483.   # ● [追加]:バトルメンバー判定
  3484.   #--------------------------------------------------------------------------
  3485.   def battle_member?
  3486.     true
  3487.   end
  3488.   #--------------------------------------------------------------------------
  3489.   # ● [追加]:通常攻撃 アニメーション ID の取得
  3490.   #--------------------------------------------------------------------------
  3491.   def atk_animation
  3492.     # メモを参照
  3493.     enemy.atk_animation
  3494.   end
  3495. end
  3496.  
  3497. #==============================================================================
  3498. # ■ Game_Party
  3499. #------------------------------------------------------------------------------
  3500. #  パーティを扱うクラスです。所持金やアイテムなどの情報が含まれます。このクラ
  3501. # スのインスタンスは $game_party で参照されます。
  3502. #==============================================================================
  3503.  
  3504. class Game_Party < Game_Unit
  3505.   #--------------------------------------------------------------------------
  3506.   # ● [追加]:公開インスタンス変数
  3507.   #--------------------------------------------------------------------------
  3508.   attr_accessor :actor_invisible     # アクター非表示
  3509.   attr_accessor :status_invisible    # バトルステータス非表示
  3510.   attr_accessor :actor_bg_invisible  # アクター背景非表示
  3511.   attr_accessor :last_party_command  # 最後に選択したパーティコマンド
  3512.   attr_accessor :members_screen_x          # バトルメンバー分のX座標配列
  3513.   attr_accessor :members_screen_x_nooffset # X:オフセットなし
  3514.   attr_accessor :members_screen_y          # バトルメンバー分のY座標配列
  3515.   attr_accessor :members_screen_z          # バトルメンバー分のZ座標配列
  3516.   #--------------------------------------------------------------------------
  3517.   # ● [追加]:バトルメンバーの座標設定
  3518.   #--------------------------------------------------------------------------
  3519.   def set_members_xyz
  3520.     return if members.size == 0
  3521.     # 座標をまとめて設定
  3522.     set_screen_x
  3523.     set_screen_y
  3524.     set_screen_z
  3525.   end
  3526.   #--------------------------------------------------------------------------
  3527.   # ● [追加]:バトルメンバーの座標設定
  3528.   #--------------------------------------------------------------------------
  3529.   def set_members_battle_graphic
  3530.     $game_party.battle_members.each {|actor| actor.update_battler_graphic}
  3531.   end
  3532.   #--------------------------------------------------------------------------
  3533.   # ● [追加]:バトル画面 X 座標の設定
  3534.   #  ここで設定した座標は Game_Actor や ステータス表示等で利用されます。
  3535.   #--------------------------------------------------------------------------
  3536.   def set_screen_x
  3537.     @members_screen_x = []
  3538.     @members_screen_x_nooffset = []
  3539.     padding = LNX11::ACTOR_PADDING[:side]
  3540.     if LNX11::ACTOR_CENTERING
  3541.       # アクターのセンタリングが有効
  3542.       a_spacing = LNX11::ACTOR_SPACING_ADJUST
  3543.       padding += (max_battle_members - battle_members.size) * a_spacing
  3544.       width = (Graphics.width - padding * 2) / battle_members.size
  3545.     else
  3546.       # アクターのセンタリングが無効
  3547.       width = (Graphics.width - padding * 2) / max_battle_members
  3548.     end
  3549.     battle_members.each_with_index do |actor, i|
  3550.       offset = LNX11::ACTOR_OFFSET[:x]
  3551.       @members_screen_x_nooffset[i] = width * i + width / 2 + padding
  3552.       @members_screen_x[i] = @members_screen_x_nooffset[i] + offset
  3553.       actor.screen_x = @members_screen_x[i]
  3554.     end
  3555.   end
  3556.   #--------------------------------------------------------------------------
  3557.   # ● [追加]:バトル画面 Y 座標の設定
  3558.   #  ここで設定した座標は Game_Actor や ステータス表示等で利用されます。
  3559.   #--------------------------------------------------------------------------
  3560.   def set_screen_y
  3561.     offset = LNX11::ACTOR_OFFSET[:y]
  3562.     ay = Graphics.height - LNX11::ACTOR_PADDING[:bottom] + offset
  3563.     @members_screen_y = Array.new(max_battle_members) {ay}
  3564.     battle_members.each {|actor| actor.screen_y = ay}
  3565.   end
  3566.   #--------------------------------------------------------------------------
  3567.   # ● [追加]:バトル画面 Z 座標の設定
  3568.   #--------------------------------------------------------------------------
  3569.   def set_screen_z
  3570.     # 便宜上、XYと同じように配列を作成しておく
  3571.     az = LNX11::ACTOR_SCREEN_TONE ? 150 : -10
  3572.     @members_screen_z = Array.new(max_battle_members) {az}
  3573.   end
  3574.   #--------------------------------------------------------------------------
  3575.   # ● [オーバーライド]:戦闘開始処理
  3576.   #--------------------------------------------------------------------------
  3577.   def on_battle_start
  3578.     super
  3579.     # バトルステータスの更新
  3580.     $game_temp.battle_status_refresh
  3581.   end
  3582. end
  3583.  
  3584. #==============================================================================
  3585. # ■ Game_Troop
  3586. #------------------------------------------------------------------------------
  3587. #  敵グループおよび戦闘に関するデータを扱うクラスです。
  3588. #==============================================================================
  3589.  
  3590. class Game_Troop < Game_Unit
  3591.   #--------------------------------------------------------------------------
  3592.   # ● [エイリアス]:セットアップ
  3593.   #  敵グループの座標修正処理を追加します。
  3594.   #--------------------------------------------------------------------------
  3595.   alias :lnx11a_setup :setup
  3596.   def setup(*args)
  3597.     # 元のメソッドを呼ぶ
  3598.     lnx11a_setup(*args)
  3599.     # 敵グループの座標修正
  3600.     @enemies.each do |enemy|
  3601.       # X:解像度がデフォルトでない場合に位置を補正する
  3602.       if LNX11::TROOP_X_SCREEN_FIX
  3603.         enemy.screen_x *= Graphics.width.to_f / 544
  3604.         enemy.screen_x.truncate
  3605.       end
  3606.       enemy.screen_y += LNX11::TROOP_Y_OFFSET
  3607.     end
  3608.   end
  3609.   #--------------------------------------------------------------------------
  3610.   # ● [エイリアス]:敵キャラ名の配列取得
  3611.   #--------------------------------------------------------------------------
  3612.   alias :lnx11a_enemy_names :enemy_names
  3613.   def enemy_names
  3614.     LNX11::MESSAGE_WINDOW_ENEMY_NAMES ? lnx11a_enemy_names : []
  3615.   end
  3616. end
  3617.  
  3618. #==============================================================================
  3619. # ■ Game_Message
  3620. #------------------------------------------------------------------------------
  3621. #  文章や選択肢などを表示するメッセージウィンドウの状態を扱うクラスです。
  3622. #==============================================================================
  3623.  
  3624. class Game_Message
  3625.   #--------------------------------------------------------------------------
  3626.   # ● [追加]:公開インスタンス変数
  3627.   #--------------------------------------------------------------------------
  3628.   attr_reader   :helpdisplay_texts        # 簡易ヘルプ配列
  3629.   #--------------------------------------------------------------------------
  3630.   # ● [追加]:簡易ヘルプ配列の取得
  3631.   #--------------------------------------------------------------------------
  3632.   def helpdisplay_texts
  3633.     return @helpdisplay_texts if @helpdisplay_texts
  3634.     @helpdisplay_texts = []
  3635.   end
  3636.   #--------------------------------------------------------------------------
  3637.   # ● [エイリアス]:クリア
  3638.   #--------------------------------------------------------------------------
  3639.   alias :lnx11a_clear :clear
  3640.   def clear
  3641.     # 元のメソッドを呼ぶ
  3642.     lnx11a_clear
  3643.     @helpdisplay_texts = []
  3644.     @add_disabled = false
  3645.   end
  3646.   #--------------------------------------------------------------------------
  3647.   # ● [エイリアス]:テキストの追加
  3648.   #--------------------------------------------------------------------------
  3649.   alias :lnx11a_add :add
  3650.   def add(text)
  3651.     # テキストの追加が禁止されてる場合、簡易ヘルプ表示用の配列に追加する
  3652.     if @add_disabled
  3653.       @helpdisplay_texts = [] unless @helpdisplay_texts
  3654.       @helpdisplay_texts.push(text)
  3655.     else
  3656.       # 元のメソッドを呼ぶ
  3657.       lnx11a_add(text)
  3658.     end
  3659.   end
  3660.   #--------------------------------------------------------------------------
  3661.   # ● [追加]:テキスト追加の禁止
  3662.   #--------------------------------------------------------------------------
  3663.   def add_disabled
  3664.     return if LNX11::MESSAGE_TYPE == 0
  3665.     @add_disabled = true
  3666.   end
  3667.   #--------------------------------------------------------------------------
  3668.   # ● [追加]:テキスト追加の禁止
  3669.   #--------------------------------------------------------------------------
  3670.   def add_enabled
  3671.     return if LNX11::MESSAGE_TYPE == 0
  3672.     @add_disabled = false
  3673.   end
  3674. end
  3675.  
  3676. #==============================================================================
  3677. # ■ Sprite_Battler
  3678. #------------------------------------------------------------------------------
  3679. #  バトラー表示用のスプライトです。
  3680. #==============================================================================
  3681.  
  3682. class Sprite_Battler < Sprite_Base
  3683.   #--------------------------------------------------------------------------
  3684.   # ● [追加]:ターゲットカーソルのバトラーの取得
  3685.   #--------------------------------------------------------------------------
  3686.   def cursor_battler
  3687.     $game_temp.target_cursor_sprite.battler
  3688.   end
  3689.   #--------------------------------------------------------------------------
  3690.   # ● [追加]:ターゲットカーソルの点滅状態に対応したシンボルを返す
  3691.   #--------------------------------------------------------------------------
  3692.   def cursor_effect
  3693.     $game_temp.target_cursor_sprite.blink ? :target_whiten : :command_whiten
  3694.   end
  3695.   #--------------------------------------------------------------------------
  3696.   # ● [追加]:対象選択フラッシュの設定
  3697.   #--------------------------------------------------------------------------
  3698.   def setup_cursor_effect
  3699.     if cursor_battler == @battler ||
  3700.        (cursor_battler == :party && @battler.actor?) ||
  3701.        ([:troop, :troop_random].include?(cursor_battler) && !@battler.actor?)
  3702.       if @effect_type == nil || @effect_type != cursor_effect
  3703.         start_effect(cursor_effect)
  3704.       end
  3705.     else
  3706.       # フラッシュエフェクト終了
  3707.       end_cursor_effect
  3708.     end
  3709.   end
  3710.   #--------------------------------------------------------------------------
  3711.   # ● [追加]:対象選択フラッシュの終了
  3712.   #--------------------------------------------------------------------------
  3713.   def end_cursor_effect
  3714.     if [:target_whiten, :command_whiten].include?(@effect_type)
  3715.       @effect_type = nil
  3716.       @effect_duration = 0
  3717.       revert_to_normal
  3718.     end
  3719.   end
  3720.   #--------------------------------------------------------------------------
  3721.   # ● [オーバーライド]:アニメーションスプライトの設定
  3722.   #--------------------------------------------------------------------------
  3723.   def animation_set_sprites(frame)
  3724.     o = self.opacity
  3725.     self.opacity = 255 if !@battler_visible || @effect_duration > 0
  3726.     # スーパークラスのメソッドを呼ぶ
  3727.     super(frame)
  3728.     self.opacity = o
  3729.   end
  3730.   #--------------------------------------------------------------------------
  3731.   # ● [オーバーライド]:アニメーションの原点設定
  3732.   #--------------------------------------------------------------------------
  3733.   def set_animation_origin
  3734.     # スーパークラスのメソッドを呼ぶ
  3735.     super
  3736.     # 画面アニメーションがアクターに再生されたら
  3737.     if @animation.position == 3 && @battler != nil && @battler.actor?
  3738.       # アニメーションのY座標を修正
  3739.       @ani_oy += LNX11::SCREEN_ANIMATION_OFFSET
  3740.     end
  3741.   end
  3742.   #--------------------------------------------------------------------------
  3743.   # ● [エイリアス]:転送元ビットマップの更新
  3744.   #--------------------------------------------------------------------------
  3745.   alias :lnx11a_update_bitmap :update_bitmap
  3746.   def update_bitmap
  3747.     if @battler.actor? && @battler.refresh_battler_graphic
  3748.       # バトラーグラフィックが変更されていれば更新する
  3749.       @battler.update_battler_graphic
  3750.     end
  3751.     if @battler.actor? && @battler.facebattler != nil
  3752.       # バトラー用顔グラフィックが作成されていれば、
  3753.       # それを Sprite の Bitmap とする
  3754.       new_bitmap = @battler.facebattler
  3755.       if bitmap != new_bitmap
  3756.         self.bitmap = new_bitmap
  3757.         init_visibility
  3758.       end
  3759.     else
  3760.       # 元のメソッドを呼ぶ
  3761.       lnx11a_update_bitmap
  3762.     end
  3763.   end
  3764.   #--------------------------------------------------------------------------
  3765.   # ● [エイリアス]:新しいアニメーションの設定
  3766.   #--------------------------------------------------------------------------
  3767.   alias :lnx11a_setup_new_animation :setup_new_animation
  3768.   def setup_new_animation
  3769.     lnx11a_setup_new_animation
  3770.     # ループアニメーションの設定
  3771.     if @battler.loop_animation_id > 0 && (@loop_animation == nil ||
  3772.        @battler.loop_animation_id != @loop_animation.id)
  3773.       animation = $data_animations[@battler.loop_animation_id]
  3774.       mirror = @battler.loop_animation_mirror
  3775.       start_loop_animation(animation, mirror)
  3776.     elsif @battler.loop_animation_id == 0 && @loop_animation
  3777.       end_loop_animation
  3778.     end
  3779.   end
  3780.   #--------------------------------------------------------------------------
  3781.   # ● [エイリアス]:新しいエフェクトの設定
  3782.   #--------------------------------------------------------------------------
  3783.   alias :lnx11a_setup_new_effect :setup_new_effect
  3784.   def setup_new_effect
  3785.     # 元のメソッドを呼ぶ
  3786.     lnx11a_setup_new_effect
  3787.     # フラッシュエフェクト設定
  3788.     if @battler_visible && cursor_battler
  3789.       setup_cursor_effect
  3790.     else
  3791.       # フラッシュエフェクト終了
  3792.       end_cursor_effect
  3793.     end
  3794.   end
  3795.   #--------------------------------------------------------------------------
  3796.   # ● [エイリアス]:エフェクトの開始
  3797.   #--------------------------------------------------------------------------
  3798.   alias :lnx11a_start_effect :start_effect
  3799.   def start_effect(effect_type)
  3800.     # エフェクト開始の追加
  3801.     @effect_type = effect_type
  3802.     case @effect_type
  3803.     when :target_whiten
  3804.       @effect_duration = 40
  3805.       @battler_visible = true
  3806.     when :command_whiten
  3807.       @effect_duration = 80
  3808.       @battler_visible = true
  3809.     end
  3810.     # 元のメソッドを呼ぶ
  3811.     lnx11a_start_effect(effect_type)
  3812.   end
  3813.   #--------------------------------------------------------------------------
  3814.   # ● [エイリアス]:エフェクトの更新
  3815.   #--------------------------------------------------------------------------
  3816.   alias :lnx11a_update_effect :update_effect
  3817.   def update_effect
  3818.     # エフェクト更新の追加
  3819.     if @effect_duration > 0
  3820.       @effect_duration -= 1
  3821.       case @effect_type
  3822.       when :target_whiten
  3823.         update_target_whiten
  3824.       when :command_whiten
  3825.         update_command_whiten
  3826.       end
  3827.       @effect_duration += 1
  3828.     end
  3829.     # 元のメソッドを呼ぶ
  3830.     lnx11a_update_effect
  3831.   end
  3832.   #--------------------------------------------------------------------------
  3833.   # ● [追加]:対象選択フラッシュエフェクトの更新
  3834.   #--------------------------------------------------------------------------
  3835.   def update_target_whiten
  3836.     alpha = @effect_duration < 20 ? @effect_duration : 40 - @effect_duration
  3837.     self.color.set(255, 255, 255, 0)
  3838.     self.color.alpha = (alpha + 1) * 2
  3839.   end
  3840.   #--------------------------------------------------------------------------
  3841.   # ● [追加]:コマンド選択フラッシュエフェクトの更新
  3842.   #--------------------------------------------------------------------------
  3843.   def update_command_whiten
  3844.     alpha = @effect_duration < 40 ? @effect_duration : 80 - @effect_duration
  3845.     self.color.set(255, 255, 255, 0)
  3846.     self.color.alpha = alpha * 2
  3847.   end
  3848.   #--------------------------------------------------------------------------
  3849.   # ● [追加]:高さの取得
  3850.   #--------------------------------------------------------------------------
  3851.   def bitmap_height
  3852.     self.bitmap.height
  3853.   end
  3854.   #--------------------------------------------------------------------------
  3855.   # ● [エイリアス]:位置の更新
  3856.   #--------------------------------------------------------------------------
  3857.   alias :lnx11a_update_position :update_position
  3858.   def update_position
  3859.     # 元のメソッドを呼ぶ
  3860.     lnx11a_update_position
  3861.     # 高さを更新
  3862.     @battler.bitmap_height = bitmap_height
  3863.     # 可視状態を更新
  3864.     self.visible = !$game_party.actor_invisible if @battler.actor?
  3865.   end
  3866.   if LNX11::ENHANCED_WHITEN
  3867.     # 白フラッシュを強めにする
  3868.     #------------------------------------------------------------------------
  3869.     # ● [再定義]:白フラッシュエフェクトの更新
  3870.     #------------------------------------------------------------------------
  3871.     def update_whiten
  3872.       self.color.set(255, 255, 255, 0)
  3873.       self.color.alpha = 192 - (16 - @effect_duration) * 12
  3874.     end
  3875.   end
  3876.   #--------------------------------------------------------------------------
  3877.   # ● ループアニメーションの追加
  3878.   #--------------------------------------------------------------------------
  3879.   #--------------------------------------------------------------------------
  3880.   # ● [追加]:クラス変数
  3881.   #--------------------------------------------------------------------------
  3882.   @@loop_ani_checker = []
  3883.   @@loop_ani_spr_checker = []
  3884.   #--------------------------------------------------------------------------
  3885.   # ● [エイリアス]:オブジェクト初期化
  3886.   #--------------------------------------------------------------------------
  3887.   alias :lnx11a_initialize :initialize
  3888.   def initialize(viewport, battler = nil)
  3889.     # 元のメソッドを呼ぶ
  3890.     lnx11a_initialize(viewport, battler)
  3891.     # ループアニメの残り時間
  3892.     @loop_ani_duration = 0
  3893.   end
  3894.   #--------------------------------------------------------------------------
  3895.   # ● [エイリアス]:解放
  3896.   #--------------------------------------------------------------------------
  3897.   alias :lnx11a_dispose :dispose
  3898.   def dispose
  3899.     # 元のメソッドを呼ぶ
  3900.     lnx11a_dispose
  3901.     # ループアニメを解放
  3902.     dispose_loop_animation
  3903.   end
  3904.   #--------------------------------------------------------------------------
  3905.   # ● [エイリアス]:フレーム更新
  3906.   #--------------------------------------------------------------------------
  3907.   alias :lnx11a_update :update
  3908.   def update
  3909.     # 元のメソッドを呼ぶ
  3910.     lnx11a_update
  3911.     update_loop_animation
  3912.     @@loop_ani_checker.clear
  3913.     @@loop_ani_spr_checker.clear
  3914.   end
  3915.   #--------------------------------------------------------------------------
  3916.   # ● [追加]:ループアニメーション表示中判定
  3917.   #--------------------------------------------------------------------------
  3918.   def loop_animation?
  3919.     @loop_animation != nil
  3920.   end
  3921.   #--------------------------------------------------------------------------
  3922.   # ● [追加]:ループアニメーションの開始
  3923.   #--------------------------------------------------------------------------
  3924.   def start_loop_animation(animation, mirror = false)
  3925.     dispose_loop_animation
  3926.     @loop_animation = animation
  3927.     if @loop_animation
  3928.       @loop_ani_mirror = mirror
  3929.       set_loop_animation_rate
  3930.       @loop_ani_duration = @loop_animation.frame_max * @loop_ani_rate + 1
  3931.       load_loop_animation_bitmap
  3932.       make_loop_animation_sprites
  3933.       set_loop_animation_origin
  3934.     end
  3935.   end
  3936.   #--------------------------------------------------------------------------
  3937.   # ● [追加]:ループアニメーションの速度を設定
  3938.   #--------------------------------------------------------------------------
  3939.   def set_loop_animation_rate
  3940.     if $lnx_include[:lnx09]
  3941.       # LNX09 を導入している
  3942.       default = LNX09::DEFAULT_BATTLE_SPEED_RATE
  3943.       if @loop_animation.speed_rate
  3944.         @loop_ani_rate = @loop_animation.speed_rate
  3945.       else
  3946.         @loop_ani_rate = default
  3947.       end
  3948.     else
  3949.       @loop_ani_rate = 4
  3950.     end
  3951.   end
  3952.   #--------------------------------------------------------------------------
  3953.   # ● [追加]:ループアニメーション グラフィックの読み込み
  3954.   #--------------------------------------------------------------------------
  3955.   def load_loop_animation_bitmap
  3956.     animation1_name = @loop_animation.animation1_name
  3957.     animation1_hue = @loop_animation.animation1_hue
  3958.     animation2_name = @loop_animation.animation2_name
  3959.     animation2_hue = @loop_animation.animation2_hue
  3960.     @loop_ani_bitmap1 = Cache.animation(animation1_name, animation1_hue)
  3961.     @loop_ani_bitmap2 = Cache.animation(animation2_name, animation2_hue)
  3962.     if @@_reference_count.include?(@loop_ani_bitmap1)
  3963.       @@_reference_count[@loop_ani_bitmap1] += 1
  3964.     else
  3965.       @@_reference_count[@loop_ani_bitmap1] = 1
  3966.     end
  3967.     if @@_reference_count.include?(@loop_ani_bitmap2)
  3968.       @@_reference_count[@loop_ani_bitmap2] += 1
  3969.     else
  3970.       @@_reference_count[@loop_ani_bitmap2] = 1
  3971.     end
  3972.     Graphics.frame_reset
  3973.   end
  3974.   #--------------------------------------------------------------------------
  3975.   # ● [追加]:ループアニメーションスプライトの作成
  3976.   #--------------------------------------------------------------------------
  3977.   def make_loop_animation_sprites
  3978.     @loop_ani_sprites = []
  3979.     if @use_sprite && !@@loop_ani_spr_checker.include?(@loop_animation)
  3980.       16.times do
  3981.         sprite = ::Sprite.new(viewport)
  3982.         sprite.visible = false
  3983.         @loop_ani_sprites.push(sprite)
  3984.       end
  3985.       if @loop_animation.position == 3
  3986.         @@loop_ani_spr_checker.push(@loop_animation)
  3987.       end
  3988.     end
  3989.     @loop_ani_duplicated = @@loop_ani_checker.include?(@loop_animation)
  3990.     if !@loop_ani_duplicated && @loop_animation.position == 3
  3991.       @@loop_ani_checker.push(@loop_animation)
  3992.     end
  3993.   end
  3994.   #--------------------------------------------------------------------------
  3995.   # ● [追加]:ループアニメーションの原点設定
  3996.   #--------------------------------------------------------------------------
  3997.   def set_loop_animation_origin
  3998.     if @loop_animation.position == 3
  3999.       if viewport == nil
  4000.         @loop_ani_ox = Graphics.width / 2
  4001.         @loop_ani_oy = Graphics.height / 2
  4002.       else
  4003.         @loop_ani_ox = viewport.rect.width / 2
  4004.         @loop_ani_oy = viewport.rect.height / 2
  4005.       end
  4006.     else
  4007.       @loop_ani_ox = x - ox + width / 2
  4008.       @loop_ani_oy = y - oy + height / 2
  4009.       if @loop_animation.position == 0
  4010.         @loop_ani_oy -= height / 2
  4011.       elsif @loop_animation.position == 2
  4012.         @loop_ani_oy += height / 2
  4013.       end
  4014.     end
  4015.   end
  4016.   #--------------------------------------------------------------------------
  4017.   # ● [追加]:ループアニメーションの解放
  4018.   #--------------------------------------------------------------------------
  4019.   def dispose_loop_animation
  4020.     if @loop_ani_bitmap1
  4021.       @@_reference_count[@loop_ani_bitmap1] -= 1
  4022.       if @@_reference_count[@loop_ani_bitmap1] == 0
  4023.         @loop_ani_bitmap1.dispose
  4024.       end
  4025.     end
  4026.     if @loop_ani_bitmap2
  4027.       @@_reference_count[@loop_ani_bitmap2] -= 1
  4028.       if @@_reference_count[@loop_ani_bitmap2] == 0
  4029.         @loop_ani_bitmap2.dispose
  4030.       end
  4031.     end
  4032.     if @loop_ani_sprites
  4033.       @loop_ani_sprites.each {|sprite| sprite.dispose }
  4034.       @loop_ani_sprites = nil
  4035.       @loop_animation = nil
  4036.     end
  4037.     @loop_ani_bitmap1 = nil
  4038.     @loop_ani_bitmap2 = nil
  4039.   end
  4040.   #--------------------------------------------------------------------------
  4041.   # ● [追加]:ループアニメーションの更新
  4042.   #--------------------------------------------------------------------------
  4043.   def update_loop_animation
  4044.     return unless loop_animation?
  4045.     @loop_ani_duration -= 1
  4046.     if @loop_ani_duration % @loop_ani_rate == 0
  4047.       if @loop_ani_duration > 0
  4048.         frame_index = @loop_animation.frame_max
  4049.         speed = (@loop_ani_duration + @loop_ani_rate - 1) / @loop_ani_rate
  4050.         frame_index -= speed
  4051.         loop_animation_set_sprites(@loop_animation.frames[frame_index])
  4052.         @loop_animation.timings.each do |timing|
  4053.           loop_animation_process_timing(timing) if timing.frame == frame_index
  4054.         end
  4055.       else
  4056.         # 残り時間を再設定してループ
  4057.         @loop_ani_duration = @loop_animation.frame_max * @loop_ani_rate + 1
  4058.       end
  4059.     end
  4060.   end
  4061.   #--------------------------------------------------------------------------
  4062.   # ● [追加]:ループアニメーションの終了
  4063.   #--------------------------------------------------------------------------
  4064.   def end_loop_animation
  4065.     dispose_loop_animation
  4066.   end
  4067.   #--------------------------------------------------------------------------
  4068.   # ● [追加]:ループアニメーションスプライトの設定
  4069.   #     frame : フレームデータ(RPG::Animation::Frame)
  4070.   #--------------------------------------------------------------------------
  4071.   def loop_animation_set_sprites(frame)
  4072.     cell_data = frame.cell_data
  4073.     @loop_ani_sprites.each_with_index do |sprite, i|
  4074.       next unless sprite
  4075.       pattern = cell_data[i, 0]
  4076.       if !pattern || pattern < 0
  4077.         sprite.visible = false
  4078.         next
  4079.       end
  4080.       sprite.bitmap = pattern < 100 ? @loop_ani_bitmap1 : @loop_ani_bitmap2
  4081.       sprite.visible = true
  4082.       sprite.src_rect.set(pattern % 5 * 192,
  4083.         pattern % 100 / 5 * 192, 192, 192)
  4084.       if @loop_ani_mirror
  4085.         sprite.x = @loop_ani_ox - cell_data[i, 1]
  4086.         sprite.y = @loop_ani_oy + cell_data[i, 2]
  4087.         sprite.angle = (360 - cell_data[i, 4])
  4088.         sprite.mirror = (cell_data[i, 5] == 0)
  4089.       else
  4090.         sprite.x = @loop_ani_ox + cell_data[i, 1]
  4091.         sprite.y = @loop_ani_oy + cell_data[i, 2]
  4092.         sprite.angle = cell_data[i, 4]
  4093.         sprite.mirror = (cell_data[i, 5] == 1)
  4094.       end
  4095.       sprite.z = self.z + 316 + i
  4096.       sprite.ox = 96
  4097.       sprite.oy = 96
  4098.       sprite.zoom_x = cell_data[i, 3] / 100.0
  4099.       sprite.zoom_y = cell_data[i, 3] / 100.0
  4100.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  4101.       sprite.blend_type = cell_data[i, 7]
  4102.     end
  4103.   end
  4104.   #--------------------------------------------------------------------------
  4105.   # ● [追加]:SE とフラッシュのタイミング処理
  4106.   #     timing : タイミングデータ(RPG::Animation::Timing)
  4107.   #--------------------------------------------------------------------------
  4108.   def loop_animation_process_timing(timing)
  4109.     timing.se.play unless @loop_ani_duplicated
  4110.     case timing.flash_scope
  4111.     when 1
  4112.       self.flash(timing.flash_color, timing.flash_duration * @loop_ani_rate)
  4113.     when 2
  4114.       if viewport && !@loop_ani_duplicated
  4115.         duration = timing.flash_duration * @loop_ani_rate
  4116.         viewport.flash(timing.flash_color, duration)
  4117.       end
  4118.     when 3
  4119.       self.flash(nil, timing.flash_duration * @loop_ani_rate)
  4120.     end
  4121.   end
  4122. end
  4123.  
  4124. #==============================================================================
  4125. # ■ Spriteset_Battle
  4126. #------------------------------------------------------------------------------
  4127. #  バトル画面のスプライトをまとめたクラスです。
  4128. #==============================================================================
  4129.  
  4130. class Spriteset_Battle
  4131.   #--------------------------------------------------------------------------
  4132.   # ● [エイリアス]:オブジェクト初期化
  4133.   #--------------------------------------------------------------------------
  4134.   alias :lnx11a_initialize :initialize
  4135.   def initialize
  4136.     # 元のメソッドを呼ぶ
  4137.     lnx11a_initialize
  4138.     # アクターエリアの背景の作成
  4139.     create_actor_background
  4140.   end
  4141.   #--------------------------------------------------------------------------
  4142.   # ● [エイリアス]:解放
  4143.   #--------------------------------------------------------------------------
  4144.   alias :lnx11a_dispose :dispose
  4145.   def dispose
  4146.     # 元のメソッドを呼ぶ
  4147.     lnx11a_dispose
  4148.     # アクターエリアの背景の解放
  4149.     dispose_actor_background
  4150.   end
  4151.   #--------------------------------------------------------------------------
  4152.   # ● [エイリアス]:フレーム更新
  4153.   #--------------------------------------------------------------------------
  4154.   alias :lnx11a_update :update
  4155.   def update
  4156.     # 元のメソッドを呼ぶ
  4157.     lnx11a_update
  4158.     # アクターエリアの背景の更新
  4159.     update_actor_background
  4160.   end
  4161.   #--------------------------------------------------------------------------
  4162.   # ● [追加]:アクターのビューポート
  4163.   #--------------------------------------------------------------------------
  4164.   def actor_viewport
  4165.     LNX11::ACTOR_SCREEN_TONE ? @viewport1 : @viewport2
  4166.   end
  4167.   #--------------------------------------------------------------------------
  4168.   # ● [追加]:アクターエリアの背景の作成
  4169.   #--------------------------------------------------------------------------
  4170.   def create_actor_background
  4171.     return if LNX11::ACTOR_BACKGROUND == 0
  4172.     viewport = actor_viewport
  4173.     height = LNX11::ACTOR_BACKGROUND_HEIGHT
  4174.     case LNX11::ACTOR_BACKGROUND
  4175.     when 1
  4176.       # グラデーション
  4177.       @actor_background = Sprite.new
  4178.       back = Bitmap.new(Graphics.width, height)
  4179.       color = LNX11::ACTOR_BG_GRADIENT_COLOR
  4180.       back.gradient_fill_rect(back.rect, color[0], color[1], true)
  4181.       @actor_background.bitmap = back
  4182.     when 2
  4183.       # ウィンドウ
  4184.       @actor_background = Window_Base.new(0, 0, Graphics.width, height)
  4185.     else
  4186.       if LNX11::ACTOR_BACKGROUND.is_a?(String)
  4187.         # ファイル指定
  4188.         @actor_background = Sprite.new
  4189.         @actor_background.bitmap = Cache.system(LNX11::ACTOR_BACKGROUND)
  4190.         @actor_background.x = Graphics.width / 2
  4191.         @actor_background.ox = @actor_background.bitmap.width / 2
  4192.         height = @actor_background.bitmap.height
  4193.       end
  4194.     end
  4195.     @actor_background.viewport = viewport
  4196.     @actor_background.y = Graphics.height - height
  4197.     @actor_background.z = viewport == @viewport1 ? 120 : -20
  4198.     update_actor_background
  4199.   end
  4200.   #--------------------------------------------------------------------------
  4201.   # ● [追加]:アクターエリアの背景の解放
  4202.   #--------------------------------------------------------------------------
  4203.   def dispose_actor_background
  4204.     return unless @actor_background
  4205.     @actor_background.bitmap.dispose if @actor_background.is_a?(Sprite)
  4206.     @actor_background.dispose
  4207.   end
  4208.   #--------------------------------------------------------------------------
  4209.   # ● [追加]:アクターエリアの背景の更新
  4210.   #--------------------------------------------------------------------------
  4211.   def update_actor_background
  4212.     return unless @actor_background
  4213.     @actor_background.visible = !$game_party.actor_bg_invisible
  4214.   end
  4215.   #--------------------------------------------------------------------------
  4216.   # ● [再定義]:アクタースプライトの作成
  4217.   #--------------------------------------------------------------------------
  4218.   def create_actors
  4219.     # 座標とグラフィックの設定
  4220.     $game_party.set_members_xyz
  4221.     $game_party.set_members_battle_graphic
  4222.     # スプライトの作成
  4223.     viewport = actor_viewport
  4224.     @actor_sprites = $game_party.battle_members.collect do |actor|
  4225.       Sprite_Battler.new(viewport, actor)
  4226.     end
  4227.   end
  4228.   #--------------------------------------------------------------------------
  4229.   # ● [再定義]:アクタースプライトの更新
  4230.   #--------------------------------------------------------------------------
  4231.   def update_actors
  4232.     @actor_sprites.each {|sprite| sprite.update }
  4233.   end
  4234. end
  4235.  
  4236. #==============================================================================
  4237. # ■ Scene_Battle
  4238. #------------------------------------------------------------------------------
  4239. #  バトル画面の処理を行うクラスです。
  4240. #==============================================================================
  4241.  
  4242. class Scene_Battle < Scene_Base
  4243.   #--------------------------------------------------------------------------
  4244.   # ● [追加]:簡易ヘルプのメソッド設定
  4245.   #--------------------------------------------------------------------------
  4246.   def set_helpdisplay_methods
  4247.     BattleManager.update_for_wait_method = method(:update_for_wait)
  4248.     BattleManager.helpdisplay_set_method = method(:helpdisplay_set)
  4249.     BattleManager.helpdisplay_clear_method = method(:helpdisplay_clear)
  4250.     BattleManager.helpdisplay_wait_short_method=method(:helpdisplay_wait_short)
  4251.   end
  4252.   #--------------------------------------------------------------------------
  4253.   # ● [追加]:簡易ヘルプ表示
  4254.   #--------------------------------------------------------------------------
  4255.   def helpdisplay_set(item, duration = nil)
  4256.     @wait_short_disabled = false
  4257.     @targethelp_window.show.set_item(item)
  4258.     @targethelp_window.update
  4259.     wait(duration ? duration : 20)
  4260.   end
  4261.   #--------------------------------------------------------------------------
  4262.   # ● [追加]:簡易ヘルプ消去
  4263.   #--------------------------------------------------------------------------
  4264.   def helpdisplay_clear(duration = nil)
  4265.     return if !@targethelp_window.visible
  4266.     @wait_short_disabled = false
  4267.     @targethelp_window.clear
  4268.     @targethelp_window.hide
  4269.     wait(duration ? duration : 10)
  4270.   end
  4271.   #--------------------------------------------------------------------------
  4272.   # ● [追加]:簡易ヘルプ・短時間ウェイト
  4273.   #--------------------------------------------------------------------------
  4274.   def helpdisplay_wait_short
  4275.     return if !@targethelp_window.visible || @wait_short_disabled
  4276.     @wait_short_disabled = true # 連続で短時間ウェイトが実行されないように
  4277.     @targethelp_window.clear
  4278.     abs_wait_short
  4279.   end
  4280.   #--------------------------------------------------------------------------
  4281.   # ● [追加]:バトラーのエフェクト実行中?
  4282.   #--------------------------------------------------------------------------
  4283.   def battler_effect?
  4284.     @spriteset.effect?
  4285.   end
  4286.   #--------------------------------------------------------------------------
  4287.   # ● [エイリアス]:コマンド[逃げる]
  4288.   #--------------------------------------------------------------------------
  4289.   alias :lnx11a_command_escape :command_escape
  4290.   def command_escape
  4291.     @party_command_window.close
  4292.     @party_command_window.openness = 0 if LNX11::MESSAGE_TYPE == 2
  4293.     @status_window.unselect
  4294.     # 元のメソッドを呼ぶ
  4295.     lnx11a_command_escape
  4296.   end
  4297.   #--------------------------------------------------------------------------
  4298.   # ● [エイリアス]:スキル/アイテムの使用
  4299.   #--------------------------------------------------------------------------
  4300.   alias :lnx11a_use_item :use_item
  4301.   def use_item
  4302.     # 簡易ヘルプ表示
  4303.     item = @subject.current_action.item
  4304.     if LNX11::BATTLELOG_TYPE == 2 && !item.no_display
  4305.       helpdisplay_set(item, item.display_wait)
  4306.     end
  4307.     # 元のメソッドを呼ぶ
  4308.     lnx11a_use_item
  4309.     # 簡易ヘルプ消去・エフェクトが終わるまで待つ
  4310.     if LNX11::BATTLELOG_TYPE == 2
  4311.       wait(item.end_wait)
  4312.       helpdisplay_clear
  4313.     end
  4314.     wait_for_effect
  4315.   end
  4316.   #--------------------------------------------------------------------------
  4317.   # ● [エイリアス]:開始処理
  4318.   #--------------------------------------------------------------------------
  4319.   alias :lnx11a_start :start
  4320.   def start
  4321.     set_helpdisplay_methods
  4322.     @last_party_members = party_members
  4323.     $game_temp.method_battle_status_refresh = method(:refresh_status)
  4324.     $game_temp.clear_last_target_cursor
  4325.     $game_party.all_members.each {|actor| actor.last_actor_command = 0 }
  4326.     reset_sprite_effects
  4327.     standby_message_window_position
  4328.     create_targetcursor
  4329.     create_popup
  4330.     #元のメソッドを呼ぶ
  4331.     lnx11a_start
  4332.   end
  4333.   #--------------------------------------------------------------------------
  4334.   # ● [エイリアス]:終了処理
  4335.   #--------------------------------------------------------------------------
  4336.   alias :lnx11a_terminate :terminate
  4337.   def terminate
  4338.     $game_message.clear
  4339.     dispose_targetcursor
  4340.     dispose_popup
  4341.     # 元のメソッドを呼ぶ
  4342.     lnx11a_terminate
  4343.   end
  4344.   #--------------------------------------------------------------------------
  4345.   # ● [追加]:アクターのスプライト情報の初期化
  4346.   #--------------------------------------------------------------------------
  4347.   def reset_sprite_effects
  4348.     $game_party.battle_members.each do |actor|
  4349.       actor.popup_delay_clear
  4350.       actor.set_state_animation
  4351.     end
  4352.   end
  4353.   #--------------------------------------------------------------------------
  4354.   # ● [エイリアス]:全ウィンドウの作成
  4355.   #--------------------------------------------------------------------------
  4356.   alias :lnx11a_create_all_windows :create_all_windows
  4357.   def create_all_windows
  4358.     # 元のメソッドを呼ぶ
  4359.     lnx11a_create_all_windows
  4360.     create_targethelp_window
  4361.   end
  4362.   #--------------------------------------------------------------------------
  4363.   # ● [エイリアス]:ステータスウィンドウの作成
  4364.   #--------------------------------------------------------------------------
  4365.   alias :lnx11a_create_status_window :create_status_window
  4366.   def create_status_window
  4367.     # 元のメソッドを呼ぶ
  4368.     lnx11a_create_status_window
  4369.     @status_window.set_xy
  4370.   end
  4371.   #--------------------------------------------------------------------------
  4372.   # ● [エイリアス]:情報表示ビューポートの作成
  4373.   #--------------------------------------------------------------------------
  4374.   alias :lnx11a_create_info_viewport :create_info_viewport
  4375.   def create_info_viewport
  4376.     # 元のメソッドを呼ぶ
  4377.     lnx11a_create_info_viewport
  4378.     # ビューポートを修正
  4379.     @info_viewport.rect.y = Graphics.height - LNX11::ACTOR_BACKGROUND_HEIGHT
  4380.     @info_viewport.rect.height = LNX11::ACTOR_BACKGROUND_HEIGHT
  4381.     @status_window.viewport = nil
  4382.   end
  4383.   #--------------------------------------------------------------------------
  4384.   # ● [エイリアス]:パーティコマンドウィンドウの作成
  4385.   #--------------------------------------------------------------------------
  4386.   alias :lnx11a_create_party_command_window :create_party_command_window
  4387.   def create_party_command_window
  4388.     # 元のメソッドを呼ぶ
  4389.     lnx11a_create_party_command_window
  4390.     @party_command_window.viewport = nil
  4391.   end
  4392.   #--------------------------------------------------------------------------
  4393.   # ● [エイリアス]:アクターコマンドウィンドウの作成
  4394.   #--------------------------------------------------------------------------
  4395.   alias :lnx11a_create_actor_command_window :create_actor_command_window
  4396.   def create_actor_command_window
  4397.     # 元のメソッドを呼ぶ
  4398.     lnx11a_create_actor_command_window
  4399.     @actor_command_window.viewport = nil
  4400.   end
  4401.   #--------------------------------------------------------------------------
  4402.   # ● [エイリアス]:ログウィンドウの作成
  4403.   #--------------------------------------------------------------------------
  4404.   alias :lnx11a_create_log_window :create_log_window
  4405.   def create_log_window
  4406.     # 元のメソッドを呼ぶ
  4407.     lnx11a_create_log_window
  4408.     # ウェイトメソッド
  4409.     @log_window.method_wait_for_animation = method(:wait_for_animation)
  4410.   end  
  4411.   #--------------------------------------------------------------------------
  4412.   # ● [追加]:ターゲットカーソルの作成
  4413.   #--------------------------------------------------------------------------
  4414.   def create_targetcursor
  4415.     @targetcursor = Sprite_TargetCursor.new
  4416.     $game_temp.target_cursor_sprite = @targetcursor
  4417.   end
  4418.   #--------------------------------------------------------------------------
  4419.   # ● [追加]:ターゲットカーソルの解放
  4420.   #--------------------------------------------------------------------------
  4421.   def dispose_targetcursor
  4422.     @targetcursor.dispose
  4423.   end
  4424.   #--------------------------------------------------------------------------
  4425.   # ● [追加]:ターゲットヘルプウィンドウの作成
  4426.   #--------------------------------------------------------------------------
  4427.   def create_targethelp_window
  4428.     @targethelp_window = Window_TargetHelp.new
  4429.     @targethelp_window.visible = false
  4430.     # ターゲット選択ウィンドウに関連付ける
  4431.     @actor_window.help_window = @targethelp_window
  4432.     @enemy_window.help_window = @targethelp_window
  4433.   end
  4434.   #--------------------------------------------------------------------------
  4435.   # ● [追加]:ポップアップの作成
  4436.   #--------------------------------------------------------------------------
  4437.   def create_popup
  4438.     $game_temp.popup_data = Popup_Data.new
  4439.   end
  4440.   #--------------------------------------------------------------------------
  4441.   # ● [追加]:ポップアップの解放
  4442.   #--------------------------------------------------------------------------
  4443.   def dispose_popup
  4444.     $game_temp.popup_data.dispose
  4445.   end
  4446.   #--------------------------------------------------------------------------
  4447.   # ● [追加]:ポップアップデータの取得
  4448.   #--------------------------------------------------------------------------
  4449.   def popup_data
  4450.     $game_temp.popup_data
  4451.   end
  4452.   #--------------------------------------------------------------------------
  4453.   # ● [エイリアス]:フレーム更新(基本)
  4454.   #--------------------------------------------------------------------------
  4455.   alias :lnx11a_update_basic :update_basic
  4456.   def update_basic
  4457.     # 元のメソッドを呼ぶ
  4458.     lnx11a_update_basic
  4459.     # 追加したオブジェクトの更新
  4460.     update_targetcursor
  4461.     update_popup
  4462.     refresh_actors
  4463.   end
  4464.   #--------------------------------------------------------------------------
  4465.   # ● [追加]:パーティメンバーの ID 配列の取得
  4466.   #--------------------------------------------------------------------------
  4467.   def party_members
  4468.     $game_party.battle_members.collect {|actor| actor.id }
  4469.   end
  4470.   #--------------------------------------------------------------------------
  4471.   # ● [追加]:メンバーが入れ替わったらオブジェクトを再作成する
  4472.   #--------------------------------------------------------------------------
  4473.   def refresh_actors
  4474.     a_party_members = party_members
  4475.     return if @last_party_members == a_party_members
  4476.     @last_party_members = a_party_members
  4477.     $game_party.battle_members.each {|actor| actor.sprite_effect_type=:appear }
  4478.     reset_sprite_effects
  4479.     @spriteset.dispose_actors
  4480.     @spriteset.create_actors
  4481.     status_clear
  4482.     refresh_status
  4483.     Graphics.frame_reset
  4484.   end
  4485.   #--------------------------------------------------------------------------
  4486.   # ● [追加]:ステータスウィンドウの情報を更新(メンバー交代用)
  4487.   #--------------------------------------------------------------------------
  4488.   def status_clear
  4489.     @status_window.all_clear
  4490.   end
  4491.   #--------------------------------------------------------------------------
  4492.   # ● [追加]:メッセージウィンドウの位置の初期化
  4493.   #  毎フレーム呼び出すことで、イベントコマンド以外のメッセージの位置を
  4494.   # 固定します。
  4495.   #--------------------------------------------------------------------------
  4496.   def standby_message_window_position
  4497.     $game_message.background = LNX11::MESSAGE_WINDOW_BACKGROUND
  4498.     $game_message.position = LNX11::MESSAGE_WINDOW_POSITION
  4499.   end
  4500.   #--------------------------------------------------------------------------
  4501.   # ● [再定義]:メッセージウィンドウを開く処理の更新
  4502.   #    ステータスウィンドウなどが閉じ終わるまでオープン度を 0 にする。
  4503.   #--------------------------------------------------------------------------
  4504.   def update_message_open
  4505.     if $game_message.busy?
  4506.       @party_command_window.close
  4507.       @actor_command_window.close
  4508.       $game_temp.battlelog_clear = true
  4509.     else
  4510.       standby_message_window_position
  4511.     end
  4512.   end
  4513.   #--------------------------------------------------------------------------
  4514.   # ● [追加]:ターゲットカーソル更新
  4515.   #--------------------------------------------------------------------------
  4516.   def update_targetcursor
  4517.     # 選択中のバトラーの座標を設定する
  4518.     if @actor_window.active
  4519.       # アクター選択ウィンドウがアクティブ
  4520.       @targetcursor.set(@actor_window.targetcursor, true)
  4521.     elsif @enemy_window.active
  4522.       # 敵キャラ選択ウィンドウがアクティブ
  4523.       @targetcursor.set(@enemy_window.targetcursor, true)
  4524.     elsif @status_window.index >= 0
  4525.       # ステータスウィンドウがアクティブ
  4526.       @targetcursor.set(@status_window.actor)
  4527.     else
  4528.       # どれもアクティブでない場合は非表示
  4529.       @targetcursor.hide
  4530.     end
  4531.     @targetcursor.update
  4532.   end
  4533.   #--------------------------------------------------------------------------
  4534.   # ● [追加]:ポップアップ更新
  4535.   #--------------------------------------------------------------------------
  4536.   def update_popup
  4537.     # ポップアップスプライトの更新
  4538.     popup_data.update
  4539.   end  
  4540.   #--------------------------------------------------------------------------
  4541.   # ● [エイリアス]:パーティコマンド選択の開始
  4542.   #--------------------------------------------------------------------------
  4543.   alias :lnx11a_start_party_command_selection :start_party_command_selection
  4544.   def start_party_command_selection
  4545.     # 元のメソッドを呼ぶ
  4546.     lnx11a_start_party_command_selection
  4547.     # バトルログ削除
  4548.     @log_window.lines_clear
  4549.     $game_temp.battlelog_clear = LNX11::STORAGE_TURNEND_CLEAR
  4550.     @actor_command = false
  4551.     # 2ターン目以降のパーテイコマンドスキップ
  4552.     return unless @party_command_skip
  4553.     @party_command_skip = false
  4554.     command_fight if !scene_changing? && @party_command_window.active
  4555.   end
  4556.   #--------------------------------------------------------------------------
  4557.   # ● [エイリアス]:アクターコマンド選択の開始
  4558.   #--------------------------------------------------------------------------
  4559.   alias :lnx11a_start_actor_command_selection :start_actor_command_selection
  4560.   def start_actor_command_selection
  4561.     # 元のメソッドを呼ぶ
  4562.     lnx11a_start_actor_command_selection
  4563.     @actor_command = true
  4564.   end
  4565.   #--------------------------------------------------------------------------
  4566.   # ● [エイリアス]:ターン終了
  4567.   #--------------------------------------------------------------------------
  4568.   alias :lnx11a_turn_end :turn_end
  4569.   def turn_end
  4570.     @party_command_skip = (LNX11::PARTY_COMMAND_SKIP && @actor_command)
  4571.     @actor_command = false
  4572.     # 元のメソッドを呼ぶ
  4573.     lnx11a_turn_end
  4574.   end
  4575.   #--------------------------------------------------------------------------
  4576.   # ● [追加]:アクターの選択したアイテム・スキルを返す
  4577.   #--------------------------------------------------------------------------
  4578.   def actor_selection_item
  4579.     case @actor_command_window.current_symbol
  4580.     when :attack ; $data_skills[BattleManager.actor.attack_skill_id]
  4581.     when :skill  ; @skill
  4582.     when :item   ; @item
  4583.     when :guard  ; $data_skills[BattleManager.actor.guard_skill_id]
  4584.     else ; nil
  4585.     end
  4586.   end
  4587.   #--------------------------------------------------------------------------
  4588.   # ● [エイリアス]:コマンド[防御]
  4589.   #--------------------------------------------------------------------------
  4590.   alias :lnx11a_command_guard :command_guard
  4591.   def command_guard
  4592.     if LNX11::GUARD_TARGET_CHECKE
  4593.       BattleManager.actor.input.set_guard
  4594.       # アクター選択
  4595.       select_actor_selection
  4596.     else
  4597.       # 元のメソッドを呼ぶ
  4598.       lnx11a_command_guard
  4599.     end
  4600.   end
  4601.   #--------------------------------------------------------------------------
  4602.   # ● [エイリアス]:アクター選択の開始
  4603.   #--------------------------------------------------------------------------
  4604.   alias :lnx11a_select_actor_selection :select_actor_selection
  4605.   def select_actor_selection
  4606.     # ターゲットチェック
  4607.     @actor_window.set_target(actor_selection_item)
  4608.     # 元のメソッドを呼ぶ
  4609.     lnx11a_select_actor_selection
  4610.     # ターゲットチェック
  4611.     @actor_window.set_target_refresh(actor_selection_item, BattleManager.actor)
  4612.   end
  4613.   #--------------------------------------------------------------------------
  4614.   # ● [エイリアス]:敵キャラ選択の開始
  4615.   #--------------------------------------------------------------------------
  4616.   alias :lnx11a_select_enemy_selection :select_enemy_selection
  4617.   def select_enemy_selection
  4618.     # ターゲットチェック
  4619.     @enemy_window.set_target(actor_selection_item)
  4620.     # 元のメソッドを呼ぶ
  4621.     lnx11a_select_enemy_selection
  4622.     # ターゲットチェック
  4623.     @enemy_window.set_target_refresh(actor_selection_item, BattleManager.actor)
  4624.   end
  4625.   #--------------------------------------------------------------------------
  4626.   # ● [エイリアス]アクター[キャンセル]
  4627.   #--------------------------------------------------------------------------
  4628.   alias :lnx11a_on_actor_cancel :on_actor_cancel
  4629.   def on_actor_cancel
  4630.     # 元のメソッドを呼ぶ
  4631.     lnx11a_on_actor_cancel
  4632.     # 防御の場合
  4633.     case @actor_command_window.current_symbol
  4634.     when :guard
  4635.       @actor_command_window.activate
  4636.     end   
  4637.   end
  4638.   #--------------------------------------------------------------------------
  4639.   # ● [エイリアス]:攻撃アニメーションの表示
  4640.   #--------------------------------------------------------------------------
  4641.   alias :lnx11a_show_attack_animation :show_attack_animation
  4642.   def show_attack_animation(targets)
  4643.     if @subject.actor?
  4644.       lnx11a_show_attack_animation(targets)
  4645.     else
  4646.       # 敵の通常攻撃アニメーション
  4647.       show_normal_animation(targets, @subject.atk_animation, false)
  4648.     end
  4649.   end
  4650. end
  4651.  
  4652. #==============================================================================
  4653. # ■ LNX11_Window_ActiveVisible
  4654. #------------------------------------------------------------------------------
  4655. #  バトル画面でターゲット選択中にウィンドウを非表示にするための
  4656. # ウィンドウ用モジュールです。
  4657. # ウィンドウの active と visible を連動させる役割があります。
  4658. # Window_ActorCommand,Window_BattleSkill, Window_BattleItem で
  4659. # インクルードされます。
  4660. #==============================================================================
  4661.  
  4662. module LNX11_Window_ActiveVisible
  4663.   #--------------------------------------------------------------------------
  4664.   # ● [オーバーライド]:ウィンドウのアクティブ化
  4665.   #--------------------------------------------------------------------------
  4666.   def activate
  4667.     self.show
  4668.     super
  4669.   end
  4670.   #--------------------------------------------------------------------------
  4671.   # ● [オーバーライド]:ウィンドウの非アクティブ化
  4672.   #--------------------------------------------------------------------------
  4673.   def deactivate
  4674.     @help_window != nil ? self.hide : self.visible = false
  4675.     super
  4676.   end
  4677. end
  4678.  
  4679. #==============================================================================
  4680. # ■ LNX11_Window_FittingList
  4681. #------------------------------------------------------------------------------
  4682. #  バトル画面のスキルリスト・アイテムリストを項目数に合わせてリサイズする
  4683. # ウィンドウ用モジュールです。
  4684. # Window_BattleSkill, Window_BattleItem でインクルードされます。
  4685. #==============================================================================
  4686.  
  4687. module LNX11_Window_FittingList
  4688.   #--------------------------------------------------------------------------
  4689.   # ● [追加]:ウィンドウの高さ(最大)
  4690.   #--------------------------------------------------------------------------
  4691.   def max_height
  4692.     @info_viewport.rect.y - @help_window.height
  4693.   end
  4694.   #--------------------------------------------------------------------------
  4695.   # ● [オーバーライド]:リフレッシュ
  4696.   #--------------------------------------------------------------------------
  4697.   def refresh
  4698.     make_item_list
  4699.     self.height = [fitting_height(row_max), max_height].min
  4700.     super
  4701.     self.oy = 0
  4702.   end
  4703. end
  4704.  
  4705. #==============================================================================
  4706. # ■ LNX11_Window_TargetHelp
  4707. #------------------------------------------------------------------------------
  4708. #  バトル画面で、ターゲット選択中にヘルプウィンドウを表示するための
  4709. # ウィンドウ用モジュールです。
  4710. # Window_BattleActor, Window_BattleEnemy でインクルードされます。
  4711. #==============================================================================
  4712.  
  4713. module LNX11_Window_TargetHelp
  4714.   #--------------------------------------------------------------------------
  4715.   # ● [追加]:ターゲットチェック
  4716.   #--------------------------------------------------------------------------
  4717.   def set_target(actor_selection_item)
  4718.     @cursor_fix = @cursor_all = @cursor_random = false
  4719.     item = actor_selection_item
  4720.     if actor_selection_item && !item.lnx11a_need_selection?
  4721.       # カーソルを固定
  4722.       @cursor_fix = true
  4723.       # 全体
  4724.       @cursor_all = item.for_all?
  4725.       # ランダム
  4726.       if item.for_random?
  4727.         @cursor_all = true
  4728.         @cursor_random = true
  4729.         @random_number = item.number_of_targets
  4730.       end
  4731.     end
  4732.     # 戦闘不能の味方が対象か?
  4733.     @dead_friend = item.for_dead_friend?
  4734.   end
  4735.   #--------------------------------------------------------------------------
  4736.   # ● [追加]:ターゲットチェック(リフレッシュ後)
  4737.   #--------------------------------------------------------------------------
  4738.   def set_target_refresh(actor_selection_item, actor)
  4739.     item = actor_selection_item
  4740.     # 使用者が対象なら、使用者にカーソルを合わせる
  4741.     select($game_party.members.index(actor)) if @cursor_fix && item.for_user?
  4742.   end
  4743.   #--------------------------------------------------------------------------
  4744.   # ● [オーバーライド]:ウィンドウの表示
  4745.   #--------------------------------------------------------------------------
  4746.   def show
  4747.     @help_window.show
  4748.     super
  4749.   end
  4750.   #--------------------------------------------------------------------------
  4751.   # ● [オーバーライド]:ウィンドウの非表示
  4752.   #--------------------------------------------------------------------------
  4753.   def hide
  4754.     @help_window.hide
  4755.     super
  4756.   end
  4757. end
  4758.  
  4759. #==============================================================================
  4760. # ■ [追加]:Window_TargetHelp
  4761. #------------------------------------------------------------------------------
  4762. #  ターゲットの名前情報やスキルやアイテムの名前を表示します。
  4763. #==============================================================================
  4764.  
  4765. class Window_TargetHelp < Window_Help
  4766.   #--------------------------------------------------------------------------
  4767.   # ● 公開インスタンス変数
  4768.   #--------------------------------------------------------------------------
  4769.   attr_accessor :random_number  # 効果範囲ランダムの数
  4770.   #--------------------------------------------------------------------------
  4771.   # ● [オーバーライド]:オブジェクト初期化
  4772.   #--------------------------------------------------------------------------
  4773.   def initialize
  4774.     super(1) # 1行ヘルプ
  4775.   end
  4776.   #--------------------------------------------------------------------------
  4777.   # ● [オーバーライド]:ウィンドウの非表示
  4778.   #--------------------------------------------------------------------------
  4779.   def hide
  4780.     super
  4781.     clear
  4782.   end
  4783.   #--------------------------------------------------------------------------
  4784.   # ● [オーバーライド]:アイテム名設定
  4785.   #     item : スキル、アイテム、バトラー等
  4786.   #--------------------------------------------------------------------------
  4787.   def set_item(item)
  4788.     set_text(item ? item : "") # itemの説明ではなく、item自体を渡すようにする
  4789.   end
  4790.   #--------------------------------------------------------------------------
  4791.   # ● ゲージ幅
  4792.   #--------------------------------------------------------------------------
  4793.   def gauge_width
  4794.     LNX11::HELP_PARAM_WIDTH
  4795.   end
  4796.   #--------------------------------------------------------------------------
  4797.   # ● ゲージ幅(余白を含む)
  4798.   #--------------------------------------------------------------------------  
  4799.   def gauge_width_spacing
  4800.     LNX11::HELP_PARAM_WIDTH + 4
  4801.   end
  4802.   #--------------------------------------------------------------------------
  4803.   # ● パラメータエリアの幅
  4804.   #--------------------------------------------------------------------------  
  4805.   def param_width(size)
  4806.     gauge_width_spacing * size
  4807.   end
  4808.   #--------------------------------------------------------------------------
  4809.   # ● 効果範囲ランダムの数の取得
  4810.   #--------------------------------------------------------------------------
  4811.   def random_number
  4812.     # 全角にして返す
  4813.     @random_number.to_s.tr('0-9','0-9')
  4814.   end
  4815.   #--------------------------------------------------------------------------
  4816.   # ● [オーバーライド]:リフレッシュ
  4817.   #--------------------------------------------------------------------------
  4818.   def refresh
  4819.     contents.clear
  4820.     if @text == :party
  4821.       draw_text(contents.rect, "味方全体", 1)
  4822.     elsif @text == :troop
  4823.       draw_text(contents.rect, "敵全体", 1)
  4824.     elsif @text == :troop_random
  4825.       case LNX11::RANDOMSCOPE_DISPLAY
  4826.       when 0 ; draw_text(contents.rect, "敵全体 ランダム", 1)
  4827.       when 1 ; draw_text(contents.rect, "敵#{random_number}体 ランダム", 1)
  4828.       end
  4829.     elsif @text.is_a?(Game_Battler)
  4830.       # 選択対象の情報を描画
  4831.       draw_target_info
  4832.     elsif @text.is_a?(RPG::UsableItem)
  4833.       # アイテムかスキルならアイテム名を描画
  4834.       draw_item_name_help(@text)
  4835.     else
  4836.       # 通常のテキスト
  4837.       super
  4838.     end
  4839.   end
  4840.   #--------------------------------------------------------------------------
  4841.   # ● 選択対象の情報の描画
  4842.   #--------------------------------------------------------------------------
  4843.   def draw_target_info
  4844.     # バトラー情報の描画
  4845.     param = @text.actor? ? LNX11::HELP_ACTOR_PARAM : LNX11::HELP_ENEMY_PARAM
  4846.     # ゲージ付きステータス配列
  4847.     status = [param[:hp],param[:mp],param[:tp]&&$data_system.opt_display_tp]
  4848.     # 名前
  4849.     x = contents_width / 2 - contents.text_size(@text.name).width / 2
  4850.     name_width = contents.text_size(@text.name).width + 4
  4851.     if !status.include?(true)
  4852.       # ゲージ付きステータスを描画しない場合
  4853.       draw_targethelp_name(@text, x, name_width, param[:hp])
  4854.       x += name_width
  4855.       state_width = contents_width - x
  4856.     else
  4857.       # ゲージ付きステータスを描画する場合
  4858.       status.delete(false)
  4859.       x -= param_width(status.size) / 2
  4860.       draw_targethelp_name(@text, x, name_width, param[:hp])
  4861.       x += name_width
  4862.       state_width = contents_width - x - param_width(status.size)
  4863.     end
  4864.     # ステートアイコン
  4865.     if param[:state]
  4866.       draw_actor_icons(@text, x, 0, state_width)
  4867.     end
  4868.     # パラメータの描画
  4869.     x = contents_width - param_width(status.size)
  4870.     # HP
  4871.     if param[:hp]
  4872.       draw_actor_hp(@text, x, 0, gauge_width)
  4873.       x += gauge_width_spacing
  4874.     end
  4875.     # MP
  4876.     if param[:mp]
  4877.       draw_actor_mp(@text, x, 0, gauge_width)
  4878.       x += gauge_width_spacing
  4879.     end
  4880.     # TP
  4881.     if param[:tp] && $data_system.opt_display_tp
  4882.       draw_actor_tp(@text, x, 0, gauge_width)
  4883.       x += gauge_width_spacing
  4884.     end
  4885.   end
  4886.   #--------------------------------------------------------------------------
  4887.   # ● ターゲットの名前描画
  4888.   #--------------------------------------------------------------------------
  4889.   def draw_targethelp_name(actor, x, name_width, hp)
  4890.     if hp
  4891.       # HPゲージを伴う場合(HPが少ない場合、名前の色が変化する)
  4892.       draw_actor_name(actor, x, 0, name_width)
  4893.     else
  4894.       text = actor.name
  4895.       draw_text(x, 0, text_size(text).width + 4, line_height, text)
  4896.     end
  4897.   end
  4898.   #--------------------------------------------------------------------------
  4899.   # ● アイテムの描画(中央揃え)
  4900.   #--------------------------------------------------------------------------
  4901.   def draw_item_name_help(item)
  4902.     case LNX11::HELPDISPLAY_TYPE
  4903.     when 0 # アイコン+名前
  4904.       w = contents.text_size(@text.name).width + 28
  4905.     when 1 # 名前のみ
  4906.       w = contents.text_size(@text.name).width + 4
  4907.     end
  4908.     # 簡易説明文の描画
  4909.     if !@text.short_description.empty?
  4910.       des = LNX11::HELPDISPLAY_DESCRIPTION
  4911.       contents.font.size = des[:size]
  4912.       text = des[:delimiter] + @text.short_description
  4913.       rect = contents.text_size(text)
  4914.       w += rect.width
  4915.       x = (contents_width - w) / 2
  4916.       y = (line_height - rect.height) / 2
  4917.       draw_text(x, y, w, line_height, text, 2)
  4918.       reset_font_settings
  4919.     end
  4920.     # 名前の描画
  4921.     x = (contents_width - w) / 2
  4922.     case LNX11::HELPDISPLAY_TYPE
  4923.     when 0 # アイコン+名前
  4924.       draw_item_name(@text, x, 0, true, w)
  4925.     when 1 # 名前のみ
  4926.       draw_text(x, 0, contents_width, line_height, @text.name)
  4927.     end
  4928.   end
  4929. end
  4930.  
  4931. #==============================================================================
  4932. # ■ Window_PartyCommand
  4933. #------------------------------------------------------------------------------
  4934. #  バトル画面で、戦うか逃げるかを選択するウィンドウです。
  4935. #==============================================================================
  4936.  
  4937. class Window_PartyCommand < Window_Command
  4938.   #--------------------------------------------------------------------------
  4939.   # ● [エイリアス]:オブジェクト初期化
  4940.   #--------------------------------------------------------------------------
  4941.   alias :lnx11a_initialize :initialize
  4942.   def initialize
  4943.     $game_party.last_party_command = nil
  4944.     # 元のメソッドを呼ぶ
  4945.     lnx11a_initialize
  4946.     # 座標を設定
  4947.     self.x = LNX11::PARTY_COMMAND_XY[:x]
  4948.     self.y = LNX11::PARTY_COMMAND_XY[:y]
  4949.   end
  4950.   #--------------------------------------------------------------------------
  4951.   # ● [オーバーライド]:ウィンドウ幅の取得
  4952.   #--------------------------------------------------------------------------
  4953.   def window_width
  4954.     return LNX11::PARTY_COMMAND_WIDTH
  4955.   end
  4956.   #--------------------------------------------------------------------------
  4957.   # ● [オーバーライド]:表示行数の取得
  4958.   #--------------------------------------------------------------------------
  4959.   def visible_line_number
  4960.     return LNX11::PARTY_COMMAND_HORIZON ? 1 : @list.size
  4961.   end
  4962.   #--------------------------------------------------------------------------
  4963.   # ● [オーバーライド]:桁数の取得
  4964.   #--------------------------------------------------------------------------
  4965.   def col_max
  4966.     return LNX11::PARTY_COMMAND_HORIZON ? @list.size : 1
  4967.   end
  4968.   #--------------------------------------------------------------------------
  4969.   # ● [オーバーライド]:アライメントの取得
  4970.   #--------------------------------------------------------------------------
  4971.   def alignment
  4972.     return LNX11::PARTY_COMMAND_ALIGNMENT
  4973.   end
  4974.   #--------------------------------------------------------------------------
  4975.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  4976.   #--------------------------------------------------------------------------
  4977.   def spacing
  4978.     return 8
  4979.   end
  4980.   #--------------------------------------------------------------------------
  4981.   # ● [オーバーライド]:ウィンドウを開く
  4982.   #--------------------------------------------------------------------------
  4983.   def open
  4984.     super
  4985.     # 最後に選択したコマンドを選択
  4986.     return self unless LNX11::LAST_PARTY_COMMAND
  4987.     last_command = $game_party.last_party_command
  4988.     if last_command && @list.include?(last_command)
  4989.       select(@list.index(last_command))
  4990.     end
  4991.     self
  4992.   end
  4993.   #--------------------------------------------------------------------------
  4994.   # ● [エイリアス]:ウィンドウを閉じる
  4995.   #--------------------------------------------------------------------------
  4996.   def close
  4997.     super
  4998.     # 選択したコマンドを記憶
  4999.     $game_party.last_party_command = @list[index] if index >= 0
  5000.     self
  5001.   end
  5002. end
  5003.  
  5004. #==============================================================================
  5005. # ■ Window_ActorCommand
  5006. #------------------------------------------------------------------------------
  5007. #  バトル画面で、アクターの行動を選択するウィンドウです。
  5008. #==============================================================================
  5009.  
  5010. class Window_ActorCommand < Window_Command
  5011.   include LNX11_Window_ActiveVisible
  5012.   #--------------------------------------------------------------------------
  5013.   # ● [オーバーライド]:ウィンドウ幅の取得
  5014.   #--------------------------------------------------------------------------
  5015.   def window_width
  5016.     return LNX11::ACTOR_COMMAND_WIDTH
  5017.   end
  5018.   #--------------------------------------------------------------------------
  5019.   # ● [オーバーライド]:表示行数の取得
  5020.   #--------------------------------------------------------------------------
  5021.   def visible_line_number
  5022.     list_size = LNX11::ACTOR_COMMAND_NOSCROLL ? @list.size : 4
  5023.     return LNX11::ACTOR_COMMAND_HORIZON ? 1 : list_size
  5024.   end
  5025.   #--------------------------------------------------------------------------
  5026.   # ● [オーバーライド]:桁数の取得
  5027.   #--------------------------------------------------------------------------
  5028.   def col_max
  5029.     return LNX11::ACTOR_COMMAND_HORIZON ? [@list.size, 1].max :  1
  5030.   end
  5031.   #--------------------------------------------------------------------------
  5032.   # ● [オーバーライド]:アライメントの取得
  5033.   #--------------------------------------------------------------------------
  5034.   def alignment
  5035.     return LNX11::ACTOR_COMMAND_ALIGNMENT
  5036.   end
  5037.   #--------------------------------------------------------------------------
  5038.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  5039.   #--------------------------------------------------------------------------
  5040.   def spacing
  5041.     return 8
  5042.   end
  5043.   #--------------------------------------------------------------------------
  5044.   # ● [追加]:X 座標をアクターに合わせる
  5045.   #--------------------------------------------------------------------------
  5046.   def actor_x(actor)
  5047.     ax = $game_party.members_screen_x_nooffset[actor.index] - self.width / 2
  5048.     pad = LNX11::STATUS_SIDE_PADDING / 2
  5049.     # 画面内に収める
  5050.     self.x = [[ax, pad].max, Graphics.width - pad - self.width].min
  5051.     self.x += LNX11::ACTOR_COMMAND_OFFSET[:x]
  5052.   end
  5053.   #--------------------------------------------------------------------------
  5054.   # ● [追加]:Y 座標をアクターに合わせる
  5055.   #--------------------------------------------------------------------------
  5056.   def actor_y(actor)
  5057.     self.y = actor.screen_y_top - self.height
  5058.     self.y += LNX11::ACTOR_COMMAND_OFFSET[:y]
  5059.   end
  5060.   #--------------------------------------------------------------------------
  5061.   # ● [追加]:固定 Y 座標
  5062.   #--------------------------------------------------------------------------
  5063.   def screen_y
  5064.     if LNX11::ACTOR_COMMAND_Y_POSITION == 0
  5065.       self.y = Graphics.height - self.height + LNX11::ACTOR_COMMAND_OFFSET[:y]
  5066.     else
  5067.       self.y = LNX11::ACTOR_COMMAND_OFFSET[:y]
  5068.     end
  5069.   end
  5070.   #--------------------------------------------------------------------------
  5071.   # ● [エイリアス]:セットアップ
  5072.   #--------------------------------------------------------------------------
  5073.   alias :lnx11a_setup :setup
  5074.   def setup(actor)
  5075.     # 前のアクターのコマンドを記憶
  5076.     @actor.last_actor_command = @list[index] if @actor
  5077.     # 元のメソッドを呼ぶ
  5078.     lnx11a_setup(actor)
  5079.     self.arrows_visible = !LNX11::ACTOR_COMMAND_NOSCROLL
  5080.     self.height = window_height
  5081.     self.oy = 0
  5082.     # アクターコマンドの表示位置で分岐
  5083.     case LNX11::ACTOR_COMMAND_POSITION
  5084.     when 0
  5085.       # アクターの頭上
  5086.       actor_x(actor)
  5087.       actor_y(actor)
  5088.     when 1
  5089.       # Y 座標固定
  5090.       actor_x(actor)
  5091.       screen_y
  5092.     when 2
  5093.       # XY固定
  5094.       self.x = LNX11::ACTOR_COMMAND_OFFSET[:x]
  5095.       screen_y
  5096.     end
  5097.     # 最後に選択したコマンドを選択
  5098.     return unless LNX11::LAST_ACTOR_COMMAND
  5099.     last_command = @actor.last_actor_command
  5100.     if last_command && @list.include?(last_command)
  5101.       select(@list.index(last_command))
  5102.     end
  5103.   end
  5104. end
  5105.  
  5106. #==============================================================================
  5107. # ■ Window_BattleStatus
  5108. #------------------------------------------------------------------------------
  5109. #  バトル画面で、パーティメンバーのステータスを表示するウィンドウです。
  5110. #==============================================================================
  5111.  
  5112. class Window_BattleStatus < Window_Selectable
  5113.   #--------------------------------------------------------------------------
  5114.   # ● [追加]:公開インスタンス変数
  5115.   #--------------------------------------------------------------------------
  5116.   attr_reader :min_offset   # ステータス描画 X 座標の位置修正
  5117.   #--------------------------------------------------------------------------
  5118.   # ● [エイリアス]:オブジェクト初期化
  5119.   #--------------------------------------------------------------------------
  5120.   alias :lnx11a_initialize :initialize
  5121.   def initialize
  5122.     @actor_last_status = Array.new($game_party.max_battle_members) { nil }   
  5123.     # 元のメソッドを呼ぶ
  5124.     lnx11a_initialize
  5125.     # ウィンドウを最初から表示
  5126.     self.openness = 255
  5127.     self.opacity = 0
  5128.     update_invisible
  5129.   end
  5130.   #--------------------------------------------------------------------------
  5131.   # ● [オーバーライド]:行の高さを取得
  5132.   #--------------------------------------------------------------------------
  5133.   def line_height
  5134.     return LNX11::STATUS_LINE_HEIGHT
  5135.   end
  5136.   #--------------------------------------------------------------------------
  5137.   # ● [オーバーライド]:標準パディングサイズの取得
  5138.   #--------------------------------------------------------------------------
  5139.   def standard_padding
  5140.     return 0
  5141.   end
  5142.   #--------------------------------------------------------------------------
  5143.   # ● [オーバーライド]:表示行数の取得
  5144.   #--------------------------------------------------------------------------
  5145.   def visible_line_number
  5146.     return $data_system.opt_display_tp ? 4 : 3
  5147.   end
  5148.   #--------------------------------------------------------------------------
  5149.   # ● [オーバーライド]:桁数の取得
  5150.   #--------------------------------------------------------------------------
  5151.   def col_max
  5152.     return [item_max, 1].max
  5153.   end
  5154.   #--------------------------------------------------------------------------
  5155.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  5156.   #--------------------------------------------------------------------------
  5157.   def spacing
  5158.     return 0
  5159.   end
  5160.   #--------------------------------------------------------------------------
  5161.   # ● [オーバーライド]:項目の高さを取得
  5162.   #--------------------------------------------------------------------------
  5163.   def item_height
  5164.     self.height
  5165.   end  
  5166.   #--------------------------------------------------------------------------
  5167.   # ● [再定義]:ウィンドウ幅の取得
  5168.   #--------------------------------------------------------------------------
  5169.   def window_width
  5170.     Graphics.width
  5171.   end
  5172.   #--------------------------------------------------------------------------
  5173.   # ● [エイリアス]:ウィンドウ高さの取得
  5174.   #--------------------------------------------------------------------------
  5175.   alias :lnx11a_window_height :window_height
  5176.   def window_height
  5177.     # 一行目(名前・ステート)の高さを確保する
  5178.     lnx11a_window_height - line_height + [24, line_height].max
  5179.   end
  5180.   #--------------------------------------------------------------------------
  5181.   # ● [オーバーライド]:カーソルの更新
  5182.   #--------------------------------------------------------------------------
  5183.   def update_cursor
  5184.     # カーソルを表示しない
  5185.     cursor_rect.empty
  5186.   end
  5187.   #--------------------------------------------------------------------------
  5188.   # ● [オーバーライド]:システム色の取得
  5189.   #  ゲージ幅が短すぎる場合、HP,MP,TP の文字を非表示にします。
  5190.   #--------------------------------------------------------------------------
  5191.   def system_color
  5192.     gauge_area_width - @min_offset >= 52 ? super : Color.new
  5193.   end  
  5194.   #--------------------------------------------------------------------------
  5195.   # ● [オーバーライド]:ゲージ背景色の取得
  5196.   #   ゲージの透明度を適用します。  
  5197.   #--------------------------------------------------------------------------
  5198.   def gauge_back_color
  5199.     color = super
  5200.     color.alpha *= LNX11::STATUS_GAUGE_OPACITY / 255.0
  5201.     color
  5202.   end
  5203.   #--------------------------------------------------------------------------
  5204.   # ● [オーバーライド]:ゲージの描画
  5205.   #   ゲージの透明度を適用します。
  5206.   #--------------------------------------------------------------------------
  5207.   def draw_gauge(x, y, width, rate, color1, color2)
  5208.     oparate = LNX11::STATUS_GAUGE_OPACITY / 255.0
  5209.     color1.alpha *= oparate
  5210.     color2.alpha *= oparate
  5211.     super
  5212.   end
  5213.   #--------------------------------------------------------------------------
  5214.   # ● [オーバーライド]:フレーム更新
  5215.   #--------------------------------------------------------------------------
  5216.   def update
  5217.     super
  5218.     update_invisible
  5219.   end
  5220.   #--------------------------------------------------------------------------
  5221.   # ● [追加]:表示状態更新
  5222.   #--------------------------------------------------------------------------
  5223.   def update_invisible
  5224.     self.contents_opacity = $game_party.status_invisible ? 0 : 255
  5225.   end  
  5226.   #--------------------------------------------------------------------------
  5227.   # ● [追加]:アクターオブジェクト取得
  5228.   #--------------------------------------------------------------------------
  5229.   def actor
  5230.     $game_party.members[@index]
  5231.   end
  5232.   #--------------------------------------------------------------------------
  5233.   # ● [追加]:座標の設定
  5234.   #--------------------------------------------------------------------------
  5235.   def set_xy
  5236.     # ステータス位置の調整:画面からはみ出ないようにする
  5237.     pw = $game_party.members_screen_x.last + LNX11::STATUS_OFFSET[:x]
  5238.     pw += gauge_area_width / 2
  5239.     right_end = Graphics.width - LNX11::STATUS_SIDE_PADDING
  5240.     min_offset = pw > right_end ? pw - right_end : 0
  5241.     # ステータスのオフセットを適用
  5242.     self.x = LNX11::STATUS_OFFSET[:x] - min_offset
  5243.     self.y = LNX11::STATUS_OFFSET[:y] + Graphics.height - self.height
  5244.     # ステータス幅の自動調整:位置を調整した分だけ幅を縮める
  5245.     @min_offset = LNX11::STATUS_AUTOADJUST ? min_offset : 0
  5246.   end
  5247.   #--------------------------------------------------------------------------
  5248.   # ● [再定義]:ゲージエリアの幅を取得
  5249.   #--------------------------------------------------------------------------
  5250.   def gauge_area_width
  5251.     return LNX11::STATUS_WIDTH
  5252.   end
  5253.   #--------------------------------------------------------------------------
  5254.   # ● [追加]:表示するステート数の取得
  5255.   #--------------------------------------------------------------------------
  5256.   def states(actor, width)
  5257.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  5258.     icons.size
  5259.   end
  5260.   #--------------------------------------------------------------------------
  5261.   # ● [追加]:名前とステートの描画(1行表示)
  5262.   #  width の範囲で名前を左揃え、ステートアイコンを右揃えで描画します。
  5263.   # ステートを優先して表示するため、アイコンが多すぎて名前の表示領域が
  5264.   # 極端に狭くなる場合は名前を描画しません。
  5265.   #--------------------------------------------------------------------------
  5266.   def draw_actor_name_with_icons(actor, x, y, width = 128, draw_name = true)
  5267.     # アイコンのY座標補正
  5268.     iy = ([line_height, 24].max - 24) / 2
  5269.     # 名前のY座標補正
  5270.     ny = ([line_height, 24].max - LNX11::STATUS_NAME_SIZE) / 2
  5271.     # 表示するステート数を取得
  5272.     icon = states(actor, width)
  5273.     if icon > 0
  5274.       # 表示するべきステートがある場合
  5275.       name_width = width - icon * 24
  5276.       ix = x + width - icon * 24
  5277.       if name_width >= contents.font.size * 2 && draw_name
  5278.         # 名前の表示領域(width) が フォントサイズ * 2 以上なら両方を描画
  5279.         draw_actor_name(actor, x, y + ny,  name_width)
  5280.         iw = width - name_width
  5281.         draw_actor_icons(actor, ix, y + iy, iw)
  5282.       else
  5283.         # ステートのみ描画
  5284.         draw_actor_icons(actor, ix, y + iy, width)
  5285.       end
  5286.     elsif draw_name
  5287.       # ない場合、名前のみ描画
  5288.       draw_actor_name(actor, x, y + ny, width)
  5289.     end
  5290.   end
  5291.   #--------------------------------------------------------------------------
  5292.   # ● [再定義]:リフレッシュ
  5293.   #--------------------------------------------------------------------------
  5294.   def refresh
  5295.     set_xy
  5296.     draw_all_items
  5297.   end
  5298.   #--------------------------------------------------------------------------
  5299.   # ● [オーバーライド]:項目を描画する矩形の取得
  5300.   #--------------------------------------------------------------------------
  5301.   def item_rect(index)
  5302.     rect = super
  5303.     rect.x = $game_party.members_screen_x[index] - gauge_area_width / 2
  5304.     rect.width = gauge_area_width
  5305.     rect
  5306.   end
  5307.   #--------------------------------------------------------------------------
  5308.   # ● [再定義]:基本エリアの矩形を取得
  5309.   #--------------------------------------------------------------------------
  5310.   def basic_area_rect(index)
  5311.     rect = item_rect(index)
  5312.     rect
  5313.   end
  5314.   #--------------------------------------------------------------------------
  5315.   # ● [再定義]:ゲージエリアの矩形を取得
  5316.   #--------------------------------------------------------------------------
  5317.   def gauge_area_rect(index)
  5318.     rect = basic_area_rect(index)
  5319.     rect.y += [24, line_height].max
  5320.     rect.x += @min_offset
  5321.     rect
  5322.   end
  5323.   #--------------------------------------------------------------------------
  5324.   # ● [再定義]:基本エリアの描画
  5325.   #--------------------------------------------------------------------------
  5326.   def draw_basic_area(rect, actor)
  5327.     # フォントサイズ変更
  5328.     contents.font.size = [LNX11::STATUS_NAME_SIZE, 8].max
  5329.     # 名前とステートを描画
  5330.     dn = LNX11::STATUS_NAME_SIZE > 0 # 名前を描画するか?
  5331.     width = gauge_area_width - @min_offset
  5332.     rest  = width % 24
  5333.     width += 24 - rest if rest > 0
  5334.     draw_actor_name_with_icons(actor, rect.x, rect.y, width, dn)
  5335.     # フォントサイズを元に戻す
  5336.     reset_font_settings
  5337.   end
  5338.   #--------------------------------------------------------------------------
  5339.   # ● [エイリアス]:ゲージエリアの描画
  5340.   #--------------------------------------------------------------------------
  5341.   alias :lnx11a_draw_gauge_area :draw_gauge_area
  5342.   def draw_gauge_area(*args)
  5343.     # フォントサイズ変更
  5344.     contents.font.size = LNX11::STATUS_PARAM_SIZE
  5345.     # 元のメソッドを呼ぶ
  5346.     lnx11a_draw_gauge_area(*args)
  5347.     # フォントサイズを元に戻す
  5348.     reset_font_settings
  5349.   end
  5350.   #--------------------------------------------------------------------------
  5351.   # ● [再定義]:ゲージエリアの描画(TP あり)
  5352.   #--------------------------------------------------------------------------
  5353.   def draw_gauge_area_with_tp(rect, actor)
  5354.     width = gauge_area_width - @min_offset
  5355.     draw_actor_hp(actor, rect.x, rect.y,                   width)
  5356.     draw_actor_mp(actor, rect.x, rect.y + line_height,     width)
  5357.     draw_actor_tp(actor, rect.x, rect.y + line_height * 2, width)
  5358.   end
  5359.   #--------------------------------------------------------------------------
  5360.   # ● [再定義]:ゲージエリアの描画(TP なし)
  5361.   #--------------------------------------------------------------------------
  5362.   def draw_gauge_area_without_tp(rect, actor)
  5363.     draw_actor_hp(actor, rect.x, rect.y,               gauge_area_width)
  5364.     draw_actor_mp(actor, rect.x, rect.y + line_height, gauge_area_width)
  5365.   end
  5366.   #--------------------------------------------------------------------------
  5367.   # ● [再定義]:項目の描画
  5368.   #--------------------------------------------------------------------------
  5369.   def draw_item(index)
  5370.     actor = $game_party.battle_members[index]
  5371.     a_status = status(actor)
  5372.     # ステータスが変化した場合のみ描画する
  5373.     return if @actor_last_status[index] == a_status
  5374.     @actor_last_status[index] = a_status
  5375.     contents.clear_rect(item_rect(index))
  5376.     draw_basic_area(basic_area_rect(index), actor)
  5377.     draw_gauge_area(gauge_area_rect(index), actor)
  5378.   end
  5379.   #--------------------------------------------------------------------------
  5380.   # ● [追加]:アクターのステータス配列を返す
  5381.   #--------------------------------------------------------------------------
  5382.   def status(actor)
  5383.     if $data_system.opt_display_tp
  5384.       return [actor.name, actor.state_icons + actor.buff_icons,
  5385.               actor.mhp, actor.hp, actor.mmp, actor.mp, actor.max_tp, actor.tp]
  5386.     else
  5387.       # TP を除くステータス配列
  5388.       return [actor.name, actor.state_icons + actor.buff_icons,
  5389.               actor.mhp, actor.hp, actor.mmp, actor.mp]
  5390.     end
  5391.   end
  5392.   #--------------------------------------------------------------------------
  5393.   # ● [追加]:内容の消去
  5394.   #--------------------------------------------------------------------------
  5395.   def all_clear
  5396.     contents.clear
  5397.     @actor_last_status = Array.new($game_party.max_battle_members) { nil }   
  5398.   end
  5399. end
  5400.  
  5401. #==============================================================================
  5402. # ■ Window_BattleActor
  5403. #------------------------------------------------------------------------------
  5404. #  バトル画面で、行動対象のアクターを選択するウィンドウです。
  5405. # XPスタイルバトルではバトルステータスを非表示にしないため、
  5406. # 選択機能だけを持つ不可視のウィンドウとして扱います。
  5407. #==============================================================================
  5408.  
  5409. class Window_BattleActor < Window_BattleStatus
  5410.   include LNX11_Window_TargetHelp
  5411.   #--------------------------------------------------------------------------
  5412.   # ● [エイリアス]:オブジェクト初期化
  5413.   #--------------------------------------------------------------------------
  5414.   alias :lnx11a_wba_initialize :initialize
  5415.   def initialize(info_viewport)
  5416.     # 元のメソッドを呼ぶ
  5417.     lnx11a_wba_initialize(info_viewport)
  5418.     # ウィンドウを画面外に移動
  5419.     self.y = Graphics.height
  5420.   end
  5421.   #--------------------------------------------------------------------------
  5422.   # ● [オーバーライド]:ヘルプテキスト更新
  5423.   #--------------------------------------------------------------------------
  5424.   def update_help
  5425.     @help_window.set_item(targetcursor)
  5426.   end
  5427.   #--------------------------------------------------------------------------
  5428.   # ● [追加]:ターゲットカーソルに渡すオブジェクト
  5429.   #--------------------------------------------------------------------------
  5430.   def targetcursor
  5431.     @cursor_all ? :party : actor
  5432.   end
  5433.   #--------------------------------------------------------------------------
  5434.   # ● [オーバーライド]:ウィンドウ幅の取得
  5435.   #--------------------------------------------------------------------------
  5436.   def window_width
  5437.     64
  5438.   end
  5439.   #--------------------------------------------------------------------------
  5440.   # ● [オーバーライド]:全項目の描画
  5441.   #--------------------------------------------------------------------------
  5442.   def draw_all_items
  5443.     # 何もしない   
  5444.   end
  5445.   #--------------------------------------------------------------------------
  5446.   # ● [オーバーライド]:項目の描画
  5447.   #--------------------------------------------------------------------------
  5448.   def draw_item(index)
  5449.     # 何もしない
  5450.   end
  5451.   #--------------------------------------------------------------------------
  5452.   # ● [オーバーライド]:リフレッシュ
  5453.   #--------------------------------------------------------------------------
  5454.   def refresh
  5455.     # 何もしない
  5456.   end
  5457.   #--------------------------------------------------------------------------
  5458.   # ● [エイリアス]:ウィンドウの表示
  5459.   #--------------------------------------------------------------------------
  5460.   alias :lnx11a_show :show
  5461.   def show
  5462.     # 元のメソッドを呼ぶ
  5463.     lnx11a_show
  5464.     # 最後に選択したアクターを選択
  5465.     last_target = $game_temp.last_target_cursor[:actor]
  5466.     if last_target && $game_party.members.include?(last_target) &&
  5467.        LNX11::LAST_TARGET
  5468.       select($game_party.members.index(last_target))
  5469.     end
  5470.     # スマートターゲットセレクト
  5471.     if LNX11::SMART_TARGET_SELECT && !@cursor_fix
  5472.       if @dead_friend && (!last_target || last_target && last_target.alive?)
  5473.         dead_actor = $game_party.dead_members[0]
  5474.         select($game_party.members.index(dead_actor)) if dead_actor
  5475.       elsif !@dead_friend && (!last_target || last_target && last_target.dead?)
  5476.         alive_actor = $game_party.alive_members[0]
  5477.         select($game_party.members.index(alive_actor)) if alive_actor
  5478.       end
  5479.     end
  5480.     self
  5481.   end
  5482.   #--------------------------------------------------------------------------
  5483.   # ● [エイリアス]:ウィンドウの非表示
  5484.   #--------------------------------------------------------------------------
  5485.   alias :lnx11a_hide :hide
  5486.   def hide
  5487.     # 元のメソッドを呼ぶ
  5488.     lnx11a_hide
  5489.     # 選択したアクターを記憶
  5490.     $game_temp.last_target_cursor[:actor] = actor
  5491.     self
  5492.   end
  5493. end
  5494.  
  5495. #==============================================================================
  5496. # ■ Window_BattleEnemy
  5497. #------------------------------------------------------------------------------
  5498. #  バトル画面で、行動対象の敵キャラを選択するウィンドウです。
  5499. # 横並びの不可視のウィンドウとして扱います。
  5500. #==============================================================================
  5501.  
  5502. class Window_BattleEnemy < Window_Selectable
  5503.   include LNX11_Window_TargetHelp
  5504.   #--------------------------------------------------------------------------
  5505.   # ● [エイリアス]:オブジェクト初期化
  5506.   #--------------------------------------------------------------------------
  5507.   alias :lnx11a_initialize :initialize
  5508.   def initialize(info_viewport)
  5509.     # 敵キャラオブジェクトの設定
  5510.     set_enemy
  5511.     # 元のメソッドを呼ぶ
  5512.     lnx11a_initialize(info_viewport)
  5513.     # ウィンドウを画面外に移動
  5514.     self.y = Graphics.height
  5515.   end
  5516.   #--------------------------------------------------------------------------
  5517.   # ● [追加]:敵キャラオブジェクトの設定
  5518.   #--------------------------------------------------------------------------
  5519.   def set_enemy
  5520.     if LNX11::TROOP_X_SORT
  5521.       @troop = $game_troop.alive_members.sort {|a,b| a.screen_x <=> b.screen_x}
  5522.     else
  5523.       @troop = $game_troop.alive_members
  5524.     end
  5525.   end
  5526.   #--------------------------------------------------------------------------
  5527.   # ● [再定義]:敵キャラオブジェクト取得
  5528.   #--------------------------------------------------------------------------
  5529.   def enemy
  5530.     @troop[@index]
  5531.   end
  5532.   #--------------------------------------------------------------------------
  5533.   # ● [オーバーライド]:ウィンドウ幅の取得
  5534.   #--------------------------------------------------------------------------
  5535.   def window_width
  5536.     64
  5537.   end
  5538.   #--------------------------------------------------------------------------
  5539.   # ● [オーバーライド]:指定行数に適合するウィンドウの高さを計算
  5540.   #--------------------------------------------------------------------------
  5541.   def fitting_height(line_number)
  5542.     super(1)
  5543.   end
  5544.   #--------------------------------------------------------------------------
  5545.   # ● [オーバーライド]:桁数の取得
  5546.   #--------------------------------------------------------------------------
  5547.   def col_max
  5548.     return item_max
  5549.   end
  5550.   #--------------------------------------------------------------------------
  5551.   # ● [オーバーライド]:ヘルプテキスト更新
  5552.   #--------------------------------------------------------------------------
  5553.   def update_help
  5554.     @help_window.random_number = @random_number
  5555.     @help_window.set_item(targetcursor)
  5556.   end
  5557.   #--------------------------------------------------------------------------
  5558.   # ● [追加]:ターゲットカーソルに渡すオブジェクト
  5559.   #--------------------------------------------------------------------------
  5560.   def targetcursor
  5561.     @cursor_all ? (@cursor_random ? :troop_random : :troop) : enemy
  5562.   end
  5563.   #--------------------------------------------------------------------------
  5564.   # ● [エイリアス]:ウィンドウの表示
  5565.   #--------------------------------------------------------------------------
  5566.   alias :lnx11a_show :show
  5567.   def show
  5568.     # 元のメソッドを呼ぶ
  5569.     lnx11a_show
  5570.     # 敵キャラオブジェクトの設定
  5571.     set_enemy
  5572.     return self unless LNX11::LAST_TARGET
  5573.     # 最後に選択した敵キャラを選択
  5574.     last_target = $game_temp.last_target_cursor[:enemy]
  5575.     if last_target && @troop.include?(last_target)
  5576.       select(@troop.index(last_target))
  5577.     end
  5578.     self
  5579.   end
  5580.   #--------------------------------------------------------------------------
  5581.   # ● [エイリアス]:ウィンドウの非表示
  5582.   #--------------------------------------------------------------------------
  5583.   alias :lnx11a_hide :hide
  5584.   def hide
  5585.     # 元のメソッドを呼ぶ
  5586.     lnx11a_hide
  5587.     # 選択した敵キャラを記憶
  5588.     $game_temp.last_target_cursor[:enemy] = enemy
  5589.     self
  5590.   end
  5591. end
  5592.  
  5593. #==============================================================================
  5594. # ■ Window_BattleSkill
  5595. #------------------------------------------------------------------------------
  5596. #  いくつかのモジュールをインクルードします。
  5597. #==============================================================================
  5598.  
  5599. class Window_BattleSkill < Window_SkillList
  5600.   include LNX11_Window_ActiveVisible
  5601.   include LNX11_Window_FittingList if LNX11::FITTING_LIST
  5602. end
  5603.  
  5604. #==============================================================================
  5605. # ■ Window_BattleItem
  5606. #------------------------------------------------------------------------------
  5607. #  いくつかのモジュールをインクルードします。
  5608. #==============================================================================
  5609.  
  5610. class Window_BattleItem < Window_ItemList
  5611.   include LNX11_Window_ActiveVisible
  5612.   include LNX11_Window_FittingList if LNX11::FITTING_LIST
  5613. end
  5614. # l:5608


三、
RUBY 代码复制
  1. #==============================================================================
  2. # ★ RGSS3-Extension
  3. # LNX11b_リフォーム・バトルステータス
  4. #  Spriteでパラメータやゲージを実装した動的なバトルステータスです。
  5. #  画像や設定を変更することでデザインをアレンジすることが可能です。
  6. #   
  7. #  * このスクリプトは LNX11a_XPスタイルバトル の機能拡張スクリプトです。
  8. #  LNX11a_XPスタイルバトル より下のセクションに導入してください。
  9. #
  10. #  また、ステータスの各要素の配置設定を行う
  11. #  LNX11bskin_リフォーム・バトルステータス#スキン設定 も必ず導入してください。
  12. #
  13. #  version   : 1.01 (12/03/13)
  14. #  author    : ももまる
  15. #  reference : [url]http://peachround.blog.fc2.com/blog-entry-12.html[/url]
  16. #
  17. #==============================================================================
  18.  
  19. #==============================================================================
  20. # ■ LNXスクリプト導入情報
  21. #==============================================================================
  22. $lnx_include = {} if $lnx_include == nil
  23. $lnx_include[:lnx11b] = 101 # version
  24. module LNX11b ; end
  25. unless $lnx_include[:lnx11a]
  26.   p "NG:LNX11b_リフォーム・バトルステータス"
  27.   text = "LNX11b: Error! LNX11a より下位のセクションに配置してください。"
  28.   p text
  29.   msgbox text
  30.   exit
  31. end
  32. p "OK:LNX11b_リフォーム・バトルステータス"
  33.  
  34. #==============================================================================
  35. # ■ Window_BattleStatus
  36. #------------------------------------------------------------------------------
  37. #  バトル画面で、パーティメンバーのステータスを表示するウィンドウです。
  38. #==============================================================================
  39.  
  40. class Window_BattleStatus < Window_Selectable
  41.   #--------------------------------------------------------------------------
  42.   # ● [エイリアス]:オブジェクト初期化
  43.   #--------------------------------------------------------------------------
  44.   alias :lnx11b_initialize :initialize
  45.   def initialize
  46.     unless $lnx_include[:lnx11bskin]
  47.       text = "LNX11b:Error! LNX11bskin が導入されていません。"
  48.       p text
  49.       msgbox text
  50.       exit
  51.     end
  52.     @sprite_viewport = Viewport.new
  53.     # 元のメソッドを呼ぶ
  54.     lnx11b_initialize
  55.     @sprite_viewport.z = self.z
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● [オーバーライド]解放
  59.   #--------------------------------------------------------------------------
  60.   def dispose
  61.     @sprite_viewport.dispose
  62.     dispose_status_sprites
  63.     super
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # ● [オーバーライド]:表示行数の取得
  67.   #--------------------------------------------------------------------------
  68.   def visible_line_number
  69.     return 4
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● [オーバーライド]:行の高さを取得
  73.   #--------------------------------------------------------------------------
  74.   def line_height
  75.     return 24 # ステートアイコン描画領域を確保
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● [オーバーライド]:フレーム更新
  79.   #--------------------------------------------------------------------------
  80.   def update
  81.     super
  82.     update_invisible
  83.     update_status_sprites
  84.   end  
  85.   #--------------------------------------------------------------------------
  86.   # ● [再定義]:表示状態更新
  87.   #--------------------------------------------------------------------------
  88.   def update_invisible
  89.     @sprite_viewport.visible = !$game_party.status_invisible
  90.   end  
  91.   #--------------------------------------------------------------------------
  92.   # ● [再定義]:リフレッシュ
  93.   #--------------------------------------------------------------------------
  94.   def refresh
  95.     set_xy
  96.     # ステータススプライトの作成
  97.     create_status_sprites
  98.     draw_all_items
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ● [追加]:ステータススプライトの作成
  102.   #--------------------------------------------------------------------------
  103.   def create_status_sprites
  104.     return if @sprite != nil
  105.     @sprite = []
  106.     $game_party.battle_members.each_with_index do |actor, i|
  107.       @sprite[i] = Spriteset_BattleStatus.new(actor, self, @sprite_viewport)
  108.     end
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ● [追加]:ステータススプライトの解放
  112.   #--------------------------------------------------------------------------
  113.   def dispose_status_sprites
  114.     return unless @sprite
  115.     @sprite.each do |sprite|
  116.       sprite.dispose
  117.     end
  118.     @sprite = nil
  119.   end
  120.   #--------------------------------------------------------------------------
  121.   # ● [追加]:ステータススプライトの更新
  122.   #--------------------------------------------------------------------------
  123.   def update_status_sprites
  124.     return unless @sprite
  125.     @sprite.each {|sprite| sprite.update}
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ● [再定義]:基本エリアの描画
  129.   #--------------------------------------------------------------------------
  130.   def draw_basic_area(rect, actor)
  131.     # スプライトの更新
  132.     @sprite[actor.index].refresh
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● [再定義]:ゲージエリアの描画
  136.   #--------------------------------------------------------------------------
  137.   def draw_gauge_area(*args)
  138.     # 何もしない
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● [エイリアス]:内容の消去
  142.   #--------------------------------------------------------------------------
  143.   alias :lnx11b_all_clear :all_clear
  144.   def all_clear
  145.     # 元のメソッドを呼ぶ
  146.     lnx11b_all_clear
  147.     # ステータススプライトの解放
  148.     dispose_status_sprites
  149.   end
  150. end
  151.  
  152. #==============================================================================
  153. # ■ [追加]:Spriteset_BattleStatus
  154. #------------------------------------------------------------------------------
  155. #  スプライトによるバトルステータス。
  156. #==============================================================================
  157.  
  158. class Spriteset_BattleStatus
  159.   include LNX11
  160.   include LNX11b
  161.   #--------------------------------------------------------------------------
  162.   # ● オブジェクト初期化
  163.   #--------------------------------------------------------------------------  
  164.   def initialize(battler, status_window, viewport = nil)
  165.     @battler = battler
  166.     @viewport = viewport
  167.     @status_window = status_window
  168.     # 基準座標
  169.     @x = $game_party.members_screen_x[battler.index] + STATUS_OFFSET[:x]
  170.     @x -= STATUS_WIDTH / 2
  171.     @y = @status_window.y + STATUS_OFFSET[:y]
  172.     # メインスキン
  173.     @main_skin_sprite = create_skin(MAIN_SKIN)
  174.     # ステート
  175.     @state_skin_sprite = create_skin(STATE_SKIN)
  176.     @state_icon = create_state_icon(STATE_ICON)
  177.     # 名前
  178.     @name_sprite = create_name(NAME)
  179.     # 数字
  180.     num = @battler.hp ; max = @battler.mhp
  181.     @hp_number_sprite = create_number(num, max, HP_NUMBER_FORMAT)
  182.     num = @battler.mp ; max = @battler.mmp
  183.     @mp_number_sprite = create_number(num, max, MP_NUMBER_FORMAT)
  184.     if $data_system.opt_display_tp
  185.       num = @battler.tp ; max = @battler.max_tp
  186.       @tp_number_sprite = create_number(num, max, TP_NUMBER_FORMAT)
  187.     end
  188.     # 数字(最大値)
  189.     num = @battler.mhp
  190.     @mhp_number_sprite = create_number(num, num, MAXHP_NUMBER_FORMAT)
  191.     num = @battler.mmp
  192.     @mmp_number_sprite = create_number(num, num, MAXMP_NUMBER_FORMAT)
  193.     if $data_system.opt_display_tp
  194.       num = @battler.max_tp
  195.       @mtp_number_sprite = create_number(num, num, MAXTP_NUMBER_FORMAT)
  196.     end
  197.     # ゲージ
  198.     @hp_gauge_sprite = create_gauge(@battler.hp_rate, HP_GAUGE_FORMAT)
  199.     @mp_gauge_sprite = create_gauge(@battler.mp_rate, MP_GAUGE_FORMAT)
  200.     if $data_system.opt_display_tp
  201.       @tp_gauge_sprite = create_gauge(@battler.tp_rate, TP_GAUGE_FORMAT)
  202.     end
  203.     # ゲージと数字スプライトの同期
  204.     if HP_GAUGE_FORMAT[:number_link] && @hp_number_sprite
  205.       @hp_gauge_sprite.number = @hp_number_sprite if @hp_gauge_sprite
  206.     end
  207.     if MP_GAUGE_FORMAT[:number_link] && @mp_number_sprite
  208.       @mp_gauge_sprite.number = @mp_number_sprite if @mp_gauge_sprite
  209.     end
  210.     if TP_GAUGE_FORMAT[:number_link] && @tp_number_sprite
  211.       @tp_gauge_sprite.number = @tp_number_sprite if @tp_gauge_sprite
  212.     end
  213.     # 更新するスプライトの配列
  214.     @sprites = [@main_skin_sprite, @state_skin_sprite, @state_icon,
  215.       @name_sprite, @hp_number_sprite, @mp_number_sprite, @tp_number_sprite,
  216.       @mhp_number_sprite, @mmp_number_sprite, @mtp_number_sprite,
  217.       @hp_gauge_sprite, @mp_gauge_sprite, @tp_gauge_sprite]
  218.     @sprites.delete(nil)
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ● 解放
  222.   #--------------------------------------------------------------------------  
  223.   def dispose
  224.     @sprites.each {|sprite| sprite.dispose }
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ● フレーム更新
  228.   #--------------------------------------------------------------------------
  229.   def update
  230.     @sprites.each {|sprite| sprite.update }
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # ● スプライトの位置設定
  234.   #--------------------------------------------------------------------------  
  235.   def move(sprite, format)
  236.     # 表示基準 X 座標
  237.     x = format[:x_fixed] ? @x : @x - @status_window.min_offset     
  238.     sprite.move(x + format[:x], @y + format[:y], format[:z])
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● スキンの作成
  242.   #--------------------------------------------------------------------------  
  243.   def create_skin(format)
  244.     return nil unless format[:enabled]
  245.     sprite = Sprite_Skin.new(format, @viewport)
  246.     move(sprite, format)
  247.     return sprite
  248.   end
  249.   #--------------------------------------------------------------------------
  250.   # ● 名前の作成
  251.   #--------------------------------------------------------------------------  
  252.   def create_name(format)
  253.     return nil unless format[:enabled]
  254.     sprite = Sprite_BattlerName.new(@battler, format, @viewport)
  255.     move(sprite, format)
  256.     return sprite
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● 数字の作成
  260.   #--------------------------------------------------------------------------  
  261.   def create_number(num, max, format)
  262.     return nil unless format[:enabled]
  263.     sprite = Sprite_Number.new(num, max, format, @viewport)
  264.     move(sprite, format)
  265.     return sprite
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ● ゲージの作成
  269.   #--------------------------------------------------------------------------  
  270.   def create_gauge(rate, format)
  271.     return nil unless format[:enabled]
  272.     case format[:type]
  273.     when 0 # 横ゲージ
  274.       sprite = Sprite_HorzGauge.new(rate, format, @viewport)
  275.     when 1 # セルゲージ
  276.       sprite = Sprite_CellGauge.new(rate, format, @viewport)
  277.     end
  278.     move(sprite, format)
  279.     return sprite
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● ステートアイコンの作成
  283.   #--------------------------------------------------------------------------  
  284.   def create_state_icon(format)
  285.     return nil unless format[:enabled]
  286.     sprite = Sprite_StateIcon.new(@battler, @status_window, format, @viewport)
  287.     move(sprite, format)
  288.     return sprite
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ● リフレッシュ
  292.   #--------------------------------------------------------------------------
  293.   def refresh
  294.     # ゲージ
  295.     @hp_gauge_sprite.set(@battler.hp_rate) if @hp_gauge_sprite
  296.     @mp_gauge_sprite.set(@battler.mp_rate) if @mp_gauge_sprite
  297.     @tp_gauge_sprite.set(@battler.tp_rate) if @tp_gauge_sprite
  298.     # 数字
  299.     @hp_number_sprite.set(@battler.hp, @battler.mhp) if @hp_number_sprite
  300.     @mp_number_sprite.set(@battler.mp, @battler.mmp) if @mp_number_sprite
  301.     @tp_number_sprite.set(@battler.tp, @battler.max_tp) if @tp_number_sprite
  302.     # 数字(最大値)
  303.     @mhp_number_sprite.set(@battler.mhp, @battler.mhp) if @mhp_number_sprite
  304.     @mmp_number_sprite.set(@battler.mmp, @battler.mmp) if @mmp_number_sprite
  305.     mtp = @battler.max_tp
  306.     @mtp_number_sprite.set(mtp, mtp) if @mtp_number_sprite
  307.     # ステート
  308.     @state_icon.refresh if @state_icon
  309.     @state_skin_sprite.visible = @state_icon.visible if @state_skin_sprite
  310.     # 名前
  311.     if @name_sprite
  312.       @name_sprite.refresh
  313.       if @state_icon && NAME[:auto_hide]
  314.         @name_sprite.visible = !@state_icon.visible
  315.       end
  316.     end
  317.   end
  318. end
  319.  
  320. module LNX11
  321.   # X 座標の自動調整を行う
  322.   STATUS_AUTOADJUST = true
  323. end
  324.  
  325. #==============================================================================
  326. # ■ [追加]:Sprite_BattleStatus
  327. #------------------------------------------------------------------------------
  328. #  バトルステータスのスプライト群のスーパークラス。
  329. #==============================================================================
  330.  
  331. class Sprite_BattleStatus < Sprite
  332.   #--------------------------------------------------------------------------
  333.   # ● 移動
  334.   #--------------------------------------------------------------------------
  335.   def move(x, y, z)
  336.     self.x = x
  337.     self.y = y
  338.     self.z = z
  339.   end
  340. end
  341.  
  342. #==============================================================================
  343. # ■ [追加]:Sprite_Skin
  344. #------------------------------------------------------------------------------
  345. #  バトルステータス:スキンのスプライト。
  346. #==============================================================================
  347.  
  348. class Sprite_Skin < Sprite_BattleStatus
  349.   #--------------------------------------------------------------------------
  350.   # ● オブジェクト初期化
  351.   #--------------------------------------------------------------------------  
  352.   def initialize(format, viewport = nil)
  353.     super(viewport)
  354.     self.bitmap = Cache.system(format[:bitmap])
  355.   end
  356. end
  357.  
  358. #==============================================================================
  359. # ■ [追加]:Sprite_BattlerName
  360. #------------------------------------------------------------------------------
  361. #  バトルステータス:名前を表示するスプライト。
  362. #==============================================================================
  363.  
  364. class Sprite_BattlerName < Sprite_BattleStatus
  365.   #--------------------------------------------------------------------------
  366.   # ● オブジェクト初期化
  367.   #--------------------------------------------------------------------------  
  368.   def initialize(battler, format, viewport = nil)
  369.     super(viewport)
  370.     @battler = battler
  371.     @format = format
  372.     @name = ""
  373.     refresh
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● ビットマップの解放
  377.   #--------------------------------------------------------------------------  
  378.   def bitmap_dispose
  379.     self.bitmap.dispose if self.bitmap && !self.bitmap.disposed?
  380.     self.bitmap = nil
  381.   end
  382.   #--------------------------------------------------------------------------
  383.   # ● リフレッシュ
  384.   #--------------------------------------------------------------------------  
  385.   def refresh
  386.     return if @name == @battler.name
  387.     @name = @battler.name
  388.     bitmap_dispose
  389.     if @format[:bitmap_name]
  390.       self.bitmap = Cache.system("name_#{@name}")
  391.     else
  392.       self.bitmap = Bitmap.new(@format[:width], @format[:height])
  393.       self.bitmap.font.name = @format[:name]
  394.       self.bitmap.font.size = @format[:size]
  395.       self.bitmap.font.bold = @format[:bold]
  396.       self.bitmap.font.italic = @format[:italic]
  397.       self.bitmap.font.color = @format[:color][0]
  398.       self.bitmap.font.out_color = @format[:color][1]  
  399.       self.bitmap.draw_text(self.bitmap.rect, @name, @format[:align])
  400.     end
  401.   end
  402. end
  403.  
  404. #==============================================================================
  405. # ■ [追加]:Sprite_HorzGauge
  406. #------------------------------------------------------------------------------
  407. #  バトルステータス:横方向のゲージ。
  408. #==============================================================================
  409.  
  410. class Sprite_HorzGauge < Sprite_BattleStatus
  411.   NUMBERS    = [0,1,2,3,4,5,6,7,8,9]
  412.   COLOR_SIZE = 4
  413.   # 0:通常 1:ピンチ 2:最大 3:サブゲージ
  414.   #--------------------------------------------------------------------------
  415.   # ● [追加]:公開インスタンス変数
  416.   #--------------------------------------------------------------------------
  417.   attr_accessor :number   # 同期する数字スプライト
  418.   #--------------------------------------------------------------------------
  419.   # ● オブジェクト初期化
  420.   #--------------------------------------------------------------------------  
  421.   def initialize(rate, format, viewport)
  422.     super(viewport)
  423.     self.bitmap = Cache.system(format[:bitmap])
  424.     @speed = format[:speed]
  425.     @s_speed = format[:s_speed]
  426.     @crisis = format[:crisis]   
  427.     @sub_gauge = Sprite.new(viewport)
  428.     @sub_gauge.bitmap = self.bitmap
  429.     @number = nil
  430.     color_set_rect(3, @sub_gauge)
  431.     set(rate, true)
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # ● 解放
  435.   #--------------------------------------------------------------------------  
  436.   def dispose
  437.     @sub_gauge.dispose
  438.     super
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● 移動
  442.   #--------------------------------------------------------------------------
  443.   def move(x, y, z)
  444.     super(x, y, z)
  445.     @sub_gauge.x = x
  446.     @sub_gauge.y = y
  447.     @sub_gauge.z = z - 1
  448.   end
  449.   #--------------------------------------------------------------------------
  450.   # ● ゲージ最大か?
  451.   #--------------------------------------------------------------------------
  452.   def max?
  453.     @gauge_width / max_gauge_widht >= 1.0
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # ● ゲージが少ない?
  457.   #--------------------------------------------------------------------------  
  458.   def crisis?
  459.     @gauge_width / max_gauge_widht < @crisis
  460.   end
  461.   #--------------------------------------------------------------------------
  462.   # ● 最大ゲージ幅の取得
  463.   #--------------------------------------------------------------------------
  464.   def max_gauge_widht
  465.     self.bitmap.width.to_f
  466.   end
  467.   #--------------------------------------------------------------------------
  468.   # ● ゲージ色変更(Rect)
  469.   #--------------------------------------------------------------------------
  470.   def color_set_rect(color, sprite)
  471.     sprite.src_rect.height = self.bitmap.height / COLOR_SIZE
  472.     sprite.src_rect.y = color * self.bitmap.height / COLOR_SIZE
  473.   end
  474.   #--------------------------------------------------------------------------
  475.   # ● ゲージ色変更
  476.   #--------------------------------------------------------------------------
  477.   def gauge_color_set
  478.     color_set_rect(max? ? 2 : crisis? ? 1 : 0, self)
  479.   end
  480.   #--------------------------------------------------------------------------
  481.   # ● フレーム更新
  482.   #--------------------------------------------------------------------------
  483.   def update
  484.     # メインゲージ幅の更新
  485.     if @real_gauge_width != @gauge_width
  486.       if @number
  487.         # 数字スプライトと同期
  488.         rate = @number.real_rate
  489.         width = ([max_gauge_widht * rate, rate != 0 ? 1 : 0].max).to_i
  490.         @real_gauge_width = width
  491.       else
  492.         @real_gauge_width = sma(@gauge_width, @real_gauge_width, @speed)
  493.       end
  494.       # ゲージ色変更
  495.       gauge_color_set
  496.     end
  497.     # サブゲージ幅の更新
  498.     if @sub_gauge_width > @gauge_width
  499.       @sub_gauge_width = [@sub_gauge_width - @s_speed, @gauge_width].max
  500.     elsif @sub_gauge_width != @gauge_width
  501.       @sub_gauge_width = @real_gauge_width
  502.     end
  503.     # スプライトの更新
  504.     update_sprite
  505.   end
  506.   #--------------------------------------------------------------------------
  507.   # ● スプライトの更新
  508.   #--------------------------------------------------------------------------
  509.   def update_sprite
  510.     self.src_rect.width = @real_gauge_width
  511.     @sub_gauge.x = self.x + @real_gauge_width
  512.     @sub_gauge.src_rect.x = @real_gauge_width
  513.     @sub_gauge.src_rect.width = @sub_gauge_width - @real_gauge_width
  514.   end
  515.   #--------------------------------------------------------------------------
  516.   # ● ゲージレートの設定
  517.   #--------------------------------------------------------------------------  
  518.   def set(rate, apply = false)
  519.     @gauge_rate = rate
  520.     @gauge_width = ([max_gauge_widht * rate, rate != 0 ? 1 : 0].max).to_i
  521.     # すぐに適用
  522.     if apply
  523.       @real_gauge_width = @gauge_width
  524.       @sub_gauge_width = @gauge_width
  525.       # ゲージ色変更
  526.       gauge_color_set
  527.       # スプライトの更新
  528.       update_sprite
  529.     end
  530.   end
  531.   #--------------------------------------------------------------------------
  532.   # ● 移動平均
  533.   #--------------------------------------------------------------------------
  534.   def sma(a, b, p)
  535.     # a = 目標位置 b = 現在地
  536.     return a if a == b || (a - b).abs < 0.3 || p == 1
  537.     result = ((a + b * (p.to_f - 1)) / p.to_f)
  538.     return (a - result).abs <= 1.0 ? (b < a ? b + 0.3 : b - 0.3) : result
  539.   end
  540. end
  541.  
  542. #==============================================================================
  543. # ■ [追加]:Sprite_CellGauge
  544. #------------------------------------------------------------------------------
  545. #  バトルステータス:値に応じたセルを参照して表示する擬似ゲージ。
  546. #==============================================================================
  547.  
  548. class Sprite_CellGauge < Sprite_BattleStatus
  549.   #--------------------------------------------------------------------------
  550.   # ● [追加]:公開インスタンス変数
  551.   #--------------------------------------------------------------------------
  552.   attr_accessor :number   # 同期する数字スプライト  
  553.   #--------------------------------------------------------------------------
  554.   # ● オブジェクト初期化
  555.   #--------------------------------------------------------------------------  
  556.   def initialize(rate, format, viewport)
  557.     super(viewport)
  558.     self.bitmap = Cache.system(format[:bitmap])
  559.     @speed = format[:speed]
  560.     @pattern = format[:pattern]
  561.     @pattern_direction = format[:direction]
  562.     @cell_width = format[:width]
  563.     @cell_height = format[:height]
  564.     # パターン
  565.     @horz_size = self.bitmap.width / @cell_width
  566.     @vtcl_size = self.bitmap.height / @cell_height
  567.     @number = nil
  568.     set(rate, true)
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● パターン数の取得
  572.   #--------------------------------------------------------------------------
  573.   def pattern
  574.     @pattern == :auto ? @horz_size * @vtcl_size - 1 : @pattern - 1
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ● フレーム更新
  578.   #--------------------------------------------------------------------------
  579.   def update
  580.     # メインゲージ幅の更新
  581.     if @real_rate.truncate != @rate.truncate
  582.       if number
  583.         # 数字スプライトと同期
  584.         @real_rate = @number.real_rate * 100
  585.       else
  586.         @real_rate = sma(@rate, @real_rate, @speed)
  587.       end
  588.       # スプライトの更新
  589.       update_sprite
  590.     end
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ● スプライトの更新
  594.   #--------------------------------------------------------------------------
  595.   def update_sprite
  596.     pt = (pattern * @real_rate / 100).truncate
  597.     if @pattern_direction == 0
  598.       # 横方向にパターンが並んでいる
  599.       cx = pt % @horz_size * @cell_width
  600.       cy = pt / @horz_size * @cell_height
  601.     else
  602.       # 縦方向にパターンが並んでいる
  603.       cx = pt / @vtcl_size * @cell_width
  604.       cy = pt % @vtcl_size * @cell_height
  605.     end
  606.     self.src_rect.set(cx, cy, @cell_width, @cell_height)
  607.   end
  608.   #--------------------------------------------------------------------------
  609.   # ● ゲージレートの設定
  610.   #--------------------------------------------------------------------------  
  611.   def set(rate, apply = false)
  612.     @rate = rate * 100
  613.     # すぐに適用
  614.     if apply
  615.       @real_rate = @rate
  616.       # スプライトの更新
  617.       update_sprite
  618.     end
  619.   end
  620.   #--------------------------------------------------------------------------
  621.   # ● 移動平均
  622.   #--------------------------------------------------------------------------
  623.   def sma(a, b, p)
  624.     # a = 目標位置 b = 現在地
  625.     return a if a == b || (a - b).abs < 0.3 || p == 1
  626.     result = ((a + b * (p.to_f - 1)) / p.to_f)
  627.     return (a - result).abs <= 1.0 ? (b < a ? b + 0.3 : b - 0.3) : result
  628.   end
  629. end
  630.  
  631. #==============================================================================
  632. # ■ [追加]:Sprite_Number
  633. #------------------------------------------------------------------------------
  634. #  バトルステータス:数字を表示するスプライト。
  635. #==============================================================================
  636.  
  637. class Sprite_Number < Sprite_BattleStatus
  638.   COLOR_SIZE = 3
  639.   # 0:通常
  640.   # 1:1/4(ピンチ)
  641.   # 2:死亡
  642.   #--------------------------------------------------------------------------
  643.   # ● オブジェクト初期化
  644.   #--------------------------------------------------------------------------  
  645.   def initialize(num, max, format, viewport = nil)
  646.     super(viewport)
  647.     @src_bitmap = Cache.system(format[:bitmap])
  648.     @speed = format[:speed]
  649.     @align  = format[:align]
  650.     @spacing = format[:spacing]
  651.     @crisis = format[:crisis]
  652.     @dead = format[:dead]
  653.     digit = format[:digit]
  654.     # 数字幅
  655.     @num_width = @src_bitmap.width / 10
  656.     # 数字高さ
  657.     @num_height = @src_bitmap.height / COLOR_SIZE
  658.     bw = @num_width * digit + @spacing * (digit - 1)   
  659.     self.bitmap = Bitmap.new(bw, @num_height)
  660.     # 文字揃えによる基準座標の変更
  661.     case @align
  662.     when 0 ; self.ox = 0
  663.     when 1 ; self.ox = self.width / 2
  664.     when 2 ; self.ox = self.width
  665.     end
  666.     # 初期値適用
  667.     set(num, max, true)
  668.   end
  669.   #--------------------------------------------------------------------------
  670.   # ● 解放
  671.   #--------------------------------------------------------------------------  
  672.   def dispose
  673.     self.bitmap.dispose
  674.     super
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # ● レートの取得
  678.   #--------------------------------------------------------------------------
  679.   def rate
  680.     @num / @max.to_f
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # ● 表示レートの取得
  684.   #--------------------------------------------------------------------------
  685.   def real_rate
  686.     @real_num / @max.to_f
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # ● 数値が少ない?
  690.   #--------------------------------------------------------------------------  
  691.   def crisis?
  692.     rate < @crisis
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ● 数値が 0 か?
  696.   #--------------------------------------------------------------------------  
  697.   def dead?
  698.     rate <= @dead
  699.   end
  700.   #--------------------------------------------------------------------------
  701.   # ● 数字色取得
  702.   #--------------------------------------------------------------------------
  703.   def number_color
  704.     dead? ? 2 : crisis? ? 1 : 0
  705.   end
  706.   #--------------------------------------------------------------------------
  707.   # ● フレーム更新
  708.   #--------------------------------------------------------------------------
  709.   def update
  710.     # 数値の更新
  711.     if @real_num != @num
  712.       ac = [1, ((@real_num - @num).abs / @speed).truncate].max
  713.       if @real_num > @num
  714.         @real_num = [@real_num - ac, @num].max
  715.       else
  716.         @real_num = [@real_num + ac, @num].min
  717.       end
  718.       # ビットマップの更新
  719.       update_bitmap
  720.     end
  721.   end
  722.   #--------------------------------------------------------------------------
  723.   # ● 数値の設定
  724.   #--------------------------------------------------------------------------  
  725.   def set(num, max, apply = false)
  726.     @num = num
  727.     @max = max
  728.     # すぐに適用
  729.     if apply
  730.       @real_num = @num
  731.       # ビットマップの更新
  732.       update_bitmap
  733.     end
  734.   end
  735.   #--------------------------------------------------------------------------
  736.   # ● ビットマップの更新
  737.   #--------------------------------------------------------------------------
  738.   def update_bitmap
  739.     self.bitmap.clear
  740.     # 数値を文字列の配列にする
  741.     numbers = (@real_num.to_i.abs.to_s).split(//)
  742.     # 数字の色
  743.     sy = @num_height * number_color
  744.     # ダメージ値の幅
  745.     nw = @num_width * numbers.size + @spacing * (numbers.size - 1)
  746.     # 描画 X 座標
  747.     case @align
  748.     when 0 ; bx = 0                            # 左揃え
  749.     when 1 ; bx = (self.bitmap.width - nw) / 2 # 中央揃え
  750.     when 2 ; bx = self.bitmap.width - nw       # 右揃え
  751.     end
  752.     # 数字を描画
  753.     rect = Rect.new(0, sy, @num_width, @num_height)
  754.     numbers.size.times do |n|
  755.       rect.x = numbers[n].to_i * @num_width
  756.       self.bitmap.blt(bx + @num_width * n + @spacing * n, 0, @src_bitmap, rect)
  757.     end
  758.   end
  759. end
  760.  
  761. #==============================================================================
  762. # ■ [追加]:Sprite_StateIcon
  763. #------------------------------------------------------------------------------
  764. #  バトルステータス:ステートアイコンをスクロール表示するスプライト。
  765. #==============================================================================
  766.  
  767. class Sprite_StateIcon < Sprite_BattleStatus
  768.   #--------------------------------------------------------------------------
  769.   # ● [追加]:公開インスタンス変数
  770.   #--------------------------------------------------------------------------
  771.   attr_reader :min_offset   # ステータス描画 X 座標の位置修正
  772.   #--------------------------------------------------------------------------
  773.   # ● オブジェクト初期化
  774.   #--------------------------------------------------------------------------  
  775.   def initialize(battler, bufwindow, format, viewport = nil)
  776.     super(viewport)
  777.     @battler = battler
  778.     @bufwindow = bufwindow
  779.     @size = format[:size]
  780.     @background_color = format[:background_color]
  781.     @scroll_interval = format[:scroll_interval]
  782.     @icons = [-128]
  783.     self.visible = false
  784.     # リフレッシュ
  785.     refresh
  786.   end
  787.   #--------------------------------------------------------------------------
  788.   # ● 解放
  789.   #--------------------------------------------------------------------------  
  790.   def dispose
  791.     bitmap_dispose
  792.     super
  793.   end
  794.   #--------------------------------------------------------------------------
  795.   # ● ビットマップの解放
  796.   #--------------------------------------------------------------------------  
  797.   def bitmap_dispose
  798.     self.visible = false
  799.     self.bitmap.dispose if self.bitmap && !self.bitmap.disposed?
  800.     self.bitmap = nil
  801.   end
  802.   #--------------------------------------------------------------------------
  803.   # ● ステートアイコン配列の取得
  804.   #--------------------------------------------------------------------------
  805.   def icons
  806.     @battler.state_icons + @battler.buff_icons
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # ● ステートアイコン数の取得
  810.   #--------------------------------------------------------------------------
  811.   def icons_size
  812.     @bufwindow.states(@battler, @bufwindow.contents_width)
  813.   end
  814.   #--------------------------------------------------------------------------
  815.   # ● スクロールのリセット
  816.   #--------------------------------------------------------------------------
  817.   def reset_scroll
  818.     self.src_rect.x = 0
  819.   end
  820.   #--------------------------------------------------------------------------
  821.   # ● スクロールを進める
  822.   #--------------------------------------------------------------------------
  823.   def update_scroll
  824.     self.src_rect.x += self.src_rect.width
  825.     reset_scroll if self.src_rect.x >= self.bitmap.width
  826.   end
  827.   #--------------------------------------------------------------------------
  828.   # ● フレーム更新
  829.   #--------------------------------------------------------------------------
  830.   def update
  831.     update_scroll if self.bitmap && Graphics.frame_count % @scroll_interval == 0
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● リフレッシュ
  835.   #--------------------------------------------------------------------------  
  836.   def refresh
  837.     i = icons
  838.     return if @icons == i
  839.     @icons = i
  840.     i_size = icons_size
  841.     # ビットマップの作成
  842.     bitmap_dispose if self.bitmap && !self.bitmap.disposed?
  843.     return if i_size == 0
  844.     self.visible = true
  845.     self.bitmap = Bitmap.new(i_size * 24, 24)
  846.     self.src_rect.set(0, 0, @size * 24, 24)
  847.     # バッファウィンドウにアイコンの描画
  848.     @bufwindow.contents.clear
  849.     @bufwindow.draw_actor_icons(@battler, 0, 0, @bufwindow.contents_width)
  850.     # 描画したアイコンをビットマップに転送
  851.     self.bitmap.fill_rect(self.bitmap.rect, @background_color)
  852.     self.bitmap.blt(0, 0, @bufwindow.contents, self.bitmap.rect)
  853.     @bufwindow.contents.clear
  854.     reset_scroll
  855.   end
  856. end


四、
RUBY 代码复制
  1. #==============================================================================
  2. # ★ RGSS3-Extension
  3. # LNX11bskin_リフォーム・バトルステータス#スキン設定
  4. #  ☆「スタンダード」プリセット
  5. #
  6. #  このスクリプトは LNX11b_リフォーム・バトルステータス の設定スクリプトです。
  7. #  LNX11b の動作に必須ですので、必ず導入してください。
  8. #  スキンファイルは Graphics/System にインポートしてください。
  9. #   
  10. #  version   : 1.00 (12/02/28)
  11. #  author    : ももまる
  12. #  reference : [url]http://peachround.blog.fc2.com/blog-entry-12.html[/url]
  13. #
  14. #==============================================================================
  15.  
  16. module LNX11
  17.   #--------------------------------------------------------------------------
  18.   # ● 基本設定
  19.   #--------------------------------------------------------------------------
  20.   # ステータス全体の座標調整  :x = X座標 / :y = Y座標
  21.   STATUS_OFFSET = {:x => 60, :y => 0}
  22.  
  23.   # アクター1人あたりのステータス幅
  24.   STATUS_WIDTH  = 64
  25. end
  26. module LNX11b
  27.   #--------------------------------------------------------------------------
  28.   # ● メインスキン
  29.   #--------------------------------------------------------------------------
  30.   MAIN_SKIN = {
  31.   :enabled => true,                # 表示するか? true = 表示 / false = 非表示
  32.   :bitmap  => "Lnx11b_mainskin",   # スキンのファイル名
  33.   :x_fixed => false,   # X 座標を自動調整しない   true = 有効 / false = 無効
  34.   :x =>  2, :y => 44, :z =>  0,    # XYZ 座標
  35.   }
  36.   #--------------------------------------------------------------------------
  37.   # ● ステートスキン
  38.   #--------------------------------------------------------------------------
  39.   STATE_SKIN = {
  40.   :enabled => true,                # 表示するか? true = 表示 / false = 非表示
  41.   :bitmap  => "Lnx11b_stateskin",  # スキンのファイル名
  42.   :x_fixed => true,      # X 座標を自動調整しない true = 有効 / false = 無効
  43.   :x => -80, :y => -18, :z => 2,   # XYZ 座標
  44.   }
  45.   #--------------------------------------------------------------------------
  46.   # ● ステートアイコン
  47.   #--------------------------------------------------------------------------
  48.   STATE_ICON = {
  49.   # ○ 基本
  50.   :enabled => true,    # 表示するか?           true = 表示 / false = 非表示
  51.   :x_fixed => true,    # X 座標を自動調整しない true = 有効 / false = 無効
  52.   :x => -76, :y => -8, :z => 1,    # XYZ 座標
  53.   # ○ 機能
  54.   :size             => 2,          # 一度に表示するアイコン数
  55.   :scroll_interval  => 30,         # スクロール速度(フレーム)
  56.   :background_color => Color.new(0, 0, 0, 0),  # ステートアイコンの背景色
  57.   }
  58.   #--------------------------------------------------------------------------
  59.   # ● 名前
  60.   #--------------------------------------------------------------------------
  61.   NAME = {
  62.   # ○ 基本
  63.   :enabled => false,  # 表示するか?           true = 表示 / false = 非表示
  64.   :x_fixed => true,   # X 座標を自動調整しない true = 有効 / false = 無効
  65.   :x => -76, :y => -8, :z => 2,     # XYZ 座標
  66.   # ○ 機能
  67.   :bitmap_name => false, # 名前表示に画像を使用する true = 有効 / false = 無効
  68.  
  69.     # bitmap_name => false :  名前表示に画像を使用しない場合
  70.     :width  => 96, :height => 20, # 名前のサイズ :width = 幅 / :height = 高さ
  71.     :name   => ["VL Gothic"], # フォント名
  72.     :size   => 16,            # フォントサイズ
  73.     :bold   => false,         # 太字    true = 有効 / false = 無効
  74.     :italic => false,         # 斜体    true = 有効 / false = 無効
  75.     :align  => 0,             # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  76.     # 描画色([文字色, 縁取り色])
  77.     :color  => [Color.new(255, 255, 255), Color.new(0, 0, 0, 192)],
  78.  
  79.   # ステートが表示されている時、自動的に隠す true = 有効 / false = 無効
  80.   :auto_hide   => true
  81.   }
  82.   #--------------------------------------------------------------------------
  83.   # ● HP ゲージ
  84.   #--------------------------------------------------------------------------
  85.   HP_GAUGE_FORMAT = {
  86.   # ○ 基本
  87.   :enabled => true,              # 表示するか?   true = 表示 / false = 非表示
  88.   :bitmap  => "Lnx11b_hpgauge",  # ゲージのファイル名
  89.   :x_fixed => false,     # X 座標を自動調整しない true = 有効 / false = 無効
  90.   :x => 6, :y => 55, :z => 2,    # XYZ 座標
  91.   # ○ 機能
  92.   :number_link => true,  # ゲージ量を表示されている表示と一致させる
  93.   :speed      => 4.0,   # ゲージ変化スピード 1.0以上(一致させない場合)
  94.   :type        => 0,     # ゲージタイプ 0 = 横ゲージ / 1 = セルゲージ
  95.  
  96.     # type => 0 : 横ゲージの設定
  97.     :crisis    => 0.25,  # ピンチ状態とみなすパーセンテージ
  98.     :s_speed   => 0.2,   # サブゲージ変化スピード(pixel per frame)
  99.  
  100.     # type => 1 : セルゲージの設定
  101.     :width => 36, :height => 36, # セルのサイズ :width = 幅 / :height = 高さ
  102.     :pattern   => :auto, # パターン数 :auto を指定するとパターン数を自動判定
  103.     :direction => 1,     # パターンの方向 0 = 横 / 1 = 縦
  104.   }
  105.   #--------------------------------------------------------------------------
  106.   # ● MP ゲージ
  107.   #--------------------------------------------------------------------------
  108.   MP_GAUGE_FORMAT = {
  109.   # ○ 基本
  110.   :enabled => true,             # 表示するか?     true = 表示 / false = 非表示
  111.   :bitmap  => "Lnx11b_mpgauge", # ゲージのファイル名
  112.   :x_fixed => false,      # X 座標を自動調整しない true = 有効 / false = 無効
  113.   :x => 6, :y => 77, :z => 2,   # XYZ 座標
  114.   # ○ 機能
  115.   :number_link => true,   # ゲージ量を表示されている表示と一致させる
  116.   :speed      => 4.0,    # ゲージ変化スピード 1.0以上(一致させない場合)  
  117.   :type        => 0,      # ゲージタイプ 0 = 横ゲージ / 1 = セルゲージ
  118.  
  119.     # type => 0 : 横ゲージの設定
  120.     :crisis    => 0.25,   # ピンチ状態とみなすパーセンテージ
  121.     :s_speed   => 0.2,    # サブゲージ変化スピード(pixel per frame)  
  122.  
  123.     # type => 1 : セルゲージの設定
  124.     :width     => 36, :height => 36, # セルのサイズ :width = 幅 / :height = 高さ
  125.     :pattern   => :auto,  # パターン数 :auto を指定するとパターン数を自動判定
  126.     :direction => 1,      # パターンの方向 0 = 横 / 1 = 縦
  127.   }
  128.   #--------------------------------------------------------------------------
  129.   # ● TP ゲージ
  130.   #--------------------------------------------------------------------------
  131.   TP_GAUGE_FORMAT = {
  132.   # ○ 基本
  133.   :enabled => true,              # 表示するか?   true = 表示 / false = 非表示
  134.   :bitmap  => "Lnx11b_tpcircle", # ゲージのファイル名
  135.   :x_fixed => false,     # X 座標を自動調整しない true = 有効 / false = 無効
  136.   :x => 16, :y => 0, :z => 3,    # XYZ 座標
  137.   # ○ 機能
  138.   :number_link => true,  # ゲージ量を表示されている表示と一致させる
  139.   :speed      => 4.0,   # ゲージ変化スピード 1.0以上(一致させない場合)  
  140.   :type        => 1,     # ゲージタイプ 0 = 横ゲージ / 1 = セルゲージ
  141.  
  142.     # type => 0 : 横ゲージの設定
  143.     :crisis    => 0.25,  # ピンチ状態とみなすパーセンテージ
  144.     :s_speed   => 0.2,   # サブゲージ変化スピード(pixel per frame)
  145.  
  146.     # type => 1 : セルゲージの設定
  147.     :width     => 36, :height => 36, # セルのサイズ :width = 幅 / :height = 高さ
  148.     :pattern   => :auto, # パターン数 :auto を指定するとパターン数を自動判定
  149.     :direction => 1,     # パターンの方向 0 = 横 / 1 = 縦
  150.   }
  151.   #--------------------------------------------------------------------------
  152.   # ● HP 数字
  153.   #--------------------------------------------------------------------------
  154.   HP_NUMBER_FORMAT = {
  155.   # ○ 基本
  156.   :enabled => true,                 # 表示するか? true = 表示 / false = 非表示
  157.   :bitmap  => "Lnx11b_largenumber", # 数字のファイル名
  158.   :x_fixed => false,   # X 座標を自動調整しない    true = 有効 / false = 無効
  159.   :x => 64, :y => 39, :z => 4,      # XYZ 座標
  160.   # ○ 機能
  161.   :digit   => 4,       # 桁数
  162.   :spacing => -2,      # 字間
  163.   :align   => 2,       # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  164.   :speed   => 12,      # 数字の変化スピード 1 以上
  165.   :crisis  => 0.25,    # ピンチ状態とみなすパーセンテージ
  166.   :dead    => 0.0,     # 死亡状態とみなすパーセンテージ
  167.   }
  168.   #--------------------------------------------------------------------------
  169.   # ● MP 数字
  170.   #--------------------------------------------------------------------------
  171.   MP_NUMBER_FORMAT = {
  172.   # ○ 基本
  173.   :enabled => true,                 # 表示するか? true = 表示 / false = 非表示
  174.   :bitmap  => "Lnx11b_largenumber", # 数字のファイル名
  175.   :x_fixed => false,   # X 座標を自動調整しない    true = 有効 / false = 無効
  176.   :x => 64, :y => 61, :z => 4,      # XYZ 座標
  177.   # ○ 機能
  178.   :digit   => 4,       # 桁数
  179.   :spacing => -2,      # 字間
  180.   :align   => 2,       # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  181.   :speed   => 12,      # 数字の変化スピード 1 以上
  182.   :crisis  => 0.25,    # ピンチ状態とみなすパーセンテージ
  183.   :dead    => -1.0,    # 死亡状態とみなすパーセンテージ
  184.   }
  185.   #--------------------------------------------------------------------------
  186.   # ● TP 数字
  187.   #--------------------------------------------------------------------------
  188.   TP_NUMBER_FORMAT = {
  189.   # ○ 基本
  190.   :enabled => true,                 # 表示するか? true = 表示 / false = 非表示
  191.   :bitmap  => "Lnx11b_smallnumber", # 数字のファイル名
  192.   :x_fixed => false,   # X 座標を自動調整しない    true = 有効 / false = 無効
  193.   :x => 34, :y => 14, :z => 5,      # XYZ 座標
  194.   # ○ 機能
  195.   :digit   => 3,       # 桁数
  196.   :spacing => -2,      # 字間
  197.   :align   => 1,       # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  198.   :speed   => 12,      # 数字の変化スピード 1 以上
  199.   :crisis  => -1.0,    # ピンチ状態とみなすパーセンテージ
  200.   :dead    => -1.0,    # 死亡状態とみなすパーセンテージ
  201.   }
  202.   #--------------------------------------------------------------------------
  203.   # ● 最大 HP 数字
  204.   #--------------------------------------------------------------------------
  205.   MAXHP_NUMBER_FORMAT = {
  206.   # ○ 基本
  207.   :enabled => false,                # 表示するか? true = 表示 / false = 非表示
  208.   :bitmap  => "Lnx11b_smallnumber", # 数字のファイル名
  209.   :x_fixed => false,   # X 座標を自動調整しない    true = 有効 / false = 無効
  210.   :x => 64, :y => 39, :z => 6,      # XYZ 座標
  211.   # ○ 機能
  212.   :digit   => 4,       # 桁数
  213.   :spacing => -2,      # 字間
  214.   :align   => 0,       # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  215.   :speed   => 12,      # 数字の変化スピード 1 以上
  216.   :crisis  => 0.25,    # ピンチ状態とみなすパーセンテージ
  217.   :dead    => 0.0,     # 死亡状態とみなすパーセンテージ
  218.   }  
  219.   #--------------------------------------------------------------------------
  220.   # ● 最大 MP 数字
  221.   #--------------------------------------------------------------------------
  222.   MAXMP_NUMBER_FORMAT = {
  223.   # ○ 基本
  224.   :enabled => false,                # 表示するか? true = 表示 / false = 非表示
  225.   :bitmap  => "Lnx11b_smallnumber", # 数字のファイル名
  226.   :x_fixed => false,   # X 座標を自動調整しない    true = 有効 / false = 無効
  227.   :x => 64, :y => 61, :z => 6,      # XYZ 座標
  228.   # ○ 機能
  229.   :digit   => 4,       # 桁数
  230.   :spacing => -2,      # 字間
  231.   :align   => 0,       # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  232.   :speed   => 12,      # 数字の変化スピード 1 以上
  233.   :crisis  => 0.25,    # ピンチ状態とみなすパーセンテージ
  234.   :dead    => -1.0,    # 死亡状態とみなすパーセンテージ
  235.   }  
  236.   #--------------------------------------------------------------------------
  237.   # ● 最大 TP 数字
  238.   #--------------------------------------------------------------------------
  239.   MAXTP_NUMBER_FORMAT = {
  240.   # ○ 基本
  241.   :enabled => false,                # 表示するか? true = 表示 / false = 非表示
  242.   :bitmap  => "Lnx11b_smallnumber", # 数字のファイル名
  243.   :x_fixed => false,   # X 座標を自動調整しない    true = 有効 / false = 無効
  244.   :x => 34, :y => 26, :z => 6,      # XYZ 座標
  245.   # ○ 機能
  246.   :digit   => 3,       # 桁数
  247.   :spacing => -2,      # 字間
  248.   :align   => 1,       # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  249.   :speed   => 12,      # 数字の変化スピード 1 以上
  250.   :crisis  => -1.0,    # ピンチ状態とみなすパーセンテージ
  251.   :dead    => -1.0,    # 死亡状態とみなすパーセンテージ
  252.   }
  253.   #
  254.   # 設定ここまで お疲れ様でした。
  255.   #
  256. end
  257. #==============================================================================
  258. # ■ LNXスクリプト導入情報
  259. #==============================================================================
  260. $lnx_include = {} if $lnx_include == nil
  261. $lnx_include[:lnx11bskin] = 100 # version
  262. p "OK:LNX11bskin_リフォーム・バトルステータス#スキン設定"


大功告成!


樓主如果要增加浮動狀態圖標的話

以中毒為範例,在備註加上文字,如圖:

付加ポップアップ表示名="_poison_add"
解除ポップアップ表示名="_poison_remove"
修飾文字非表示

表示名的後面要寫的文字為圖檔名稱的
請參考:


效果圖:

点评

我已經提供了的說.............................  发表于 2013-8-18 01:12
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-5-13 00:53

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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