查看: 1898|回复: 0

[已经过期] “显示敌人动画”在被二刀流角色攻击之后出现镜面错误

[复制链接]

漾夕☽星化残月☾

梦石
0
星屑
8611
在线时间
3858 小时
注册时间
2015-5-12
回帖
2022

剧作品鉴家

发表于 2016-7-24 19:32:15 | 显示全部楼层 |阅读模式

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

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

×
如题。如果敌人被二刀流角色攻击之后。播放“显示敌人动画”就会出现镜面的错误非常难看。
我试着在事件之前加入
  1. @animation_mirror = false
复制代码

或者
  1.     @animation_id = 0
  2.     @animation_mirror = false
  3.     @sprite_effect_type = nil
复制代码

都无效。请问有没有什么解决方法。麻烦看帖的各位了。


附我所加入的改变战斗的脚本
XPstyle_battle(超长注意)

  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. # ■ LNXスクリプト導入情報
  13. #==============================================================================
  14. $lnx_include = {} if $lnx_include == nil
  15. $lnx_include[:lnx11a] = 111 # version
  16. p "OK:LNX11a_XPスタイルバトル ver1.11"

  17. module LNX11
  18.   #--------------------------------------------------------------------------
  19.   # ● 正規表現
  20.   #--------------------------------------------------------------------------
  21.   # アクター:バトラーグラフィック = "ファイル名"
  22.   RE_BATTLER = /(?:バトラーグラフィック|battler_graphic)\s*=\s*"([^"]*)"/i
  23.   # アイテム/スキル:使用時アニメ = アニメーションID
  24.   RE_USE_ANIMATION = /(?:使用時アニメ|use_animation)\s*=\s*(\d+)/i
  25.   # アイテム/スキル:ヘルプ説明 = "説明文"
  26.   RE_SHORT_DESCRIPTION =/(?:ヘルプ説明|short_description)\s*=\s*"([^"]*)"/i
  27.   # アイテム/スキル:ヘルプ非表示
  28.   RE_USABLEITEM_NO_DISPLAY = /(?:ヘルプ非表示|no_display)/i
  29.   # アイテム/スキル:使用時追加ウェイト = duration
  30.   RE_DISPLAY_WAIT = /(?:使用時追加ウェイト|display_wait)\s*=\s*(\d+)/i
  31.   # アイテム/スキル:終了時追加ウェイト = duration
  32.   RE_END_WAIT = /(?:終了時追加ウェイト|end_wait)\s*=\s*(\d+)/i
  33.   # 敵キャラ:通常攻撃アニメ = アニメーションID
  34.   RE_ATK_ANIMATION = /(?:通常攻撃アニメ|atk_animation)\s*=\s*(\d+)/i
  35.   # ステート:ステートアニメ = アニメーションID
  36.   RE_STATE_ANIMATION = /(?:ステートアニメ|state_animation)\s*=\s*(\d+)/i
  37.   # ステート:ポップアップ表示名 = "表示名"
  38.   RE_STATE_DISPLAY = /(?:ポップアップ表示名|display_name)\s*=\s*"([^"]*)"/i
  39.   # ステート:ポップアップ非表示
  40.   RE_STATE_NO_DISPLAY = /(?:ポップアップ非表示|no_display)/i
  41.   # ステート:付加ポップアップ非表示
  42.   RE_STATE_ADD_NO_DISPLAY = /(?:付加ポップアップ非表示|add_no_display)/i
  43.   # ステート:解除ポップアップ非表示
  44.   RE_STATE_REM_NO_DISPLAY = /(?:解除ポップアップ非表示|remove_no_display)/i
  45.   # ステート:有利なステート
  46.   RE_STATE_ADVANTAGE = /(?:有利なステート|advantage_state)/i
  47.   # ステート:ポップアップタイプ = type_id
  48.   RE_STATE_TYPE = /(?:ポップアップタイプ|popup_type)\s*=\s*(\d+)/i
  49.   # ステート:付加ポップアップタイプ = type_id
  50.   RE_STATE_ADD_TYPE = /(?:付加ポップアップタイプ|add_popup_type)\s*=\s*(\d+)/i
  51.   # ステート:解除ポップアップタイプ = type_id
  52.   RE_STATE_REM_TYPE=/(?:解除ポップアップタイプ|remove_popup_type)\s*=\s*(\d+)/i
  53.   # ステート:修飾文字非表示
  54.   RE_STATE_NO_DECORATION = /(?:修飾文字非表示|no_decoration)/i
  55.   # ステート:付加修飾文字非表示
  56.   RE_STATE_ADD_NO_DECORATION = /(?:付加修飾文字非表示|add_no_decoration)/i
  57.   # ステート:解除修飾文字非表示
  58.   RE_STATE_REM_NO_DECORATION = /(?:解除修飾文字非表示|remove_no_decoration)/i
  59.   # <<ver1.10>>
  60.   # ステート:付加ポップアップ表示名 = "表示名"
  61.   RE_STATE_ADD_DISPLAY =
  62.   /(?:付加ポップアップ表示名|add_display_name)\s*=\s*"([^"]*)"/i
  63.   # ステート:解除ポップアップ表示名 = "表示名"
  64.   RE_STATE_REM_DISPLAY =
  65.   /(?:解除ポップアップ表示名|remove_display_name)\s*=\s*"([^"]*)"/i
  66.   #--------------------------------------------------------------------------
  67.   # ● バトルステータス更新
  68.   #--------------------------------------------------------------------------
  69.   # LNX11.バトルステータス更新
  70.   def self.battle_status_refresh
  71.     $game_temp.battle_status_refresh
  72.   end
  73.   def self.バトルステータス更新
  74.     self.battle_status_refresh
  75.   end  
  76.   #--------------------------------------------------------------------------
  77.   # ● アクターエリア表示/非表示
  78.   #--------------------------------------------------------------------------
  79.   # LNX11.アクターエリア表示
  80.   def self.actor_area_show
  81.     self.actor_show
  82.     self.status_show
  83.     self.actor_bg_show
  84.   end
  85.   def self.アクターエリア表示
  86.     self.actor_area_show
  87.   end
  88.   # LNX11.アクターエリア非表示
  89.   def self.actor_area_hide
  90.     self.actor_hide
  91.     self.status_hide
  92.     self.actor_bg_hide
  93.   end
  94.   def self.アクターエリア非表示
  95.     self.actor_area_hide
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # ● アクター表示/非表示
  99.   #--------------------------------------------------------------------------
  100.   # LNX11.アクター表示
  101.   def self.actor_show
  102.     $game_party.actor_invisible = false
  103.   end
  104.   def self.アクター表示
  105.     self.actor_show
  106.   end
  107.   # LNX11.アクター非表示
  108.   def self.actor_hide
  109.     $game_party.actor_invisible = true
  110.   end
  111.   def self.アクター非表示
  112.     self.actor_hide
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● バトルステータス表示/非表示
  116.   #--------------------------------------------------------------------------
  117.   # LNX11.バトルステータス表示
  118.   def self.status_show
  119.     $game_party.status_invisible = false
  120.     self.battle_status_refresh
  121.   end
  122.   def self.バトルステータス表示
  123.     self.status_show
  124.   end
  125.   # LNX11.バトルステータス非表示
  126.   def self.status_hide
  127.     $game_party.status_invisible = true
  128.     self.battle_status_refresh
  129.   end
  130.   def self.バトルステータス非表示
  131.     self.status_hide
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● アクター背景表示/非表示
  135.   #--------------------------------------------------------------------------
  136.   # LNX11.アクター背景表示
  137.   def self.actor_bg_show
  138.     $game_party.actor_bg_invisible = false
  139.   end
  140.   def self.アクター背景表示
  141.     self.actor_bg_show
  142.   end
  143.   # LNX11.アクター背景非表示
  144.   def self.actor_bg_hide
  145.     $game_party.actor_bg_invisible = true
  146.   end
  147.   def self.アクター背景非表示
  148.     self.actor_bg_hide
  149.   end  
  150.   #--------------------------------------------------------------------------
  151.   # ● バトラーグラフィックのスクリプト指定
  152.   #--------------------------------------------------------------------------
  153.   # LNX11.バトラーグラフィック(id, filename)
  154.   def self.battler_graphic(id ,filename)
  155.     if id.is_a?(Numeric) && filename.is_a?(String)
  156.       p "LNX11a:バトラーグラフィックを変更しました:ID#{id} #{filename}"
  157.       $game_actors[id].battler_graphic_name = filename
  158.     else
  159.       errormes =  "LNX11a:バトラーグラフィック指定の引数が正しくありません。"
  160.       p errormes, "LNX11a:バトラーグラフィックの指定は行われませんでした。"
  161.       msgbox errormes
  162.     end
  163.   end
  164.   def self.バトラーグラフィック(id ,filename)
  165.     self.battler_graphic(id ,filename)
  166.   end
  167.   #--------------------------------------------------------------------------
  168.   # ● 任意のポップアップを生成
  169.   #--------------------------------------------------------------------------
  170.   # LNX11.ポップアップ(battler, popup, type, color, deco)
  171.   def self.make_popup(battler, popup, type = 0, color = :hp_damage, deco = nil)
  172.     return unless $game_party.in_battle
  173.     target = self.battler_search(battler)
  174.     unless target.is_a?(Game_Battler)
  175.       p "LNX11a:任意のポップアップの生成に失敗しました。バトラー指定が"
  176.       p "LNX11a:間違っているか、バトラーが存在していない可能性があります。"
  177.       return
  178.     end
  179.     $game_temp.popup_data.popup_custom(target, popup, type, color, deco)   
  180.   end
  181.   def self.ポップアップ(battler, popup, type=0, color=:hp_damage, deco=nil)
  182.     self.make_popup(battler, popup, type, color, deco)
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● バトラー指定
  186.   #--------------------------------------------------------------------------
  187.   def self.battler_search(val)
  188.     if val.is_a?(String)
  189.       # 名前指定
  190.       a = ($game_party.members + $game_troop.members).find {|b| b.name == val }
  191.       return a
  192.     elsif val.is_a?(Array)
  193.       # インデックス指定
  194.       case val[0]
  195.       when :actor ; return $game_party.members[val[1]]
  196.       when :enemy ; return $game_troop.members[val[1]]
  197.       else        ; return nil
  198.       end
  199.     else
  200.       # オブジェクト
  201.       return val
  202.     end
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● バトルログプッシュ
  206.   #--------------------------------------------------------------------------
  207.   # LNX11.バトルログ(text)
  208.   def self.battle_log_push(text)
  209.     return unless $game_party.in_battle
  210.     case BATTLELOG_TYPE
  211.     when 0..1 # バトルログ
  212.       BattleManager.log_window.add_text(text)
  213.     when 2 # 簡易ヘルプ表示
  214.       BattleManager.helpdisplay_set(text, 0)
  215.     end
  216.   end
  217.   def self.バトルログ(text)
  218.     self.battle_log_push(text)
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ● バトルログ消去
  222.   #--------------------------------------------------------------------------
  223.   # LNX11.バトルログ消去
  224.   def self.battle_log_clear
  225.     return unless $game_party.in_battle
  226.     case BATTLELOG_TYPE
  227.     when 0 # バトルログ
  228.       BattleManager.log_window.clear
  229.     when 1 # 蓄積型
  230.       BattleManager.log_window.clear
  231.       $game_temp.battlelog_clear = true
  232.       self.battle_wait(1)
  233.     when 2 # 簡易ヘルプ
  234.       BattleManager.helpdisplay_clear(0)
  235.     end
  236.   end
  237.   def self.バトルログ消去
  238.     self.battle_log_clear
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● バトルウェイト
  242.   #--------------------------------------------------------------------------
  243.   # LNX11.バトルウェイト(duration)
  244.   def self.battle_wait(duration)
  245.     return unless $game_party.in_battle
  246.     BattleManager.log_window.abs_wait(duration)
  247.   end
  248.   def self.バトルウェイト(duration)
  249.     self.battle_wait(duration)
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ● 設定値
  253.   #  ※ 設定を変更する場合、LNX11aconf を使用してください。
  254.   #--------------------------------------------------------------------------
  255.   # <<ver1.00>>
  256.   if !$lnx_include[:lnx11aconf] ||
  257.      $lnx_include[:lnx11aconf] && $lnx_include[:lnx11aconf] < 100
  258.   DEFAULT_BATTLER_GRAPHIC = 0
  259.   DEFAULT_BG_COLOR        = [Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  260.   ACTOR_SCREEN_TONE       = false
  261.   TP_POPUP_TYPE           = 1
  262.   INDEXZERO_NO_POPUP      = true
  263.   ACTOR_BACKGROUND        = 2
  264.   ACTOR_BACKGROUND_HEIGHT = 112
  265.   ACTOR_BG_GRADIENT_COLOR = [Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  266.   BATTLELOG_TYPE  =  1
  267.   STORAGE_LINE_NUMBER     = 6
  268.   STORAGE_LINE_HEIGHT     = 20
  269.   STORAGE_UP_MESSAGE_TIME = 90
  270.   STORAGE_TURNEND_CLEAR   = true
  271.   STORAGE_OFFSET = {:x => 0, :y => 6}
  272.   STORAGE_FONT   = {:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  273.   STORAGE_GRADIENT_COLOR = [Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  274.   POPUP_ADD_WAIT          = 6
  275.   HELPDISPLAY_TYPE        = 1
  276.   HELPDISPLAT_WAIT        = 20
  277.   HELPDISPLAT_END_WAIT    = 24
  278.   HELPDISPLAY_DESCRIPTION = {:size => 20, :delimiter => " "}
  279.   MESSAGE_TYPE  =  2
  280.   MESSAGE_WINDOW_BACKGROUND  = 1
  281.   MESSAGE_WINDOW_POSITION    = 0
  282.   MESSAGE_WAIT = {:battle_start => [120, false], :victory   => [ 60, false],
  283.                   :defeat       => [120, false], :escape    => [120, false],
  284.                   :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  285.   MESSAGE_WINDOW_ENEMY_NAMES = false
  286.   LEVELUP_SE  = RPG::SE.new("Up4", 90, 100)
  287.   DROPITEM_SE = RPG::SE.new("Item3", 80, 125)
  288.   ACTOR_CENTERING  =  true
  289.   ACTOR_SPACING_ADJUST = 32
  290.   ACTOR_OFFSET  = {:x => -16, :y => 0}
  291.   ACTOR_PADDING = {:side => 4, :bottom => 8}
  292.   SCREEN_ANIMATION_OFFSET = 128
  293.   STATUS_OFFSET = {:x => 64, :y => -12}
  294.   STATUS_SIDE_PADDING   = 6
  295.   STATUS_WIDTH          = 72
  296.   STATUS_AUTOADJUST     = true
  297.   STATUS_LINE_HEIGHT    = 22
  298.   STATUS_NAME_SIZE      = 20
  299.   STATUS_PARAM_SIZE     = 23
  300.   STATUS_GAUGE_OPACITY  = 192
  301.   ACTOR_COMMAND_NOSCROLL   = true
  302.   ACTOR_COMMAND_HORIZON    = false
  303.   ACTOR_COMMAND_ALIGNMENT  = 0
  304.   ACTOR_COMMAND_WIDTH      = 128
  305.   ACTOR_COMMAND_POSITION   = 0
  306.   ACTOR_COMMAND_Y_POSITION = 0
  307.   ACTOR_COMMAND_OFFSET  = {:x => 0, :y => -16}
  308.   PARTY_COMMAND_HORIZON   = true
  309.   PARTY_COMMAND_ALIGNMENT = 1
  310.   PARTY_COMMAND_WIDTH     = Graphics.width
  311.   PARTY_COMMAND_XY        = {:x => 0, :y => 0}
  312.   CURSOR_NAME       = ""
  313.   CURSOR_TONE     = Tone.new(-34, 0, 68)
  314.   CURSOR_ANI_SPEED  = 3
  315.   CURSOR_SPEED      = 3
  316.   CURSOR_BLINK      = true
  317.   CURSOR_MINMAX     = {:min => 48, :max => Graphics.height}
  318.   CURSOR_OFFSET     = {:x => 0, :y => 0}
  319.   HELP_ACTOR_PARAM = {:hp => true ,:mp => true ,:tp => true ,:state => true }
  320.   HELP_ENEMY_PARAM = {:hp => false,:mp => false,:tp => false,:state => true }
  321.   HELP_PARAM_WIDTH    = 72
  322.   RANDOMSCOPE_DISPLAY = 1
  323.   ACTOR_POPUP_POSITION   = 3
  324.   ENEMY_POPUP_POSITION   = 1
  325.   LEVELUP_POPUP_POSITION = 3
  326.   ACTOR_POPUP_Y     =  -100
  327.   LEVELUP_POPUP_Y   =  -112
  328.   NUMBER_FONT   =  ["Arial Black", "WQYMHEx"]
  329.   TEXT_FONT     =  ["Arial Black", "WQYMHEx"]
  330.   TEXT_FONT_MCS =  ["WQYMHEx"]
  331.   LARGE_NUMBER  =  {:fontsize => 38, :spacing => -4, :line_height => 26}
  332.   SMALL_NUMBER  =  {:fontsize => 28, :spacing => -4, :line_height => 20}
  333.   TEXT_SIZERATE     = {:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  334.   TEXT_SIZERATE_MCS = 0.9
  335.   DECORATION_NUMBER = {
  336.   :critical    => ["CRITICAL", 8], :weakness    => ["WEAKNESS", 8],
  337.   :resist      => ["RESIST"  , 8], :mp_damage   => ["\mp"     , 4],
  338.   :mp_plus     => ["\mp+"    , 4], :mp_minus    => ["\mp-"    , 4],
  339.   :tp_plus     => ["\tp+"    , 4], :tp_minus    => ["\tp-"    , 4]}
  340.   DECORATION_TEXT = {
  341.   :add_state   => "+%s",      :rem_state   => "-%s",
  342.   :add_buff    => "%s UP",    :add_debuff  => "%s DOWN",
  343.   :rem_buff    => "-%s Buff"}
  344.   POPUP_VOCAB = {
  345.   :miss        => "MISS!",      :counter     => "Counter",
  346.   :reflection  => "Reflection", :substitute  => "Substitute",
  347.   :levelup     => "LEVELUP!"}
  348.   POPUP_VOCAB_PARAMS = [
  349.   "MAX\hp","MAX\mp","ATK","DEF","MATK","MDEF","AGI","LUCK"]
  350.   POPUP_COLOR = {
  351.   :hp_damage     => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  352.   :critical      => [Color.new(255, 255,  80), Color.new(224,  32,   0)],
  353.   :weakness      => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  354.   :resist        => [Color.new(232, 224, 216), Color.new( 56,  48,  40)],
  355.   :hp_recovery   => [Color.new( 96, 255, 128), Color.new(  0,  64,  32)],
  356.   :mp_damage     => [Color.new(248,  80, 172), Color.new( 48,   0,  32)],
  357.   :mp_recovery   => [Color.new(160, 240, 255), Color.new( 32,  48, 144)],
  358.   :tp_damage     => [Color.new(248, 240,  64), Color.new(  0,  80,  40)],
  359.   :add_state     => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  360.   :rem_state     => [Color.new(224, 232, 240), Color.new( 32,  64, 128, 128)],
  361.   :add_badstate  => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  362.   :rem_badstate  => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  363.   :add_buff      => [Color.new(255, 255, 192), Color.new( 96,  64,   0)],
  364.   :add_debuff    => [Color.new(200, 224, 232), Color.new( 40,  48,  56)],
  365.   :rem_buff      => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  366.   :counter       => [Color.new(255, 255, 224), Color.new(128,  96,   0)],
  367.   :reflection    => [Color.new(224, 255, 255), Color.new(  0,  96, 128)],
  368.   :substitute    => [Color.new(224, 255, 224), Color.new(  0, 128,  64)],
  369.   :levelup       => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  370.   }
  371.   POPUP_TYPE = {
  372.   :miss          =>   0,:hp_damage     =>   0,:hp_slipdamage =>   1,
  373.   :hp_recovery   =>   0,:hp_regenerate =>   1,:hp_drain      =>   0,
  374.   :hp_drainrecv  =>   0,:mp_damage     =>   0,:mp_slipdamage =>   1,
  375.   :mp_recovery   =>   0,:mp_regenerate =>   1,:mp_drain      =>   0,
  376.   :mp_drainrecv  =>   0,:mp_paycost    =>  -1,:tp_damage     =>   1,
  377.   :tp_charge     =>  -1,:tp_gain       =>   7,:tp_regenerate =>   1,
  378.   :tp_paycost    =>  -1,:add_state     =>   2,:rem_state     =>   2,
  379.   :add_badstate  =>   2,:rem_badstate  =>   2,:add_debuff    =>   3,
  380.   :rem_buff      =>   3,:counter       =>   6,:reflection    =>   6,
  381.   :substitute    =>   4,}
  382.   LARGE_MOVEMENT = {
  383.   :inirate    => 6.4,  :gravity      => 0.68,  :side_scatter => 1.2,
  384.   :ref_height =>  32,  :ref_factor   => 0.60,  :ref_count    =>   2,
  385.                        :duration     =>   40,  :fadeout      =>  20 }
  386.   SMALL_MOVEMENT = {
  387.   :inirate    => 4.4,  :gravity      => 0.60,  :side_scatter => 0.0,
  388.   :ref_height =>  12,  :ref_factor   => 0.70,  :ref_count    =>   0,
  389.                        :duration     =>   60,  :fadeout      =>  16 }
  390.   RISE_MOVEMENT     = {:rising_speed => 0.75,  :line_spacing => 0.9,
  391.                        :duration     =>   40,  :fadeout      =>   8 }
  392.   SLIDE_MOVEMENT    = {:x_speed      =>    2,  :line_spacing => 0.9,
  393.                        :duration     =>   50,  :fadeout      =>  32 }
  394.   OVERLAY_MOVEMENT  = {:duration     =>   36,  :fadeout      =>  32 }
  395.   FIX_TARGET_CHECKE     = true
  396.   GUARD_TARGET_CHECKE   = true
  397.   SMART_TARGET_SELECT   = true
  398.   LAST_TARGET           = true
  399.   LAST_PARTY_COMMAND    = true
  400.   LAST_ACTOR_COMMAND    = true
  401.   TROOP_X_SORT          = true
  402.   PARTY_COMMAND_SKIP    = true
  403.   FITTING_LIST          = true
  404.   ENHANCED_WHITEN       = true
  405.   DISABLED_DAMAGE_SHAKE = true
  406.   TROOP_X_SCREEN_FIX    = true
  407.   TROOP_Y_OFFSET        = 0
  408.   end
  409.   # <<ver1.10>>
  410.   if !$lnx_include[:lnx11aconf] ||
  411.     $lnx_include[:lnx11aconf] && $lnx_include[:lnx11aconf] < 110
  412.   LARGE_NUMBER_NAME = ""
  413.   SMALL_NUMBER_NAME = ""
  414.   LARGE_BUFFS_NAME  = ""
  415.   SMALL_BUFFS_NAME  = ""
  416.   end
  417. end

  418. #==============================================================================
  419. # ■ [追加]:Popup_Data
  420. #------------------------------------------------------------------------------
  421. #  戦闘中のポップアップをまとめて扱うクラス。ポップアップスプライトの
  422. # initialize 時に自身を参照させて、ポップアップ内容を定義する際にも使います。
  423. #==============================================================================

  424. class Popup_Data
  425.   #--------------------------------------------------------------------------
  426.   # ● クラス変数
  427.   #--------------------------------------------------------------------------
  428.   @@make_methods = {} # ポップアップ作成メソッドのハッシュ
  429.   #--------------------------------------------------------------------------
  430.   # ● 定数(ポップアップのタイプID)
  431.   #--------------------------------------------------------------------------
  432.   SPRING_LARGE  = 0
  433.   SPRING_SMALL  = 1
  434.   RISING_LARGE  = 2
  435.   RISING_SMALL  = 3
  436.   SLIDING_LARGE = 4
  437.   SLIDING_SMALL = 5
  438.   OVERLAY_LARGE = 6
  439.   OVERLAY_SMALL = 7
  440.   LEVELUP       = :levelup
  441.   #--------------------------------------------------------------------------
  442.   # ● 公開インスタンス変数
  443.   #--------------------------------------------------------------------------
  444.   attr_accessor :type       # ポップアップのタイプ
  445.   attr_accessor :popup      # 表示する内容
  446.   attr_accessor :popup_size # ポップアップの大きさ
  447.   attr_accessor :color      # 色
  448.   attr_accessor :deco       # 修飾文字
  449.   attr_accessor :battler    # ポップアップするバトラー
  450.   attr_accessor :delay      # 表示開始までの時間
  451.   attr_accessor :viewport   # ビューポート
  452.   attr_accessor :popup_wait # ポップアップウェイト
  453.   attr_accessor :buff_data  # 能力強化/弱体 <<ver1.10>>
  454.   #--------------------------------------------------------------------------
  455.   # ● オブジェクト初期化
  456.   #--------------------------------------------------------------------------
  457.   def initialize
  458.     @sprites = []
  459.     @viewport = Viewport.new
  460.     @viewport.z = 120 # ポップアップの Z 座標
  461.     spb = Sprite_PopupBase.new
  462.     spb.create_number
  463.     spb.dispose
  464.     set_methods
  465.     refresh
  466.   end
  467.   #--------------------------------------------------------------------------
  468.   # ● ポップアップ生成メソッドの登録
  469.   #--------------------------------------------------------------------------
  470.   def set_methods
  471.     @@make_methods[SPRING_LARGE]  = method(:makeup_spring_large)
  472.     @@make_methods[SPRING_SMALL]  = method(:makeup_spring_small)
  473.     @@make_methods[RISING_LARGE]  = method(:makeup_rising_large)
  474.     @@make_methods[RISING_SMALL]  = method(:makeup_rising_small)
  475.     @@make_methods[SLIDING_LARGE] = method(:makeup_sliding_large)
  476.     @@make_methods[SLIDING_SMALL] = method(:makeup_sliding_small)
  477.     @@make_methods[OVERLAY_LARGE] = method(:makeup_overlay_large)
  478.     @@make_methods[OVERLAY_SMALL] = method(:makeup_overlay_small)
  479.     @@make_methods[LEVELUP]       = method(:makeup_levelup)
  480.   end
  481.   #--------------------------------------------------------------------------
  482.   # ● スプライト解放
  483.   #--------------------------------------------------------------------------
  484.   def dispose
  485.     @sprites.each {|sprite| sprite.dispose}
  486.     @viewport.dispose
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # ● フレーム更新
  490.   #--------------------------------------------------------------------------
  491.   def update
  492.     @sprites.each do |sprite|
  493.       sprite.update
  494.       @sprites.delete(sprite) if sprite.disposed?
  495.     end
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ● リフレッシュ
  499.   #--------------------------------------------------------------------------
  500.   def refresh
  501.     @type  = 0
  502.     @popup = nil
  503.     @popup_size = :large
  504.     [url=home.php?mod=space&uid=10453]@color[/url] = :hp_damage
  505.     @deco = ["", -1] # [テキスト, テキストの位置]
  506.     [url=home.php?mod=space&uid=133701]@battler[/url] = nil
  507.     @delay = 0
  508.     @popup_wait = false
  509.     # <<ver1.10>> 能力強化/弱体ポップアップを画像で表示する際に利用
  510.     @buff_data = [-1, -1] # [能力, 強化or弱体or解除]
  511.   end
  512.   #--------------------------------------------------------------------------
  513.   # ● ポップアップを生成
  514.   #--------------------------------------------------------------------------
  515.   def makeup
  516.     if @@make_methods[@type]
  517.       @@make_methods[@type].call
  518.       @popup_wait = true
  519.     end
  520.   end
  521.   #--------------------------------------------------------------------------
  522.   # ● ポップアップウェイト
  523.   #  バトルログタイプが [2:ヘルプ表示] の場合のみ実行されます。
  524.   #--------------------------------------------------------------------------
  525.   def add_wait
  526.     return if LNX11::BATTLELOG_TYPE != 2 || !@popup_wait
  527.     LNX11::POPUP_ADD_WAIT.times {BattleManager.log_window.abs_wait(1)}
  528.     @popup_wait = false
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ● ポップアップ生成メソッド
  532.   #  これらのメソッドを @@make_methods に登録して呼び出します。
  533.   # これはポップアップタイプの拡張を容易にするための仕様です。
  534.   #--------------------------------------------------------------------------
  535.   def makeup_spring_large
  536.     # @type   0 : 跳ねるポップアップ(大)
  537.     @popup_size = :large
  538.     @sprites.push(Sprite_PopupSpring.new(self))
  539.   end
  540.   def makeup_spring_small
  541.     # @type   1 : 跳ねるポップアップ(小)
  542.     @popup_size = :small
  543.     @delay = @battler.popup_delay[1]
  544.     @sprites.push(Sprite_PopupSpring.new(self))
  545.   end
  546.   def makeup_rising_large
  547.     # @type   2 : ゆっくり上昇(大)
  548.     @popup_size = :large
  549.     @delay = @battler.popup_delay[2]
  550.     @sprites.push(Sprite_PopupRising.new(self))
  551.   end
  552.   def makeup_rising_small
  553.     # @type   3 : ゆっくり上昇(小)
  554.     @popup_size = :small      
  555.     @delay = @battler.popup_delay[2]
  556.     @sprites.push(Sprite_PopupRising.new(self))
  557.   end
  558.   def makeup_sliding_large
  559.     # @type   4 : スライド(大)
  560.     @popup_size = :large
  561.     @delay = @battler.popup_delay[3]
  562.     @sprites.push(Sprite_PopupSliding.new(self))
  563.   end
  564.   def makeup_sliding_small
  565.     # @type   5 : スライド(小)
  566.     @popup_size = :small
  567.     @delay = @battler.popup_delay[3]
  568.     @sprites.push(Sprite_PopupSliding.new(self))      
  569.   end
  570.   def makeup_overlay_large
  571.     # @type   6 : オーバーレイ(大)
  572.     @popup_size = :large
  573.     @sprites.push(Sprite_PopupOverlay.new(self))
  574.   end
  575.   def makeup_overlay_small
  576.     # @type   7 : オーバーレイ(小)
  577.     @popup_size = :small
  578.     @sprites.push(Sprite_PopupOverlay.new(self))
  579.   end
  580.   def makeup_levelup
  581.     # @type :levelup : レベルアップ
  582.     @battler.popup_delay[3] = 0
  583.     @popup_size = :large
  584.     @sprites.push(Sprite_PopupLevelUp.new(self))
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # ● TP のポップアップが有効か?
  588.   #--------------------------------------------------------------------------
  589.   def tp_popup_enabled?(target)
  590.     return false if !$data_system.opt_display_tp
  591.     return true  if LNX11::TP_POPUP_TYPE == 0 # すべてポップアップ
  592.     return true  if LNX11::TP_POPUP_TYPE == 1 && target.actor? # アクターのみ
  593.     false # ポップアップしない
  594.   end
  595.   #--------------------------------------------------------------------------
  596.   # ● 任意のポップアップ
  597.   #--------------------------------------------------------------------------
  598.   def popup_custom(target, popup, type = 0, color = :hp_damage, deco = nil)
  599.     refresh
  600.     @battler = target
  601.     @popup = popup
  602.     type = LNX11::POPUP_TYPE[type] if type.is_a?(Symbol)
  603.     @type = type
  604.     @color = color
  605.     @deco = LNX11::DECORATION_NUMBER[deco] if deco.is_a?(Symbol)
  606.     # ポップアップ作成
  607.     makeup
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # ● レベルアップのポップアップ
  611.   #--------------------------------------------------------------------------
  612.   def popup_levelup(target)
  613.     # 戦闘に参加している場合のみポップアップ
  614.     return unless $game_party.battle_members.include?(target)
  615.     refresh
  616.     @type = :levelup
  617.     @battler = target
  618.     @popup = LNX11::POPUP_VOCAB[:levelup]
  619.     @color = :levelup
  620.     # ポップアップ作成
  621.     makeup
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # ● 単一テキストのポップアップ
  625.   #--------------------------------------------------------------------------
  626.   def popup_text(target, type)
  627.     refresh
  628.     @type = LNX11::POPUP_TYPE[type]
  629.     @battler = target
  630.     @popup = LNX11::POPUP_VOCAB[type]
  631.     @color = type
  632.     # ポップアップ作成
  633.     makeup
  634.   end
  635.   #--------------------------------------------------------------------------
  636.   # ● ミスのポップアップ
  637.   #--------------------------------------------------------------------------
  638.   def popup_miss(target, item)
  639.     refresh
  640.     @type = LNX11::POPUP_TYPE[:miss]
  641.     @battler = target
  642.     @popup = LNX11::POPUP_VOCAB[:miss]
  643.     @color = :hp_damage
  644.     # ポップアップ作成
  645.     makeup
  646.   end
  647.   #--------------------------------------------------------------------------
  648.   # ● HP ダメージポップアップ
  649.   #--------------------------------------------------------------------------
  650.   def popup_hp_damage(target, item)
  651.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  652.     refresh
  653.     @popup = target.result.hp_damage
  654.     @battler = target
  655.     if target.result.hp_drain > 0
  656.       # 被吸収
  657.       @type = LNX11::POPUP_TYPE[:hp_drain]
  658.       # 弱点/耐性
  659.       if target.result.element_rate > 1
  660.         @deco = LNX11::DECORATION_NUMBER[:weakness]
  661.         @color = :weakness
  662.       elsif target.result.element_rate < 1
  663.         @deco = LNX11::DECORATION_NUMBER[:resist]
  664.         @color = :resist
  665.       else
  666.         @color = :hp_damage
  667.       end
  668.     elsif target.result.hp_damage > 0
  669.       # ダメージ
  670.       @type = LNX11::POPUP_TYPE[:hp_damage]
  671.       @color = :hp_damage
  672.       if target.result.critical
  673.         # クリティカル
  674.         @deco = LNX11::DECORATION_NUMBER[:critical]
  675.         @color = :critical
  676.       end
  677.       # 弱点/耐性
  678.       if target.result.element_rate > 1
  679.         @deco = LNX11::DECORATION_NUMBER[:weakness]
  680.         @color = :weakness if @color != :critical
  681.       elsif target.result.element_rate < 1
  682.         @deco = LNX11::DECORATION_NUMBER[:resist]
  683.         @color = :resist if @color != :critical
  684.       end
  685.     elsif target.result.hp_damage < 0
  686.       # 回復
  687.       @type = LNX11::POPUP_TYPE[:hp_recovery]
  688.       @color = :hp_recovery
  689.     else
  690.       # 0 ダメージ
  691.       @type = LNX11::POPUP_TYPE[:hp_damage]
  692.       @color = :hp_damage
  693.     end
  694.     # ポップアップ作成
  695.     makeup
  696.   end
  697.   #--------------------------------------------------------------------------
  698.   # ● MP ダメージポップアップ
  699.   #--------------------------------------------------------------------------
  700.   def popup_mp_damage(target, item)
  701.     return if target.dead? || target.result.mp_damage == 0
  702.     refresh
  703.     @popup = target.result.mp_damage
  704.     @battler = target
  705.     @deco = LNX11::DECORATION_NUMBER[:mp_damage]
  706.     if target.result.mp_drain > 0
  707.       # 被吸収
  708.       @type = LNX11::POPUP_TYPE[:mp_drain]
  709.       @color = :mp_damage
  710.     elsif target.result.mp_damage > 0
  711.       # ダメージ
  712.       @type = LNX11::POPUP_TYPE[:mp_damage]
  713.       @color = :mp_damage
  714.     elsif target.result.mp_damage < 0
  715.       # 回復
  716.       @type = LNX11::POPUP_TYPE[:mp_recovery]
  717.       @color = :mp_recovery
  718.     end
  719.     # ポップアップ作成
  720.     makeup
  721.   end
  722.   #--------------------------------------------------------------------------
  723.   # ● TP ダメージポップアップ
  724.   #--------------------------------------------------------------------------
  725.   def popup_tp_damage(target, item)
  726.     return unless tp_popup_enabled?(target)
  727.     return if target.dead? || target.result.tp_damage == 0
  728.     refresh
  729.     @popup = target.result.tp_damage
  730.     @battler = target
  731.     deco = target.result.tp_damage > 0 ? :tp_minus : :tp_plus
  732.     @deco = LNX11::DECORATION_NUMBER[deco]
  733.     @type = LNX11::POPUP_TYPE[:tp_damage]
  734.     @color = :tp_damage
  735.     # ポップアップ作成
  736.     makeup
  737.   end
  738.   #--------------------------------------------------------------------------
  739.   # ● HP 吸収回復
  740.   #--------------------------------------------------------------------------
  741.   def popup_hp_drain(target, hp_drain)
  742.     return if hp_drain == 0
  743.     refresh
  744.     @popup = hp_drain
  745.     @battler = target
  746.     @type = LNX11::POPUP_TYPE[:hp_drainrecv]
  747.     @color = :hp_recovery
  748.     # ポップアップ作成
  749.     makeup
  750.   end
  751.   #--------------------------------------------------------------------------
  752.   # ● MP 吸収回復
  753.   #--------------------------------------------------------------------------
  754.   def popup_mp_drain(target, mp_drain)
  755.     return if mp_drain == 0
  756.     refresh
  757.     @popup = mp_drain
  758.     @battler = target
  759.     @deco = LNX11::DECORATION_NUMBER[:mp_damage]
  760.     @type = LNX11::POPUP_TYPE[:mp_drainrecv]
  761.     @color = :mp_recovery
  762.     # ポップアップ作成
  763.     makeup
  764.   end
  765.   #--------------------------------------------------------------------------
  766.   # ● ステート付加のポップアップ
  767.   #--------------------------------------------------------------------------
  768.   def popup_added_states(target)
  769.     refresh
  770.     @battler = target
  771.     target.result.added_state_objects.each do |state|
  772.       next if state.id == target.death_state_id
  773.       next if state.icon_index == 0 && LNX11::INDEXZERO_NO_POPUP
  774.       next if state.add_no_display?      
  775.       if state.add_no_decoration?
  776.         @popup = state.add_display_name
  777.       else
  778.         @popup = sprintf(LNX11::DECORATION_TEXT[:add_state],
  779.                          state.add_display_name)
  780.       end
  781.       type = state.advantage? ? :add_state : :add_badstate
  782.       if state.add_popup_type
  783.         @type = state.add_popup_type
  784.       else
  785.         @type = LNX11::POPUP_TYPE[type]
  786.       end
  787.       @color = type
  788.       # ポップアップ作成
  789.       makeup
  790.     end
  791.   end
  792.   #--------------------------------------------------------------------------
  793.   # ● ステート解除のポップアップ
  794.   #--------------------------------------------------------------------------
  795.   def popup_removed_states(target)
  796.     refresh
  797.     @type = LNX11::POPUP_TYPE[:rem_badstate]
  798.     @battler = target
  799.     target.result.removed_state_objects.each do |state|
  800.       next if state.id == target.death_state_id
  801.       next if state.icon_index == 0 && LNX11::INDEXZERO_NO_POPUP
  802.       next if state.remove_no_display?
  803.       if state.remove_no_decoration?
  804.         @popup = state.remove_display_name
  805.       else
  806.         @popup = sprintf(LNX11::DECORATION_TEXT[:rem_state],
  807.                          state.remove_display_name)
  808.       end
  809.       type = state.advantage? ? :rem_state : :rem_badstate
  810.       if state.remove_popup_type
  811.         @type = state.remove_popup_type
  812.       else
  813.         @type = LNX11::POPUP_TYPE[type]
  814.       end
  815.       @color = type
  816.       # ポップアップ作成
  817.       makeup
  818.     end
  819.   end
  820.   #--------------------------------------------------------------------------
  821.   # ● 能力強化/弱体のポップアップ
  822.   #--------------------------------------------------------------------------
  823.   def popup_buffs(target, buffs, fmt)
  824.     return if buffs.empty?
  825.     refresh
  826.     @battler = target
  827.     case fmt
  828.     when Vocab::BuffAdd
  829.       buffdeco = LNX11::DECORATION_TEXT[:add_buff]
  830.       @type = LNX11::POPUP_TYPE[:add_buff]
  831.       @color = :add_buff
  832.       @buff_data[1] = 0
  833.     when Vocab::DebuffAdd
  834.       buffdeco = LNX11::DECORATION_TEXT[:add_debuff]
  835.       @type = LNX11::POPUP_TYPE[:add_debuff]
  836.       @color = :add_debuff
  837.       @buff_data[1] = 1
  838.     when Vocab::BuffRemove
  839.       buffdeco = LNX11::DECORATION_TEXT[:rem_buff]
  840.       @type = LNX11::POPUP_TYPE[:rem_buff]
  841.       @color = :rem_buff
  842.       @buff_data[1] = 2
  843.     end
  844.     buffs.each do |param_id|
  845.       @popup = sprintf(buffdeco, LNX11::POPUP_VOCAB_PARAMS[param_id])
  846.       @buff_data[0] = param_id
  847.       # ポップアップ作成
  848.       makeup
  849.       @popup_wait = false
  850.     end
  851.   end
  852.   #--------------------------------------------------------------------------
  853.   # ● HP 再生
  854.   #--------------------------------------------------------------------------
  855.   def popup_regenerate_hp(target, hp_damage, paycost = false)
  856.     return if hp_damage == 0
  857.     refresh
  858.     @popup = hp_damage
  859.     @battler = target
  860.     if hp_damage > 0
  861.       # ダメージ
  862.       @type = LNX11::POPUP_TYPE[:hp_slipdamage]
  863.       @color = :hp_damage
  864.     elsif hp_damage < 0
  865.       # 回復
  866.       @type = LNX11::POPUP_TYPE[:hp_regenerate]
  867.       @color = :hp_recovery
  868.     end
  869.     # ポップアップ作成
  870.     makeup
  871.   end
  872.   #--------------------------------------------------------------------------
  873.   # ● MP 再生
  874.   #--------------------------------------------------------------------------
  875.   def popup_regenerate_mp(target, mp_damage, paycost = false)
  876.     return if mp_damage == 0
  877.     refresh
  878.     @popup = mp_damage
  879.     @battler = target
  880.     @deco = LNX11::DECORATION_NUMBER[mp_damage > 0 ? :mp_minus : :mp_plus]
  881.     if mp_damage > 0
  882.       # ダメージ
  883.       @type = LNX11::POPUP_TYPE[paycost ? :mp_paycost : :mp_slipdamage]
  884.       @color = :mp_damage
  885.     elsif mp_damage < 0
  886.       # 回復
  887.       @type = LNX11::POPUP_TYPE[paycost ? :mp_paycost : :mp_regenerate]
  888.       @color = :mp_recovery
  889.     end
  890.     # ポップアップ作成
  891.     makeup
  892.   end
  893.   #--------------------------------------------------------------------------
  894.   # ● TP 再生
  895.   #--------------------------------------------------------------------------
  896.   def popup_regenerate_tp(target, tp_damage, paycost = false)
  897.     return unless tp_popup_enabled?(target)
  898.     return if tp_damage == 0
  899.     refresh
  900.     @popup = tp_damage
  901.     @battler = target
  902.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  903.     @type = LNX11::POPUP_TYPE[paycost ? :tp_paycost : :tp_regenerate]
  904.     @color = :tp_damage
  905.     # ポップアップ作成
  906.     makeup
  907.   end
  908.   #--------------------------------------------------------------------------
  909.   # ● TP チャージ
  910.   #--------------------------------------------------------------------------
  911.   def popup_tp_charge(target, tp_damage)
  912.     return unless tp_popup_enabled?(target)
  913.     return if tp_damage == 0
  914.     refresh
  915.     @popup = tp_damage
  916.     @battler = target
  917.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  918.     @type = LNX11::POPUP_TYPE[:tp_charge]
  919.     @color = :tp_damage
  920.     # ポップアップ作成
  921.     makeup
  922.   end
  923.   #--------------------------------------------------------------------------
  924.   # ● TP 得
  925.   #--------------------------------------------------------------------------
  926.   def popup_tp_gain(target, tp_damage)
  927.     return unless tp_popup_enabled?(target)
  928.     return if tp_damage == 0
  929.     refresh
  930.     @popup = tp_damage
  931.     @battler = target
  932.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  933.     @type = LNX11::POPUP_TYPE[:tp_gain]
  934.     @color = :tp_damage
  935.     # ポップアップ作成
  936.     makeup
  937.   end
  938. end

  939. #==============================================================================
  940. # ■ [追加]:Sprite_PopupBase
  941. #------------------------------------------------------------------------------
  942. #  戦闘中のダメージ表示等をポップアップ表示するためのスプライトの
  943. # スーパークラス。サブクラスで細かい動きを定義します。
  944. #==============================================================================

  945. class Sprite_PopupBase < Sprite
  946.   #--------------------------------------------------------------------------
  947.   # ● クラス変数
  948.   #--------------------------------------------------------------------------
  949.   @@cache_number = []
  950.   @@cache_text   = {}
  951.   @@w = []
  952.   @@h = []
  953.   @@priority = 0
  954.   @@count    = 0
  955.   @@buf_bitmap = nil
  956.   #--------------------------------------------------------------------------
  957.   # ● 定数
  958.   #--------------------------------------------------------------------------
  959.   NUMBER_COLOR_SIZE = 8
  960.   NUMBERS    = [0,1,2,3,4,5,6,7,8,9]
  961.   COLOR_KEYS = LNX11::POPUP_COLOR.keys
  962.   #--------------------------------------------------------------------------
  963.   # ● オブジェクト初期化
  964.   #     data : ポップアップデータ
  965.   #--------------------------------------------------------------------------
  966.   def initialize(data = nil)
  967.     if data == nil || !data.battler.battle_member?
  968.       # 非表示のポップアップ
  969.       super(nil)
  970.       @remove = true
  971.       return
  972.     end
  973.     # ポップアップデータを適用
  974.     super(data.viewport)
  975.     @battler = data.battler # ポップアップを表示するバトラー
  976.     @delay   = data.delay   # ディレイ(遅延) ※サブクラスによって扱いが違います
  977.     @popup_size = data.popup_size # ポップアップの大きさ 大/小
  978.     # 基本設定
  979.     @duration = 60  # 消え始める時間
  980.     @fadeout  = 16  # 消える速さ
  981.     @rx = ry  = 0   # XY座標
  982.     # Z座標
  983.     @rz = base_z * 128 + priority
  984.     popup_add
  985.     self.visible = false
  986.     # ポップアップデータからビットマップを作成
  987.     if data.popup.is_a?(Numeric)
  988.       # ダメージ値
  989.       self.bitmap = number(data.popup, data.color, data.popup_size, data.deco)
  990.     elsif data.popup.is_a?(String)
  991.       # テキスト
  992.       self.bitmap = text(data.popup, data.color,
  993.                          data.popup_size, data.buff_data)
  994.     end
  995.     # 位置設定
  996.     self.ox = self.width  / 2
  997.     self.oy = self.height / 2
  998.     set_position
  999.     start
  1000.   end
  1001.   #--------------------------------------------------------------------------
  1002.   # ● 解放
  1003.   #--------------------------------------------------------------------------
  1004.   def dispose
  1005.     popup_remove
  1006.     terminate
  1007.     self.bitmap.dispose if self.bitmap
  1008.     super
  1009.   end
  1010.   #--------------------------------------------------------------------------
  1011.   # ● フレーム更新
  1012.   #--------------------------------------------------------------------------
  1013.   def update
  1014.     return if removed? || delay?
  1015.     update_popup
  1016.     update_xy
  1017.     @duration -= 1
  1018.     self.opacity -= @fadeout if @duration <= 0
  1019.     dispose if self.opacity == 0
  1020.   end
  1021.   #--------------------------------------------------------------------------
  1022.   # ● 開始処理(サブクラスで定義)
  1023.   #--------------------------------------------------------------------------
  1024.   def start
  1025.   end
  1026.   #--------------------------------------------------------------------------
  1027.   # ● 終了処理(サブクラスで定義)
  1028.   #--------------------------------------------------------------------------
  1029.   def terminate
  1030.   end
  1031.   #--------------------------------------------------------------------------
  1032.   # ● フレーム更新(サブクラスで定義)
  1033.   #--------------------------------------------------------------------------
  1034.   def update_popup
  1035.   end
  1036.   #--------------------------------------------------------------------------
  1037.   # ● ポップアップ Z 座標
  1038.   #--------------------------------------------------------------------------
  1039.   def base_z
  1040.     0
  1041.   end
  1042.   #--------------------------------------------------------------------------
  1043.   # ● ポップアップのプライオリティを返す
  1044.   #  同一Z座標のポップアップで、後から生成されたものが手前に表示されるように
  1045.   # Z座標の修正値をクラス変数で管理しています。
  1046.   #--------------------------------------------------------------------------
  1047.   def priority
  1048.     @@priority * 2
  1049.   end
  1050.   #--------------------------------------------------------------------------
  1051.   # ● ポップアップ追加
  1052.   #--------------------------------------------------------------------------
  1053.   def popup_add
  1054.     @@priority += 1
  1055.     @@count += 1
  1056.   end
  1057.   #--------------------------------------------------------------------------
  1058.   # ● ポップアップ消去
  1059.   #--------------------------------------------------------------------------
  1060.   def popup_remove
  1061.     @remove = true
  1062.     @@count -= 1
  1063.     @@priority = 0 if @@count <= 0
  1064.   end
  1065.   #--------------------------------------------------------------------------
  1066.   # ● ディレイが残っている?
  1067.   #  サブクラスの update メソッドで使用します。
  1068.   #--------------------------------------------------------------------------
  1069.   def delay?
  1070.     @delay -= 1
  1071.     self.visible = (@delay <= 0)
  1072.     !self.visible
  1073.   end
  1074.   #--------------------------------------------------------------------------
  1075.   # ● ポップアップ消去済み?
  1076.   #--------------------------------------------------------------------------
  1077.   def removed?
  1078.     @remove
  1079.   end  
  1080.   #--------------------------------------------------------------------------
  1081.   # ● 座標更新
  1082.   #--------------------------------------------------------------------------
  1083.   def update_xy
  1084.     self.x = @rx
  1085.     self.y = @ry
  1086.     self.z = @rz
  1087.   end
  1088.   #--------------------------------------------------------------------------
  1089.   # ● ポップアップ位置の設定
  1090.   #--------------------------------------------------------------------------
  1091.   def set_position
  1092.     @rx = @battler.screen_x
  1093.     if @battler.actor?
  1094.       pos = LNX11::ACTOR_POPUP_POSITION
  1095.     else
  1096.       pos = [LNX11::ENEMY_POPUP_POSITION, 2].min
  1097.     end
  1098.     case pos
  1099.     when 0 ; @ry = @battler.screen_y        # 足元
  1100.     when 1 ; @ry = @battler.screen_y_center # 中心
  1101.     when 2 ; @ry = @battler.screen_y_top    # 頭上
  1102.     when 3 ; @ry = Graphics.height + LNX11::ACTOR_POPUP_Y # Y座標統一(アクター)
  1103.     end
  1104.   end
  1105.   #--------------------------------------------------------------------------
  1106.   # ● 描画するテキストの矩形を取得
  1107.   #--------------------------------------------------------------------------
  1108.   def text_size(str, name, size, bold = false)
  1109.     @@buf_bitmap = Bitmap.new(4, 4) if !@@buf_bitmap || @@buf_bitmap.disposed?
  1110.     @@buf_bitmap.font.name = name
  1111.     @@buf_bitmap.font.size = size
  1112.     @@buf_bitmap.font.bold = bold
  1113.     return @@buf_bitmap.text_size(str)
  1114.   end
  1115.   #--------------------------------------------------------------------------
  1116.   # ● 数字ビットマップの取得
  1117.   #--------------------------------------------------------------------------
  1118.   def bitmap_number(size = :large)
  1119.     return @@cache_number[size == :large ? 0 : 1]
  1120.   end
  1121.   #--------------------------------------------------------------------------
  1122.   # ● 数字ビットマップキャッシュの作成
  1123.   #--------------------------------------------------------------------------
  1124.   def create_number
  1125.     return if @@cache_number[0] && !@@cache_number[0].disposed?
  1126.     n_index = NUMBER_COLOR_SIZE
  1127.     @@cache_number.clear
  1128.     colors = LNX11::POPUP_COLOR.values # 色
  1129.     name = LNX11::NUMBER_FONT
  1130.     # 大・小の 2 パターンを作成する(ループ)
  1131.     [LNX11::LARGE_NUMBER, LNX11::SMALL_NUMBER].each_with_index do |n_size, i|
  1132.       next if get_number(i)
  1133.       size = n_size[:fontsize]
  1134.       # 数字の幅・高さ
  1135.       w = NUMBERS.collect{|n| text_size(n.to_s, name, size).width}.max + 4
  1136.       nh = NUMBERS.collect{|n| text_size(n.to_s, name, size).height}.max
  1137.       h = n_size[:line_height]
  1138.       @@w[i] = w
  1139.       @@h[i] = h
  1140.       # ビットマップ作成
  1141.       bitmap = Bitmap.new(w * NUMBERS.size, h * [colors.size, n_index].min)
  1142.       bitmap.font.name = LNX11::NUMBER_FONT
  1143.       bitmap.font.size = n_size[:fontsize]
  1144.       y = ((h - nh) / 2) - 1
  1145.       # 色ごとに分けて描画する(ループ)
  1146.       n_index.times do |col|
  1147.         # 色を変更
  1148.         bitmap.font.color.set(colors[col][0])
  1149.         bitmap.font.out_color.set(colors[col][1])
  1150.         # 文字ごとに分けて描画(ループ)
  1151.         NUMBERS.size.times do |num|
  1152.           bitmap.draw_text(num * w, (col * h) + y, w, nh, NUMBERS[num], 2)
  1153.         end
  1154.       end
  1155.       @@cache_number.push(bitmap)
  1156.     end
  1157.     p "LNX11a:数字ビットマップのキャッシュを作成しました。"
  1158.     # 数字ビットマップを表示する(テスト用)
  1159.     # s = Sprite.new
  1160.     # s.z = 1000000
  1161.     # s.bitmap = @@cache_number[1] # 0 or 1
  1162.     # loop do Graphics.update end
  1163.   end
  1164.   #--------------------------------------------------------------------------
  1165.   # ● 数字ビットマップの取得
  1166.   #--------------------------------------------------------------------------
  1167.   def get_number(i)
  1168.     case i
  1169.     when 0 # 大
  1170.       return false if LNX11::LARGE_NUMBER_NAME.empty?
  1171.       bitmap = Cache.system(LNX11::LARGE_NUMBER_NAME)
  1172.     when 1 # 小
  1173.       return false if LNX11::SMALL_NUMBER_NAME.empty?
  1174.       bitmap = Cache.system(LNX11::SMALL_NUMBER_NAME)
  1175.     end
  1176.     @@cache_number.push(bitmap)
  1177.     @@w[i] = bitmap.width / NUMBERS.size
  1178.     @@h[i] = bitmap.height / NUMBER_COLOR_SIZE
  1179.     true
  1180.   end
  1181.   #--------------------------------------------------------------------------
  1182.   # ● ダメージ数を描画したビットマップの取得
  1183.   #--------------------------------------------------------------------------
  1184.   def number(num, color, size = :large, deco = nil)
  1185.     # 数値を文字列の配列にする
  1186.     numbers = (num.abs.to_s).split(//)
  1187.     # 色番号を取得
  1188.     color_index = COLOR_KEYS.index(color)
  1189.     # ポップアップサイズを設定
  1190.     n_bitmap = bitmap_number(size)
  1191.     if size == :large
  1192.       n_size = LNX11::LARGE_NUMBER
  1193.       i = 0
  1194.     else
  1195.       n_size = LNX11::SMALL_NUMBER
  1196.       i = 1
  1197.     end
  1198.     spacing = n_size[:spacing]
  1199.     w = @@w[i]
  1200.     h = @@h[i]
  1201.     # ダメージ値のビットマップサイズ
  1202.     @bw = w * numbers.size + spacing * (numbers.size - 1)
  1203.     @bh = h
  1204.     # 修飾文字の描画
  1205.     @offset_x = @offset_y = 0
  1206.     text_bitmap = deco_text(deco,color,n_size[:fontsize]) if deco[1] >= 0
  1207.     # ビットマップを作成
  1208.     bitmap = Bitmap.new(@bw, @bh)
  1209.     # 塗りつぶし(テスト用)
  1210.     # bitmap.fill_rect(bitmap.rect, Color.new(0,0,0,128))
  1211.     # ダメージ値を描画
  1212.     rect = Rect.new(0, h * color_index, w, h)
  1213.     numbers.size.times do |n|
  1214.       rect.x = numbers[n].to_i * w
  1215.       bitmap.blt(w * n + spacing * n + @offset_x, @offset_y, n_bitmap, rect)
  1216.     end
  1217.     # 修飾文字の描画をコールバック
  1218.     @decoblt.call(bitmap) if @decoblt
  1219.     @decoblt = nil
  1220.     # ビットマップを返す
  1221.     bitmap
  1222.   end
  1223.   #--------------------------------------------------------------------------
  1224.   # ● 修飾文字の描画
  1225.   #--------------------------------------------------------------------------
  1226.   def deco_text(deco, color, sizerate)
  1227.     # 元の幅・高さ
  1228.     ow = @bw
  1229.     oh = @bh
  1230.     case deco[1]   
  1231.     when 2 # ダメージ値の下
  1232.       # テキストのビットマップを取得
  1233.       size = decosize(deco[0], sizerate, :top_bottom)
  1234.       text_bitmap = text(deco[0], color, size)
  1235.       # テキストの幅・高さ
  1236.       tw = text_bitmap.width
  1237.       th = text_bitmap.height * 0.8
  1238.       # 最終的なビットマップのサイズ
  1239.       @bw = [@bw, tw].max
  1240.       @bh += th
  1241.       # ダメージ値の描画位置の修正
  1242.       @offset_x = (@bw - ow) / 2
  1243.       @offset_y = 0
  1244.       # 修飾文字の描画位置を設定
  1245.       x = (@bw - tw) / 2
  1246.       y = oh * 0.8
  1247.     when 4 # ダメージ値の左
  1248.       # テキストのビットマップを取得
  1249.       size = decosize(deco[0], sizerate, :left_right)
  1250.       text_bitmap = text(deco[0], color, size)
  1251.       # テキストの幅・高さ
  1252.       tw = text_bitmap.width
  1253.       th = text_bitmap.height
  1254.       # 最終的なビットマップのサイズ
  1255.       @bw += tw
  1256.       @bh = [@bh, th].max
  1257.       # ダメージ値の描画位置の修正
  1258.       @offset_x = tw
  1259.       @offset_y = (@bh - oh) / 2
  1260.       # 修飾文字の描画位置を設定
  1261.       x = 2
  1262.       y = (@bh - th) / 2
  1263.     when 6 # ダメージ値の右
  1264.       # テキストのビットマップを取得
  1265.       size = decosize(deco[0], sizerate, :left_right)
  1266.       text_bitmap = text(deco[0], color, size)
  1267.       # テキストの幅・高さ
  1268.       tw = text_bitmap.width
  1269.       th = text_bitmap.height
  1270.       # 最終的なビットマップのサイズ
  1271.       @bw += tw
  1272.       @bh = [@bh, th].max
  1273.       # ダメージ値の描画位置の修正
  1274.       @offset_x = 0
  1275.       @offset_y = (@bh - oh) / 2
  1276.       # 修飾文字の描画位置を設定
  1277.       x = ow
  1278.       y = (@bh - th) / 2
  1279.     when 8 # ダメージ値の上
  1280.       # テキストのビットマップを取得
  1281.       size = decosize(deco[0], sizerate, :top_bottom)
  1282.       text_bitmap = text(deco[0], color, size)
  1283.       # テキストの幅・高さ
  1284.       tw = text_bitmap.width
  1285.       th = text_bitmap.height * 0.8
  1286.       # 最終的なビットマップのサイズ
  1287.       @bw = [@bw, tw].max
  1288.       @bh += th
  1289.       # ダメージ値の描画位置の修正
  1290.       @offset_x = (@bw - ow) / 2
  1291.       @offset_y = @bh - oh
  1292.       # 修飾文字の描画位置を設定
  1293.       x = (@bw - tw) / 2
  1294.       y = 0
  1295.     end
  1296.     # 修飾文字の描画(コールバック)
  1297.     @decoblt = Proc.new {|bitmap|
  1298.     bitmap.blt(x, y, text_bitmap, text_bitmap.rect)
  1299.     text_bitmap.dispose}
  1300.     return text_bitmap
  1301.   end
  1302.   #--------------------------------------------------------------------------
  1303.   # ● 修飾文字のサイズ
  1304.   #--------------------------------------------------------------------------
  1305.   def decosize(text, size, pos)
  1306.     if text.length != text.bytesize
  1307.       return size * LNX11::TEXT_SIZERATE[pos] * LNX11::TEXT_SIZERATE_MCS
  1308.     else
  1309.       return size * LNX11::TEXT_SIZERATE[pos]
  1310.     end
  1311.   end
  1312.   #--------------------------------------------------------------------------
  1313.   # ● テキストを描画したビットマップの取得
  1314.   #  ステートやダメージ値の修飾文字の描画に使用します。
  1315.   #--------------------------------------------------------------------------
  1316.   def text(text, color, size = :large, buff_data = [-1, -1])
  1317.     # キャッシュがあればそれを返す(無ければ作成)
  1318.     key = text + color.to_s + size.to_s
  1319.     if @@cache_text[key] && !@@cache_text[key].disposed?
  1320.       return @@cache_text[key].clone
  1321.     end
  1322.     # 用語の置き換え
  1323.     text.gsub!("\hp") { Vocab::hp_a } if text.include?("\hp")
  1324.     text.gsub!("\mp") { Vocab::mp_a } if text.include?("\mp")
  1325.     text.gsub!("\tp") { Vocab::tp_a } if text.include?("\tp")
  1326.     # <<ver1.10>> テキストの頭に _ があれば対応する画像ファイルを参照する
  1327.     if text[/^[\_]./]
  1328.       bitmap = get_text_bitmap(text, color, size)
  1329.       # キャッシュに保存
  1330.       @@cache_text[key] = bitmap
  1331.       # ビットマップを返す
  1332.       return bitmap.clone
  1333.     end
  1334.     # <<ver1.10>>
  1335.     # 能力強化/弱体のポップアップで、ファイル名が指定されていればそれを返す
  1336.     if buff_data[0] >= 0 &&
  1337.       (size == :large && !LNX11::LARGE_BUFFS_NAME.empty?) ||
  1338.       (size == :small && !LNX11::SMALL_BUFFS_NAME.empty?)
  1339.       bitmap = get_buff_bitmap(buff_data, size)
  1340.       # キャッシュに保存
  1341.       @@cache_text[key] = bitmap
  1342.       # ビットマップを返す
  1343.       return bitmap.clone
  1344.     end
  1345.     # テキストにマルチバイト文字があれば日本語用フォントを使う
  1346.     if text.length != text.bytesize
  1347.       fontname = LNX11::TEXT_FONT_MCS
  1348.       sizerate = LNX11::TEXT_SIZERATE[:normal] * LNX11::TEXT_SIZERATE_MCS
  1349.     else
  1350.       fontname = LNX11::TEXT_FONT
  1351.       sizerate = LNX11::TEXT_SIZERATE[:normal]
  1352.     end
  1353.     # ポップアップサイズを設定
  1354.     case size
  1355.     when :large ; fontsize = LNX11::LARGE_NUMBER[:fontsize] * sizerate
  1356.     when :small ; fontsize = LNX11::SMALL_NUMBER[:fontsize] * sizerate
  1357.     else        ; fontsize = size
  1358.     end
  1359.     # テキストサイズ計算
  1360.     rect = text_size(text, fontname, fontsize)
  1361.     rect.width += 2
  1362.     # ビットマップを作成
  1363.     bitmap = Bitmap.new(rect.width, rect.height)
  1364.     # 塗りつぶし(テスト用)
  1365.     # bitmap.fill_rect(bitmap.rect, Color.new(0,0,0,128))
  1366.     # フォント設定
  1367.     bitmap.font.name = fontname
  1368.     bitmap.font.size = fontsize
  1369.     bitmap.font.color.set(LNX11::POPUP_COLOR[color][0])
  1370.     bitmap.font.out_color.set(LNX11::POPUP_COLOR[color][1])
  1371.     # テキスト描画
  1372.     bitmap.draw_text(rect, text, 1)
  1373.     # キャッシュに保存
  1374.     @@cache_text[key] = bitmap
  1375.     # ビットマップを返す
  1376.     bitmap.clone
  1377.   end
  1378.   #--------------------------------------------------------------------------
  1379.   # ● 能力強化/弱体ビットマップの取得 <<ver1.10>>
  1380.   #--------------------------------------------------------------------------
  1381.   def get_buff_bitmap(buff_data, size)
  1382.     case size
  1383.     when :large ; src_bitmap = Cache.system(LNX11::LARGE_BUFFS_NAME)
  1384.     when :small ; src_bitmap = Cache.system(LNX11::SMALL_BUFFS_NAME)
  1385.     end
  1386.     src_rect = Rect.new
  1387.     src_rect.width  = src_bitmap.width  / 2
  1388.     src_rect.height = src_bitmap.height / 12
  1389.     src_rect.x = (buff_data[0] / 4) * src_rect.width
  1390.     src_rect.y = (buff_data[0] % 4) * src_rect.height * 3 +
  1391.                   buff_data[1] * src_rect.height
  1392.     bitmap = Bitmap.new(src_rect.width, src_rect.height)
  1393.     bitmap.blt(0, 0, src_bitmap, src_rect)
  1394.     bitmap
  1395.   end
  1396.   #--------------------------------------------------------------------------
  1397.   # ● テキストビットマップの取得 <<ver1.10>>
  1398.   #--------------------------------------------------------------------------
  1399.   def get_text_bitmap(text, color, size)
  1400.     # クリティカルカラーかつ、弱点/耐性なら参照するビットマップを変更
  1401.     if LNX11::POPUP_COLOR[color] == LNX11::POPUP_COLOR[:critical] &&
  1402.       (text == LNX11::DECORATION_NUMBER[:weakness][0] ||
  1403.        text == LNX11::DECORATION_NUMBER[:resist][0])
  1404.       # ファイル名に _critcolor を加える
  1405.       text += "_critcolor"
  1406.     end
  1407.     # MPダメージ/回復(符号なし)なら参照するビットマップを変更
  1408.     if text == LNX11::DECORATION_NUMBER[:mp_damage][0]
  1409.       # カラーに応じてファイル名を変更
  1410.       case LNX11::POPUP_COLOR[color]
  1411.       when LNX11::POPUP_COLOR[:mp_damage]   ; text += "_damage"
  1412.       when LNX11::POPUP_COLOR[:mp_recovery] ; text += "_recovery"
  1413.       end
  1414.     end
  1415.     # popup_xxxxxx_(large or small)
  1416.     Cache.system("popup" + text + (size == :large ? "_large" : "_small"))
  1417.   end
  1418. end

  1419. #==============================================================================
  1420. # ■ [追加]:Sprite_PopupSpring
  1421. #------------------------------------------------------------------------------
  1422. #  通常の跳ねるポップアップ。
  1423. #==============================================================================

  1424. class Sprite_PopupSpring < Sprite_PopupBase
  1425.   #--------------------------------------------------------------------------
  1426.   # ● ポップアップ Z 座標
  1427.   #--------------------------------------------------------------------------
  1428.   def base_z
  1429.     14
  1430.   end
  1431.   #--------------------------------------------------------------------------
  1432.   # ● 開始処理
  1433.   #--------------------------------------------------------------------------
  1434.   def start
  1435.     # 動き設定
  1436.     set_movement
  1437.     # ディレイ設定 同じタイプのポップアップが重ならないようにする
  1438.     if @popup_size == :small
  1439.       self.oy -= @battler.popup_delay[1]
  1440.       @delay_clear = (@delay == 0)
  1441.       dy = self.bitmap.height * 0.8
  1442.       @battler.popup_delay[1] += dy
  1443.       @delay = 0
  1444.     end
  1445.   end
  1446.   #--------------------------------------------------------------------------
  1447.   # ● 終了処理
  1448.   #--------------------------------------------------------------------------  
  1449.   def terminate
  1450.     # 一番上のポップアップなら、ディレイを初期化する
  1451.     @battler.popup_delay[1] = 0 if @delay_clear
  1452.   end
  1453.   #--------------------------------------------------------------------------
  1454.   # ● 投射運動の設定
  1455.   #--------------------------------------------------------------------------
  1456.   def set_movement
  1457.     if @popup_size == :large
  1458.       movement = LNX11::LARGE_MOVEMENT
  1459.     else
  1460.       movement = LNX11::SMALL_MOVEMENT
  1461.     end
  1462.     [url=home.php?mod=space&uid=287440]@fall[/url]       = -movement[:inirate]
  1463.     @gravity    =  movement[:gravity]
  1464.     @side       =  movement[:side_scatter] * rand(0) * (rand(2) == 0 ? -1 : 1)
  1465.     @ref_move   =  movement[:ref_height]
  1466.     @ref_factor =  movement[:ref_factor]
  1467.     @ref_count  =  movement[:ref_count]
  1468.     @duration   =  movement[:duration]
  1469.     @fadeout    =  movement[:fadeout]
  1470.   end
  1471.   #--------------------------------------------------------------------------
  1472.   # ● フレーム更新
  1473.   #--------------------------------------------------------------------------
  1474.   def update_popup
  1475.     update_freefall
  1476.   end
  1477.   #--------------------------------------------------------------------------
  1478.   # ● 投射運動の更新
  1479.   #--------------------------------------------------------------------------
  1480.   def update_freefall
  1481.     if @ref_count >= 0
  1482.       # X:左右移動
  1483.       @rx += @side
  1484.       # Y:自由落下
  1485.       @ry += @fall
  1486.       @ref_move -= @fall
  1487.       @fall += @gravity
  1488.       # 跳ね返り
  1489.       if @ref_move <= 0 && @fall >= 0
  1490.         @ref_count -= 1
  1491.         @fall = -@fall * @ref_factor
  1492.       end      
  1493.     end
  1494.   end
  1495. end

  1496. #==============================================================================
  1497. # ■ [追加]:Sprite_PopupRising
  1498. #------------------------------------------------------------------------------
  1499. #  少しずつ上昇するポップアップ。
  1500. #==============================================================================

  1501. class Sprite_PopupRising < Sprite_PopupBase
  1502.   #--------------------------------------------------------------------------
  1503.   # ● ポップアップ Z 座標
  1504.   #--------------------------------------------------------------------------
  1505.   def base_z
  1506.     6
  1507.   end
  1508.   #--------------------------------------------------------------------------
  1509.   # ● 開始処理
  1510.   #--------------------------------------------------------------------------
  1511.   def start
  1512.     # 動き設定
  1513.     set_movement
  1514.     self.opacity = 0
  1515.     d = self.bitmap.height * LNX11::RISE_MOVEMENT[:line_spacing]
  1516.     @delay_count = d / @rising_speed
  1517.     @battler.popup_delay[2] += @delay_count
  1518.   end
  1519.   #--------------------------------------------------------------------------
  1520.   # ● 動きの設定
  1521.   #--------------------------------------------------------------------------
  1522.   def set_movement
  1523.     @rising_speed = LNX11::RISE_MOVEMENT[:rising_speed]
  1524.     @duration = LNX11::RISE_MOVEMENT[:duration]
  1525.     @fadeout  = LNX11::RISE_MOVEMENT[:fadeout]
  1526.   end
  1527.   #--------------------------------------------------------------------------
  1528.   # ● フレーム更新
  1529.   #--------------------------------------------------------------------------
  1530.   def update_popup
  1531.     @delay_count -= 1
  1532.     @battler.popup_delay[2] -= 1 if @delay_count >= 0
  1533.     @ry -= @rising_speed # すこしずつ上昇
  1534.     self.opacity += 32 if @duration > 0
  1535.   end
  1536. end

  1537. #==============================================================================
  1538. # ■ [追加]:Sprite_PopupSliding
  1539. #------------------------------------------------------------------------------
  1540. #  スライド表示するポップアップ。
  1541. #==============================================================================

  1542. class Sprite_PopupSliding < Sprite_PopupBase
  1543.   #--------------------------------------------------------------------------
  1544.   # ● ポップアップ Z 座標
  1545.   #--------------------------------------------------------------------------
  1546.   def base_z
  1547.     8
  1548.   end
  1549.   #--------------------------------------------------------------------------
  1550.   # ● 開始処理
  1551.   #--------------------------------------------------------------------------
  1552.   def start
  1553.     # 動き設定
  1554.     set_movement
  1555.     d = self.bitmap.height * LNX11::SLIDE_MOVEMENT[:line_spacing]
  1556.     self.oy += @delay + d / 2 if @delay > 0
  1557.     self.opacity = 0
  1558.     # ディレイ設定 同じタイプのポップアップが重ならないようにする
  1559.     @delay_clear = (@delay == 0)
  1560.     @battler.popup_delay[3] += (@delay <= 0 ? d / 2 : d)
  1561.     @delay = 0
  1562.   end
  1563.   #--------------------------------------------------------------------------
  1564.   # ● 終了処理
  1565.   #--------------------------------------------------------------------------  
  1566.   def terminate
  1567.     # 一番下のポップアップなら、ディレイを初期化する
  1568.     @battler.popup_delay[3] = 0 if @delay_clear
  1569.   end
  1570.   #--------------------------------------------------------------------------
  1571.   # ● 動きの設定
  1572.   #--------------------------------------------------------------------------
  1573.   def set_movement
  1574.     @x_speed  = LNX11::SLIDE_MOVEMENT[:x_speed]
  1575.     @duration = LNX11::SLIDE_MOVEMENT[:duration]
  1576.     @fadeout  = LNX11::SLIDE_MOVEMENT[:fadeout]
  1577.     # フェードインのスライド分だけ X を移動
  1578.     @rx -= @x_speed * 255.0 / @fadeout
  1579.   end
  1580.   #--------------------------------------------------------------------------
  1581.   # ● フレーム更新
  1582.   #--------------------------------------------------------------------------
  1583.   def update_popup
  1584.     @rx += @x_speed if opacity != 255 # スライド
  1585.     self.opacity += @fadeout if @duration > 0
  1586.   end
  1587. end

  1588. #==============================================================================
  1589. # ■ [追加]:Sprite_PopupOverlay
  1590. #------------------------------------------------------------------------------
  1591. #  オーバーレイポップアップ。自身の複製を加算合成で重ね合わせます。
  1592. #==============================================================================

  1593. class Sprite_PopupOverlay < Sprite_PopupBase
  1594.   #--------------------------------------------------------------------------
  1595.   # ● ポップアップ Z 座標
  1596.   #--------------------------------------------------------------------------
  1597.   def base_z
  1598.     10
  1599.   end
  1600.   #--------------------------------------------------------------------------
  1601.   # ● 開始処理
  1602.   #--------------------------------------------------------------------------
  1603.   def start
  1604.     @duration = LNX11::OVERLAY_MOVEMENT[:duration]
  1605.     @fadeout  = LNX11::OVERLAY_MOVEMENT[:fadeout]
  1606.     # オーバーレイの作成
  1607.     create_overlay
  1608.   end
  1609.   #--------------------------------------------------------------------------
  1610.   # ● 終了処理
  1611.   #--------------------------------------------------------------------------
  1612.   def terminate
  1613.     @overlay.dispose
  1614.     @overlay = nil
  1615.   end
  1616.   #--------------------------------------------------------------------------
  1617.   # ● オーバーレイ(複製)の作成
  1618.   #--------------------------------------------------------------------------
  1619.   def create_overlay
  1620.     @overlay = Sprite.new
  1621.     @overlay.bitmap   = self.bitmap
  1622.     @overlay.viewport = self.viewport
  1623.     @overlay.ox = self.ox
  1624.     @overlay.oy = self.oy
  1625.     @overlay.visible = false
  1626.     @overlay.blend_type = 1
  1627.   end
  1628.   #--------------------------------------------------------------------------
  1629.   # ● フレーム更新
  1630.   #--------------------------------------------------------------------------
  1631.   def update_popup
  1632.     self.opacity += @fadeout * 2 if @duration > 0
  1633.   end
  1634.   #--------------------------------------------------------------------------
  1635.   # ● フレーム更新
  1636.   #--------------------------------------------------------------------------
  1637.   def update
  1638.     super
  1639.     update_overlay
  1640.   end
  1641.   #--------------------------------------------------------------------------
  1642.   # ● オーバーレイの更新
  1643.   #--------------------------------------------------------------------------
  1644.   def update_overlay
  1645.     return if self.disposed? || @overlay.opacity == 0
  1646.     @overlay.x = self.x
  1647.     @overlay.y = self.y
  1648.     @overlay.z = self.z
  1649.     # 拡大・消去
  1650.     @overlay.zoom_x += 0.16
  1651.     @overlay.zoom_y += 0.12
  1652.     @overlay.opacity -= 20
  1653.     @overlay.visible = (@overlay.opacity != 0)
  1654.   end
  1655. end

  1656. #==============================================================================
  1657. # ■ [追加]:Sprite_PopupLevelUp
  1658. #------------------------------------------------------------------------------
  1659. #  レベルアップのポップアップ。スライドポップアップを継承しています。
  1660. #==============================================================================

  1661. class Sprite_PopupLevelUp < Sprite_PopupSliding
  1662.   #--------------------------------------------------------------------------
  1663.   # ● ポップアップ Z 座標
  1664.   #--------------------------------------------------------------------------
  1665.   def base_z
  1666.     32
  1667.   end
  1668.   #--------------------------------------------------------------------------
  1669.   # ● ポップアップ位置の設定
  1670.   #--------------------------------------------------------------------------
  1671.   def set_position
  1672.     @rx = @battler.screen_x - LNX11::ACTOR_OFFSET[:x]
  1673.     case LNX11::LEVELUP_POPUP_POSITION
  1674.     when 0 ; @ry = @battler.screen_y        # 足元
  1675.     when 1 ; @ry = @battler.screen_y_center # 中心
  1676.     when 2 ; @ry = @battler.screen_y_top    # 頭上
  1677.     when 3 ; @ry = Graphics.height + LNX11::LEVELUP_POPUP_Y # Y座標統一
  1678.     end
  1679.   end
  1680.   #--------------------------------------------------------------------------
  1681.   # ● フレーム更新
  1682.   #--------------------------------------------------------------------------
  1683.   def update_popup
  1684.     super
  1685.     # リザルト中なら自動的に消去しない
  1686.     @duration += 1 if $game_troop.all_dead? || $game_message.busy?
  1687.   end
  1688. end

  1689. #==============================================================================
  1690. # ■ Bitmap
  1691. #==============================================================================

  1692. class Bitmap
  1693.   #--------------------------------------------------------------------------
  1694.   # ● [追加]:カーソル用三角形の描画
  1695.   #--------------------------------------------------------------------------
  1696.   def lnx_cursor_triangle(size, color, oy = 0, grad = 1)
  1697.     color = color.clone
  1698.     x = (self.width - size) / 2
  1699.     y = (self.height - size) / 2 + oy
  1700.     rect = Rect.new(x, y, size, 1)
  1701.     count = size / 2
  1702.     minus = 128 / count / 2
  1703.     count.times do
  1704.       clear_rect(rect)
  1705.       fill_rect(rect, color)
  1706.       color.red   = [color.red   - minus * grad, 0].max
  1707.       color.green = [color.green - minus * grad, 0].max
  1708.       color.blue  = [color.blue  - minus * grad, 0].max
  1709.       rect.y += rect.height
  1710.       clear_rect(rect)
  1711.       fill_rect(rect, color)
  1712.       color.red   = [color.red   - minus * grad, 0].max
  1713.       color.green = [color.green - minus * grad, 0].max
  1714.       color.blue  = [color.blue  - minus * grad, 0].max
  1715.       rect.x += 1
  1716.       rect.y += rect.height
  1717.       rect.width -= 2
  1718.     end
  1719.   end
  1720. end

  1721. #==============================================================================
  1722. # ■ [追加]:Sprite_TargetCursor
  1723. #------------------------------------------------------------------------------
  1724. #  対象選択されているバトラーや行動選択中のアクターを示すアローカーソルです。
  1725. #==============================================================================
  1726. class Sprite_TargetCursor < Sprite
  1727.   #--------------------------------------------------------------------------
  1728.   # ● クラス変数
  1729.   #--------------------------------------------------------------------------
  1730.   @@cursor_cache = nil
  1731.   #--------------------------------------------------------------------------
  1732.   # ● 公開インスタンス変数
  1733.   #--------------------------------------------------------------------------
  1734.   attr_accessor :battler     # バトラー
  1735.   attr_accessor :blink       # 点滅(対象の選択中)
  1736.   #--------------------------------------------------------------------------
  1737.   # ● オブジェクト初期化
  1738.   #--------------------------------------------------------------------------
  1739.   def initialize(viewport = nil)
  1740.     super(viewport)
  1741.     @wait = LNX11::CURSOR_ANI_SPEED
  1742.     @speed = [LNX11::CURSOR_SPEED, 1].max
  1743.     @battler = nil
  1744.     @sub_cursor = []
  1745.     @blink = false
  1746.     self.bitmap = cursor_bitmap
  1747.     partition = self.bitmap.width / self.height
  1748.     self.src_rect.set(0, 0, self.width / partition, self.height)
  1749.     self.ox = self.width / 2
  1750.     self.oy = self.height / 2
  1751.     self.x = @rx = @tx = 0
  1752.     self.y = @ry = @ty = 0
  1753.     self.z = 98
  1754.     self.visible = false
  1755.   end
  1756.   #--------------------------------------------------------------------------
  1757.   # ● 解放
  1758.   #--------------------------------------------------------------------------  
  1759.   def dispose
  1760.     dispose_subcursor
  1761.     super
  1762.   end
  1763.   #--------------------------------------------------------------------------
  1764.   # ● サブカーソル作成
  1765.   #  メンバー全体にカーソルを表示するために複数のカーソルを作成します。
  1766.   #--------------------------------------------------------------------------  
  1767.   def create_subcursor(members)
  1768.     return unless @sub_cursor.empty?
  1769.     members.each_with_index do |battler, i|
  1770.       @sub_cursor[i] = Sprite_TargetCursor.new(self.viewport)
  1771.       @sub_cursor[i].set(@rx, @ry)
  1772.       @sub_cursor[i].set(battler, true)
  1773.     end
  1774.   end
  1775.   #--------------------------------------------------------------------------
  1776.   # ● サブカーソル解放
  1777.   #--------------------------------------------------------------------------  
  1778.   def dispose_subcursor
  1779.     @sub_cursor.each {|sprite| sprite.dispose }
  1780.     @sub_cursor = []
  1781.   end
  1782.   #--------------------------------------------------------------------------
  1783.   # ● サブカーソル更新
  1784.   #--------------------------------------------------------------------------  
  1785.   def update_subcursor
  1786.     @sub_cursor.each {|sprite| sprite.update }
  1787.   end
  1788.   #--------------------------------------------------------------------------
  1789.   # ● ビットマップの設定
  1790.   #--------------------------------------------------------------------------
  1791.   def cursor_bitmap
  1792.     if !LNX11::CURSOR_NAME.empty?
  1793.       return Cache.system(LNX11::CURSOR_NAME)
  1794.     else
  1795.       # カーソルファイル名が指定されていなければRGSS側で生成
  1796.       return @@cursor_cache if @@cursor_cache && !@@cursor_cache.disposed?
  1797.       @@cursor_cache = Bitmap.new(32, 32)
  1798.       color = Color.new(0, 0, 0)
  1799.       @@cursor_cache.lnx_cursor_triangle(26, color, 2)
  1800.       2.times {@@cursor_cache.blur}
  1801.       color.set(255, 255, 255)
  1802.       @@cursor_cache.lnx_cursor_triangle(24, color, 1, 0.5)
  1803.       tone = LNX11::CURSOR_TONE ? LNX11::CURSOR_TONE : $game_system.window_tone
  1804.       r = 118 + tone.red
  1805.       g = 118 + tone.green
  1806.       b = 118 + tone.blue
  1807.       color.set(r, g, b, 232)
  1808.       @@cursor_cache.lnx_cursor_triangle(20, color,  0)
  1809.       @@cursor_cache.lnx_cursor_triangle(20, color,  1)
  1810.       p "LNX11a:カーソルビットマップを作成しました。"
  1811.       return @@cursor_cache
  1812.     end
  1813.   end
  1814.   #--------------------------------------------------------------------------
  1815.   # ● カーソルの表示
  1816.   #--------------------------------------------------------------------------
  1817.   def show
  1818.     self.x = @rx = @tx
  1819.     self.y = @ry = @ty
  1820.     self.visible = true
  1821.   end
  1822.   #--------------------------------------------------------------------------
  1823.   # ● カーソルの非表示
  1824.   #--------------------------------------------------------------------------
  1825.   def hide
  1826.     dispose_subcursor
  1827.     @battler = nil
  1828.     self.visible = false
  1829.   end
  1830.   #--------------------------------------------------------------------------
  1831.   # ● 移動平均
  1832.   #--------------------------------------------------------------------------
  1833.   def sma(a, b, p)
  1834.     # a = 目標位置 b = 現在地
  1835.     return a if a == b || (a - b).abs < 0.3 || p == 1
  1836.     result = ((a + b * (p.to_f - 1)) / p.to_f)
  1837.     return (a - result).abs <= 1.0 ? (b < a ? b + 0.3 : b - 0.3) : result
  1838.   end
  1839.   #--------------------------------------------------------------------------
  1840.   # ● フレーム更新
  1841.   #--------------------------------------------------------------------------
  1842.   def update
  1843.     update_subcursor
  1844.     self.opacity = @sub_cursor.empty? ? 255 : 0
  1845.     return if !visible || !@sub_cursor.empty?
  1846.     super
  1847.     # 点滅
  1848.     if LNX11::CURSOR_BLINK
  1849.       self.blend_type = @blink && Graphics.frame_count / 3 % 2 == 0 ? 1 : 0
  1850.     end
  1851.     # アニメーションを進める
  1852.     @wait -= 1
  1853.     if @wait <= 0
  1854.       @wait += LNX11::CURSOR_ANI_SPEED
  1855.       self.src_rect.x += self.width
  1856.       self.src_rect.x = 0 if self.src_rect.x >= self.bitmap.width
  1857.     end
  1858.     # カーソルの座標を更新
  1859.     set_xy if @battler && @sub_cursor.empty?
  1860.     self.x = @rx = sma(@tx, @rx, @speed)
  1861.     self.y = @ry = sma(@ty, @ry, @speed)
  1862.   end
  1863.   #--------------------------------------------------------------------------
  1864.   # ● カーソル位置の設定
  1865.   #--------------------------------------------------------------------------
  1866.   def set(*args)
  1867.     if args[0].is_a?(Numeric)
  1868.       # 引数一つ目が数値なら、XY指定
  1869.       @battler = nil
  1870.       set_xy(args[0], args[1])
  1871.       @blink = args[2] ? args[2] : false
  1872.     else
  1873.       # バトラーorシンボル指定
  1874.       if @battler != args[0]
  1875.         @battler = args[0]
  1876.         dispose_subcursor
  1877.         case args[0]
  1878.         when :party        ; create_subcursor($game_party.members)
  1879.         when :troop        ; create_subcursor($game_troop.alive_members)
  1880.         when :troop_random ; create_subcursor($game_troop.alive_members)
  1881.         else ; args[0] ? set_xy : hide
  1882.         end
  1883.       end
  1884.       @blink = args[1] ? args[1] : false
  1885.     end
  1886.     # スピードが1かカーソルが非表示なら表示に変える
  1887.     show if @sub_cursor.empty? && (@speed == 1 || !visible)
  1888.   end
  1889.   #--------------------------------------------------------------------------
  1890.   # ● カーソル位置をバトラーの位置に設定
  1891.   #--------------------------------------------------------------------------
  1892.   def set_xy(x = nil, y = nil)
  1893.     if x
  1894.       # 直接指定
  1895.       x += LNX11::CURSOR_OFFSET[:x]
  1896.       y += LNX11::CURSOR_OFFSET[:y]
  1897.     else
  1898.       # バトラーの座標
  1899.       x = @battler.screen_x + LNX11::CURSOR_OFFSET[:x]
  1900.       y = @battler.screen_y_top + LNX11::CURSOR_OFFSET[:y]
  1901.     end
  1902.     @tx = x
  1903.     minmax = LNX11::CURSOR_MINMAX
  1904.     @ty = [[y, minmax[:min] + self.oy].max, minmax[:max]].min
  1905.   end
  1906. end

  1907. #==============================================================================
  1908. # ■ [追加]:Sprite_OneLine_BattleLog
  1909. #------------------------------------------------------------------------------
  1910. #  バトルログを動的に表示するスプライトです。単体では1行しか表示できませんが、
  1911. # 複数同時に扱うことで複数行の表示を実装しています。
  1912. #==============================================================================

  1913. class Sprite_OneLine_BattleLog < Sprite
  1914.   @@grad_cache = nil
  1915.   #--------------------------------------------------------------------------
  1916.   # ● 公開インスタンス変数
  1917.   #--------------------------------------------------------------------------
  1918.   attr_accessor   :position # 表示位置(行)
  1919.   #--------------------------------------------------------------------------
  1920.   # ● オブジェクト初期化
  1921.   #--------------------------------------------------------------------------
  1922.   def initialize(width, height, max_line_number)
  1923.     super(nil)
  1924.     @rx = @ry = 0
  1925.     @line_height = height
  1926.     @max_line_number = max_line_number
  1927.     @position = -1
  1928.     @visible = true
  1929.     self.ox = -LNX11::STORAGE_OFFSET[:x]
  1930.     self.oy = -LNX11::STORAGE_OFFSET[:y]
  1931.     self.opacity = 0
  1932.     self.z = 96
  1933.     self.bitmap = Bitmap.new(width * 0.75, height)
  1934.   end
  1935.   #--------------------------------------------------------------------------
  1936.   # ● 解放
  1937.   #--------------------------------------------------------------------------  
  1938.   def dispose
  1939.     self.bitmap.dispose
  1940.     super
  1941.   end
  1942.   #--------------------------------------------------------------------------
  1943.   # ● スプライトの表示
  1944.   #--------------------------------------------------------------------------  
  1945.   def show
  1946.     @visible = true
  1947.   end
  1948.   #--------------------------------------------------------------------------
  1949.   # ● スプライトの非表示
  1950.   #--------------------------------------------------------------------------  
  1951.   def hide
  1952.     @visible = false
  1953.     @position = -1
  1954.   end
  1955.   #--------------------------------------------------------------------------
  1956.   # ● 表示しているか?
  1957.   #--------------------------------------------------------------------------  
  1958.   def visible?
  1959.     @visible
  1960.   end
  1961.   #--------------------------------------------------------------------------
  1962.   # ● フレーム更新
  1963.   #--------------------------------------------------------------------------
  1964.   def update
  1965.     return if self.opacity == 0
  1966.     self.opacity += @visible && @position >= 0 ? 24 : -24
  1967.     self.visible = self.opacity > 0
  1968.     return unless @visible # 不可視状態なら座標を更新しない
  1969.     @ry = (target_y + (@ry * 5)) / 6.0 if target_y < @ry
  1970.     @rx += 2 if @rx < 0
  1971.     self.x = @rx
  1972.     self.y = @ry
  1973.   end
  1974.   #--------------------------------------------------------------------------
  1975.   # ● テキストの描画
  1976.   #  自身が持つ Bitmap で描画するのではなく、Window の contents から
  1977.   # コピーします(Sprite からでは Window_Base#draw_text_ex が扱えないため)。
  1978.   #--------------------------------------------------------------------------
  1979.   def set_text(window, position)
  1980.     self.bitmap.clear
  1981.     # 横グラデーション
  1982.     if @@grad_cache && !@@grad_cache.disposed?
  1983.       self.bitmap.blt(0, 0, @@grad_cache, self.bitmap.rect)
  1984.     else
  1985.       color = LNX11::STORAGE_GRADIENT_COLOR
  1986.       fillrect = self.bitmap.rect
  1987.       fillrect.width /= 2
  1988.       self.bitmap.gradient_fill_rect(fillrect, color[0], color[1])
  1989.       @@grad_cache = self.bitmap.clone
  1990.     end
  1991.     # contents からコピー
  1992.     self.bitmap.blt(4, 0, window.contents, self.bitmap.rect)
  1993.     self.opacity = 1
  1994.     @rx = -8
  1995.     @position = position
  1996.     @ry = target_y
  1997.   end
  1998.   #--------------------------------------------------------------------------
  1999.   # ● 位置の繰り上げ
  2000.   #--------------------------------------------------------------------------
  2001.   def up_position
  2002.     @position -= 1
  2003.   end
  2004.   #--------------------------------------------------------------------------
  2005.   # ● メッセージが空か?(表示待ち)
  2006.   #--------------------------------------------------------------------------
  2007.   def mes_empty?
  2008.     @position < 0
  2009.   end
  2010.   #--------------------------------------------------------------------------
  2011.   # ● 移動するべき Y 座標
  2012.   #--------------------------------------------------------------------------
  2013.   def target_y
  2014.     @position * @line_height
  2015.   end
  2016. end

  2017. #==============================================================================
  2018. # ■ Window_BattleLog
  2019. #------------------------------------------------------------------------------
  2020. #  戦闘の進行を実況表示するウィンドウです。
  2021. #==============================================================================

  2022. class Window_BattleLog < Window_Selectable
  2023.   #--------------------------------------------------------------------------
  2024.   # ● [エイリアス]:オブジェクト初期化
  2025.   #--------------------------------------------------------------------------
  2026.   alias :lnx11a_initialize :initialize
  2027.   def initialize
  2028.     lnx11a_initialize
  2029.     # バトルログタイプが 1 以上なら非表示にする
  2030.     @storage_number = 0
  2031.     hide if LNX11::BATTLELOG_TYPE >= 1
  2032.     BattleManager.log_window = self
  2033.   end
  2034.   #--------------------------------------------------------------------------
  2035.   # ● [追加]:文章の配列のクリア
  2036.   #--------------------------------------------------------------------------
  2037.   def lines_clear
  2038.     @lines.clear if LNX11::BATTLELOG_TYPE == 1
  2039.   end
  2040.   #--------------------------------------------------------------------------
  2041.   # ● [追加]:指定ウェイト
  2042.   #--------------------------------------------------------------------------
  2043.   def abs_wait(wait)
  2044.     @method_wait.call(wait) if @method_wait
  2045.   end
  2046.   #--------------------------------------------------------------------------
  2047.   # ● [再定義]:メッセージ速度の取得
  2048.   #--------------------------------------------------------------------------
  2049.   def message_speed
  2050.     return 20
  2051.   end
  2052.   #--------------------------------------------------------------------------
  2053.   # ● [再定義]:エフェクト実行が終わるまでウェイト
  2054.   #--------------------------------------------------------------------------
  2055.   def wait_for_effect
  2056.     return if LNX11::BATTLELOG_TYPE > 0
  2057.     @method_wait_for_effect.call if @method_wait_for_effect
  2058.   end
  2059.   #--------------------------------------------------------------------------
  2060.   # ● [追加]:アニメーションのウェイト用メソッドの設定
  2061.   #--------------------------------------------------------------------------
  2062.   def method_wait_for_animation=(method)
  2063.     @method_wait_for_animation = method
  2064.   end
  2065.   #--------------------------------------------------------------------------
  2066.   # ● [追加]:アニメーション再生が終わるまでウェイト
  2067.   #--------------------------------------------------------------------------
  2068.   def wait_for_animation
  2069.     @method_wait_for_animation.call if @method_wait_for_animation
  2070.   end
  2071.   
  2072.   #--------------------------------------------------------------------------
  2073.   # ● [エイリアス]:ウィンドウ高さの取得
  2074.   #--------------------------------------------------------------------------
  2075.   alias :lnx11a_window_height :window_height
  2076.   def window_height
  2077.     LNX11::BATTLELOG_TYPE == 1 ? fitting_height(1) : lnx11a_window_height
  2078.   end
  2079.   #--------------------------------------------------------------------------
  2080.   # ● [エイリアス]:最大行数の取得
  2081.   #--------------------------------------------------------------------------
  2082.   alias :lnx11a_max_line_number :max_line_number
  2083.   def max_line_number
  2084.     num = LNX11::STORAGE_LINE_NUMBER
  2085.     LNX11::BATTLELOG_TYPE == 1 ? num : lnx11a_max_line_number
  2086.   end
  2087.   #--------------------------------------------------------------------------
  2088.   # ● [オーバーライド]:行の高さを取得
  2089.   #--------------------------------------------------------------------------
  2090.   def line_height
  2091.     LNX11::BATTLELOG_TYPE == 1 ? LNX11::STORAGE_LINE_HEIGHT : super
  2092.   end
  2093.   #--------------------------------------------------------------------------
  2094.   # ● [オーバーライド]:フォント設定のリセット
  2095.   #--------------------------------------------------------------------------
  2096.   def reset_font_settings
  2097.     super
  2098.     return unless LNX11::BATTLELOG_TYPE == 1
  2099.     contents.font.size = LNX11::STORAGE_FONT[:size]
  2100.     contents.font.out_color.set(LNX11::STORAGE_FONT[:out_color])
  2101.   end
  2102.   #--------------------------------------------------------------------------
  2103.   # ● [エイリアス]:データ行数の取得
  2104.   #--------------------------------------------------------------------------
  2105.   alias :lnx11a_line_number :line_number
  2106.   def line_number
  2107.     return 0 if LNX11::BATTLELOG_TYPE == 2
  2108.     LNX11::BATTLELOG_TYPE == 1 ? @storage_number : lnx11a_line_number
  2109.   end
  2110.   #--------------------------------------------------------------------------
  2111.   # ● [再定義]:背景スプライトの作成
  2112.   #--------------------------------------------------------------------------
  2113.   alias :lnx11a_create_back_sprite :create_back_sprite
  2114.   def create_back_sprite
  2115.     if LNX11::BATTLELOG_TYPE == 1
  2116.       # 蓄積型
  2117.       create_message_sprite
  2118.     else
  2119.       # 背景
  2120.       lnx11a_create_back_sprite
  2121.     end
  2122.   end
  2123.   #--------------------------------------------------------------------------
  2124.   # ● [再定義]:背景スプライトの解放
  2125.   #--------------------------------------------------------------------------
  2126.   alias :lnx11a_dispose_back_sprite :dispose_back_sprite
  2127.   def dispose_back_sprite
  2128.     if LNX11::BATTLELOG_TYPE == 1
  2129.       # 蓄積型
  2130.       dispose_message_sprite
  2131.     else
  2132.       # 背景
  2133.       lnx11a_dispose_back_sprite
  2134.     end
  2135.   end
  2136.   #--------------------------------------------------------------------------
  2137.   # ● [追加]:メッセージスプライトの作成
  2138.   #--------------------------------------------------------------------------
  2139.   def create_message_sprite
  2140.     # メッセージスプライト 行数分だけ作成する
  2141.     @mes_position = 0 # 次にメッセージを表示させる位置
  2142.     @mesup_count = LNX11::STORAGE_UP_MESSAGE_TIME # ログが進行するまでの時間
  2143.     @mes_sprites = Array.new(max_line_number + 1) {
  2144.     Sprite_OneLine_BattleLog.new(self.width, line_height, max_line_number)}
  2145.   end
  2146.   #--------------------------------------------------------------------------
  2147.   # ● [追加]:メッセージスプライトの解放
  2148.   #--------------------------------------------------------------------------
  2149.   def dispose_message_sprite
  2150.     @mes_sprites.each {|sprite| sprite.dispose }
  2151.   end
  2152.   #--------------------------------------------------------------------------
  2153.   # ● [追加]:メッセージスプライトを表示
  2154.   #--------------------------------------------------------------------------
  2155.   def show_message_sprite
  2156.     @mes_sprites.each {|sprite| sprite.show }
  2157.   end
  2158.   #--------------------------------------------------------------------------
  2159.   # ● [追加]:メッセージスプライトを非表示
  2160.   #--------------------------------------------------------------------------
  2161.   def hide_message_sprite
  2162.     @mes_sprites.each {|sprite| sprite.hide }
  2163.     @mes_position = 0
  2164.   end
  2165.   #--------------------------------------------------------------------------
  2166.   # ● [追加]:メッセージスプライトを一つ進める
  2167.   #--------------------------------------------------------------------------
  2168.   def up_message_sprite
  2169.     @mes_sprites.each {|sprite| sprite.up_position }
  2170.   end
  2171.   #--------------------------------------------------------------------------
  2172.   # ● [追加]:空のメッセージスプライトを返す
  2173.   #--------------------------------------------------------------------------
  2174.   def empty_message_sprite
  2175.     @mes_sprites.each {|sprite| return sprite if sprite.mes_empty? }
  2176.     @mes_sprites[0]
  2177.   end
  2178.   #--------------------------------------------------------------------------
  2179.   # ● [追加]:メッセージスプライトの更新
  2180.   #--------------------------------------------------------------------------
  2181.   def update_message_sprite
  2182.     # バトルログ消去フラグが有効
  2183.     if $game_temp.battlelog_clear
  2184.       $game_temp.battlelog_clear = false
  2185.       # スプライトが表示されていれば非表示にする
  2186.       if @mes_sprites[0].visible?
  2187.         hide_message_sprite
  2188.         lines_clear
  2189.       end
  2190.     end
  2191.     # ログの自動進行
  2192.     @mesup_count -= 1
  2193.     if @mesup_count <= 0 && @mes_position > 0
  2194.       up_message_sprite
  2195.       @mes_position -= 1
  2196.       @mesup_count = LNX11::STORAGE_UP_MESSAGE_TIME
  2197.     end
  2198.     @mes_sprites.each {|sprite| sprite.update }
  2199.   end
  2200.   #--------------------------------------------------------------------------
  2201.   # ● [追加]:メッセージスプライトのリフレッシュ
  2202.   #--------------------------------------------------------------------------
  2203.   def refresh_message_sprite
  2204.     # 文章が無ければ何もしない
  2205.     return if @lines.empty?
  2206.     # スプライトを表示する
  2207.     show_message_sprite unless @mes_sprites[0].visible?
  2208.     # 文章の描画
  2209.     contents.clear
  2210.     @lines[0] = last_text
  2211.     return if @lines[0].empty?
  2212.     draw_line(0)
  2213.     @storage_number += 1
  2214.     # ウィンドウの内容をスプライトにコピー
  2215.     empty_message_sprite.set_text(self, @mes_position)
  2216.     # スプライト位置の変動   
  2217.     if @mes_position < max_line_number
  2218.       @mes_position += 1
  2219.     elsif @mesup_count > 0
  2220.       up_message_sprite
  2221.     end
  2222.     @mesup_count = (LNX11::STORAGE_UP_MESSAGE_TIME * 1.5).truncate
  2223.   end  
  2224.   #--------------------------------------------------------------------------
  2225.   # ● [オーバーライド]:フレーム更新
  2226.   #--------------------------------------------------------------------------
  2227.   def update
  2228.     super
  2229.     update_message_sprite if LNX11::BATTLELOG_TYPE == 1
  2230.   end
  2231.   #--------------------------------------------------------------------------
  2232.   # ● [エイリアス]:リフレッシュ
  2233.   #--------------------------------------------------------------------------
  2234.   alias :lnx11a_refresh :refresh
  2235.   def refresh
  2236.     return if LNX11::BATTLELOG_TYPE == 2
  2237.     LNX11::BATTLELOG_TYPE == 1 ? refresh_message_sprite : lnx11a_refresh
  2238.   end
  2239.   #--------------------------------------------------------------------------
  2240.   # ● [エイリアス]:クリア
  2241.   #--------------------------------------------------------------------------
  2242.   alias :lnx11a_clear :clear
  2243.   def clear
  2244.     return if LNX11::BATTLELOG_TYPE == 2
  2245.     LNX11::BATTLELOG_TYPE == 1 ? @storage_number = 0 : lnx11a_clear
  2246.   end
  2247.   #--------------------------------------------------------------------------
  2248.   # ● [エイリアス]:一行戻る
  2249.   #--------------------------------------------------------------------------
  2250.   alias :lnx11a_back_one :back_one
  2251.   def back_one
  2252.     if LNX11::BATTLELOG_TYPE == 1
  2253.       # 蓄積型
  2254.       @storage_number = [@storage_number - 1, 0].max
  2255.     else
  2256.       # 通常
  2257.       lnx11a_back_one
  2258.     end
  2259.   end
  2260.   #--------------------------------------------------------------------------
  2261.   # ● [エイリアス]:指定した行に戻る
  2262.   #--------------------------------------------------------------------------
  2263.   alias :lnx11a_back_to :back_to
  2264.   def back_to(line_number)
  2265.     if LNX11::BATTLELOG_TYPE == 1
  2266.       # 蓄積型
  2267.       @storage_number -= 1 while @storage_number > line_number
  2268.     else
  2269.       # 通常
  2270.       lnx11a_back_to(line_number)
  2271.     end
  2272.   end
  2273.   #--------------------------------------------------------------------------
  2274.   # ● [エイリアス]:ウェイト
  2275.   #--------------------------------------------------------------------------
  2276.   alias :lnx11a_wait :wait
  2277.   def wait
  2278.     return if LNX11::BATTLELOG_TYPE == 2
  2279.     # 元のメソッドを呼ぶ
  2280.     lnx11a_wait
  2281.   end
  2282.   #--------------------------------------------------------------------------
  2283.   # ● [エイリアス]:スキル/アイテム使用の表示
  2284.   #  使用時アニメーションの処理を追加します。
  2285.   #--------------------------------------------------------------------------
  2286.   alias :lnx11a_display_use_item :display_use_item
  2287.   def display_use_item(subject, item)
  2288.     if item.use_animation > 0
  2289.       # 使用時アニメーションが設定されていれば再生
  2290.       subject.animation_id = item.use_animation
  2291.       subject.animation_mirror = false
  2292.     end
  2293.     # 元のメソッドを呼ぶ
  2294.     lnx11a_display_use_item(subject, item)
  2295.     # アニメーションのウェイト
  2296.     wait_for_animation if item.use_animation > 0
  2297.   end
  2298.   #--------------------------------------------------------------------------
  2299.   # ● [追加]:ポップアップデータの取得
  2300.   #--------------------------------------------------------------------------
  2301.   def popup_data
  2302.     $game_temp.popup_data
  2303.   end
  2304.   #--------------------------------------------------------------------------
  2305.   # ● [エイリアス]:反撃の表示
  2306.   #--------------------------------------------------------------------------
  2307.   alias :lnx11a_display_counter :display_counter
  2308.   def display_counter(target, item)
  2309.     # ポップアップ
  2310.     popup_data.popup_text(target, :counter)
  2311.     # 元のメソッドを呼ぶ
  2312.     lnx11a_display_counter(target, item)
  2313.     # ポップアップウェイト
  2314.     popup_data.add_wait
  2315.   end
  2316.   #--------------------------------------------------------------------------
  2317.   # ● [エイリアス]:反射の表示
  2318.   #--------------------------------------------------------------------------
  2319.   alias :lnx11a_display_reflection :display_reflection
  2320.   def display_reflection(target, item)
  2321.     # ポップアップ
  2322.     popup_data.popup_text(target, :reflection)
  2323.     # 元のメソッドを呼ぶ
  2324.     lnx11a_display_reflection(target, item)
  2325.     # ポップアップウェイト
  2326.     popup_data.add_wait
  2327.   end
  2328.   #--------------------------------------------------------------------------
  2329.   # ● [エイリアス]:身代わりの表示
  2330.   #--------------------------------------------------------------------------
  2331.   alias :lnx11a_display_substitute :display_substitute
  2332.   def display_substitute(substitute, target)
  2333.     # ポップアップ
  2334.     popup_data.popup_text(substitute, :substitute)
  2335.     # 元のメソッドを呼ぶ
  2336.     lnx11a_display_substitute(substitute, target)
  2337.     # ポップアップウェイト
  2338.     popup_data.add_wait
  2339.   end
  2340.   #--------------------------------------------------------------------------
  2341.   # ● [エイリアス]:失敗の表示
  2342.   #--------------------------------------------------------------------------
  2343.   alias :lnx11a_display_failure :display_failure
  2344.   def display_failure(target, item)
  2345.     if target.result.hit? && !target.result.success
  2346.       # ポップアップ (ミスと同じ扱いにする)
  2347.       popup_data.popup_miss(target, item)
  2348.     end
  2349.     # 元のメソッドを呼ぶ
  2350.     lnx11a_display_failure(target, item)
  2351.     # ポップアップウェイト
  2352.     popup_data.add_wait
  2353.   end
  2354.   #--------------------------------------------------------------------------
  2355.   # ● [エイリアス]:ミスの表示
  2356.   #--------------------------------------------------------------------------
  2357.   alias :lnx11a_display_miss :display_miss
  2358.   def display_miss(target, item)
  2359.     # ポップアップ
  2360.     popup_data.popup_miss(target, item)
  2361.     # 元のメソッドを呼ぶ   
  2362.     lnx11a_display_miss(target, item)
  2363.     # ポップアップウェイト
  2364.     popup_data.add_wait
  2365.   end
  2366.   #--------------------------------------------------------------------------
  2367.   # ● [エイリアス]:回避の表示
  2368.   #--------------------------------------------------------------------------
  2369.   alias :lnx11a_display_evasion :display_evasion
  2370.   def display_evasion(target, item)
  2371.     # ポップアップ (ミスと同じ扱いにする)
  2372.     popup_data.popup_miss(target, item)
  2373.     # 元のメソッドを呼ぶ   
  2374.     lnx11a_display_evasion(target, item)
  2375.     # ポップアップウェイト
  2376.     popup_data.add_wait
  2377.   end
  2378.   #--------------------------------------------------------------------------
  2379.   # ● [エイリアス]:HP ダメージ表示
  2380.   #--------------------------------------------------------------------------
  2381.   alias :lnx11a_display_hp_damage :display_hp_damage
  2382.   def display_hp_damage(target, item)
  2383.     # ポップアップ
  2384.     popup_data.popup_hp_damage(target, item)
  2385.     # 元のメソッドを呼ぶ
  2386.     lnx11a_display_hp_damage(target, item)
  2387.     # ポップアップウェイト
  2388.     popup_data.add_wait
  2389.   end
  2390.   #--------------------------------------------------------------------------
  2391.   # ● [エイリアス]:MP ダメージ表示
  2392.   #--------------------------------------------------------------------------
  2393.   alias :lnx11a_display_mp_damage :display_mp_damage
  2394.   def display_mp_damage(target, item)
  2395.     # ポップアップ
  2396.     popup_data.popup_mp_damage(target, item)
  2397.     # 元のメソッドを呼ぶ
  2398.     lnx11a_display_mp_damage(target, item)
  2399.     # ポップアップウェイト
  2400.     popup_data.add_wait
  2401.   end
  2402.   #--------------------------------------------------------------------------
  2403.   # ● [エイリアス]:TP ダメージ表示
  2404.   #--------------------------------------------------------------------------
  2405.   alias :lnx11a_display_tp_damage :display_tp_damage
  2406.   def display_tp_damage(target, item)
  2407.     # ポップアップ
  2408.     popup_data.popup_tp_damage(target, item)
  2409.     # 元のメソッドを呼ぶ
  2410.     lnx11a_display_tp_damage(target, item)
  2411.     # ポップアップウェイト
  2412.     popup_data.add_wait
  2413.   end
  2414.   #--------------------------------------------------------------------------
  2415.   # ● [エイリアス]:ステート付加の表示
  2416.   #--------------------------------------------------------------------------
  2417.   alias :lnx11a_display_added_states :display_added_states
  2418.   def display_added_states(target)
  2419.     # ポップアップ
  2420.     popup_data.popup_added_states(target)
  2421.     # 元のメソッドを呼ぶ
  2422.     lnx11a_display_added_states(target)
  2423.   end
  2424.   #--------------------------------------------------------------------------
  2425.   # ● [エイリアス]:ステート解除の表示
  2426.   #--------------------------------------------------------------------------
  2427.   alias :lnx11a_display_removed_states :display_removed_states
  2428.   def display_removed_states(target)
  2429.     # ポップアップ
  2430.     popup_data.popup_removed_states(target)
  2431.     # 元のメソッドを呼ぶ
  2432.     lnx11a_display_removed_states(target)
  2433.   end
  2434.   #--------------------------------------------------------------------------
  2435.   # ● [エイリアス]:能力強化/弱体の表示(個別)
  2436.   #--------------------------------------------------------------------------
  2437.   alias :lnx11a_display_buffs :display_buffs
  2438.   def display_buffs(target, buffs, fmt)
  2439.     # ポップアップ
  2440.     popup_data.popup_buffs(target, buffs, fmt)
  2441.     # 元のメソッドを呼ぶ
  2442.     lnx11a_display_buffs(target, buffs, fmt)
  2443.   end
  2444. end

  2445. #==============================================================================
  2446. # ■ RPG::BaseItem
  2447. #------------------------------------------------------------------------------
  2448. #  アクター、職業、スキル、アイテム、武器、防具、敵キャラ、およびステートの
  2449. # スーパークラス。
  2450. #==============================================================================

  2451. class RPG::BaseItem  
  2452.   #--------------------------------------------------------------------------
  2453.   # ● [追加]:バトラーグラフィックファイル名を取得
  2454.   #--------------------------------------------------------------------------
  2455.   def default_battler_graphic
  2456.     # キャッシュがある場合、それを返す
  2457.     return @default_battler_graphic if @default_battler_graphic
  2458.     # メモ取得
  2459.     re = LNX11::RE_BATTLER =~ note
  2460.     @default_battler_graphic = re ? $1 : ""
  2461.   end
  2462.   #--------------------------------------------------------------------------
  2463.   # ● [追加]:敵キャラの通常攻撃アニメの取得
  2464.   #--------------------------------------------------------------------------
  2465.   def atk_animation
  2466.     # キャッシュがある場合、それを返す
  2467.     return @atk_animation if @atk_animation
  2468.     # メモ取得
  2469.     re = LNX11::RE_ATK_ANIMATION =~ note
  2470.     @atk_animation = re ? $1.to_i : 1
  2471.   end
  2472. end

  2473. #==============================================================================
  2474. # ■ RPG::UsableItem
  2475. #------------------------------------------------------------------------------
  2476. #  スキルとアイテムのスーパークラス。
  2477. #==============================================================================
  2478. class RPG::UsableItem < RPG::BaseItem
  2479.   #--------------------------------------------------------------------------
  2480.   # ● [エイリアス]:対象の選択操作が必要か否かを取得
  2481.   #--------------------------------------------------------------------------
  2482.   alias :lnx11a_need_selection? :need_selection?
  2483.   def need_selection?
  2484.     LNX11::FIX_TARGET_CHECKE && scope > 0 ? true : lnx11a_need_selection?
  2485.   end
  2486.   #--------------------------------------------------------------------------
  2487.   # ● [追加]:使用時アニメの取得
  2488.   #--------------------------------------------------------------------------
  2489.   def use_animation
  2490.     # キャッシュがある場合、それを返す
  2491.     return @use_animation if @use_animation
  2492.     # メモ取得
  2493.     re = LNX11::RE_USE_ANIMATION =~ note
  2494.     @use_animation = re ? $1.to_i : 0
  2495.   end
  2496.   #--------------------------------------------------------------------------
  2497.   # ● [追加]:簡易ヘルプ非表示の取得
  2498.   #--------------------------------------------------------------------------
  2499.   def no_display
  2500.     # キャッシュがある場合、それを返す
  2501.     return @no_display if @no_display
  2502.     # メモ取得
  2503.     re = LNX11::RE_USABLEITEM_NO_DISPLAY =~ note
  2504.     @no_display = re ? true : false
  2505.   end
  2506.   #--------------------------------------------------------------------------
  2507.   # ● [追加]:使用時追加ウェイトの取得
  2508.   #--------------------------------------------------------------------------
  2509.   def display_wait
  2510.     # キャッシュがある場合、それを返す
  2511.     return @display_wait if @display_wait
  2512.     # メモ取得
  2513.     re = LNX11::RE_DISPLAY_WAIT =~ note
  2514.     @display_wait = re ? $1.to_i : LNX11::HELPDISPLAT_WAIT
  2515.   end
  2516.   #--------------------------------------------------------------------------
  2517.   # ● [追加]:終了時追加ウェイトの取得
  2518.   #--------------------------------------------------------------------------
  2519.   def end_wait
  2520.     # キャッシュがある場合、それを返す
  2521.     return @end_wait if @end_wait
  2522.     # メモ取得
  2523.     re = LNX11::RE_END_WAIT =~ note
  2524.     @end_wait = re ? $1.to_i : LNX11::HELPDISPLAT_END_WAIT
  2525.   end
  2526.   #--------------------------------------------------------------------------
  2527.   # ● [追加]:簡易ヘルプ説明を取得
  2528.   #--------------------------------------------------------------------------
  2529.   def short_description
  2530.     # キャッシュがある場合、それを返す
  2531.     return @short_description if @short_description
  2532.     # メモ取得
  2533.     re = LNX11::RE_SHORT_DESCRIPTION =~ note
  2534.     @short_description = re ? $1 : ""
  2535.   end
  2536. end

  2537. #==============================================================================
  2538. # ■ RPG::State
  2539. #------------------------------------------------------------------------------
  2540. #  ステートのデータクラス。
  2541. #==============================================================================

  2542. class RPG::State < RPG::BaseItem
  2543.   #--------------------------------------------------------------------------
  2544.   # ● [追加]:ステートアニメの取得
  2545.   #--------------------------------------------------------------------------
  2546.   def state_animation
  2547.     # キャッシュがある場合、それを返す
  2548.     return @state_animation if @state_animation
  2549.     # メモ取得
  2550.     re = LNX11::RE_STATE_ANIMATION =~ note
  2551.     @state_animation = re ? $1.to_i : 0
  2552.   end
  2553.   #--------------------------------------------------------------------------
  2554.   # ● [追加]:ポップアップ表示名の取得
  2555.   # <<ver1.10>>
  2556.   #  このメソッドは付加/解除ポップアップ表示名が設定されていない場合のみ
  2557.   # 呼び出されるようになりました。
  2558.   #--------------------------------------------------------------------------
  2559.   def display_name
  2560.     # キャッシュがある場合、それを返す
  2561.     return @display_name if @display_name
  2562.     # メモ取得
  2563.     re = LNX11::RE_STATE_DISPLAY =~ note
  2564.     @display_name = re ? $1 : name
  2565.   end
  2566.   #--------------------------------------------------------------------------
  2567.   # ● [追加]:付加ポップアップ表示名の取得 <<ver1.10>>
  2568.   #--------------------------------------------------------------------------
  2569.   def add_display_name
  2570.     # キャッシュがある場合、それを返す
  2571.     return @add_display_name if @add_display_name
  2572.     # メモ取得
  2573.     re = LNX11::RE_STATE_ADD_DISPLAY =~ note
  2574.     @add_display_name = re ? $1 : display_name
  2575.   end
  2576.   #--------------------------------------------------------------------------
  2577.   # ● [追加]:解除ポップアップ表示名の取得 <<ver1.10>>
  2578.   #--------------------------------------------------------------------------
  2579.   def remove_display_name
  2580.     # キャッシュがある場合、それを返す
  2581.     return @remove_display_name if @remove_display_name
  2582.     # メモ取得
  2583.     re = LNX11::RE_STATE_REM_DISPLAY =~ note
  2584.     @remove_display_name = re ? $1 : display_name
  2585.   end
  2586.   #--------------------------------------------------------------------------
  2587.   # ● [追加]:ポップアップ非表示の取得
  2588.   #--------------------------------------------------------------------------
  2589.   def no_display?
  2590.     # キャッシュがある場合、それを返す
  2591.     return @no_display if @no_display
  2592.     # 付加/解除のどちらかで設定されていれば無視する
  2593.     if LNX11::RE_STATE_ADD_NO_DISPLAY =~ note ||
  2594.        LNX11::RE_STATE_REM_NO_DISPLAY =~ note
  2595.       return @no_display = false
  2596.     end
  2597.     # メモ取得
  2598.     re = LNX11::RE_STATE_NO_DISPLAY =~ note
  2599.     @no_display = re ? true : false
  2600.   end
  2601.   #--------------------------------------------------------------------------
  2602.   # ● [追加]:付加ポップアップ非表示の取得
  2603.   #--------------------------------------------------------------------------
  2604.   def add_no_display?
  2605.     return true if no_display?
  2606.     # キャッシュがある場合、それを返す
  2607.     return @add_no_display if @add_no_display
  2608.     # メモ取得
  2609.     re = LNX11::RE_STATE_ADD_NO_DISPLAY =~ note
  2610.     @add_no_display = re ? true : false
  2611.   end
  2612.   #--------------------------------------------------------------------------
  2613.   # ● [追加]:解除ポップアップ非表示の取得
  2614.   #--------------------------------------------------------------------------
  2615.   def remove_no_display?
  2616.     return true if no_display?
  2617.     # キャッシュがある場合、それを返す
  2618.     return @remove_no_display if @remove_no_display
  2619.     # メモ取得
  2620.     re = LNX11::RE_STATE_REM_NO_DISPLAY =~ note
  2621.     @remove_no_display = re ? true : false
  2622.   end
  2623.   #--------------------------------------------------------------------------
  2624.   # ● [追加]:有利なステートの取得
  2625.   #--------------------------------------------------------------------------
  2626.   def advantage?
  2627.     # キャッシュがある場合、それを返す
  2628.     return @advantage if @advantage
  2629.     # メモ取得
  2630.     re = LNX11::RE_STATE_ADVANTAGE =~ note
  2631.     @advantage = re ? true : false
  2632.   end
  2633.   #--------------------------------------------------------------------------
  2634.   # ● [追加]:ポップアップタイプの取得
  2635.   #--------------------------------------------------------------------------
  2636.   def popup_type
  2637.     # キャッシュがある場合、それを返す
  2638.     return @popup_type if @popup_type != nil
  2639.     # 付加/解除のどちらかで設定されていれば無視する
  2640.     if LNX11::RE_STATE_ADD_TYPE =~ note ||
  2641.        LNX11::RE_STATE_REM_TYPE =~ note
  2642.       return @popup_type = false
  2643.     end
  2644.     # メモ取得
  2645.     re = LNX11::RE_STATE_TYPE =~ note
  2646.     @popup_type = re ? $1.to_i : false
  2647.   end
  2648.   #--------------------------------------------------------------------------
  2649.   # ● [追加]:付加ポップアップタイプの取得
  2650.   #--------------------------------------------------------------------------
  2651.   def add_popup_type
  2652.     return popup_type if popup_type
  2653.     # キャッシュがある場合、それを返す
  2654.     return @add_popup_type if @add_popup_type != nil
  2655.     # メモ取得
  2656.     re = LNX11::RE_STATE_ADD_TYPE =~ note
  2657.     @add_popup_type = re ? $1.to_i : false
  2658.   end
  2659.   #--------------------------------------------------------------------------
  2660.   # ● [追加]:解除ポップアップタイプの取得
  2661.   #--------------------------------------------------------------------------
  2662.   def remove_popup_type
  2663.     return popup_type if popup_type
  2664.     # キャッシュがある場合、それを返す
  2665.     return @remove_popup_type if @remove_popup_type != nil
  2666.     # メモ取得
  2667.     re = LNX11::RE_STATE_REM_TYPE =~ note
  2668.     @remove_popup_type = re ? $1.to_i : false
  2669.   end
  2670.   #--------------------------------------------------------------------------
  2671.   # ● [追加]:修飾文字非表示の取得
  2672.   #--------------------------------------------------------------------------
  2673.   def no_decoration?
  2674.     # キャッシュがある場合、それを返す
  2675.     return @no_decoration if @no_decoration
  2676.     # 付加/解除のどちらかで設定されていれば無視する
  2677.     if LNX11::RE_STATE_ADD_NO_DECORATION =~ note ||
  2678.        LNX11::RE_STATE_REM_NO_DECORATION =~ note
  2679.       return @no_decoration = false
  2680.     end
  2681.     # メモ取得
  2682.     re = LNX11::RE_STATE_NO_DECORATION =~ note
  2683.     @no_decoration = re ? true : false
  2684.   end
  2685.   #--------------------------------------------------------------------------
  2686.   # ● [追加]:付加修飾文字非表示の取得
  2687.   #--------------------------------------------------------------------------
  2688.   def add_no_decoration?
  2689.     return true if no_decoration?
  2690.     # キャッシュがある場合、それを返す
  2691.     return @add_no_decoration if @add_no_decoration
  2692.     # メモ取得
  2693.     re = LNX11::RE_STATE_ADD_NO_DECORATION =~ note
  2694.     @add_no_decoration = re ? true : false
  2695.   end
  2696.   #--------------------------------------------------------------------------
  2697.   # ● [追加]:解除修飾文字非表示の取得
  2698.   #--------------------------------------------------------------------------
  2699.   def remove_no_decoration?
  2700.     return true if no_decoration?
  2701.     # キャッシュがある場合、それを返す
  2702.     return @remove_no_decoration if @remove_no_decoration
  2703.     # メモ取得
  2704.     re = LNX11::RE_STATE_REM_NO_DECORATION =~ note
  2705.     @remove_no_decoration = re ? true : false
  2706.   end
  2707. end

  2708. #==============================================================================
  2709. # ■ BattleManager
  2710. #------------------------------------------------------------------------------
  2711. #  戦闘の進行を管理するモジュールです。
  2712. #==============================================================================

  2713. class << BattleManager
  2714.   #--------------------------------------------------------------------------
  2715.   # ● [追加]:公開インスタンス変数
  2716.   #--------------------------------------------------------------------------
  2717.   attr_reader   :preemptive             # 先制攻撃フラグ
  2718.   attr_reader   :surprise               # 不意打ちフラグ
  2719.   attr_accessor :log_window             # バトルログウィンドウ
  2720.   attr_accessor :update_for_wait_method # ウェイト中のフレーム更新
  2721.   attr_accessor :helpdisplay_set_method        # 簡易ヘルプ表示
  2722.   attr_accessor :helpdisplay_clear_method      # 簡易ヘルプ消去
  2723.   attr_accessor :helpdisplay_wait_short_method # 簡易ヘルプ・短時間ウェイト
  2724.   #--------------------------------------------------------------------------
  2725.   # ● [追加]:簡易ヘルプ表示
  2726.   #--------------------------------------------------------------------------
  2727.   def helpdisplay_set(*args)
  2728.     @helpdisplay_set_method.call(*args) if @helpdisplay_set_method
  2729.   end
  2730.   #--------------------------------------------------------------------------
  2731.   # ● [追加]:簡易ヘルプ消去
  2732.   #--------------------------------------------------------------------------
  2733.   def helpdisplay_clear(*args)
  2734.     @helpdisplay_clear_method.call(*args) if @helpdisplay_clear_method
  2735.   end
  2736.   #--------------------------------------------------------------------------
  2737.   # ● [追加]:簡易ヘルプ・短時間ウェイト
  2738.   #--------------------------------------------------------------------------
  2739.   def helpdisplay_wait_short
  2740.     @helpdisplay_wait_short_method.call if @helpdisplay_wait_short_method
  2741.   end
  2742.   #--------------------------------------------------------------------------
  2743.   # ● [追加]:キー入力待ち
  2744.   #--------------------------------------------------------------------------
  2745.   def helpdisplay_wait_input
  2746.     return if $game_message.helpdisplay_texts.empty?
  2747.     return if LNX11::MESSAGE_TYPE == 0
  2748.     return if !@helpdisplay_wait_input || !@update_for_wait_method
  2749.     update_for_wait_method.call while !Input.press?(:B) && !Input.press?(:C)
  2750.   end
  2751.   #--------------------------------------------------------------------------
  2752.   # ● [追加]:メッセージ進行の SE 再生
  2753.   #--------------------------------------------------------------------------
  2754.   def messagedisplay_se_play
  2755.     return if !@helpdisplay_se
  2756.     @helpdisplay_se.play  
  2757.     @helpdisplay_se = nil if @helpdisplay_se == LNX11::LEVELUP_SE
  2758.   end
  2759.   #--------------------------------------------------------------------------
  2760.   # ● [追加]:メッセージ進行
  2761.   #--------------------------------------------------------------------------
  2762.   def process_messagedisplay(wait)
  2763.     return if $game_message.helpdisplay_texts.empty?
  2764.     return if LNX11::MESSAGE_TYPE == 0
  2765.     $game_temp.battlelog_clear = true
  2766.     BattleManager.log_window.update
  2767.     if LNX11::BATTLELOG_TYPE == 2 || LNX11::MESSAGE_TYPE == 2
  2768.       # 簡易ヘルプ
  2769.       $game_message.helpdisplay_texts.each do |text|
  2770.         helpdisplay_wait_short
  2771.         messagedisplay_se_play
  2772.         helpdisplay_set(text, wait)
  2773.         helpdisplay_wait_input
  2774.       end
  2775.       helpdisplay_clear
  2776.     elsif LNX11::BATTLELOG_TYPE == 0
  2777.       # VXAceデフォルト
  2778.       BattleManager.log_window.clear
  2779.       $game_message.helpdisplay_texts.each do |text|
  2780.         messagedisplay_se_play
  2781.         BattleManager.log_window.add_text(text)
  2782.         BattleManager.log_window.abs_wait(wait)
  2783.         helpdisplay_wait_input
  2784.         max = BattleManager.log_window.max_line_number
  2785.         # 表示がいっぱいになったら消去
  2786.         if BattleManager.log_window.line_number >= max
  2787.           BattleManager.log_window.clear
  2788.         end
  2789.       end
  2790.       BattleManager.log_window.clear
  2791.     elsif LNX11::BATTLELOG_TYPE == 1
  2792.       # 蓄積型
  2793.       $game_message.helpdisplay_texts.each do |text|
  2794.         messagedisplay_se_play
  2795.         BattleManager.log_window.add_text(text)
  2796.         BattleManager.log_window.abs_wait(wait)
  2797.         helpdisplay_wait_input
  2798.       end
  2799.       $game_temp.battlelog_clear = true
  2800.       BattleManager.log_window.update
  2801.     end
  2802.     $game_message.helpdisplay_texts.clear
  2803.   end
  2804.   #--------------------------------------------------------------------------
  2805.   # ● [エイリアス]:メッセージ表示が終わるまでウェイト
  2806.   #--------------------------------------------------------------------------
  2807.   alias :lnx11a_wait_for_message :wait_for_message
  2808.   def wait_for_message
  2809.     # 簡易ヘルプ表示
  2810.     process_messagedisplay(@helpdisplay_wait ? @helpdisplay_wait : 60)
  2811.     return if $game_message.texts.empty?
  2812.     # 元のメソッドを呼ぶ
  2813.     lnx11a_wait_for_message
  2814.   end  
  2815.   #--------------------------------------------------------------------------
  2816.   # ● [エイリアス]:戦闘開始
  2817.   #--------------------------------------------------------------------------
  2818.   alias :lnx11a_battle_start :battle_start
  2819.   def battle_start   
  2820.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:battle_start][0]
  2821.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:battle_start][1]
  2822.     # メッセージウィンドウへのテキスト追加を禁止する
  2823.     $game_message.add_disabled
  2824.     # 元のメソッドを呼ぶ
  2825.     lnx11a_battle_start
  2826.     # メッセージウィンドウへのテキスト追加を許可する
  2827.     $game_message.add_enabled
  2828.     @helpdisplay_wait = nil
  2829.     @helpdisplay_wait_input = nil
  2830.   end
  2831.   #--------------------------------------------------------------------------
  2832.   # ● [エイリアス]:勝利の処理
  2833.   #--------------------------------------------------------------------------
  2834.   alias :lnx11a_process_victory :process_victory
  2835.   def process_victory
  2836.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:victory][0]
  2837.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:victory][1]
  2838.     # メッセージウィンドウへのテキスト追加を禁止する
  2839.     $game_message.add_disabled
  2840.     # 元のメソッドを呼ぶ
  2841.     success = lnx11a_process_victory
  2842.     # メッセージウィンドウへのテキスト追加を許可する
  2843.     $game_message.add_enabled
  2844.     @helpdisplay_wait = nil
  2845.     @helpdisplay_wait_input = nil
  2846.     return success
  2847.   end
  2848.   #--------------------------------------------------------------------------
  2849.   # ● [エイリアス]:逃走の処理
  2850.   #--------------------------------------------------------------------------
  2851.   alias :lnx11a_process_escape :process_escape
  2852.   def process_escape
  2853.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:escape][0]
  2854.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:escape][1]
  2855.     # メッセージウィンドウへのテキスト追加を禁止する
  2856.     $game_message.add_disabled
  2857.     # 元のメソッドを呼ぶ
  2858.     success = lnx11a_process_escape
  2859.     # メッセージウィンドウへのテキスト追加を許可する
  2860.     $game_message.add_enabled
  2861.     @helpdisplay_wait = nil
  2862.     @helpdisplay_wait_input = nil
  2863.     return success
  2864.   end
  2865.   #--------------------------------------------------------------------------
  2866.   # ● [エイリアス]:敗北の処理
  2867.   #--------------------------------------------------------------------------
  2868.   alias :lnx11a_process_defeat :process_defeat
  2869.   def process_defeat
  2870.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:defeat][0]
  2871.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:defeat][1]
  2872.     # メッセージウィンドウへのテキスト追加を禁止する
  2873.     $game_message.add_disabled
  2874.     # 元のメソッドを呼ぶ
  2875.     success = lnx11a_process_defeat
  2876.     # メッセージウィンドウへのテキスト追加を許可する
  2877.     $game_message.add_enabled
  2878.     @helpdisplay_wait = nil
  2879.     @helpdisplay_wait_input = nil
  2880.     return success
  2881.   end
  2882.   #--------------------------------------------------------------------------
  2883.   # ● [エイリアス]:ドロップアイテムの獲得と表示
  2884.   #--------------------------------------------------------------------------
  2885.   alias :lnx11a_gain_drop_items :gain_drop_items
  2886.   def gain_drop_items
  2887.     helpdisplay_clear
  2888.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:drop_item][0]
  2889.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:drop_item][1]
  2890.     @helpdisplay_se = LNX11::DROPITEM_SE
  2891.     # 元のメソッドを呼ぶ
  2892.     lnx11a_gain_drop_items
  2893.     @helpdisplay_wait = nil
  2894.     @helpdisplay_wait_input = nil
  2895.     @helpdisplay_se = nil
  2896.   end
  2897.   #--------------------------------------------------------------------------
  2898.   # ● [再定義]:経験値の獲得とレベルアップの表示
  2899.   #--------------------------------------------------------------------------
  2900.   def gain_exp
  2901.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:levelup][0]
  2902.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:levelup][1]
  2903.     $game_party.all_members.each do |actor|
  2904.       @helpdisplay_se = LNX11::LEVELUP_SE
  2905.       actor.gain_exp($game_troop.exp_total)
  2906.       # レベルアップ毎にメッセージ表示ウェイト
  2907.       wait_for_message
  2908.     end
  2909.     @helpdisplay_wait = nil
  2910.     @helpdisplay_wait_input = nil
  2911.     @helpdisplay_se = nil
  2912.   end
  2913. end

  2914. #==============================================================================
  2915. # ■ Game_Temp
  2916. #------------------------------------------------------------------------------
  2917. #  セーブデータに含まれない、一時的なデータを扱うクラスです。このクラスのイン
  2918. # スタンスは $game_temp で参照されます。
  2919. #==============================================================================

  2920. class Game_Temp
  2921.   #--------------------------------------------------------------------------
  2922.   # ● [追加]:公開インスタンス変数
  2923.   #--------------------------------------------------------------------------
  2924.   attr_accessor :popup_data            # ポップアップスプライト
  2925.   attr_accessor :actor_battler_graphic # アクターのバトラーグラフィック
  2926.   attr_accessor :battlelog_clear       # バトルログ消去フラグ
  2927.   attr_accessor :target_cursor_sprite  # ターゲットカーソルスプライト
  2928.   attr_accessor :last_target_cursor    # 対象選択のカーソル記憶
  2929.   #--------------------------------------------------------------------------
  2930.   # ● [エイリアス]:オブジェクト初期化
  2931.   #--------------------------------------------------------------------------
  2932.   alias :lnx11a_initialize :initialize
  2933.   def initialize
  2934.     # 元のメソッドを呼ぶ
  2935.     lnx11a_initialize
  2936.     # 追加
  2937.     @popup_data = nil
  2938.     @actor_battler_graphic = []
  2939.     @battlelog_clear = false
  2940.     @battle_status_refresh = nil
  2941.     @target_cursor_sprite = nil
  2942.     clear_last_target_cursor
  2943.   end
  2944.   #--------------------------------------------------------------------------
  2945.   # ● [追加]:バトルステータス更新メソッドの設定
  2946.   #--------------------------------------------------------------------------
  2947.   def method_battle_status_refresh=(method)
  2948.     @battle_status_refresh = method
  2949.   end
  2950.   #--------------------------------------------------------------------------
  2951.   # ● [追加]:バトルステータス更新
  2952.   #--------------------------------------------------------------------------
  2953.   def battle_status_refresh
  2954.     return unless $game_party.in_battle
  2955.     @battle_status_refresh.call if @battle_status_refresh
  2956.   end
  2957.   #--------------------------------------------------------------------------
  2958.   # ● [追加]:対象選択のカーソル記憶をクリア
  2959.   #--------------------------------------------------------------------------
  2960.   def clear_last_target_cursor
  2961.     @last_target_cursor = {:actor => nil, :enemy => nil}
  2962.   end
  2963. end

  2964. #==============================================================================
  2965. # ■ Game_Action
  2966. #------------------------------------------------------------------------------
  2967. #  戦闘行動を扱うクラスです。
  2968. #==============================================================================

  2969. class Game_Action
  2970.   #--------------------------------------------------------------------------
  2971.   # ● [エイリアス]:ターゲットの配列作成
  2972.   #--------------------------------------------------------------------------
  2973.   alias :lnx11a_make_targets :make_targets
  2974.   def make_targets   
  2975.     if LNX11::TROOP_X_SORT
  2976.       # 元のメソッドを呼んでソート
  2977.       return lnx11a_make_targets.sort {|a,b| a.screen_x <=> b.screen_x}
  2978.     else
  2979.       return lnx11a_make_targets
  2980.     end
  2981.   end
  2982. end

  2983. #==============================================================================
  2984. # ■ Game_ActionResult
  2985. #------------------------------------------------------------------------------
  2986. #  戦闘行動の結果を扱うクラスです。属性に関する結果を追加します。
  2987. #==============================================================================

  2988. class Game_ActionResult
  2989.   #--------------------------------------------------------------------------
  2990.   # ● 公開インスタンス変数
  2991.   #--------------------------------------------------------------------------
  2992.   attr_accessor :element_rate               # 属性修正値
  2993.   #--------------------------------------------------------------------------
  2994.   # ● ダメージ値のクリア
  2995.   #--------------------------------------------------------------------------
  2996.   alias :lnx11a_clear_damage_values :clear_damage_values
  2997.   def clear_damage_values
  2998.     # 元のメソッドを呼ぶ
  2999.     lnx11a_clear_damage_values
  3000.     # 属性修正値をクリア
  3001.     @element_rate = 1.0
  3002.   end
  3003.   #--------------------------------------------------------------------------
  3004.   # ● [追加]:属性修正値の取得
  3005.   #--------------------------------------------------------------------------
  3006.   def element_rate
  3007.     return @element_rate if @element_rate
  3008.     @element_rate = 1.0
  3009.   end
  3010. end

  3011. #==============================================================================
  3012. # ■ Game_BattlerBase
  3013. #------------------------------------------------------------------------------
  3014. #  バトラーを扱う基本のクラスです。
  3015. #==============================================================================

  3016. class Game_BattlerBase
  3017.   #--------------------------------------------------------------------------
  3018.   # ● [追加]:ポップアップデータの取得
  3019.   #--------------------------------------------------------------------------
  3020.   def popup_data
  3021.     $game_temp.popup_data
  3022.   end
  3023.   #--------------------------------------------------------------------------
  3024.   # ● [エイリアス]:スキル使用コストの支払い
  3025.   #--------------------------------------------------------------------------
  3026.   alias :lnx11a_pay_skill_cost :pay_skill_cost
  3027.   def pay_skill_cost(skill)
  3028.     rmp = self.mp
  3029.     rtp = self.tp
  3030.     # 元のメソッドを呼ぶ   
  3031.     lnx11a_pay_skill_cost(skill)
  3032.     return unless $game_party.in_battle
  3033.     # ポップアップ
  3034.     popup_data.popup_regenerate_mp(self, (rmp - self.mp).truncate, true)
  3035.     popup_data.popup_regenerate_tp(self, (rtp - self.tp).truncate, true)
  3036.   end
  3037. end

  3038. #==============================================================================
  3039. # ■ Game_Battler
  3040. #------------------------------------------------------------------------------
  3041. #  スプライトに関するメソッドを追加したバトラーのクラスです。
  3042. #==============================================================================

  3043. class Game_Battler < Game_BattlerBase
  3044.   #--------------------------------------------------------------------------
  3045.   # ● 公開インスタンス変数
  3046.   #--------------------------------------------------------------------------
  3047.   attr_accessor :loop_animation_id     # ループアニメーション ID
  3048.   attr_accessor :loop_animation_mirror # ループアニメーション 左右反転フラグ
  3049.   #--------------------------------------------------------------------------
  3050.   # ● [エイリアス]:スプライトのエフェクトをクリア
  3051.   #--------------------------------------------------------------------------
  3052.   alias :lnx11a_clear_sprite_effects :clear_sprite_effects
  3053.   def clear_sprite_effects
  3054.     # 元のメソッドを呼ぶ
  3055.     lnx11a_clear_sprite_effects
  3056.     @loop_animation_id = 0
  3057.     @loop_animation_mirror = false
  3058.   end
  3059.   #--------------------------------------------------------------------------
  3060.   # ● [再定義]:アニメーション ID の設定
  3061.   #--------------------------------------------------------------------------  
  3062.   def animation_id=(id)
  3063.     return unless battle_member?
  3064.     @animation_id = id
  3065.   end
  3066.   #--------------------------------------------------------------------------
  3067.   # ● [追加]:ステートのループアニメーションの設定
  3068.   #--------------------------------------------------------------------------
  3069.   def set_state_animation
  3070.     # 表示優先度が高いステートを優先
  3071.     sort_states
  3072.     anime = @states.collect {|id| $data_states[id].state_animation }
  3073.     anime.delete(0)
  3074.     @loop_animation_id = anime[0] ? anime[0] : 0
  3075.   end
  3076.   #--------------------------------------------------------------------------
  3077.   # ● [エイリアス]:ステート情報をクリア
  3078.   #--------------------------------------------------------------------------
  3079.   alias :lnx11a_clear_states :clear_states
  3080.   def clear_states
  3081.     # 元のメソッドを呼ぶ
  3082.     lnx11a_clear_states
  3083.     # ステートアニメ設定
  3084.     set_state_animation
  3085.   end
  3086.   #--------------------------------------------------------------------------
  3087.   # ● [エイリアス]:ステートの付加
  3088.   #--------------------------------------------------------------------------
  3089.   alias :lnx11a_add_state :add_state
  3090.   def add_state(state_id)
  3091.     # 元のメソッドを呼ぶ
  3092.     lnx11a_add_state(state_id)
  3093.     # ステートアニメ設定
  3094.     set_state_animation
  3095.   end
  3096.   #--------------------------------------------------------------------------
  3097.   # ● [エイリアス]:ステートの解除
  3098.   #--------------------------------------------------------------------------
  3099.   alias :lnx11a_remove_state :remove_state
  3100.   def remove_state(state_id)
  3101.     # 元のメソッドを呼ぶ
  3102.     lnx11a_remove_state(state_id)
  3103.     # ステートアニメ設定
  3104.     set_state_animation
  3105.   end
  3106.   #--------------------------------------------------------------------------
  3107.   # ● [追加]:ポップアップディレイの取得
  3108.   #--------------------------------------------------------------------------
  3109.   def popup_delay
  3110.     return @popup_delay if @popup_delay
  3111.     popup_delay_clear
  3112.   end
  3113.   #--------------------------------------------------------------------------
  3114.   # ● [追加]:ポップアップディレイの設定
  3115.   #--------------------------------------------------------------------------
  3116.   def popup_delay=(delay)
  3117.     @popup_delay = delay
  3118.   end
  3119.   #--------------------------------------------------------------------------
  3120.   # ● [追加]:ポップアップディレイの設定
  3121.   #--------------------------------------------------------------------------
  3122.   def popup_delay_clear
  3123.     @popup_delay = Array.new(16) { 0 }
  3124.   end
  3125.   #--------------------------------------------------------------------------
  3126.   # ● [エイリアス]:スキル/アイテムの属性修正値を取得
  3127.   #  弱点/耐性の判定を追加します。
  3128.   #--------------------------------------------------------------------------
  3129.   alias :lnx11a_item_element_rate :item_element_rate
  3130.   def item_element_rate(user, item)
  3131.     # 元のメソッドを呼ぶ
  3132.     rate = lnx11a_item_element_rate(user, item)
  3133.     return rate unless $game_party.in_battle
  3134.     # レートを結果に保存する
  3135.     @result.element_rate = rate
  3136.     rate
  3137.   end
  3138.   #--------------------------------------------------------------------------
  3139.   # ● [エイリアス]:ダメージの処理
  3140.   #  吸収による回復のポップアップを生成します。
  3141.   #--------------------------------------------------------------------------
  3142.   alias :lnx11a_execute_damage :execute_damage
  3143.   def execute_damage(user)
  3144.     # 元のメソッドを呼ぶ
  3145.     lnx11a_execute_damage(user)
  3146.     return unless $game_party.in_battle
  3147.     # ポップアップ
  3148.     popup_data.popup_hp_drain(user, @result.hp_drain)
  3149.     popup_data.popup_mp_drain(user, @result.mp_drain)
  3150.   end
  3151.   #--------------------------------------------------------------------------
  3152.   # ● [エイリアス]:HP の再生
  3153.   #--------------------------------------------------------------------------
  3154.   alias :lnx11a_regenerate_hp :regenerate_hp
  3155.   def regenerate_hp
  3156.     # 元のメソッドを呼ぶ
  3157.     lnx11a_regenerate_hp
  3158.     return unless $game_party.in_battle
  3159.     # ポップアップ
  3160.     popup_data.popup_regenerate_hp(self, @result.hp_damage)
  3161.   end
  3162.   #--------------------------------------------------------------------------
  3163.   # ● [エイリアス]:MP の再生
  3164.   #--------------------------------------------------------------------------
  3165.   alias :lnx11a_regenerate_mp :regenerate_mp
  3166.   def regenerate_mp
  3167.     # 元のメソッドを呼ぶ
  3168.     lnx11a_regenerate_mp
  3169.     return unless $game_party.in_battle
  3170.     # ポップアップ
  3171.     popup_data.popup_regenerate_mp(self, @result.mp_damage)
  3172.   end
  3173.   #--------------------------------------------------------------------------
  3174.   # ● [エイリアス]:TP の再生
  3175.   #--------------------------------------------------------------------------
  3176.   alias :lnx11a_regenerate_tp :regenerate_tp
  3177.   def regenerate_tp
  3178.     rtp = self.tp.to_i
  3179.     # 元のメソッドを呼ぶ
  3180.     lnx11a_regenerate_tp
  3181.     return unless $game_party.in_battle
  3182.     # ポップアップ
  3183.     popup_data.popup_regenerate_tp(self, rtp - self.tp.to_i)
  3184.   end
  3185.   #--------------------------------------------------------------------------
  3186.   # ● 被ダメージによる TP チャージ
  3187.   #--------------------------------------------------------------------------
  3188.   alias :lnx11a_charge_tp_by_damage :charge_tp_by_damage
  3189.   def charge_tp_by_damage(damage_rate)
  3190.     rtp = self.tp.to_i
  3191.     # 元のメソッドを呼ぶ
  3192.     lnx11a_charge_tp_by_damage(damage_rate)
  3193.     return unless $game_party.in_battle
  3194.     # ポップアップ
  3195.     popup_data.popup_tp_charge(self, rtp - self.tp.to_i)
  3196.   end
  3197.   #--------------------------------------------------------------------------
  3198.   # ● [エイリアス]:スキル/アイテムの使用者側への効果(TP 得)
  3199.   #--------------------------------------------------------------------------
  3200.   alias :lnx11a_item_user_effect :item_user_effect
  3201.   def item_user_effect(user, item)
  3202.     rtp = user.tp.to_i
  3203.     # 元のメソッドを呼ぶ
  3204.     lnx11a_item_user_effect(user, item)
  3205.     return unless $game_party.in_battle
  3206.     # ポップアップ
  3207.     popup_data.popup_tp_gain(user, rtp - user.tp.to_i)
  3208.   end
  3209.   #--------------------------------------------------------------------------
  3210.   # ● [追加]:高さの取得
  3211.   #--------------------------------------------------------------------------
  3212.   def bitmap_height
  3213.     return @bitmap_height if @bitmap_height
  3214.     @bitmap_height = 0
  3215.   end
  3216.   #--------------------------------------------------------------------------
  3217.   # ● [追加]:高さの設定
  3218.   #--------------------------------------------------------------------------
  3219.   def bitmap_height=(y)
  3220.     @bitmap_height = y
  3221.   end
  3222.   #--------------------------------------------------------------------------
  3223.   # ● [追加]:バトル画面 Y 座標(頭上)の取得
  3224.   #--------------------------------------------------------------------------
  3225.   def screen_y_top
  3226.     screen_y - @bitmap_height
  3227.   end
  3228.   #--------------------------------------------------------------------------
  3229.   # ● [追加]:バトル画面 Y 座標(中心)の取得
  3230.   #--------------------------------------------------------------------------
  3231.   def screen_y_center
  3232.     screen_y - @bitmap_height / 2
  3233.   end
  3234. end

  3235. #==============================================================================
  3236. # ■ Game_Actor
  3237. #------------------------------------------------------------------------------
  3238. #  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors)
  3239. # の内部で使用され、Game_Party クラス($game_party)からも参照されます。
  3240. #==============================================================================

  3241. class Game_Actor < Game_Battler
  3242.   #--------------------------------------------------------------------------
  3243.   # ● [追加]:公開インスタンス変数
  3244.   #--------------------------------------------------------------------------
  3245.   attr_accessor :battler_graphic_name    # 後指定のバトラーグラフィック
  3246.   attr_accessor :refresh_battler_graphic # バトラーグラフィックの更新フラグ
  3247.   attr_accessor :screen_x                # バトル画面 X 座標
  3248.   attr_accessor :screen_y                # バトル画面 Y 座標
  3249.   attr_accessor :last_actor_command      # 最後に選択したコマンド
  3250.   #--------------------------------------------------------------------------
  3251.   # ● [再定義]:スプライトを使うか?
  3252.   #--------------------------------------------------------------------------
  3253.   def use_sprite?
  3254.     return true # 使う
  3255.   end
  3256.   #--------------------------------------------------------------------------
  3257.   # ● [追加]:バトル画面 Z 座標の取得
  3258.   #--------------------------------------------------------------------------
  3259.   def screen_z
  3260.     return $game_party.members_screen_z[0] if index == nil
  3261.     return $game_party.members_screen_z[index] # Game_EnemyのZ座標は100
  3262.   end
  3263.   #--------------------------------------------------------------------------
  3264.   # ● [エイリアス]:ダメージ効果の実行
  3265.   #--------------------------------------------------------------------------
  3266.   alias :lnx11a_perform_damage_effect :perform_damage_effect
  3267.   def perform_damage_effect
  3268.     # 元のメソッドを呼ぶ
  3269.     lnx11a_perform_damage_effect
  3270.     # シェイクを無効にしている場合、シェイクをクリア
  3271.     $game_troop.screen.clear_shake if LNX11::DISABLED_DAMAGE_SHAKE
  3272.   end
  3273.   #--------------------------------------------------------------------------
  3274.   # ● [再定義]:コラプス効果の実行
  3275.   #  アクターの[特徴>その他>消滅エフェクト]の設定を適用するようにします。
  3276.   #  処理内容は Game_Enemy のものとほぼ同一です。
  3277.   #--------------------------------------------------------------------------
  3278.   def perform_collapse_effect
  3279.     if $game_party.in_battle
  3280.       case collapse_type
  3281.       when 0
  3282.         @sprite_effect_type = :collapse
  3283.         Sound.play_actor_collapse
  3284.       when 1
  3285.         @sprite_effect_type = :boss_collapse
  3286.         Sound.play_boss_collapse1
  3287.       when 2
  3288.         @sprite_effect_type = :instant_collapse
  3289.       end
  3290.     end
  3291.   end
  3292.   #--------------------------------------------------------------------------
  3293.   # ● [追加]:グラフィック設定の配列を返す
  3294.   #--------------------------------------------------------------------------
  3295.   def graphic_name_index
  3296.     case LNX11::DEFAULT_BATTLER_GRAPHIC
  3297.     when 0 ; [@face_name, @face_index]
  3298.     when 1 ; [@character_name, @character_index]
  3299.     end
  3300.   end
  3301.   #--------------------------------------------------------------------------
  3302.   # ● [エイリアス]:グラフィックの変更
  3303.   #--------------------------------------------------------------------------
  3304.   alias :lnx11a_set_graphic :set_graphic
  3305.   def set_graphic(*args)
  3306.     face = graphic_name_index
  3307.     # 元のメソッドを呼ぶ
  3308.     lnx11a_set_graphic(*args)
  3309.     @refresh_battler_graphic = (face != graphic_name_index)
  3310.   end
  3311.   #--------------------------------------------------------------------------
  3312.   # ● [追加]:デフォルトバトラーグラフィックの取得
  3313.   #--------------------------------------------------------------------------
  3314.   def facebattler
  3315.     $game_temp.actor_battler_graphic[id]
  3316.   end
  3317.   def facebattler=(bitmap)
  3318.     facebattler.dispose if facebattler && !facebattler.disposed?
  3319.     $game_temp.actor_battler_graphic[id] = bitmap
  3320.   end
  3321.   #--------------------------------------------------------------------------
  3322.   # ● [追加]:後指定のバトラーグラフィックファイル名の取得
  3323.   #--------------------------------------------------------------------------
  3324.   def battler_graphic_name
  3325.     return @battler_graphic_name if @battler_graphic_name != nil
  3326.     @battler_graphic_name = ""
  3327.   end
  3328.   #--------------------------------------------------------------------------
  3329.   # ● [追加]:後指定のバトラーグラフィックファイル名の指定
  3330.   #--------------------------------------------------------------------------
  3331.   def battler_graphic_name=(filename)
  3332.     @battler_graphic_name = filename
  3333.     @refresh_battler_graphic = true
  3334.   end
  3335.   #--------------------------------------------------------------------------
  3336.   # ● [追加]:顔グラフィックを描画して返す
  3337.   #  処理内容は Window_Base の draw_face に準じたものです。
  3338.   #--------------------------------------------------------------------------
  3339.   def draw_face(face_name, face_index, enabled = true)
  3340.     fw = 96
  3341.     fh = 96
  3342.     # ビットマップを作成して返す
  3343.     bitmap = Cache.face(face_name)
  3344.     rect = Rect.new(face_index % 4 * fw, face_index / 4 * fh, fw, fh)
  3345.     face = Bitmap.new(fw, fh)
  3346.     color = LNX11::DEFAULT_BG_COLOR
  3347.     face.gradient_fill_rect(face.rect, color[0], color[1], true)
  3348.     face.blt(0, 0, bitmap, rect)
  3349.     bitmap.dispose
  3350.     face
  3351.   end
  3352.   #--------------------------------------------------------------------------
  3353.   # ● [追加]:歩行グラフィックを描画して返す
  3354.   #  処理内容は Window_Base の draw_character に準じたものです。
  3355.   #--------------------------------------------------------------------------
  3356.   def draw_character(character_name, character_index)
  3357.     return unless character_name
  3358.     bitmap = Cache.character(character_name)
  3359.     sign = character_name[/^[\!\$]./]
  3360.     if sign && sign.include?('$')
  3361.       cw = bitmap.width / 3
  3362.       ch = bitmap.height / 4
  3363.     else
  3364.       cw = bitmap.width / 12
  3365.       ch = bitmap.height / 8
  3366.     end
  3367.     n = character_index
  3368.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  3369.     character = Bitmap.new(cw, ch)
  3370.     color = LNX11::DEFAULT_BG_COLOR
  3371.     character.gradient_fill_rect(character.rect, color[0], color[1], true)
  3372.     character.blt(0, 0, bitmap, src_rect)
  3373.     character
  3374.   end
  3375.   #--------------------------------------------------------------------------
  3376.   # ● [追加]:デフォルトバトラーグラフィック設定
  3377.   #--------------------------------------------------------------------------
  3378.   def default_battler_graphic
  3379.     case LNX11::DEFAULT_BATTLER_GRAPHIC
  3380.     when 0 # 顔グラフィック
  3381.       self.facebattler = draw_face(@face_name, @face_index)
  3382.     when 1 # 歩行グラフィック
  3383.       self.facebattler = draw_character(@character_name, @character_index)
  3384.     end
  3385.   end
  3386.   #--------------------------------------------------------------------------
  3387.   # ● [追加]:バトラーグラフィックの更新
  3388.   #  Sprite_Batter が利用するオブジェクトを更新します。
  3389.   #--------------------------------------------------------------------------
  3390.   def update_battler_graphic
  3391.     @battler_hue = 0
  3392.     if !battler_graphic_name.empty?
  3393.       # スクリプトで指定されている
  3394.       @battler_name = @battler_graphic_name
  3395.       dispose_facebattler
  3396.     elsif !actor.default_battler_graphic.empty?
  3397.       # メモで指定されている
  3398.       @battler_name = actor.default_battler_graphic
  3399.       dispose_facebattler
  3400.     else
  3401.       # 何も指定されていない
  3402.       @battler_name = ""
  3403.       default_battler_graphic
  3404.     end
  3405.     # 更新したので更新フラグを取り消す
  3406.     @refresh_battler_graphic = false
  3407.   end
  3408.   #--------------------------------------------------------------------------
  3409.   # ● [追加]:バトラー用顔グラフィックの解放
  3410.   #--------------------------------------------------------------------------
  3411.   def dispose_facebattler
  3412.     return if self.facebattler == nil
  3413.     self.facebattler.dispose
  3414.     self.facebattler = nil
  3415.   end
  3416.   #--------------------------------------------------------------------------
  3417.   # ● [エイリアス]:レベルアップメッセージの表示
  3418.   #   レベルアップのポップアップを追加します。
  3419.   #--------------------------------------------------------------------------
  3420.   alias :lnx11a_display_level_up :display_level_up
  3421.   def display_level_up(new_skills)
  3422.     popup_data.popup_levelup(self) if $game_party.in_battle
  3423.     lnx11a_display_level_up(new_skills)
  3424.   end
  3425. end

  3426. #==============================================================================
  3427. # ■ Game_Enemy
  3428. #------------------------------------------------------------------------------
  3429. #  敵キャラを扱うクラスです。
  3430. #==============================================================================

  3431. class Game_Enemy < Game_Battler
  3432.   #--------------------------------------------------------------------------
  3433.   # ● [追加]:バトルメンバー判定
  3434.   #--------------------------------------------------------------------------
  3435.   def battle_member?
  3436.     true
  3437.   end
  3438.   #--------------------------------------------------------------------------
  3439.   # ● [追加]:通常攻撃 アニメーション ID の取得
  3440.   #--------------------------------------------------------------------------
  3441.   def atk_animation
  3442.     # メモを参照
  3443.     enemy.atk_animation
  3444.   end
  3445. end

  3446. #==============================================================================
  3447. # ■ Game_Party
  3448. #------------------------------------------------------------------------------
  3449. #  パーティを扱うクラスです。所持金やアイテムなどの情報が含まれます。このクラ
  3450. # スのインスタンスは $game_party で参照されます。
  3451. #==============================================================================

  3452. class Game_Party < Game_Unit
  3453.   #--------------------------------------------------------------------------
  3454.   # ● [追加]:公開インスタンス変数
  3455.   #--------------------------------------------------------------------------
  3456.   attr_accessor :actor_invisible     # アクター非表示
  3457.   attr_accessor :status_invisible    # バトルステータス非表示
  3458.   attr_accessor :actor_bg_invisible  # アクター背景非表示
  3459.   attr_accessor :last_party_command  # 最後に選択したパーティコマンド
  3460.   attr_accessor :members_screen_x          # バトルメンバー分のX座標配列
  3461.   attr_accessor :members_screen_x_nooffset # X:オフセットなし
  3462.   attr_accessor :members_screen_y          # バトルメンバー分のY座標配列
  3463.   attr_accessor :members_screen_z          # バトルメンバー分のZ座標配列
  3464.   #--------------------------------------------------------------------------
  3465.   # ● [追加]:バトルメンバーの座標設定
  3466.   #--------------------------------------------------------------------------
  3467.   def set_members_xyz
  3468.     return if members.size == 0
  3469.     # 座標をまとめて設定
  3470.     set_screen_x
  3471.     set_screen_y
  3472.     set_screen_z
  3473.   end
  3474.   #--------------------------------------------------------------------------
  3475.   # ● [追加]:バトルメンバーの座標設定
  3476.   #--------------------------------------------------------------------------
  3477.   def set_members_battle_graphic
  3478.     $game_party.battle_members.each {|actor| actor.update_battler_graphic}
  3479.   end
  3480.   #--------------------------------------------------------------------------
  3481.   # ● [追加]:バトル画面 X 座標の設定
  3482.   #  ここで設定した座標は Game_Actor や ステータス表示等で利用されます。
  3483.   #--------------------------------------------------------------------------
  3484.   def set_screen_x
  3485.     @members_screen_x = []
  3486.     @members_screen_x_nooffset = []
  3487.     padding = LNX11::ACTOR_PADDING[:side]
  3488.     if LNX11::ACTOR_CENTERING
  3489.       # アクターのセンタリングが有効
  3490.       a_spacing = LNX11::ACTOR_SPACING_ADJUST
  3491.       padding += (max_battle_members - battle_members.size) * a_spacing
  3492.       width = (Graphics.width - padding * 2) / battle_members.size
  3493.     else
  3494.       # アクターのセンタリングが無効
  3495.       width = (Graphics.width - padding * 2) / max_battle_members
  3496.     end
  3497.     battle_members.each_with_index do |actor, i|
  3498.       offset = LNX11::ACTOR_OFFSET[:x]
  3499.       @members_screen_x_nooffset[i] = width * i + width / 2 + padding
  3500.       @members_screen_x[i] = @members_screen_x_nooffset[i] + offset
  3501.       actor.screen_x = @members_screen_x[i]
  3502.     end
  3503.   end
  3504.   #--------------------------------------------------------------------------
  3505.   # ● [追加]:バトル画面 Y 座標の設定
  3506.   #  ここで設定した座標は Game_Actor や ステータス表示等で利用されます。
  3507.   #--------------------------------------------------------------------------
  3508.   def set_screen_y
  3509.     offset = LNX11::ACTOR_OFFSET[:y]
  3510.     ay = Graphics.height - LNX11::ACTOR_PADDING[:bottom] + offset
  3511.     @members_screen_y = Array.new(max_battle_members) {ay}
  3512.     battle_members.each {|actor| actor.screen_y = ay}
  3513.   end
  3514.   #--------------------------------------------------------------------------
  3515.   # ● [追加]:バトル画面 Z 座標の設定
  3516.   #--------------------------------------------------------------------------
  3517.   def set_screen_z
  3518.     # 便宜上、XYと同じように配列を作成しておく
  3519.     az = LNX11::ACTOR_SCREEN_TONE ? 150 : -10
  3520.     @members_screen_z = Array.new(max_battle_members) {az}
  3521.   end
  3522.   #--------------------------------------------------------------------------
  3523.   # ● [オーバーライド]:戦闘開始処理
  3524.   #--------------------------------------------------------------------------
  3525.   def on_battle_start
  3526.     super
  3527.     # バトルステータスの更新
  3528.     $game_temp.battle_status_refresh
  3529.   end
  3530. end

  3531. #==============================================================================
  3532. # ■ Game_Troop
  3533. #------------------------------------------------------------------------------
  3534. #  敵グループおよび戦闘に関するデータを扱うクラスです。
  3535. #==============================================================================

  3536. class Game_Troop < Game_Unit
  3537.   #--------------------------------------------------------------------------
  3538.   # ● [エイリアス]:セットアップ
  3539.   #  敵グループの座標修正処理を追加します。
  3540.   #--------------------------------------------------------------------------
  3541.   alias :lnx11a_setup :setup
  3542.   def setup(*args)
  3543.     # 元のメソッドを呼ぶ
  3544.     lnx11a_setup(*args)
  3545.     # 敵グループの座標修正
  3546.     @enemies.each do |enemy|
  3547.       # X:解像度がデフォルトでない場合に位置を補正する
  3548.       if LNX11::TROOP_X_SCREEN_FIX
  3549.         enemy.screen_x *= Graphics.width.to_f / 544
  3550.         enemy.screen_x.truncate
  3551.       end
  3552.       enemy.screen_y += LNX11::TROOP_Y_OFFSET
  3553.     end
  3554.   end
  3555.   #--------------------------------------------------------------------------
  3556.   # ● [エイリアス]:敵キャラ名の配列取得
  3557.   #--------------------------------------------------------------------------
  3558.   alias :lnx11a_enemy_names :enemy_names
  3559.   def enemy_names
  3560.     LNX11::MESSAGE_WINDOW_ENEMY_NAMES ? lnx11a_enemy_names : []
  3561.   end
  3562. end

  3563. #==============================================================================
  3564. # ■ Game_Message
  3565. #------------------------------------------------------------------------------
  3566. #  文章や選択肢などを表示するメッセージウィンドウの状態を扱うクラスです。
  3567. #==============================================================================

  3568. class Game_Message
  3569.   #--------------------------------------------------------------------------
  3570.   # ● [追加]:公開インスタンス変数
  3571.   #--------------------------------------------------------------------------
  3572.   attr_reader   :helpdisplay_texts        # 簡易ヘルプ配列
  3573.   #--------------------------------------------------------------------------
  3574.   # ● [追加]:簡易ヘルプ配列の取得
  3575.   #--------------------------------------------------------------------------
  3576.   def helpdisplay_texts
  3577.     return @helpdisplay_texts if @helpdisplay_texts
  3578.     @helpdisplay_texts = []
  3579.   end
  3580.   #--------------------------------------------------------------------------
  3581.   # ● [エイリアス]:クリア
  3582.   #--------------------------------------------------------------------------
  3583.   alias :lnx11a_clear :clear
  3584.   def clear
  3585.     # 元のメソッドを呼ぶ
  3586.     lnx11a_clear
  3587.     @helpdisplay_texts = []
  3588.     @add_disabled = false
  3589.   end
  3590.   #--------------------------------------------------------------------------
  3591.   # ● [エイリアス]:テキストの追加
  3592.   #--------------------------------------------------------------------------
  3593.   alias :lnx11a_add :add
  3594.   def add(text)
  3595.     # テキストの追加が禁止されてる場合、簡易ヘルプ表示用の配列に追加する
  3596.     if @add_disabled
  3597.       @helpdisplay_texts = [] unless @helpdisplay_texts
  3598.       @helpdisplay_texts.push(text)
  3599.     else
  3600.       # 元のメソッドを呼ぶ
  3601.       lnx11a_add(text)
  3602.     end
  3603.   end
  3604.   #--------------------------------------------------------------------------
  3605.   # ● [追加]:テキスト追加の禁止
  3606.   #--------------------------------------------------------------------------
  3607.   def add_disabled
  3608.     return if LNX11::MESSAGE_TYPE == 0
  3609.     @add_disabled = true
  3610.   end
  3611.   #--------------------------------------------------------------------------
  3612.   # ● [追加]:テキスト追加の禁止
  3613.   #--------------------------------------------------------------------------
  3614.   def add_enabled
  3615.     return if LNX11::MESSAGE_TYPE == 0
  3616.     @add_disabled = false
  3617.   end
  3618. end

  3619. #==============================================================================
  3620. # ■ Sprite_Battler
  3621. #------------------------------------------------------------------------------
  3622. #  バトラー表示用のスプライトです。
  3623. #==============================================================================

  3624. class Sprite_Battler < Sprite_Base
  3625.   #--------------------------------------------------------------------------
  3626.   # ● [追加]:ターゲットカーソルのバトラーの取得
  3627.   #--------------------------------------------------------------------------
  3628.   def cursor_battler
  3629.     $game_temp.target_cursor_sprite.battler
  3630.   end
  3631.   #--------------------------------------------------------------------------
  3632.   # ● [追加]:ターゲットカーソルの点滅状態に対応したシンボルを返す
  3633.   #--------------------------------------------------------------------------
  3634.   def cursor_effect
  3635.     $game_temp.target_cursor_sprite.blink ? :target_whiten : :command_whiten
  3636.   end
  3637.   #--------------------------------------------------------------------------
  3638.   # ● [追加]:対象選択フラッシュの設定
  3639.   #--------------------------------------------------------------------------
  3640.   def setup_cursor_effect
  3641.     if cursor_battler == @battler ||
  3642.        (cursor_battler == :party && @battler.actor?) ||
  3643.        ([:troop, :troop_random].include?(cursor_battler) && !@battler.actor?)
  3644.       if @effect_type == nil || @effect_type != cursor_effect
  3645.         start_effect(cursor_effect)
  3646.       end
  3647.     else
  3648.       # フラッシュエフェクト終了
  3649.       end_cursor_effect
  3650.     end
  3651.   end
  3652.   #--------------------------------------------------------------------------
  3653.   # ● [追加]:対象選択フラッシュの終了
  3654.   #--------------------------------------------------------------------------
  3655.   def end_cursor_effect
  3656.     if [:target_whiten, :command_whiten].include?(@effect_type)
  3657.       @effect_type = nil
  3658.       @effect_duration = 0
  3659.       revert_to_normal
  3660.     end
  3661.   end
  3662.   #--------------------------------------------------------------------------
  3663.   # ● [オーバーライド]:アニメーションスプライトの設定
  3664.   #--------------------------------------------------------------------------
  3665.   def animation_set_sprites(frame)
  3666.     o = self.opacity
  3667.     self.opacity = 255 if !@battler_visible || @effect_duration > 0
  3668.     # スーパークラスのメソッドを呼ぶ
  3669.     super(frame)
  3670.     self.opacity = o
  3671.   end
  3672.   #--------------------------------------------------------------------------
  3673.   # ● [オーバーライド]:アニメーションの原点設定
  3674.   #--------------------------------------------------------------------------
  3675.   def set_animation_origin
  3676.     # スーパークラスのメソッドを呼ぶ
  3677.     super
  3678.     # 画面アニメーションがアクターに再生されたら
  3679.     if @animation.position == 3 && @battler != nil && @battler.actor?
  3680.       # アニメーションのY座標を修正
  3681.       @ani_oy += LNX11::SCREEN_ANIMATION_OFFSET
  3682.     end
  3683.   end
  3684.   #--------------------------------------------------------------------------
  3685.   # ● [エイリアス]:転送元ビットマップの更新
  3686.   #--------------------------------------------------------------------------
  3687.   alias :lnx11a_update_bitmap :update_bitmap
  3688.   def update_bitmap
  3689.     if @battler.actor? && @battler.refresh_battler_graphic
  3690.       # バトラーグラフィックが変更されていれば更新する
  3691.       @battler.update_battler_graphic
  3692.     end
  3693.     if @battler.actor? && @battler.facebattler != nil
  3694.       # バトラー用顔グラフィックが作成されていれば、
  3695.       # それを Sprite の Bitmap とする
  3696.       new_bitmap = @battler.facebattler
  3697.       if bitmap != new_bitmap
  3698.         self.bitmap = new_bitmap
  3699.         init_visibility
  3700.       end
  3701.     else
  3702.       # 元のメソッドを呼ぶ
  3703.       lnx11a_update_bitmap
  3704.     end
  3705.   end
  3706.   #--------------------------------------------------------------------------
  3707.   # ● [エイリアス]:新しいアニメーションの設定
  3708.   #--------------------------------------------------------------------------
  3709.   alias :lnx11a_setup_new_animation :setup_new_animation
  3710.   def setup_new_animation
  3711.     lnx11a_setup_new_animation
  3712.     # ループアニメーションの設定
  3713.     if @battler.loop_animation_id > 0 && (@loop_animation == nil ||
  3714.        @battler.loop_animation_id != @loop_animation.id)
  3715.       animation = $data_animations[@battler.loop_animation_id]
  3716.       mirror = @battler.loop_animation_mirror
  3717.       start_loop_animation(animation, mirror)
  3718.     elsif @battler.loop_animation_id == 0 && @loop_animation
  3719.       end_loop_animation
  3720.     end
  3721.   end
  3722.   #--------------------------------------------------------------------------
  3723.   # ● [エイリアス]:新しいエフェクトの設定
  3724.   #--------------------------------------------------------------------------
  3725.   alias :lnx11a_setup_new_effect :setup_new_effect
  3726.   def setup_new_effect
  3727.     # 元のメソッドを呼ぶ
  3728.     lnx11a_setup_new_effect
  3729.     # フラッシュエフェクト設定
  3730.     if @battler_visible && cursor_battler
  3731.       setup_cursor_effect
  3732.     else
  3733.       # フラッシュエフェクト終了
  3734.       end_cursor_effect
  3735.     end
  3736.   end
  3737.   #--------------------------------------------------------------------------
  3738.   # ● [エイリアス]:エフェクトの開始
  3739.   #--------------------------------------------------------------------------
  3740.   alias :lnx11a_start_effect :start_effect
  3741.   def start_effect(effect_type)
  3742.     # エフェクト開始の追加
  3743.     @effect_type = effect_type
  3744.     case @effect_type
  3745.     when :target_whiten
  3746.       @effect_duration = 40
  3747.       @battler_visible = true
  3748.     when :command_whiten
  3749.       @effect_duration = 80
  3750.       @battler_visible = true
  3751.     end
  3752.     # 元のメソッドを呼ぶ
  3753.     lnx11a_start_effect(effect_type)
  3754.   end
  3755.   #--------------------------------------------------------------------------
  3756.   # ● [エイリアス]:エフェクトの更新
  3757.   #--------------------------------------------------------------------------
  3758.   alias :lnx11a_update_effect :update_effect
  3759.   def update_effect
  3760.     # エフェクト更新の追加
  3761.     if @effect_duration > 0
  3762.       @effect_duration -= 1
  3763.       case @effect_type
  3764.       when :target_whiten
  3765.         update_target_whiten
  3766.       when :command_whiten
  3767.         update_command_whiten
  3768.       end
  3769.       @effect_duration += 1
  3770.     end
  3771.     # 元のメソッドを呼ぶ
  3772.     lnx11a_update_effect
  3773.   end
  3774.   #--------------------------------------------------------------------------
  3775.   # ● [追加]:対象選択フラッシュエフェクトの更新
  3776.   #--------------------------------------------------------------------------
  3777.   def update_target_whiten
  3778.     alpha = @effect_duration < 20 ? @effect_duration : 40 - @effect_duration
  3779.     self.color.set(255, 255, 255, 0)
  3780.     self.color.alpha = (alpha + 1) * 2
  3781.   end
  3782.   #--------------------------------------------------------------------------
  3783.   # ● [追加]:コマンド選択フラッシュエフェクトの更新
  3784.   #--------------------------------------------------------------------------
  3785.   def update_command_whiten
  3786.     alpha = @effect_duration < 40 ? @effect_duration : 80 - @effect_duration
  3787.     self.color.set(255, 255, 255, 0)
  3788.     self.color.alpha = alpha * 2
  3789.   end
  3790.   #--------------------------------------------------------------------------
  3791.   # ● [追加]:高さの取得
  3792.   #--------------------------------------------------------------------------
  3793.   def bitmap_height
  3794.     self.bitmap.height
  3795.   end
  3796.   #--------------------------------------------------------------------------
  3797.   # ● [エイリアス]:位置の更新
  3798.   #--------------------------------------------------------------------------
  3799.   alias :lnx11a_update_position :update_position
  3800.   def update_position
  3801.     # 元のメソッドを呼ぶ
  3802.     lnx11a_update_position
  3803.     # 高さを更新
  3804.     @battler.bitmap_height = bitmap_height
  3805.     # 可視状態を更新
  3806.     self.visible = !$game_party.actor_invisible if @battler.actor?
  3807.   end
  3808.   if LNX11::ENHANCED_WHITEN
  3809.     # 白フラッシュを強めにする
  3810.     #------------------------------------------------------------------------
  3811.     # ● [再定義]:白フラッシュエフェクトの更新
  3812.     #------------------------------------------------------------------------
  3813.     def update_whiten
  3814.       self.color.set(255, 255, 255, 0)
  3815.       self.color.alpha = 192 - (16 - @effect_duration) * 12
  3816.     end
  3817.   end
  3818.   #--------------------------------------------------------------------------
  3819.   # ● ループアニメーションの追加
  3820.   #--------------------------------------------------------------------------
  3821.   #--------------------------------------------------------------------------
  3822.   # ● [追加]:クラス変数
  3823.   #--------------------------------------------------------------------------
  3824.   @@loop_ani_checker = []
  3825.   @@loop_ani_spr_checker = []
  3826.   #--------------------------------------------------------------------------
  3827.   # ● [エイリアス]:オブジェクト初期化
  3828.   #--------------------------------------------------------------------------
  3829.   alias :lnx11a_initialize :initialize
  3830.   def initialize(viewport, battler = nil)
  3831.     # 元のメソッドを呼ぶ
  3832.     lnx11a_initialize(viewport, battler)
  3833.     # ループアニメの残り時間
  3834.     @loop_ani_duration = 0
  3835.   end
  3836.   #--------------------------------------------------------------------------
  3837.   # ● [エイリアス]:解放
  3838.   #--------------------------------------------------------------------------
  3839.   alias :lnx11a_dispose :dispose
  3840.   def dispose
  3841.     # 元のメソッドを呼ぶ
  3842.     lnx11a_dispose
  3843.     # ループアニメを解放
  3844.     dispose_loop_animation
  3845.   end
  3846.   #--------------------------------------------------------------------------
  3847.   # ● [エイリアス]:フレーム更新
  3848.   #--------------------------------------------------------------------------
  3849.   alias :lnx11a_update :update
  3850.   def update
  3851.     # 元のメソッドを呼ぶ
  3852.     lnx11a_update
  3853.     update_loop_animation
  3854.     @@loop_ani_checker.clear
  3855.     @@loop_ani_spr_checker.clear
  3856.   end
  3857.   #--------------------------------------------------------------------------
  3858.   # ● [追加]:ループアニメーション表示中判定
  3859.   #--------------------------------------------------------------------------
  3860.   def loop_animation?
  3861.     @loop_animation != nil
  3862.   end
  3863.   #--------------------------------------------------------------------------
  3864.   # ● [追加]:ループアニメーションの開始
  3865.   #--------------------------------------------------------------------------
  3866.   def start_loop_animation(animation, mirror = false)
  3867.     dispose_loop_animation
  3868.     @loop_animation = animation
  3869.     if @loop_animation
  3870.       @loop_ani_mirror = mirror
  3871.       set_loop_animation_rate
  3872.       @loop_ani_duration = @loop_animation.frame_max * @loop_ani_rate + 1
  3873.       load_loop_animation_bitmap
  3874.       make_loop_animation_sprites
  3875.       set_loop_animation_origin
  3876.     end
  3877.   end
  3878.   #--------------------------------------------------------------------------
  3879.   # ● [追加]:ループアニメーションの速度を設定
  3880.   #--------------------------------------------------------------------------
  3881.   def set_loop_animation_rate
  3882.     if $lnx_include[:lnx09]
  3883.       # LNX09 を導入している
  3884.       default = LNX09::DEFAULT_BATTLE_SPEED_RATE
  3885.       if @loop_animation.speed_rate
  3886.         @loop_ani_rate = @loop_animation.speed_rate
  3887.       else
  3888.         @loop_ani_rate = default
  3889.       end
  3890.     else
  3891.       @loop_ani_rate = 4
  3892.     end
  3893.   end
  3894.   #--------------------------------------------------------------------------
  3895.   # ● [追加]:ループアニメーション グラフィックの読み込み
  3896.   #--------------------------------------------------------------------------
  3897.   def load_loop_animation_bitmap
  3898.     animation1_name = @loop_animation.animation1_name
  3899.     animation1_hue = @loop_animation.animation1_hue
  3900.     animation2_name = @loop_animation.animation2_name
  3901.     animation2_hue = @loop_animation.animation2_hue
  3902.     @loop_ani_bitmap1 = Cache.animation(animation1_name, animation1_hue)
  3903.     @loop_ani_bitmap2 = Cache.animation(animation2_name, animation2_hue)
  3904.     if @@_reference_count.include?(@loop_ani_bitmap1)
  3905.       @@_reference_count[@loop_ani_bitmap1] += 1
  3906.     else
  3907.       @@_reference_count[@loop_ani_bitmap1] = 1
  3908.     end
  3909.     if @@_reference_count.include?(@loop_ani_bitmap2)
  3910.       @@_reference_count[@loop_ani_bitmap2] += 1
  3911.     else
  3912.       @@_reference_count[@loop_ani_bitmap2] = 1
  3913.     end
  3914.     Graphics.frame_reset
  3915.   end
  3916.   #--------------------------------------------------------------------------
  3917.   # ● [追加]:ループアニメーションスプライトの作成
  3918.   #--------------------------------------------------------------------------
  3919.   def make_loop_animation_sprites
  3920.     @loop_ani_sprites = []
  3921.     if @use_sprite && !@@loop_ani_spr_checker.include?(@loop_animation)
  3922.       16.times do
  3923.         sprite = ::Sprite.new(viewport)
  3924.         sprite.visible = false
  3925.         @loop_ani_sprites.push(sprite)
  3926.       end
  3927.       if @loop_animation.position == 3
  3928.         @@loop_ani_spr_checker.push(@loop_animation)
  3929.       end
  3930.     end
  3931.     @loop_ani_duplicated = @@loop_ani_checker.include?(@loop_animation)
  3932.     if !@loop_ani_duplicated && @loop_animation.position == 3
  3933.       @@loop_ani_checker.push(@loop_animation)
  3934.     end
  3935.   end
  3936.   #--------------------------------------------------------------------------
  3937.   # ● [追加]:ループアニメーションの原点設定
  3938.   #--------------------------------------------------------------------------
  3939.   def set_loop_animation_origin
  3940.     if @loop_animation.position == 3
  3941.       if viewport == nil
  3942.         @loop_ani_ox = Graphics.width / 2
  3943.         @loop_ani_oy = Graphics.height / 2
  3944.       else
  3945.         @loop_ani_ox = viewport.rect.width / 2
  3946.         @loop_ani_oy = viewport.rect.height / 2
  3947.       end
  3948.     else
  3949.       @loop_ani_ox = x - ox + width / 2
  3950.       @loop_ani_oy = y - oy + height / 2
  3951.       if @loop_animation.position == 0
  3952.         @loop_ani_oy -= height / 2
  3953.       elsif @loop_animation.position == 2
  3954.         @loop_ani_oy += height / 2
  3955.       end
  3956.     end
  3957.   end
  3958.   #--------------------------------------------------------------------------
  3959.   # ● [追加]:ループアニメーションの解放
  3960.   #--------------------------------------------------------------------------
  3961.   def dispose_loop_animation
  3962.     if @loop_ani_bitmap1
  3963.       @@_reference_count[@loop_ani_bitmap1] -= 1
  3964.       if @@_reference_count[@loop_ani_bitmap1] == 0
  3965.         @loop_ani_bitmap1.dispose
  3966.       end
  3967.     end
  3968.     if @loop_ani_bitmap2
  3969.       @@_reference_count[@loop_ani_bitmap2] -= 1
  3970.       if @@_reference_count[@loop_ani_bitmap2] == 0
  3971.         @loop_ani_bitmap2.dispose
  3972.       end
  3973.     end
  3974.     if @loop_ani_sprites
  3975.       @loop_ani_sprites.each {|sprite| sprite.dispose }
  3976.       @loop_ani_sprites = nil
  3977.       @loop_animation = nil
  3978.     end
  3979.     @loop_ani_bitmap1 = nil
  3980.     @loop_ani_bitmap2 = nil
  3981.   end
  3982.   #--------------------------------------------------------------------------
  3983.   # ● [追加]:ループアニメーションの更新
  3984.   #--------------------------------------------------------------------------
  3985.   def update_loop_animation
  3986.     return unless loop_animation?
  3987.     @loop_ani_duration -= 1
  3988.     if @loop_ani_duration % @loop_ani_rate == 0
  3989.       if @loop_ani_duration > 0
  3990.         frame_index = @loop_animation.frame_max
  3991.         speed = (@loop_ani_duration + @loop_ani_rate - 1) / @loop_ani_rate
  3992.         frame_index -= speed
  3993.         loop_animation_set_sprites(@loop_animation.frames[frame_index])
  3994.         @loop_animation.timings.each do |timing|
  3995.           loop_animation_process_timing(timing) if timing.frame == frame_index
  3996.         end
  3997.       else
  3998.         # 残り時間を再設定してループ
  3999.         @loop_ani_duration = @loop_animation.frame_max * @loop_ani_rate + 1
  4000.       end
  4001.     end
  4002.   end
  4003.   #--------------------------------------------------------------------------
  4004.   # ● [追加]:ループアニメーションの終了
  4005.   #--------------------------------------------------------------------------
  4006.   def end_loop_animation
  4007.     dispose_loop_animation
  4008.   end
  4009.   #--------------------------------------------------------------------------
  4010.   # ● [追加]:ループアニメーションスプライトの設定
  4011.   #     frame : フレームデータ(RPG::Animation::Frame)
  4012.   #--------------------------------------------------------------------------
  4013.   def loop_animation_set_sprites(frame)
  4014.     cell_data = frame.cell_data
  4015.     @loop_ani_sprites.each_with_index do |sprite, i|
  4016.       next unless sprite
  4017.       pattern = cell_data[i, 0]
  4018.       if !pattern || pattern < 0
  4019.         sprite.visible = false
  4020.         next
  4021.       end
  4022.       sprite.bitmap = pattern < 100 ? @loop_ani_bitmap1 : @loop_ani_bitmap2
  4023.       sprite.visible = true
  4024.       sprite.src_rect.set(pattern % 5 * 192,
  4025.         pattern % 100 / 5 * 192, 192, 192)
  4026.       if @loop_ani_mirror
  4027.         sprite.x = @loop_ani_ox - cell_data[i, 1]
  4028.         sprite.y = @loop_ani_oy + cell_data[i, 2]
  4029.         sprite.angle = (360 - cell_data[i, 4])
  4030.         sprite.mirror = (cell_data[i, 5] == 0)
  4031.       else
  4032.         sprite.x = @loop_ani_ox + cell_data[i, 1]
  4033.         sprite.y = @loop_ani_oy + cell_data[i, 2]
  4034.         sprite.angle = cell_data[i, 4]
  4035.         sprite.mirror = (cell_data[i, 5] == 1)
  4036.       end
  4037.       sprite.z = self.z + 316 + i
  4038.       sprite.ox = 96
  4039.       sprite.oy = 96
  4040.       sprite.zoom_x = cell_data[i, 3] / 100.0
  4041.       sprite.zoom_y = cell_data[i, 3] / 100.0
  4042.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  4043.       sprite.blend_type = cell_data[i, 7]
  4044.     end
  4045.   end
  4046.   #--------------------------------------------------------------------------
  4047.   # ● [追加]:SE とフラッシュのタイミング処理
  4048.   #     timing : タイミングデータ(RPG::Animation::Timing)
  4049.   #--------------------------------------------------------------------------
  4050.   def loop_animation_process_timing(timing)
  4051.     timing.se.play unless @loop_ani_duplicated
  4052.     case timing.flash_scope
  4053.     when 1
  4054.       self.flash(timing.flash_color, timing.flash_duration * @loop_ani_rate)
  4055.     when 2
  4056.       if viewport && !@loop_ani_duplicated
  4057.         duration = timing.flash_duration * @loop_ani_rate
  4058.         viewport.flash(timing.flash_color, duration)
  4059.       end
  4060.     when 3
  4061.       self.flash(nil, timing.flash_duration * @loop_ani_rate)
  4062.     end
  4063.   end
  4064. end

  4065. #==============================================================================
  4066. # ■ Spriteset_Battle
  4067. #------------------------------------------------------------------------------
  4068. #  バトル画面のスプライトをまとめたクラスです。
  4069. #==============================================================================

  4070. class Spriteset_Battle
  4071.   #--------------------------------------------------------------------------
  4072.   # ● [エイリアス]:オブジェクト初期化
  4073.   #--------------------------------------------------------------------------
  4074.   alias :lnx11a_initialize :initialize
  4075.   def initialize
  4076.     # 元のメソッドを呼ぶ
  4077.     lnx11a_initialize
  4078.     # アクターエリアの背景の作成
  4079.     create_actor_background
  4080.   end
  4081.   #--------------------------------------------------------------------------
  4082.   # ● [エイリアス]:解放
  4083.   #--------------------------------------------------------------------------
  4084.   alias :lnx11a_dispose :dispose
  4085.   def dispose
  4086.     # 元のメソッドを呼ぶ
  4087.     lnx11a_dispose
  4088.     # アクターエリアの背景の解放
  4089.     dispose_actor_background
  4090.   end
  4091.   #--------------------------------------------------------------------------
  4092.   # ● [エイリアス]:フレーム更新
  4093.   #--------------------------------------------------------------------------
  4094.   alias :lnx11a_update :update
  4095.   def update
  4096.     # 元のメソッドを呼ぶ
  4097.     lnx11a_update
  4098.     # アクターエリアの背景の更新
  4099.     update_actor_background
  4100.   end
  4101.   #--------------------------------------------------------------------------
  4102.   # ● [追加]:アクターのビューポート
  4103.   #--------------------------------------------------------------------------
  4104.   def actor_viewport
  4105.     LNX11::ACTOR_SCREEN_TONE ? @viewport1 : @viewport2
  4106.   end
  4107.   #--------------------------------------------------------------------------
  4108.   # ● [追加]:アクターエリアの背景の作成
  4109.   #--------------------------------------------------------------------------
  4110.   def create_actor_background
  4111.     return if LNX11::ACTOR_BACKGROUND == 0
  4112.     viewport = actor_viewport
  4113.     height = LNX11::ACTOR_BACKGROUND_HEIGHT
  4114.     case LNX11::ACTOR_BACKGROUND
  4115.     when 1
  4116.       # グラデーション
  4117.       @actor_background = Sprite.new
  4118.       back = Bitmap.new(Graphics.width, height)
  4119.       color = LNX11::ACTOR_BG_GRADIENT_COLOR
  4120.       back.gradient_fill_rect(back.rect, color[0], color[1], true)
  4121.       @actor_background.bitmap = back
  4122.     when 2
  4123.       # ウィンドウ
  4124.       @actor_background = Window_Base.new(0, 0, Graphics.width, height)
  4125.     else
  4126.       if LNX11::ACTOR_BACKGROUND.is_a?(String)
  4127.         # ファイル指定
  4128.         @actor_background = Sprite.new
  4129.         @actor_background.bitmap = Cache.system(LNX11::ACTOR_BACKGROUND)
  4130.         @actor_background.x = Graphics.width / 2
  4131.         @actor_background.ox = @actor_background.bitmap.width / 2
  4132.         height = @actor_background.bitmap.height
  4133.       end
  4134.     end
  4135.     @actor_background.viewport = viewport
  4136.     @actor_background.y = Graphics.height - height
  4137.     @actor_background.z = viewport == @viewport1 ? 120 : -20
  4138.     update_actor_background
  4139.   end
  4140.   #--------------------------------------------------------------------------
  4141.   # ● [追加]:アクターエリアの背景の解放
  4142.   #--------------------------------------------------------------------------
  4143.   def dispose_actor_background
  4144.     return unless @actor_background
  4145.     @actor_background.bitmap.dispose if @actor_background.is_a?(Sprite)
  4146.     @actor_background.dispose
  4147.   end
  4148.   #--------------------------------------------------------------------------
  4149.   # ● [追加]:アクターエリアの背景の更新
  4150.   #--------------------------------------------------------------------------
  4151.   def update_actor_background
  4152.     return unless @actor_background
  4153.     @actor_background.visible = !$game_party.actor_bg_invisible
  4154.   end
  4155.   #--------------------------------------------------------------------------
  4156.   # ● [再定義]:アクタースプライトの作成
  4157.   #--------------------------------------------------------------------------
  4158.   def create_actors
  4159.     # 座標とグラフィックの設定
  4160.     $game_party.set_members_xyz
  4161.     $game_party.set_members_battle_graphic
  4162.     # スプライトの作成
  4163.     viewport = actor_viewport
  4164.     @actor_sprites = $game_party.battle_members.collect do |actor|
  4165.       Sprite_Battler.new(viewport, actor)
  4166.     end
  4167.   end
  4168.   #--------------------------------------------------------------------------
  4169.   # ● [再定義]:アクタースプライトの更新
  4170.   #--------------------------------------------------------------------------
  4171.   def update_actors
  4172.     @actor_sprites.each {|sprite| sprite.update }
  4173.   end
  4174. end

  4175. #==============================================================================
  4176. # ■ Scene_Battle
  4177. #------------------------------------------------------------------------------
  4178. #  バトル画面の処理を行うクラスです。
  4179. #==============================================================================

  4180. class Scene_Battle < Scene_Base
  4181.   #--------------------------------------------------------------------------
  4182.   # ● [追加]:簡易ヘルプのメソッド設定
  4183.   #--------------------------------------------------------------------------
  4184.   def set_helpdisplay_methods
  4185.     BattleManager.update_for_wait_method = method(:update_for_wait)
  4186.     BattleManager.helpdisplay_set_method = method(:helpdisplay_set)
  4187.     BattleManager.helpdisplay_clear_method = method(:helpdisplay_clear)
  4188.     BattleManager.helpdisplay_wait_short_method=method(:helpdisplay_wait_short)
  4189.   end
  4190.   #--------------------------------------------------------------------------
  4191.   # ● [追加]:簡易ヘルプ表示
  4192.   #--------------------------------------------------------------------------
  4193.   def helpdisplay_set(item, duration = nil)
  4194.     @wait_short_disabled = false
  4195.     @targethelp_window.show.set_item(item)
  4196.     @targethelp_window.update
  4197.     wait(duration ? duration : 20)
  4198.   end
  4199.   #--------------------------------------------------------------------------
  4200.   # ● [追加]:簡易ヘルプ消去
  4201.   #--------------------------------------------------------------------------
  4202.   def helpdisplay_clear(duration = nil)
  4203.     return if !@targethelp_window.visible
  4204.     @wait_short_disabled = false
  4205.     @targethelp_window.clear
  4206.     @targethelp_window.hide
  4207.     wait(duration ? duration : 10)
  4208.   end
  4209.   #--------------------------------------------------------------------------
  4210.   # ● [追加]:簡易ヘルプ・短時間ウェイト
  4211.   #--------------------------------------------------------------------------
  4212.   def helpdisplay_wait_short
  4213.     return if !@targethelp_window.visible || @wait_short_disabled
  4214.     @wait_short_disabled = true # 連続で短時間ウェイトが実行されないように
  4215.     @targethelp_window.clear
  4216.     abs_wait_short
  4217.   end
  4218.   #--------------------------------------------------------------------------
  4219.   # ● [追加]:バトラーのエフェクト実行中?
  4220.   #--------------------------------------------------------------------------
  4221.   def battler_effect?
  4222.     @spriteset.effect?
  4223.   end
  4224.   #--------------------------------------------------------------------------
  4225.   # ● [エイリアス]:コマンド[逃げる]
  4226.   #--------------------------------------------------------------------------
  4227.   alias :lnx11a_command_escape :command_escape
  4228.   def command_escape
  4229.     @party_command_window.close
  4230.     @party_command_window.openness = 0 if LNX11::MESSAGE_TYPE == 2
  4231.     @status_window.unselect
  4232.     # 元のメソッドを呼ぶ
  4233.     lnx11a_command_escape
  4234.   end
  4235.   #--------------------------------------------------------------------------
  4236.   # ● [エイリアス]:スキル/アイテムの使用
  4237.   #--------------------------------------------------------------------------
  4238.   alias :lnx11a_use_item :use_item
  4239.   def use_item
  4240.     # 簡易ヘルプ表示
  4241.     item = @subject.current_action.item
  4242.     if LNX11::BATTLELOG_TYPE == 2 && !item.no_display
  4243.       helpdisplay_set(item, item.display_wait)
  4244.     end
  4245.     # 元のメソッドを呼ぶ
  4246.     lnx11a_use_item
  4247.     # 簡易ヘルプ消去・エフェクトが終わるまで待つ
  4248.     if LNX11::BATTLELOG_TYPE == 2
  4249.       wait(item.end_wait)
  4250.       helpdisplay_clear
  4251.     end
  4252.     wait_for_effect
  4253.   end
  4254.   #--------------------------------------------------------------------------
  4255.   # ● [エイリアス]:開始処理
  4256.   #--------------------------------------------------------------------------
  4257.   alias :lnx11a_start :start
  4258.   def start
  4259.     set_helpdisplay_methods
  4260.     @last_party_members = party_members
  4261.     $game_temp.method_battle_status_refresh = method(:refresh_status)
  4262.     $game_temp.clear_last_target_cursor
  4263.     $game_party.all_members.each {|actor| actor.last_actor_command = 0 }
  4264.     reset_sprite_effects
  4265.     standby_message_window_position
  4266.     create_targetcursor
  4267.     create_popup
  4268.     #元のメソッドを呼ぶ
  4269.     lnx11a_start
  4270.   end
  4271.   #--------------------------------------------------------------------------
  4272.   # ● [エイリアス]:終了処理
  4273.   #--------------------------------------------------------------------------
  4274.   alias :lnx11a_terminate :terminate
  4275.   def terminate
  4276.     $game_message.clear
  4277.     dispose_targetcursor
  4278.     dispose_popup
  4279.     # 元のメソッドを呼ぶ
  4280.     lnx11a_terminate
  4281.   end
  4282.   #--------------------------------------------------------------------------
  4283.   # ● [追加]:アクターのスプライト情報の初期化
  4284.   #--------------------------------------------------------------------------
  4285.   def reset_sprite_effects
  4286.     $game_party.battle_members.each do |actor|
  4287.       actor.popup_delay_clear
  4288.       actor.set_state_animation
  4289.     end
  4290.   end
  4291.   #--------------------------------------------------------------------------
  4292.   # ● [エイリアス]:全ウィンドウの作成
  4293.   #--------------------------------------------------------------------------
  4294.   alias :lnx11a_create_all_windows :create_all_windows
  4295.   def create_all_windows
  4296.     # 元のメソッドを呼ぶ
  4297.     lnx11a_create_all_windows
  4298.     create_targethelp_window
  4299.   end
  4300.   #--------------------------------------------------------------------------
  4301.   # ● [エイリアス]:ステータスウィンドウの作成
  4302.   #--------------------------------------------------------------------------
  4303.   alias :lnx11a_create_status_window :create_status_window
  4304.   def create_status_window
  4305.     # 元のメソッドを呼ぶ
  4306.     lnx11a_create_status_window
  4307.     @status_window.set_xy
  4308.   end
  4309.   #--------------------------------------------------------------------------
  4310.   # ● [エイリアス]:情報表示ビューポートの作成
  4311.   #--------------------------------------------------------------------------
  4312.   alias :lnx11a_create_info_viewport :create_info_viewport
  4313.   def create_info_viewport
  4314.     # 元のメソッドを呼ぶ
  4315.     lnx11a_create_info_viewport
  4316.     # ビューポートを修正
  4317.     @info_viewport.rect.y = Graphics.height - LNX11::ACTOR_BACKGROUND_HEIGHT
  4318.     @info_viewport.rect.height = LNX11::ACTOR_BACKGROUND_HEIGHT
  4319.     @status_window.viewport = nil
  4320.   end
  4321.   #--------------------------------------------------------------------------
  4322.   # ● [エイリアス]:パーティコマンドウィンドウの作成
  4323.   #--------------------------------------------------------------------------
  4324.   alias :lnx11a_create_party_command_window :create_party_command_window
  4325.   def create_party_command_window
  4326.     # 元のメソッドを呼ぶ
  4327.     lnx11a_create_party_command_window
  4328.     @party_command_window.viewport = nil
  4329.   end
  4330.   #--------------------------------------------------------------------------
  4331.   # ● [エイリアス]:アクターコマンドウィンドウの作成
  4332.   #--------------------------------------------------------------------------
  4333.   alias :lnx11a_create_actor_command_window :create_actor_command_window
  4334.   def create_actor_command_window
  4335.     # 元のメソッドを呼ぶ
  4336.     lnx11a_create_actor_command_window
  4337.     @actor_command_window.viewport = nil
  4338.   end
  4339.   #--------------------------------------------------------------------------
  4340.   # ● [エイリアス]:ログウィンドウの作成
  4341.   #--------------------------------------------------------------------------
  4342.   alias :lnx11a_create_log_window :create_log_window
  4343.   def create_log_window
  4344.     # 元のメソッドを呼ぶ
  4345.     lnx11a_create_log_window
  4346.     # ウェイトメソッド
  4347.     @log_window.method_wait_for_animation = method(:wait_for_animation)
  4348.   end  
  4349.   #--------------------------------------------------------------------------
  4350.   # ● [追加]:ターゲットカーソルの作成
  4351.   #--------------------------------------------------------------------------
  4352.   def create_targetcursor
  4353.     @targetcursor = Sprite_TargetCursor.new
  4354.     $game_temp.target_cursor_sprite = @targetcursor
  4355.   end
  4356.   #--------------------------------------------------------------------------
  4357.   # ● [追加]:ターゲットカーソルの解放
  4358.   #--------------------------------------------------------------------------
  4359.   def dispose_targetcursor
  4360.     @targetcursor.dispose
  4361.   end
  4362.   #--------------------------------------------------------------------------
  4363.   # ● [追加]:ターゲットヘルプウィンドウの作成
  4364.   #--------------------------------------------------------------------------
  4365.   def create_targethelp_window
  4366.     @targethelp_window = Window_TargetHelp.new
  4367.     @targethelp_window.visible = false
  4368.     # ターゲット選択ウィンドウに関連付ける
  4369.     @actor_window.help_window = @targethelp_window
  4370.     @enemy_window.help_window = @targethelp_window
  4371.   end
  4372.   #--------------------------------------------------------------------------
  4373.   # ● [追加]:ポップアップの作成
  4374.   #--------------------------------------------------------------------------
  4375.   def create_popup
  4376.     $game_temp.popup_data = Popup_Data.new
  4377.   end
  4378.   #--------------------------------------------------------------------------
  4379.   # ● [追加]:ポップアップの解放
  4380.   #--------------------------------------------------------------------------
  4381.   def dispose_popup
  4382.     $game_temp.popup_data.dispose
  4383.   end
  4384.   #--------------------------------------------------------------------------
  4385.   # ● [追加]:ポップアップデータの取得
  4386.   #--------------------------------------------------------------------------
  4387.   def popup_data
  4388.     $game_temp.popup_data
  4389.   end
  4390.   #--------------------------------------------------------------------------
  4391.   # ● [エイリアス]:フレーム更新(基本)
  4392.   #--------------------------------------------------------------------------
  4393.   alias :lnx11a_update_basic :update_basic
  4394.   def update_basic
  4395.     # 元のメソッドを呼ぶ
  4396.     lnx11a_update_basic
  4397.     # 追加したオブジェクトの更新
  4398.     update_targetcursor
  4399.     update_popup
  4400.     refresh_actors
  4401.   end
  4402.   #--------------------------------------------------------------------------
  4403.   # ● [追加]:パーティメンバーの ID 配列の取得
  4404.   #--------------------------------------------------------------------------
  4405.   def party_members
  4406.     $game_party.battle_members.collect {|actor| actor.id }
  4407.   end
  4408.   #--------------------------------------------------------------------------
  4409.   # ● [追加]:メンバーが入れ替わったらオブジェクトを再作成する
  4410.   #--------------------------------------------------------------------------
  4411.   def refresh_actors
  4412.     a_party_members = party_members
  4413.     return if @last_party_members == a_party_members
  4414.     @last_party_members = a_party_members
  4415.     $game_party.battle_members.each {|actor| actor.sprite_effect_type=:appear }
  4416.     reset_sprite_effects
  4417.     @spriteset.dispose_actors
  4418.     @spriteset.create_actors
  4419.     status_clear
  4420.     refresh_status
  4421.     Graphics.frame_reset
  4422.   end
  4423.   #--------------------------------------------------------------------------
  4424.   # ● [追加]:ステータスウィンドウの情報を更新(メンバー交代用)
  4425.   #--------------------------------------------------------------------------
  4426.   def status_clear
  4427.     @status_window.all_clear
  4428.   end
  4429.   #--------------------------------------------------------------------------
  4430.   # ● [追加]:メッセージウィンドウの位置の初期化
  4431.   #  毎フレーム呼び出すことで、イベントコマンド以外のメッセージの位置を
  4432.   # 固定します。
  4433.   #--------------------------------------------------------------------------
  4434.   def standby_message_window_position
  4435.     $game_message.background = LNX11::MESSAGE_WINDOW_BACKGROUND
  4436.     $game_message.position = LNX11::MESSAGE_WINDOW_POSITION
  4437.   end
  4438.   #--------------------------------------------------------------------------
  4439.   # ● [再定義]:メッセージウィンドウを開く処理の更新
  4440.   #    ステータスウィンドウなどが閉じ終わるまでオープン度を 0 にする。
  4441.   #--------------------------------------------------------------------------
  4442.   def update_message_open
  4443.     if $game_message.busy?
  4444.       @party_command_window.close
  4445.       @actor_command_window.close
  4446.       $game_temp.battlelog_clear = true
  4447.     else
  4448.       standby_message_window_position
  4449.     end
  4450.   end
  4451.   #--------------------------------------------------------------------------
  4452.   # ● [追加]:ターゲットカーソル更新
  4453.   #--------------------------------------------------------------------------
  4454.   def update_targetcursor
  4455.     # 選択中のバトラーの座標を設定する
  4456.     if @actor_window.active
  4457.       # アクター選択ウィンドウがアクティブ
  4458.       @targetcursor.set(@actor_window.targetcursor, true)
  4459.     elsif @enemy_window.active
  4460.       # 敵キャラ選択ウィンドウがアクティブ
  4461.       @targetcursor.set(@enemy_window.targetcursor, true)
  4462.     elsif @status_window.index >= 0
  4463.       # ステータスウィンドウがアクティブ
  4464.       @targetcursor.set(@status_window.actor)
  4465.     else
  4466.       # どれもアクティブでない場合は非表示
  4467.       @targetcursor.hide
  4468.     end
  4469.     @targetcursor.update
  4470.   end
  4471.   #--------------------------------------------------------------------------
  4472.   # ● [追加]:ポップアップ更新
  4473.   #--------------------------------------------------------------------------
  4474.   def update_popup
  4475.     # ポップアップスプライトの更新
  4476.     popup_data.update
  4477.   end  
  4478.   #--------------------------------------------------------------------------
  4479.   # ● [エイリアス]:パーティコマンド選択の開始
  4480.   #--------------------------------------------------------------------------
  4481.   alias :lnx11a_start_party_command_selection :start_party_command_selection
  4482.   def start_party_command_selection
  4483.     # 元のメソッドを呼ぶ
  4484.     lnx11a_start_party_command_selection
  4485.     # バトルログ削除
  4486.     @log_window.lines_clear
  4487.     $game_temp.battlelog_clear = LNX11::STORAGE_TURNEND_CLEAR
  4488.     @actor_command = false
  4489.     # 2ターン目以降のパーテイコマンドスキップ
  4490.     return unless @party_command_skip
  4491.     @party_command_skip = false
  4492.     command_fight if !scene_changing? && @party_command_window.active
  4493.   end
  4494.   #--------------------------------------------------------------------------
  4495.   # ● [エイリアス]:アクターコマンド選択の開始
  4496.   #--------------------------------------------------------------------------
  4497.   alias :lnx11a_start_actor_command_selection :start_actor_command_selection
  4498.   def start_actor_command_selection
  4499.     # 元のメソッドを呼ぶ
  4500.     lnx11a_start_actor_command_selection
  4501.     @actor_command = true
  4502.   end
  4503.   #--------------------------------------------------------------------------
  4504.   # ● [エイリアス]:ターン終了
  4505.   #--------------------------------------------------------------------------
  4506.   alias :lnx11a_turn_end :turn_end
  4507.   def turn_end
  4508.     @party_command_skip = (LNX11::PARTY_COMMAND_SKIP && @actor_command)
  4509.     @actor_command = false
  4510.     # 元のメソッドを呼ぶ
  4511.     lnx11a_turn_end
  4512.   end
  4513.   #--------------------------------------------------------------------------
  4514.   # ● [追加]:アクターの選択したアイテム・スキルを返す
  4515.   #--------------------------------------------------------------------------
  4516.   def actor_selection_item
  4517.     case @actor_command_window.current_symbol
  4518.     when :attack ; $data_skills[BattleManager.actor.attack_skill_id]
  4519.     when :skill  ; @skill
  4520.     when :item   ; @item
  4521.     when :guard  ; $data_skills[BattleManager.actor.guard_skill_id]
  4522.     else ; nil
  4523.     end
  4524.   end
  4525.   #--------------------------------------------------------------------------
  4526.   # ● [エイリアス]:コマンド[防御]
  4527.   #--------------------------------------------------------------------------
  4528.   alias :lnx11a_command_guard :command_guard
  4529.   def command_guard
  4530.     if LNX11::GUARD_TARGET_CHECKE
  4531.       BattleManager.actor.input.set_guard
  4532.       # アクター選択
  4533.       select_actor_selection
  4534.     else
  4535.       # 元のメソッドを呼ぶ
  4536.       lnx11a_command_guard
  4537.     end
  4538.   end
  4539.   #--------------------------------------------------------------------------
  4540.   # ● [エイリアス]:アクター選択の開始
  4541.   #--------------------------------------------------------------------------
  4542.   alias :lnx11a_select_actor_selection :select_actor_selection
  4543.   def select_actor_selection
  4544.     # ターゲットチェック
  4545.     @actor_window.set_target(actor_selection_item)
  4546.     # 元のメソッドを呼ぶ
  4547.     lnx11a_select_actor_selection
  4548.     # ターゲットチェック
  4549.     @actor_window.set_target_refresh(actor_selection_item, BattleManager.actor)
  4550.   end
  4551.   #--------------------------------------------------------------------------
  4552.   # ● [エイリアス]:敵キャラ選択の開始
  4553.   #--------------------------------------------------------------------------
  4554.   alias :lnx11a_select_enemy_selection :select_enemy_selection
  4555.   def select_enemy_selection
  4556.     # ターゲットチェック
  4557.     @enemy_window.set_target(actor_selection_item)
  4558.     # 元のメソッドを呼ぶ
  4559.     lnx11a_select_enemy_selection
  4560.     # ターゲットチェック
  4561.     @enemy_window.set_target_refresh(actor_selection_item, BattleManager.actor)
  4562.   end
  4563.   #--------------------------------------------------------------------------
  4564.   # ● [エイリアス]アクター[キャンセル]
  4565.   #--------------------------------------------------------------------------
  4566.   alias :lnx11a_on_actor_cancel :on_actor_cancel
  4567.   def on_actor_cancel
  4568.     # 元のメソッドを呼ぶ
  4569.     lnx11a_on_actor_cancel
  4570.     # 防御の場合
  4571.     case @actor_command_window.current_symbol
  4572.     when :guard
  4573.       @actor_command_window.activate
  4574.     end   
  4575.   end
  4576.   #--------------------------------------------------------------------------
  4577.   # ● [エイリアス]:攻撃アニメーションの表示
  4578.   #--------------------------------------------------------------------------
  4579.   alias :lnx11a_show_attack_animation :show_attack_animation
  4580.   def show_attack_animation(targets)
  4581.     if @subject.actor?
  4582.       lnx11a_show_attack_animation(targets)
  4583.     else
  4584.       # 敵の通常攻撃アニメーション
  4585.       show_normal_animation(targets, @subject.atk_animation, false)
  4586.     end
  4587.   end
  4588. end

  4589. #==============================================================================
  4590. # ■ LNX11_Window_ActiveVisible
  4591. #------------------------------------------------------------------------------
  4592. #  バトル画面でターゲット選択中にウィンドウを非表示にするための
  4593. # ウィンドウ用モジュールです。
  4594. # ウィンドウの active と visible を連動させる役割があります。
  4595. # Window_ActorCommand,Window_BattleSkill, Window_BattleItem で
  4596. # インクルードされます。
  4597. #==============================================================================

  4598. module LNX11_Window_ActiveVisible
  4599.   #--------------------------------------------------------------------------
  4600.   # ● [オーバーライド]:ウィンドウのアクティブ化
  4601.   #--------------------------------------------------------------------------
  4602.   def activate
  4603.     self.show
  4604.     super
  4605.   end
  4606.   #--------------------------------------------------------------------------
  4607.   # ● [オーバーライド]:ウィンドウの非アクティブ化
  4608.   #--------------------------------------------------------------------------
  4609.   def deactivate
  4610.     @help_window != nil ? self.hide : self.visible = false
  4611.     super
  4612.   end
  4613. end

  4614. #==============================================================================
  4615. # ■ LNX11_Window_FittingList
  4616. #------------------------------------------------------------------------------
  4617. #  バトル画面のスキルリスト・アイテムリストを項目数に合わせてリサイズする
  4618. # ウィンドウ用モジュールです。
  4619. # Window_BattleSkill, Window_BattleItem でインクルードされます。
  4620. #==============================================================================

  4621. module LNX11_Window_FittingList
  4622.   #--------------------------------------------------------------------------
  4623.   # ● [追加]:ウィンドウの高さ(最大)
  4624.   #--------------------------------------------------------------------------
  4625.   def max_height
  4626.     @info_viewport.rect.y - @help_window.height
  4627.   end
  4628.   #--------------------------------------------------------------------------
  4629.   # ● [オーバーライド]:リフレッシュ
  4630.   #--------------------------------------------------------------------------
  4631.   def refresh
  4632.     make_item_list
  4633.     self.height = [fitting_height(row_max), max_height].min
  4634.     super
  4635.     self.oy = 0
  4636.   end
  4637. end
  4638.   
  4639. #==============================================================================
  4640. # ■ LNX11_Window_TargetHelp
  4641. #------------------------------------------------------------------------------
  4642. #  バトル画面で、ターゲット選択中にヘルプウィンドウを表示するための
  4643. # ウィンドウ用モジュールです。
  4644. # Window_BattleActor, Window_BattleEnemy でインクルードされます。
  4645. #==============================================================================

  4646. module LNX11_Window_TargetHelp
  4647.   #--------------------------------------------------------------------------
  4648.   # ● [追加]:ターゲットチェック
  4649.   #--------------------------------------------------------------------------
  4650.   def set_target(actor_selection_item)
  4651.     @cursor_fix = @cursor_all = @cursor_random = false
  4652.     item = actor_selection_item
  4653.     if actor_selection_item && !item.lnx11a_need_selection?
  4654.       # カーソルを固定
  4655.       @cursor_fix = true
  4656.       # 全体
  4657.       @cursor_all = item.for_all?
  4658.       # ランダム
  4659.       if item.for_random?
  4660.         @cursor_all = true
  4661.         @cursor_random = true
  4662.         @random_number = item.number_of_targets
  4663.       end
  4664.     end
  4665.     # 戦闘不能の味方が対象か?
  4666.     @dead_friend = item.for_dead_friend?
  4667.   end
  4668.   #--------------------------------------------------------------------------
  4669.   # ● [追加]:ターゲットチェック(リフレッシュ後)
  4670.   #--------------------------------------------------------------------------
  4671.   def set_target_refresh(actor_selection_item, actor)
  4672.     item = actor_selection_item
  4673.     # 使用者が対象なら、使用者にカーソルを合わせる
  4674.     select($game_party.members.index(actor)) if @cursor_fix && item.for_user?
  4675.   end
  4676.   #--------------------------------------------------------------------------
  4677.   # ● [オーバーライド]:ウィンドウの表示
  4678.   #--------------------------------------------------------------------------
  4679.   def show
  4680.     @help_window.show
  4681.     super
  4682.   end
  4683.   #--------------------------------------------------------------------------
  4684.   # ● [オーバーライド]:ウィンドウの非表示
  4685.   #--------------------------------------------------------------------------
  4686.   def hide
  4687.     @help_window.hide
  4688.     super
  4689.   end
  4690. end

  4691. #==============================================================================
  4692. # ■ [追加]:Window_TargetHelp
  4693. #------------------------------------------------------------------------------
  4694. #  ターゲットの名前情報やスキルやアイテムの名前を表示します。
  4695. #==============================================================================

  4696. class Window_TargetHelp < Window_Help
  4697.   #--------------------------------------------------------------------------
  4698.   # ● 公開インスタンス変数
  4699.   #--------------------------------------------------------------------------
  4700.   attr_accessor :random_number  # 効果範囲ランダムの数
  4701.   #--------------------------------------------------------------------------
  4702.   # ● [オーバーライド]:オブジェクト初期化
  4703.   #--------------------------------------------------------------------------
  4704.   def initialize
  4705.     super(1) # 1行ヘルプ
  4706.   end
  4707.   #--------------------------------------------------------------------------
  4708.   # ● [オーバーライド]:ウィンドウの非表示
  4709.   #--------------------------------------------------------------------------
  4710.   def hide
  4711.     super
  4712.     clear
  4713.   end
  4714.   #--------------------------------------------------------------------------
  4715.   # ● [オーバーライド]:アイテム名設定
  4716.   #     item : スキル、アイテム、バトラー等
  4717.   #--------------------------------------------------------------------------
  4718.   def set_item(item)
  4719.     set_text(item ? item : "") # itemの説明ではなく、item自体を渡すようにする
  4720.   end
  4721.   #--------------------------------------------------------------------------
  4722.   # ● ゲージ幅
  4723.   #--------------------------------------------------------------------------
  4724.   def gauge_width
  4725.     LNX11::HELP_PARAM_WIDTH
  4726.   end
  4727.   #--------------------------------------------------------------------------
  4728.   # ● ゲージ幅(余白を含む)
  4729.   #--------------------------------------------------------------------------  
  4730.   def gauge_width_spacing
  4731.     LNX11::HELP_PARAM_WIDTH + 4
  4732.   end
  4733.   #--------------------------------------------------------------------------
  4734.   # ● パラメータエリアの幅
  4735.   #--------------------------------------------------------------------------  
  4736.   def param_width(size)
  4737.     gauge_width_spacing * size
  4738.   end
  4739.   #--------------------------------------------------------------------------
  4740.   # ● 効果範囲ランダムの数の取得
  4741.   #--------------------------------------------------------------------------
  4742.   def random_number
  4743.     # 全角にして返す
  4744.     @random_number.to_s.tr('0-9','0-9')
  4745.   end
  4746.   #--------------------------------------------------------------------------
  4747.   # ● [オーバーライド]:リフレッシュ
  4748.   #--------------------------------------------------------------------------
  4749.   def refresh
  4750.     contents.clear
  4751.     if @text == :party
  4752.       draw_text(contents.rect, "我方全体", 1)
  4753.     elsif @text == :troop
  4754.       draw_text(contents.rect, "敌全体", 1)
  4755.     elsif @text == :troop_random
  4756.       case LNX11::RANDOMSCOPE_DISPLAY
  4757.       when 0 ; draw_text(contents.rect, "敌全体 随机", 1)
  4758.       when 1 ; draw_text(contents.rect, "#{random_number}名敌人 随机", 1)
  4759.       end
  4760.     elsif @text.is_a?(Game_Battler)
  4761.       # 選択対象の情報を描画
  4762.       draw_target_info
  4763.     elsif @text.is_a?(RPG::UsableItem)
  4764.       # アイテムかスキルならアイテム名を描画
  4765.       draw_item_name_help(@text)
  4766.     else
  4767.       # 通常のテキスト
  4768.       super
  4769.     end
  4770.   end
  4771.   #--------------------------------------------------------------------------
  4772.   # ● 選択対象の情報の描画
  4773.   #--------------------------------------------------------------------------
  4774.   def draw_target_info
  4775.     # バトラー情報の描画
  4776.     param = @text.actor? ? LNX11::HELP_ACTOR_PARAM : LNX11::HELP_ENEMY_PARAM
  4777.     # ゲージ付きステータス配列
  4778.     status = [param[:hp],param[:mp],param[:tp]&&$data_system.opt_display_tp]
  4779.     # 名前
  4780.     x = contents_width / 2 - contents.text_size(@text.name).width / 2
  4781.     name_width = contents.text_size(@text.name).width + 4
  4782.     if !status.include?(true)
  4783.       # ゲージ付きステータスを描画しない場合
  4784.       draw_targethelp_name(@text, x, name_width, param[:hp])
  4785.       x += name_width
  4786.       state_width = contents_width - x
  4787.     else
  4788.       # ゲージ付きステータスを描画する場合
  4789.       status.delete(false)
  4790.       x -= param_width(status.size) / 2
  4791.       draw_targethelp_name(@text, x, name_width, param[:hp])
  4792.       x += name_width
  4793.       state_width = contents_width - x - param_width(status.size)
  4794.     end
  4795.     # ステートアイコン
  4796.     if param[:state]
  4797.       draw_actor_icons(@text, x, 0, state_width)
  4798.     end
  4799.     # パラメータの描画
  4800.     x = contents_width - param_width(status.size)
  4801.     # HP
  4802.     if param[:hp]
  4803.       draw_actor_hp(@text, x, 0, gauge_width)
  4804.       x += gauge_width_spacing
  4805.     end
  4806.     # MP
  4807.     if param[:mp]
  4808.       draw_actor_mp(@text, x, 0, gauge_width)
  4809.       x += gauge_width_spacing
  4810.     end
  4811.     # TP
  4812.     if param[:tp] && $data_system.opt_display_tp
  4813.       draw_actor_tp(@text, x, 0, gauge_width)
  4814.       x += gauge_width_spacing
  4815.     end
  4816.   end
  4817.   #--------------------------------------------------------------------------
  4818.   # ● ターゲットの名前描画
  4819.   #--------------------------------------------------------------------------
  4820.   def draw_targethelp_name(actor, x, name_width, hp)
  4821.     if hp
  4822.       # HPゲージを伴う場合(HPが少ない場合、名前の色が変化する)
  4823.       draw_actor_name(actor, x, 0, name_width)
  4824.     else
  4825.       text = actor.name
  4826.       draw_text(x, 0, text_size(text).width + 4, line_height, text)
  4827.     end
  4828.   end
  4829.   #--------------------------------------------------------------------------
  4830.   # ● アイテムの描画(中央揃え)
  4831.   #--------------------------------------------------------------------------
  4832.   def draw_item_name_help(item)
  4833.     case LNX11::HELPDISPLAY_TYPE
  4834.     when 0 # アイコン+名前
  4835.       w = contents.text_size(@text.name).width + 28
  4836.     when 1 # 名前のみ
  4837.       w = contents.text_size(@text.name).width + 4
  4838.     end
  4839.     # 簡易説明文の描画
  4840.     if !@text.short_description.empty?
  4841.       des = LNX11::HELPDISPLAY_DESCRIPTION
  4842.       contents.font.size = des[:size]
  4843.       text = des[:delimiter] + @text.short_description
  4844.       rect = contents.text_size(text)
  4845.       w += rect.width
  4846.       x = (contents_width - w) / 2
  4847.       y = (line_height - rect.height) / 2
  4848.       draw_text(x, y, w, line_height, text, 2)
  4849.       reset_font_settings
  4850.     end
  4851.     # 名前の描画
  4852.     x = (contents_width - w) / 2
  4853.     case LNX11::HELPDISPLAY_TYPE
  4854.     when 0 # アイコン+名前
  4855. #      draw_item_name(@text, x, 0, true, w)
  4856.       draw_item_name(@text, x, 0, true, w)
  4857.     when 1 # 名前のみ
  4858.       draw_text(x, 0, contents_width, line_height, @text.name)
  4859.     end
  4860.   end
  4861. end

  4862. #==============================================================================
  4863. # ■ Window_PartyCommand
  4864. #------------------------------------------------------------------------------
  4865. #  バトル画面で、戦うか逃げるかを選択するウィンドウです。
  4866. #==============================================================================

  4867. class Window_PartyCommand < Window_Command
  4868.   #--------------------------------------------------------------------------
  4869.   # ● [エイリアス]:オブジェクト初期化
  4870.   #--------------------------------------------------------------------------
  4871.   alias :lnx11a_initialize :initialize
  4872.   def initialize
  4873.     $game_party.last_party_command = nil
  4874.     # 元のメソッドを呼ぶ
  4875.     lnx11a_initialize
  4876.     # 座標を設定
  4877.     self.x = LNX11::PARTY_COMMAND_XY[:x]
  4878.     self.y = LNX11::PARTY_COMMAND_XY[:y]
  4879.   end
  4880.   #--------------------------------------------------------------------------
  4881.   # ● [オーバーライド]:ウィンドウ幅の取得
  4882.   #--------------------------------------------------------------------------
  4883.   def window_width
  4884.     return LNX11::PARTY_COMMAND_WIDTH
  4885.   end
  4886.   #--------------------------------------------------------------------------
  4887.   # ● [オーバーライド]:表示行数の取得
  4888.   #--------------------------------------------------------------------------
  4889.   def visible_line_number
  4890.     return LNX11::PARTY_COMMAND_HORIZON ? 1 : @list.size
  4891.   end
  4892.   #--------------------------------------------------------------------------
  4893.   # ● [オーバーライド]:桁数の取得
  4894.   #--------------------------------------------------------------------------
  4895.   def col_max
  4896.     return LNX11::PARTY_COMMAND_HORIZON ? @list.size : 1
  4897.   end
  4898.   #--------------------------------------------------------------------------
  4899.   # ● [オーバーライド]:アライメントの取得
  4900.   #--------------------------------------------------------------------------
  4901.   def alignment
  4902.     return LNX11::PARTY_COMMAND_ALIGNMENT
  4903.   end
  4904.   #--------------------------------------------------------------------------
  4905.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  4906.   #--------------------------------------------------------------------------
  4907.   def spacing
  4908.     return 8
  4909.   end
  4910.   #--------------------------------------------------------------------------
  4911.   # ● [オーバーライド]:ウィンドウを開く
  4912.   #--------------------------------------------------------------------------
  4913.   def open
  4914.     super
  4915.     # 最後に選択したコマンドを選択
  4916.     return self unless LNX11::LAST_PARTY_COMMAND
  4917.     last_command = $game_party.last_party_command
  4918.     if last_command && @list.include?(last_command)
  4919.       select(@list.index(last_command))
  4920.     end
  4921.     self
  4922.   end
  4923.   #--------------------------------------------------------------------------
  4924.   # ● [エイリアス]:ウィンドウを閉じる
  4925.   #--------------------------------------------------------------------------
  4926.   def close
  4927.     super
  4928.     # 選択したコマンドを記憶
  4929.     $game_party.last_party_command = @list[index] if index >= 0
  4930.     self
  4931.   end
  4932. end

  4933. #==============================================================================
  4934. # ■ Window_ActorCommand
  4935. #------------------------------------------------------------------------------
  4936. #  バトル画面で、アクターの行動を選択するウィンドウです。
  4937. #==============================================================================

  4938. class Window_ActorCommand < Window_Command
  4939.   include LNX11_Window_ActiveVisible
  4940.   #--------------------------------------------------------------------------
  4941.   # ● [オーバーライド]:ウィンドウ幅の取得
  4942.   #--------------------------------------------------------------------------
  4943.   def window_width
  4944.     return LNX11::ACTOR_COMMAND_WIDTH
  4945.   end
  4946.   #--------------------------------------------------------------------------
  4947.   # ● [オーバーライド]:表示行数の取得
  4948.   #--------------------------------------------------------------------------
  4949.   def visible_line_number
  4950.     list_size = LNX11::ACTOR_COMMAND_NOSCROLL ? @list.size : 4
  4951.     return LNX11::ACTOR_COMMAND_HORIZON ? 1 : list_size
  4952.   end
  4953.   #--------------------------------------------------------------------------
  4954.   # ● [オーバーライド]:桁数の取得
  4955.   #--------------------------------------------------------------------------
  4956.   def col_max
  4957.     return LNX11::ACTOR_COMMAND_HORIZON ? [@list.size, 1].max :  1
  4958.   end
  4959.   #--------------------------------------------------------------------------
  4960.   # ● [オーバーライド]:アライメントの取得
  4961.   #--------------------------------------------------------------------------
  4962.   def alignment
  4963.     return LNX11::ACTOR_COMMAND_ALIGNMENT
  4964.   end
  4965.   #--------------------------------------------------------------------------
  4966.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  4967.   #--------------------------------------------------------------------------
  4968.   def spacing
  4969.     return 8
  4970.   end
  4971.   #--------------------------------------------------------------------------
  4972.   # ● [追加]:X 座標をアクターに合わせる
  4973.   #--------------------------------------------------------------------------
  4974.   def actor_x(actor)
  4975.     ax = $game_party.members_screen_x_nooffset[actor.index] - self.width / 2
  4976.     pad = LNX11::STATUS_SIDE_PADDING / 2
  4977.     # 画面内に収める
  4978.     self.x = [[ax, pad].max, Graphics.width - pad - self.width].min
  4979.     self.x += LNX11::ACTOR_COMMAND_OFFSET[:x]
  4980.   end
  4981.   #--------------------------------------------------------------------------
  4982.   # ● [追加]:Y 座標をアクターに合わせる
  4983.   #--------------------------------------------------------------------------
  4984.   def actor_y(actor)
  4985.     self.y = actor.screen_y_top - self.height
  4986.     self.y += LNX11::ACTOR_COMMAND_OFFSET[:y]
  4987.   end
  4988.   #--------------------------------------------------------------------------
  4989.   # ● [追加]:固定 Y 座標
  4990.   #--------------------------------------------------------------------------
  4991.   def screen_y
  4992.     if LNX11::ACTOR_COMMAND_Y_POSITION == 0
  4993.       self.y = Graphics.height - self.height + LNX11::ACTOR_COMMAND_OFFSET[:y]
  4994.     else
  4995.       self.y = LNX11::ACTOR_COMMAND_OFFSET[:y]
  4996.     end
  4997.   end
  4998.   #--------------------------------------------------------------------------
  4999.   # ● [エイリアス]:セットアップ
  5000.   #--------------------------------------------------------------------------
  5001.   alias :lnx11a_setup :setup
  5002.   def setup(actor)
  5003.     # 前のアクターのコマンドを記憶
  5004.     @actor.last_actor_command = @list[index] if @actor
  5005.     # 元のメソッドを呼ぶ
  5006.     lnx11a_setup(actor)
  5007.     self.arrows_visible = !LNX11::ACTOR_COMMAND_NOSCROLL
  5008.     self.height = window_height
  5009.     self.oy = 0
  5010.     # アクターコマンドの表示位置で分岐
  5011.     case LNX11::ACTOR_COMMAND_POSITION
  5012.     when 0
  5013.       # アクターの頭上
  5014.       actor_x(actor)
  5015.       actor_y(actor)
  5016.     when 1
  5017.       # Y 座標固定
  5018.       actor_x(actor)
  5019.       screen_y
  5020.     when 2
  5021.       # XY固定
  5022.       self.x = LNX11::ACTOR_COMMAND_OFFSET[:x]
  5023.       screen_y
  5024.     end
  5025.     # 最後に選択したコマンドを選択
  5026.     return unless LNX11::LAST_ACTOR_COMMAND
  5027.     last_command = @actor.last_actor_command
  5028.     if last_command && @list.include?(last_command)
  5029.       select(@list.index(last_command))
  5030.     end
  5031.   end
  5032. end

  5033. #==============================================================================
  5034. # ■ Window_BattleStatus
  5035. #------------------------------------------------------------------------------
  5036. #  バトル画面で、パーティメンバーのステータスを表示するウィンドウです。
  5037. #==============================================================================

  5038. class Window_BattleStatus < Window_Selectable
  5039.   #--------------------------------------------------------------------------
  5040.   # ● [追加]:公開インスタンス変数
  5041.   #--------------------------------------------------------------------------
  5042.   attr_reader :min_offset   # ステータス描画 X 座標の位置修正
  5043.   #--------------------------------------------------------------------------
  5044.   # ● [エイリアス]:オブジェクト初期化
  5045.   #--------------------------------------------------------------------------
  5046.   alias :lnx11a_initialize :initialize
  5047.   def initialize
  5048.     @actor_last_status = Array.new($game_party.max_battle_members) { nil }   
  5049.     # 元のメソッドを呼ぶ
  5050.     lnx11a_initialize
  5051.     # ウィンドウを最初から表示
  5052.     self.openness = 255
  5053.     self.opacity = 0
  5054.     update_invisible
  5055.   end
  5056.   #--------------------------------------------------------------------------
  5057.   # ● [オーバーライド]:行の高さを取得
  5058.   #--------------------------------------------------------------------------
  5059.   def line_height
  5060.     return LNX11::STATUS_LINE_HEIGHT
  5061.   end
  5062.   #--------------------------------------------------------------------------
  5063.   # ● [オーバーライド]:標準パディングサイズの取得
  5064.   #--------------------------------------------------------------------------
  5065.   def standard_padding
  5066.     return 0
  5067.   end
  5068.   #--------------------------------------------------------------------------
  5069.   # ● [オーバーライド]:表示行数の取得
  5070.   #--------------------------------------------------------------------------
  5071.   def visible_line_number
  5072.     return $data_system.opt_display_tp ? 4 : 3
  5073.   end
  5074.   #--------------------------------------------------------------------------
  5075.   # ● [オーバーライド]:桁数の取得
  5076.   #--------------------------------------------------------------------------
  5077.   def col_max
  5078.     return [item_max, 1].max
  5079.   end
  5080.   #--------------------------------------------------------------------------
  5081.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  5082.   #--------------------------------------------------------------------------
  5083.   def spacing
  5084.     return 0
  5085.   end
  5086.   #--------------------------------------------------------------------------
  5087.   # ● [オーバーライド]:項目の高さを取得
  5088.   #--------------------------------------------------------------------------
  5089.   def item_height
  5090.     self.height
  5091.   end  
  5092.   #--------------------------------------------------------------------------
  5093.   # ● [再定義]:ウィンドウ幅の取得
  5094.   #--------------------------------------------------------------------------
  5095.   def window_width
  5096.     Graphics.width
  5097.   end
  5098.   #--------------------------------------------------------------------------
  5099.   # ● [エイリアス]:ウィンドウ高さの取得
  5100.   #--------------------------------------------------------------------------
  5101.   alias :lnx11a_window_height :window_height
  5102.   def window_height
  5103.     # 一行目(名前・ステート)の高さを確保する
  5104.     lnx11a_window_height - line_height + [24, line_height].max
  5105.   end
  5106.   #--------------------------------------------------------------------------
  5107.   # ● [オーバーライド]:カーソルの更新
  5108.   #--------------------------------------------------------------------------
  5109.   def update_cursor
  5110.     # カーソルを表示しない
  5111.     cursor_rect.empty
  5112.   end
  5113.   #--------------------------------------------------------------------------
  5114.   # ● [オーバーライド]:システム色の取得
  5115.   #  ゲージ幅が短すぎる場合、HP,MP,TP の文字を非表示にします。
  5116.   #--------------------------------------------------------------------------
  5117.   def system_color
  5118.     gauge_area_width - @min_offset >= 52 ? super : Color.new
  5119.   end  
  5120.   #--------------------------------------------------------------------------
  5121.   # ● [オーバーライド]:ゲージ背景色の取得
  5122.   #   ゲージの透明度を適用します。  
  5123.   #--------------------------------------------------------------------------
  5124.   def gauge_back_color
  5125.     color = super
  5126.     color.alpha *= LNX11::STATUS_GAUGE_OPACITY / 255.0
  5127.     color
  5128.   end
  5129.   #--------------------------------------------------------------------------
  5130.   # ● [オーバーライド]:ゲージの描画
  5131.   #   ゲージの透明度を適用します。
  5132.   #--------------------------------------------------------------------------
  5133.   def draw_gauge(x, y, width, rate, color1, color2)
  5134.     oparate = LNX11::STATUS_GAUGE_OPACITY / 255.0
  5135.     color1.alpha *= oparate
  5136.     color2.alpha *= oparate
  5137.     super
  5138.   end
  5139.   #--------------------------------------------------------------------------
  5140.   # ● [オーバーライド]:フレーム更新
  5141.   #--------------------------------------------------------------------------
  5142.   def update
  5143.     super
  5144.     update_invisible
  5145.   end
  5146.   #--------------------------------------------------------------------------
  5147.   # ● [追加]:表示状態更新
  5148.   #--------------------------------------------------------------------------
  5149.   def update_invisible
  5150.     self.contents_opacity = $game_party.status_invisible ? 0 : 255
  5151.   end  
  5152.   #--------------------------------------------------------------------------
  5153.   # ● [追加]:アクターオブジェクト取得
  5154.   #--------------------------------------------------------------------------
  5155.   def actor
  5156.     $game_party.members[@index]
  5157.   end
  5158.   #--------------------------------------------------------------------------
  5159.   # ● [追加]:座標の設定
  5160.   #--------------------------------------------------------------------------
  5161.   def set_xy
  5162.     # ステータス位置の調整:画面からはみ出ないようにする
  5163.     pw = $game_party.members_screen_x.last + LNX11::STATUS_OFFSET[:x]
  5164.     pw += gauge_area_width / 2
  5165.     right_end = Graphics.width - LNX11::STATUS_SIDE_PADDING
  5166.     min_offset = pw > right_end ? pw - right_end : 0
  5167.     # ステータスのオフセットを適用
  5168.     self.x = LNX11::STATUS_OFFSET[:x] - min_offset
  5169.     self.y = LNX11::STATUS_OFFSET[:y] + Graphics.height - self.height
  5170.     # ステータス幅の自動調整:位置を調整した分だけ幅を縮める
  5171.     @min_offset = LNX11::STATUS_AUTOADJUST ? min_offset : 0
  5172.   end
  5173.   #--------------------------------------------------------------------------
  5174.   # ● [再定義]:ゲージエリアの幅を取得
  5175.   #--------------------------------------------------------------------------
  5176.   def gauge_area_width
  5177.     return LNX11::STATUS_WIDTH
  5178.   end
  5179.   #--------------------------------------------------------------------------
  5180.   # ● [追加]:表示するステート数の取得
  5181.   #--------------------------------------------------------------------------
  5182.   def states(actor, width)
  5183.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  5184.     icons.size
  5185.   end
  5186.   #--------------------------------------------------------------------------
  5187.   # ● [追加]:名前とステートの描画(1行表示)
  5188.   #  width の範囲で名前を左揃え、ステートアイコンを右揃えで描画します。
  5189.   # ステートを優先して表示するため、アイコンが多すぎて名前の表示領域が
  5190.   # 極端に狭くなる場合は名前を描画しません。
  5191.   #--------------------------------------------------------------------------
  5192.   def draw_actor_name_with_icons(actor, x, y, width = 128, draw_name = true)
  5193.     # アイコンのY座標補正
  5194.     iy = ([line_height, 24].max - 24) / 2
  5195.     # 名前のY座標補正
  5196.     ny = ([line_height, 24].max - LNX11::STATUS_NAME_SIZE) / 2
  5197.     # 表示するステート数を取得
  5198.     icon = states(actor, width)
  5199.     if icon > 0
  5200.       # 表示するべきステートがある場合
  5201.       name_width = width - icon * 24
  5202.       ix = x + width - icon * 24
  5203.       if name_width >= contents.font.size * 2 && draw_name
  5204.         # 名前の表示領域(width) が フォントサイズ * 2 以上なら両方を描画
  5205.         draw_actor_name(actor, x, y + ny,  name_width)
  5206.         iw = width - name_width
  5207.         draw_actor_icons(actor, ix, y + iy, iw)
  5208.       else
  5209.         # ステートのみ描画
  5210.         draw_actor_icons(actor, ix, y + iy, width)
  5211.       end
  5212.     elsif draw_name
  5213.       # ない場合、名前のみ描画
  5214.       draw_actor_name(actor, x, y + ny, width)
  5215.     end
  5216.   end
  5217.   #--------------------------------------------------------------------------
  5218.   # ● [再定義]:リフレッシュ
  5219.   #--------------------------------------------------------------------------
  5220.   def refresh
  5221.     set_xy
  5222.     draw_all_items
  5223.   end
  5224.   #--------------------------------------------------------------------------
  5225.   # ● [オーバーライド]:項目を描画する矩形の取得
  5226.   #--------------------------------------------------------------------------
  5227.   def item_rect(index)
  5228.     rect = super
  5229.     rect.x = $game_party.members_screen_x[index] - gauge_area_width / 2
  5230.     rect.width = gauge_area_width
  5231.     rect
  5232.   end
  5233.   #--------------------------------------------------------------------------
  5234.   # ● [再定義]:基本エリアの矩形を取得
  5235.   #--------------------------------------------------------------------------
  5236.   def basic_area_rect(index)
  5237.     rect = item_rect(index)
  5238.     rect
  5239.   end
  5240.   #--------------------------------------------------------------------------
  5241.   # ● [再定義]:ゲージエリアの矩形を取得
  5242.   #--------------------------------------------------------------------------
  5243.   def gauge_area_rect(index)
  5244.     rect = basic_area_rect(index)
  5245.     rect.y += [24, line_height].max
  5246.     rect.x += @min_offset
  5247.     rect
  5248.   end
  5249.   #--------------------------------------------------------------------------
  5250.   # ● [再定義]:基本エリアの描画
  5251.   #--------------------------------------------------------------------------
  5252.   def draw_basic_area(rect, actor)
  5253.     # フォントサイズ変更
  5254.     contents.font.size = [LNX11::STATUS_NAME_SIZE, 8].max
  5255.     # 名前とステートを描画
  5256.     dn = LNX11::STATUS_NAME_SIZE > 0 # 名前を描画するか?
  5257.     width = gauge_area_width - @min_offset
  5258.     rest  = width % 24
  5259.     width += 24 - rest if rest > 0
  5260.     draw_actor_name_with_icons(actor, rect.x, rect.y, width, dn)
  5261.     # フォントサイズを元に戻す
  5262.     reset_font_settings
  5263.   end
  5264.   #--------------------------------------------------------------------------
  5265.   # ● [エイリアス]:ゲージエリアの描画
  5266.   #--------------------------------------------------------------------------
  5267.   alias :lnx11a_draw_gauge_area :draw_gauge_area
  5268.   def draw_gauge_area(*args)
  5269.     # フォントサイズ変更
  5270.     contents.font.size = LNX11::STATUS_PARAM_SIZE
  5271.     # 元のメソッドを呼ぶ
  5272.     lnx11a_draw_gauge_area(*args)
  5273.     # フォントサイズを元に戻す
  5274.     reset_font_settings
  5275.   end
  5276.   #--------------------------------------------------------------------------
  5277.   # ● [再定義]:ゲージエリアの描画(TP あり)
  5278.   #--------------------------------------------------------------------------
  5279.   def draw_gauge_area_with_tp(rect, actor)
  5280.     width = gauge_area_width - @min_offset
  5281.     draw_actor_hp(actor, rect.x, rect.y,                   width)
  5282.     draw_actor_mp(actor, rect.x, rect.y + line_height,     width)
  5283.     draw_actor_tp(actor, rect.x, rect.y + line_height * 2, width)
  5284.   end
  5285.   #--------------------------------------------------------------------------
  5286.   # ● [再定義]:ゲージエリアの描画(TP なし)
  5287.   #--------------------------------------------------------------------------
  5288.   def draw_gauge_area_without_tp(rect, actor)
  5289.     draw_actor_hp(actor, rect.x, rect.y,               gauge_area_width)
  5290.     draw_actor_mp(actor, rect.x, rect.y + line_height, gauge_area_width)
  5291.   end
  5292.   #--------------------------------------------------------------------------
  5293.   # ● [再定義]:項目の描画
  5294.   #--------------------------------------------------------------------------
  5295.   def draw_item(index)
  5296.     actor = $game_party.battle_members[index]
  5297.     a_status = status(actor)
  5298.     # ステータスが変化した場合のみ描画する
  5299.     return if @actor_last_status[index] == a_status
  5300.     @actor_last_status[index] = a_status
  5301.     contents.clear_rect(item_rect(index))
  5302.     draw_basic_area(basic_area_rect(index), actor)
  5303.     draw_gauge_area(gauge_area_rect(index), actor)
  5304.   end
  5305.   #--------------------------------------------------------------------------
  5306.   # ● [追加]:アクターのステータス配列を返す
  5307.   #--------------------------------------------------------------------------
  5308.   def status(actor)
  5309.     if $data_system.opt_display_tp
  5310.       return [actor.name, actor.state_icons + actor.buff_icons,
  5311.               actor.mhp, actor.hp, actor.mmp, actor.mp, actor.max_tp, actor.tp]
  5312.     else
  5313.       # TP を除くステータス配列
  5314.       return [actor.name, actor.state_icons + actor.buff_icons,
  5315.               actor.mhp, actor.hp, actor.mmp, actor.mp]
  5316.     end
  5317.   end
  5318.   #--------------------------------------------------------------------------
  5319.   # ● [追加]:内容の消去
  5320.   #--------------------------------------------------------------------------
  5321.   def all_clear
  5322.     contents.clear
  5323.     @actor_last_status = Array.new($game_party.max_battle_members) { nil }   
  5324.   end
  5325. end

  5326. #==============================================================================
  5327. # ■ Window_BattleActor
  5328. #------------------------------------------------------------------------------
  5329. #  バトル画面で、行動対象のアクターを選択するウィンドウです。
  5330. # XPスタイルバトルではバトルステータスを非表示にしないため、
  5331. # 選択機能だけを持つ不可視のウィンドウとして扱います。
  5332. #==============================================================================

  5333. class Window_BattleActor < Window_BattleStatus
  5334.   include LNX11_Window_TargetHelp
  5335.   #--------------------------------------------------------------------------
  5336.   # ● [エイリアス]:オブジェクト初期化
  5337.   #--------------------------------------------------------------------------
  5338.   alias :lnx11a_wba_initialize :initialize
  5339.   def initialize(info_viewport)
  5340.     # 元のメソッドを呼ぶ
  5341.     lnx11a_wba_initialize(info_viewport)
  5342.     # ウィンドウを画面外に移動
  5343.     self.y = Graphics.height
  5344.   end
  5345.   #--------------------------------------------------------------------------
  5346.   # ● [オーバーライド]:ヘルプテキスト更新
  5347.   #--------------------------------------------------------------------------
  5348.   def update_help
  5349.     @help_window.set_item(targetcursor)
  5350.   end
  5351.   #--------------------------------------------------------------------------
  5352.   # ● [追加]:ターゲットカーソルに渡すオブジェクト
  5353.   #--------------------------------------------------------------------------
  5354.   def targetcursor
  5355.     @cursor_all ? :party : actor
  5356.   end
  5357.   #--------------------------------------------------------------------------
  5358.   # ● [オーバーライド]:ウィンドウ幅の取得
  5359.   #--------------------------------------------------------------------------
  5360.   def window_width
  5361.     64
  5362.   end
  5363.   #--------------------------------------------------------------------------
  5364.   # ● [オーバーライド]:全項目の描画
  5365.   #--------------------------------------------------------------------------
  5366.   def draw_all_items
  5367.     # 何もしない   
  5368.   end
  5369.   #--------------------------------------------------------------------------
  5370.   # ● [オーバーライド]:項目の描画
  5371.   #--------------------------------------------------------------------------
  5372.   def draw_item(index)
  5373.     # 何もしない
  5374.   end
  5375.   #--------------------------------------------------------------------------
  5376.   # ● [オーバーライド]:リフレッシュ
  5377.   #--------------------------------------------------------------------------
  5378.   def refresh
  5379.     # 何もしない
  5380.   end
  5381.   #--------------------------------------------------------------------------
  5382.   # ● [エイリアス]:ウィンドウの表示
  5383.   #--------------------------------------------------------------------------
  5384.   alias :lnx11a_show :show
  5385.   def show
  5386.     # 元のメソッドを呼ぶ
  5387.     lnx11a_show
  5388.     # 最後に選択したアクターを選択
  5389.     last_target = $game_temp.last_target_cursor[:actor]
  5390.     if last_target && $game_party.members.include?(last_target) &&
  5391.        LNX11::LAST_TARGET
  5392.       select($game_party.members.index(last_target))
  5393.     end
  5394.     # スマートターゲットセレクト
  5395.     if LNX11::SMART_TARGET_SELECT && !@cursor_fix
  5396.       if @dead_friend && (!last_target || last_target && last_target.alive?)
  5397.         dead_actor = $game_party.dead_members[0]
  5398.         select($game_party.members.index(dead_actor)) if dead_actor
  5399.       elsif !@dead_friend && (!last_target || last_target && last_target.dead?)
  5400.         alive_actor = $game_party.alive_members[0]
  5401.         select($game_party.members.index(alive_actor)) if alive_actor
  5402.       end
  5403.     end
  5404.     self
  5405.   end
  5406.   #--------------------------------------------------------------------------
  5407.   # ● [エイリアス]:ウィンドウの非表示
  5408.   #--------------------------------------------------------------------------
  5409.   alias :lnx11a_hide :hide
  5410.   def hide
  5411.     # 元のメソッドを呼ぶ
  5412.     lnx11a_hide
  5413.     # 選択したアクターを記憶
  5414.     $game_temp.last_target_cursor[:actor] = actor
  5415.     self
  5416.   end
  5417. end

  5418. #==============================================================================
  5419. # ■ Window_BattleEnemy
  5420. #------------------------------------------------------------------------------
  5421. #  バトル画面で、行動対象の敵キャラを選択するウィンドウです。
  5422. # 横並びの不可視のウィンドウとして扱います。
  5423. #==============================================================================

  5424. class Window_BattleEnemy < Window_Selectable
  5425.   include LNX11_Window_TargetHelp
  5426.   #--------------------------------------------------------------------------
  5427.   # ● [エイリアス]:オブジェクト初期化
  5428.   #--------------------------------------------------------------------------
  5429.   alias :lnx11a_initialize :initialize
  5430.   def initialize(info_viewport)
  5431.     # 敵キャラオブジェクトの設定
  5432.     set_enemy
  5433.     # 元のメソッドを呼ぶ
  5434.     lnx11a_initialize(info_viewport)
  5435.     # ウィンドウを画面外に移動
  5436.     self.y = Graphics.height
  5437.   end
  5438.   #--------------------------------------------------------------------------
  5439.   # ● [追加]:敵キャラオブジェクトの設定
  5440.   #--------------------------------------------------------------------------
  5441.   def set_enemy
  5442.     if LNX11::TROOP_X_SORT
  5443.       @troop = $game_troop.alive_members.sort {|a,b| a.screen_x <=> b.screen_x}
  5444.     else
  5445.       @troop = $game_troop.alive_members
  5446.     end
  5447.   end
  5448.   #--------------------------------------------------------------------------
  5449.   # ● [再定義]:敵キャラオブジェクト取得
  5450.   #--------------------------------------------------------------------------
  5451.   def enemy
  5452.     @troop[@index]
  5453.   end
  5454.   #--------------------------------------------------------------------------
  5455.   # ● [オーバーライド]:ウィンドウ幅の取得
  5456.   #--------------------------------------------------------------------------
  5457.   def window_width
  5458.     64
  5459.   end
  5460.   #--------------------------------------------------------------------------
  5461.   # ● [オーバーライド]:指定行数に適合するウィンドウの高さを計算
  5462.   #--------------------------------------------------------------------------
  5463.   def fitting_height(line_number)
  5464.     super(1)
  5465.   end
  5466.   #--------------------------------------------------------------------------
  5467.   # ● [オーバーライド]:桁数の取得
  5468.   #--------------------------------------------------------------------------
  5469.   def col_max
  5470.     return item_max
  5471.   end
  5472.   #--------------------------------------------------------------------------
  5473.   # ● [オーバーライド]:ヘルプテキスト更新
  5474.   #--------------------------------------------------------------------------
  5475.   def update_help
  5476.     @help_window.random_number = @random_number
  5477.     @help_window.set_item(targetcursor)
  5478.   end
  5479.   #--------------------------------------------------------------------------
  5480.   # ● [追加]:ターゲットカーソルに渡すオブジェクト
  5481.   #--------------------------------------------------------------------------
  5482.   def targetcursor
  5483.     @cursor_all ? (@cursor_random ? :troop_random : :troop) : enemy
  5484.   end
  5485.   #--------------------------------------------------------------------------
  5486.   # ● [エイリアス]:ウィンドウの表示
  5487.   #--------------------------------------------------------------------------
  5488.   alias :lnx11a_show :show
  5489.   def show
  5490.     # 元のメソッドを呼ぶ
  5491.     lnx11a_show
  5492.     # 敵キャラオブジェクトの設定
  5493.     set_enemy
  5494.     return self unless LNX11::LAST_TARGET
  5495.     # 最後に選択した敵キャラを選択
  5496.     last_target = $game_temp.last_target_cursor[:enemy]
  5497.     if last_target && @troop.include?(last_target)
  5498.       select(@troop.index(last_target))
  5499.     end
  5500.     self
  5501.   end
  5502.   #--------------------------------------------------------------------------
  5503.   # ● [エイリアス]:ウィンドウの非表示
  5504.   #--------------------------------------------------------------------------
  5505.   alias :lnx11a_hide :hide
  5506.   def hide
  5507.     # 元のメソッドを呼ぶ
  5508.     lnx11a_hide
  5509.     # 選択した敵キャラを記憶
  5510.     $game_temp.last_target_cursor[:enemy] = enemy
  5511.     self
  5512.   end
  5513. end

  5514. #==============================================================================
  5515. # ■ Window_BattleSkill
  5516. #------------------------------------------------------------------------------
  5517. #  いくつかのモジュールをインクルードします。
  5518. #==============================================================================

  5519. class Window_BattleSkill < Window_SkillList
  5520.   include LNX11_Window_ActiveVisible
  5521.   include LNX11_Window_FittingList if LNX11::FITTING_LIST
  5522. end

  5523. #==============================================================================
  5524. # ■ Window_BattleItem
  5525. #------------------------------------------------------------------------------
  5526. #  いくつかのモジュールをインクルードします。
  5527. #==============================================================================

  5528. class Window_BattleItem < Window_ItemList
  5529.   include LNX11_Window_ActiveVisible
  5530.   include LNX11_Window_FittingList if LNX11::FITTING_LIST
  5531. end
  5532. # l:5608
  5533. #==============================================================================
  5534. # ★ RGSS3-Extension
  5535. # LNX11a_XPスタイルバトル
  5536. #  戦闘画面をRPGツクールXP準拠のものに変更します。
  5537. #
  5538. #  version   : 1.11 (13/06/19)
  5539. #  author    : ももまる
  5540. #  reference : [url]http://peachround.blog.fc2.com/blog-entry-9.html[/url]
  5541. #
  5542. #==============================================================================

  5543. #==============================================================================
  5544. # ■ LNXスクリプト導入情報
  5545. #==============================================================================
  5546. $lnx_include = {} if $lnx_include == nil
  5547. $lnx_include[:lnx11a] = 111 # version
  5548. p "OK:LNX11a_XPスタイルバトル ver1.11"

  5549. module LNX11
  5550.   #--------------------------------------------------------------------------
  5551.   # ● 正規表現
  5552.   #--------------------------------------------------------------------------
  5553.   # アクター:バトラーグラフィック = "ファイル名"
  5554.   RE_BATTLER = /(?:バトラーグラフィック|battler_graphic)\s*=\s*"([^"]*)"/i
  5555.   # アイテム/スキル:使用時アニメ = アニメーションID
  5556.   RE_USE_ANIMATION = /(?:使用時アニメ|use_animation)\s*=\s*(\d+)/i
  5557.   # アイテム/スキル:ヘルプ説明 = "説明文"
  5558.   RE_SHORT_DESCRIPTION =/(?:ヘルプ説明|short_description)\s*=\s*"([^"]*)"/i
  5559.   # アイテム/スキル:ヘルプ非表示
  5560.   RE_USABLEITEM_NO_DISPLAY = /(?:ヘルプ非表示|no_display)/i
  5561.   # アイテム/スキル:使用時追加ウェイト = duration
  5562.   RE_DISPLAY_WAIT = /(?:使用時追加ウェイト|display_wait)\s*=\s*(\d+)/i
  5563.   # アイテム/スキル:終了時追加ウェイト = duration
  5564.   RE_END_WAIT = /(?:終了時追加ウェイト|end_wait)\s*=\s*(\d+)/i
  5565.   # 敵キャラ:通常攻撃アニメ = アニメーションID
  5566.   RE_ATK_ANIMATION = /(?:通常攻撃アニメ|atk_animation)\s*=\s*(\d+)/i
  5567.   # ステート:ステートアニメ = アニメーションID
  5568.   RE_STATE_ANIMATION = /(?:ステートアニメ|state_animation)\s*=\s*(\d+)/i
  5569.   # ステート:ポップアップ表示名 = "表示名"
  5570.   RE_STATE_DISPLAY = /(?:ポップアップ表示名|display_name)\s*=\s*"([^"]*)"/i
  5571.   # ステート:ポップアップ非表示
  5572.   RE_STATE_NO_DISPLAY = /(?:ポップアップ非表示|no_display)/i
  5573.   # ステート:付加ポップアップ非表示
  5574.   RE_STATE_ADD_NO_DISPLAY = /(?:付加ポップアップ非表示|add_no_display)/i
  5575.   # ステート:解除ポップアップ非表示
  5576.   RE_STATE_REM_NO_DISPLAY = /(?:解除ポップアップ非表示|remove_no_display)/i
  5577.   # ステート:有利なステート
  5578.   RE_STATE_ADVANTAGE = /(?:有利なステート|advantage_state)/i
  5579.   # ステート:ポップアップタイプ = type_id
  5580.   RE_STATE_TYPE = /(?:ポップアップタイプ|popup_type)\s*=\s*(\d+)/i
  5581.   # ステート:付加ポップアップタイプ = type_id
  5582.   RE_STATE_ADD_TYPE = /(?:付加ポップアップタイプ|add_popup_type)\s*=\s*(\d+)/i
  5583.   # ステート:解除ポップアップタイプ = type_id
  5584.   RE_STATE_REM_TYPE=/(?:解除ポップアップタイプ|remove_popup_type)\s*=\s*(\d+)/i
  5585.   # ステート:修飾文字非表示
  5586.   RE_STATE_NO_DECORATION = /(?:修飾文字非表示|no_decoration)/i
  5587.   # ステート:付加修飾文字非表示
  5588.   RE_STATE_ADD_NO_DECORATION = /(?:付加修飾文字非表示|add_no_decoration)/i
  5589.   # ステート:解除修飾文字非表示
  5590.   RE_STATE_REM_NO_DECORATION = /(?:解除修飾文字非表示|remove_no_decoration)/i
  5591.   # <<ver1.10>>
  5592.   # ステート:付加ポップアップ表示名 = "表示名"
  5593.   RE_STATE_ADD_DISPLAY =
  5594.   /(?:付加ポップアップ表示名|add_display_name)\s*=\s*"([^"]*)"/i
  5595.   # ステート:解除ポップアップ表示名 = "表示名"
  5596.   RE_STATE_REM_DISPLAY =
  5597.   /(?:解除ポップアップ表示名|remove_display_name)\s*=\s*"([^"]*)"/i
  5598.   #--------------------------------------------------------------------------
  5599.   # ● バトルステータス更新
  5600.   #--------------------------------------------------------------------------
  5601.   # LNX11.バトルステータス更新
  5602.   def self.battle_status_refresh
  5603.     $game_temp.battle_status_refresh
  5604.   end
  5605.   def self.バトルステータス更新
  5606.     self.battle_status_refresh
  5607.   end  
  5608.   #--------------------------------------------------------------------------
  5609.   # ● アクターエリア表示/非表示
  5610.   #--------------------------------------------------------------------------
  5611.   # LNX11.アクターエリア表示
  5612.   def self.actor_area_show
  5613.     self.actor_show
  5614.     self.status_show
  5615.     self.actor_bg_show
  5616.   end
  5617.   def self.アクターエリア表示
  5618.     self.actor_area_show
  5619.   end
  5620.   # LNX11.アクターエリア非表示
  5621.   def self.actor_area_hide
  5622.     self.actor_hide
  5623.     self.status_hide
  5624.     self.actor_bg_hide
  5625.   end
  5626.   def self.アクターエリア非表示
  5627.     self.actor_area_hide
  5628.   end
  5629.   #--------------------------------------------------------------------------
  5630.   # ● アクター表示/非表示
  5631.   #--------------------------------------------------------------------------
  5632.   # LNX11.アクター表示
  5633.   def self.actor_show
  5634.     $game_party.actor_invisible = false
  5635.   end
  5636.   def self.アクター表示
  5637.     self.actor_show
  5638.   end
  5639.   # LNX11.アクター非表示
  5640.   def self.actor_hide
  5641.     $game_party.actor_invisible = true
  5642.   end
  5643.   def self.アクター非表示
  5644.     self.actor_hide
  5645.   end
  5646.   #--------------------------------------------------------------------------
  5647.   # ● バトルステータス表示/非表示
  5648.   #--------------------------------------------------------------------------
  5649.   # LNX11.バトルステータス表示
  5650.   def self.status_show
  5651.     $game_party.status_invisible = false
  5652.     self.battle_status_refresh
  5653.   end
  5654.   def self.バトルステータス表示
  5655.     self.status_show
  5656.   end
  5657.   # LNX11.バトルステータス非表示
  5658.   def self.status_hide
  5659.     $game_party.status_invisible = true
  5660.     self.battle_status_refresh
  5661.   end
  5662.   def self.バトルステータス非表示
  5663.     self.status_hide
  5664.   end
  5665.   #--------------------------------------------------------------------------
  5666.   # ● アクター背景表示/非表示
  5667.   #--------------------------------------------------------------------------
  5668.   # LNX11.アクター背景表示
  5669.   def self.actor_bg_show
  5670.     $game_party.actor_bg_invisible = false
  5671.   end
  5672.   def self.アクター背景表示
  5673.     self.actor_bg_show
  5674.   end
  5675.   # LNX11.アクター背景非表示
  5676.   def self.actor_bg_hide
  5677.     $game_party.actor_bg_invisible = true
  5678.   end
  5679.   def self.アクター背景非表示
  5680.     self.actor_bg_hide
  5681.   end  
  5682.   #--------------------------------------------------------------------------
  5683.   # ● バトラーグラフィックのスクリプト指定
  5684.   #--------------------------------------------------------------------------
  5685.   # LNX11.バトラーグラフィック(id, filename)
  5686.   def self.battler_graphic(id ,filename)
  5687.     if id.is_a?(Numeric) && filename.is_a?(String)
  5688.       p "LNX11a:バトラーグラフィックを変更しました:ID#{id} #{filename}"
  5689.       $game_actors[id].battler_graphic_name = filename
  5690.     else
  5691.       errormes =  "LNX11a:バトラーグラフィック指定の引数が正しくありません。"
  5692.       p errormes, "LNX11a:バトラーグラフィックの指定は行われませんでした。"
  5693.       msgbox errormes
  5694.     end
  5695.   end
  5696.   def self.バトラーグラフィック(id ,filename)
  5697.     self.battler_graphic(id ,filename)
  5698.   end
  5699.   #--------------------------------------------------------------------------
  5700.   # ● 任意のポップアップを生成
  5701.   #--------------------------------------------------------------------------
  5702.   # LNX11.ポップアップ(battler, popup, type, color, deco)
  5703.   def self.make_popup(battler, popup, type = 0, color = :hp_damage, deco = nil)
  5704.     return unless $game_party.in_battle
  5705.     target = self.battler_search(battler)
  5706.     unless target.is_a?(Game_Battler)
  5707.       p "LNX11a:任意のポップアップの生成に失敗しました。バトラー指定が"
  5708.       p "LNX11a:間違っているか、バトラーが存在していない可能性があります。"
  5709.       return
  5710.     end
  5711.     $game_temp.popup_data.popup_custom(target, popup, type, color, deco)   
  5712.   end
  5713.   def self.ポップアップ(battler, popup, type=0, color=:hp_damage, deco=nil)
  5714.     self.make_popup(battler, popup, type, color, deco)
  5715.   end
  5716.   #--------------------------------------------------------------------------
  5717.   # ● バトラー指定
  5718.   #--------------------------------------------------------------------------
  5719.   def self.battler_search(val)
  5720.     if val.is_a?(String)
  5721.       # 名前指定
  5722.       a = ($game_party.members + $game_troop.members).find {|b| b.name == val }
  5723.       return a
  5724.     elsif val.is_a?(Array)
  5725.       # インデックス指定
  5726.       case val[0]
  5727.       when :actor ; return $game_party.members[val[1]]
  5728.       when :enemy ; return $game_troop.members[val[1]]
  5729.       else        ; return nil
  5730.       end
  5731.     else
  5732.       # オブジェクト
  5733.       return val
  5734.     end
  5735.   end
  5736.   #--------------------------------------------------------------------------
  5737.   # ● バトルログプッシュ
  5738.   #--------------------------------------------------------------------------
  5739.   # LNX11.バトルログ(text)
  5740.   def self.battle_log_push(text)
  5741.     return unless $game_party.in_battle
  5742.     case BATTLELOG_TYPE
  5743.     when 0..1 # バトルログ
  5744.       BattleManager.log_window.add_text(text)
  5745.     when 2 # 簡易ヘルプ表示
  5746.       BattleManager.helpdisplay_set(text, 0)
  5747.     end
  5748.   end
  5749.   def self.バトルログ(text)
  5750.     self.battle_log_push(text)
  5751.   end
  5752.   #--------------------------------------------------------------------------
  5753.   # ● バトルログ消去
  5754.   #--------------------------------------------------------------------------
  5755.   # LNX11.バトルログ消去
  5756.   def self.battle_log_clear
  5757.     return unless $game_party.in_battle
  5758.     case BATTLELOG_TYPE
  5759.     when 0 # バトルログ
  5760.       BattleManager.log_window.clear
  5761.     when 1 # 蓄積型
  5762.       BattleManager.log_window.clear
  5763.       $game_temp.battlelog_clear = true
  5764.       self.battle_wait(1)
  5765.     when 2 # 簡易ヘルプ
  5766.       BattleManager.helpdisplay_clear(0)
  5767.     end
  5768.   end
  5769.   def self.バトルログ消去
  5770.     self.battle_log_clear
  5771.   end
  5772.   #--------------------------------------------------------------------------
  5773.   # ● バトルウェイト
  5774.   #--------------------------------------------------------------------------
  5775.   # LNX11.バトルウェイト(duration)
  5776.   def self.battle_wait(duration)
  5777.     return unless $game_party.in_battle
  5778.     BattleManager.log_window.abs_wait(duration)
  5779.   end
  5780.   def self.バトルウェイト(duration)
  5781.     self.battle_wait(duration)
  5782.   end
  5783.   #--------------------------------------------------------------------------
  5784.   # ● 設定値
  5785.   #  ※ 設定を変更する場合、LNX11aconf を使用してください。
  5786.   #--------------------------------------------------------------------------
  5787.   # <<ver1.00>>
  5788.   if !$lnx_include[:lnx11aconf] ||
  5789.      $lnx_include[:lnx11aconf] && $lnx_include[:lnx11aconf] < 100
  5790.   DEFAULT_BATTLER_GRAPHIC = 0
  5791.   DEFAULT_BG_COLOR        = [Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  5792.   ACTOR_SCREEN_TONE       = false
  5793.   TP_POPUP_TYPE           = 1
  5794.   INDEXZERO_NO_POPUP      = true
  5795.   ACTOR_BACKGROUND        = 2
  5796.   ACTOR_BACKGROUND_HEIGHT = 112
  5797.   ACTOR_BG_GRADIENT_COLOR = [Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  5798.   BATTLELOG_TYPE  =  1
  5799.   STORAGE_LINE_NUMBER     = 6
  5800.   STORAGE_LINE_HEIGHT     = 20
  5801.   STORAGE_UP_MESSAGE_TIME = 90
  5802.   STORAGE_TURNEND_CLEAR   = true
  5803.   STORAGE_OFFSET = {:x => 0, :y => 6}
  5804.   STORAGE_FONT   = {:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  5805.   STORAGE_GRADIENT_COLOR = [Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  5806.   POPUP_ADD_WAIT          = 6
  5807.   HELPDISPLAY_TYPE        = 1
  5808.   HELPDISPLAT_WAIT        = 20
  5809.   HELPDISPLAT_END_WAIT    = 24
  5810.   HELPDISPLAY_DESCRIPTION = {:size => 20, :delimiter => " "}
  5811.   MESSAGE_TYPE  =  2
  5812.   MESSAGE_WINDOW_BACKGROUND  = 1
  5813.   MESSAGE_WINDOW_POSITION    = 0
  5814.   MESSAGE_WAIT = {:battle_start => [120, false], :victory   => [ 60, false],
  5815.                   :defeat       => [120, false], :escape    => [120, false],
  5816.                   :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  5817.   MESSAGE_WINDOW_ENEMY_NAMES = false
  5818.   LEVELUP_SE  = RPG::SE.new("Up4", 90, 100)
  5819.   DROPITEM_SE = RPG::SE.new("Item3", 80, 125)
  5820.   ACTOR_CENTERING  =  true
  5821.   ACTOR_SPACING_ADJUST = 32
  5822.   ACTOR_OFFSET  = {:x => -16, :y => 0}
  5823.   ACTOR_PADDING = {:side => 4, :bottom => 8}
  5824.   SCREEN_ANIMATION_OFFSET = 128
  5825.   STATUS_OFFSET = {:x => 64, :y => -12}
  5826.   STATUS_SIDE_PADDING   = 6
  5827.   STATUS_WIDTH          = 72
  5828.   STATUS_AUTOADJUST     = true
  5829.   STATUS_LINE_HEIGHT    = 22
  5830.   STATUS_NAME_SIZE      = 20
  5831.   STATUS_PARAM_SIZE     = 23
  5832.   STATUS_GAUGE_OPACITY  = 192
  5833.   ACTOR_COMMAND_NOSCROLL   = true
  5834.   ACTOR_COMMAND_HORIZON    = false
  5835.   ACTOR_COMMAND_ALIGNMENT  = 0
  5836.   ACTOR_COMMAND_WIDTH      = 128
  5837.   ACTOR_COMMAND_POSITION   = 0
  5838.   ACTOR_COMMAND_Y_POSITION = 0
  5839.   ACTOR_COMMAND_OFFSET  = {:x => 0, :y => -16}
  5840.   PARTY_COMMAND_HORIZON   = true
  5841.   PARTY_COMMAND_ALIGNMENT = 1
  5842.   PARTY_COMMAND_WIDTH     = Graphics.width
  5843.   PARTY_COMMAND_XY        = {:x => 0, :y => 0}
  5844.   CURSOR_NAME       = ""
  5845.   CURSOR_TONE     = Tone.new(-34, 0, 68)
  5846.   CURSOR_ANI_SPEED  = 3
  5847.   CURSOR_SPEED      = 3
  5848.   CURSOR_BLINK      = true
  5849.   CURSOR_MINMAX     = {:min => 48, :max => Graphics.height}
  5850.   CURSOR_OFFSET     = {:x => 0, :y => 0}
  5851.   HELP_ACTOR_PARAM = {:hp => true ,:mp => true ,:tp => true ,:state => true }
  5852.   HELP_ENEMY_PARAM = {:hp => false,:mp => false,:tp => false,:state => true }
  5853.   HELP_PARAM_WIDTH    = 72
  5854.   RANDOMSCOPE_DISPLAY = 1
  5855.   ACTOR_POPUP_POSITION   = 3
  5856.   ENEMY_POPUP_POSITION   = 1
  5857.   LEVELUP_POPUP_POSITION = 3
  5858.   ACTOR_POPUP_Y     =  -100
  5859.   LEVELUP_POPUP_Y   =  -112
  5860.   NUMBER_FONT   =  ["Arial Black", "WQYMHEx"]
  5861.   TEXT_FONT     =  ["Arial Black", "WQYMHEx"]
  5862.   TEXT_FONT_MCS =  ["WQYMHEx"]
  5863.   LARGE_NUMBER  =  {:fontsize => 38, :spacing => -4, :line_height => 26}
  5864.   SMALL_NUMBER  =  {:fontsize => 28, :spacing => -4, :line_height => 20}
  5865.   TEXT_SIZERATE     = {:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  5866.   TEXT_SIZERATE_MCS = 0.9
  5867.   DECORATION_NUMBER = {
  5868.   :critical    => ["CRITICAL", 8], :weakness    => ["WEAKNESS", 8],
  5869.   :resist      => ["RESIST"  , 8], :mp_damage   => ["\mp"     , 4],
  5870.   :mp_plus     => ["\mp+"    , 4], :mp_minus    => ["\mp-"    , 4],
  5871.   :tp_plus     => ["\tp+"    , 4], :tp_minus    => ["\tp-"    , 4]}
  5872.   DECORATION_TEXT = {
  5873.   :add_state   => "+%s",      :rem_state   => "-%s",
  5874.   :add_buff    => "%s UP",    :add_debuff  => "%s DOWN",
  5875.   :rem_buff    => "-%s Buff"}
  5876.   POPUP_VOCAB = {
  5877.   :miss        => "MISS!",      :counter     => "Counter",
  5878.   :reflection  => "Reflection", :substitute  => "Substitute",
  5879.   :levelup     => "LEVELUP!"}
  5880.   POPUP_VOCAB_PARAMS = [
  5881.   "MAX\hp","MAX\mp","ATK","DEF","MATK","MDEF","AGI","LUCK"]
  5882.   POPUP_COLOR = {
  5883.   :hp_damage     => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  5884.   :critical      => [Color.new(255, 255,  80), Color.new(224,  32,   0)],
  5885.   :weakness      => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  5886.   :resist        => [Color.new(232, 224, 216), Color.new( 56,  48,  40)],
  5887.   :hp_recovery   => [Color.new( 96, 255, 128), Color.new(  0,  64,  32)],
  5888.   :mp_damage     => [Color.new(248,  80, 172), Color.new( 48,   0,  32)],
  5889.   :mp_recovery   => [Color.new(160, 240, 255), Color.new( 32,  48, 144)],
  5890.   :tp_damage     => [Color.new(248, 240,  64), Color.new(  0,  80,  40)],
  5891.   :add_state     => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  5892.   :rem_state     => [Color.new(224, 232, 240), Color.new( 32,  64, 128, 128)],
  5893.   :add_badstate  => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  5894.   :rem_badstate  => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  5895.   :add_buff      => [Color.new(255, 255, 192), Color.new( 96,  64,   0)],
  5896.   :add_debuff    => [Color.new(200, 224, 232), Color.new( 40,  48,  56)],
  5897.   :rem_buff      => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  5898.   :counter       => [Color.new(255, 255, 224), Color.new(128,  96,   0)],
  5899.   :reflection    => [Color.new(224, 255, 255), Color.new(  0,  96, 128)],
  5900.   :substitute    => [Color.new(224, 255, 224), Color.new(  0, 128,  64)],
  5901.   :levelup       => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  5902.   }
  5903.   POPUP_TYPE = {
  5904.   :miss          =>   0,:hp_damage     =>   0,:hp_slipdamage =>   1,
  5905.   :hp_recovery   =>   0,:hp_regenerate =>   1,:hp_drain      =>   0,
  5906.   :hp_drainrecv  =>   0,:mp_damage     =>   0,:mp_slipdamage =>   1,
  5907.   :mp_recovery   =>   0,:mp_regenerate =>   1,:mp_drain      =>   0,
  5908.   :mp_drainrecv  =>   0,:mp_paycost    =>  -1,:tp_damage     =>   1,
  5909.   :tp_charge     =>  -1,:tp_gain       =>   7,:tp_regenerate =>   1,
  5910.   :tp_paycost    =>  -1,:add_state     =>   2,:rem_state     =>   2,
  5911.   :add_badstate  =>   2,:rem_badstate  =>   2,:add_debuff    =>   3,
  5912.   :rem_buff      =>   3,:counter       =>   6,:reflection    =>   6,
  5913.   :substitute    =>   4,}
  5914.   LARGE_MOVEMENT = {
  5915.   :inirate    => 6.4,  :gravity      => 0.68,  :side_scatter => 1.2,
  5916.   :ref_height =>  32,  :ref_factor   => 0.60,  :ref_count    =>   2,
  5917.                        :duration     =>   40,  :fadeout      =>  20 }
  5918.   SMALL_MOVEMENT = {
  5919.   :inirate    => 4.4,  :gravity      => 0.60,  :side_scatter => 0.0,
  5920.   :ref_height =>  12,  :ref_factor   => 0.70,  :ref_count    =>   0,
  5921.                        :duration     =>   60,  :fadeout      =>  16 }
  5922.   RISE_MOVEMENT     = {:rising_speed => 0.75,  :line_spacing => 0.9,
  5923.                        :duration     =>   40,  :fadeout      =>   8 }
  5924.   SLIDE_MOVEMENT    = {:x_speed      =>    2,  :line_spacing => 0.9,
  5925.                        :duration     =>   50,  :fadeout      =>  32 }
  5926.   OVERLAY_MOVEMENT  = {:duration     =>   36,  :fadeout      =>  32 }
  5927.   FIX_TARGET_CHECKE     = true
  5928.   GUARD_TARGET_CHECKE   = true
  5929.   SMART_TARGET_SELECT   = true
  5930.   LAST_TARGET           = true
  5931.   LAST_PARTY_COMMAND    = true
  5932.   LAST_ACTOR_COMMAND    = true
  5933.   TROOP_X_SORT          = true
  5934.   PARTY_COMMAND_SKIP    = true
  5935.   FITTING_LIST          = true
  5936.   ENHANCED_WHITEN       = true
  5937.   DISABLED_DAMAGE_SHAKE = true
  5938.   TROOP_X_SCREEN_FIX    = true
  5939.   TROOP_Y_OFFSET        = 0
  5940.   end
  5941.   # <<ver1.10>>
  5942.   if !$lnx_include[:lnx11aconf] ||
  5943.     $lnx_include[:lnx11aconf] && $lnx_include[:lnx11aconf] < 110
  5944.   LARGE_NUMBER_NAME = ""
  5945.   SMALL_NUMBER_NAME = ""
  5946.   LARGE_BUFFS_NAME  = ""
  5947.   SMALL_BUFFS_NAME  = ""
  5948.   end
  5949. end

  5950. #==============================================================================
  5951. # ■ [追加]:Popup_Data
  5952. #------------------------------------------------------------------------------
  5953. #  戦闘中のポップアップをまとめて扱うクラス。ポップアップスプライトの
  5954. # initialize 時に自身を参照させて、ポップアップ内容を定義する際にも使います。
  5955. #==============================================================================

  5956. class Popup_Data
  5957.   #--------------------------------------------------------------------------
  5958.   # ● クラス変数
  5959.   #--------------------------------------------------------------------------
  5960.   @@make_methods = {} # ポップアップ作成メソッドのハッシュ
  5961.   #--------------------------------------------------------------------------
  5962.   # ● 定数(ポップアップのタイプID)
  5963.   #--------------------------------------------------------------------------
  5964.   SPRING_LARGE  = 0
  5965.   SPRING_SMALL  = 1
  5966.   RISING_LARGE  = 2
  5967.   RISING_SMALL  = 3
  5968.   SLIDING_LARGE = 4
  5969.   SLIDING_SMALL = 5
  5970.   OVERLAY_LARGE = 6
  5971.   OVERLAY_SMALL = 7
  5972.   LEVELUP       = :levelup
  5973.   #--------------------------------------------------------------------------
  5974.   # ● 公開インスタンス変数
  5975.   #--------------------------------------------------------------------------
  5976.   attr_accessor :type       # ポップアップのタイプ
  5977.   attr_accessor :popup      # 表示する内容
  5978.   attr_accessor :popup_size # ポップアップの大きさ
  5979.   attr_accessor :color      # 色
  5980.   attr_accessor :deco       # 修飾文字
  5981.   attr_accessor :battler    # ポップアップするバトラー
  5982.   attr_accessor :delay      # 表示開始までの時間
  5983.   attr_accessor :viewport   # ビューポート
  5984.   attr_accessor :popup_wait # ポップアップウェイト
  5985.   attr_accessor :buff_data  # 能力強化/弱体 <<ver1.10>>
  5986.   #--------------------------------------------------------------------------
  5987.   # ● オブジェクト初期化
  5988.   #--------------------------------------------------------------------------
  5989.   def initialize
  5990.     @sprites = []
  5991.     @viewport = Viewport.new
  5992.     @viewport.z = 120 # ポップアップの Z 座標
  5993.     spb = Sprite_PopupBase.new
  5994.     spb.create_number
  5995.     spb.dispose
  5996.     set_methods
  5997.     refresh
  5998.   end
  5999.   #--------------------------------------------------------------------------
  6000.   # ● ポップアップ生成メソッドの登録
  6001.   #--------------------------------------------------------------------------
  6002.   def set_methods
  6003.     @@make_methods[SPRING_LARGE]  = method(:makeup_spring_large)
  6004.     @@make_methods[SPRING_SMALL]  = method(:makeup_spring_small)
  6005.     @@make_methods[RISING_LARGE]  = method(:makeup_rising_large)
  6006.     @@make_methods[RISING_SMALL]  = method(:makeup_rising_small)
  6007.     @@make_methods[SLIDING_LARGE] = method(:makeup_sliding_large)
  6008.     @@make_methods[SLIDING_SMALL] = method(:makeup_sliding_small)
  6009.     @@make_methods[OVERLAY_LARGE] = method(:makeup_overlay_large)
  6010.     @@make_methods[OVERLAY_SMALL] = method(:makeup_overlay_small)
  6011.     @@make_methods[LEVELUP]       = method(:makeup_levelup)
  6012.   end
  6013.   #--------------------------------------------------------------------------
  6014.   # ● スプライト解放
  6015.   #--------------------------------------------------------------------------
  6016.   def dispose
  6017.     @sprites.each {|sprite| sprite.dispose}
  6018.     @viewport.dispose
  6019.   end
  6020.   #--------------------------------------------------------------------------
  6021.   # ● フレーム更新
  6022.   #--------------------------------------------------------------------------
  6023.   def update
  6024.     @sprites.each do |sprite|
  6025.       sprite.update
  6026.       @sprites.delete(sprite) if sprite.disposed?
  6027.     end
  6028.   end
  6029.   #--------------------------------------------------------------------------
  6030.   # ● リフレッシュ
  6031.   #--------------------------------------------------------------------------
  6032.   def refresh
  6033.     @type  = 0
  6034.     @popup = nil
  6035.     @popup_size = :large
  6036.     @color = :hp_damage
  6037.     @deco = ["", -1] # [テキスト, テキストの位置]
  6038.     @battler = nil
  6039.     @delay = 0
  6040.     @popup_wait = false
  6041.     # <<ver1.10>> 能力強化/弱体ポップアップを画像で表示する際に利用
  6042.     @buff_data = [-1, -1] # [能力, 強化or弱体or解除]
  6043.   end
  6044.   #--------------------------------------------------------------------------
  6045.   # ● ポップアップを生成
  6046.   #--------------------------------------------------------------------------
  6047.   def makeup
  6048.     if @@make_methods[@type]
  6049.       @@make_methods[@type].call
  6050.       @popup_wait = true
  6051.     end
  6052.   end
  6053.   #--------------------------------------------------------------------------
  6054.   # ● ポップアップウェイト
  6055.   #  バトルログタイプが [2:ヘルプ表示] の場合のみ実行されます。
  6056.   #--------------------------------------------------------------------------
  6057.   def add_wait
  6058.     return if LNX11::BATTLELOG_TYPE != 2 || !@popup_wait
  6059.     LNX11::POPUP_ADD_WAIT.times {BattleManager.log_window.abs_wait(1)}
  6060.     @popup_wait = false
  6061.   end
  6062.   #--------------------------------------------------------------------------
  6063.   # ● ポップアップ生成メソッド
  6064.   #  これらのメソッドを @@make_methods に登録して呼び出します。
  6065.   # これはポップアップタイプの拡張を容易にするための仕様です。
  6066.   #--------------------------------------------------------------------------
  6067.   def makeup_spring_large
  6068.     # @type   0 : 跳ねるポップアップ(大)
  6069.     @popup_size = :large
  6070.     @sprites.push(Sprite_PopupSpring.new(self))
  6071.   end
  6072.   def makeup_spring_small
  6073.     # @type   1 : 跳ねるポップアップ(小)
  6074.     @popup_size = :small
  6075.     @delay = @battler.popup_delay[1]
  6076.     @sprites.push(Sprite_PopupSpring.new(self))
  6077.   end
  6078.   def makeup_rising_large
  6079.     # @type   2 : ゆっくり上昇(大)
  6080.     @popup_size = :large
  6081.     @delay = @battler.popup_delay[2]
  6082.     @sprites.push(Sprite_PopupRising.new(self))
  6083.   end
  6084.   def makeup_rising_small
  6085.     # @type   3 : ゆっくり上昇(小)
  6086.     @popup_size = :small      
  6087.     @delay = @battler.popup_delay[2]
  6088.     @sprites.push(Sprite_PopupRising.new(self))
  6089.   end
  6090.   def makeup_sliding_large
  6091.     # @type   4 : スライド(大)
  6092.     @popup_size = :large
  6093.     @delay = @battler.popup_delay[3]
  6094.     @sprites.push(Sprite_PopupSliding.new(self))
  6095.   end
  6096.   def makeup_sliding_small
  6097.     # @type   5 : スライド(小)
  6098.     @popup_size = :small
  6099.     @delay = @battler.popup_delay[3]
  6100.     @sprites.push(Sprite_PopupSliding.new(self))      
  6101.   end
  6102.   def makeup_overlay_large
  6103.     # @type   6 : オーバーレイ(大)
  6104.     @popup_size = :large
  6105.     @sprites.push(Sprite_PopupOverlay.new(self))
  6106.   end
  6107.   def makeup_overlay_small
  6108.     # @type   7 : オーバーレイ(小)
  6109.     @popup_size = :small
  6110.     @sprites.push(Sprite_PopupOverlay.new(self))
  6111.   end
  6112.   def makeup_levelup
  6113.     # @type :levelup : レベルアップ
  6114.     @battler.popup_delay[3] = 0
  6115.     @popup_size = :large
  6116.     @sprites.push(Sprite_PopupLevelUp.new(self))
  6117.   end
  6118.   #--------------------------------------------------------------------------
  6119.   # ● TP のポップアップが有効か?
  6120.   #--------------------------------------------------------------------------
  6121.   def tp_popup_enabled?(target)
  6122.     return false if !$data_system.opt_display_tp
  6123.     return true  if LNX11::TP_POPUP_TYPE == 0 # すべてポップアップ
  6124.     return true  if LNX11::TP_POPUP_TYPE == 1 && target.actor? # アクターのみ
  6125.     false # ポップアップしない
  6126.   end
  6127.   #--------------------------------------------------------------------------
  6128.   # ● 任意のポップアップ
  6129.   #--------------------------------------------------------------------------
  6130.   def popup_custom(target, popup, type = 0, color = :hp_damage, deco = nil)
  6131.     refresh
  6132.     @battler = target
  6133.     @popup = popup
  6134.     type = LNX11::POPUP_TYPE[type] if type.is_a?(Symbol)
  6135.     @type = type
  6136.     @color = color
  6137.     @deco = LNX11::DECORATION_NUMBER[deco] if deco.is_a?(Symbol)
  6138.     # ポップアップ作成
  6139.     makeup
  6140.   end
  6141.   #--------------------------------------------------------------------------
  6142.   # ● レベルアップのポップアップ
  6143.   #--------------------------------------------------------------------------
  6144.   def popup_levelup(target)
  6145.     # 戦闘に参加している場合のみポップアップ
  6146.     return unless $game_party.battle_members.include?(target)
  6147.     refresh
  6148.     @type = :levelup
  6149.     @battler = target
  6150.     @popup = LNX11::POPUP_VOCAB[:levelup]
  6151.     @color = :levelup
  6152.     # ポップアップ作成
  6153.     makeup
  6154.   end
  6155.   #--------------------------------------------------------------------------
  6156.   # ● 単一テキストのポップアップ
  6157.   #--------------------------------------------------------------------------
  6158.   def popup_text(target, type)
  6159.     refresh
  6160.     @type = LNX11::POPUP_TYPE[type]
  6161.     @battler = target
  6162.     @popup = LNX11::POPUP_VOCAB[type]
  6163.     @color = type
  6164.     # ポップアップ作成
  6165.     makeup
  6166.   end
  6167.   #--------------------------------------------------------------------------
  6168.   # ● ミスのポップアップ
  6169.   #--------------------------------------------------------------------------
  6170.   def popup_miss(target, item)
  6171.     refresh
  6172.     @type = LNX11::POPUP_TYPE[:miss]
  6173.     @battler = target
  6174.     @popup = LNX11::POPUP_VOCAB[:miss]
  6175.     @color = :hp_damage
  6176.     # ポップアップ作成
  6177.     makeup
  6178.   end
  6179.   #--------------------------------------------------------------------------
  6180.   # ● HP ダメージポップアップ
  6181.   #--------------------------------------------------------------------------
  6182.   def popup_hp_damage(target, item)
  6183.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  6184.     refresh
  6185.     @popup = target.result.hp_damage
  6186.     @battler = target
  6187.     if target.result.hp_drain > 0
  6188.       # 被吸収
  6189.       @type = LNX11::POPUP_TYPE[:hp_drain]
  6190.       # 弱点/耐性
  6191.       if target.result.element_rate > 1
  6192.         @deco = LNX11::DECORATION_NUMBER[:weakness]
  6193.         @color = :weakness
  6194.       elsif target.result.element_rate < 1
  6195.         @deco = LNX11::DECORATION_NUMBER[:resist]
  6196.         @color = :resist
  6197.       else
  6198.         @color = :hp_damage
  6199.       end
  6200.     elsif target.result.hp_damage > 0
  6201.       # ダメージ
  6202.       @type = LNX11::POPUP_TYPE[:hp_damage]
  6203.       @color = :hp_damage
  6204.       if target.result.critical
  6205.         # クリティカル
  6206.         @deco = LNX11::DECORATION_NUMBER[:critical]
  6207.         @color = :critical
  6208.       end
  6209.       # 弱点/耐性
  6210.       if target.result.element_rate > 1
  6211.         @deco = LNX11::DECORATION_NUMBER[:weakness]
  6212.         @color = :weakness if @color != :critical
  6213.       elsif target.result.element_rate < 1
  6214.         @deco = LNX11::DECORATION_NUMBER[:resist]
  6215.         @color = :resist if @color != :critical
  6216.       end
  6217.     elsif target.result.hp_damage < 0
  6218.       # 回復
  6219.       @type = LNX11::POPUP_TYPE[:hp_recovery]
  6220.       @color = :hp_recovery
  6221.     else
  6222.       # 0 ダメージ
  6223.       @type = LNX11::POPUP_TYPE[:hp_damage]
  6224.       @color = :hp_damage
  6225.     end
  6226.     # ポップアップ作成
  6227.     makeup
  6228.   end
  6229.   #--------------------------------------------------------------------------
  6230.   # ● MP ダメージポップアップ
  6231.   #--------------------------------------------------------------------------
  6232.   def popup_mp_damage(target, item)
  6233.     return if target.dead? || target.result.mp_damage == 0
  6234.     refresh
  6235.     @popup = target.result.mp_damage
  6236.     @battler = target
  6237.     @deco = LNX11::DECORATION_NUMBER[:mp_damage]
  6238.     if target.result.mp_drain > 0
  6239.       # 被吸収
  6240.       @type = LNX11::POPUP_TYPE[:mp_drain]
  6241.       @color = :mp_damage
  6242.     elsif target.result.mp_damage > 0
  6243.       # ダメージ
  6244.       @type = LNX11::POPUP_TYPE[:mp_damage]
  6245.       @color = :mp_damage
  6246.     elsif target.result.mp_damage < 0
  6247.       # 回復
  6248.       @type = LNX11::POPUP_TYPE[:mp_recovery]
  6249.       @color = :mp_recovery
  6250.     end
  6251.     # ポップアップ作成
  6252.     makeup
  6253.   end
  6254.   #--------------------------------------------------------------------------
  6255.   # ● TP ダメージポップアップ
  6256.   #--------------------------------------------------------------------------
  6257.   def popup_tp_damage(target, item)
  6258.     return unless tp_popup_enabled?(target)
  6259.     return if target.dead? || target.result.tp_damage == 0
  6260.     refresh
  6261.     @popup = target.result.tp_damage
  6262.     @battler = target
  6263.     deco = target.result.tp_damage > 0 ? :tp_minus : :tp_plus
  6264.     @deco = LNX11::DECORATION_NUMBER[deco]
  6265.     @type = LNX11::POPUP_TYPE[:tp_damage]
  6266.     @color = :tp_damage
  6267.     # ポップアップ作成
  6268.     makeup
  6269.   end
  6270.   #--------------------------------------------------------------------------
  6271.   # ● HP 吸収回復
  6272.   #--------------------------------------------------------------------------
  6273.   def popup_hp_drain(target, hp_drain)
  6274.     return if hp_drain == 0
  6275.     refresh
  6276.     @popup = hp_drain
  6277.     @battler = target
  6278.     @type = LNX11::POPUP_TYPE[:hp_drainrecv]
  6279.     @color = :hp_recovery
  6280.     # ポップアップ作成
  6281.     makeup
  6282.   end
  6283.   #--------------------------------------------------------------------------
  6284.   # ● MP 吸収回復
  6285.   #--------------------------------------------------------------------------
  6286.   def popup_mp_drain(target, mp_drain)
  6287.     return if mp_drain == 0
  6288.     refresh
  6289.     @popup = mp_drain
  6290.     @battler = target
  6291.     @deco = LNX11::DECORATION_NUMBER[:mp_damage]
  6292.     @type = LNX11::POPUP_TYPE[:mp_drainrecv]
  6293.     @color = :mp_recovery
  6294.     # ポップアップ作成
  6295.     makeup
  6296.   end
  6297.   #--------------------------------------------------------------------------
  6298.   # ● ステート付加のポップアップ
  6299.   #--------------------------------------------------------------------------
  6300.   def popup_added_states(target)
  6301.     refresh
  6302.     @battler = target
  6303.     target.result.added_state_objects.each do |state|
  6304.       next if state.id == target.death_state_id
  6305.       next if state.icon_index == 0 && LNX11::INDEXZERO_NO_POPUP
  6306.       next if state.add_no_display?      
  6307.       if state.add_no_decoration?
  6308.         @popup = state.add_display_name
  6309.       else
  6310.         @popup = sprintf(LNX11::DECORATION_TEXT[:add_state],
  6311.                          state.add_display_name)
  6312.       end
  6313.       type = state.advantage? ? :add_state : :add_badstate
  6314.       if state.add_popup_type
  6315.         @type = state.add_popup_type
  6316.       else
  6317.         @type = LNX11::POPUP_TYPE[type]
  6318.       end
  6319.       @color = type
  6320.       # ポップアップ作成
  6321.       makeup
  6322.     end
  6323.   end
  6324.   #--------------------------------------------------------------------------
  6325.   # ● ステート解除のポップアップ
  6326.   #--------------------------------------------------------------------------
  6327.   def popup_removed_states(target)
  6328.     refresh
  6329.     @type = LNX11::POPUP_TYPE[:rem_badstate]
  6330.     @battler = target
  6331.     target.result.removed_state_objects.each do |state|
  6332.       next if state.id == target.death_state_id
  6333.       next if state.icon_index == 0 && LNX11::INDEXZERO_NO_POPUP
  6334.       next if state.remove_no_display?
  6335.       if state.remove_no_decoration?
  6336.         @popup = state.remove_display_name
  6337.       else
  6338.         @popup = sprintf(LNX11::DECORATION_TEXT[:rem_state],
  6339.                          state.remove_display_name)
  6340.       end
  6341.       type = state.advantage? ? :rem_state : :rem_badstate
  6342.       if state.remove_popup_type
  6343.         @type = state.remove_popup_type
  6344.       else
  6345.         @type = LNX11::POPUP_TYPE[type]
  6346.       end
  6347.       @color = type
  6348.       # ポップアップ作成
  6349.       makeup
  6350.     end
  6351.   end
  6352.   #--------------------------------------------------------------------------
  6353.   # ● 能力強化/弱体のポップアップ
  6354.   #--------------------------------------------------------------------------
  6355.   def popup_buffs(target, buffs, fmt)
  6356.     return if buffs.empty?
  6357.     refresh
  6358.     @battler = target
  6359.     case fmt
  6360.     when Vocab::BuffAdd
  6361.       buffdeco = LNX11::DECORATION_TEXT[:add_buff]
  6362.       @type = LNX11::POPUP_TYPE[:add_buff]
  6363.       @color = :add_buff
  6364.       @buff_data[1] = 0
  6365.     when Vocab::DebuffAdd
  6366.       buffdeco = LNX11::DECORATION_TEXT[:add_debuff]
  6367.       @type = LNX11::POPUP_TYPE[:add_debuff]
  6368.       @color = :add_debuff
  6369.       @buff_data[1] = 1
  6370.     when Vocab::BuffRemove
  6371.       buffdeco = LNX11::DECORATION_TEXT[:rem_buff]
  6372.       @type = LNX11::POPUP_TYPE[:rem_buff]
  6373.       @color = :rem_buff
  6374.       @buff_data[1] = 2
  6375.     end
  6376.     buffs.each do |param_id|
  6377.       @popup = sprintf(buffdeco, LNX11::POPUP_VOCAB_PARAMS[param_id])
  6378.       @buff_data[0] = param_id
  6379.       # ポップアップ作成
  6380.       makeup
  6381.       @popup_wait = false
  6382.     end
  6383.   end
  6384.   #--------------------------------------------------------------------------
  6385.   # ● HP 再生
  6386.   #--------------------------------------------------------------------------
  6387.   def popup_regenerate_hp(target, hp_damage, paycost = false)
  6388.     return if hp_damage == 0
  6389.     refresh
  6390.     @popup = hp_damage
  6391.     @battler = target
  6392.     if hp_damage > 0
  6393.       # ダメージ
  6394.       @type = LNX11::POPUP_TYPE[:hp_slipdamage]
  6395.       @color = :hp_damage
  6396.     elsif hp_damage < 0
  6397.       # 回復
  6398.       @type = LNX11::POPUP_TYPE[:hp_regenerate]
  6399.       @color = :hp_recovery
  6400.     end
  6401.     # ポップアップ作成
  6402.     makeup
  6403.   end
  6404.   #--------------------------------------------------------------------------
  6405.   # ● MP 再生
  6406.   #--------------------------------------------------------------------------
  6407.   def popup_regenerate_mp(target, mp_damage, paycost = false)
  6408.     return if mp_damage == 0
  6409.     refresh
  6410.     @popup = mp_damage
  6411.     @battler = target
  6412.     @deco = LNX11::DECORATION_NUMBER[mp_damage > 0 ? :mp_minus : :mp_plus]
  6413.     if mp_damage > 0
  6414.       # ダメージ
  6415.       @type = LNX11::POPUP_TYPE[paycost ? :mp_paycost : :mp_slipdamage]
  6416.       @color = :mp_damage
  6417.     elsif mp_damage < 0
  6418.       # 回復
  6419.       @type = LNX11::POPUP_TYPE[paycost ? :mp_paycost : :mp_regenerate]
  6420.       @color = :mp_recovery
  6421.     end
  6422.     # ポップアップ作成
  6423.     makeup
  6424.   end
  6425.   #--------------------------------------------------------------------------
  6426.   # ● TP 再生
  6427.   #--------------------------------------------------------------------------
  6428.   def popup_regenerate_tp(target, tp_damage, paycost = false)
  6429.     return unless tp_popup_enabled?(target)
  6430.     return if tp_damage == 0
  6431.     refresh
  6432.     @popup = tp_damage
  6433.     @battler = target
  6434.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  6435.     @type = LNX11::POPUP_TYPE[paycost ? :tp_paycost : :tp_regenerate]
  6436.     @color = :tp_damage
  6437.     # ポップアップ作成
  6438.     makeup
  6439.   end
  6440.   #--------------------------------------------------------------------------
  6441.   # ● TP チャージ
  6442.   #--------------------------------------------------------------------------
  6443.   def popup_tp_charge(target, tp_damage)
  6444.     return unless tp_popup_enabled?(target)
  6445.     return if tp_damage == 0
  6446.     refresh
  6447.     @popup = tp_damage
  6448.     @battler = target
  6449.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  6450.     @type = LNX11::POPUP_TYPE[:tp_charge]
  6451.     @color = :tp_damage
  6452.     # ポップアップ作成
  6453.     makeup
  6454.   end
  6455.   #--------------------------------------------------------------------------
  6456.   # ● TP 得
  6457.   #--------------------------------------------------------------------------
  6458.   def popup_tp_gain(target, tp_damage)
  6459.     return unless tp_popup_enabled?(target)
  6460.     return if tp_damage == 0
  6461.     refresh
  6462.     @popup = tp_damage
  6463.     @battler = target
  6464.     @deco = LNX11::DECORATION_NUMBER[tp_damage > 0 ? :tp_minus : :tp_plus]
  6465.     @type = LNX11::POPUP_TYPE[:tp_gain]
  6466.     @color = :tp_damage
  6467.     # ポップアップ作成
  6468.     makeup
  6469.   end
  6470. end

  6471. #==============================================================================
  6472. # ■ [追加]:Sprite_PopupBase
  6473. #------------------------------------------------------------------------------
  6474. #  戦闘中のダメージ表示等をポップアップ表示するためのスプライトの
  6475. # スーパークラス。サブクラスで細かい動きを定義します。
  6476. #==============================================================================

  6477. class Sprite_PopupBase < Sprite
  6478.   #--------------------------------------------------------------------------
  6479.   # ● クラス変数
  6480.   #--------------------------------------------------------------------------
  6481.   @@cache_number = []
  6482.   @@cache_text   = {}
  6483.   @@w = []
  6484.   @@h = []
  6485.   @@priority = 0
  6486.   @@count    = 0
  6487.   @@buf_bitmap = nil
  6488.   #--------------------------------------------------------------------------
  6489.   # ● 定数
  6490.   #--------------------------------------------------------------------------
  6491.   NUMBER_COLOR_SIZE = 8
  6492.   NUMBERS    = [0,1,2,3,4,5,6,7,8,9]
  6493.   COLOR_KEYS = LNX11::POPUP_COLOR.keys
  6494.   #--------------------------------------------------------------------------
  6495.   # ● オブジェクト初期化
  6496.   #     data : ポップアップデータ
  6497.   #--------------------------------------------------------------------------
  6498.   def initialize(data = nil)
  6499.     if data == nil || !data.battler.battle_member?
  6500.       # 非表示のポップアップ
  6501.       super(nil)
  6502.       @remove = true
  6503.       return
  6504.     end
  6505.     # ポップアップデータを適用
  6506.     super(data.viewport)
  6507.     @battler = data.battler # ポップアップを表示するバトラー
  6508.     @delay   = data.delay   # ディレイ(遅延) ※サブクラスによって扱いが違います
  6509.     @popup_size = data.popup_size # ポップアップの大きさ 大/小
  6510.     # 基本設定
  6511.     @duration = 60  # 消え始める時間
  6512.     @fadeout  = 16  # 消える速さ
  6513.     @rx = ry  = 0   # XY座標
  6514.     # Z座標
  6515.     @rz = base_z * 128 + priority
  6516.     popup_add
  6517.     self.visible = false
  6518.     # ポップアップデータからビットマップを作成
  6519.     if data.popup.is_a?(Numeric)
  6520.       # ダメージ値
  6521.       self.bitmap = number(data.popup, data.color, data.popup_size, data.deco)
  6522.     elsif data.popup.is_a?(String)
  6523.       # テキスト
  6524.       self.bitmap = text(data.popup, data.color,
  6525.                          data.popup_size, data.buff_data)
  6526.     end
  6527.     # 位置設定
  6528.     self.ox = self.width  / 2
  6529.     self.oy = self.height / 2
  6530.     set_position
  6531.     start
  6532.   end
  6533.   #--------------------------------------------------------------------------
  6534.   # ● 解放
  6535.   #--------------------------------------------------------------------------
  6536.   def dispose
  6537.     popup_remove
  6538.     terminate
  6539.     self.bitmap.dispose if self.bitmap
  6540.     super
  6541.   end
  6542.   #--------------------------------------------------------------------------
  6543.   # ● フレーム更新
  6544.   #--------------------------------------------------------------------------
  6545.   def update
  6546.     return if removed? || delay?
  6547.     update_popup
  6548.     update_xy
  6549.     @duration -= 1
  6550.     self.opacity -= @fadeout if @duration <= 0
  6551.     dispose if self.opacity == 0
  6552.   end
  6553.   #--------------------------------------------------------------------------
  6554.   # ● 開始処理(サブクラスで定義)
  6555.   #--------------------------------------------------------------------------
  6556.   def start
  6557.   end
  6558.   #--------------------------------------------------------------------------
  6559.   # ● 終了処理(サブクラスで定義)
  6560.   #--------------------------------------------------------------------------
  6561.   def terminate
  6562.   end
  6563.   #--------------------------------------------------------------------------
  6564.   # ● フレーム更新(サブクラスで定義)
  6565.   #--------------------------------------------------------------------------
  6566.   def update_popup
  6567.   end
  6568.   #--------------------------------------------------------------------------
  6569.   # ● ポップアップ Z 座標
  6570.   #--------------------------------------------------------------------------
  6571.   def base_z
  6572.     0
  6573.   end
  6574.   #--------------------------------------------------------------------------
  6575.   # ● ポップアップのプライオリティを返す
  6576.   #  同一Z座標のポップアップで、後から生成されたものが手前に表示されるように
  6577.   # Z座標の修正値をクラス変数で管理しています。
  6578.   #--------------------------------------------------------------------------
  6579.   def priority
  6580.     @@priority * 2
  6581.   end
  6582.   #--------------------------------------------------------------------------
  6583.   # ● ポップアップ追加
  6584.   #--------------------------------------------------------------------------
  6585.   def popup_add
  6586.     @@priority += 1
  6587.     @@count += 1
  6588.   end
  6589.   #--------------------------------------------------------------------------
  6590.   # ● ポップアップ消去
  6591.   #--------------------------------------------------------------------------
  6592.   def popup_remove
  6593.     @remove = true
  6594.     @@count -= 1
  6595.     @@priority = 0 if @@count <= 0
  6596.   end
  6597.   #--------------------------------------------------------------------------
  6598.   # ● ディレイが残っている?
  6599.   #  サブクラスの update メソッドで使用します。
  6600.   #--------------------------------------------------------------------------
  6601.   def delay?
  6602.     @delay -= 1
  6603.     self.visible = (@delay <= 0)
  6604.     !self.visible
  6605.   end
  6606.   #--------------------------------------------------------------------------
  6607.   # ● ポップアップ消去済み?
  6608.   #--------------------------------------------------------------------------
  6609.   def removed?
  6610.     @remove
  6611.   end  
  6612.   #--------------------------------------------------------------------------
  6613.   # ● 座標更新
  6614.   #--------------------------------------------------------------------------
  6615.   def update_xy
  6616.     self.x = @rx
  6617.     self.y = @ry
  6618.     self.z = @rz
  6619.   end
  6620.   #--------------------------------------------------------------------------
  6621.   # ● ポップアップ位置の設定
  6622.   #--------------------------------------------------------------------------
  6623.   def set_position
  6624.     @rx = @battler.screen_x
  6625.     if @battler.actor?
  6626.       pos = LNX11::ACTOR_POPUP_POSITION
  6627.     else
  6628.       pos = [LNX11::ENEMY_POPUP_POSITION, 2].min
  6629.     end
  6630.     case pos
  6631.     when 0 ; @ry = @battler.screen_y        # 足元
  6632.     when 1 ; @ry = @battler.screen_y_center # 中心
  6633.     when 2 ; @ry = @battler.screen_y_top    # 頭上
  6634.     when 3 ; @ry = Graphics.height + LNX11::ACTOR_POPUP_Y # Y座標統一(アクター)
  6635.     end
  6636.   end
  6637.   #--------------------------------------------------------------------------
  6638.   # ● 描画するテキストの矩形を取得
  6639.   #--------------------------------------------------------------------------
  6640.   def text_size(str, name, size, bold = false)
  6641.     @@buf_bitmap = Bitmap.new(4, 4) if !@@buf_bitmap || @@buf_bitmap.disposed?
  6642.     @@buf_bitmap.font.name = name
  6643.     @@buf_bitmap.font.size = size
  6644.     @@buf_bitmap.font.bold = bold
  6645.     return @@buf_bitmap.text_size(str)
  6646.   end
  6647.   #--------------------------------------------------------------------------
  6648.   # ● 数字ビットマップの取得
  6649.   #--------------------------------------------------------------------------
  6650.   def bitmap_number(size = :large)
  6651.     return @@cache_number[size == :large ? 0 : 1]
  6652.   end
  6653.   #--------------------------------------------------------------------------
  6654.   # ● 数字ビットマップキャッシュの作成
  6655.   #--------------------------------------------------------------------------
  6656.   def create_number
  6657.     return if @@cache_number[0] && !@@cache_number[0].disposed?
  6658.     n_index = NUMBER_COLOR_SIZE
  6659.     @@cache_number.clear
  6660.     colors = LNX11::POPUP_COLOR.values # 色
  6661.     name = LNX11::NUMBER_FONT
  6662.     # 大・小の 2 パターンを作成する(ループ)
  6663.     [LNX11::LARGE_NUMBER, LNX11::SMALL_NUMBER].each_with_index do |n_size, i|
  6664.       next if get_number(i)
  6665.       size = n_size[:fontsize]
  6666.       # 数字の幅・高さ
  6667.       w = NUMBERS.collect{|n| text_size(n.to_s, name, size).width}.max + 4
  6668.       nh = NUMBERS.collect{|n| text_size(n.to_s, name, size).height}.max
  6669.       h = n_size[:line_height]
  6670.       @@w[i] = w
  6671.       @@h[i] = h
  6672.       # ビットマップ作成
  6673.       bitmap = Bitmap.new(w * NUMBERS.size, h * [colors.size, n_index].min)
  6674.       bitmap.font.name = LNX11::NUMBER_FONT
  6675.       bitmap.font.size = n_size[:fontsize]
  6676.       y = ((h - nh) / 2) - 1
  6677.       # 色ごとに分けて描画する(ループ)
  6678.       n_index.times do |col|
  6679.         # 色を変更
  6680.         bitmap.font.color.set(colors[col][0])
  6681.         bitmap.font.out_color.set(colors[col][1])
  6682.         # 文字ごとに分けて描画(ループ)
  6683.         NUMBERS.size.times do |num|
  6684.           bitmap.draw_text(num * w, (col * h) + y, w, nh, NUMBERS[num], 2)
  6685.         end
  6686.       end
  6687.       @@cache_number.push(bitmap)
  6688.     end
  6689.     p "LNX11a:数字ビットマップのキャッシュを作成しました。"
  6690.     # 数字ビットマップを表示する(テスト用)
  6691.     # s = Sprite.new
  6692.     # s.z = 1000000
  6693.     # s.bitmap = @@cache_number[1] # 0 or 1
  6694.     # loop do Graphics.update end
  6695.   end
  6696.   #--------------------------------------------------------------------------
  6697.   # ● 数字ビットマップの取得
  6698.   #--------------------------------------------------------------------------
  6699.   def get_number(i)
  6700.     case i
  6701.     when 0 # 大
  6702.       return false if LNX11::LARGE_NUMBER_NAME.empty?
  6703.       bitmap = Cache.system(LNX11::LARGE_NUMBER_NAME)
  6704.     when 1 # 小
  6705.       return false if LNX11::SMALL_NUMBER_NAME.empty?
  6706.       bitmap = Cache.system(LNX11::SMALL_NUMBER_NAME)
  6707.     end
  6708.     @@cache_number.push(bitmap)
  6709.     @@w[i] = bitmap.width / NUMBERS.size
  6710.     @@h[i] = bitmap.height / NUMBER_COLOR_SIZE
  6711.     true
  6712.   end
  6713.   #--------------------------------------------------------------------------
  6714.   # ● ダメージ数を描画したビットマップの取得
  6715.   #--------------------------------------------------------------------------
  6716.   def number(num, color, size = :large, deco = nil)
  6717.     # 数値を文字列の配列にする
  6718.     numbers = (num.abs.to_s).split(//)
  6719.     # 色番号を取得
  6720.     color_index = COLOR_KEYS.index(color)
  6721.     # ポップアップサイズを設定
  6722.     n_bitmap = bitmap_number(size)
  6723.     if size == :large
  6724.       n_size = LNX11::LARGE_NUMBER
  6725.       i = 0
  6726.     else
  6727.       n_size = LNX11::SMALL_NUMBER
  6728.       i = 1
  6729.     end
  6730.     spacing = n_size[:spacing]
  6731.     w = @@w[i]
  6732.     h = @@h[i]
  6733.     # ダメージ値のビットマップサイズ
  6734.     @bw = w * numbers.size + spacing * (numbers.size - 1)
  6735.     @bh = h
  6736.     # 修飾文字の描画
  6737.     @offset_x = @offset_y = 0
  6738.     text_bitmap = deco_text(deco,color,n_size[:fontsize]) if deco[1] >= 0
  6739.     # ビットマップを作成
  6740.     bitmap = Bitmap.new(@bw, @bh)
  6741.     # 塗りつぶし(テスト用)
  6742.     # bitmap.fill_rect(bitmap.rect, Color.new(0,0,0,128))
  6743.     # ダメージ値を描画
  6744.     rect = Rect.new(0, h * color_index, w, h)
  6745.     numbers.size.times do |n|
  6746.       rect.x = numbers[n].to_i * w
  6747.       bitmap.blt(w * n + spacing * n + @offset_x, @offset_y, n_bitmap, rect)
  6748.     end
  6749.     # 修飾文字の描画をコールバック
  6750.     @decoblt.call(bitmap) if @decoblt
  6751.     @decoblt = nil
  6752.     # ビットマップを返す
  6753.     bitmap
  6754.   end
  6755.   #--------------------------------------------------------------------------
  6756.   # ● 修飾文字の描画
  6757.   #--------------------------------------------------------------------------
  6758.   def deco_text(deco, color, sizerate)
  6759.     # 元の幅・高さ
  6760.     ow = @bw
  6761.     oh = @bh
  6762.     case deco[1]   
  6763.     when 2 # ダメージ値の下
  6764.       # テキストのビットマップを取得
  6765.       size = decosize(deco[0], sizerate, :top_bottom)
  6766.       text_bitmap = text(deco[0], color, size)
  6767.       # テキストの幅・高さ
  6768.       tw = text_bitmap.width
  6769.       th = text_bitmap.height * 0.8
  6770.       # 最終的なビットマップのサイズ
  6771.       @bw = [@bw, tw].max
  6772.       @bh += th
  6773.       # ダメージ値の描画位置の修正
  6774.       @offset_x = (@bw - ow) / 2
  6775.       @offset_y = 0
  6776.       # 修飾文字の描画位置を設定
  6777.       x = (@bw - tw) / 2
  6778.       y = oh * 0.8
  6779.     when 4 # ダメージ値の左
  6780.       # テキストのビットマップを取得
  6781.       size = decosize(deco[0], sizerate, :left_right)
  6782.       text_bitmap = text(deco[0], color, size)
  6783.       # テキストの幅・高さ
  6784.       tw = text_bitmap.width
  6785.       th = text_bitmap.height
  6786.       # 最終的なビットマップのサイズ
  6787.       @bw += tw
  6788.       @bh = [@bh, th].max
  6789.       # ダメージ値の描画位置の修正
  6790.       @offset_x = tw
  6791.       @offset_y = (@bh - oh) / 2
  6792.       # 修飾文字の描画位置を設定
  6793.       x = 2
  6794.       y = (@bh - th) / 2
  6795.     when 6 # ダメージ値の右
  6796.       # テキストのビットマップを取得
  6797.       size = decosize(deco[0], sizerate, :left_right)
  6798.       text_bitmap = text(deco[0], color, size)
  6799.       # テキストの幅・高さ
  6800.       tw = text_bitmap.width
  6801.       th = text_bitmap.height
  6802.       # 最終的なビットマップのサイズ
  6803.       @bw += tw
  6804.       @bh = [@bh, th].max
  6805.       # ダメージ値の描画位置の修正
  6806.       @offset_x = 0
  6807.       @offset_y = (@bh - oh) / 2
  6808.       # 修飾文字の描画位置を設定
  6809.       x = ow
  6810.       y = (@bh - th) / 2
  6811.     when 8 # ダメージ値の上
  6812.       # テキストのビットマップを取得
  6813.       size = decosize(deco[0], sizerate, :top_bottom)
  6814.       text_bitmap = text(deco[0], color, size)
  6815.       # テキストの幅・高さ
  6816.       tw = text_bitmap.width
  6817.       th = text_bitmap.height * 0.8
  6818.       # 最終的なビットマップのサイズ
  6819.       @bw = [@bw, tw].max
  6820.       @bh += th
  6821.       # ダメージ値の描画位置の修正
  6822.       @offset_x = (@bw - ow) / 2
  6823.       @offset_y = @bh - oh
  6824.       # 修飾文字の描画位置を設定
  6825.       x = (@bw - tw) / 2
  6826.       y = 0
  6827.     end
  6828.     # 修飾文字の描画(コールバック)
  6829.     @decoblt = Proc.new {|bitmap|
  6830.     bitmap.blt(x, y, text_bitmap, text_bitmap.rect)
  6831.     text_bitmap.dispose}
  6832.     return text_bitmap
  6833.   end
  6834.   #--------------------------------------------------------------------------
  6835.   # ● 修飾文字のサイズ
  6836.   #--------------------------------------------------------------------------
  6837.   def decosize(text, size, pos)
  6838.     if text.length != text.bytesize
  6839.       return size * LNX11::TEXT_SIZERATE[pos] * LNX11::TEXT_SIZERATE_MCS
  6840.     else
  6841.       return size * LNX11::TEXT_SIZERATE[pos]
  6842.     end
  6843.   end
  6844.   #--------------------------------------------------------------------------
  6845.   # ● テキストを描画したビットマップの取得
  6846.   #  ステートやダメージ値の修飾文字の描画に使用します。
  6847.   #--------------------------------------------------------------------------
  6848.   def text(text, color, size = :large, buff_data = [-1, -1])
  6849.     # キャッシュがあればそれを返す(無ければ作成)
  6850.     key = text + color.to_s + size.to_s
  6851.     if @@cache_text[key] && !@@cache_text[key].disposed?
  6852.       return @@cache_text[key].clone
  6853.     end
  6854.     # 用語の置き換え
  6855.     text.gsub!("\hp") { Vocab::hp_a } if text.include?("\hp")
  6856.     text.gsub!("\mp") { Vocab::mp_a } if text.include?("\mp")
  6857.     text.gsub!("\tp") { Vocab::tp_a } if text.include?("\tp")
  6858.     # <<ver1.10>> テキストの頭に _ があれば対応する画像ファイルを参照する
  6859.     if text[/^[\_]./]
  6860.       bitmap = get_text_bitmap(text, color, size)
  6861.       # キャッシュに保存
  6862.       @@cache_text[key] = bitmap
  6863.       # ビットマップを返す
  6864.       return bitmap.clone
  6865.     end
  6866.     # <<ver1.10>>
  6867.     # 能力強化/弱体のポップアップで、ファイル名が指定されていればそれを返す
  6868.     if buff_data[0] >= 0 &&
  6869.       (size == :large && !LNX11::LARGE_BUFFS_NAME.empty?) ||
  6870.       (size == :small && !LNX11::SMALL_BUFFS_NAME.empty?)
  6871.       bitmap = get_buff_bitmap(buff_data, size)
  6872.       # キャッシュに保存
  6873.       @@cache_text[key] = bitmap
  6874.       # ビットマップを返す
  6875.       return bitmap.clone
  6876.     end
  6877.     # テキストにマルチバイト文字があれば日本語用フォントを使う
  6878.     if text.length != text.bytesize
  6879.       fontname = LNX11::TEXT_FONT_MCS
  6880.       sizerate = LNX11::TEXT_SIZERATE[:normal] * LNX11::TEXT_SIZERATE_MCS
  6881.     else
  6882.       fontname = LNX11::TEXT_FONT
  6883.       sizerate = LNX11::TEXT_SIZERATE[:normal]
  6884.     end
  6885.     # ポップアップサイズを設定
  6886.     case size
  6887.     when :large ; fontsize = LNX11::LARGE_NUMBER[:fontsize] * sizerate
  6888.     when :small ; fontsize = LNX11::SMALL_NUMBER[:fontsize] * sizerate
  6889.     else        ; fontsize = size
  6890.     end
  6891.     # テキストサイズ計算
  6892.     rect = text_size(text, fontname, fontsize)
  6893.     rect.width += 2
  6894.     # ビットマップを作成
  6895.     bitmap = Bitmap.new(rect.width, rect.height)
  6896.     # 塗りつぶし(テスト用)
  6897.     # bitmap.fill_rect(bitmap.rect, Color.new(0,0,0,128))
  6898.     # フォント設定
  6899.     bitmap.font.name = fontname
  6900.     bitmap.font.size = fontsize
  6901.     bitmap.font.color.set(LNX11::POPUP_COLOR[color][0])
  6902.     bitmap.font.out_color.set(LNX11::POPUP_COLOR[color][1])
  6903.     # テキスト描画
  6904.     bitmap.draw_text(rect, text, 1)
  6905.     # キャッシュに保存
  6906.     @@cache_text[key] = bitmap
  6907.     # ビットマップを返す
  6908.     bitmap.clone
  6909.   end
  6910.   #--------------------------------------------------------------------------
  6911.   # ● 能力強化/弱体ビットマップの取得 <<ver1.10>>
  6912.   #--------------------------------------------------------------------------
  6913.   def get_buff_bitmap(buff_data, size)
  6914.     case size
  6915.     when :large ; src_bitmap = Cache.system(LNX11::LARGE_BUFFS_NAME)
  6916.     when :small ; src_bitmap = Cache.system(LNX11::SMALL_BUFFS_NAME)
  6917.     end
  6918.     src_rect = Rect.new
  6919.     src_rect.width  = src_bitmap.width  / 2
  6920.     src_rect.height = src_bitmap.height / 12
  6921.     src_rect.x = (buff_data[0] / 4) * src_rect.width
  6922.     src_rect.y = (buff_data[0] % 4) * src_rect.height * 3 +
  6923.                   buff_data[1] * src_rect.height
  6924.     bitmap = Bitmap.new(src_rect.width, src_rect.height)
  6925.     bitmap.blt(0, 0, src_bitmap, src_rect)
  6926.     bitmap
  6927.   end
  6928.   #--------------------------------------------------------------------------
  6929.   # ● テキストビットマップの取得 <<ver1.10>>
  6930.   #--------------------------------------------------------------------------
  6931.   def get_text_bitmap(text, color, size)
  6932.     # クリティカルカラーかつ、弱点/耐性なら参照するビットマップを変更
  6933.     if LNX11::POPUP_COLOR[color] == LNX11::POPUP_COLOR[:critical] &&
  6934.       (text == LNX11::DECORATION_NUMBER[:weakness][0] ||
  6935.        text == LNX11::DECORATION_NUMBER[:resist][0])
  6936.       # ファイル名に _critcolor を加える
  6937.       text += "_critcolor"
  6938.     end
  6939.     # MPダメージ/回復(符号なし)なら参照するビットマップを変更
  6940.     if text == LNX11::DECORATION_NUMBER[:mp_damage][0]
  6941.       # カラーに応じてファイル名を変更
  6942.       case LNX11::POPUP_COLOR[color]
  6943.       when LNX11::POPUP_COLOR[:mp_damage]   ; text += "_damage"
  6944.       when LNX11::POPUP_COLOR[:mp_recovery] ; text += "_recovery"
  6945.       end
  6946.     end
  6947.     # popup_xxxxxx_(large or small)
  6948.     Cache.system("popup" + text + (size == :large ? "_large" : "_small"))
  6949.   end
  6950. end

  6951. #==============================================================================
  6952. # ■ [追加]:Sprite_PopupSpring
  6953. #------------------------------------------------------------------------------
  6954. #  通常の跳ねるポップアップ。
  6955. #==============================================================================

  6956. class Sprite_PopupSpring < Sprite_PopupBase
  6957.   #--------------------------------------------------------------------------
  6958.   # ● ポップアップ Z 座標
  6959.   #--------------------------------------------------------------------------
  6960.   def base_z
  6961.     14
  6962.   end
  6963.   #--------------------------------------------------------------------------
  6964.   # ● 開始処理
  6965.   #--------------------------------------------------------------------------
  6966.   def start
  6967.     # 動き設定
  6968.     set_movement
  6969.     # ディレイ設定 同じタイプのポップアップが重ならないようにする
  6970.     if @popup_size == :small
  6971.       self.oy -= @battler.popup_delay[1]
  6972.       @delay_clear = (@delay == 0)
  6973.       dy = self.bitmap.height * 0.8
  6974.       @battler.popup_delay[1] += dy
  6975.       @delay = 0
  6976.     end
  6977.   end
  6978.   #--------------------------------------------------------------------------
  6979.   # ● 終了処理
  6980.   #--------------------------------------------------------------------------  
  6981.   def terminate
  6982.     # 一番上のポップアップなら、ディレイを初期化する
  6983.     @battler.popup_delay[1] = 0 if @delay_clear
  6984.   end
  6985.   #--------------------------------------------------------------------------
  6986.   # ● 投射運動の設定
  6987.   #--------------------------------------------------------------------------
  6988.   def set_movement
  6989.     if @popup_size == :large
  6990.       movement = LNX11::LARGE_MOVEMENT
  6991.     else
  6992.       movement = LNX11::SMALL_MOVEMENT
  6993.     end
  6994.     @fall       = -movement[:inirate]
  6995.     @gravity    =  movement[:gravity]
  6996.     @side       =  movement[:side_scatter] * rand(0) * (rand(2) == 0 ? -1 : 1)
  6997.     @ref_move   =  movement[:ref_height]
  6998.     @ref_factor =  movement[:ref_factor]
  6999.     @ref_count  =  movement[:ref_count]
  7000.     @duration   =  movement[:duration]
  7001.     @fadeout    =  movement[:fadeout]
  7002.   end
  7003.   #--------------------------------------------------------------------------
  7004.   # ● フレーム更新
  7005.   #--------------------------------------------------------------------------
  7006.   def update_popup
  7007.     update_freefall
  7008.   end
  7009.   #--------------------------------------------------------------------------
  7010.   # ● 投射運動の更新
  7011.   #--------------------------------------------------------------------------
  7012.   def update_freefall
  7013.     if @ref_count >= 0
  7014.       # X:左右移動
  7015.       @rx += @side
  7016.       # Y:自由落下
  7017.       @ry += @fall
  7018.       @ref_move -= @fall
  7019.       @fall += @gravity
  7020.       # 跳ね返り
  7021.       if @ref_move <= 0 && @fall >= 0
  7022.         @ref_count -= 1
  7023.         @fall = -@fall * @ref_factor
  7024.       end      
  7025.     end
  7026.   end
  7027. end

  7028. #==============================================================================
  7029. # ■ [追加]:Sprite_PopupRising
  7030. #------------------------------------------------------------------------------
  7031. #  少しずつ上昇するポップアップ。
  7032. #==============================================================================

  7033. class Sprite_PopupRising < Sprite_PopupBase
  7034.   #--------------------------------------------------------------------------
  7035.   # ● ポップアップ Z 座標
  7036.   #--------------------------------------------------------------------------
  7037.   def base_z
  7038.     6
  7039.   end
  7040.   #--------------------------------------------------------------------------
  7041.   # ● 開始処理
  7042.   #--------------------------------------------------------------------------
  7043.   def start
  7044.     # 動き設定
  7045.     set_movement
  7046.     self.opacity = 0
  7047.     d = self.bitmap.height * LNX11::RISE_MOVEMENT[:line_spacing]
  7048.     @delay_count = d / @rising_speed
  7049.     @battler.popup_delay[2] += @delay_count
  7050.   end
  7051.   #--------------------------------------------------------------------------
  7052.   # ● 動きの設定
  7053.   #--------------------------------------------------------------------------
  7054.   def set_movement
  7055.     @rising_speed = LNX11::RISE_MOVEMENT[:rising_speed]
  7056.     @duration = LNX11::RISE_MOVEMENT[:duration]
  7057.     @fadeout  = LNX11::RISE_MOVEMENT[:fadeout]
  7058.   end
  7059.   #--------------------------------------------------------------------------
  7060.   # ● フレーム更新
  7061.   #--------------------------------------------------------------------------
  7062.   def update_popup
  7063.     @delay_count -= 1
  7064.     @battler.popup_delay[2] -= 1 if @delay_count >= 0
  7065.     @ry -= @rising_speed # すこしずつ上昇
  7066.     self.opacity += 32 if @duration > 0
  7067.   end
  7068. end

  7069. #==============================================================================
  7070. # ■ [追加]:Sprite_PopupSliding
  7071. #------------------------------------------------------------------------------
  7072. #  スライド表示するポップアップ。
  7073. #==============================================================================

  7074. class Sprite_PopupSliding < Sprite_PopupBase
  7075.   #--------------------------------------------------------------------------
  7076.   # ● ポップアップ Z 座標
  7077.   #--------------------------------------------------------------------------
  7078.   def base_z
  7079.     8
  7080.   end
  7081.   #--------------------------------------------------------------------------
  7082.   # ● 開始処理
  7083.   #--------------------------------------------------------------------------
  7084.   def start
  7085.     # 動き設定
  7086.     set_movement
  7087.     d = self.bitmap.height * LNX11::SLIDE_MOVEMENT[:line_spacing]
  7088.     self.oy += @delay + d / 2 if @delay > 0
  7089.     self.opacity = 0
  7090.     # ディレイ設定 同じタイプのポップアップが重ならないようにする
  7091.     @delay_clear = (@delay == 0)
  7092.     @battler.popup_delay[3] += (@delay <= 0 ? d / 2 : d)
  7093.     @delay = 0
  7094.   end
  7095.   #--------------------------------------------------------------------------
  7096.   # ● 終了処理
  7097.   #--------------------------------------------------------------------------  
  7098.   def terminate
  7099.     # 一番下のポップアップなら、ディレイを初期化する
  7100.     @battler.popup_delay[3] = 0 if @delay_clear
  7101.   end
  7102.   #--------------------------------------------------------------------------
  7103.   # ● 動きの設定
  7104.   #--------------------------------------------------------------------------
  7105.   def set_movement
  7106.     @x_speed  = LNX11::SLIDE_MOVEMENT[:x_speed]
  7107.     @duration = LNX11::SLIDE_MOVEMENT[:duration]
  7108.     @fadeout  = LNX11::SLIDE_MOVEMENT[:fadeout]
  7109.     # フェードインのスライド分だけ X を移動
  7110.     @rx -= @x_speed * 255.0 / @fadeout
  7111.   end
  7112.   #--------------------------------------------------------------------------
  7113.   # ● フレーム更新
  7114.   #--------------------------------------------------------------------------
  7115.   def update_popup
  7116.     @rx += @x_speed if opacity != 255 # スライド
  7117.     self.opacity += @fadeout if @duration > 0
  7118.   end
  7119. end

  7120. #==============================================================================
  7121. # ■ [追加]:Sprite_PopupOverlay
  7122. #------------------------------------------------------------------------------
  7123. #  オーバーレイポップアップ。自身の複製を加算合成で重ね合わせます。
  7124. #==============================================================================

  7125. class Sprite_PopupOverlay < Sprite_PopupBase
  7126.   #--------------------------------------------------------------------------
  7127.   # ● ポップアップ Z 座標
  7128.   #--------------------------------------------------------------------------
  7129.   def base_z
  7130.     10
  7131.   end
  7132.   #--------------------------------------------------------------------------
  7133.   # ● 開始処理
  7134.   #--------------------------------------------------------------------------
  7135.   def start
  7136.     @duration = LNX11::OVERLAY_MOVEMENT[:duration]
  7137.     @fadeout  = LNX11::OVERLAY_MOVEMENT[:fadeout]
  7138.     # オーバーレイの作成
  7139.     create_overlay
  7140.   end
  7141.   #--------------------------------------------------------------------------
  7142.   # ● 終了処理
  7143.   #--------------------------------------------------------------------------
  7144.   def terminate
  7145.     @overlay.dispose
  7146.     @overlay = nil
  7147.   end
  7148.   #--------------------------------------------------------------------------
  7149.   # ● オーバーレイ(複製)の作成
  7150.   #--------------------------------------------------------------------------
  7151.   def create_overlay
  7152.     @overlay = Sprite.new
  7153.     @overlay.bitmap   = self.bitmap
  7154.     @overlay.viewport = self.viewport
  7155.     @overlay.ox = self.ox
  7156.     @overlay.oy = self.oy
  7157.     @overlay.visible = false
  7158.     @overlay.blend_type = 1
  7159.   end
  7160.   #--------------------------------------------------------------------------
  7161.   # ● フレーム更新
  7162.   #--------------------------------------------------------------------------
  7163.   def update_popup
  7164.     self.opacity += @fadeout * 2 if @duration > 0
  7165.   end
  7166.   #--------------------------------------------------------------------------
  7167.   # ● フレーム更新
  7168.   #--------------------------------------------------------------------------
  7169.   def update
  7170.     super
  7171.     update_overlay
  7172.   end
  7173.   #--------------------------------------------------------------------------
  7174.   # ● オーバーレイの更新
  7175.   #--------------------------------------------------------------------------
  7176.   def update_overlay
  7177.     return if self.disposed? || @overlay.opacity == 0
  7178.     @overlay.x = self.x
  7179.     @overlay.y = self.y
  7180.     @overlay.z = self.z
  7181.     # 拡大・消去
  7182.     @overlay.zoom_x += 0.16
  7183.     @overlay.zoom_y += 0.12
  7184.     @overlay.opacity -= 20
  7185.     @overlay.visible = (@overlay.opacity != 0)
  7186.   end
  7187. end

  7188. #==============================================================================
  7189. # ■ [追加]:Sprite_PopupLevelUp
  7190. #------------------------------------------------------------------------------
  7191. #  レベルアップのポップアップ。スライドポップアップを継承しています。
  7192. #==============================================================================

  7193. class Sprite_PopupLevelUp < Sprite_PopupSliding
  7194.   #--------------------------------------------------------------------------
  7195.   # ● ポップアップ Z 座標
  7196.   #--------------------------------------------------------------------------
  7197.   def base_z
  7198.     32
  7199.   end
  7200.   #--------------------------------------------------------------------------
  7201.   # ● ポップアップ位置の設定
  7202.   #--------------------------------------------------------------------------
  7203.   def set_position
  7204.     @rx = @battler.screen_x - LNX11::ACTOR_OFFSET[:x]
  7205.     case LNX11::LEVELUP_POPUP_POSITION
  7206.     when 0 ; @ry = @battler.screen_y        # 足元
  7207.     when 1 ; @ry = @battler.screen_y_center # 中心
  7208.     when 2 ; @ry = @battler.screen_y_top    # 頭上
  7209.     when 3 ; @ry = Graphics.height + LNX11::LEVELUP_POPUP_Y # Y座標統一
  7210.     end
  7211.   end
  7212.   #--------------------------------------------------------------------------
  7213.   # ● フレーム更新
  7214.   #--------------------------------------------------------------------------
  7215.   def update_popup
  7216.     super
  7217.     # リザルト中なら自動的に消去しない
  7218.     @duration += 1 if $game_troop.all_dead? || $game_message.busy?
  7219.   end
  7220. end

  7221. #==============================================================================
  7222. # ■ Bitmap
  7223. #==============================================================================

  7224. class Bitmap
  7225.   #--------------------------------------------------------------------------
  7226.   # ● [追加]:カーソル用三角形の描画
  7227.   #--------------------------------------------------------------------------
  7228.   def lnx_cursor_triangle(size, color, oy = 0, grad = 1)
  7229.     color = color.clone
  7230.     x = (self.width - size) / 2
  7231.     y = (self.height - size) / 2 + oy
  7232.     rect = Rect.new(x, y, size, 1)
  7233.     count = size / 2
  7234.     minus = 128 / count / 2
  7235.     count.times do
  7236.       clear_rect(rect)
  7237.       fill_rect(rect, color)
  7238.       color.red   = [color.red   - minus * grad, 0].max
  7239.       color.green = [color.green - minus * grad, 0].max
  7240.       color.blue  = [color.blue  - minus * grad, 0].max
  7241.       rect.y += rect.height
  7242.       clear_rect(rect)
  7243.       fill_rect(rect, color)
  7244.       color.red   = [color.red   - minus * grad, 0].max
  7245.       color.green = [color.green - minus * grad, 0].max
  7246.       color.blue  = [color.blue  - minus * grad, 0].max
  7247.       rect.x += 1
  7248.       rect.y += rect.height
  7249.       rect.width -= 2
  7250.     end
  7251.   end
  7252. end

  7253. #==============================================================================
  7254. # ■ [追加]:Sprite_TargetCursor
  7255. #------------------------------------------------------------------------------
  7256. #  対象選択されているバトラーや行動選択中のアクターを示すアローカーソルです。
  7257. #==============================================================================
  7258. class Sprite_TargetCursor < Sprite
  7259.   #--------------------------------------------------------------------------
  7260.   # ● クラス変数
  7261.   #--------------------------------------------------------------------------
  7262.   @@cursor_cache = nil
  7263.   #--------------------------------------------------------------------------
  7264.   # ● 公開インスタンス変数
  7265.   #--------------------------------------------------------------------------
  7266.   attr_accessor :battler     # バトラー
  7267.   attr_accessor :blink       # 点滅(対象の選択中)
  7268.   #--------------------------------------------------------------------------
  7269.   # ● オブジェクト初期化
  7270.   #--------------------------------------------------------------------------
  7271.   def initialize(viewport = nil)
  7272.     super(viewport)
  7273.     @wait = LNX11::CURSOR_ANI_SPEED
  7274.     @speed = [LNX11::CURSOR_SPEED, 1].max
  7275.     @battler = nil
  7276.     @sub_cursor = []
  7277.     @blink = false
  7278.     self.bitmap = cursor_bitmap
  7279.     partition = self.bitmap.width / self.height
  7280.     self.src_rect.set(0, 0, self.width / partition, self.height)
  7281.     self.ox = self.width / 2
  7282.     self.oy = self.height / 2
  7283.     self.x = @rx = @tx = 0
  7284.     self.y = @ry = @ty = 0
  7285.     self.z = 98
  7286.     self.visible = false
  7287.   end
  7288.   #--------------------------------------------------------------------------
  7289.   # ● 解放
  7290.   #--------------------------------------------------------------------------  
  7291.   def dispose
  7292.     dispose_subcursor
  7293.     super
  7294.   end
  7295.   #--------------------------------------------------------------------------
  7296.   # ● サブカーソル作成
  7297.   #  メンバー全体にカーソルを表示するために複数のカーソルを作成します。
  7298.   #--------------------------------------------------------------------------  
  7299.   def create_subcursor(members)
  7300.     return unless @sub_cursor.empty?
  7301.     members.each_with_index do |battler, i|
  7302.       @sub_cursor[i] = Sprite_TargetCursor.new(self.viewport)
  7303.       @sub_cursor[i].set(@rx, @ry)
  7304.       @sub_cursor[i].set(battler, true)
  7305.     end
  7306.   end
  7307.   #--------------------------------------------------------------------------
  7308.   # ● サブカーソル解放
  7309.   #--------------------------------------------------------------------------  
  7310.   def dispose_subcursor
  7311.     @sub_cursor.each {|sprite| sprite.dispose }
  7312.     @sub_cursor = []
  7313.   end
  7314.   #--------------------------------------------------------------------------
  7315.   # ● サブカーソル更新
  7316.   #--------------------------------------------------------------------------  
  7317.   def update_subcursor
  7318.     @sub_cursor.each {|sprite| sprite.update }
  7319.   end
  7320.   #--------------------------------------------------------------------------
  7321.   # ● ビットマップの設定
  7322.   #--------------------------------------------------------------------------
  7323.   def cursor_bitmap
  7324.     if !LNX11::CURSOR_NAME.empty?
  7325.       return Cache.system(LNX11::CURSOR_NAME)
  7326.     else
  7327.       # カーソルファイル名が指定されていなければRGSS側で生成
  7328.       return @@cursor_cache if @@cursor_cache && !@@cursor_cache.disposed?
  7329.       @@cursor_cache = Bitmap.new(32, 32)
  7330.       color = Color.new(0, 0, 0)
  7331.       @@cursor_cache.lnx_cursor_triangle(26, color, 2)
  7332.       2.times {@@cursor_cache.blur}
  7333.       color.set(255, 255, 255)
  7334.       @@cursor_cache.lnx_cursor_triangle(24, color, 1, 0.5)
  7335.       tone = LNX11::CURSOR_TONE ? LNX11::CURSOR_TONE : $game_system.window_tone
  7336.       r = 118 + tone.red
  7337.       g = 118 + tone.green
  7338.       b = 118 + tone.blue
  7339.       color.set(r, g, b, 232)
  7340.       @@cursor_cache.lnx_cursor_triangle(20, color,  0)
  7341.       @@cursor_cache.lnx_cursor_triangle(20, color,  1)
  7342.       p "LNX11a:カーソルビットマップを作成しました。"
  7343.       return @@cursor_cache
  7344.     end
  7345.   end
  7346.   #--------------------------------------------------------------------------
  7347.   # ● カーソルの表示
  7348.   #--------------------------------------------------------------------------
  7349.   def show
  7350.     self.x = @rx = @tx
  7351.     self.y = @ry = @ty
  7352.     self.visible = true
  7353.   end
  7354.   #--------------------------------------------------------------------------
  7355.   # ● カーソルの非表示
  7356.   #--------------------------------------------------------------------------
  7357.   def hide
  7358.     dispose_subcursor
  7359.     @battler = nil
  7360.     self.visible = false
  7361.   end
  7362.   #--------------------------------------------------------------------------
  7363.   # ● 移動平均
  7364.   #--------------------------------------------------------------------------
  7365.   def sma(a, b, p)
  7366.     # a = 目標位置 b = 現在地
  7367.     return a if a == b || (a - b).abs < 0.3 || p == 1
  7368.     result = ((a + b * (p.to_f - 1)) / p.to_f)
  7369.     return (a - result).abs <= 1.0 ? (b < a ? b + 0.3 : b - 0.3) : result
  7370.   end
  7371.   #--------------------------------------------------------------------------
  7372.   # ● フレーム更新
  7373.   #--------------------------------------------------------------------------
  7374.   def update
  7375.     update_subcursor
  7376.     self.opacity = @sub_cursor.empty? ? 255 : 0
  7377.     return if !visible || !@sub_cursor.empty?
  7378.     super
  7379.     # 点滅
  7380.     if LNX11::CURSOR_BLINK
  7381.       self.blend_type = @blink && Graphics.frame_count / 3 % 2 == 0 ? 1 : 0
  7382.     end
  7383.     # アニメーションを進める
  7384.     @wait -= 1
  7385.     if @wait <= 0
  7386.       @wait += LNX11::CURSOR_ANI_SPEED
  7387.       self.src_rect.x += self.width
  7388.       self.src_rect.x = 0 if self.src_rect.x >= self.bitmap.width
  7389.     end
  7390.     # カーソルの座標を更新
  7391.     set_xy if @battler && @sub_cursor.empty?
  7392.     self.x = @rx = sma(@tx, @rx, @speed)
  7393.     self.y = @ry = sma(@ty, @ry, @speed)
  7394.   end
  7395.   #--------------------------------------------------------------------------
  7396.   # ● カーソル位置の設定
  7397.   #--------------------------------------------------------------------------
  7398.   def set(*args)
  7399.     if args[0].is_a?(Numeric)
  7400.       # 引数一つ目が数値なら、XY指定
  7401.       @battler = nil
  7402.       set_xy(args[0], args[1])
  7403.       @blink = args[2] ? args[2] : false
  7404.     else
  7405.       # バトラーorシンボル指定
  7406.       if @battler != args[0]
  7407.         @battler = args[0]
  7408.         dispose_subcursor
  7409.         case args[0]
  7410.         when :party        ; create_subcursor($game_party.members)
  7411.         when :troop        ; create_subcursor($game_troop.alive_members)
  7412.         when :troop_random ; create_subcursor($game_troop.alive_members)
  7413.         else ; args[0] ? set_xy : hide
  7414.         end
  7415.       end
  7416.       @blink = args[1] ? args[1] : false
  7417.     end
  7418.     # スピードが1かカーソルが非表示なら表示に変える
  7419.     show if @sub_cursor.empty? && (@speed == 1 || !visible)
  7420.   end
  7421.   #--------------------------------------------------------------------------
  7422.   # ● カーソル位置をバトラーの位置に設定
  7423.   #--------------------------------------------------------------------------
  7424.   def set_xy(x = nil, y = nil)
  7425.     if x
  7426.       # 直接指定
  7427.       x += LNX11::CURSOR_OFFSET[:x]
  7428.       y += LNX11::CURSOR_OFFSET[:y]
  7429.     else
  7430.       # バトラーの座標
  7431.       x = @battler.screen_x + LNX11::CURSOR_OFFSET[:x]
  7432.       y = @battler.screen_y_top + LNX11::CURSOR_OFFSET[:y]
  7433.     end
  7434.     @tx = x
  7435.     minmax = LNX11::CURSOR_MINMAX
  7436.     @ty = [[y, minmax[:min] + self.oy].max, minmax[:max]].min
  7437.   end
  7438. end

  7439. #==============================================================================
  7440. # ■ [追加]:Sprite_OneLine_BattleLog
  7441. #------------------------------------------------------------------------------
  7442. #  バトルログを動的に表示するスプライトです。単体では1行しか表示できませんが、
  7443. # 複数同時に扱うことで複数行の表示を実装しています。
  7444. #==============================================================================

  7445. class Sprite_OneLine_BattleLog < Sprite
  7446.   @@grad_cache = nil
  7447.   #--------------------------------------------------------------------------
  7448.   # ● 公開インスタンス変数
  7449.   #--------------------------------------------------------------------------
  7450.   attr_accessor   :position # 表示位置(行)
  7451.   #--------------------------------------------------------------------------
  7452.   # ● オブジェクト初期化
  7453.   #--------------------------------------------------------------------------
  7454.   def initialize(width, height, max_line_number)
  7455.     super(nil)
  7456.     @rx = @ry = 0
  7457.     @line_height = height
  7458.     @max_line_number = max_line_number
  7459.     @position = -1
  7460.     @visible = true
  7461.     self.ox = -LNX11::STORAGE_OFFSET[:x]
  7462.     self.oy = -LNX11::STORAGE_OFFSET[:y]
  7463.     self.opacity = 0
  7464.     self.z = 96
  7465.     self.bitmap = Bitmap.new(width * 0.75, height)
  7466.   end
  7467.   #--------------------------------------------------------------------------
  7468.   # ● 解放
  7469.   #--------------------------------------------------------------------------  
  7470.   def dispose
  7471.     self.bitmap.dispose
  7472.     super
  7473.   end
  7474.   #--------------------------------------------------------------------------
  7475.   # ● スプライトの表示
  7476.   #--------------------------------------------------------------------------  
  7477.   def show
  7478.     @visible = true
  7479.   end
  7480.   #--------------------------------------------------------------------------
  7481.   # ● スプライトの非表示
  7482.   #--------------------------------------------------------------------------  
  7483.   def hide
  7484.     @visible = false
  7485.     @position = -1
  7486.   end
  7487.   #--------------------------------------------------------------------------
  7488.   # ● 表示しているか?
  7489.   #--------------------------------------------------------------------------  
  7490.   def visible?
  7491.     @visible
  7492.   end
  7493.   #--------------------------------------------------------------------------
  7494.   # ● フレーム更新
  7495.   #--------------------------------------------------------------------------
  7496.   def update
  7497.     return if self.opacity == 0
  7498.     self.opacity += @visible && @position >= 0 ? 24 : -24
  7499.     self.visible = self.opacity > 0
  7500.     return unless @visible # 不可視状態なら座標を更新しない
  7501.     @ry = (target_y + (@ry * 5)) / 6.0 if target_y < @ry
  7502.     @rx += 2 if @rx < 0
  7503.     self.x = @rx
  7504.     self.y = @ry
  7505.   end
  7506.   #--------------------------------------------------------------------------
  7507.   # ● テキストの描画
  7508.   #  自身が持つ Bitmap で描画するのではなく、Window の contents から
  7509.   # コピーします(Sprite からでは Window_Base#draw_text_ex が扱えないため)。
  7510.   #--------------------------------------------------------------------------
  7511.   def set_text(window, position)
  7512.     self.bitmap.clear
  7513.     # 横グラデーション
  7514.     if @@grad_cache && !@@grad_cache.disposed?
  7515.       self.bitmap.blt(0, 0, @@grad_cache, self.bitmap.rect)
  7516.     else
  7517.       color = LNX11::STORAGE_GRADIENT_COLOR
  7518.       fillrect = self.bitmap.rect
  7519.       fillrect.width /= 2
  7520.       self.bitmap.gradient_fill_rect(fillrect, color[0], color[1])
  7521.       @@grad_cache = self.bitmap.clone
  7522.     end
  7523.     # contents からコピー
  7524.     self.bitmap.blt(4, 0, window.contents, self.bitmap.rect)
  7525.     self.opacity = 1
  7526.     @rx = -8
  7527.     @position = position
  7528.     @ry = target_y
  7529.   end
  7530.   #--------------------------------------------------------------------------
  7531.   # ● 位置の繰り上げ
  7532.   #--------------------------------------------------------------------------
  7533.   def up_position
  7534.     @position -= 1
  7535.   end
  7536.   #--------------------------------------------------------------------------
  7537.   # ● メッセージが空か?(表示待ち)
  7538.   #--------------------------------------------------------------------------
  7539.   def mes_empty?
  7540.     @position < 0
  7541.   end
  7542.   #--------------------------------------------------------------------------
  7543.   # ● 移動するべき Y 座標
  7544.   #--------------------------------------------------------------------------
  7545.   def target_y
  7546.     @position * @line_height
  7547.   end
  7548. end

  7549. #==============================================================================
  7550. # ■ Window_BattleLog
  7551. #------------------------------------------------------------------------------
  7552. #  戦闘の進行を実況表示するウィンドウです。
  7553. #==============================================================================

  7554. class Window_BattleLog < Window_Selectable
  7555.   #--------------------------------------------------------------------------
  7556.   # ● [エイリアス]:オブジェクト初期化
  7557.   #--------------------------------------------------------------------------
  7558.   alias :lnx11a_initialize :initialize
  7559.   def initialize
  7560.     lnx11a_initialize
  7561.     # バトルログタイプが 1 以上なら非表示にする
  7562.     @storage_number = 0
  7563.     hide if LNX11::BATTLELOG_TYPE >= 1
  7564.     BattleManager.log_window = self
  7565.   end
  7566.   #--------------------------------------------------------------------------
  7567.   # ● [追加]:文章の配列のクリア
  7568.   #--------------------------------------------------------------------------
  7569.   def lines_clear
  7570.     @lines.clear if LNX11::BATTLELOG_TYPE == 1
  7571.   end
  7572.   #--------------------------------------------------------------------------
  7573.   # ● [追加]:指定ウェイト
  7574.   #--------------------------------------------------------------------------
  7575.   def abs_wait(wait)
  7576.     @method_wait.call(wait) if @method_wait
  7577.   end
  7578.   #--------------------------------------------------------------------------
  7579.   # ● [再定義]:メッセージ速度の取得
  7580.   #--------------------------------------------------------------------------
  7581.   def message_speed
  7582.     return 20
  7583.   end
  7584.   #--------------------------------------------------------------------------
  7585.   # ● [再定義]:エフェクト実行が終わるまでウェイト
  7586.   #--------------------------------------------------------------------------
  7587.   def wait_for_effect
  7588.     return if LNX11::BATTLELOG_TYPE > 0
  7589.     @method_wait_for_effect.call if @method_wait_for_effect
  7590.   end
  7591.   #--------------------------------------------------------------------------
  7592.   # ● [追加]:アニメーションのウェイト用メソッドの設定
  7593.   #--------------------------------------------------------------------------
  7594.   def method_wait_for_animation=(method)
  7595.     @method_wait_for_animation = method
  7596.   end
  7597.   #--------------------------------------------------------------------------
  7598.   # ● [追加]:アニメーション再生が終わるまでウェイト
  7599.   #--------------------------------------------------------------------------
  7600.   def wait_for_animation
  7601.     @method_wait_for_animation.call if @method_wait_for_animation
  7602.   end
  7603.   
  7604.   #--------------------------------------------------------------------------
  7605.   # ● [エイリアス]:ウィンドウ高さの取得
  7606.   #--------------------------------------------------------------------------
  7607.   alias :lnx11a_window_height :window_height
  7608.   def window_height
  7609.     LNX11::BATTLELOG_TYPE == 1 ? fitting_height(1) : lnx11a_window_height
  7610.   end
  7611.   #--------------------------------------------------------------------------
  7612.   # ● [エイリアス]:最大行数の取得
  7613.   #--------------------------------------------------------------------------
  7614.   alias :lnx11a_max_line_number :max_line_number
  7615.   def max_line_number
  7616.     num = LNX11::STORAGE_LINE_NUMBER
  7617.     LNX11::BATTLELOG_TYPE == 1 ? num : lnx11a_max_line_number
  7618.   end
  7619.   #--------------------------------------------------------------------------
  7620.   # ● [オーバーライド]:行の高さを取得
  7621.   #--------------------------------------------------------------------------
  7622.   def line_height
  7623.     LNX11::BATTLELOG_TYPE == 1 ? LNX11::STORAGE_LINE_HEIGHT : super
  7624.   end
  7625.   #--------------------------------------------------------------------------
  7626.   # ● [オーバーライド]:フォント設定のリセット
  7627.   #--------------------------------------------------------------------------
  7628.   def reset_font_settings
  7629.     super
  7630.     return unless LNX11::BATTLELOG_TYPE == 1
  7631.     contents.font.size = LNX11::STORAGE_FONT[:size]
  7632.     contents.font.out_color.set(LNX11::STORAGE_FONT[:out_color])
  7633.   end
  7634.   #--------------------------------------------------------------------------
  7635.   # ● [エイリアス]:データ行数の取得
  7636.   #--------------------------------------------------------------------------
  7637.   alias :lnx11a_line_number :line_number
  7638.   def line_number
  7639.     return 0 if LNX11::BATTLELOG_TYPE == 2
  7640.     LNX11::BATTLELOG_TYPE == 1 ? @storage_number : lnx11a_line_number
  7641.   end
  7642.   #--------------------------------------------------------------------------
  7643.   # ● [再定義]:背景スプライトの作成
  7644.   #--------------------------------------------------------------------------
  7645.   alias :lnx11a_create_back_sprite :create_back_sprite
  7646.   def create_back_sprite
  7647.     if LNX11::BATTLELOG_TYPE == 1
  7648.       # 蓄積型
  7649.       create_message_sprite
  7650.     else
  7651.       # 背景
  7652.       lnx11a_create_back_sprite
  7653.     end
  7654.   end
  7655.   #--------------------------------------------------------------------------
  7656.   # ● [再定義]:背景スプライトの解放
  7657.   #--------------------------------------------------------------------------
  7658.   alias :lnx11a_dispose_back_sprite :dispose_back_sprite
  7659.   def dispose_back_sprite
  7660.     if LNX11::BATTLELOG_TYPE == 1
  7661.       # 蓄積型
  7662.       dispose_message_sprite
  7663.     else
  7664.       # 背景
  7665.       lnx11a_dispose_back_sprite
  7666.     end
  7667.   end
  7668.   #--------------------------------------------------------------------------
  7669.   # ● [追加]:メッセージスプライトの作成
  7670.   #--------------------------------------------------------------------------
  7671.   def create_message_sprite
  7672.     # メッセージスプライト 行数分だけ作成する
  7673.     @mes_position = 0 # 次にメッセージを表示させる位置
  7674.     @mesup_count = LNX11::STORAGE_UP_MESSAGE_TIME # ログが進行するまでの時間
  7675.     @mes_sprites = Array.new(max_line_number + 1) {
  7676.     Sprite_OneLine_BattleLog.new(self.width, line_height, max_line_number)}
  7677.   end
  7678.   #--------------------------------------------------------------------------
  7679.   # ● [追加]:メッセージスプライトの解放
  7680.   #--------------------------------------------------------------------------
  7681.   def dispose_message_sprite
  7682.     @mes_sprites.each {|sprite| sprite.dispose }
  7683.   end
  7684.   #--------------------------------------------------------------------------
  7685.   # ● [追加]:メッセージスプライトを表示
  7686.   #--------------------------------------------------------------------------
  7687.   def show_message_sprite
  7688.     @mes_sprites.each {|sprite| sprite.show }
  7689.   end
  7690.   #--------------------------------------------------------------------------
  7691.   # ● [追加]:メッセージスプライトを非表示
  7692.   #--------------------------------------------------------------------------
  7693.   def hide_message_sprite
  7694.     @mes_sprites.each {|sprite| sprite.hide }
  7695.     @mes_position = 0
  7696.   end
  7697.   #--------------------------------------------------------------------------
  7698.   # ● [追加]:メッセージスプライトを一つ進める
  7699.   #--------------------------------------------------------------------------
  7700.   def up_message_sprite
  7701.     @mes_sprites.each {|sprite| sprite.up_position }
  7702.   end
  7703.   #--------------------------------------------------------------------------
  7704.   # ● [追加]:空のメッセージスプライトを返す
  7705.   #--------------------------------------------------------------------------
  7706.   def empty_message_sprite
  7707.     @mes_sprites.each {|sprite| return sprite if sprite.mes_empty? }
  7708.     @mes_sprites[0]
  7709.   end
  7710.   #--------------------------------------------------------------------------
  7711.   # ● [追加]:メッセージスプライトの更新
  7712.   #--------------------------------------------------------------------------
  7713.   def update_message_sprite
  7714.     # バトルログ消去フラグが有効
  7715.     if $game_temp.battlelog_clear
  7716.       $game_temp.battlelog_clear = false
  7717.       # スプライトが表示されていれば非表示にする
  7718.       if @mes_sprites[0].visible?
  7719.         hide_message_sprite
  7720.         lines_clear
  7721.       end
  7722.     end
  7723.     # ログの自動進行
  7724.     @mesup_count -= 1
  7725.     if @mesup_count <= 0 && @mes_position > 0
  7726.       up_message_sprite
  7727.       @mes_position -= 1
  7728.       @mesup_count = LNX11::STORAGE_UP_MESSAGE_TIME
  7729.     end
  7730.     @mes_sprites.each {|sprite| sprite.update }
  7731.   end
  7732.   #--------------------------------------------------------------------------
  7733.   # ● [追加]:メッセージスプライトのリフレッシュ
  7734.   #--------------------------------------------------------------------------
  7735.   def refresh_message_sprite
  7736.     # 文章が無ければ何もしない
  7737.     return if @lines.empty?
  7738.     # スプライトを表示する
  7739.     show_message_sprite unless @mes_sprites[0].visible?
  7740.     # 文章の描画
  7741.     contents.clear
  7742.     @lines[0] = last_text
  7743.     return if @lines[0].empty?
  7744.     draw_line(0)
  7745.     @storage_number += 1
  7746.     # ウィンドウの内容をスプライトにコピー
  7747.     empty_message_sprite.set_text(self, @mes_position)
  7748.     # スプライト位置の変動   
  7749.     if @mes_position < max_line_number
  7750.       @mes_position += 1
  7751.     elsif @mesup_count > 0
  7752.       up_message_sprite
  7753.     end
  7754.     @mesup_count = (LNX11::STORAGE_UP_MESSAGE_TIME * 1.5).truncate
  7755.   end  
  7756.   #--------------------------------------------------------------------------
  7757.   # ● [オーバーライド]:フレーム更新
  7758.   #--------------------------------------------------------------------------
  7759.   def update
  7760.     super
  7761.     update_message_sprite if LNX11::BATTLELOG_TYPE == 1
  7762.   end
  7763.   #--------------------------------------------------------------------------
  7764.   # ● [エイリアス]:リフレッシュ
  7765.   #--------------------------------------------------------------------------
  7766.   alias :lnx11a_refresh :refresh
  7767.   def refresh
  7768.     return if LNX11::BATTLELOG_TYPE == 2
  7769.     LNX11::BATTLELOG_TYPE == 1 ? refresh_message_sprite : lnx11a_refresh
  7770.   end
  7771.   #--------------------------------------------------------------------------
  7772.   # ● [エイリアス]:クリア
  7773.   #--------------------------------------------------------------------------
  7774.   alias :lnx11a_clear :clear
  7775.   def clear
  7776.     return if LNX11::BATTLELOG_TYPE == 2
  7777.     LNX11::BATTLELOG_TYPE == 1 ? @storage_number = 0 : lnx11a_clear
  7778.   end
  7779.   #--------------------------------------------------------------------------
  7780.   # ● [エイリアス]:一行戻る
  7781.   #--------------------------------------------------------------------------
  7782.   alias :lnx11a_back_one :back_one
  7783.   def back_one
  7784.     if LNX11::BATTLELOG_TYPE == 1
  7785.       # 蓄積型
  7786.       @storage_number = [@storage_number - 1, 0].max
  7787.     else
  7788.       # 通常
  7789.       lnx11a_back_one
  7790.     end
  7791.   end
  7792.   #--------------------------------------------------------------------------
  7793.   # ● [エイリアス]:指定した行に戻る
  7794.   #--------------------------------------------------------------------------
  7795.   alias :lnx11a_back_to :back_to
  7796.   def back_to(line_number)
  7797.     if LNX11::BATTLELOG_TYPE == 1
  7798.       # 蓄積型
  7799.       @storage_number -= 1 while @storage_number > line_number
  7800.     else
  7801.       # 通常
  7802.       lnx11a_back_to(line_number)
  7803.     end
  7804.   end
  7805.   #--------------------------------------------------------------------------
  7806.   # ● [エイリアス]:ウェイト
  7807.   #--------------------------------------------------------------------------
  7808.   alias :lnx11a_wait :wait
  7809.   def wait
  7810.     return if LNX11::BATTLELOG_TYPE == 2
  7811.     # 元のメソッドを呼ぶ
  7812.     lnx11a_wait
  7813.   end
  7814.   #--------------------------------------------------------------------------
  7815.   # ● [エイリアス]:スキル/アイテム使用の表示
  7816.   #  使用時アニメーションの処理を追加します。
  7817.   #--------------------------------------------------------------------------
  7818.   alias :lnx11a_display_use_item :display_use_item
  7819.   def display_use_item(subject, item)
  7820.     if item.use_animation > 0
  7821.       # 使用時アニメーションが設定されていれば再生
  7822.       subject.animation_id = item.use_animation
  7823.       subject.animation_mirror = false
  7824.     end
  7825.     # 元のメソッドを呼ぶ
  7826.     lnx11a_display_use_item(subject, item)
  7827.     # アニメーションのウェイト
  7828.     wait_for_animation if item.use_animation > 0
  7829.   end
  7830.   #--------------------------------------------------------------------------
  7831.   # ● [追加]:ポップアップデータの取得
  7832.   #--------------------------------------------------------------------------
  7833.   def popup_data
  7834.     $game_temp.popup_data
  7835.   end
  7836.   #--------------------------------------------------------------------------
  7837.   # ● [エイリアス]:反撃の表示
  7838.   #--------------------------------------------------------------------------
  7839.   alias :lnx11a_display_counter :display_counter
  7840.   def display_counter(target, item)
  7841.     # ポップアップ
  7842.     popup_data.popup_text(target, :counter)
  7843.     # 元のメソッドを呼ぶ
  7844.     lnx11a_display_counter(target, item)
  7845.     # ポップアップウェイト
  7846.     popup_data.add_wait
  7847.   end
  7848.   #--------------------------------------------------------------------------
  7849.   # ● [エイリアス]:反射の表示
  7850.   #--------------------------------------------------------------------------
  7851.   alias :lnx11a_display_reflection :display_reflection
  7852.   def display_reflection(target, item)
  7853.     # ポップアップ
  7854.     popup_data.popup_text(target, :reflection)
  7855.     # 元のメソッドを呼ぶ
  7856.     lnx11a_display_reflection(target, item)
  7857.     # ポップアップウェイト
  7858.     popup_data.add_wait
  7859.   end
  7860.   #--------------------------------------------------------------------------
  7861.   # ● [エイリアス]:身代わりの表示
  7862.   #--------------------------------------------------------------------------
  7863.   alias :lnx11a_display_substitute :display_substitute
  7864.   def display_substitute(substitute, target)
  7865.     # ポップアップ
  7866.     popup_data.popup_text(substitute, :substitute)
  7867.     # 元のメソッドを呼ぶ
  7868.     lnx11a_display_substitute(substitute, target)
  7869.     # ポップアップウェイト
  7870.     popup_data.add_wait
  7871.   end
  7872.   #--------------------------------------------------------------------------
  7873.   # ● [エイリアス]:失敗の表示
  7874.   #--------------------------------------------------------------------------
  7875.   alias :lnx11a_display_failure :display_failure
  7876.   def display_failure(target, item)
  7877.     if target.result.hit? && !target.result.success
  7878.       # ポップアップ (ミスと同じ扱いにする)
  7879.       popup_data.popup_miss(target, item)
  7880.     end
  7881.     # 元のメソッドを呼ぶ
  7882.     lnx11a_display_failure(target, item)
  7883.     # ポップアップウェイト
  7884.     popup_data.add_wait
  7885.   end
  7886.   #--------------------------------------------------------------------------
  7887.   # ● [エイリアス]:ミスの表示
  7888.   #--------------------------------------------------------------------------
  7889.   alias :lnx11a_display_miss :display_miss
  7890.   def display_miss(target, item)
  7891.     # ポップアップ
  7892.     popup_data.popup_miss(target, item)
  7893.     # 元のメソッドを呼ぶ   
  7894.     lnx11a_display_miss(target, item)
  7895.     # ポップアップウェイト
  7896.     popup_data.add_wait
  7897.   end
  7898.   #--------------------------------------------------------------------------
  7899.   # ● [エイリアス]:回避の表示
  7900.   #--------------------------------------------------------------------------
  7901.   alias :lnx11a_display_evasion :display_evasion
  7902.   def display_evasion(target, item)
  7903.     # ポップアップ (ミスと同じ扱いにする)
  7904.     popup_data.popup_miss(target, item)
  7905.     # 元のメソッドを呼ぶ   
  7906.     lnx11a_display_evasion(target, item)
  7907.     # ポップアップウェイト
  7908.     popup_data.add_wait
  7909.   end
  7910.   #--------------------------------------------------------------------------
  7911.   # ● [エイリアス]:HP ダメージ表示
  7912.   #--------------------------------------------------------------------------
  7913.   alias :lnx11a_display_hp_damage :display_hp_damage
  7914.   def display_hp_damage(target, item)
  7915.     # ポップアップ
  7916.     popup_data.popup_hp_damage(target, item)
  7917.     # 元のメソッドを呼ぶ
  7918.     lnx11a_display_hp_damage(target, item)
  7919.     # ポップアップウェイト
  7920.     popup_data.add_wait
  7921.   end
  7922.   #--------------------------------------------------------------------------
  7923.   # ● [エイリアス]:MP ダメージ表示
  7924.   #--------------------------------------------------------------------------
  7925.   alias :lnx11a_display_mp_damage :display_mp_damage
  7926.   def display_mp_damage(target, item)
  7927.     # ポップアップ
  7928.     popup_data.popup_mp_damage(target, item)
  7929.     # 元のメソッドを呼ぶ
  7930.     lnx11a_display_mp_damage(target, item)
  7931.     # ポップアップウェイト
  7932.     popup_data.add_wait
  7933.   end
  7934.   #--------------------------------------------------------------------------
  7935.   # ● [エイリアス]:TP ダメージ表示
  7936.   #--------------------------------------------------------------------------
  7937.   alias :lnx11a_display_tp_damage :display_tp_damage
  7938.   def display_tp_damage(target, item)
  7939.     # ポップアップ
  7940.     popup_data.popup_tp_damage(target, item)
  7941.     # 元のメソッドを呼ぶ
  7942.     lnx11a_display_tp_damage(target, item)
  7943.     # ポップアップウェイト
  7944.     popup_data.add_wait
  7945.   end
  7946.   #--------------------------------------------------------------------------
  7947.   # ● [エイリアス]:ステート付加の表示
  7948.   #--------------------------------------------------------------------------
  7949.   alias :lnx11a_display_added_states :display_added_states
  7950.   def display_added_states(target)
  7951.     # ポップアップ
  7952.     popup_data.popup_added_states(target)
  7953.     # 元のメソッドを呼ぶ
  7954.     lnx11a_display_added_states(target)
  7955.   end
  7956.   #--------------------------------------------------------------------------
  7957.   # ● [エイリアス]:ステート解除の表示
  7958.   #--------------------------------------------------------------------------
  7959.   alias :lnx11a_display_removed_states :display_removed_states
  7960.   def display_removed_states(target)
  7961.     # ポップアップ
  7962.     popup_data.popup_removed_states(target)
  7963.     # 元のメソッドを呼ぶ
  7964.     lnx11a_display_removed_states(target)
  7965.   end
  7966.   #--------------------------------------------------------------------------
  7967.   # ● [エイリアス]:能力強化/弱体の表示(個別)
  7968.   #--------------------------------------------------------------------------
  7969.   alias :lnx11a_display_buffs :display_buffs
  7970.   def display_buffs(target, buffs, fmt)
  7971.     # ポップアップ
  7972.     popup_data.popup_buffs(target, buffs, fmt)
  7973.     # 元のメソッドを呼ぶ
  7974.     lnx11a_display_buffs(target, buffs, fmt)
  7975.   end
  7976. end

  7977. #==============================================================================
  7978. # ■ RPG::BaseItem
  7979. #------------------------------------------------------------------------------
  7980. #  アクター、職業、スキル、アイテム、武器、防具、敵キャラ、およびステートの
  7981. # スーパークラス。
  7982. #==============================================================================

  7983. class RPG::BaseItem  
  7984.   #--------------------------------------------------------------------------
  7985.   # ● [追加]:バトラーグラフィックファイル名を取得
  7986.   #--------------------------------------------------------------------------
  7987.   def default_battler_graphic
  7988.     # キャッシュがある場合、それを返す
  7989.     return @default_battler_graphic if @default_battler_graphic
  7990.     # メモ取得
  7991.     re = LNX11::RE_BATTLER =~ note
  7992.     @default_battler_graphic = re ? $1 : ""
  7993.   end
  7994.   #--------------------------------------------------------------------------
  7995.   # ● [追加]:敵キャラの通常攻撃アニメの取得
  7996.   #--------------------------------------------------------------------------
  7997.   def atk_animation
  7998.     # キャッシュがある場合、それを返す
  7999.     return @atk_animation if @atk_animation
  8000.     # メモ取得
  8001.     re = LNX11::RE_ATK_ANIMATION =~ note
  8002.     @atk_animation = re ? $1.to_i : 1
  8003.   end
  8004. end

  8005. #==============================================================================
  8006. # ■ RPG::UsableItem
  8007. #------------------------------------------------------------------------------
  8008. #  スキルとアイテムのスーパークラス。
  8009. #==============================================================================
  8010. class RPG::UsableItem < RPG::BaseItem
  8011.   #--------------------------------------------------------------------------
  8012.   # ● [エイリアス]:対象の選択操作が必要か否かを取得
  8013.   #--------------------------------------------------------------------------
  8014.   alias :lnx11a_need_selection? :need_selection?
  8015.   def need_selection?
  8016.     LNX11::FIX_TARGET_CHECKE && scope > 0 ? true : lnx11a_need_selection?
  8017.   end
  8018.   #--------------------------------------------------------------------------
  8019.   # ● [追加]:使用時アニメの取得
  8020.   #--------------------------------------------------------------------------
  8021.   def use_animation
  8022.     # キャッシュがある場合、それを返す
  8023.     return @use_animation if @use_animation
  8024.     # メモ取得
  8025.     re = LNX11::RE_USE_ANIMATION =~ note
  8026.     @use_animation = re ? $1.to_i : 0
  8027.   end
  8028.   #--------------------------------------------------------------------------
  8029.   # ● [追加]:簡易ヘルプ非表示の取得
  8030.   #--------------------------------------------------------------------------
  8031.   def no_display
  8032.     # キャッシュがある場合、それを返す
  8033.     return @no_display if @no_display
  8034.     # メモ取得
  8035.     re = LNX11::RE_USABLEITEM_NO_DISPLAY =~ note
  8036.     @no_display = re ? true : false
  8037.   end
  8038.   #--------------------------------------------------------------------------
  8039.   # ● [追加]:使用時追加ウェイトの取得
  8040.   #--------------------------------------------------------------------------
  8041.   def display_wait
  8042.     # キャッシュがある場合、それを返す
  8043.     return @display_wait if @display_wait
  8044.     # メモ取得
  8045.     re = LNX11::RE_DISPLAY_WAIT =~ note
  8046.     @display_wait = re ? $1.to_i : LNX11::HELPDISPLAT_WAIT
  8047.   end
  8048.   #--------------------------------------------------------------------------
  8049.   # ● [追加]:終了時追加ウェイトの取得
  8050.   #--------------------------------------------------------------------------
  8051.   def end_wait
  8052.     # キャッシュがある場合、それを返す
  8053.     return @end_wait if @end_wait
  8054.     # メモ取得
  8055.     re = LNX11::RE_END_WAIT =~ note
  8056.     @end_wait = re ? $1.to_i : LNX11::HELPDISPLAT_END_WAIT
  8057.   end
  8058.   #--------------------------------------------------------------------------
  8059.   # ● [追加]:簡易ヘルプ説明を取得
  8060.   #--------------------------------------------------------------------------
  8061.   def short_description
  8062.     # キャッシュがある場合、それを返す
  8063.     return @short_description if @short_description
  8064.     # メモ取得
  8065.     re = LNX11::RE_SHORT_DESCRIPTION =~ note
  8066.     @short_description = re ? $1 : ""
  8067.   end
  8068. end

  8069. #==============================================================================
  8070. # ■ RPG::State
  8071. #------------------------------------------------------------------------------
  8072. #  ステートのデータクラス。
  8073. #==============================================================================

  8074. class RPG::State < RPG::BaseItem
  8075.   #--------------------------------------------------------------------------
  8076.   # ● [追加]:ステートアニメの取得
  8077.   #--------------------------------------------------------------------------
  8078.   def state_animation
  8079.     # キャッシュがある場合、それを返す
  8080.     return @state_animation if @state_animation
  8081.     # メモ取得
  8082.     re = LNX11::RE_STATE_ANIMATION =~ note
  8083.     @state_animation = re ? $1.to_i : 0
  8084.   end
  8085.   #--------------------------------------------------------------------------
  8086.   # ● [追加]:ポップアップ表示名の取得
  8087.   # <<ver1.10>>
  8088.   #  このメソッドは付加/解除ポップアップ表示名が設定されていない場合のみ
  8089.   # 呼び出されるようになりました。
  8090.   #--------------------------------------------------------------------------
  8091.   def display_name
  8092.     # キャッシュがある場合、それを返す
  8093.     return @display_name if @display_name
  8094.     # メモ取得
  8095.     re = LNX11::RE_STATE_DISPLAY =~ note
  8096.     @display_name = re ? $1 : name
  8097.   end
  8098.   #--------------------------------------------------------------------------
  8099.   # ● [追加]:付加ポップアップ表示名の取得 <<ver1.10>>
  8100.   #--------------------------------------------------------------------------
  8101.   def add_display_name
  8102.     # キャッシュがある場合、それを返す
  8103.     return @add_display_name if @add_display_name
  8104.     # メモ取得
  8105.     re = LNX11::RE_STATE_ADD_DISPLAY =~ note
  8106.     @add_display_name = re ? $1 : display_name
  8107.   end
  8108.   #--------------------------------------------------------------------------
  8109.   # ● [追加]:解除ポップアップ表示名の取得 <<ver1.10>>
  8110.   #--------------------------------------------------------------------------
  8111.   def remove_display_name
  8112.     # キャッシュがある場合、それを返す
  8113.     return @remove_display_name if @remove_display_name
  8114.     # メモ取得
  8115.     re = LNX11::RE_STATE_REM_DISPLAY =~ note
  8116.     @remove_display_name = re ? $1 : display_name
  8117.   end
  8118.   #--------------------------------------------------------------------------
  8119.   # ● [追加]:ポップアップ非表示の取得
  8120.   #--------------------------------------------------------------------------
  8121.   def no_display?
  8122.     # キャッシュがある場合、それを返す
  8123.     return @no_display if @no_display
  8124.     # 付加/解除のどちらかで設定されていれば無視する
  8125.     if LNX11::RE_STATE_ADD_NO_DISPLAY =~ note ||
  8126.        LNX11::RE_STATE_REM_NO_DISPLAY =~ note
  8127.       return @no_display = false
  8128.     end
  8129.     # メモ取得
  8130.     re = LNX11::RE_STATE_NO_DISPLAY =~ note
  8131.     @no_display = re ? true : false
  8132.   end
  8133.   #--------------------------------------------------------------------------
  8134.   # ● [追加]:付加ポップアップ非表示の取得
  8135.   #--------------------------------------------------------------------------
  8136.   def add_no_display?
  8137.     return true if no_display?
  8138.     # キャッシュがある場合、それを返す
  8139.     return @add_no_display if @add_no_display
  8140.     # メモ取得
  8141.     re = LNX11::RE_STATE_ADD_NO_DISPLAY =~ note
  8142.     @add_no_display = re ? true : false
  8143.   end
  8144.   #--------------------------------------------------------------------------
  8145.   # ● [追加]:解除ポップアップ非表示の取得
  8146.   #--------------------------------------------------------------------------
  8147.   def remove_no_display?
  8148.     return true if no_display?
  8149.     # キャッシュがある場合、それを返す
  8150.     return @remove_no_display if @remove_no_display
  8151.     # メモ取得
  8152.     re = LNX11::RE_STATE_REM_NO_DISPLAY =~ note
  8153.     @remove_no_display = re ? true : false
  8154.   end
  8155.   #--------------------------------------------------------------------------
  8156.   # ● [追加]:有利なステートの取得
  8157.   #--------------------------------------------------------------------------
  8158.   def advantage?
  8159.     # キャッシュがある場合、それを返す
  8160.     return @advantage if @advantage
  8161.     # メモ取得
  8162.     re = LNX11::RE_STATE_ADVANTAGE =~ note
  8163.     @advantage = re ? true : false
  8164.   end
  8165.   #--------------------------------------------------------------------------
  8166.   # ● [追加]:ポップアップタイプの取得
  8167.   #--------------------------------------------------------------------------
  8168.   def popup_type
  8169.     # キャッシュがある場合、それを返す
  8170.     return @popup_type if @popup_type != nil
  8171.     # 付加/解除のどちらかで設定されていれば無視する
  8172.     if LNX11::RE_STATE_ADD_TYPE =~ note ||
  8173.        LNX11::RE_STATE_REM_TYPE =~ note
  8174.       return @popup_type = false
  8175.     end
  8176.     # メモ取得
  8177.     re = LNX11::RE_STATE_TYPE =~ note
  8178.     @popup_type = re ? $1.to_i : false
  8179.   end
  8180.   #--------------------------------------------------------------------------
  8181.   # ● [追加]:付加ポップアップタイプの取得
  8182.   #--------------------------------------------------------------------------
  8183.   def add_popup_type
  8184.     return popup_type if popup_type
  8185.     # キャッシュがある場合、それを返す
  8186.     return @add_popup_type if @add_popup_type != nil
  8187.     # メモ取得
  8188.     re = LNX11::RE_STATE_ADD_TYPE =~ note
  8189.     @add_popup_type = re ? $1.to_i : false
  8190.   end
  8191.   #--------------------------------------------------------------------------
  8192.   # ● [追加]:解除ポップアップタイプの取得
  8193.   #--------------------------------------------------------------------------
  8194.   def remove_popup_type
  8195.     return popup_type if popup_type
  8196.     # キャッシュがある場合、それを返す
  8197.     return @remove_popup_type if @remove_popup_type != nil
  8198.     # メモ取得
  8199.     re = LNX11::RE_STATE_REM_TYPE =~ note
  8200.     @remove_popup_type = re ? $1.to_i : false
  8201.   end
  8202.   #--------------------------------------------------------------------------
  8203.   # ● [追加]:修飾文字非表示の取得
  8204.   #--------------------------------------------------------------------------
  8205.   def no_decoration?
  8206.     # キャッシュがある場合、それを返す
  8207.     return @no_decoration if @no_decoration
  8208.     # 付加/解除のどちらかで設定されていれば無視する
  8209.     if LNX11::RE_STATE_ADD_NO_DECORATION =~ note ||
  8210.        LNX11::RE_STATE_REM_NO_DECORATION =~ note
  8211.       return @no_decoration = false
  8212.     end
  8213.     # メモ取得
  8214.     re = LNX11::RE_STATE_NO_DECORATION =~ note
  8215.     @no_decoration = re ? true : false
  8216.   end
  8217.   #--------------------------------------------------------------------------
  8218.   # ● [追加]:付加修飾文字非表示の取得
  8219.   #--------------------------------------------------------------------------
  8220.   def add_no_decoration?
  8221.     return true if no_decoration?
  8222.     # キャッシュがある場合、それを返す
  8223.     return @add_no_decoration if @add_no_decoration
  8224.     # メモ取得
  8225.     re = LNX11::RE_STATE_ADD_NO_DECORATION =~ note
  8226.     @add_no_decoration = re ? true : false
  8227.   end
  8228.   #--------------------------------------------------------------------------
  8229.   # ● [追加]:解除修飾文字非表示の取得
  8230.   #--------------------------------------------------------------------------
  8231.   def remove_no_decoration?
  8232.     return true if no_decoration?
  8233.     # キャッシュがある場合、それを返す
  8234.     return @remove_no_decoration if @remove_no_decoration
  8235.     # メモ取得
  8236.     re = LNX11::RE_STATE_REM_NO_DECORATION =~ note
  8237.     @remove_no_decoration = re ? true : false
  8238.   end
  8239. end

  8240. #==============================================================================
  8241. # ■ BattleManager
  8242. #------------------------------------------------------------------------------
  8243. #  戦闘の進行を管理するモジュールです。
  8244. #==============================================================================

  8245. class << BattleManager
  8246.   #--------------------------------------------------------------------------
  8247.   # ● [追加]:公開インスタンス変数
  8248.   #--------------------------------------------------------------------------
  8249.   attr_reader   :preemptive             # 先制攻撃フラグ
  8250.   attr_reader   :surprise               # 不意打ちフラグ
  8251.   attr_accessor :log_window             # バトルログウィンドウ
  8252.   attr_accessor :update_for_wait_method # ウェイト中のフレーム更新
  8253.   attr_accessor :helpdisplay_set_method        # 簡易ヘルプ表示
  8254.   attr_accessor :helpdisplay_clear_method      # 簡易ヘルプ消去
  8255.   attr_accessor :helpdisplay_wait_short_method # 簡易ヘルプ・短時間ウェイト
  8256.   #--------------------------------------------------------------------------
  8257.   # ● [追加]:簡易ヘルプ表示
  8258.   #--------------------------------------------------------------------------
  8259.   def helpdisplay_set(*args)
  8260.     @helpdisplay_set_method.call(*args) if @helpdisplay_set_method
  8261.   end
  8262.   #--------------------------------------------------------------------------
  8263.   # ● [追加]:簡易ヘルプ消去
  8264.   #--------------------------------------------------------------------------
  8265.   def helpdisplay_clear(*args)
  8266.     @helpdisplay_clear_method.call(*args) if @helpdisplay_clear_method
  8267.   end
  8268.   #--------------------------------------------------------------------------
  8269.   # ● [追加]:簡易ヘルプ・短時間ウェイト
  8270.   #--------------------------------------------------------------------------
  8271.   def helpdisplay_wait_short
  8272.     @helpdisplay_wait_short_method.call if @helpdisplay_wait_short_method
  8273.   end
  8274.   #--------------------------------------------------------------------------
  8275.   # ● [追加]:キー入力待ち
  8276.   #--------------------------------------------------------------------------
  8277.   def helpdisplay_wait_input
  8278.     return if $game_message.helpdisplay_texts.empty?
  8279.     return if LNX11::MESSAGE_TYPE == 0
  8280.     return if !@helpdisplay_wait_input || !@update_for_wait_method
  8281.     update_for_wait_method.call while !Input.press?(:B) && !Input.press?(:C)
  8282.   end
  8283.   #--------------------------------------------------------------------------
  8284.   # ● [追加]:メッセージ進行の SE 再生
  8285.   #--------------------------------------------------------------------------
  8286.   def messagedisplay_se_play
  8287.     return if !@helpdisplay_se
  8288.     @helpdisplay_se.play  
  8289.     @helpdisplay_se = nil if @helpdisplay_se == LNX11::LEVELUP_SE
  8290.   end
  8291.   #--------------------------------------------------------------------------
  8292.   # ● [追加]:メッセージ進行
  8293.   #--------------------------------------------------------------------------
  8294.   def process_messagedisplay(wait)
  8295.     return if $game_message.helpdisplay_texts.empty?
  8296.     return if LNX11::MESSAGE_TYPE == 0
  8297.     $game_temp.battlelog_clear = true
  8298.     BattleManager.log_window.update
  8299.     if LNX11::BATTLELOG_TYPE == 2 || LNX11::MESSAGE_TYPE == 2
  8300.       # 簡易ヘルプ
  8301.       $game_message.helpdisplay_texts.each do |text|
  8302.         helpdisplay_wait_short
  8303.         messagedisplay_se_play
  8304.         helpdisplay_set(text, wait)
  8305.         helpdisplay_wait_input
  8306.       end
  8307.       helpdisplay_clear
  8308.     elsif LNX11::BATTLELOG_TYPE == 0
  8309.       # VXAceデフォルト
  8310.       BattleManager.log_window.clear
  8311.       $game_message.helpdisplay_texts.each do |text|
  8312.         messagedisplay_se_play
  8313.         BattleManager.log_window.add_text(text)
  8314.         BattleManager.log_window.abs_wait(wait)
  8315.         helpdisplay_wait_input
  8316.         max = BattleManager.log_window.max_line_number
  8317.         # 表示がいっぱいになったら消去
  8318.         if BattleManager.log_window.line_number >= max
  8319.           BattleManager.log_window.clear
  8320.         end
  8321.       end
  8322.       BattleManager.log_window.clear
  8323.     elsif LNX11::BATTLELOG_TYPE == 1
  8324.       # 蓄積型
  8325.       $game_message.helpdisplay_texts.each do |text|
  8326.         messagedisplay_se_play
  8327.         BattleManager.log_window.add_text(text)
  8328.         BattleManager.log_window.abs_wait(wait)
  8329.         helpdisplay_wait_input
  8330.       end
  8331.       $game_temp.battlelog_clear = true
  8332.       BattleManager.log_window.update
  8333.     end
  8334.     $game_message.helpdisplay_texts.clear
  8335.   end
  8336.   #--------------------------------------------------------------------------
  8337.   # ● [エイリアス]:メッセージ表示が終わるまでウェイト
  8338.   #--------------------------------------------------------------------------
  8339.   alias :lnx11a_wait_for_message :wait_for_message
  8340.   def wait_for_message
  8341.     # 簡易ヘルプ表示
  8342.     process_messagedisplay(@helpdisplay_wait ? @helpdisplay_wait : 60)
  8343.     return if $game_message.texts.empty?
  8344.     # 元のメソッドを呼ぶ
  8345.     lnx11a_wait_for_message
  8346.   end  
  8347.   #--------------------------------------------------------------------------
  8348.   # ● [エイリアス]:戦闘開始
  8349.   #--------------------------------------------------------------------------
  8350.   alias :lnx11a_battle_start :battle_start
  8351.   def battle_start   
  8352.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:battle_start][0]
  8353.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:battle_start][1]
  8354.     # メッセージウィンドウへのテキスト追加を禁止する
  8355.     $game_message.add_disabled
  8356.     # 元のメソッドを呼ぶ
  8357.     lnx11a_battle_start
  8358.     # メッセージウィンドウへのテキスト追加を許可する
  8359.     $game_message.add_enabled
  8360.     @helpdisplay_wait = nil
  8361.     @helpdisplay_wait_input = nil
  8362.   end
  8363.   #--------------------------------------------------------------------------
  8364.   # ● [エイリアス]:勝利の処理
  8365.   #--------------------------------------------------------------------------
  8366.   alias :lnx11a_process_victory :process_victory
  8367.   def process_victory
  8368.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:victory][0]
  8369.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:victory][1]
  8370.     # メッセージウィンドウへのテキスト追加を禁止する
  8371.     $game_message.add_disabled
  8372.     # 元のメソッドを呼ぶ
  8373.     success = lnx11a_process_victory
  8374.     # メッセージウィンドウへのテキスト追加を許可する
  8375.     $game_message.add_enabled
  8376.     @helpdisplay_wait = nil
  8377.     @helpdisplay_wait_input = nil
  8378.     return success
  8379.   end
  8380.   #--------------------------------------------------------------------------
  8381.   # ● [エイリアス]:逃走の処理
  8382.   #--------------------------------------------------------------------------
  8383.   alias :lnx11a_process_escape :process_escape
  8384.   def process_escape
  8385.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:escape][0]
  8386.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:escape][1]
  8387.     # メッセージウィンドウへのテキスト追加を禁止する
  8388.     $game_message.add_disabled
  8389.     # 元のメソッドを呼ぶ
  8390.     success = lnx11a_process_escape
  8391.     # メッセージウィンドウへのテキスト追加を許可する
  8392.     $game_message.add_enabled
  8393.     @helpdisplay_wait = nil
  8394.     @helpdisplay_wait_input = nil
  8395.     return success
  8396.   end
  8397.   #--------------------------------------------------------------------------
  8398.   # ● [エイリアス]:敗北の処理
  8399.   #--------------------------------------------------------------------------
  8400.   alias :lnx11a_process_defeat :process_defeat
  8401.   def process_defeat
  8402.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:defeat][0]
  8403.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:defeat][1]
  8404.     # メッセージウィンドウへのテキスト追加を禁止する
  8405.     $game_message.add_disabled
  8406.     # 元のメソッドを呼ぶ
  8407.     success = lnx11a_process_defeat
  8408.     # メッセージウィンドウへのテキスト追加を許可する
  8409.     $game_message.add_enabled
  8410.     @helpdisplay_wait = nil
  8411.     @helpdisplay_wait_input = nil
  8412.     return success
  8413.   end
  8414.   #--------------------------------------------------------------------------
  8415.   # ● [エイリアス]:ドロップアイテムの獲得と表示
  8416.   #--------------------------------------------------------------------------
  8417.   alias :lnx11a_gain_drop_items :gain_drop_items
  8418.   def gain_drop_items
  8419.     helpdisplay_clear
  8420.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:drop_item][0]
  8421.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:drop_item][1]
  8422.     @helpdisplay_se = LNX11::DROPITEM_SE
  8423.     # 元のメソッドを呼ぶ
  8424.     lnx11a_gain_drop_items
  8425.     @helpdisplay_wait = nil
  8426.     @helpdisplay_wait_input = nil
  8427.     @helpdisplay_se = nil
  8428.   end
  8429.   #--------------------------------------------------------------------------
  8430.   # ● [再定義]:経験値の獲得とレベルアップの表示
  8431.   #--------------------------------------------------------------------------
  8432.   def gain_exp
  8433.     @helpdisplay_wait = LNX11::MESSAGE_WAIT[:levelup][0]
  8434.     @helpdisplay_wait_input = LNX11::MESSAGE_WAIT[:levelup][1]
  8435.     $game_party.all_members.each do |actor|
  8436.       @helpdisplay_se = LNX11::LEVELUP_SE
  8437.       actor.gain_exp($game_troop.exp_total)
  8438.       # レベルアップ毎にメッセージ表示ウェイト
  8439.       wait_for_message
  8440.     end
  8441.     @helpdisplay_wait = nil
  8442.     @helpdisplay_wait_input = nil
  8443.     @helpdisplay_se = nil
  8444.   end
  8445. end

  8446. #==============================================================================
  8447. # ■ Game_Temp
  8448. #------------------------------------------------------------------------------
  8449. #  セーブデータに含まれない、一時的なデータを扱うクラスです。このクラスのイン
  8450. # スタンスは $game_temp で参照されます。
  8451. #==============================================================================

  8452. class Game_Temp
  8453.   #--------------------------------------------------------------------------
  8454.   # ● [追加]:公開インスタンス変数
  8455.   #--------------------------------------------------------------------------
  8456.   attr_accessor :popup_data            # ポップアップスプライト
  8457.   attr_accessor :actor_battler_graphic # アクターのバトラーグラフィック
  8458.   attr_accessor :battlelog_clear       # バトルログ消去フラグ
  8459.   attr_accessor :target_cursor_sprite  # ターゲットカーソルスプライト
  8460.   attr_accessor :last_target_cursor    # 対象選択のカーソル記憶
  8461.   #--------------------------------------------------------------------------
  8462.   # ● [エイリアス]:オブジェクト初期化
  8463.   #--------------------------------------------------------------------------
  8464.   alias :lnx11a_initialize :initialize
  8465.   def initialize
  8466.     # 元のメソッドを呼ぶ
  8467.     lnx11a_initialize
  8468.     # 追加
  8469.     @popup_data = nil
  8470.     @actor_battler_graphic = []
  8471.     @battlelog_clear = false
  8472.     @battle_status_refresh = nil
  8473.     @target_cursor_sprite = nil
  8474.     clear_last_target_cursor
  8475.   end
  8476.   #--------------------------------------------------------------------------
  8477.   # ● [追加]:バトルステータス更新メソッドの設定
  8478.   #--------------------------------------------------------------------------
  8479.   def method_battle_status_refresh=(method)
  8480.     @battle_status_refresh = method
  8481.   end
  8482.   #--------------------------------------------------------------------------
  8483.   # ● [追加]:バトルステータス更新
  8484.   #--------------------------------------------------------------------------
  8485.   def battle_status_refresh
  8486.     return unless $game_party.in_battle
  8487.     @battle_status_refresh.call if @battle_status_refresh
  8488.   end
  8489.   #--------------------------------------------------------------------------
  8490.   # ● [追加]:対象選択のカーソル記憶をクリア
  8491.   #--------------------------------------------------------------------------
  8492.   def clear_last_target_cursor
  8493.     @last_target_cursor = {:actor => nil, :enemy => nil}
  8494.   end
  8495. end

  8496. #==============================================================================
  8497. # ■ Game_Action
  8498. #------------------------------------------------------------------------------
  8499. #  戦闘行動を扱うクラスです。
  8500. #==============================================================================

  8501. class Game_Action
  8502.   #--------------------------------------------------------------------------
  8503.   # ● [エイリアス]:ターゲットの配列作成
  8504.   #--------------------------------------------------------------------------
  8505.   alias :lnx11a_make_targets :make_targets
  8506.   def make_targets   
  8507.     if LNX11::TROOP_X_SORT
  8508.       # 元のメソッドを呼んでソート
  8509.       return lnx11a_make_targets.sort {|a,b| a.screen_x <=> b.screen_x}
  8510.     else
  8511.       return lnx11a_make_targets
  8512.     end
  8513.   end
  8514. end

  8515. #==============================================================================
  8516. # ■ Game_ActionResult
  8517. #------------------------------------------------------------------------------
  8518. #  戦闘行動の結果を扱うクラスです。属性に関する結果を追加します。
  8519. #==============================================================================

  8520. class Game_ActionResult
  8521.   #--------------------------------------------------------------------------
  8522.   # ● 公開インスタンス変数
  8523.   #--------------------------------------------------------------------------
  8524.   attr_accessor :element_rate               # 属性修正値
  8525.   #--------------------------------------------------------------------------
  8526.   # ● ダメージ値のクリア
  8527.   #--------------------------------------------------------------------------
  8528.   alias :lnx11a_clear_damage_values :clear_damage_values
  8529.   def clear_damage_values
  8530.     # 元のメソッドを呼ぶ
  8531.     lnx11a_clear_damage_values
  8532.     # 属性修正値をクリア
  8533.     @element_rate = 1.0
  8534.   end
  8535.   #--------------------------------------------------------------------------
  8536.   # ● [追加]:属性修正値の取得
  8537.   #--------------------------------------------------------------------------
  8538.   def element_rate
  8539.     return @element_rate if @element_rate
  8540.     @element_rate = 1.0
  8541.   end
  8542. end

  8543. #==============================================================================
  8544. # ■ Game_BattlerBase
  8545. #------------------------------------------------------------------------------
  8546. #  バトラーを扱う基本のクラスです。
  8547. #==============================================================================

  8548. class Game_BattlerBase
  8549.   #--------------------------------------------------------------------------
  8550.   # ● [追加]:ポップアップデータの取得
  8551.   #--------------------------------------------------------------------------
  8552.   def popup_data
  8553.     $game_temp.popup_data
  8554.   end
  8555.   #--------------------------------------------------------------------------
  8556.   # ● [エイリアス]:スキル使用コストの支払い
  8557.   #--------------------------------------------------------------------------
  8558.   alias :lnx11a_pay_skill_cost :pay_skill_cost
  8559.   def pay_skill_cost(skill)
  8560.     rmp = self.mp
  8561.     rtp = self.tp
  8562.     # 元のメソッドを呼ぶ   
  8563.     lnx11a_pay_skill_cost(skill)
  8564.     return unless $game_party.in_battle
  8565.     # ポップアップ
  8566.     popup_data.popup_regenerate_mp(self, (rmp - self.mp).truncate, true)
  8567.     popup_data.popup_regenerate_tp(self, (rtp - self.tp).truncate, true)
  8568.   end
  8569. end

  8570. #==============================================================================
  8571. # ■ Game_Battler
  8572. #------------------------------------------------------------------------------
  8573. #  スプライトに関するメソッドを追加したバトラーのクラスです。
  8574. #==============================================================================

  8575. class Game_Battler < Game_BattlerBase
  8576.   #--------------------------------------------------------------------------
  8577.   # ● 公開インスタンス変数
  8578.   #--------------------------------------------------------------------------
  8579.   attr_accessor :loop_animation_id     # ループアニメーション ID
  8580.   attr_accessor :loop_animation_mirror # ループアニメーション 左右反転フラグ
  8581.   #--------------------------------------------------------------------------
  8582.   # ● [エイリアス]:スプライトのエフェクトをクリア
  8583.   #--------------------------------------------------------------------------
  8584.   alias :lnx11a_clear_sprite_effects :clear_sprite_effects
  8585.   def clear_sprite_effects
  8586.     # 元のメソッドを呼ぶ
  8587.     lnx11a_clear_sprite_effects
  8588.     @loop_animation_id = 0
  8589.     @loop_animation_mirror = false
  8590.   end
  8591.   #--------------------------------------------------------------------------
  8592.   # ● [再定義]:アニメーション ID の設定
  8593.   #--------------------------------------------------------------------------  
  8594.   def animation_id=(id)
  8595.     return unless battle_member?
  8596.     @animation_id = id
  8597.   end
  8598.   #--------------------------------------------------------------------------
  8599.   # ● [追加]:ステートのループアニメーションの設定
  8600.   #--------------------------------------------------------------------------
  8601.   def set_state_animation
  8602.     # 表示優先度が高いステートを優先
  8603.     sort_states
  8604.     anime = @states.collect {|id| $data_states[id].state_animation }
  8605.     anime.delete(0)
  8606.     @loop_animation_id = anime[0] ? anime[0] : 0
  8607.   end
  8608.   #--------------------------------------------------------------------------
  8609.   # ● [エイリアス]:ステート情報をクリア
  8610.   #--------------------------------------------------------------------------
  8611.   alias :lnx11a_clear_states :clear_states
  8612.   def clear_states
  8613.     # 元のメソッドを呼ぶ
  8614.     lnx11a_clear_states
  8615.     # ステートアニメ設定
  8616.     set_state_animation
  8617.   end
  8618.   #--------------------------------------------------------------------------
  8619.   # ● [エイリアス]:ステートの付加
  8620.   #--------------------------------------------------------------------------
  8621.   alias :lnx11a_add_state :add_state
  8622.   def add_state(state_id)
  8623.     # 元のメソッドを呼ぶ
  8624.     lnx11a_add_state(state_id)
  8625.     # ステートアニメ設定
  8626.     set_state_animation
  8627.   end
  8628.   #--------------------------------------------------------------------------
  8629.   # ● [エイリアス]:ステートの解除
  8630.   #--------------------------------------------------------------------------
  8631.   alias :lnx11a_remove_state :remove_state
  8632.   def remove_state(state_id)
  8633.     # 元のメソッドを呼ぶ
  8634.     lnx11a_remove_state(state_id)
  8635.     # ステートアニメ設定
  8636.     set_state_animation
  8637.   end
  8638.   #--------------------------------------------------------------------------
  8639.   # ● [追加]:ポップアップディレイの取得
  8640.   #--------------------------------------------------------------------------
  8641.   def popup_delay
  8642.     return @popup_delay if @popup_delay
  8643.     popup_delay_clear
  8644.   end
  8645.   #--------------------------------------------------------------------------
  8646.   # ● [追加]:ポップアップディレイの設定
  8647.   #--------------------------------------------------------------------------
  8648.   def popup_delay=(delay)
  8649.     @popup_delay = delay
  8650.   end
  8651.   #--------------------------------------------------------------------------
  8652.   # ● [追加]:ポップアップディレイの設定
  8653.   #--------------------------------------------------------------------------
  8654.   def popup_delay_clear
  8655.     @popup_delay = Array.new(16) { 0 }
  8656.   end
  8657.   #--------------------------------------------------------------------------
  8658.   # ● [エイリアス]:スキル/アイテムの属性修正値を取得
  8659.   #  弱点/耐性の判定を追加します。
  8660.   #--------------------------------------------------------------------------
  8661.   alias :lnx11a_item_element_rate :item_element_rate
  8662.   def item_element_rate(user, item)
  8663.     # 元のメソッドを呼ぶ
  8664.     rate = lnx11a_item_element_rate(user, item)
  8665.     return rate unless $game_party.in_battle
  8666.     # レートを結果に保存する
  8667.     @result.element_rate = rate
  8668.     rate
  8669.   end
  8670.   #--------------------------------------------------------------------------
  8671.   # ● [エイリアス]:ダメージの処理
  8672.   #  吸収による回復のポップアップを生成します。
  8673.   #--------------------------------------------------------------------------
  8674.   alias :lnx11a_execute_damage :execute_damage
  8675.   def execute_damage(user)
  8676.     # 元のメソッドを呼ぶ
  8677.     lnx11a_execute_damage(user)
  8678.     return unless $game_party.in_battle
  8679.     # ポップアップ
  8680.     popup_data.popup_hp_drain(user, @result.hp_drain)
  8681.     popup_data.popup_mp_drain(user, @result.mp_drain)
  8682.   end
  8683.   #--------------------------------------------------------------------------
  8684.   # ● [エイリアス]:HP の再生
  8685.   #--------------------------------------------------------------------------
  8686.   alias :lnx11a_regenerate_hp :regenerate_hp
  8687.   def regenerate_hp
  8688.     # 元のメソッドを呼ぶ
  8689.     lnx11a_regenerate_hp
  8690.     return unless $game_party.in_battle
  8691.     # ポップアップ
  8692.     popup_data.popup_regenerate_hp(self, @result.hp_damage)
  8693.   end
  8694.   #--------------------------------------------------------------------------
  8695.   # ● [エイリアス]:MP の再生
  8696.   #--------------------------------------------------------------------------
  8697.   alias :lnx11a_regenerate_mp :regenerate_mp
  8698.   def regenerate_mp
  8699.     # 元のメソッドを呼ぶ
  8700.     lnx11a_regenerate_mp
  8701.     return unless $game_party.in_battle
  8702.     # ポップアップ
  8703.     popup_data.popup_regenerate_mp(self, @result.mp_damage)
  8704.   end
  8705.   #--------------------------------------------------------------------------
  8706.   # ● [エイリアス]:TP の再生
  8707.   #--------------------------------------------------------------------------
  8708.   alias :lnx11a_regenerate_tp :regenerate_tp
  8709.   def regenerate_tp
  8710.     rtp = self.tp.to_i
  8711.     # 元のメソッドを呼ぶ
  8712.     lnx11a_regenerate_tp
  8713.     return unless $game_party.in_battle
  8714.     # ポップアップ
  8715.     popup_data.popup_regenerate_tp(self, rtp - self.tp.to_i)
  8716.   end
  8717.   #--------------------------------------------------------------------------
  8718.   # ● 被ダメージによる TP チャージ
  8719.   #--------------------------------------------------------------------------
  8720.   alias :lnx11a_charge_tp_by_damage :charge_tp_by_damage
  8721.   def charge_tp_by_damage(damage_rate)
  8722.     rtp = self.tp.to_i
  8723.     # 元のメソッドを呼ぶ
  8724.     lnx11a_charge_tp_by_damage(damage_rate)
  8725.     return unless $game_party.in_battle
  8726.     # ポップアップ
  8727.     popup_data.popup_tp_charge(self, rtp - self.tp.to_i)
  8728.   end
  8729.   #--------------------------------------------------------------------------
  8730.   # ● [エイリアス]:スキル/アイテムの使用者側への効果(TP 得)
  8731.   #--------------------------------------------------------------------------
  8732.   alias :lnx11a_item_user_effect :item_user_effect
  8733.   def item_user_effect(user, item)
  8734.     rtp = user.tp.to_i
  8735.     # 元のメソッドを呼ぶ
  8736.     lnx11a_item_user_effect(user, item)
  8737.     return unless $game_party.in_battle
  8738.     # ポップアップ
  8739.     popup_data.popup_tp_gain(user, rtp - user.tp.to_i)
  8740.   end
  8741.   #--------------------------------------------------------------------------
  8742.   # ● [追加]:高さの取得
  8743.   #--------------------------------------------------------------------------
  8744.   def bitmap_height
  8745.     return @bitmap_height if @bitmap_height
  8746.     @bitmap_height = 0
  8747.   end
  8748.   #--------------------------------------------------------------------------
  8749.   # ● [追加]:高さの設定
  8750.   #--------------------------------------------------------------------------
  8751.   def bitmap_height=(y)
  8752.     @bitmap_height = y
  8753.   end
  8754.   #--------------------------------------------------------------------------
  8755.   # ● [追加]:バトル画面 Y 座標(頭上)の取得
  8756.   #--------------------------------------------------------------------------
  8757.   def screen_y_top
  8758.     screen_y - @bitmap_height
  8759.   end
  8760.   #--------------------------------------------------------------------------
  8761.   # ● [追加]:バトル画面 Y 座標(中心)の取得
  8762.   #--------------------------------------------------------------------------
  8763.   def screen_y_center
  8764.     screen_y - @bitmap_height / 2
  8765.   end
  8766. end

  8767. #==============================================================================
  8768. # ■ Game_Actor
  8769. #------------------------------------------------------------------------------
  8770. #  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors)
  8771. # の内部で使用され、Game_Party クラス($game_party)からも参照されます。
  8772. #==============================================================================

  8773. class Game_Actor < Game_Battler
  8774.   #--------------------------------------------------------------------------
  8775.   # ● [追加]:公開インスタンス変数
  8776.   #--------------------------------------------------------------------------
  8777.   attr_accessor :battler_graphic_name    # 後指定のバトラーグラフィック
  8778.   attr_accessor :refresh_battler_graphic # バトラーグラフィックの更新フラグ
  8779.   attr_accessor :screen_x                # バトル画面 X 座標
  8780.   attr_accessor :screen_y                # バトル画面 Y 座標
  8781.   attr_accessor :last_actor_command      # 最後に選択したコマンド
  8782.   #--------------------------------------------------------------------------
  8783.   # ● [再定義]:スプライトを使うか?
  8784.   #--------------------------------------------------------------------------
  8785.   def use_sprite?
  8786.     return true # 使う
  8787.   end
  8788.   #--------------------------------------------------------------------------
  8789.   # ● [追加]:バトル画面 Z 座標の取得
  8790.   #--------------------------------------------------------------------------
  8791.   def screen_z
  8792.     return $game_party.members_screen_z[0] if index == nil
  8793.     return $game_party.members_screen_z[index] # Game_EnemyのZ座標は100
  8794.   end
  8795.   #--------------------------------------------------------------------------
  8796.   # ● [エイリアス]:ダメージ効果の実行
  8797.   #--------------------------------------------------------------------------
  8798.   alias :lnx11a_perform_damage_effect :perform_damage_effect
  8799.   def perform_damage_effect
  8800.     # 元のメソッドを呼ぶ
  8801.     lnx11a_perform_damage_effect
  8802.     # シェイクを無効にしている場合、シェイクをクリア
  8803.     $game_troop.screen.clear_shake if LNX11::DISABLED_DAMAGE_SHAKE
  8804.   end
  8805.   #--------------------------------------------------------------------------
  8806.   # ● [再定義]:コラプス効果の実行
  8807.   #  アクターの[特徴>その他>消滅エフェクト]の設定を適用するようにします。
  8808.   #  処理内容は Game_Enemy のものとほぼ同一です。
  8809.   #--------------------------------------------------------------------------
  8810.   def perform_collapse_effect
  8811.     if $game_party.in_battle
  8812.       case collapse_type
  8813.       when 0
  8814.         @sprite_effect_type = :collapse
  8815.         Sound.play_actor_collapse
  8816.       when 1
  8817.         @sprite_effect_type = :boss_collapse
  8818.         Sound.play_boss_collapse1
  8819.       when 2
  8820.         @sprite_effect_type = :instant_collapse
  8821.       end
  8822.     end
  8823.   end
  8824.   #--------------------------------------------------------------------------
  8825.   # ● [追加]:グラフィック設定の配列を返す
  8826.   #--------------------------------------------------------------------------
  8827.   def graphic_name_index
  8828.     case LNX11::DEFAULT_BATTLER_GRAPHIC
  8829.     when 0 ; [@face_name, @face_index]
  8830.     when 1 ; [@character_name, @character_index]
  8831.     end
  8832.   end
  8833.   #--------------------------------------------------------------------------
  8834.   # ● [エイリアス]:グラフィックの変更
  8835.   #--------------------------------------------------------------------------
  8836.   alias :lnx11a_set_graphic :set_graphic
  8837.   def set_graphic(*args)
  8838.     face = graphic_name_index
  8839.     # 元のメソッドを呼ぶ
  8840.     lnx11a_set_graphic(*args)
  8841.     @refresh_battler_graphic = (face != graphic_name_index)
  8842.   end
  8843.   #--------------------------------------------------------------------------
  8844.   # ● [追加]:デフォルトバトラーグラフィックの取得
  8845.   #--------------------------------------------------------------------------
  8846.   def facebattler
  8847.     $game_temp.actor_battler_graphic[id]
  8848.   end
  8849.   def facebattler=(bitmap)
  8850.     facebattler.dispose if facebattler && !facebattler.disposed?
  8851.     $game_temp.actor_battler_graphic[id] = bitmap
  8852.   end
  8853.   #--------------------------------------------------------------------------
  8854.   # ● [追加]:後指定のバトラーグラフィックファイル名の取得
  8855.   #--------------------------------------------------------------------------
  8856.   def battler_graphic_name
  8857.     return @battler_graphic_name if @battler_graphic_name != nil
  8858.     @battler_graphic_name = ""
  8859.   end
  8860.   #--------------------------------------------------------------------------
  8861.   # ● [追加]:後指定のバトラーグラフィックファイル名の指定
  8862.   #--------------------------------------------------------------------------
  8863.   def battler_graphic_name=(filename)
  8864.     @battler_graphic_name = filename
  8865.     @refresh_battler_graphic = true
  8866.   end
  8867.   #--------------------------------------------------------------------------
  8868.   # ● [追加]:顔グラフィックを描画して返す
  8869.   #  処理内容は Window_Base の draw_face に準じたものです。
  8870.   #--------------------------------------------------------------------------
  8871.   def draw_face(face_name, face_index, enabled = true)
  8872.     fw = 96
  8873.     fh = 96
  8874.     # ビットマップを作成して返す
  8875.     bitmap = Cache.face(face_name)
  8876.     rect = Rect.new(face_index % 4 * fw, face_index / 4 * fh, fw, fh)
  8877.     face = Bitmap.new(fw, fh)
  8878.     color = LNX11::DEFAULT_BG_COLOR
  8879.     face.gradient_fill_rect(face.rect, color[0], color[1], true)
  8880.     face.blt(0, 0, bitmap, rect)
  8881.     bitmap.dispose
  8882.     face
  8883.   end
  8884.   #--------------------------------------------------------------------------
  8885.   # ● [追加]:歩行グラフィックを描画して返す
  8886.   #  処理内容は Window_Base の draw_character に準じたものです。
  8887.   #--------------------------------------------------------------------------
  8888.   def draw_character(character_name, character_index)
  8889.     return unless character_name
  8890.     bitmap = Cache.character(character_name)
  8891.     sign = character_name[/^[\!\$]./]
  8892.     if sign && sign.include?('$')
  8893.       cw = bitmap.width / 3
  8894.       ch = bitmap.height / 4
  8895.     else
  8896.       cw = bitmap.width / 12
  8897.       ch = bitmap.height / 8
  8898.     end
  8899.     n = character_index
  8900.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  8901.     character = Bitmap.new(cw, ch)
  8902.     color = LNX11::DEFAULT_BG_COLOR
  8903.     character.gradient_fill_rect(character.rect, color[0], color[1], true)
  8904.     character.blt(0, 0, bitmap, src_rect)
  8905.     character
  8906.   end
  8907.   #--------------------------------------------------------------------------
  8908.   # ● [追加]:デフォルトバトラーグラフィック設定
  8909.   #--------------------------------------------------------------------------
  8910.   def default_battler_graphic
  8911.     case LNX11::DEFAULT_BATTLER_GRAPHIC
  8912.     when 0 # 顔グラフィック
  8913.       self.facebattler = draw_face(@face_name, @face_index)
  8914.     when 1 # 歩行グラフィック
  8915.       self.facebattler = draw_character(@character_name, @character_index)
  8916.     end
  8917.   end
  8918.   #--------------------------------------------------------------------------
  8919.   # ● [追加]:バトラーグラフィックの更新
  8920.   #  Sprite_Batter が利用するオブジェクトを更新します。
  8921.   #--------------------------------------------------------------------------
  8922.   def update_battler_graphic
  8923.     @battler_hue = 0
  8924.     if !battler_graphic_name.empty?
  8925.       # スクリプトで指定されている
  8926.       @battler_name = @battler_graphic_name
  8927.       dispose_facebattler
  8928.     elsif !actor.default_battler_graphic.empty?
  8929.       # メモで指定されている
  8930.       @battler_name = actor.default_battler_graphic
  8931.       dispose_facebattler
  8932.     else
  8933.       # 何も指定されていない
  8934.       @battler_name = ""
  8935.       default_battler_graphic
  8936.     end
  8937.     # 更新したので更新フラグを取り消す
  8938.     @refresh_battler_graphic = false
  8939.   end
  8940.   #--------------------------------------------------------------------------
  8941.   # ● [追加]:バトラー用顔グラフィックの解放
  8942.   #--------------------------------------------------------------------------
  8943.   def dispose_facebattler
  8944.     return if self.facebattler == nil
  8945.     self.facebattler.dispose
  8946.     self.facebattler = nil
  8947.   end
  8948.   #--------------------------------------------------------------------------
  8949.   # ● [エイリアス]:レベルアップメッセージの表示
  8950.   #   レベルアップのポップアップを追加します。
  8951.   #--------------------------------------------------------------------------
  8952.   alias :lnx11a_display_level_up :display_level_up
  8953.   def display_level_up(new_skills)
  8954.     popup_data.popup_levelup(self) if $game_party.in_battle
  8955.     lnx11a_display_level_up(new_skills)
  8956.   end
  8957. end

  8958. #==============================================================================
  8959. # ■ Game_Enemy
  8960. #------------------------------------------------------------------------------
  8961. #  敵キャラを扱うクラスです。
  8962. #==============================================================================

  8963. class Game_Enemy < Game_Battler
  8964.   #--------------------------------------------------------------------------
  8965.   # ● [追加]:バトルメンバー判定
  8966.   #--------------------------------------------------------------------------
  8967.   def battle_member?
  8968.     true
  8969.   end
  8970.   #--------------------------------------------------------------------------
  8971.   # ● [追加]:通常攻撃 アニメーション ID の取得
  8972.   #--------------------------------------------------------------------------
  8973.   def atk_animation
  8974.     # メモを参照
  8975.     enemy.atk_animation
  8976.   end
  8977. end

  8978. #==============================================================================
  8979. # ■ Game_Party
  8980. #------------------------------------------------------------------------------
  8981. #  パーティを扱うクラスです。所持金やアイテムなどの情報が含まれます。このクラ
  8982. # スのインスタンスは $game_party で参照されます。
  8983. #==============================================================================

  8984. class Game_Party < Game_Unit
  8985.   #--------------------------------------------------------------------------
  8986.   # ● [追加]:公開インスタンス変数
  8987.   #--------------------------------------------------------------------------
  8988.   attr_accessor :actor_invisible     # アクター非表示
  8989.   attr_accessor :status_invisible    # バトルステータス非表示
  8990.   attr_accessor :actor_bg_invisible  # アクター背景非表示
  8991.   attr_accessor :last_party_command  # 最後に選択したパーティコマンド
  8992.   attr_accessor :members_screen_x          # バトルメンバー分のX座標配列
  8993.   attr_accessor :members_screen_x_nooffset # X:オフセットなし
  8994.   attr_accessor :members_screen_y          # バトルメンバー分のY座標配列
  8995.   attr_accessor :members_screen_z          # バトルメンバー分のZ座標配列
  8996.   #--------------------------------------------------------------------------
  8997.   # ● [追加]:バトルメンバーの座標設定
  8998.   #--------------------------------------------------------------------------
  8999.   def set_members_xyz
  9000.     return if members.size == 0
  9001.     # 座標をまとめて設定
  9002.     set_screen_x
  9003.     set_screen_y
  9004.     set_screen_z
  9005.   end
  9006.   #--------------------------------------------------------------------------
  9007.   # ● [追加]:バトルメンバーの座標設定
  9008.   #--------------------------------------------------------------------------
  9009.   def set_members_battle_graphic
  9010.     $game_party.battle_members.each {|actor| actor.update_battler_graphic}
  9011.   end
  9012.   #--------------------------------------------------------------------------
  9013.   # ● [追加]:バトル画面 X 座標の設定
  9014.   #  ここで設定した座標は Game_Actor や ステータス表示等で利用されます。
  9015.   #--------------------------------------------------------------------------
  9016.   def set_screen_x
  9017.     @members_screen_x = []
  9018.     @members_screen_x_nooffset = []
  9019.     padding = LNX11::ACTOR_PADDING[:side]
  9020.     if LNX11::ACTOR_CENTERING
  9021.       # アクターのセンタリングが有効
  9022.       a_spacing = LNX11::ACTOR_SPACING_ADJUST
  9023.       padding += (max_battle_members - battle_members.size) * a_spacing
  9024.       width = (Graphics.width - padding * 2) / battle_members.size
  9025.     else
  9026.       # アクターのセンタリングが無効
  9027.       width = (Graphics.width - padding * 2) / max_battle_members
  9028.     end
  9029.     battle_members.each_with_index do |actor, i|
  9030.       offset = LNX11::ACTOR_OFFSET[:x]
  9031.       @members_screen_x_nooffset[i] = width * i + width / 2 + padding
  9032.       @members_screen_x[i] = @members_screen_x_nooffset[i] + offset
  9033.       actor.screen_x = @members_screen_x[i]
  9034.     end
  9035.   end
  9036.   #--------------------------------------------------------------------------
  9037.   # ● [追加]:バトル画面 Y 座標の設定
  9038.   #  ここで設定した座標は Game_Actor や ステータス表示等で利用されます。
  9039.   #--------------------------------------------------------------------------
  9040.   def set_screen_y
  9041.     offset = LNX11::ACTOR_OFFSET[:y]
  9042.     ay = Graphics.height - LNX11::ACTOR_PADDING[:bottom] + offset
  9043.     @members_screen_y = Array.new(max_battle_members) {ay}
  9044.     battle_members.each {|actor| actor.screen_y = ay}
  9045.   end
  9046.   #--------------------------------------------------------------------------
  9047.   # ● [追加]:バトル画面 Z 座標の設定
  9048.   #--------------------------------------------------------------------------
  9049.   def set_screen_z
  9050.     # 便宜上、XYと同じように配列を作成しておく
  9051.     az = LNX11::ACTOR_SCREEN_TONE ? 150 : -10
  9052.     @members_screen_z = Array.new(max_battle_members) {az}
  9053.   end
  9054.   #--------------------------------------------------------------------------
  9055.   # ● [オーバーライド]:戦闘開始処理
  9056.   #--------------------------------------------------------------------------
  9057.   def on_battle_start
  9058.     super
  9059.     # バトルステータスの更新
  9060.     $game_temp.battle_status_refresh
  9061.   end
  9062. end

  9063. #==============================================================================
  9064. # ■ Game_Troop
  9065. #------------------------------------------------------------------------------
  9066. #  敵グループおよび戦闘に関するデータを扱うクラスです。
  9067. #==============================================================================

  9068. class Game_Troop < Game_Unit
  9069.   #--------------------------------------------------------------------------
  9070.   # ● [エイリアス]:セットアップ
  9071.   #  敵グループの座標修正処理を追加します。
  9072.   #--------------------------------------------------------------------------
  9073.   alias :lnx11a_setup :setup
  9074.   def setup(*args)
  9075.     # 元のメソッドを呼ぶ
  9076.     lnx11a_setup(*args)
  9077.     # 敵グループの座標修正
  9078.     @enemies.each do |enemy|
  9079.       # X:解像度がデフォルトでない場合に位置を補正する
  9080.       if LNX11::TROOP_X_SCREEN_FIX
  9081.         enemy.screen_x *= Graphics.width.to_f / 544
  9082.         enemy.screen_x.truncate
  9083.       end
  9084.       enemy.screen_y += LNX11::TROOP_Y_OFFSET
  9085.     end
  9086.   end
  9087.   #--------------------------------------------------------------------------
  9088.   # ● [エイリアス]:敵キャラ名の配列取得
  9089.   #--------------------------------------------------------------------------
  9090.   alias :lnx11a_enemy_names :enemy_names
  9091.   def enemy_names
  9092.     LNX11::MESSAGE_WINDOW_ENEMY_NAMES ? lnx11a_enemy_names : []
  9093.   end
  9094. end

  9095. #==============================================================================
  9096. # ■ Game_Message
  9097. #------------------------------------------------------------------------------
  9098. #  文章や選択肢などを表示するメッセージウィンドウの状態を扱うクラスです。
  9099. #==============================================================================

  9100. class Game_Message
  9101.   #--------------------------------------------------------------------------
  9102.   # ● [追加]:公開インスタンス変数
  9103.   #--------------------------------------------------------------------------
  9104.   attr_reader   :helpdisplay_texts        # 簡易ヘルプ配列
  9105.   #--------------------------------------------------------------------------
  9106.   # ● [追加]:簡易ヘルプ配列の取得
  9107.   #--------------------------------------------------------------------------
  9108.   def helpdisplay_texts
  9109.     return @helpdisplay_texts if @helpdisplay_texts
  9110.     @helpdisplay_texts = []
  9111.   end
  9112.   #--------------------------------------------------------------------------
  9113.   # ● [エイリアス]:クリア
  9114.   #--------------------------------------------------------------------------
  9115.   alias :lnx11a_clear :clear
  9116.   def clear
  9117.     # 元のメソッドを呼ぶ
  9118.     lnx11a_clear
  9119.     @helpdisplay_texts = []
  9120.     @add_disabled = false
  9121.   end
  9122.   #--------------------------------------------------------------------------
  9123.   # ● [エイリアス]:テキストの追加
  9124.   #--------------------------------------------------------------------------
  9125.   alias :lnx11a_add :add
  9126.   def add(text)
  9127.     # テキストの追加が禁止されてる場合、簡易ヘルプ表示用の配列に追加する
  9128.     if @add_disabled
  9129.       @helpdisplay_texts = [] unless @helpdisplay_texts
  9130.       @helpdisplay_texts.push(text)
  9131.     else
  9132.       # 元のメソッドを呼ぶ
  9133.       lnx11a_add(text)
  9134.     end
  9135.   end
  9136.   #--------------------------------------------------------------------------
  9137.   # ● [追加]:テキスト追加の禁止
  9138.   #--------------------------------------------------------------------------
  9139.   def add_disabled
  9140.     return if LNX11::MESSAGE_TYPE == 0
  9141.     @add_disabled = true
  9142.   end
  9143.   #--------------------------------------------------------------------------
  9144.   # ● [追加]:テキスト追加の禁止
  9145.   #--------------------------------------------------------------------------
  9146.   def add_enabled
  9147.     return if LNX11::MESSAGE_TYPE == 0
  9148.     @add_disabled = false
  9149.   end
  9150. end

  9151. #==============================================================================
  9152. # ■ Sprite_Battler
  9153. #------------------------------------------------------------------------------
  9154. #  バトラー表示用のスプライトです。
  9155. #==============================================================================

  9156. class Sprite_Battler < Sprite_Base
  9157.   #--------------------------------------------------------------------------
  9158.   # ● [追加]:ターゲットカーソルのバトラーの取得
  9159.   #--------------------------------------------------------------------------
  9160.   def cursor_battler
  9161.     $game_temp.target_cursor_sprite.battler
  9162.   end
  9163.   #--------------------------------------------------------------------------
  9164.   # ● [追加]:ターゲットカーソルの点滅状態に対応したシンボルを返す
  9165.   #--------------------------------------------------------------------------
  9166.   def cursor_effect
  9167.     $game_temp.target_cursor_sprite.blink ? :target_whiten : :command_whiten
  9168.   end
  9169.   #--------------------------------------------------------------------------
  9170.   # ● [追加]:対象選択フラッシュの設定
  9171.   #--------------------------------------------------------------------------
  9172.   def setup_cursor_effect
  9173.     if cursor_battler == @battler ||
  9174.        (cursor_battler == :party && @battler.actor?) ||
  9175.        ([:troop, :troop_random].include?(cursor_battler) && !@battler.actor?)
  9176.       if @effect_type == nil || @effect_type != cursor_effect
  9177.         start_effect(cursor_effect)
  9178.       end
  9179.     else
  9180.       # フラッシュエフェクト終了
  9181.       end_cursor_effect
  9182.     end
  9183.   end
  9184.   #--------------------------------------------------------------------------
  9185.   # ● [追加]:対象選択フラッシュの終了
  9186.   #--------------------------------------------------------------------------
  9187.   def end_cursor_effect
  9188.     if [:target_whiten, :command_whiten].include?(@effect_type)
  9189.       @effect_type = nil
  9190.       @effect_duration = 0
  9191.       revert_to_normal
  9192.     end
  9193.   end
  9194.   #--------------------------------------------------------------------------
  9195.   # ● [オーバーライド]:アニメーションスプライトの設定
  9196.   #--------------------------------------------------------------------------
  9197.   def animation_set_sprites(frame)
  9198.     o = self.opacity
  9199.     self.opacity = 255 if !@battler_visible || @effect_duration > 0
  9200.     # スーパークラスのメソッドを呼ぶ
  9201.     super(frame)
  9202.     self.opacity = o
  9203.   end
  9204.   #--------------------------------------------------------------------------
  9205.   # ● [オーバーライド]:アニメーションの原点設定
  9206.   #--------------------------------------------------------------------------
  9207.   def set_animation_origin
  9208.     # スーパークラスのメソッドを呼ぶ
  9209.     super
  9210.     # 画面アニメーションがアクターに再生されたら
  9211.     if @animation.position == 3 && @battler != nil && @battler.actor?
  9212.       # アニメーションのY座標を修正
  9213.       @ani_oy += LNX11::SCREEN_ANIMATION_OFFSET
  9214.     end
  9215.   end
  9216.   #--------------------------------------------------------------------------
  9217.   # ● [エイリアス]:転送元ビットマップの更新
  9218.   #--------------------------------------------------------------------------
  9219.   alias :lnx11a_update_bitmap :update_bitmap
  9220.   def update_bitmap
  9221.     if @battler.actor? && @battler.refresh_battler_graphic
  9222.       # バトラーグラフィックが変更されていれば更新する
  9223.       @battler.update_battler_graphic
  9224.     end
  9225.     if @battler.actor? && @battler.facebattler != nil
  9226.       # バトラー用顔グラフィックが作成されていれば、
  9227.       # それを Sprite の Bitmap とする
  9228.       new_bitmap = @battler.facebattler
  9229.       if bitmap != new_bitmap
  9230.         self.bitmap = new_bitmap
  9231.         init_visibility
  9232.       end
  9233.     else
  9234.       # 元のメソッドを呼ぶ
  9235.       lnx11a_update_bitmap
  9236.     end
  9237.   end
  9238.   #--------------------------------------------------------------------------
  9239.   # ● [エイリアス]:新しいアニメーションの設定
  9240.   #--------------------------------------------------------------------------
  9241.   alias :lnx11a_setup_new_animation :setup_new_animation
  9242.   def setup_new_animation
  9243.     lnx11a_setup_new_animation
  9244.     # ループアニメーションの設定
  9245.     if @battler.loop_animation_id > 0 && (@loop_animation == nil ||
  9246.        @battler.loop_animation_id != @loop_animation.id)
  9247.       animation = $data_animations[@battler.loop_animation_id]
  9248.       mirror = @battler.loop_animation_mirror
  9249.       start_loop_animation(animation, mirror)
  9250.     elsif @battler.loop_animation_id == 0 && @loop_animation
  9251.       end_loop_animation
  9252.     end
  9253.   end
  9254.   #--------------------------------------------------------------------------
  9255.   # ● [エイリアス]:新しいエフェクトの設定
  9256.   #--------------------------------------------------------------------------
  9257.   alias :lnx11a_setup_new_effect :setup_new_effect
  9258.   def setup_new_effect
  9259.     # 元のメソッドを呼ぶ
  9260.     lnx11a_setup_new_effect
  9261.     # フラッシュエフェクト設定
  9262.     if @battler_visible && cursor_battler
  9263.       setup_cursor_effect
  9264.     else
  9265.       # フラッシュエフェクト終了
  9266.       end_cursor_effect
  9267.     end
  9268.   end
  9269.   #--------------------------------------------------------------------------
  9270.   # ● [エイリアス]:エフェクトの開始
  9271.   #--------------------------------------------------------------------------
  9272.   alias :lnx11a_start_effect :start_effect
  9273.   def start_effect(effect_type)
  9274.     # エフェクト開始の追加
  9275.     @effect_type = effect_type
  9276.     case @effect_type
  9277.     when :target_whiten
  9278.       @effect_duration = 40
  9279.       @battler_visible = true
  9280.     when :command_whiten
  9281.       @effect_duration = 80
  9282.       @battler_visible = true
  9283.     end
  9284.     # 元のメソッドを呼ぶ
  9285.     lnx11a_start_effect(effect_type)
  9286.   end
  9287.   #--------------------------------------------------------------------------
  9288.   # ● [エイリアス]:エフェクトの更新
  9289.   #--------------------------------------------------------------------------
  9290.   alias :lnx11a_update_effect :update_effect
  9291.   def update_effect
  9292.     # エフェクト更新の追加
  9293.     if @effect_duration > 0
  9294.       @effect_duration -= 1
  9295.       case @effect_type
  9296.       when :target_whiten
  9297.         update_target_whiten
  9298.       when :command_whiten
  9299.         update_command_whiten
  9300.       end
  9301.       @effect_duration += 1
  9302.     end
  9303.     # 元のメソッドを呼ぶ
  9304.     lnx11a_update_effect
  9305.   end
  9306.   #--------------------------------------------------------------------------
  9307.   # ● [追加]:対象選択フラッシュエフェクトの更新
  9308.   #--------------------------------------------------------------------------
  9309.   def update_target_whiten
  9310.     alpha = @effect_duration < 20 ? @effect_duration : 40 - @effect_duration
  9311.     self.color.set(255, 255, 255, 0)
  9312.     self.color.alpha = (alpha + 1) * 2
  9313.   end
  9314.   #--------------------------------------------------------------------------
  9315.   # ● [追加]:コマンド選択フラッシュエフェクトの更新
  9316.   #--------------------------------------------------------------------------
  9317.   def update_command_whiten
  9318.     alpha = @effect_duration < 40 ? @effect_duration : 80 - @effect_duration
  9319.     self.color.set(255, 255, 255, 0)
  9320.     self.color.alpha = alpha * 2
  9321.   end
  9322.   #--------------------------------------------------------------------------
  9323.   # ● [追加]:高さの取得
  9324.   #--------------------------------------------------------------------------
  9325.   def bitmap_height
  9326.     self.bitmap.height
  9327.   end
  9328.   #--------------------------------------------------------------------------
  9329.   # ● [エイリアス]:位置の更新
  9330.   #--------------------------------------------------------------------------
  9331.   alias :lnx11a_update_position :update_position
  9332.   def update_position
  9333.     # 元のメソッドを呼ぶ
  9334.     lnx11a_update_position
  9335.     # 高さを更新
  9336.     @battler.bitmap_height = bitmap_height
  9337.     # 可視状態を更新
  9338.     self.visible = !$game_party.actor_invisible if @battler.actor?
  9339.   end
  9340.   if LNX11::ENHANCED_WHITEN
  9341.     # 白フラッシュを強めにする
  9342.     #------------------------------------------------------------------------
  9343.     # ● [再定義]:白フラッシュエフェクトの更新
  9344.     #------------------------------------------------------------------------
  9345.     def update_whiten
  9346.       self.color.set(255, 255, 255, 0)
  9347.       self.color.alpha = 192 - (16 - @effect_duration) * 12
  9348.     end
  9349.   end
  9350.   #--------------------------------------------------------------------------
  9351.   # ● ループアニメーションの追加
  9352.   #--------------------------------------------------------------------------
  9353.   #--------------------------------------------------------------------------
  9354.   # ● [追加]:クラス変数
  9355.   #--------------------------------------------------------------------------
  9356.   @@loop_ani_checker = []
  9357.   @@loop_ani_spr_checker = []
  9358.   #--------------------------------------------------------------------------
  9359.   # ● [エイリアス]:オブジェクト初期化
  9360.   #--------------------------------------------------------------------------
  9361.   alias :lnx11a_initialize :initialize
  9362.   def initialize(viewport, battler = nil)
  9363.     # 元のメソッドを呼ぶ
  9364.     lnx11a_initialize(viewport, battler)
  9365.     # ループアニメの残り時間
  9366.     @loop_ani_duration = 0
  9367.   end
  9368.   #--------------------------------------------------------------------------
  9369.   # ● [エイリアス]:解放
  9370.   #--------------------------------------------------------------------------
  9371.   alias :lnx11a_dispose :dispose
  9372.   def dispose
  9373.     # 元のメソッドを呼ぶ
  9374.     lnx11a_dispose
  9375.     # ループアニメを解放
  9376.     dispose_loop_animation
  9377.   end
  9378.   #--------------------------------------------------------------------------
  9379.   # ● [エイリアス]:フレーム更新
  9380.   #--------------------------------------------------------------------------
  9381.   alias :lnx11a_update :update
  9382.   def update
  9383.     # 元のメソッドを呼ぶ
  9384.     lnx11a_update
  9385.     update_loop_animation
  9386.     @@loop_ani_checker.clear
  9387.     @@loop_ani_spr_checker.clear
  9388.   end
  9389.   #--------------------------------------------------------------------------
  9390.   # ● [追加]:ループアニメーション表示中判定
  9391.   #--------------------------------------------------------------------------
  9392.   def loop_animation?
  9393.     @loop_animation != nil
  9394.   end
  9395.   #--------------------------------------------------------------------------
  9396.   # ● [追加]:ループアニメーションの開始
  9397.   #--------------------------------------------------------------------------
  9398.   def start_loop_animation(animation, mirror = false)
  9399.     dispose_loop_animation
  9400.     @loop_animation = animation
  9401.     if @loop_animation
  9402.       @loop_ani_mirror = mirror
  9403.       set_loop_animation_rate
  9404.       @loop_ani_duration = @loop_animation.frame_max * @loop_ani_rate + 1
  9405.       load_loop_animation_bitmap
  9406.       make_loop_animation_sprites
  9407.       set_loop_animation_origin
  9408.     end
  9409.   end
  9410.   #--------------------------------------------------------------------------
  9411.   # ● [追加]:ループアニメーションの速度を設定
  9412.   #--------------------------------------------------------------------------
  9413.   def set_loop_animation_rate
  9414.     if $lnx_include[:lnx09]
  9415.       # LNX09 を導入している
  9416.       default = LNX09::DEFAULT_BATTLE_SPEED_RATE
  9417.       if @loop_animation.speed_rate
  9418.         @loop_ani_rate = @loop_animation.speed_rate
  9419.       else
  9420.         @loop_ani_rate = default
  9421.       end
  9422.     else
  9423.       @loop_ani_rate = 4
  9424.     end
  9425.   end
  9426.   #--------------------------------------------------------------------------
  9427.   # ● [追加]:ループアニメーション グラフィックの読み込み
  9428.   #--------------------------------------------------------------------------
  9429.   def load_loop_animation_bitmap
  9430.     animation1_name = @loop_animation.animation1_name
  9431.     animation1_hue = @loop_animation.animation1_hue
  9432.     animation2_name = @loop_animation.animation2_name
  9433.     animation2_hue = @loop_animation.animation2_hue
  9434.     @loop_ani_bitmap1 = Cache.animation(animation1_name, animation1_hue)
  9435.     @loop_ani_bitmap2 = Cache.animation(animation2_name, animation2_hue)
  9436.     if @@_reference_count.include?(@loop_ani_bitmap1)
  9437.       @@_reference_count[@loop_ani_bitmap1] += 1
  9438.     else
  9439.       @@_reference_count[@loop_ani_bitmap1] = 1
  9440.     end
  9441.     if @@_reference_count.include?(@loop_ani_bitmap2)
  9442.       @@_reference_count[@loop_ani_bitmap2] += 1
  9443.     else
  9444.       @@_reference_count[@loop_ani_bitmap2] = 1
  9445.     end
  9446.     Graphics.frame_reset
  9447.   end
  9448.   #--------------------------------------------------------------------------
  9449.   # ● [追加]:ループアニメーションスプライトの作成
  9450.   #--------------------------------------------------------------------------
  9451.   def make_loop_animation_sprites
  9452.     @loop_ani_sprites = []
  9453.     if @use_sprite && !@@loop_ani_spr_checker.include?(@loop_animation)
  9454.       16.times do
  9455.         sprite = ::Sprite.new(viewport)
  9456.         sprite.visible = false
  9457.         @loop_ani_sprites.push(sprite)
  9458.       end
  9459.       if @loop_animation.position == 3
  9460.         @@loop_ani_spr_checker.push(@loop_animation)
  9461.       end
  9462.     end
  9463.     @loop_ani_duplicated = @@loop_ani_checker.include?(@loop_animation)
  9464.     if !@loop_ani_duplicated && @loop_animation.position == 3
  9465.       @@loop_ani_checker.push(@loop_animation)
  9466.     end
  9467.   end
  9468.   #--------------------------------------------------------------------------
  9469.   # ● [追加]:ループアニメーションの原点設定
  9470.   #--------------------------------------------------------------------------
  9471.   def set_loop_animation_origin
  9472.     if @loop_animation.position == 3
  9473.       if viewport == nil
  9474.         @loop_ani_ox = Graphics.width / 2
  9475.         @loop_ani_oy = Graphics.height / 2
  9476.       else
  9477.         @loop_ani_ox = viewport.rect.width / 2
  9478.         @loop_ani_oy = viewport.rect.height / 2
  9479.       end
  9480.     else
  9481.       @loop_ani_ox = x - ox + width / 2
  9482.       @loop_ani_oy = y - oy + height / 2
  9483.       if @loop_animation.position == 0
  9484.         @loop_ani_oy -= height / 2
  9485.       elsif @loop_animation.position == 2
  9486.         @loop_ani_oy += height / 2
  9487.       end
  9488.     end
  9489.   end
  9490.   #--------------------------------------------------------------------------
  9491.   # ● [追加]:ループアニメーションの解放
  9492.   #--------------------------------------------------------------------------
  9493.   def dispose_loop_animation
  9494.     if @loop_ani_bitmap1
  9495.       @@_reference_count[@loop_ani_bitmap1] -= 1
  9496.       if @@_reference_count[@loop_ani_bitmap1] == 0
  9497.         @loop_ani_bitmap1.dispose
  9498.       end
  9499.     end
  9500.     if @loop_ani_bitmap2
  9501.       @@_reference_count[@loop_ani_bitmap2] -= 1
  9502.       if @@_reference_count[@loop_ani_bitmap2] == 0
  9503.         @loop_ani_bitmap2.dispose
  9504.       end
  9505.     end
  9506.     if @loop_ani_sprites
  9507.       @loop_ani_sprites.each {|sprite| sprite.dispose }
  9508.       @loop_ani_sprites = nil
  9509.       @loop_animation = nil
  9510.     end
  9511.     @loop_ani_bitmap1 = nil
  9512.     @loop_ani_bitmap2 = nil
  9513.   end
  9514.   #--------------------------------------------------------------------------
  9515.   # ● [追加]:ループアニメーションの更新
  9516.   #--------------------------------------------------------------------------
  9517.   def update_loop_animation
  9518.     return unless loop_animation?
  9519.     @loop_ani_duration -= 1
  9520.     if @loop_ani_duration % @loop_ani_rate == 0
  9521.       if @loop_ani_duration > 0
  9522.         frame_index = @loop_animation.frame_max
  9523.         speed = (@loop_ani_duration + @loop_ani_rate - 1) / @loop_ani_rate
  9524.         frame_index -= speed
  9525.         loop_animation_set_sprites(@loop_animation.frames[frame_index])
  9526.         @loop_animation.timings.each do |timing|
  9527.           loop_animation_process_timing(timing) if timing.frame == frame_index
  9528.         end
  9529.       else
  9530.         # 残り時間を再設定してループ
  9531.         @loop_ani_duration = @loop_animation.frame_max * @loop_ani_rate + 1
  9532.       end
  9533.     end
  9534.   end
  9535.   #--------------------------------------------------------------------------
  9536.   # ● [追加]:ループアニメーションの終了
  9537.   #--------------------------------------------------------------------------
  9538.   def end_loop_animation
  9539.     dispose_loop_animation
  9540.   end
  9541.   #--------------------------------------------------------------------------
  9542.   # ● [追加]:ループアニメーションスプライトの設定
  9543.   #     frame : フレームデータ(RPG::Animation::Frame)
  9544.   #--------------------------------------------------------------------------
  9545.   def loop_animation_set_sprites(frame)
  9546.     cell_data = frame.cell_data
  9547.     @loop_ani_sprites.each_with_index do |sprite, i|
  9548.       next unless sprite
  9549.       pattern = cell_data[i, 0]
  9550.       if !pattern || pattern < 0
  9551.         sprite.visible = false
  9552.         next
  9553.       end
  9554.       sprite.bitmap = pattern < 100 ? @loop_ani_bitmap1 : @loop_ani_bitmap2
  9555.       sprite.visible = true
  9556.       sprite.src_rect.set(pattern % 5 * 192,
  9557.         pattern % 100 / 5 * 192, 192, 192)
  9558.       if @loop_ani_mirror
  9559.         sprite.x = @loop_ani_ox - cell_data[i, 1]
  9560.         sprite.y = @loop_ani_oy + cell_data[i, 2]
  9561.         sprite.angle = (360 - cell_data[i, 4])
  9562.         sprite.mirror = (cell_data[i, 5] == 0)
  9563.       else
  9564.         sprite.x = @loop_ani_ox + cell_data[i, 1]
  9565.         sprite.y = @loop_ani_oy + cell_data[i, 2]
  9566.         sprite.angle = cell_data[i, 4]
  9567.         sprite.mirror = (cell_data[i, 5] == 1)
  9568.       end
  9569.       sprite.z = self.z + 316 + i
  9570.       sprite.ox = 96
  9571.       sprite.oy = 96
  9572.       sprite.zoom_x = cell_data[i, 3] / 100.0
  9573.       sprite.zoom_y = cell_data[i, 3] / 100.0
  9574.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  9575.       sprite.blend_type = cell_data[i, 7]
  9576.     end
  9577.   end
  9578.   #--------------------------------------------------------------------------
  9579.   # ● [追加]:SE とフラッシュのタイミング処理
  9580.   #     timing : タイミングデータ(RPG::Animation::Timing)
  9581.   #--------------------------------------------------------------------------
  9582.   def loop_animation_process_timing(timing)
  9583.     timing.se.play unless @loop_ani_duplicated
  9584.     case timing.flash_scope
  9585.     when 1
  9586.       self.flash(timing.flash_color, timing.flash_duration * @loop_ani_rate)
  9587.     when 2
  9588.       if viewport && !@loop_ani_duplicated
  9589.         duration = timing.flash_duration * @loop_ani_rate
  9590.         viewport.flash(timing.flash_color, duration)
  9591.       end
  9592.     when 3
  9593.       self.flash(nil, timing.flash_duration * @loop_ani_rate)
  9594.     end
  9595.   end
  9596. end

  9597. #==============================================================================
  9598. # ■ Spriteset_Battle
  9599. #------------------------------------------------------------------------------
  9600. #  バトル画面のスプライトをまとめたクラスです。
  9601. #==============================================================================

  9602. class Spriteset_Battle
  9603.   #--------------------------------------------------------------------------
  9604.   # ● [エイリアス]:オブジェクト初期化
  9605.   #--------------------------------------------------------------------------
  9606.   alias :lnx11a_initialize :initialize
  9607.   def initialize
  9608.     # 元のメソッドを呼ぶ
  9609.     lnx11a_initialize
  9610.     # アクターエリアの背景の作成
  9611.     create_actor_background
  9612.   end
  9613.   #--------------------------------------------------------------------------
  9614.   # ● [エイリアス]:解放
  9615.   #--------------------------------------------------------------------------
  9616.   alias :lnx11a_dispose :dispose
  9617.   def dispose
  9618.     # 元のメソッドを呼ぶ
  9619.     lnx11a_dispose
  9620.     # アクターエリアの背景の解放
  9621.     dispose_actor_background
  9622.   end
  9623.   #--------------------------------------------------------------------------
  9624.   # ● [エイリアス]:フレーム更新
  9625.   #--------------------------------------------------------------------------
  9626.   alias :lnx11a_update :update
  9627.   def update
  9628.     # 元のメソッドを呼ぶ
  9629.     lnx11a_update
  9630.     # アクターエリアの背景の更新
  9631.     update_actor_background
  9632.   end
  9633.   #--------------------------------------------------------------------------
  9634.   # ● [追加]:アクターのビューポート
  9635.   #--------------------------------------------------------------------------
  9636.   def actor_viewport
  9637.     LNX11::ACTOR_SCREEN_TONE ? @viewport1 : @viewport2
  9638.   end
  9639.   #--------------------------------------------------------------------------
  9640.   # ● [追加]:アクターエリアの背景の作成
  9641.   #--------------------------------------------------------------------------
  9642.   def create_actor_background
  9643.     return if LNX11::ACTOR_BACKGROUND == 0
  9644.     viewport = actor_viewport
  9645.     height = LNX11::ACTOR_BACKGROUND_HEIGHT
  9646.     case LNX11::ACTOR_BACKGROUND
  9647.     when 1
  9648.       # グラデーション
  9649.       @actor_background = Sprite.new
  9650.       back = Bitmap.new(Graphics.width, height)
  9651.       color = LNX11::ACTOR_BG_GRADIENT_COLOR
  9652.       back.gradient_fill_rect(back.rect, color[0], color[1], true)
  9653.       @actor_background.bitmap = back
  9654.     when 2
  9655.       # ウィンドウ
  9656.       @actor_background = Window_Base.new(0, 0, Graphics.width, height)
  9657.     else
  9658.       if LNX11::ACTOR_BACKGROUND.is_a?(String)
  9659.         # ファイル指定
  9660.         @actor_background = Sprite.new
  9661.         @actor_background.bitmap = Cache.system(LNX11::ACTOR_BACKGROUND)
  9662.         @actor_background.x = Graphics.width / 2
  9663.         @actor_background.ox = @actor_background.bitmap.width / 2
  9664.         height = @actor_background.bitmap.height
  9665.       end
  9666.     end
  9667.     @actor_background.viewport = viewport
  9668.     @actor_background.y = Graphics.height - height
  9669.     @actor_background.z = viewport == @viewport1 ? 120 : -20
  9670.     update_actor_background
  9671.   end
  9672.   #--------------------------------------------------------------------------
  9673.   # ● [追加]:アクターエリアの背景の解放
  9674.   #--------------------------------------------------------------------------
  9675.   def dispose_actor_background
  9676.     return unless @actor_background
  9677.     @actor_background.bitmap.dispose if @actor_background.is_a?(Sprite)
  9678.     @actor_background.dispose
  9679.   end
  9680.   #--------------------------------------------------------------------------
  9681.   # ● [追加]:アクターエリアの背景の更新
  9682.   #--------------------------------------------------------------------------
  9683.   def update_actor_background
  9684.     return unless @actor_background
  9685.     @actor_background.visible = !$game_party.actor_bg_invisible
  9686.   end
  9687.   #--------------------------------------------------------------------------
  9688.   # ● [再定義]:アクタースプライトの作成
  9689.   #--------------------------------------------------------------------------
  9690.   def create_actors
  9691.     # 座標とグラフィックの設定
  9692.     $game_party.set_members_xyz
  9693.     $game_party.set_members_battle_graphic
  9694.     # スプライトの作成
  9695.     viewport = actor_viewport
  9696.     @actor_sprites = $game_party.battle_members.collect do |actor|
  9697.       Sprite_Battler.new(viewport, actor)
  9698.     end
  9699.   end
  9700.   #--------------------------------------------------------------------------
  9701.   # ● [再定義]:アクタースプライトの更新
  9702.   #--------------------------------------------------------------------------
  9703.   def update_actors
  9704.     @actor_sprites.each {|sprite| sprite.update }
  9705.   end
  9706. end

  9707. #==============================================================================
  9708. # ■ Scene_Battle
  9709. #------------------------------------------------------------------------------
  9710. #  バトル画面の処理を行うクラスです。
  9711. #==============================================================================

  9712. class Scene_Battle < Scene_Base
  9713.   #--------------------------------------------------------------------------
  9714.   # ● [追加]:簡易ヘルプのメソッド設定
  9715.   #--------------------------------------------------------------------------
  9716.   def set_helpdisplay_methods
  9717.     BattleManager.update_for_wait_method = method(:update_for_wait)
  9718.     BattleManager.helpdisplay_set_method = method(:helpdisplay_set)
  9719.     BattleManager.helpdisplay_clear_method = method(:helpdisplay_clear)
  9720.     BattleManager.helpdisplay_wait_short_method=method(:helpdisplay_wait_short)
  9721.   end
  9722.   #--------------------------------------------------------------------------
  9723.   # ● [追加]:簡易ヘルプ表示
  9724.   #--------------------------------------------------------------------------
  9725.   def helpdisplay_set(item, duration = nil)
  9726.     @wait_short_disabled = false
  9727.     @targethelp_window.show.set_item(item)
  9728.     @targethelp_window.update
  9729.     wait(duration ? duration : 20)
  9730.   end
  9731.   #--------------------------------------------------------------------------
  9732.   # ● [追加]:簡易ヘルプ消去
  9733.   #--------------------------------------------------------------------------
  9734.   def helpdisplay_clear(duration = nil)
  9735.     return if !@targethelp_window.visible
  9736.     @wait_short_disabled = false
  9737.     @targethelp_window.clear
  9738.     @targethelp_window.hide
  9739.     wait(duration ? duration : 10)
  9740.   end
  9741.   #--------------------------------------------------------------------------
  9742.   # ● [追加]:簡易ヘルプ・短時間ウェイト
  9743.   #--------------------------------------------------------------------------
  9744.   def helpdisplay_wait_short
  9745.     return if !@targethelp_window.visible || @wait_short_disabled
  9746.     @wait_short_disabled = true # 連続で短時間ウェイトが実行されないように
  9747.     @targethelp_window.clear
  9748.     abs_wait_short
  9749.   end
  9750.   #--------------------------------------------------------------------------
  9751.   # ● [追加]:バトラーのエフェクト実行中?
  9752.   #--------------------------------------------------------------------------
  9753.   def battler_effect?
  9754.     @spriteset.effect?
  9755.   end
  9756.   #--------------------------------------------------------------------------
  9757.   # ● [エイリアス]:コマンド[逃げる]
  9758.   #--------------------------------------------------------------------------
  9759.   alias :lnx11a_command_escape :command_escape
  9760.   def command_escape
  9761.     @party_command_window.close
  9762.     @party_command_window.openness = 0 if LNX11::MESSAGE_TYPE == 2
  9763.     @status_window.unselect
  9764.     # 元のメソッドを呼ぶ
  9765.     lnx11a_command_escape
  9766.   end
  9767.   #--------------------------------------------------------------------------
  9768.   # ● [エイリアス]:スキル/アイテムの使用
  9769.   #--------------------------------------------------------------------------
  9770.   alias :lnx11a_use_item :use_item
  9771.   def use_item
  9772.     # 簡易ヘルプ表示
  9773.     item = @subject.current_action.item
  9774.     if LNX11::BATTLELOG_TYPE == 2 && !item.no_display
  9775.       helpdisplay_set(item, item.display_wait)
  9776.     end
  9777.     # 元のメソッドを呼ぶ
  9778.     lnx11a_use_item
  9779.     # 簡易ヘルプ消去・エフェクトが終わるまで待つ
  9780.     if LNX11::BATTLELOG_TYPE == 2
  9781.       wait(item.end_wait)
  9782.       helpdisplay_clear
  9783.     end
  9784.     wait_for_effect
  9785.   end
  9786.   #--------------------------------------------------------------------------
  9787.   # ● [エイリアス]:開始処理
  9788.   #--------------------------------------------------------------------------
  9789.   alias :lnx11a_start :start
  9790.   def start
  9791.     set_helpdisplay_methods
  9792.     @last_party_members = party_members
  9793.     $game_temp.method_battle_status_refresh = method(:refresh_status)
  9794.     $game_temp.clear_last_target_cursor
  9795.     $game_party.all_members.each {|actor| actor.last_actor_command = 0 }
  9796.     reset_sprite_effects
  9797.     standby_message_window_position
  9798.     create_targetcursor
  9799.     create_popup
  9800.     #元のメソッドを呼ぶ
  9801.     lnx11a_start
  9802.   end
  9803.   #--------------------------------------------------------------------------
  9804.   # ● [エイリアス]:終了処理
  9805.   #--------------------------------------------------------------------------
  9806.   alias :lnx11a_terminate :terminate
  9807.   def terminate
  9808.     $game_message.clear
  9809.     dispose_targetcursor
  9810.     dispose_popup
  9811.     # 元のメソッドを呼ぶ
  9812.     lnx11a_terminate
  9813.   end
  9814.   #--------------------------------------------------------------------------
  9815.   # ● [追加]:アクターのスプライト情報の初期化
  9816.   #--------------------------------------------------------------------------
  9817.   def reset_sprite_effects
  9818.     $game_party.battle_members.each do |actor|
  9819.       actor.popup_delay_clear
  9820.       actor.set_state_animation
  9821.     end
  9822.   end
  9823.   #--------------------------------------------------------------------------
  9824.   # ● [エイリアス]:全ウィンドウの作成
  9825.   #--------------------------------------------------------------------------
  9826.   alias :lnx11a_create_all_windows :create_all_windows
  9827.   def create_all_windows
  9828.     # 元のメソッドを呼ぶ
  9829.     lnx11a_create_all_windows
  9830.     create_targethelp_window
  9831.   end
  9832.   #--------------------------------------------------------------------------
  9833.   # ● [エイリアス]:ステータスウィンドウの作成
  9834.   #--------------------------------------------------------------------------
  9835.   alias :lnx11a_create_status_window :create_status_window
  9836.   def create_status_window
  9837.     # 元のメソッドを呼ぶ
  9838.     lnx11a_create_status_window
  9839.     @status_window.set_xy
  9840.   end
  9841.   #--------------------------------------------------------------------------
  9842.   # ● [エイリアス]:情報表示ビューポートの作成
  9843.   #--------------------------------------------------------------------------
  9844.   alias :lnx11a_create_info_viewport :create_info_viewport
  9845.   def create_info_viewport
  9846.     # 元のメソッドを呼ぶ
  9847.     lnx11a_create_info_viewport
  9848.     # ビューポートを修正
  9849.     @info_viewport.rect.y = Graphics.height - LNX11::ACTOR_BACKGROUND_HEIGHT
  9850.     @info_viewport.rect.height = LNX11::ACTOR_BACKGROUND_HEIGHT
  9851.     @status_window.viewport = nil
  9852.   end
  9853.   #--------------------------------------------------------------------------
  9854.   # ● [エイリアス]:パーティコマンドウィンドウの作成
  9855.   #--------------------------------------------------------------------------
  9856.   alias :lnx11a_create_party_command_window :create_party_command_window
  9857.   def create_party_command_window
  9858.     # 元のメソッドを呼ぶ
  9859.     lnx11a_create_party_command_window
  9860.     @party_command_window.viewport = nil
  9861.   end
  9862.   #--------------------------------------------------------------------------
  9863.   # ● [エイリアス]:アクターコマンドウィンドウの作成
  9864.   #--------------------------------------------------------------------------
  9865.   alias :lnx11a_create_actor_command_window :create_actor_command_window
  9866.   def create_actor_command_window
  9867.     # 元のメソッドを呼ぶ
  9868.     lnx11a_create_actor_command_window
  9869.     @actor_command_window.viewport = nil
  9870.   end
  9871.   #--------------------------------------------------------------------------
  9872.   # ● [エイリアス]:ログウィンドウの作成
  9873.   #--------------------------------------------------------------------------
  9874.   alias :lnx11a_create_log_window :create_log_window
  9875.   def create_log_window
  9876.     # 元のメソッドを呼ぶ
  9877.     lnx11a_create_log_window
  9878.     # ウェイトメソッド
  9879.     @log_window.method_wait_for_animation = method(:wait_for_animation)
  9880.   end  
  9881.   #--------------------------------------------------------------------------
  9882.   # ● [追加]:ターゲットカーソルの作成
  9883.   #--------------------------------------------------------------------------
  9884.   def create_targetcursor
  9885.     @targetcursor = Sprite_TargetCursor.new
  9886.     $game_temp.target_cursor_sprite = @targetcursor
  9887.   end
  9888.   #--------------------------------------------------------------------------
  9889.   # ● [追加]:ターゲットカーソルの解放
  9890.   #--------------------------------------------------------------------------
  9891.   def dispose_targetcursor
  9892.     @targetcursor.dispose
  9893.   end
  9894.   #--------------------------------------------------------------------------
  9895.   # ● [追加]:ターゲットヘルプウィンドウの作成
  9896.   #--------------------------------------------------------------------------
  9897.   def create_targethelp_window
  9898.     @targethelp_window = Window_TargetHelp.new
  9899.     @targethelp_window.visible = false
  9900.     # ターゲット選択ウィンドウに関連付ける
  9901.     @actor_window.help_window = @targethelp_window
  9902.     @enemy_window.help_window = @targethelp_window
  9903.   end
  9904.   #--------------------------------------------------------------------------
  9905.   # ● [追加]:ポップアップの作成
  9906.   #--------------------------------------------------------------------------
  9907.   def create_popup
  9908.     $game_temp.popup_data = Popup_Data.new
  9909.   end
  9910.   #--------------------------------------------------------------------------
  9911.   # ● [追加]:ポップアップの解放
  9912.   #--------------------------------------------------------------------------
  9913.   def dispose_popup
  9914.     $game_temp.popup_data.dispose
  9915.   end
  9916.   #--------------------------------------------------------------------------
  9917.   # ● [追加]:ポップアップデータの取得
  9918.   #--------------------------------------------------------------------------
  9919.   def popup_data
  9920.     $game_temp.popup_data
  9921.   end
  9922.   #--------------------------------------------------------------------------
  9923.   # ● [エイリアス]:フレーム更新(基本)
  9924.   #--------------------------------------------------------------------------
  9925.   alias :lnx11a_update_basic :update_basic
  9926.   def update_basic
  9927.     # 元のメソッドを呼ぶ
  9928.     lnx11a_update_basic
  9929.     # 追加したオブジェクトの更新
  9930.     update_targetcursor
  9931.     update_popup
  9932.     refresh_actors
  9933.   end
  9934.   #--------------------------------------------------------------------------
  9935.   # ● [追加]:パーティメンバーの ID 配列の取得
  9936.   #--------------------------------------------------------------------------
  9937.   def party_members
  9938.     $game_party.battle_members.collect {|actor| actor.id }
  9939.   end
  9940.   #--------------------------------------------------------------------------
  9941.   # ● [追加]:メンバーが入れ替わったらオブジェクトを再作成する
  9942.   #--------------------------------------------------------------------------
  9943.   def refresh_actors
  9944.     a_party_members = party_members
  9945.     return if @last_party_members == a_party_members
  9946.     @last_party_members = a_party_members
  9947.     $game_party.battle_members.each {|actor| actor.sprite_effect_type=:appear }
  9948.     reset_sprite_effects
  9949.     @spriteset.dispose_actors
  9950.     @spriteset.create_actors
  9951.     status_clear
  9952.     refresh_status
  9953.     Graphics.frame_reset
  9954.   end
  9955.   #--------------------------------------------------------------------------
  9956.   # ● [追加]:ステータスウィンドウの情報を更新(メンバー交代用)
  9957.   #--------------------------------------------------------------------------
  9958.   def status_clear
  9959.     @status_window.all_clear
  9960.   end
  9961.   #--------------------------------------------------------------------------
  9962.   # ● [追加]:メッセージウィンドウの位置の初期化
  9963.   #  毎フレーム呼び出すことで、イベントコマンド以外のメッセージの位置を
  9964.   # 固定します。
  9965.   #--------------------------------------------------------------------------
  9966.   def standby_message_window_position
  9967.     $game_message.background = LNX11::MESSAGE_WINDOW_BACKGROUND
  9968.     $game_message.position = LNX11::MESSAGE_WINDOW_POSITION
  9969.   end
  9970.   #--------------------------------------------------------------------------
  9971.   # ● [再定義]:メッセージウィンドウを開く処理の更新
  9972.   #    ステータスウィンドウなどが閉じ終わるまでオープン度を 0 にする。
  9973.   #--------------------------------------------------------------------------
  9974.   def update_message_open
  9975.     if $game_message.busy?
  9976.       @party_command_window.close
  9977.       @actor_command_window.close
  9978.       $game_temp.battlelog_clear = true
  9979.     else
  9980.       standby_message_window_position
  9981.     end
  9982.   end
  9983.   #--------------------------------------------------------------------------
  9984.   # ● [追加]:ターゲットカーソル更新
  9985.   #--------------------------------------------------------------------------
  9986.   def update_targetcursor
  9987.     # 選択中のバトラーの座標を設定する
  9988.     if @actor_window.active
  9989.       # アクター選択ウィンドウがアクティブ
  9990.       @targetcursor.set(@actor_window.targetcursor, true)
  9991.     elsif @enemy_window.active
  9992.       # 敵キャラ選択ウィンドウがアクティブ
  9993.       @targetcursor.set(@enemy_window.targetcursor, true)
  9994.     elsif @status_window.index >= 0
  9995.       # ステータスウィンドウがアクティブ
  9996.       @targetcursor.set(@status_window.actor)
  9997.     else
  9998.       # どれもアクティブでない場合は非表示
  9999.       @targetcursor.hide
  10000.     end
  10001.     @targetcursor.update
  10002.   end
  10003.   #--------------------------------------------------------------------------
  10004.   # ● [追加]:ポップアップ更新
  10005.   #--------------------------------------------------------------------------
  10006.   def update_popup
  10007.     # ポップアップスプライトの更新
  10008.     popup_data.update
  10009.   end  
  10010.   #--------------------------------------------------------------------------
  10011.   # ● [エイリアス]:パーティコマンド選択の開始
  10012.   #--------------------------------------------------------------------------
  10013.   alias :lnx11a_start_party_command_selection :start_party_command_selection
  10014.   def start_party_command_selection
  10015.     # 元のメソッドを呼ぶ
  10016.     lnx11a_start_party_command_selection
  10017.     # バトルログ削除
  10018.     @log_window.lines_clear
  10019.     $game_temp.battlelog_clear = LNX11::STORAGE_TURNEND_CLEAR
  10020.     @actor_command = false
  10021.     # 2ターン目以降のパーテイコマンドスキップ
  10022.     return unless @party_command_skip
  10023.     @party_command_skip = false
  10024.     command_fight if !scene_changing? && @party_command_window.active
  10025.   end
  10026.   #--------------------------------------------------------------------------
  10027.   # ● [エイリアス]:アクターコマンド選択の開始
  10028.   #--------------------------------------------------------------------------
  10029.   alias :lnx11a_start_actor_command_selection :start_actor_command_selection
  10030.   def start_actor_command_selection
  10031.     # 元のメソッドを呼ぶ
  10032.     lnx11a_start_actor_command_selection
  10033.     @actor_command = true
  10034.   end
  10035.   #--------------------------------------------------------------------------
  10036.   # ● [エイリアス]:ターン終了
  10037.   #--------------------------------------------------------------------------
  10038.   alias :lnx11a_turn_end :turn_end
  10039.   def turn_end
  10040.     @party_command_skip = (LNX11::PARTY_COMMAND_SKIP && @actor_command)
  10041.     @actor_command = false
  10042.     # 元のメソッドを呼ぶ
  10043.     lnx11a_turn_end
  10044.   end
  10045.   #--------------------------------------------------------------------------
  10046.   # ● [追加]:アクターの選択したアイテム・スキルを返す
  10047.   #--------------------------------------------------------------------------
  10048.   def actor_selection_item
  10049.     case @actor_command_window.current_symbol
  10050.     when :attack ; $data_skills[BattleManager.actor.attack_skill_id]
  10051.     when :skill  ; @skill
  10052.     when :item   ; @item
  10053.     when :guard  ; $data_skills[BattleManager.actor.guard_skill_id]
  10054.     else ; nil
  10055.     end
  10056.   end
  10057.   #--------------------------------------------------------------------------
  10058.   # ● [エイリアス]:コマンド[防御]
  10059.   #--------------------------------------------------------------------------
  10060.   alias :lnx11a_command_guard :command_guard
  10061.   def command_guard
  10062.     if LNX11::GUARD_TARGET_CHECKE
  10063.       BattleManager.actor.input.set_guard
  10064.       # アクター選択
  10065.       select_actor_selection
  10066.     else
  10067.       # 元のメソッドを呼ぶ
  10068.       lnx11a_command_guard
  10069.     end
  10070.   end
  10071.   #--------------------------------------------------------------------------
  10072.   # ● [エイリアス]:アクター選択の開始
  10073.   #--------------------------------------------------------------------------
  10074.   alias :lnx11a_select_actor_selection :select_actor_selection
  10075.   def select_actor_selection
  10076.     # ターゲットチェック
  10077.     @actor_window.set_target(actor_selection_item)
  10078.     # 元のメソッドを呼ぶ
  10079.     lnx11a_select_actor_selection
  10080.     # ターゲットチェック
  10081.     @actor_window.set_target_refresh(actor_selection_item, BattleManager.actor)
  10082.   end
  10083.   #--------------------------------------------------------------------------
  10084.   # ● [エイリアス]:敵キャラ選択の開始
  10085.   #--------------------------------------------------------------------------
  10086.   alias :lnx11a_select_enemy_selection :select_enemy_selection
  10087.   def select_enemy_selection
  10088.     # ターゲットチェック
  10089.     @enemy_window.set_target(actor_selection_item)
  10090.     # 元のメソッドを呼ぶ
  10091.     lnx11a_select_enemy_selection
  10092.     # ターゲットチェック
  10093.     @enemy_window.set_target_refresh(actor_selection_item, BattleManager.actor)
  10094.   end
  10095.   #--------------------------------------------------------------------------
  10096.   # ● [エイリアス]アクター[キャンセル]
  10097.   #--------------------------------------------------------------------------
  10098.   alias :lnx11a_on_actor_cancel :on_actor_cancel
  10099.   def on_actor_cancel
  10100.     # 元のメソッドを呼ぶ
  10101.     lnx11a_on_actor_cancel
  10102.     # 防御の場合
  10103.     case @actor_command_window.current_symbol
  10104.     when :guard
  10105.       @actor_command_window.activate
  10106.     end   
  10107.   end
  10108.   #--------------------------------------------------------------------------
  10109.   # ● [エイリアス]:攻撃アニメーションの表示
  10110.   #--------------------------------------------------------------------------
  10111.   alias :lnx11a_show_attack_animation :show_attack_animation
  10112.   def show_attack_animation(targets)
  10113.     if @subject.actor?
  10114.       lnx11a_show_attack_animation(targets)
  10115.     else
  10116.       # 敵の通常攻撃アニメーション
  10117.       show_normal_animation(targets, @subject.atk_animation, false)
  10118.     end
  10119.   end
  10120. end

  10121. #==============================================================================
  10122. # ■ LNX11_Window_ActiveVisible
  10123. #------------------------------------------------------------------------------
  10124. #  バトル画面でターゲット選択中にウィンドウを非表示にするための
  10125. # ウィンドウ用モジュールです。
  10126. # ウィンドウの active と visible を連動させる役割があります。
  10127. # Window_ActorCommand,Window_BattleSkill, Window_BattleItem で
  10128. # インクルードされます。
  10129. #==============================================================================

  10130. module LNX11_Window_ActiveVisible
  10131.   #--------------------------------------------------------------------------
  10132.   # ● [オーバーライド]:ウィンドウのアクティブ化
  10133.   #--------------------------------------------------------------------------
  10134.   def activate
  10135.     self.show
  10136.     super
  10137.   end
  10138.   #--------------------------------------------------------------------------
  10139.   # ● [オーバーライド]:ウィンドウの非アクティブ化
  10140.   #--------------------------------------------------------------------------
  10141.   def deactivate
  10142.     @help_window != nil ? self.hide : self.visible = false
  10143.     super
  10144.   end
  10145. end

  10146. #==============================================================================
  10147. # ■ LNX11_Window_FittingList
  10148. #------------------------------------------------------------------------------
  10149. #  バトル画面のスキルリスト・アイテムリストを項目数に合わせてリサイズする
  10150. # ウィンドウ用モジュールです。
  10151. # Window_BattleSkill, Window_BattleItem でインクルードされます。
  10152. #==============================================================================

  10153. module LNX11_Window_FittingList
  10154.   #--------------------------------------------------------------------------
  10155.   # ● [追加]:ウィンドウの高さ(最大)
  10156.   #--------------------------------------------------------------------------
  10157.   def max_height
  10158.     @info_viewport.rect.y - @help_window.height
  10159.   end
  10160.   #--------------------------------------------------------------------------
  10161.   # ● [オーバーライド]:リフレッシュ
  10162.   #--------------------------------------------------------------------------
  10163.   def refresh
  10164.     make_item_list
  10165.     self.height = [fitting_height(row_max), max_height].min
  10166.     super
  10167.     self.oy = 0
  10168.   end
  10169. end
  10170.   
  10171. #==============================================================================
  10172. # ■ LNX11_Window_TargetHelp
  10173. #------------------------------------------------------------------------------
  10174. #  バトル画面で、ターゲット選択中にヘルプウィンドウを表示するための
  10175. # ウィンドウ用モジュールです。
  10176. # Window_BattleActor, Window_BattleEnemy でインクルードされます。
  10177. #==============================================================================

  10178. module LNX11_Window_TargetHelp
  10179.   #--------------------------------------------------------------------------
  10180.   # ● [追加]:ターゲットチェック
  10181.   #--------------------------------------------------------------------------
  10182.   def set_target(actor_selection_item)
  10183.     @cursor_fix = @cursor_all = @cursor_random = false
  10184.     item = actor_selection_item
  10185.     if actor_selection_item && !item.lnx11a_need_selection?
  10186.       # カーソルを固定
  10187.       @cursor_fix = true
  10188.       # 全体
  10189.       @cursor_all = item.for_all?
  10190.       # ランダム
  10191.       if item.for_random?
  10192.         @cursor_all = true
  10193.         @cursor_random = true
  10194.         @random_number = item.number_of_targets
  10195.       end
  10196.     end
  10197.     # 戦闘不能の味方が対象か?
  10198.     @dead_friend = item.for_dead_friend?
  10199.   end
  10200.   #--------------------------------------------------------------------------
  10201.   # ● [追加]:ターゲットチェック(リフレッシュ後)
  10202.   #--------------------------------------------------------------------------
  10203.   def set_target_refresh(actor_selection_item, actor)
  10204.     item = actor_selection_item
  10205.     # 使用者が対象なら、使用者にカーソルを合わせる
  10206.     select($game_party.members.index(actor)) if @cursor_fix && item.for_user?
  10207.   end
  10208.   #--------------------------------------------------------------------------
  10209.   # ● [オーバーライド]:ウィンドウの表示
  10210.   #--------------------------------------------------------------------------
  10211.   def show
  10212.     @help_window.show
  10213.     super
  10214.   end
  10215.   #--------------------------------------------------------------------------
  10216.   # ● [オーバーライド]:ウィンドウの非表示
  10217.   #--------------------------------------------------------------------------
  10218.   def hide
  10219.     @help_window.hide
  10220.     super
  10221.   end
  10222. end

  10223. #==============================================================================
  10224. # ■ [追加]:Window_TargetHelp
  10225. #------------------------------------------------------------------------------
  10226. #  ターゲットの名前情報やスキルやアイテムの名前を表示します。
  10227. #==============================================================================

  10228. class Window_TargetHelp < Window_Help
  10229.   #--------------------------------------------------------------------------
  10230.   # ● 公開インスタンス変数
  10231.   #--------------------------------------------------------------------------
  10232.   attr_accessor :random_number  # 効果範囲ランダムの数
  10233.   #--------------------------------------------------------------------------
  10234.   # ● [オーバーライド]:オブジェクト初期化
  10235.   #--------------------------------------------------------------------------
  10236.   def initialize
  10237.     super(1) # 1行ヘルプ
  10238.   end
  10239.   #--------------------------------------------------------------------------
  10240.   # ● [オーバーライド]:ウィンドウの非表示
  10241.   #--------------------------------------------------------------------------
  10242.   def hide
  10243.     super
  10244.     clear
  10245.   end
  10246.   #--------------------------------------------------------------------------
  10247.   # ● [オーバーライド]:アイテム名設定
  10248.   #     item : スキル、アイテム、バトラー等
  10249.   #--------------------------------------------------------------------------
  10250.   def set_item(item)
  10251.     set_text(item ? item : "") # itemの説明ではなく、item自体を渡すようにする
  10252.   end
  10253.   #--------------------------------------------------------------------------
  10254.   # ● ゲージ幅
  10255.   #--------------------------------------------------------------------------
  10256.   def gauge_width
  10257.     LNX11::HELP_PARAM_WIDTH
  10258.   end
  10259.   #--------------------------------------------------------------------------
  10260.   # ● ゲージ幅(余白を含む)
  10261.   #--------------------------------------------------------------------------  
  10262.   def gauge_width_spacing
  10263.     LNX11::HELP_PARAM_WIDTH + 4
  10264.   end
  10265.   #--------------------------------------------------------------------------
  10266.   # ● パラメータエリアの幅
  10267.   #--------------------------------------------------------------------------  
  10268.   def param_width(size)
  10269.     gauge_width_spacing * size
  10270.   end
  10271.   #--------------------------------------------------------------------------
  10272.   # ● 効果範囲ランダムの数の取得
  10273.   #--------------------------------------------------------------------------
  10274.   def random_number
  10275.     # 全角にして返す
  10276.     @random_number.to_s.tr('0-9','0-9')
  10277.   end
  10278.   #--------------------------------------------------------------------------
  10279.   # ● [オーバーライド]:リフレッシュ
  10280.   #--------------------------------------------------------------------------
  10281.   def refresh
  10282.     contents.clear
  10283.     if @text == :party
  10284.       draw_text(contents.rect, "我方全体", 1)
  10285.     elsif @text == :troop
  10286.       draw_text(contents.rect, "敌全体", 1)
  10287.     elsif @text == :troop_random
  10288.       case LNX11::RANDOMSCOPE_DISPLAY
  10289.       when 0 ; draw_text(contents.rect, "敌全体 随机", 1)
  10290.       when 1 ; draw_text(contents.rect, "#{random_number}名敌人 随机", 1)
  10291.       end
  10292.     elsif @text.is_a?(Game_Battler)
  10293.       # 選択対象の情報を描画
  10294.       draw_target_info
  10295.     elsif @text.is_a?(RPG::UsableItem)
  10296.       # アイテムかスキルならアイテム名を描画
  10297.       draw_item_name_help(@text)
  10298.     else
  10299.       # 通常のテキスト
  10300.       super
  10301.     end
  10302.   end
  10303.   #--------------------------------------------------------------------------
  10304.   # ● 選択対象の情報の描画
  10305.   #--------------------------------------------------------------------------
  10306.   def draw_target_info
  10307.     # バトラー情報の描画
  10308.     param = @text.actor? ? LNX11::HELP_ACTOR_PARAM : LNX11::HELP_ENEMY_PARAM
  10309.     # ゲージ付きステータス配列
  10310.     status = [param[:hp],param[:mp],param[:tp]&&$data_system.opt_display_tp]
  10311.     # 名前
  10312.     x = contents_width / 2 - contents.text_size(@text.name).width / 2
  10313.     name_width = contents.text_size(@text.name).width + 4
  10314.     if !status.include?(true)
  10315.       # ゲージ付きステータスを描画しない場合
  10316.       draw_targethelp_name(@text, x, name_width, param[:hp])
  10317.       x += name_width
  10318.       state_width = contents_width - x
  10319.     else
  10320.       # ゲージ付きステータスを描画する場合
  10321.       status.delete(false)
  10322.       x -= param_width(status.size) / 2
  10323.       draw_targethelp_name(@text, x, name_width, param[:hp])
  10324.       x += name_width
  10325.       state_width = contents_width - x - param_width(status.size)
  10326.     end
  10327.     # ステートアイコン
  10328.     if param[:state]
  10329.       draw_actor_icons(@text, x, 0, state_width)
  10330.     end
  10331.     # パラメータの描画
  10332.     x = contents_width - param_width(status.size)
  10333.     # HP
  10334.     if param[:hp]
  10335.       draw_actor_hp(@text, x, 0, gauge_width)
  10336.       x += gauge_width_spacing
  10337.     end
  10338.     # MP
  10339.     if param[:mp]
  10340.       draw_actor_mp(@text, x, 0, gauge_width)
  10341.       x += gauge_width_spacing
  10342.     end
  10343.     # TP
  10344.     if param[:tp] && $data_system.opt_display_tp
  10345.       draw_actor_tp(@text, x, 0, gauge_width)
  10346.       x += gauge_width_spacing
  10347.     end
  10348.   end
  10349.   #--------------------------------------------------------------------------
  10350.   # ● ターゲットの名前描画
  10351.   #--------------------------------------------------------------------------
  10352.   def draw_targethelp_name(actor, x, name_width, hp)
  10353.     if hp
  10354.       # HPゲージを伴う場合(HPが少ない場合、名前の色が変化する)
  10355.       draw_actor_name(actor, x, 0, name_width)
  10356.     else
  10357.       text = actor.name
  10358.       draw_text(x, 0, text_size(text).width + 4, line_height, text)
  10359.     end
  10360.   end
  10361.   #--------------------------------------------------------------------------
  10362.   # ● アイテムの描画(中央揃え)
  10363.   #--------------------------------------------------------------------------
  10364.   def draw_item_name_help(item)
  10365.     case LNX11::HELPDISPLAY_TYPE
  10366.     when 0 # アイコン+名前
  10367.       w = contents.text_size(@text.name).width + 28
  10368.     when 1 # 名前のみ
  10369.       w = contents.text_size(@text.name).width + 4
  10370.     end
  10371.     # 簡易説明文の描画
  10372.     if !@text.short_description.empty?
  10373.       des = LNX11::HELPDISPLAY_DESCRIPTION
  10374.       contents.font.size = des[:size]
  10375.       text = des[:delimiter] + @text.short_description
  10376.       rect = contents.text_size(text)
  10377.       w += rect.width
  10378.       x = (contents_width - w) / 2
  10379.       y = (line_height - rect.height) / 2
  10380.       draw_text(x, y, w, line_height, text, 2)
  10381.       reset_font_settings
  10382.     end
  10383.     # 名前の描画
  10384.     x = (contents_width - w) / 2
  10385.     case LNX11::HELPDISPLAY_TYPE
  10386.     when 0 # アイコン+名前
  10387. #      draw_item_name(@text, x, 0, true, w)
  10388.       draw_item_name(@text, x, 0, true, w)
  10389.     when 1 # 名前のみ
  10390.       draw_text(x, 0, contents_width, line_height, @text.name)
  10391.     end
  10392.   end
  10393. end

  10394. #==============================================================================
  10395. # ■ Window_PartyCommand
  10396. #------------------------------------------------------------------------------
  10397. #  バトル画面で、戦うか逃げるかを選択するウィンドウです。
  10398. #==============================================================================

  10399. class Window_PartyCommand < Window_Command
  10400.   #--------------------------------------------------------------------------
  10401.   # ● [エイリアス]:オブジェクト初期化
  10402.   #--------------------------------------------------------------------------
  10403.   alias :lnx11a_initialize :initialize
  10404.   def initialize
  10405.     $game_party.last_party_command = nil
  10406.     # 元のメソッドを呼ぶ
  10407.     lnx11a_initialize
  10408.     # 座標を設定
  10409.     self.x = LNX11::PARTY_COMMAND_XY[:x]
  10410.     self.y = LNX11::PARTY_COMMAND_XY[:y]
  10411.   end
  10412.   #--------------------------------------------------------------------------
  10413.   # ● [オーバーライド]:ウィンドウ幅の取得
  10414.   #--------------------------------------------------------------------------
  10415.   def window_width
  10416.     return LNX11::PARTY_COMMAND_WIDTH
  10417.   end
  10418.   #--------------------------------------------------------------------------
  10419.   # ● [オーバーライド]:表示行数の取得
  10420.   #--------------------------------------------------------------------------
  10421.   def visible_line_number
  10422.     return LNX11::PARTY_COMMAND_HORIZON ? 1 : @list.size
  10423.   end
  10424.   #--------------------------------------------------------------------------
  10425.   # ● [オーバーライド]:桁数の取得
  10426.   #--------------------------------------------------------------------------
  10427.   def col_max
  10428.     return LNX11::PARTY_COMMAND_HORIZON ? @list.size : 1
  10429.   end
  10430.   #--------------------------------------------------------------------------
  10431.   # ● [オーバーライド]:アライメントの取得
  10432.   #--------------------------------------------------------------------------
  10433.   def alignment
  10434.     return LNX11::PARTY_COMMAND_ALIGNMENT
  10435.   end
  10436.   #--------------------------------------------------------------------------
  10437.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  10438.   #--------------------------------------------------------------------------
  10439.   def spacing
  10440.     return 8
  10441.   end
  10442.   #--------------------------------------------------------------------------
  10443.   # ● [オーバーライド]:ウィンドウを開く
  10444.   #--------------------------------------------------------------------------
  10445.   def open
  10446.     super
  10447.     # 最後に選択したコマンドを選択
  10448.     return self unless LNX11::LAST_PARTY_COMMAND
  10449.     last_command = $game_party.last_party_command
  10450.     if last_command && @list.include?(last_command)
  10451.       select(@list.index(last_command))
  10452.     end
  10453.     self
  10454.   end
  10455.   #--------------------------------------------------------------------------
  10456.   # ● [エイリアス]:ウィンドウを閉じる
  10457.   #--------------------------------------------------------------------------
  10458.   def close
  10459.     super
  10460.     # 選択したコマンドを記憶
  10461.     $game_party.last_party_command = @list[index] if index >= 0
  10462.     self
  10463.   end
  10464. end

  10465. #==============================================================================
  10466. # ■ Window_ActorCommand
  10467. #------------------------------------------------------------------------------
  10468. #  バトル画面で、アクターの行動を選択するウィンドウです。
  10469. #==============================================================================

  10470. class Window_ActorCommand < Window_Command
  10471.   include LNX11_Window_ActiveVisible
  10472.   #--------------------------------------------------------------------------
  10473.   # ● [オーバーライド]:ウィンドウ幅の取得
  10474.   #--------------------------------------------------------------------------
  10475.   def window_width
  10476.     return LNX11::ACTOR_COMMAND_WIDTH
  10477.   end
  10478.   #--------------------------------------------------------------------------
  10479.   # ● [オーバーライド]:表示行数の取得
  10480.   #--------------------------------------------------------------------------
  10481.   def visible_line_number
  10482.     list_size = LNX11::ACTOR_COMMAND_NOSCROLL ? @list.size : 4
  10483.     return LNX11::ACTOR_COMMAND_HORIZON ? 1 : list_size
  10484.   end
  10485.   #--------------------------------------------------------------------------
  10486.   # ● [オーバーライド]:桁数の取得
  10487.   #--------------------------------------------------------------------------
  10488.   def col_max
  10489.     return LNX11::ACTOR_COMMAND_HORIZON ? [@list.size, 1].max :  1
  10490.   end
  10491.   #--------------------------------------------------------------------------
  10492.   # ● [オーバーライド]:アライメントの取得
  10493.   #--------------------------------------------------------------------------
  10494.   def alignment
  10495.     return LNX11::ACTOR_COMMAND_ALIGNMENT
  10496.   end
  10497.   #--------------------------------------------------------------------------
  10498.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  10499.   #--------------------------------------------------------------------------
  10500.   def spacing
  10501.     return 8
  10502.   end
  10503.   #--------------------------------------------------------------------------
  10504.   # ● [追加]:X 座標をアクターに合わせる
  10505.   #--------------------------------------------------------------------------
  10506.   def actor_x(actor)
  10507.     ax = $game_party.members_screen_x_nooffset[actor.index] - self.width / 2
  10508.     pad = LNX11::STATUS_SIDE_PADDING / 2
  10509.     # 画面内に収める
  10510.     self.x = [[ax, pad].max, Graphics.width - pad - self.width].min
  10511.     self.x += LNX11::ACTOR_COMMAND_OFFSET[:x]
  10512.   end
  10513.   #--------------------------------------------------------------------------
  10514.   # ● [追加]:Y 座標をアクターに合わせる
  10515.   #--------------------------------------------------------------------------
  10516.   def actor_y(actor)
  10517.     self.y = actor.screen_y_top - self.height
  10518.     self.y += LNX11::ACTOR_COMMAND_OFFSET[:y]
  10519.   end
  10520.   #--------------------------------------------------------------------------
  10521.   # ● [追加]:固定 Y 座標
  10522.   #--------------------------------------------------------------------------
  10523.   def screen_y
  10524.     if LNX11::ACTOR_COMMAND_Y_POSITION == 0
  10525.       self.y = Graphics.height - self.height + LNX11::ACTOR_COMMAND_OFFSET[:y]
  10526.     else
  10527.       self.y = LNX11::ACTOR_COMMAND_OFFSET[:y]
  10528.     end
  10529.   end
  10530.   #--------------------------------------------------------------------------
  10531.   # ● [エイリアス]:セットアップ
  10532.   #--------------------------------------------------------------------------
  10533.   alias :lnx11a_setup :setup
  10534.   def setup(actor)
  10535.     # 前のアクターのコマンドを記憶
  10536.     @actor.last_actor_command = @list[index] if @actor
  10537.     # 元のメソッドを呼ぶ
  10538.     lnx11a_setup(actor)
  10539.     self.arrows_visible = !LNX11::ACTOR_COMMAND_NOSCROLL
  10540.     self.height = window_height
  10541.     self.oy = 0
  10542.     # アクターコマンドの表示位置で分岐
  10543.     case LNX11::ACTOR_COMMAND_POSITION
  10544.     when 0
  10545.       # アクターの頭上
  10546.       actor_x(actor)
  10547.       actor_y(actor)
  10548.     when 1
  10549.       # Y 座標固定
  10550.       actor_x(actor)
  10551.       screen_y
  10552.     when 2
  10553.       # XY固定
  10554.       self.x = LNX11::ACTOR_COMMAND_OFFSET[:x]
  10555.       screen_y
  10556.     end
  10557.     # 最後に選択したコマンドを選択
  10558.     return unless LNX11::LAST_ACTOR_COMMAND
  10559.     last_command = @actor.last_actor_command
  10560.     if last_command && @list.include?(last_command)
  10561.       select(@list.index(last_command))
  10562.     end
  10563.   end
  10564. end

  10565. #==============================================================================
  10566. # ■ Window_BattleStatus
  10567. #------------------------------------------------------------------------------
  10568. #  バトル画面で、パーティメンバーのステータスを表示するウィンドウです。
  10569. #==============================================================================

  10570. class Window_BattleStatus < Window_Selectable
  10571.   #--------------------------------------------------------------------------
  10572.   # ● [追加]:公開インスタンス変数
  10573.   #--------------------------------------------------------------------------
  10574.   attr_reader :min_offset   # ステータス描画 X 座標の位置修正
  10575.   #--------------------------------------------------------------------------
  10576.   # ● [エイリアス]:オブジェクト初期化
  10577.   #--------------------------------------------------------------------------
  10578.   alias :lnx11a_initialize :initialize
  10579.   def initialize
  10580.     @actor_last_status = Array.new($game_party.max_battle_members) { nil }   
  10581.     # 元のメソッドを呼ぶ
  10582.     lnx11a_initialize
  10583.     # ウィンドウを最初から表示
  10584.     self.openness = 255
  10585.     self.opacity = 0
  10586.     update_invisible
  10587.   end
  10588.   #--------------------------------------------------------------------------
  10589.   # ● [オーバーライド]:行の高さを取得
  10590.   #--------------------------------------------------------------------------
  10591.   def line_height
  10592.     return LNX11::STATUS_LINE_HEIGHT
  10593.   end
  10594.   #--------------------------------------------------------------------------
  10595.   # ● [オーバーライド]:標準パディングサイズの取得
  10596.   #--------------------------------------------------------------------------
  10597.   def standard_padding
  10598.     return 0
  10599.   end
  10600.   #--------------------------------------------------------------------------
  10601.   # ● [オーバーライド]:表示行数の取得
  10602.   #--------------------------------------------------------------------------
  10603.   def visible_line_number
  10604.     return $data_system.opt_display_tp ? 4 : 3
  10605.   end
  10606.   #--------------------------------------------------------------------------
  10607.   # ● [オーバーライド]:桁数の取得
  10608.   #--------------------------------------------------------------------------
  10609.   def col_max
  10610.     return [item_max, 1].max
  10611.   end
  10612.   #--------------------------------------------------------------------------
  10613.   # ● [オーバーライド]:横に項目が並ぶときの空白の幅を取得
  10614.   #--------------------------------------------------------------------------
  10615.   def spacing
  10616.     return 0
  10617.   end
  10618.   #--------------------------------------------------------------------------
  10619.   # ● [オーバーライド]:項目の高さを取得
  10620.   #--------------------------------------------------------------------------
  10621.   def item_height
  10622.     self.height
  10623.   end  
  10624.   #--------------------------------------------------------------------------
  10625.   # ● [再定義]:ウィンドウ幅の取得
  10626.   #--------------------------------------------------------------------------
  10627.   def window_width
  10628.     Graphics.width
  10629.   end
  10630.   #--------------------------------------------------------------------------
  10631.   # ● [エイリアス]:ウィンドウ高さの取得
  10632.   #--------------------------------------------------------------------------
  10633.   alias :lnx11a_window_height :window_height
  10634.   def window_height
  10635.     # 一行目(名前・ステート)の高さを確保する
  10636.     lnx11a_window_height - line_height + [24, line_height].max
  10637.   end
  10638.   #--------------------------------------------------------------------------
  10639.   # ● [オーバーライド]:カーソルの更新
  10640.   #--------------------------------------------------------------------------
  10641.   def update_cursor
  10642.     # カーソルを表示しない
  10643.     cursor_rect.empty
  10644.   end
  10645.   #--------------------------------------------------------------------------
  10646.   # ● [オーバーライド]:システム色の取得
  10647.   #  ゲージ幅が短すぎる場合、HP,MP,TP の文字を非表示にします。
  10648.   #--------------------------------------------------------------------------
  10649.   def system_color
  10650.     gauge_area_width - @min_offset >= 52 ? super : Color.new
  10651.   end  
  10652.   #--------------------------------------------------------------------------
  10653.   # ● [オーバーライド]:ゲージ背景色の取得
  10654.   #   ゲージの透明度を適用します。  
  10655.   #--------------------------------------------------------------------------
  10656.   def gauge_back_color
  10657.     color = super
  10658.     color.alpha *= LNX11::STATUS_GAUGE_OPACITY / 255.0
  10659.     color
  10660.   end
  10661.   #--------------------------------------------------------------------------
  10662.   # ● [オーバーライド]:ゲージの描画
  10663.   #   ゲージの透明度を適用します。
  10664.   #--------------------------------------------------------------------------
  10665.   def draw_gauge(x, y, width, rate, color1, color2)
  10666.     oparate = LNX11::STATUS_GAUGE_OPACITY / 255.0
  10667.     color1.alpha *= oparate
  10668.     color2.alpha *= oparate
  10669.     super
  10670.   end
  10671.   #--------------------------------------------------------------------------
  10672.   # ● [オーバーライド]:フレーム更新
  10673.   #--------------------------------------------------------------------------
  10674.   def update
  10675.     super
  10676.     update_invisible
  10677.   end
  10678.   #--------------------------------------------------------------------------
  10679.   # ● [追加]:表示状態更新
  10680.   #--------------------------------------------------------------------------
  10681.   def update_invisible
  10682.     self.contents_opacity = $game_party.status_invisible ? 0 : 255
  10683.   end  
  10684.   #--------------------------------------------------------------------------
  10685.   # ● [追加]:アクターオブジェクト取得
  10686.   #--------------------------------------------------------------------------
  10687.   def actor
  10688.     $game_party.members[@index]
  10689.   end
  10690.   #--------------------------------------------------------------------------
  10691.   # ● [追加]:座標の設定
  10692.   #--------------------------------------------------------------------------
  10693.   def set_xy
  10694.     # ステータス位置の調整:画面からはみ出ないようにする
  10695.     pw = $game_party.members_screen_x.last + LNX11::STATUS_OFFSET[:x]
  10696.     pw += gauge_area_width / 2
  10697.     right_end = Graphics.width - LNX11::STATUS_SIDE_PADDING
  10698.     min_offset = pw > right_end ? pw - right_end : 0
  10699.     # ステータスのオフセットを適用
  10700.     self.x = LNX11::STATUS_OFFSET[:x] - min_offset
  10701.     self.y = LNX11::STATUS_OFFSET[:y] + Graphics.height - self.height
  10702.     # ステータス幅の自動調整:位置を調整した分だけ幅を縮める
  10703.     @min_offset = LNX11::STATUS_AUTOADJUST ? min_offset : 0
  10704.   end
  10705.   #--------------------------------------------------------------------------
  10706.   # ● [再定義]:ゲージエリアの幅を取得
  10707.   #--------------------------------------------------------------------------
  10708.   def gauge_area_width
  10709.     return LNX11::STATUS_WIDTH
  10710.   end
  10711.   #--------------------------------------------------------------------------
  10712.   # ● [追加]:表示するステート数の取得
  10713.   #--------------------------------------------------------------------------
  10714.   def states(actor, width)
  10715.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  10716.     icons.size
  10717.   end
  10718.   #--------------------------------------------------------------------------
  10719.   # ● [追加]:名前とステートの描画(1行表示)
  10720.   #  width の範囲で名前を左揃え、ステートアイコンを右揃えで描画します。
  10721.   # ステートを優先して表示するため、アイコンが多すぎて名前の表示領域が
  10722.   # 極端に狭くなる場合は名前を描画しません。
  10723.   #--------------------------------------------------------------------------
  10724.   def draw_actor_name_with_icons(actor, x, y, width = 128, draw_name = true)
  10725.     # アイコンのY座標補正
  10726.     iy = ([line_height, 24].max - 24) / 2
  10727.     # 名前のY座標補正
  10728.     ny = ([line_height, 24].max - LNX11::STATUS_NAME_SIZE) / 2
  10729.     # 表示するステート数を取得
  10730.     icon = states(actor, width)
  10731.     if icon > 0
  10732.       # 表示するべきステートがある場合
  10733.       name_width = width - icon * 24
  10734.       ix = x + width - icon * 24
  10735.       if name_width >= contents.font.size * 2 && draw_name
  10736.         # 名前の表示領域(width) が フォントサイズ * 2 以上なら両方を描画
  10737.         draw_actor_name(actor, x, y + ny,  name_width)
  10738.         iw = width - name_width
  10739.         draw_actor_icons(actor, ix, y + iy, iw)
  10740.       else
  10741.         # ステートのみ描画
  10742.         draw_actor_icons(actor, ix, y + iy, width)
  10743.       end
  10744.     elsif draw_name
  10745.       # ない場合、名前のみ描画
  10746.       draw_actor_name(actor, x, y + ny, width)
  10747.     end
  10748.   end
  10749.   #--------------------------------------------------------------------------
  10750.   # ● [再定義]:リフレッシュ
  10751.   #--------------------------------------------------------------------------
  10752.   def refresh
  10753.     set_xy
  10754.     draw_all_items
  10755.   end
  10756.   #--------------------------------------------------------------------------
  10757.   # ● [オーバーライド]:項目を描画する矩形の取得
  10758.   #--------------------------------------------------------------------------
  10759.   def item_rect(index)
  10760.     rect = super
  10761.     rect.x = $game_party.members_screen_x[index] - gauge_area_width / 2
  10762.     rect.width = gauge_area_width
  10763.     rect
  10764.   end
  10765.   #--------------------------------------------------------------------------
  10766.   # ● [再定義]:基本エリアの矩形を取得
  10767.   #--------------------------------------------------------------------------
  10768.   def basic_area_rect(index)
  10769.     rect = item_rect(index)
  10770.     rect
  10771.   end
  10772.   #--------------------------------------------------------------------------
  10773.   # ● [再定義]:ゲージエリアの矩形を取得
  10774.   #--------------------------------------------------------------------------
  10775.   def gauge_area_rect(index)
  10776.     rect = basic_area_rect(index)
  10777.     rect.y += [24, line_height].max
  10778.     rect.x += @min_offset
  10779.     rect
  10780.   end
  10781.   #--------------------------------------------------------------------------
  10782.   # ● [再定義]:基本エリアの描画
  10783.   #--------------------------------------------------------------------------
  10784.   def draw_basic_area(rect, actor)
  10785.     # フォントサイズ変更
  10786.     contents.font.size = [LNX11::STATUS_NAME_SIZE, 8].max
  10787.     # 名前とステートを描画
  10788.     dn = LNX11::STATUS_NAME_SIZE > 0 # 名前を描画するか?
  10789.     width = gauge_area_width - @min_offset
  10790.     rest  = width % 24
  10791.     width += 24 - rest if rest > 0
  10792.     draw_actor_name_with_icons(actor, rect.x, rect.y, width, dn)
  10793.     # フォントサイズを元に戻す
  10794.     reset_font_settings
  10795.   end
  10796.   #--------------------------------------------------------------------------
  10797.   # ● [エイリアス]:ゲージエリアの描画
  10798.   #--------------------------------------------------------------------------
  10799.   alias :lnx11a_draw_gauge_area :draw_gauge_area
  10800.   def draw_gauge_area(*args)
  10801.     # フォントサイズ変更
  10802.     contents.font.size = LNX11::STATUS_PARAM_SIZE
  10803.     # 元のメソッドを呼ぶ
  10804.     lnx11a_draw_gauge_area(*args)
  10805.     # フォントサイズを元に戻す
  10806.     reset_font_settings
  10807.   end
  10808.   #--------------------------------------------------------------------------
  10809.   # ● [再定義]:ゲージエリアの描画(TP あり)
  10810.   #--------------------------------------------------------------------------
  10811.   def draw_gauge_area_with_tp(rect, actor)
  10812.     width = gauge_area_width - @min_offset
  10813.     draw_actor_hp(actor, rect.x, rect.y,                   width)
  10814.     draw_actor_mp(actor, rect.x, rect.y + line_height,     width)
  10815.     draw_actor_tp(actor, rect.x, rect.y + line_height * 2, width)
  10816.   end
  10817.   #--------------------------------------------------------------------------
  10818.   # ● [再定義]:ゲージエリアの描画(TP なし)
  10819.   #--------------------------------------------------------------------------
  10820.   def draw_gauge_area_without_tp(rect, actor)
  10821.     draw_actor_hp(actor, rect.x, rect.y,               gauge_area_width)
  10822.     draw_actor_mp(actor, rect.x, rect.y + line_height, gauge_area_width)
  10823.   end
  10824.   #--------------------------------------------------------------------------
  10825.   # ● [再定義]:項目の描画
  10826.   #--------------------------------------------------------------------------
  10827.   def draw_item(index)
  10828.     actor = $game_party.battle_members[index]
  10829.     a_status = status(actor)
  10830.     # ステータスが変化した場合のみ描画する
  10831.     return if @actor_last_status[index] == a_status
  10832.     @actor_last_status[index] = a_status
  10833.     contents.clear_rect(item_rect(index))
  10834.     draw_basic_area(basic_area_rect(index), actor)
  10835.     draw_gauge_area(gauge_area_rect(index), actor)
  10836.   end
  10837.   #--------------------------------------------------------------------------
  10838.   # ● [追加]:アクターのステータス配列を返す
  10839.   #--------------------------------------------------------------------------
  10840.   def status(actor)
  10841.     if $data_system.opt_display_tp
  10842.       return [actor.name, actor.state_icons + actor.buff_icons,
  10843.               actor.mhp, actor.hp, actor.mmp, actor.mp, actor.max_tp, actor.tp]
  10844.     else
  10845.       # TP を除くステータス配列
  10846.       return [actor.name, actor.state_icons + actor.buff_icons,
  10847.               actor.mhp, actor.hp, actor.mmp, actor.mp]
  10848.     end
  10849.   end
  10850.   #--------------------------------------------------------------------------
  10851.   # ● [追加]:内容の消去
  10852.   #--------------------------------------------------------------------------
  10853.   def all_clear
  10854.     contents.clear
  10855.     @actor_last_status = Array.new($game_party.max_battle_members) { nil }   
  10856.   end
  10857. end

  10858. #==============================================================================
  10859. # ■ Window_BattleActor
  10860. #------------------------------------------------------------------------------
  10861. #  バトル画面で、行動対象のアクターを選択するウィンドウです。
  10862. # XPスタイルバトルではバトルステータスを非表示にしないため、
  10863. # 選択機能だけを持つ不可視のウィンドウとして扱います。
  10864. #==============================================================================

  10865. class Window_BattleActor < Window_BattleStatus
  10866.   include LNX11_Window_TargetHelp
  10867.   #--------------------------------------------------------------------------
  10868.   # ● [エイリアス]:オブジェクト初期化
  10869.   #--------------------------------------------------------------------------
  10870.   alias :lnx11a_wba_initialize :initialize
  10871.   def initialize(info_viewport)
  10872.     # 元のメソッドを呼ぶ
  10873.     lnx11a_wba_initialize(info_viewport)
  10874.     # ウィンドウを画面外に移動
  10875.     self.y = Graphics.height
  10876.   end
  10877.   #--------------------------------------------------------------------------
  10878.   # ● [オーバーライド]:ヘルプテキスト更新
  10879.   #--------------------------------------------------------------------------
  10880.   def update_help
  10881.     @help_window.set_item(targetcursor)
  10882.   end
  10883.   #--------------------------------------------------------------------------
  10884.   # ● [追加]:ターゲットカーソルに渡すオブジェクト
  10885.   #--------------------------------------------------------------------------
  10886.   def targetcursor
  10887.     @cursor_all ? :party : actor
  10888.   end
  10889.   #--------------------------------------------------------------------------
  10890.   # ● [オーバーライド]:ウィンドウ幅の取得
  10891.   #--------------------------------------------------------------------------
  10892.   def window_width
  10893.     64
  10894.   end
  10895.   #--------------------------------------------------------------------------
  10896.   # ● [オーバーライド]:全項目の描画
  10897.   #--------------------------------------------------------------------------
  10898.   def draw_all_items
  10899.     # 何もしない   
  10900.   end
  10901.   #--------------------------------------------------------------------------
  10902.   # ● [オーバーライド]:項目の描画
  10903.   #--------------------------------------------------------------------------
  10904.   def draw_item(index)
  10905.     # 何もしない
  10906.   end
  10907.   #--------------------------------------------------------------------------
  10908.   # ● [オーバーライド]:リフレッシュ
  10909.   #--------------------------------------------------------------------------
  10910.   def refresh
  10911.     # 何もしない
  10912.   end
  10913.   #--------------------------------------------------------------------------
  10914.   # ● [エイリアス]:ウィンドウの表示
  10915.   #--------------------------------------------------------------------------
  10916.   alias :lnx11a_show :show
  10917.   def show
  10918.     # 元のメソッドを呼ぶ
  10919.     lnx11a_show
  10920.     # 最後に選択したアクターを選択
  10921.     last_target = $game_temp.last_target_cursor[:actor]
  10922.     if last_target && $game_party.members.include?(last_target) &&
  10923.        LNX11::LAST_TARGET
  10924.       select($game_party.members.index(last_target))
  10925.     end
  10926.     # スマートターゲットセレクト
  10927.     if LNX11::SMART_TARGET_SELECT && !@cursor_fix
  10928.       if @dead_friend && (!last_target || last_target && last_target.alive?)
  10929.         dead_actor = $game_party.dead_members[0]
  10930.         select($game_party.members.index(dead_actor)) if dead_actor
  10931.       elsif !@dead_friend && (!last_target || last_target && last_target.dead?)
  10932.         alive_actor = $game_party.alive_members[0]
  10933.         select($game_party.members.index(alive_actor)) if alive_actor
  10934.       end
  10935.     end
  10936.     self
  10937.   end
  10938.   #--------------------------------------------------------------------------
  10939.   # ● [エイリアス]:ウィンドウの非表示
  10940.   #--------------------------------------------------------------------------
  10941.   alias :lnx11a_hide :hide
  10942.   def hide
  10943.     # 元のメソッドを呼ぶ
  10944.     lnx11a_hide
  10945.     # 選択したアクターを記憶
  10946.     $game_temp.last_target_cursor[:actor] = actor
  10947.     self
  10948.   end
  10949. end

  10950. #==============================================================================
  10951. # ■ Window_BattleEnemy
  10952. #------------------------------------------------------------------------------
  10953. #  バトル画面で、行動対象の敵キャラを選択するウィンドウです。
  10954. # 横並びの不可視のウィンドウとして扱います。
  10955. #==============================================================================

  10956. class Window_BattleEnemy < Window_Selectable
  10957.   include LNX11_Window_TargetHelp
  10958.   #--------------------------------------------------------------------------
  10959.   # ● [エイリアス]:オブジェクト初期化
  10960.   #--------------------------------------------------------------------------
  10961.   alias :lnx11a_initialize :initialize
  10962.   def initialize(info_viewport)
  10963.     # 敵キャラオブジェクトの設定
  10964.     set_enemy
  10965.     # 元のメソッドを呼ぶ
  10966.     lnx11a_initialize(info_viewport)
  10967.     # ウィンドウを画面外に移動
  10968.     self.y = Graphics.height
  10969.   end
  10970.   #--------------------------------------------------------------------------
  10971.   # ● [追加]:敵キャラオブジェクトの設定
  10972.   #--------------------------------------------------------------------------
  10973.   def set_enemy
  10974.     if LNX11::TROOP_X_SORT
  10975.       @troop = $game_troop.alive_members.sort {|a,b| a.screen_x <=> b.screen_x}
  10976.     else
  10977.       @troop = $game_troop.alive_members
  10978.     end
  10979.   end
  10980.   #--------------------------------------------------------------------------
  10981.   # ● [再定義]:敵キャラオブジェクト取得
  10982.   #--------------------------------------------------------------------------
  10983.   def enemy
  10984.     @troop[@index]
  10985.   end
  10986.   #--------------------------------------------------------------------------
  10987.   # ● [オーバーライド]:ウィンドウ幅の取得
  10988.   #--------------------------------------------------------------------------
  10989.   def window_width
  10990.     64
  10991.   end
  10992.   #--------------------------------------------------------------------------
  10993.   # ● [オーバーライド]:指定行数に適合するウィンドウの高さを計算
  10994.   #--------------------------------------------------------------------------
  10995.   def fitting_height(line_number)
  10996.     super(1)
  10997.   end
  10998.   #--------------------------------------------------------------------------
  10999.   # ● [オーバーライド]:桁数の取得
  11000.   #--------------------------------------------------------------------------
  11001.   def col_max
  11002.     return item_max
  11003.   end
  11004.   #--------------------------------------------------------------------------
  11005.   # ● [オーバーライド]:ヘルプテキスト更新
  11006.   #--------------------------------------------------------------------------
  11007.   def update_help
  11008.     @help_window.random_number = @random_number
  11009.     @help_window.set_item(targetcursor)
  11010.   end
  11011.   #--------------------------------------------------------------------------
  11012.   # ● [追加]:ターゲットカーソルに渡すオブジェクト
  11013.   #--------------------------------------------------------------------------
  11014.   def targetcursor
  11015.     @cursor_all ? (@cursor_random ? :troop_random : :troop) : enemy
  11016.   end
  11017.   #--------------------------------------------------------------------------
  11018.   # ● [エイリアス]:ウィンドウの表示
  11019.   #--------------------------------------------------------------------------
  11020.   alias :lnx11a_show :show
  11021.   def show
  11022.     # 元のメソッドを呼ぶ
  11023.     lnx11a_show
  11024.     # 敵キャラオブジェクトの設定
  11025.     set_enemy
  11026.     return self unless LNX11::LAST_TARGET
  11027.     # 最後に選択した敵キャラを選択
  11028.     last_target = $game_temp.last_target_cursor[:enemy]
  11029.     if last_target && @troop.include?(last_target)
  11030.       select(@troop.index(last_target))
  11031.     end
  11032.     self
  11033.   end
  11034.   #--------------------------------------------------------------------------
  11035.   # ● [エイリアス]:ウィンドウの非表示
  11036.   #--------------------------------------------------------------------------
  11037.   alias :lnx11a_hide :hide
  11038.   def hide
  11039.     # 元のメソッドを呼ぶ
  11040.     lnx11a_hide
  11041.     # 選択した敵キャラを記憶
  11042.     $game_temp.last_target_cursor[:enemy] = enemy
  11043.     self
  11044.   end
  11045. end

  11046. #==============================================================================
  11047. # ■ Window_BattleSkill
  11048. #------------------------------------------------------------------------------
  11049. #  いくつかのモジュールをインクルードします。
  11050. #==============================================================================

  11051. class Window_BattleSkill < Window_SkillList
  11052.   include LNX11_Window_ActiveVisible
  11053.   include LNX11_Window_FittingList if LNX11::FITTING_LIST
  11054. end

  11055. #==============================================================================
  11056. # ■ Window_BattleItem
  11057. #------------------------------------------------------------------------------
  11058. #  いくつかのモジュールをインクルードします。
  11059. #==============================================================================

  11060. class Window_BattleItem < Window_ItemList
  11061.   include LNX11_Window_ActiveVisible
  11062.   include LNX11_Window_FittingList if LNX11::FITTING_LIST
  11063. end
  11064. # l:5608
复制代码




XPstyle_battle_config

  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. module LNX11
  13.   #--------------------------------------------------------------------------
  14.   # ■ Index
  15.   #
  16.   # line 026 : 基本設定              line 244 : パーティコマンド
  17.   # line 048 : アクターエリアの背景  line 259 : ターゲットカーソル
  18.   # line 065 : バトルログ            line 289 : ターゲットヘルプ
  19.   # line 118 : バトルメッセージ      line 305 : ポップアップ
  20.   # line 159 : バトラーグラフィック  line 507 : ユーザビリティ
  21.   # line 182 : バトルステータス      line 535 : その他
  22.   # line 212 : アクターコマンド      
  23.   #
  24.   #--------------------------------------------------------------------------
  25.   # ● 基本設定
  26.   #--------------------------------------------------------------------------
  27.   # デフォルトで表示するアクターのバトラーグラフィック
  28.   #  0 = 顔グラフィック / 1 = 歩行グラフィック
  29.   DEFAULT_BATTLER_GRAPHIC = 0  # 規定値:0
  30.   
  31.   # デフォルトバトラーグラフィックの背景グラデーション色([Color1, Color2])
  32.   DEFAULT_BG_COLOR        = [Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  33.                    # 規定値:[Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0)]
  34.   
  35.   # 画面の色調変更をアクターに適用する true = 有効 / false = 無効
  36.   # * true にするとアクターエリアの背景にも適用されます
  37.   ACTOR_SCREEN_TONE       = false  # 規定値:false
  38.   
  39.   # TP のポップアップ設定
  40.   #  0 = すべてポップアップする / 1 = アクターのみ / 2 = ポップアップしない
  41.   TP_POPUP_TYPE           = 1      # 規定値:1
  42.   
  43.   # アイコン無しのステートをポップアップしない true = 有効 / false = 無効
  44.   INDEXZERO_NO_POPUP      = true   # 規定値:true

  45.   #--------------------------------------------------------------------------
  46.   # ● 設定:アクターエリアの背景
  47.   #--------------------------------------------------------------------------
  48.   # アクターエリアの背景のタイプ
  49.   #  0 = 無し / 1 = グラデーション / 2 = ウィンドウ / "文字列" = 画像
  50.   ACTOR_BACKGROUND        = 1   # 規定値:2
  51.   
  52.   # アクターエリア背景の高さ
  53.   ACTOR_BACKGROUND_HEIGHT = 112 # 規定値:112
  54.   
  55.     #------------------------------------------------------------------------
  56.     # ○ タイプ [1:グラデーション] の設定
  57.     #------------------------------------------------------------------------
  58.     # グラデーションの色([Color1, Color2])
  59.     ACTOR_BG_GRADIENT_COLOR = [Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  60.                      # 規定値:[Color.new(0, 0, 0, 96), Color.new(0, 0, 0, 224)]
  61.   
  62.   #--------------------------------------------------------------------------
  63.   # ● 設定:バトルログ
  64.   #--------------------------------------------------------------------------
  65.   # バトルログ(戦闘進行の実況)のタイプ
  66.   # 0 = VXAceデフォルト / 1 = 蓄積型 / 2 = ヘルプ表示
  67.   BATTLELOG_TYPE  =  1  # 規定値:1
  68.   
  69.     #------------------------------------------------------------------------
  70.     # ○ バトルログタイプ [1:蓄積型] の設定
  71.     #------------------------------------------------------------------------
  72.     # 一度に表示する行数
  73.     STORAGE_LINE_NUMBER     = 6     # 規定値:6
  74.    
  75.     # 一行の高さ
  76.     STORAGE_LINE_HEIGHT     = 20    # 規定値:20
  77.    
  78.     # 自動的にログが進行する時間(フレーム)
  79.     STORAGE_UP_MESSAGE_TIME = 90    # 規定値:90
  80.    
  81.     # ターン終了時にバトルログを消去する true = 有効 / false = 無効
  82.     STORAGE_TURNEND_CLEAR   = true  # 規定値:true
  83.    
  84.     # 座標の調整 :x = X座標 / :y = Y座標
  85.     STORAGE_OFFSET = {:x => 0, :y => 6}  # 規定値:{:x => 0, :y => 6}
  86.    
  87.     # フォント :size = フォントサイズ / :out_color = テキストの縁取り色
  88.     STORAGE_FONT   = {:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  89.             # 規定値:{:size => 20, :out_color => Color.new(0, 0, 0, 192)}
  90.    
  91.     # 背景のグラデーションの色([Color1, Color2])
  92.     STORAGE_GRADIENT_COLOR = [Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  93.                     # 規定値:[Color.new(0, 0, 0, 128), Color.new(0, 0, 0, 0)]
  94.    
  95.     #------------------------------------------------------------------------
  96.     # ○ バトルログタイプ [2:ヘルプ表示] の設定
  97.     #------------------------------------------------------------------------
  98.     # ポップアップのウェイト
  99.     POPUP_ADD_WAIT          = 6     # 規定値:6

  100.     # 行動の表示形式 0 = アイコン+名前 / 1 = 名前のみ
  101.     HELPDISPLAY_TYPE        = 1     # 規定値:1
  102.    
  103.     # 行動の表示始めの追加ウェイト
  104.     HELPDISPLAT_WAIT        = 20    # 規定値:20
  105.    
  106.     # 行動の表示終了までの追加ウェイト
  107.     HELPDISPLAT_END_WAIT    = 24    # 規定値:24
  108.    
  109.     # 行動の簡易説明文
  110.     # :size = フォントサイズ :delimiter = 名前と簡易説明文の区切り文字
  111.     HELPDISPLAY_DESCRIPTION = {:size => 20, :delimiter => " "}
  112.                      # 規定値:{:size => 20, :delimiter => " "}
  113.   
  114.   #--------------------------------------------------------------------------
  115.   # ● 設定:バトルメッセージ
  116.   #--------------------------------------------------------------------------
  117.   # バトルメッセージ(戦闘開始・逃走・リザルト等)の表示先
  118.   # 0 = メッセージウィンドウ / 1 = バトルログ / 2 = ヘルプ
  119.   MESSAGE_TYPE  =  2   # 規定値:2

  120.     #------------------------------------------------------------------------
  121.     # ○ バトルメッセージタイプ [0:メッセージウィンドウ] の設定
  122.     #------------------------------------------------------------------------
  123.     # メッセージウィンドウの背景 0 = ウィンドウ / 1 = 背景を暗くする / 2 = 透明
  124.     MESSAGE_WINDOW_BACKGROUND  = 1     # 規定値:1
  125.   
  126.     # メッセージウィンドウの位置 0 = 上 / 1 = 中 / 2 = 下
  127.     MESSAGE_WINDOW_POSITION    = 0     # 規定値:0

  128.     #------------------------------------------------------------------------
  129.     # ○ バトルメッセージタイプ [2:ヘルプ] の設定
  130.     #------------------------------------------------------------------------
  131.     # ヘルプバトルメッセージのウェイト
  132.     #   [ウェイト(フレーム), キー入力を待つ(true = 有効 / false = 無効)]
  133.     #  :battle_start = 戦闘開始      :victory = 勝利
  134.     #  :escape       = 逃走          :defeat  = 敗北
  135.     #  :drop_item    = アイテム獲得 :levelup = レベルアップ
  136.     MESSAGE_WAIT = {:battle_start => [120, false], :victory   => [ 60, false],
  137.                     :defeat       => [120, false], :escape    => [120, false],
  138.                     :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  139.           # 規定値:{:battle_start => [120, false], :victory   => [ 60, false],
  140.           #         :defeat       => [120, false], :escape    => [120, false],
  141.           #         :drop_item    => [ 60,  true], :levelup   => [ 60,  true]}
  142.   
  143.   # 戦闘開始時の敵出現メッセージを表示する
  144.   MESSAGE_WINDOW_ENEMY_NAMES = false # 規定値:false
  145.   
  146.   # レベルアップ SE  RPG::SE.new("ファイル名", 音量, ピッチ)
  147.   LEVELUP_SE  = RPG::SE.new("Up4", 90, 100)   # 規定値:("Up4", 90, 100)
  148.   
  149.   # ドロップアイテム獲得 SE  RPG::SE.new("ファイル名", 音量, ピッチ)
  150.   # * バトルメッセージタイプが 0 以外の場合のみ再生されます。
  151.   DROPITEM_SE = RPG::SE.new("Item3", 80, 125) # 規定値:("Item3", 80, 125)
  152.   
  153.   #--------------------------------------------------------------------------
  154.   # ● 設定:アクターのバトラーグラフィック
  155.   #--------------------------------------------------------------------------
  156.   # アクター表示を中央揃えにする true = 有効 / false = 左揃え
  157.   ACTOR_CENTERING  =  true    # 規定値:true

  158.     #------------------------------------------------------------------------
  159.     # ○ アクター表示中央揃えの設定
  160.     #------------------------------------------------------------------------
  161.     # アクター間のスペースの大きさ補正
  162.     ACTOR_SPACING_ADJUST = 32 # 規定値:32
  163.    
  164.   # 座標の調整 :x = X座標 / :y = Y座標
  165.   # * アクターコマンドのX座標には影響しません。
  166.   ACTOR_OFFSET  = {:x => -16, :y => 0}       # 規定値:{:x => -16, :y => 0}
  167.   
  168.   # アクターエリアと画面端との余白 :side = 左右の余白 / :bottom = 下の余白
  169.   ACTOR_PADDING = {:side => 4, :bottom => 8} # 規定値:{:side => 4, :bottom => 8}
  170.   
  171.   # パーティに対する画面アニメーションのY座標修正
  172.   #  位置が[画面]のアニメーションをパーティの中心に表示されるようにします。
  173.   SCREEN_ANIMATION_OFFSET = 128  # 規定値:128
  174.   
  175.   #--------------------------------------------------------------------------
  176.   # ● 設定:バトルステータス
  177.   #--------------------------------------------------------------------------
  178.   # 座標の調整  :x = X座標 / :y = Y座標
  179.   #  X 座標はアクターの中心を基準とします。
  180.   # * パーティメンバーの数やステータス幅によっては、X 座標が自動的に
  181.   # 調整される場合があります。
  182.   STATUS_OFFSET = {:x => 64, :y => -12} # 規定値:{:x => 64, :y => -12}
  183.   
  184.   # 画面左右端の余白
  185.   STATUS_SIDE_PADDING   = 6     # 規定値:6
  186.   
  187.   # アクター1人あたりのステータス幅
  188.   STATUS_WIDTH          = 72    # 規定値:72

  189.   # ステータス幅の自動調整を行う
  190.   STATUS_AUTOADJUST     = true  # 規定値:true
  191.   
  192.   # 行の高さ
  193.   STATUS_LINE_HEIGHT    = 22    # 規定値:22
  194.   
  195.   # アクターの名前のフォントサイズ 値を 0 にすると非表示になる
  196.   STATUS_NAME_SIZE      = 20    # 規定値:20
  197.   
  198.   # HP/MP/TPのフォントサイズ
  199.   STATUS_PARAM_SIZE     = 23    # 規定値:23
  200.   
  201.   # HP/MP/TPゲージの不透明度 (0-255)
  202.   STATUS_GAUGE_OPACITY  = 192   # 規定値:192

  203.   #--------------------------------------------------------------------------
  204.   # ● 設定:アクターコマンド
  205.   #--------------------------------------------------------------------------
  206.   # コマンドの項目数が 4 を超える場合、項目がすべて見えるように
  207.   # コマンドウィンドウの高さを拡張する true = 有効 / false = 無効
  208.   ACTOR_COMMAND_NOSCROLL   = true  # 規定値:true
  209.   
  210.   # コマンドを横並びにする true = 横並び / false = 縦並び
  211.   ACTOR_COMMAND_HORIZON    = false # 規定値:false

  212.   # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  213.   ACTOR_COMMAND_ALIGNMENT  = 0     # 規定値:0
  214.   
  215.   # ウィンドウの横幅
  216.   #  コマンドを横並びにする場合、大きめの値を設定してください。
  217.   ACTOR_COMMAND_WIDTH      = 128   # 規定値:128
  218.   
  219.   # ウィンドウの位置
  220.   #  0 = アクターの頭上 / 1 = Y座標を固定 / 2 = XY座標を固定
  221.   ACTOR_COMMAND_POSITION   = 0     # 規定値:0

  222.     #------------------------------------------------------------------------
  223.     # ○ ウィンドウの位置 [1:Y座標固定 2:XY座標] の設定
  224.     #------------------------------------------------------------------------
  225.     # 固定Y座標の基準位置
  226.     # 0 = 画面下端 - ウィンドウの高さ / 画面上端
  227.     ACTOR_COMMAND_Y_POSITION = 0   # 規定値:0
  228.   
  229.     # ウィンドウのXY座標修正 :x = X座標 / :y = Y座標
  230.     # * コマンド位置が 1 or 2 の場合、ここで設定した値で座標を固定します。
  231.     ACTOR_COMMAND_OFFSET  = {:x => 0, :y => -16} # 規定値:{:x => 0, :y => -16}
  232.   
  233.   #--------------------------------------------------------------------------
  234.   # ● 設定:パーティコマンド
  235.   #--------------------------------------------------------------------------
  236.   # コマンドを横並びにする true = 横並び / false = 縦並び
  237.   PARTY_COMMAND_HORIZON   = true  # 規定値:true
  238.   
  239.   # 文字揃え 0 = 左揃え / 1 = 中央揃え / 2 = 右揃え
  240.   PARTY_COMMAND_ALIGNMENT = 1     # 規定値:1
  241.   
  242.   # ウィンドウの幅
  243.   PARTY_COMMAND_WIDTH     = Graphics.width     # 規定値:Graphics.width
  244.   
  245.   # ウィンドウの座標 :x = X座標 / :y = Y座標
  246.   PARTY_COMMAND_XY        = {:x => 0, :y => 0} # 規定値:{:x => 0, :y => 0}
  247.   
  248.   #--------------------------------------------------------------------------
  249.   # ● 設定:ターゲットカーソル
  250.   #--------------------------------------------------------------------------
  251.   # カーソルグラフィックのファイル名 (Graphics/System/*)
  252.   #  "" を設定した場合、Bitmap の機能でカーソルを自動生成します。
  253.   CURSOR_NAME       = ""    # 規定値:""
  254.   
  255.     #------------------------------------------------------------------------
  256.     # ○ 自動生成のカーソルグラフィックの設定
  257.     #------------------------------------------------------------------------
  258.     # カーソルの色調 (Red, Green, Blue)
  259.     #  nil を設定した場合、データベースのウィンドウカラーと同じになります。
  260.     CURSOR_TONE     = Tone.new(-34, 0, 68)  # 規定値:Tone.new(-34, 0, 68)
  261.   
  262.   # アニメーションスピード
  263.   CURSOR_ANI_SPEED  = 3     # 規定値:3
  264.    
  265.   # 移動スピード
  266.   CURSOR_SPEED      = 3     # 規定値:3
  267.   
  268.   # 対象選択時にカーソルを点滅させる
  269.   CURSOR_BLINK      = true  # 規定値:true
  270.   
  271.   # カーソルのY座標の制限 :min = 最小値 / :max = 最大値
  272.   CURSOR_MINMAX     = {:min => 48, :max => Graphics.height}
  273.              # 規定値:{:min => 48, :max => Graphics.height}
  274.   
  275.   # カーソル位置のXY座標修正 :x = X座標 / :y = Y座標
  276.   CURSOR_OFFSET     = {:x => 0, :y => 0} # 規定値:{:x => 0, :y => 0}

  277.   #--------------------------------------------------------------------------
  278.   # ● 設定:ターゲットヘルプ
  279.   #--------------------------------------------------------------------------
  280.   # バトラーの各パラメータ表示 true = 表示 / false = 非表示
  281.   HELP_ACTOR_PARAM = {:hp => true ,:mp => true ,:tp => true ,:state => true }
  282.   HELP_ENEMY_PARAM = {:hp => false,:mp => false,:tp => false,:state => true }
  283.     # アクター規定値:{:hp => true ,:mp => true ,:tp => true ,:state => true }
  284.     # 敵キャラ規定値:{:hp => false,:mp => false,:tp => false,:state => true }
  285.   
  286.   # HP/MP/TP ゲージの幅
  287.   HELP_PARAM_WIDTH    = 72  # 規定値:72
  288.   
  289.   # 敵ランダムの表示形式
  290.   # 0 = 敵全体 ランダム / 1 = 敵n体 ランダム
  291.   RANDOMSCOPE_DISPLAY = 1   # 規定値:1
  292.   
  293.   #--------------------------------------------------------------------------
  294.   # ● 設定:ポップアップ
  295.   #--------------------------------------------------------------------------
  296.   # ポップアップ位置 0 = 足元 / 1 = 中心 / 2 = 頭上 / 3 = 一定(アクターのみ)
  297.   ACTOR_POPUP_POSITION   = 3  # アクター     規定値:3
  298.   ENEMY_POPUP_POSITION   = 1  # 敵キャラ     規定値:1
  299.   LEVELUP_POPUP_POSITION = 3  # レベルアップ 規定値:3
  300.   
  301.     #------------------------------------------------------------------------
  302.     # ○ ポップアップ位置 [3:一定(アクターのみ)] の設定
  303.     #------------------------------------------------------------------------
  304.     # アクターのポップアップの Y 座標
  305.     #  ゲーム画面の高さ(Graphics.height)を基準とします。
  306.     ACTOR_POPUP_Y     =  -100  # 規定値:-100
  307.    
  308.     # レベルアップのポップアップの Y 座標
  309.     #  ゲーム画面の高さ(Graphics.height)を基準とします。
  310.     LEVELUP_POPUP_Y   =  -112  # 規定値:-112
  311.   
  312.   # 数字のフォント
  313.   NUMBER_FONT   =  ["Arial Black", "WQYMHEx"] # ["Arial Black", "VL Gothic"]
  314.   
  315.   # ステート等のテキストのフォント
  316.   TEXT_FONT     =  ["Arial Black", "WQYMHEx"] # ["Arial Black", "VL Gothic"]
  317.   TEXT_FONT_MCS =  ["WQYMHEx"]       #日本語を含む場合。規定値:["VL Gothic"]
  318.   
  319.   # 画像フォントのファイル名 (Graphics/System/*) <<ver1.10>>
  320.   #  "" を設定した場合、通常のフォントを利用します。
  321.   # 数字
  322.   LARGE_NUMBER_NAME = ""       # 規定値:""
  323.   SMALL_NUMBER_NAME = ""       # 規定値:""
  324.   # 能力強化/弱体
  325.   LARGE_BUFFS_NAME  = ""       # 規定値:""
  326.   SMALL_BUFFS_NAME  = ""       # 規定値:""
  327.   
  328.   # 数字のサイズ・字間
  329.   #  :fontsize = フォントサイズ / :spacing = 字間
  330.   #  :width    = 一字あたりの幅 / :height = 一字あたりの高さ
  331.   LARGE_NUMBER  =  {:fontsize => 38, :spacing => -4, :line_height => 26}
  332.   SMALL_NUMBER  =  {:fontsize => 28, :spacing => -4, :line_height => 20}
  333.   # 大サイズ規定値:{:fontsize => 38, :spacing => -4, :line_height => 26}
  334.   # 小サイズ規定値:{:fontsize => 28, :spacing => -4, :line_height => 20}
  335.   
  336.   # テキストのフォントサイズ倍率
  337.   #   :normal     = テキスト単体
  338.   #   :left_right = ダメージ左右   :top_bottom = ダメージ上下
  339.   # * 数字のフォントサイズからの割合で指定します。
  340.   TEXT_SIZERATE     = {:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  341.              # 規定値:{:normal => 0.8, :left_right => 0.7, :top_bottom => 0.6}
  342.   
  343.   # 日本語を含むテキストのフォントサイズ倍率
  344.   # * 通常のテキストフォントサイズからの倍率で指定します。
  345.   TEXT_SIZERATE_MCS = 0.9   # 規定値:0.9
  346.   
  347.   # ポップアップの修飾文字
  348.   # ["テキスト", 修飾文字の位置(2 = 下 / 4 = 左 / 6 = 右 / 8 = 上)]
  349.   # * 文字列中の \mp \tp はデータベースで設定した用語(短)に置き換わります
  350.   DECORATION_NUMBER = {            # 規定値
  351.   :critical    => ["CRITICAL", 8], # ["CRITICAL", 8] / クリティカル
  352.   :weakness    => ["WEAKNESS", 8], # ["WEAKNESS", 8] / 弱点ダメージ
  353.   :resist      => ["RESIST"  , 8], # ["RESIST"  , 8] / 耐性ダメージ
  354.   :mp_damage   => ["\mp"     , 4], # ["\mp"     , 4] / MP ダメージ・回復
  355.   :mp_plus     => ["\mp+"    , 4], # ["\mp+"    , 4] / MP 再生
  356.   :mp_minus    => ["\mp-"    , 4], # ["\mp-"    , 4] / MP 消費
  357.   :tp_plus     => ["\tp+"    , 4], # ["\tp+"    , 4] / TP 増加
  358.   :tp_minus    => ["\tp-"    , 4], # ["\tp-"    , 4] / TP 減少
  359.   }
  360.   # ステートや能力強化/弱体のポップアップの修飾文字
  361.   #  %s にステート・能力名が入る
  362.   DECORATION_TEXT = {              # 規定値
  363.   :add_state   => "+%s",           # "+%s"           / ステート付加
  364.   :rem_state   => "-%s",           # "-%s"           / ステート解除
  365.   :add_buff    => "%s UP",         # "%s UP"         / 能力強化付加
  366.   :add_debuff  => "%s DOWN",       # "%s DOWN"       / 能力弱体付加
  367.   :rem_buff    => "-%s Buff",      # "-%s Buff"      / 能力強化/弱体解除
  368.   }
  369.   # ポップアップの表示用語
  370.   POPUP_VOCAB = {                  # 規定値
  371.   :miss        => "MISS!",         # "MISS!"         / ミス
  372.   :counter     => "Counter",       # "Counter"       / 反撃
  373.   :reflection  => "Reflection",    # "Reflection"    / 反射
  374.   :substitute  => "Substitute",    # "Substitute"    / 身代わり
  375.   :levelup     => "LEVELUP!",      # "LEVELUP!"      / レベルアップ
  376.   }
  377.   # 能力強化/弱体ポップアップのパラメータ表記
  378.   # * 文字列中の \hp \mp はデータベースで設定した用語(短)に置き換わります
  379.   POPUP_VOCAB_PARAMS = [ # 規定値
  380.   "MAX\hp",              # "MAX\hp"  / 最大HP    MAXimum Hit Point
  381.   "MAX\mp",              # "MAX\mp"  / 最大MP    MAXimum Magic Point
  382.   "ATK",                 # "ATK"     / 攻撃力    ATtacK power
  383.   "DEF",                 # "MATK"    / 防御力    DEFense power
  384.   "MATK",                # "MDEF"    / 魔法力    Magic ATtacK power
  385.   "MDEF",                # "MDEF"    / 魔法防御  Magic DEFense power
  386.   "AGI",                 # "AGI"     / 敏捷性    AGIlity
  387.   "LUCK",                # "LUCK"    / 運        LUCK
  388.   ]
  389.   # ポップアップの色([Color1, Color2])
  390.   # * ハッシュの順序を変更しないこと
  391.   POPUP_COLOR = {
  392.   # HP ダメージ(ミス)
  393.   :hp_damage     => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  394.   # クリティカルダメージ
  395.   :critical      => [Color.new(255, 255,  80), Color.new(224,  32,   0)],
  396.   # 弱点ダメージ
  397.   :weakness      => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  398.   # 耐性ダメージ
  399.   :resist        => [Color.new(232, 224, 216), Color.new( 56,  48,  40)],
  400.   # HP 回復(再生,吸収)
  401.   :hp_recovery   => [Color.new( 96, 255, 128), Color.new(  0,  64,  32)],
  402.   # MP ダメージ
  403.   :mp_damage     => [Color.new(248,  80, 172), Color.new( 48,   0,  32)],
  404.   # MP 回復(再生,吸収)
  405.   :mp_recovery   => [Color.new(160, 240, 255), Color.new( 32,  48, 144)],
  406.   # TP 増減
  407.   :tp_damage     => [Color.new(248, 240,  64), Color.new(  0,  80,  40)],
  408.   # 有利なステートの付加
  409.   :add_state     => [Color.new(255, 255, 255), Color.new(  0,  56, 144)],
  410.   # 有利なステートの解除
  411.   :rem_state     => [Color.new(224, 232, 240), Color.new( 32,  64, 128, 128)],
  412.   # ステートの付加
  413.   :add_badstate  => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  414.   # ステートの解除
  415.   :rem_badstate  => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  416.   # 能力強化の付加
  417.   :add_buff      => [Color.new(255, 255, 192), Color.new( 96,  64,   0)],
  418.   # 能力弱体の付加
  419.   :add_debuff    => [Color.new(200, 224, 232), Color.new( 40,  48,  56)],
  420.   # 能力強化/弱体の解除
  421.   :rem_buff      => [Color.new(224, 224, 224), Color.new( 32,  32,  32, 128)],
  422.   # 反撃
  423.   :counter       => [Color.new(255, 255, 224), Color.new(128,  96,   0)],
  424.   # 反射
  425.   :reflection    => [Color.new(224, 255, 255), Color.new(  0,  96, 128)],
  426.   # 身代わり
  427.   :substitute    => [Color.new(224, 255, 224), Color.new(  0, 128,  64)],
  428.   # レベルアップ
  429.   :levelup       => [Color.new(255, 255, 255), Color.new(  0,   0,   0)],
  430.   }
  431.   # ポップアップのタイプ        -1 = ポップアップしない
  432.   #  0 = 跳ねるポップアップ(大)  4 = スライド(大)
  433.   #  1 = 跳ねるポップアップ(小)  5 = スライド(小)
  434.   #  2 = ゆっくり上昇(大)        6 = オーバーレイ(大)
  435.   #  3 = ゆっくり上昇(小)        7 = オーバーレイ(小)
  436.   POPUP_TYPE = {          # 規定値
  437.   :miss          =>   0,  #   0 / ミス
  438.   :hp_damage     =>   0,  #   0 / HP ダメージ
  439.   :hp_slipdamage =>   1,  #   1 / HP スリップダメージ
  440.   :hp_recovery   =>   0,  #   0 / HP 回復
  441.   :hp_regenerate =>   1,  #   1 / HP 再生
  442.   :hp_drain      =>   0,  #   0 / HP 被吸収
  443.   :hp_drainrecv  =>   0,  #   0 / HP 吸収回復
  444.   :mp_damage     =>   0,  #   0 / MP ダメージ
  445.   :mp_slipdamage =>   1,  #   1 / MP スリップダメージ
  446.   :mp_recovery   =>   0,  #   0 / MP 回復
  447.   :mp_regenerate =>   1,  #   1 / MP 再生
  448.   :mp_drain      =>   0,  #   0 / MP 被吸収
  449.   :mp_drainrecv  =>   0,  #   0 / MP 吸収回復
  450.   :mp_paycost    =>  -1,  #  -1 / MP 消費
  451.   :tp_damage     =>   1,  #   1 / TP 増加(ダメージ)
  452.   :tp_charge     =>  -1,  #  -1 / TP チャージ(被ダメージ時の TP 増加)
  453.   :tp_gain       =>   7,  #   7 / TP 得
  454.   :tp_regenerate =>   1,  #   1 / TP 再生(スリップダメージ)
  455.   :tp_paycost    =>  -1,  #  -1 / TP 消費
  456.   # ステート/能力
  457.   :add_state     =>   2,  #   2 / 有利なステートの付加
  458.   :rem_state     =>   2,  #   2 / 有利なステートの解除
  459.   :add_badstate  =>   2,  #   2 / 不利なステートの付加
  460.   :rem_badstate  =>   2,  #   2 / 不利なステートの解除
  461.   :add_buff      =>   3,  #   3 / 能力強化の付加
  462.   :add_debuff    =>   3,  #   3 / 能力弱体の付加
  463.   :rem_buff      =>   3,  #   3 / 能力強化/弱体の解除
  464.   # 特殊
  465.   :counter       =>   6,  #   6 / 反撃
  466.   :reflection    =>   6,  #   6 / 反射
  467.   :substitute    =>   4,  #   4 / 身代わり
  468.   }
  469.   # 0:跳ねるポップアップの動き(大)
  470.   LARGE_MOVEMENT = {
  471.   :inirate    => 6.4,  :gravity      => 0.68,  :side_scatter => 1.2,
  472.   :ref_height =>  32,  :ref_factor   => 0.60,  :ref_count    =>   2,
  473.                        :duration     =>   40,  :fadeout      =>  20 }
  474.   # 1:跳ねるポップアップの動き(小)
  475.   SMALL_MOVEMENT = {
  476.   :inirate    => 4.4,  :gravity      => 0.60,  :side_scatter => 0.0,
  477.   :ref_height =>  12,  :ref_factor   => 0.70,  :ref_count    =>   0,
  478.                        :duration     =>   60,  :fadeout      =>  16 }
  479.   # 2,3:上昇ポップアップの動き
  480.   RISE_MOVEMENT     = {:rising_speed => 0.75,  :line_spacing => 0.9,
  481.                        :duration     =>   40,  :fadeout      =>   8 }
  482.   # 4,5:スライドポップアップの動き
  483.   SLIDE_MOVEMENT    = {:x_speed      =>    2,  :line_spacing => 0.9,
  484.                        :duration     =>   50,  :fadeout      =>  32 }
  485.   # 6,7:オーバーレイポップアップの動き
  486.   OVERLAY_MOVEMENT  = {:duration     =>   36,  :fadeout      =>  32 }

  487.   # :inirate      = 初速度                :gravity    = 重力加速度
  488.   # :side_scatter = 左右移動のばらつき    :ref_height = 跳ね返り位置
  489.   # :ref_factor   = 反発係数              :ref_count  = 跳ね返り回数
  490.   # :duration     = 消え始めるまでの時間  :fadeout    = 消える速度
  491.   # :rising_speed = 上昇速度              :x_speed    = 横移動速度
  492.   # :line_spacing = ポップアップの行間
  493.   
  494.   #--------------------------------------------------------------------------
  495.   # ● 設定:ユーザビリティ
  496.   #--------------------------------------------------------------------------  
  497.   # 効果範囲が 使用者/全体/ランダム のスキル・アイテムの対象確認を行う
  498.   #  true = 有効 / false = 無効
  499.   FIX_TARGET_CHECKE     = true   # 規定値:true
  500.    
  501.   # 防御コマンドの対象確認を行う     true = 有効 / false = 無効
  502.   GUARD_TARGET_CHECKE   = true   # 規定値:true
  503.   
  504.   # アクターの対象選択を最適化する   true = 有効 / false = 無効
  505.   SMART_TARGET_SELECT   = true   # 規定値:true
  506.   
  507.   # 対象選択のカーソル位置を記憶する true = 有効 / false = 無効
  508.   LAST_TARGET           = true   # 規定値:true

  509.   # パーティコマンドのカーソル位置を記憶する    true = 有効 / false = 無効
  510.   LAST_PARTY_COMMAND    = true   # 規定値:true
  511.   
  512.   # アクターコマンドのカーソル位置を記憶する    true = 有効 / false = 無効
  513.   LAST_ACTOR_COMMAND    = true   # 規定値:true
  514.   
  515.   # 敵キャラのインデックスを X 座標でソートする true = 有効 / false = 無効
  516.   TROOP_X_SORT          = true   # 規定値:true
  517.   
  518.   # パーティコマンド入力回数を最適化する        true = 有効 / false = 無効
  519.   PARTY_COMMAND_SKIP    = true   # 規定値:true
  520.   
  521.   #--------------------------------------------------------------------------
  522.   # ● 設定:その他
  523.   #--------------------------------------------------------------------------
  524.   # スキルリストとアイテムリストを項目数に合わせてリサイズする
  525.   #  true = 有効 / false = 無効
  526.   FITTING_LIST          = true   # 規定値:true
  527.    
  528.   # バトラーの行動時の白フラッシュを強める          true = 有効 / false = 無効
  529.   ENHANCED_WHITEN       = true   # 規定値:true
  530.   
  531.   # ダメージを受けた時の画面のシェイクを行わない    true = 有効 / false = 無効
  532.   DISABLED_DAMAGE_SHAKE = true   # 規定値:true
  533.   
  534.   # 敵キャラの X 座標を画面サイズに合わせて修正する true = 有効 / false = 無効
  535.   TROOP_X_SCREEN_FIX    = true   # 規定値:true
  536.   
  537.   # 敵キャラの Y 座標の調整
  538.   TROOP_Y_OFFSET        = 0      # 規定値:0
  539.   
  540.   #
  541.   # 設定ここまで お疲れ様でした。
  542.   #
  543. end
  544. #==============================================================================
  545. # ■ LNXスクリプト導入情報
  546. #==============================================================================
  547. $lnx_include = {} if $lnx_include == nil
  548. $lnx_include[:lnx11aconf] = 110 # version
  549. p "OK:LNX11aconf_XPスタイルバトル#コンフィグ"
复制代码




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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部