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

Project1

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

[已经过期] 求助,能帮忙把战斗特效和连击两脚本分开来吗

[复制链接]

Lv4.逐梦者

梦石
0
星屑
12157
在线时间
4435 小时
注册时间
2014-4-11
帖子
5955

开拓者

跳转到指定楼层
1
发表于 2014-10-25 13:28:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
以下6个脚本被连在了一起,可是连击部分脚本和其他脚本有冲突,只想要战斗特效脚本,可是这个战斗特效脚本不把连击加进去会出错。

连击显示部分
RUBY 代码复制
  1. #==============================================================================
  2. #RTAB观光游第六站,连击效果+连击数显示 (显示部分)
  3. #==============================================================================
  4. # ▼▲▼ XRXS_BP19. コンボ表示+ヒットボーナス ver.3β ▼▲▼ built 201409
  5. # by 桜雅 在土
  6.  
  7. #==============================================================================
  8. # □ カスタマイズポイント
  9. #==============================================================================
  10. class XRXS_BP19
  11.   #
  12.   # コンボ持続時間[単位:F](40F が 一秒)
  13.   #
  14.   COMBOHIT_DURATION = 90
  15.   #
  16.   # スキン ファイル名
  17.   #
  18.   SKIN_NUMBER = "SixRice_Number.png"
  19.   SKIN_HIT    = "SixRice_HITS.png"
  20. end
  21. class Game_Battler
  22.   #
  23.   # コンボヒットによるダメージ補正力/ヒット数[単位:%]
  24.   #
  25.   DAMAGE_INCREASE_PER_HIT = 1
  26. end
  27. #==============================================================================
  28. # --- XRXS.ナンバースプライト スキン対応!  ---
  29. #==============================================================================
  30. class NumberSprite
  31.   #--------------------------------------------------------------------------
  32.   # ○ オブジェクト初期化
  33.   #--------------------------------------------------------------------------
  34.   def initialize(skin)
  35.     [url=home.php?mod=space&uid=81523]@skin[/url] = skin
  36.     @sprites = []
  37.     @width  = skin.width/10
  38.     [url=home.php?mod=space&uid=291977]@height[/url] = skin.height
  39.     set_digit(4) # 基本設定値
  40.     set(0)
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ○ 桁の設定
  44.   #--------------------------------------------------------------------------
  45.   def set_digit(digit)
  46.     @sprites.each{|sprite| sprite.dispose}
  47.     @sprites.clear
  48.     digit.times do
  49.       sprite = Sprite.new
  50.       sprite.bitmap = @skin
  51.       sprite.z = 999
  52.       sprite.src_rect.set(0, 0, @width, @height)
  53.       @sprites.push(sprite)
  54.     end
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ○ 値の設定
  58.   #--------------------------------------------------------------------------
  59.   def set(number)
  60.     # 例外補正 0.17b更新
  61.     digit = (number ==0) ? 0 : Math.log10(number)
  62.     if digit > @sprites.size
  63.       set_digit(digit)
  64.     end
  65.     # 各桁の適用
  66.     for sprite in @sprites
  67.       sprite.src_rect.x = number%10 * @width
  68.       number /= 10
  69.     end
  70.     # ゼロ表示 上から判定し、一度でも 0 でなければそこから表示
  71.     zero_display = false
  72.     for sprite in @sprites.reverse
  73.       zero_display |= (sprite.src_rect.x != 0)
  74.       sprite.visible = zero_display
  75.     end
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ○ 座標などの設定の経由
  79.   #--------------------------------------------------------------------------
  80.   def x=(n)
  81.     @sprites.each{|sprite|
  82.       sprite.x = n
  83.       n -= @width
  84.     }
  85.   end
  86.   def y=(n)
  87.     @sprites.each{|sprite| sprite.y = n }
  88.   end
  89.   def opacity=(n)
  90.     @sprites.each{|sprite| sprite.opacity = n }
  91.   end
  92.   def dispose
  93.     @sprites.each{|sprite| sprite.dispose }
  94.   end
  95. end
  96.  
  97. #==============================================================================
  98. # □ Window_ComboHit
  99. #------------------------------------------------------------------------------
  100. #     戦闘中にコンボ数を表示する透明なウィンドウです。
  101. #==============================================================================
  102. class Window_ComboHit < Window_Base
  103.   #--------------------------------------------------------------------------
  104.   # ○ オブジェクト初期化
  105.   #--------------------------------------------------------------------------
  106.   def initialize
  107.     @number = NumberSprite.new(RPG::Cache.windowskin(XRXS_BP19::SKIN_NUMBER))
  108.      super(200, 80, 200, 80)
  109.     self.opacity = 0
  110.     self.z = 999
  111.     self.visible = false
  112.     self.contents = RPG::Cache.windowskin(XRXS_BP19::SKIN_HIT).dup
  113.     @active = false
  114.     @show_duration = 0
  115.     @sliding_duration = 0
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ○ クリア ほか
  119.   #--------------------------------------------------------------------------
  120.   def clear
  121.     self.visible = false
  122.   end
  123.   def x=(n)
  124.     super
  125.     @number.x = n if @number != nil
  126.   end
  127.   def y=(n)
  128.     super
  129.     @number.y = n if @number != nil
  130.   end
  131.   def contents_opacity=(n)
  132.     super
  133.     @number.opacity = n if @number != nil
  134.   end
  135.   def dispose
  136.     @number.dispose
  137.     super
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ○ リフレッシュ
  141.   #--------------------------------------------------------------------------
  142.   def refresh(hit_combo, duration)
  143.     # 可視化
  144.     self.contents_opacity = 255
  145.     self.visible = true
  146.     # 設定
  147.     @show_duration    = duration
  148.     @sliding_duration = 0
  149.     # 描写
  150.     @number.set(hit_combo)
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ○ フレーム更新
  154.   #--------------------------------------------------------------------------
  155.   def update
  156.     if @sliding_duration > 0
  157.       @sliding_duration -= 1
  158.       self.contents_opacity -= 32
  159.       self.x += 1
  160.       if @sliding_duration == 0
  161.         self.visible = false
  162.       end
  163.     elsif @show_duration > 0
  164.       @show_duration -= 1
  165.       if @show_duration == 0
  166.         @sliding_duration = 8
  167.       end
  168.     end
  169.   end
  170. end


RTAB连击数-计算部分
RUBY 代码复制
  1. #==============================================================================
  2. #RTAB观光游第六站,连击效果+连击数显示 (计算部分)
  3. #==============================================================================
  4. # 連撃 Ver 1.03
  5. # 配布元・サポートURL
  6. # [url]http://members.jcom.home.ne.jp/cogwheel/[/url]
  7.  
  8. #==============================================================================
  9. # ■ Scene_Battle (分割定義 4)
  10. #------------------------------------------------------------------------------
  11. #  バトル画面の処理を行うクラスです。
  12. #==============================================================================
  13. # アニメに強さ0のフラッシュが存在した場合、
  14. # 赤:倍率 緑:+スキル・アイテムID でダメージ計算を行う。
  15. #
  16. # 连击数,每次伤害比率如何设置,参考动画“千裂斩”
  17.  
  18. class Scene_Battle
  19. attr_reader :skill#到此一游
  20. #--------------------------------------------------------------------------
  21. # ● ATB基礎セットアップ
  22. #--------------------------------------------------------------------------
  23.   alias :atb_setup_straight :atb_setup
  24.   def atb_setup
  25.     atb_setup_straight
  26.     for battler in $game_party.actors + $game_troop.enemies
  27.       battler.total_damage = {}
  28.     end
  29.   end
  30. #--------------------------------------------------------------------------
  31. # ● アクション更新 (メインフェーズ)
  32. #--------------------------------------------------------------------------
  33.   def action_phase(battler)
  34.     while true
  35.       # action が 1 の場合、バトラーが行動中かどうか確認
  36.       if @action == 1 and battler.phase < 3
  37.         for target in battler.target
  38.           speller = synthe?(target)
  39.           if speller == nil
  40.             # ターゲットが通常行動中の場合
  41.             if @action_battlers.include?(target)
  42.               if target.phase > 2
  43.                 return
  44.               end
  45.             end
  46.           else
  47.             # ターゲットが連携スキル発動中の場合
  48.             for spell in speller
  49.               if @action_battlers.include?(spell)
  50.                 if spell.phase > 2
  51.                   return
  52.                 end
  53.               end
  54.             end
  55.           end
  56.         end
  57.       end
  58.       case battler.phase
  59.       when 1
  60.         update_phase4_step1(battler)
  61.       when 2
  62.         update_phase4_step2(battler)
  63.       when 3
  64.         update_phase4_step3(battler)
  65.       when 4
  66.         update_phase4_step4(battler)
  67.       when 5
  68.         update_phase4_step5(battler)
  69.       when 6
  70.         update_phase4_step6(battler)
  71.       end
  72.       # ウェイトが入った場合
  73.       if battler.wait > 0
  74.         # ウェイトカウントを減らして終了
  75.         battler.wait -= 1
  76.         break
  77.       end
  78.       # 行動終了した場合ループを抜ける
  79.       unless @action_battlers.include?(battler)
  80.         break
  81.       end
  82.     end
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  86.   #--------------------------------------------------------------------------
  87.   def update_phase4_step1(battler)
  88.     # すでに戦闘から外されている場合
  89.     if battler.index == nil
  90.       @action_battlers.delete(battler)
  91.       anime_wait_return
  92.       battler.wait = 1
  93.       return
  94.     end
  95.     speller = synthe?(battler)
  96.     if speller == nil
  97.       # ダメージ食らい中の場合
  98.       unless battler.damage.empty? or @action > 2
  99.         battler.wait = 1
  100.         return
  101.       end
  102.       # 行動可能かどうか判定
  103.       unless battler.movable?
  104.         battler.phase = 6
  105.         return
  106.       end
  107.     else
  108.       # ダメージ食らい中の場合
  109.       for spell in speller
  110.         unless spell.damage.empty? or @action > 2
  111.           battler.wait = 1
  112.           return
  113.         end
  114.         # 行動可能かどうか判定
  115.         unless spell.movable?
  116.           battler.phase = 6
  117.           return
  118.         end
  119.       end
  120.     end
  121.     # スキル使用時、詠唱時間設定
  122.     # 強制アクションかつ [url=home.php?mod=space&uid=316545]@force[/url] が 2 の時はスキルを即時発動
  123.     if battler.current_action.kind == 1 and
  124.       (not battler.current_action.forcing or @force != 2)
  125.       if battler.rtp == 0
  126.         # スキル詠唱中ならば、解除
  127.         skill_reset(battler)
  128.         # スキル詠唱時間設定
  129.         recite_time(battler)
  130.         # 連携技設定
  131.         synthe_spell(battler)
  132.         # スキルを詠唱する場合
  133.         if battler.rtp > 0
  134.           # 強制アクションかつ @force が 1 の時は連携スキルのみ即時発動
  135.           speller = synthe?(battler)
  136.           if battler.current_action.forcing and @force > 0 and speller != nil
  137.             for spell in speller
  138.               spell.rt = spell.rtp
  139.             end
  140.           else
  141.             battler.blink = true
  142.             if battler.current_action.forcing
  143.               $game_temp.forcing_battler = nil
  144.               battler.current_action.forcing = false
  145.             end
  146.             @action_battlers.delete(battler)
  147.             return
  148.           end
  149.         end
  150.       end
  151.     end
  152.     # アクターの明滅エフェクト OFF
  153.     if battler != nil
  154.       battler.blink = false
  155.     end
  156.     speller = synthe?(battler)
  157.     if speller == nil
  158.       @spell_p.delete(battler)
  159.       @spell_e.delete(battler)
  160.     else
  161.       for spell in speller
  162.         spell.blink = false
  163.         @spell_p.delete(spell)
  164.         @spell_e.delete(spell)
  165.       end
  166.     end
  167.     # ステップ 2 に移行
  168.     battler.phase = 2
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  172.   #--------------------------------------------------------------------------
  173.   def update_phase4_step2(battler)
  174.     # 強制アクションでなければ
  175.     unless battler.current_action.forcing
  176.       # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  177.       if battler.restriction == 2 or battler.restriction == 3
  178.         # アクションに攻撃を設定
  179.         battler.current_action.kind = 0
  180.         battler.current_action.basic = 0
  181.       end
  182.     end
  183.     # アクションの種別より攻撃アニメーションを取得する
  184.     case battler.current_action.kind
  185.     when 0 # 基本
  186.       if battler.is_a?(Game_Actor)
  187.         base_id = battler.weapon_id
  188.       end
  189.       anime_id = battler.animation2_id
  190.       # 防御など特殊行動の場合は次のステップへ
  191.       unless make_basic_action_preparation(battler)
  192.         return
  193.       end
  194.       # 戦闘が終了した場合は行動をキャンセル
  195.       if fin?
  196.         battler.phase = 6
  197.         return
  198.       end
  199.     when 1 # スキル
  200.       base_id = battler.current_action.skill_id
  201.       anime_id = $data_skills[battler.current_action.skill_id].animation2_id
  202.       # スキルが使用できない場合は行動をキャンセル
  203.       unless make_skill_action_preparation(battler)
  204.         return
  205.       end
  206.       # 戦闘が終了した場合は行動をキャンセル
  207.       if fin? and $data_skills[anime_id].scope == 1..2
  208.         battler.phase = 6
  209.         return
  210.       end
  211.     when 2 # アイテム
  212.       base_id = battler.current_action.item_id
  213.       anime_id = $data_items[battler.current_action.item_id].animation2_id
  214.       # アイテムが使用できない場合は行動をキャンセル
  215.       unless make_item_action_preparation(battler)
  216.         return
  217.       end
  218.       # 戦闘が終了した場合は行動をキャンセル
  219.       if fin? and $data_items[anime_id].scope == 1..2
  220.         battler.phase = 6
  221.         return
  222.       end
  223.     end
  224.     # アニメーションを検索し、連撃性を変数serialに代入する
  225.     serial = []
  226.     frame = 0
  227.     if $data_animations[anime_id] != nil
  228.       for animation in $data_animations[anime_id].timings
  229.         color = animation.flash_color
  230.         # アニメーション・フラッシュの強さが0の場合
  231.         if color.alpha == 0
  232.           serial.push([color.red.to_i, color.green, animation.frame - frame])
  233.           frame = animation.frame
  234.         end
  235.       end
  236.       # 連撃性がない場合単発攻撃
  237.       if serial.empty?
  238.         serial = [[20, 100, $data_animations[anime_id].frame_max - 5]]
  239.       end
  240.     else
  241.       # アニメーションが存在しない場合
  242.       serial = [[20, 100, 0]]
  243.     end
  244.     # ハッシュ total_damage の作成
  245.     total_damage = {}
  246.     for target in battler.target
  247.       total_damage[target] = []
  248.     end
  249.     # 連撃回数分ダメージ計算を行う
  250.     for attack in serial
  251.       # アクションの種別で分岐
  252.       case battler.current_action.kind
  253.       when 0  # 基本
  254.         if battler.is_a?(Game_Actor)
  255.           # バトラーがアクターの場合、攻撃時に武器を変更する
  256.           battler.change_weapon(base_id + attack[1] - 100)
  257.         end
  258.         make_basic_action_result(battler)
  259.       when 1  # スキル
  260.         # 連携スキルのことを考え、スキルIDの変更は内部処理で行う
  261.         make_skill_action_result(battler, attack[1] - 100)
  262.       when 2  # アイテム
  263.         # アイテムIDを設定分変化させる
  264.         battler.current_action.item_id = base_id + attack[1] - 100
  265.         make_item_action_result(battler)
  266.       end
  267.       # total_damage へダメージを代入
  268.       for target in battler.target
  269.         # ダメージがある場合、ダメージをX/20倍する。
  270.         if target.damage[battler].is_a?(Numeric)
  271.           damage = target.damage[battler] * attack[0] / 20
  272.         else
  273.           damage = target.damage[battler]
  274.         end
  275.         # 回復HP量がある場合、回復HP量をX/20倍する。
  276.         if target.recover_hp[battler].is_a?(Numeric)
  277.           recover_hp = target.recover_hp[battler] * attack[0] / 20
  278.         end
  279.         # 回復SP量がある場合、回復SP量をX/20倍する。
  280.         if target.recover_sp[battler].is_a?(Numeric)
  281.           recover_sp = target.recover_sp[battler] * attack[0] / 20
  282.         end
  283.         critical = target.critical[battler]
  284.         # total_damage = [ダメージ, クリティカルフラグ, 回復HP量, 回復SP量,
  285.         #                 ステート変化, ステート回復, 待ちフレーム時間]
  286.         total_damage[target].push([damage, critical, recover_hp, recover_sp,
  287.           target.state_p[battler], target.state_m[battler], attack[2]])
  288.       end
  289.     end
  290.     # トータルダメージを、バトラーのインスタンスに代入
  291.     for target in battler.target
  292.       target.total_damage[battler] = total_damage[target]
  293.     end
  294.     # 武器・スキル・アイテムIDを通常に戻す
  295.     case battler.current_action.kind
  296.     when 0  # 基本
  297.       if battler.is_a?(Game_Actor)
  298.         battler.change_weapon(base_id)
  299.       end
  300.     when 1  # スキル
  301.       battler.current_action.skill_id = base_id
  302.     when 2  # アイテム
  303.       battler.current_action.item_id = base_id
  304.     end
  305.     if battler.phase == 2
  306.       # ステップ 3 に移行
  307.       battler.phase = 3
  308.     end
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● 基本アクション 準備
  312.   #--------------------------------------------------------------------------
  313.   def make_basic_action_preparation(battler)
  314.     # 攻撃の場合
  315.     if battler.current_action.basic == 0
  316.       # アニメーション ID を設定
  317.       battler.anime1 = battler.animation1_id
  318.       battler.anime2 = battler.animation2_id
  319.       # 行動側バトラーがエネミーの場合
  320.       if battler.is_a?(Game_Enemy)
  321.         if battler.restriction == 3
  322.           target = $game_troop.random_target_enemy
  323.         elsif battler.restriction == 2
  324.           target = $game_party.random_target_actor
  325.         else
  326.           index = battler.current_action.target_index
  327.           target = $game_party.smooth_target_actor(index)
  328.         end
  329.       end
  330.       # 行動側バトラーがアクターの場合
  331.       if battler.is_a?(Game_Actor)
  332.         if battler.restriction == 3
  333.           target = $game_party.random_target_actor
  334.         elsif battler.restriction == 2
  335.           target = $game_troop.random_target_enemy
  336.         else
  337.           index = battler.current_action.target_index
  338.           target = $game_troop.smooth_target_enemy(index)
  339.         end
  340.       end
  341.       # 対象側バトラーの配列を設定
  342.       battler.target = [target]
  343.       return true
  344.     end
  345.     # 防御の場合
  346.     if battler.current_action.basic == 1
  347.       # ステップ 3 に移行
  348.       battler.phase = 3
  349.       return false
  350.     end
  351. #===============0.15b(RTAB官方更新)===========================================   
  352.     # 逃げるの場合
  353.     if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  354.       # ステップ 3 に移行
  355.       battler.phase = 3
  356.       return false
  357.     end
  358. #=============================================================================
  359.     # 何もしないの場合
  360.     if battler.current_action.basic == 3
  361.       # ステップ 6 に移行
  362.       battler.phase = 6
  363.       return false
  364.     end
  365.   end
  366.   #--------------------------------------------------------------------------
  367.   # ● スキルアクション 準備
  368.   #--------------------------------------------------------------------------
  369.   def make_skill_action_preparation(battler)
  370.     # スキルを取得
  371.     [url=home.php?mod=space&uid=260100]@skill[/url] = $data_skills[battler.current_action.skill_id]
  372.     # 連携スキルであるかどうか確認
  373.     speller = synthe?(battler)
  374.     # 強制アクションでなければ
  375.     unless battler.current_action.forcing
  376.       # SP 切れなどで使用できなくなった場合
  377.       if speller == nil
  378.         unless battler.skill_can_use?(@skill.id)
  379.           # ステップ 6 に移行
  380.           battler.phase = 6
  381.          return false
  382.         end
  383.       end
  384.     end
  385.     # SP 消費
  386.     temp = false
  387.     if speller != nil
  388.       for spell in speller
  389.         if spell.current_action.spell_id == 0
  390.           spell.sp -= @skill.sp_cost
  391.         else
  392.           spell.sp -= $data_skills[spell.current_action.spell_id].sp_cost
  393.         end
  394.         # ステータスウィンドウをリフレッシュ
  395.         status_refresh(spell)
  396.       end
  397.     else
  398.       battler.sp -= @skill.sp_cost
  399.       # ステータスウィンドウをリフレッシュ
  400.       status_refresh(battler)
  401.     end
  402.     # アニメーション ID を設定
  403.     battler.anime1 = @skill.animation1_id
  404.     battler.anime2 = @skill.animation2_id
  405.     # コモンイベント ID を設定
  406.     battler.event = @skill.common_event_id
  407.     # 対象側バトラーを設定
  408.     set_target_battlers(@skill.scope, battler)
  409.     return true
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● アイテムアクション 準備
  413.   #--------------------------------------------------------------------------
  414.   def make_item_action_preparation(battler)
  415.     # アイテムを取得
  416.     @item = $data_items[battler.current_action.item_id]
  417.     # アイテム切れなどで使用できなくなった場合
  418.     unless $game_party.item_can_use?(@item.id)
  419.       # ステップ 6 に移行
  420.       battler.phase = 6
  421.       return false
  422.     end
  423.     # 消耗品の場合
  424.     if @item.consumable
  425.       # 使用したアイテムを 1 減らす
  426.       $game_party.lose_item(@item.id, 1)
  427.     end
  428.     # アニメーション ID を設定
  429.     battler.anime1 = @item.animation1_id
  430.     battler.anime2 = @item.animation2_id
  431.     # コモンイベント ID を設定
  432.     battler.event = @item.common_event_id
  433.     # 対象を決定
  434.     index = battler.current_action.target_index
  435.     target = $game_party.smooth_target_actor(index)
  436.     # 対象側バトラーを設定
  437.     set_target_battlers(@item.scope, battler)
  438.     return true
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● 基本アクション 結果作成
  442.   #--------------------------------------------------------------------------
  443.   def make_basic_action_result(battler)
  444.     # 通常攻撃の効果を適用
  445.     for target in battler.target
  446.       target.attack_effect(battler)
  447.     end
  448.   end
  449.   #--------------------------------------------------------------------------
  450.   # ● スキルアクション 結果作成
  451.   #--------------------------------------------------------------------------
  452.   def make_skill_action_result(battler, plus_id)
  453.     # スキルを取得
  454.     @skill = $data_skills[battler.current_action.skill_id + plus_id]
  455.     # 連携スキルであるかどうか確認
  456.     speller = synthe?(battler)
  457.     # スキルの効果を適用
  458.     for target in battler.target
  459.       if speller != nil
  460.         damage = 0
  461.         effective = false
  462.         state_p = []
  463.         state_m = []
  464.         d_result = false
  465.         for spell in speller
  466.           if spell.current_action.spell_id != 0
  467.             @skill = $data_skills[spell.current_action.spell_id + plus_id]
  468.           end
  469.           effective |= target.skill_effect(spell, @skill)
  470.           if target.damage[spell].class != String
  471.             d_result = true
  472.             damage += target.damage[spell]
  473.           elsif effective
  474.             effect = target.damage[spell]
  475.           end
  476.           state_p += target.state_p[spell]
  477.           state_m += target.state_m[spell]
  478.           target.damage.delete(spell)
  479.           target.state_p.delete(spell)
  480.           target.state_m.delete(spell)
  481.         end
  482.         if d_result
  483.           target.damage[battler] = damage
  484.         elsif effective
  485.           target.damage[battler] = effect
  486.         end
  487.         target.state_p[battler] = state_p
  488.         target.state_m[battler] = state_m
  489.       else
  490.         target.skill_effect(battler, @skill)
  491.       end
  492.     end
  493.   end
  494.   #--------------------------------------------------------------------------
  495.   # ● アイテムアクション 結果作成
  496.   #--------------------------------------------------------------------------
  497.   def make_item_action_result(battler)
  498.     # アイテムを取得
  499.     @item = $data_items[battler.current_action.item_id]
  500.     # アイテムの効果を適用
  501.     for target in battler.target
  502.       target.item_effect(@item, battler)
  503.     end
  504.   end
  505.   #--------------------------------------------------------------------------
  506.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  507.   #--------------------------------------------------------------------------
  508.   def update_phase4_step4(battler)
  509.     # カメラ設定
  510.     if battler.target[0].is_a?(Game_Enemy) and battler.anime1 != 0
  511.       camera_set(battler)
  512.     end
  513.     # 対象側アニメーション
  514.     for target in battler.target
  515.       target.animation.push([battler.anime2,
  516.                                           (target.damage[battler] != "Miss")])
  517.       unless battler.anime2 == 0
  518.         battler.wait = 2 * target.total_damage[battler][0][6] - 1 +
  519.           Graphics.frame_count % 2
  520.       end
  521.     end
  522.     # ステップ 5 に移行
  523.     battler.phase = 5
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  527.   #--------------------------------------------------------------------------
  528.   def update_phase4_step5(battler)
  529.     next_step = true
  530.     # ダメージ表示
  531.     for target in battler.target
  532.       # total_damage より全ダメージを算出
  533.       total_damage = target.total_damage[battler].shift
  534.       target.damage[battler] = total_damage[0]
  535.       target.critical[battler] = total_damage[1]
  536.       target.recover_hp[battler] = total_damage[2]
  537.       target.recover_sp[battler] = total_damage[3]
  538.       target.state_p[battler] = total_damage[4]
  539.       target.state_m[battler] = total_damage[5]
  540.       # ダメージ表示フラグをON
  541.       target.damage_pop[battler] = true
  542.       # 恭喜你发现了连击计算的关键一行!
  543.       target.combohit_count if target.damage[battler].to_i > 0 and target.damage[battler] != "Miss"
  544.       # 実際にダメージを与える
  545. #      target.damage_effect(battler, battler.current_action.kind)
  546.       target.damage_effect(battler, battler.current_action.kind,skill)#到此一游
  547.       # 余計なハッシュを削除
  548.       target.recover_hp.delete(battler)
  549.       target.recover_sp.delete(battler)
  550.       target.state_p.delete(battler)
  551.       target.state_m.delete(battler)
  552.       # ダメージを全て与えきった場合
  553.       if target.total_damage[battler].empty?
  554.         # ターゲットへの全ダメージを削除
  555.         target.total_damage.delete(battler)
  556.         # 指定時間ウェイトする
  557.         battler.wait = @damage_wait
  558.       else
  559.         # 指定時間ウェイトする
  560.         next_step = false
  561.         battler.wait = 2 * target.total_damage[battler][0][6]
  562.       end
  563.       # ステータスウィンドウをリフレッシュ
  564.       status_refresh(target)
  565.     end
  566.     if next_step
  567.       # ステップ 6 に移行
  568.       battler.phase = 6
  569.     end
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  573.   #--------------------------------------------------------------------------
  574.   def update_phase4_step6(battler)
  575.     # カメラを戻す
  576.     if battler.target[0].is_a?(Game_Enemy) and @camera == battler
  577.       @spriteset.screen_target(0, 0, 1)
  578.     end
  579.     # スキルラーニング
  580.     if battler.target[0].is_a?(Game_Actor) and battler.current_action.kind == 1
  581.       for target in battler.target        
  582.         if target.is_a?(Game_Actor)#(0.16)
  583.         skill_learning(target, target.class_id,
  584.                         battler.current_action.skill_id)
  585.         end #(0.16)               
  586.       end
  587.     end
  588.     # アクション強制対象のバトラーをクリア
  589.     if battler.current_action.forcing == true and
  590.         battler.current_action.force_kind == 0 and
  591.         battler.current_action.force_basic == 0 and
  592.         battler.current_action.force_skill_id == 0
  593.       $game_temp.forcing_battler = nil
  594.       battler.current_action.forcing = false
  595.     end
  596.     refresh_phase(battler)
  597.     speller = synthe?(battler)
  598.     if speller != nil
  599.       for spell in speller
  600.         if spell != battler
  601.           refresh_phase(spell)
  602.         end
  603.       end
  604.       synthe_delete(speller)
  605.     end
  606.     # コモンイベント ID が有効の場合
  607.     if battler.event > 0
  608.       # イベントをセットアップ
  609.       common_event = $data_common_events[battler.event]
  610.       $game_system.battle_interpreter.setup(common_event.list, 0)
  611.     end
  612.     act = 0
  613.     for actor in $game_party.actors + $game_troop.enemies
  614.       if actor.movable?
  615.         act += 1
  616.       end
  617.     end
  618.     if @turn_cnt >= act and act > 0
  619.       @turn_cnt %= act
  620.       $game_temp.battle_turn += 1
  621.       # バトルイベントの全ページを検索
  622.       for index in 0...$data_troops[@troop_id].pages.size
  623.         # イベントページを取得
  624.         page = $data_troops[@troop_id].pages[index]
  625.         # このページのスパンが [ターン] の場合
  626.         if page.span == 1
  627.           # 実行済みフラグをクリア
  628.           $game_temp.battle_event_flags[index] = false
  629.         end
  630.       end
  631.     end
  632.     battler.phase = 1
  633.     @action_battlers.delete(battler)
  634.   end
  635. #//////////////////////////////////////////////////////////////////////////////
  636. #连击数计算的基础部分Part1  by 桜雅 在土
  637. #------------------------------------------------------------------------------
  638. # ● メイン処理
  639. #------------------------------------------------------------------------------
  640.   alias xrxs_bp19_main main
  641.   def main
  642.     # コンボヒットウィンドウを作成
  643.     @combohit_window = Window_ComboHit.new
  644.     # 呼び戻す
  645.     xrxs_bp19_main
  646.     # ウィンドウを解放
  647.     @combohit_window.dispose
  648.     # コンボクリア
  649.     $game_party.actors.each {|actor| actor.combohit_clear}
  650.   end
  651. #------------------------------------------------------------------------------
  652. # ● フレーム更新
  653. #------------------------------------------------------------------------------
  654.   alias xrxs_bp19_update update
  655.   def update
  656.     # フレーム更新
  657.     @combohit_window.update
  658.     $game_party.actors.each {|actor| actor.combohit_update}
  659.     $game_troop.enemies.each{|enemy| enemy.combohit_update}
  660.     # 呼び戻す
  661.     xrxs_bp19_update
  662.   end
  663. #------------------------------------------------------------------------------
  664. # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  665. #------------------------------------------------------------------------------
  666.   alias xrxs_bp19_update_phase4_step5 update_phase4_step5
  667.   def update_phase4_step5(battler)
  668.     # 呼び戻す
  669.     xrxs_bp19_update_phase4_step5(battler)
  670.     # コンボ数の最も高いターゲットを探す
  671.     max = 0
  672.     hit_target = nil
  673.     for target in battler.target
  674.       if target.combohit > max
  675.         max = target.combohit
  676.         hit_target = target
  677.       end
  678.     end
  679.     if max >= 2 and !hit_target.nil?
  680.       @combohit_window.x = hit_target.is_a?(Game_Enemy) ? 512 : 512
  681.       @combohit_window.refresh(max, hit_target.combohit_duration)
  682.     end
  683.   end  
  684. end
  685. #//////////////////////////////////////////////////////////////////////////////
  686. #==============================================================================
  687. # ■ Game_Battler (分割定義 1)
  688. #------------------------------------------------------------------------------
  689. #  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ
  690. # スのスーパークラスとして使用されます。
  691. #==============================================================================
  692.  
  693. class Game_Battler
  694.   #--------------------------------------------------------------------------
  695.   # ● 公開インスタンス変数追加
  696.   #--------------------------------------------------------------------------
  697.   attr_accessor :total_damage              # 総ダメージ
  698.   #--------------------------------------------------------------------------
  699.   # ● オブジェクト初期化
  700.   #--------------------------------------------------------------------------
  701.   alias :initialize_straight :initialize
  702.   def initialize
  703.     initialize_straight
  704.     @total_damage = {}
  705.   end
  706.   #--------------------------------------------------------------------------
  707.   # ● 存在判定
  708.   #--------------------------------------------------------------------------
  709.   def exist?
  710.     return (not [url=home.php?mod=space&uid=292300]@Hidden[/url] and (@hp > 0 or @immortal or not @total_damage.empty?))
  711.   end
  712.   #--------------------------------------------------------------------------
  713.   # ● 残HP予測
  714.   #--------------------------------------------------------------------------
  715.   def rest_hp
  716.     # rest_hp に現HPを代入
  717.     rest_hp = @hp
  718.     # バトラーが受ける全ダメージをrest_hpに反映させる
  719.     for total in @total_damage
  720.       for pre_damage in total[1]
  721.         if pre_damage[0].is_a?(Numeric)
  722.           rest_hp -= pre_damage[0]
  723.         end
  724.         if pre_damage[2].is_a?(Numeric)
  725.           rest_hp += pre_damage[2]
  726.         end
  727.       end
  728.     end
  729.     return rest_hp
  730.   end
  731. end
  732. #//////////////////////////////////////////////////////////////////////////////
  733. #连击数计算的基础部分Part2  by 桜雅 在土
  734. #------------------------------------------------------------------------------
  735. # ● 公開インスタンス変数
  736. #------------------------------------------------------------------------------
  737.   def combohit
  738.     @combohit = 0 if @combohit.nil?
  739.     return @combohit
  740.   end
  741.   def combohit_duration
  742.     @combohit_duration = 0 if @combohit_duration.nil?
  743.     return @combohit_duration
  744.   end
  745. #------------------------------------------------------------------------------
  746. # ○ コンボヒットを更新
  747. #------------------------------------------------------------------------------  
  748.   def combohit_update
  749.     # 例外補正
  750.     @combohit_duration = 0 if @combohit_duration.nil?
  751.     # カウント
  752.     if @combohit_duration > 0
  753.       @combohit_duration -= 1
  754.       # のけぞり時間終了時、コンボ数をリセット
  755.       @combohit = 0 if @combohit_duration == 0
  756.     end
  757.   end
  758. #------------------------------------------------------------------------------
  759. # ○ コンボヒットをカウント
  760. #------------------------------------------------------------------------------
  761.   def combohit_count
  762.     # 例外補正
  763.     @combohit = 0 if @combohit.nil?  
  764.     # カウント
  765.     @combohit += 1
  766.     @combohit_duration = XRXS_BP19::COMBOHIT_DURATION
  767.   end
  768. #------------------------------------------------------------------------------
  769. # ○ コンボヒットをクリア
  770. #------------------------------------------------------------------------------  
  771.   def combohit_clear
  772.     @combohit = nil
  773.     @combohit_duration = nil
  774.   end
  775.  
  776. #//////////////////////////////////////////////////////////////////////////////
  777. #==============================================================================
  778. # ■ Game_Actor
  779. #------------------------------------------------------------------------------
  780. #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
  781. # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
  782. #==============================================================================
  783.  
  784. class Game_Actor < Game_Battler
  785.   #--------------------------------------------------------------------------
  786.   # ● 公開インスタンス変数
  787.   #--------------------------------------------------------------------------
  788.   def change_weapon(id)
  789.     @weapon_id = id
  790.   end
  791. end
  792.  
  793. #==============================================================================
  794. # ■ Sprite_Battler
  795. #------------------------------------------------------------------------------
  796. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  797. # スプライトの状態を自動的に変化させます。
  798. #==============================================================================
  799.  
  800. class Sprite_Battler < RPG::Sprite
  801.   #--------------------------------------------------------------------------
  802.   # ● フレーム更新
  803.   #--------------------------------------------------------------------------
  804.   def update
  805.     super
  806.     # バトラーが nil の場合
  807.     if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
  808.       self.bitmap = nil
  809.       loop_animation(nil)
  810.       return
  811.     end
  812.     # ファイル名か色相が現在のものと異なる場合
  813.     if @battler.battler_name != @battler_name or
  814.        @battler.battler_hue != @battler_hue
  815.       # ビットマップを取得、設定
  816.       @battler_name = @battler.battler_name
  817.       @battler_hue = @battler.battler_hue
  818.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  819.       @width = bitmap.width
  820.       @height = bitmap.height
  821.       self.ox = @width / 2
  822.       self.oy = @height
  823.       if @battler.is_a?(Game_Enemy)
  824.         @battler.height = @height
  825.       end
  826.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  827.       if @battler.dead? or @battler.hidden
  828.         self.opacity = 0
  829.       end
  830.     end
  831.     # アニメーション ID が現在のものと異なる場合
  832.     if @battler.state_animation_id != @state_animation_id
  833.       @state_animation_id = @battler.state_animation_id
  834.       loop_animation($data_animations[@state_animation_id])
  835.     end
  836.     # 表示されるべきアクターの場合
  837.     if @battler.is_a?(Game_Actor) and @battler_visible
  838.       # メインフェーズでないときは不透明度をやや下げる
  839.       if $game_temp.battle_main_phase
  840.         self.opacity += 3 if self.opacity < 255
  841.       else
  842.         self.opacity -= 3 if self.opacity > 207
  843.       end
  844.     end
  845.     # 明滅
  846.     if @battler.blink
  847.       blink_on
  848.     else
  849.       blink_off
  850.     end
  851.     # 不可視の場合
  852.     unless @battler_visible
  853.       # 出現
  854.       if not @battler.hidden and not @battler.dead? and
  855.          (@battler.damage.size < 2 or @battler.damage_pop.size < 2)
  856.         appear
  857.         @battler_visible = true
  858.       end
  859.     end
  860.     # ダメージ
  861.     for battler in @battler.damage_pop
  862.       if battler[0].class == Array
  863.         if battler[0][1] >= 0
  864.           $scene.skill_se
  865.         else
  866.           $scene.levelup_se
  867.         end
  868.         damage(@battler.damage[battler[0]], false, 2)
  869.       else
  870.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  871.       end
  872.       if @battler.damage_sp.include?(battler[0])
  873.         damage(@battler.damage_sp[battler[0]],
  874.                 @battler.critical[battler[0]], 1)
  875.         @battler.damage_sp.delete(battler[0])
  876.       end
  877.       @battler.damage_pop.delete(battler[0])
  878.       @battler.damage.delete(battler[0])
  879.       @battler.critical.delete(battler[0])
  880.     end
  881.     # 可視の場合
  882.     if @battler_visible
  883.       # 逃走
  884.       if @battler.hidden
  885.         $game_system.se_play($data_system.escape_se)
  886.         escape
  887.         @battler_visible = false
  888.       end
  889.       # 白フラッシュ
  890.       if @battler.white_flash
  891.         whiten
  892.         @battler.white_flash = false
  893.       end
  894.       # アニメーション
  895.       unless @battler.animation.empty?
  896.         for animation in @battler.animation.reverse
  897.           animation($data_animations[animation[0]], animation[1])
  898.           @battler.animation.delete(animation)
  899.         end
  900.       end
  901.       # コラプス
  902.       if @battler.total_damage.empty? and @battler.dead?
  903.         if $scene.dead_ok?(@battler)
  904.           if @battler.is_a?(Game_Enemy)
  905.             $game_system.se_play($data_system.enemy_collapse_se)
  906.           else
  907.             $game_system.se_play($data_system.actor_collapse_se)
  908.           end
  909.           collapse
  910.           @battler_visible = false
  911.         end
  912.       end
  913.     end
  914.     # スプライトの座標を設定
  915.     self.x = @battler.screen_x
  916.     self.y = @battler.screen_y
  917.     self.z = @battler.screen_z
  918.     if @battler.is_a?(Game_Enemy)
  919.       self.zoom_x = @battler.real_zoom * @battler.zoom
  920.       self.zoom_y = @battler.real_zoom * @battler.zoom
  921.     end
  922.   end
  923. end


XRXS.付加属性名称判定
RUBY 代码复制
  1. # ▽△▽ XRXS.付加属性名称判定 ▽△▽  built 091221
  2. # by 桜雅 在土
  3.  
  4. #==============================================================================
  5. # --- XRXS. 付加属性名称判定モジュール ---
  6. #==============================================================================
  7. module XRXS
  8.   #--------------------------------------------------------------------------
  9.   # ○ 配列が指定名の属性を持つか判定
  10.   #--------------------------------------------------------------------------
  11.   def XRXS.element_check(set, element_name)
  12.     returnar = [false, 0, 0, []] # 存在したか?, 固定値の合計、%値の合計
  13.     return returnar if !set.is_a?(Array) or set.size == 0 or element_name == ""
  14.     for i in set
  15.       if $data_system.elements[i] =~ /^#{element_name}([+-]?[0-9]+)?(%)?/
  16.         returnar[0] = true
  17.         if $2 == nil
  18.           returnar[1] += $1.to_i
  19.           returnar[3].push($1.to_i)
  20.         else
  21.           returnar[2] += $1.to_i
  22.         end
  23.       end
  24.     end
  25.     return returnar
  26.   end
  27.   def XRXS.element_include?(set, element_name)
  28.     return element_check(set, element_name)[0]
  29.   end
  30.   def XRXS.element_amount(set, element_name)
  31.     return element_check(set, element_name)[1]
  32.   end
  33.   def XRXS.element_percent(set, element_name)
  34.     return element_check(set, element_name)[2]
  35.   end
  36.   def XRXS.element_numbers(set, element_name)
  37.     return element_check(set, element_name)[3]
  38.   end
  39. end


XRXS.装备属性取得机构
RUBY 代码复制
  1. # ▽△▽ XRXS. 装備属性取得機構 ▽△▽ built 221114
  2. # by 桜雅 在土
  3.  
  4. #==============================================================================
  5. # --- XRXS. 装備属性取得機構 ---
  6. #==============================================================================
  7. class Game_Battler
  8.   #--------------------------------------------------------------------------
  9.   # ○ スキルの属性取得
  10.   #--------------------------------------------------------------------------
  11.   def skill_element_set(skill)
  12.     return skill.nil? ? [] : skill.element_set
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # ○ 全装備の属性取得
  16.   #--------------------------------------------------------------------------
  17.   def equip_element_set
  18.     return self.element_set + self.guard_element_set
  19.   end
  20.   #--------------------------------------------------------------------------
  21.   # ○ 全防具の属性取得
  22.   #--------------------------------------------------------------------------
  23.   def guard_element_set
  24.     return []
  25.   end
  26. end
  27. class Game_Actor < Game_Battler
  28.   def guard_element_set
  29.     set = []
  30.     for id in self.armor_ids
  31.       next if id.nil?
  32.       armor = $data_armors[id]
  33.       set += (armor != nil ? armor.guard_element_set : [])
  34.     end
  35.     return set
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # ○ 武器 ID配列
  39.   #--------------------------------------------------------------------------
  40.   def weapon_ids
  41.     @weapon_ids = [] if @weapon_ids == nil
  42.     @weapon_ids[0] = @weapon_id
  43.     return @weapon_ids
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ○ 防具 ID配列
  47.   #--------------------------------------------------------------------------
  48.   def armor_ids
  49.     @armor_ids = [] if @armor_ids == nil
  50.     @armor_ids[0] = @armor1_id
  51.     @armor_ids[1] = @armor2_id
  52.     @armor_ids[2] = @armor3_id
  53.     @armor_ids[3] = @armor4_id
  54.     return @armor_ids
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ○ 装備配列の取得
  58.   #--------------------------------------------------------------------------
  59.   def equipments
  60.     equipments = []
  61.     self.weapon_ids.each {|id| equipments.push($data_weapons[id])}
  62.     self.armor_ids.each {|id| equipments.push($data_armors[id])}
  63.     return equipments
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # ○ 装備中?
  67.   #--------------------------------------------------------------------------
  68.   def equiping?(item)
  69.     case item
  70.     when RPG::Weapon
  71.       return self.weapon_ids.include?(item.id)
  72.     when RPG::Armor
  73.       return self.armor_ids.include?(item.id)
  74.     else
  75.       return false
  76.     end   
  77.   end
  78. end


XRXS.属性修正计数限制
RUBY 代码复制
  1. # ▼▲▼ XRXS38. 属性修正计算数限制 ▼▲▼ built 081012
  2. # by 桜雅 在土 (原作)
  3. #    Tetra-Z   (強化)
  4. #==============================================================================
  5. # 简介:此脚本会将“系统默认的属性修正”和“战斗特殊效果属性”分开计算;
  6. #       插入此脚本后,“战斗特殊效果属性”将“不计算属性有效度”。
  7. #==============================================================================
  8. # □ カスタマイズポイント
  9. #==============================================================================
  10. module XRXS38
  11.   # 属性的限制数量
  12.   ELEMENTS_NUMBER_LIMIT = 16
  13.   # 属性修正的计算方法
  14.   #        0 : 最大(默认的计算方法)
  15.   #        1 : 乘法
  16.   #        2 : 平均
  17.   #        3 : 最小
  18.   ELEMENT_CORRECT_METHOD = 1
  19. end
  20. #==============================================================================
  21. # ■ Game_Battler
  22. #==============================================================================
  23. class Game_Battler
  24. #--------------------------------------------------------------------------
  25. # ● 属性修正的计算 + 倍率计算公式
  26. #--------------------------------------------------------------------------
  27.   alias xrxs38_elements_correct elements_correct
  28.   def elements_correct(element_set)
  29.     elements = element_set.dup
  30.     # 属性数量的限制
  31.     for element_id in element_set
  32.       if element_id >XRXS38:: ELEMENTS_NUMBER_LIMIT
  33.         elements.delete(element_id)
  34.       end
  35.     end
  36.     #无属性的场合返回100
  37.     return 100 if elements.size == 0
  38.     #
  39.     case XRXS38::ELEMENT_CORRECT_METHOD
  40.     when 0 # 最大
  41.       return xrxs38_elements_correct(elements)
  42.     when 1 # 乘法
  43.       result = 100.0
  44.       minus_enable = false
  45.       for i in elements
  46.         n = self.element_rate(i)
  47.         minus_enable |= (n < 0)
  48.         result *= n / 100.0
  49.       end
  50.       result = -1 * result.abs if minus_enable
  51.       return result.to_i
  52.     when 2 # 平均
  53.       rates = []
  54.       result = 0
  55.       for i in elements
  56.         rates.push(self.element_rate(i))
  57.       end
  58.       for rate in rates
  59.         result += rate
  60.       end
  61.       return result / rates.size
  62.     when 3 # 最小
  63.       for i in elements
  64.         n = self.element_rate(i)
  65.         result = n if result.nil? or result > n
  66.       end
  67.       return result
  68.     end
  69.   end  
  70. end


RTAB战斗特效 Ver 1.03
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. # 基础脚本▼▲▼ XRXS19. 特殊効果詰め合わせ DamageEX ver.2 ▼▲▼ built 220920
  5. # by 桜雅 在土 (基本) Tetra-Z   (修正)  [url]http://scriptself.jpn.org/x/XRXS19.htm[/url]
  6. #==============================================================================
  7. # ▼▲▼ 战斗特殊效果属性 DamageEX - Plus × RTAB ▼▲▼
  8. #
  9. # 适用环境:RTAB Ver 1.16
  10. #
  11. # by SixRice  (Plus × RTAB改造)     Ver.1.03 2006/8/18
  12. # 从1.03版开始记录每次更新。
  13. #==============================================================================
  14. # 伤害计算流程:
  15. # 1  基础伤害计算                   (Game Battler)
  16. # 2  忽视躲闪判定                   (IGNORE_EVADE)
  17. # 3  修正基础伤害                   (HP_RATE,SP_RATE,CRITICAL_HIT,ADD_VARIANCE)
  18. # 4  固定伤害(取消基础)             (FIXDAMAGE)
  19. # 5  追加伤害计算                   (追加伤害效果类)
  20. # -> 基础伤害(或固定伤害)+追加伤害
  21. # =  总伤害
  22. # 6  修正总伤害                     (HP_DAMAGE,SP_DAMAGE)
  23. # -> 最终伤害
  24. # 7  收招修正使用者的HP/SP          (HP_CORRECT,SP_CORRECT)(1.03)
  25. # 8  根据最终伤害修正使用者的HP/SP  (HP_DRAIN,SP_DRAIN)
  26. #------------------------------------------------------------------------------
  27. module XRXS19
  28. #------------------------------------------------------------------------------
  29. # 一:特殊伤害效果类的属性名称设定
  30. #------------------------------------------------------------------------------  
  31. # 提示:本类属性名称后请添加自定义数值,然后才会生效。(数据库)
  32. #------------------------------------------------------------------------------  
  33. # 提示:本类属性请设为“不计算属性有效度”(XRXS38. 属性修正计算数限制)。
  34. #------------------------------------------------------------------------------  
  35. # 提示:本类属性中如果存在同属性,效果也叠加。
  36. #
  37. # 举例:一个东西同时包含HP吸收50%,HP吸收25%,实际效果为HP吸收75%.
  38. #------------------------------------------------------------------------------
  39.   AT_DAMAGE         = "AT伤害"         # 「修正目标的AT值(行动值)」(1.03)
  40.   HP_DAMAGE         = "HP伤害"         # 「将本次造成的总伤害的x%修正为HP伤害」
  41.   SP_DAMAGE         = "SP伤害"         # 「将本次造成的总伤害的x%修正为SP伤害」
  42.   HP_DRAIN          = "HP吸收"         # 「根据本次最终伤害的x%修正使用者的HP」
  43.   SP_DRAIN          = "SP吸收"         # 「根据本次最终伤害的x%修正使用者的SP」
  44.   HP_RATE           = "现HP威力"       # 「根据使用者HP/MAXHP修正本次基础伤害」
  45.   SP_RATE           = "现SP威力"       # 「根据使用者SP/MAXSP修正本次基础伤害」
  46.   CRITICAL_HIT      = "必杀"           # 「会心一击」   (武器效果通用化)
  47.   IGNORE_EVADE      = "忽视躲闪"       # 「忽视躲闪」   (特技效果武器化)
  48.   ADD_VARIANCE      = "分散度"         # 「追加分散度」 (特技效果武器化)
  49.   FIXDAMAGE         = "固定伤害"       # 「固定伤害值」 (特技效果武器化)
  50. #------------------------------------------------------------------------------
  51. # 提示:本类中“固定伤害值”不能和“会心一击”、“追加分散度”叠加;
  52. #       其余效果均可叠加。   
  53. #------------------------------------------------------------------------------  
  54.   AREA_EXTEND       = "敌方全体"      # 「敌方全体」属性名2
  55.   AREA_ACTOR        = "己方单体"      # 「己方单体」属性名3
  56.   AREA_ACTOR_ALL    = "己方全体"      # 「己方全体」属性名4
  57.   AREA_SELF         = "使用者"        # 「 使用者 」属性名7
  58.   AREA_WHOLE        = "全域化"        # 「 全域化 」属性名8
  59.   AREA_ENEMY_RAND   = "敌方随机"      # 「敌方随机」属性名9
  60.   AREA_ACTOR_RAND   = "己方随机"      # 「己方随机」属性名10
  61.   AREA_ALL_RAND     = "对象随机"      # 「对象随机」属性名11
  62.   SELF_INCLUSION    = "诸刃"          # 「  诸刃  」属性名
  63.   SELF_EXCLUSION    = "自身以外"      # 「自身以外」(与使用者,己方单体叠加无效)
  64. #------------------------------------------------------------------------------  
  65. # 提示:「诸刃」与
  66. #   「使用者」,「己方单体」,「己方全体」,「己方随机」,「对象随机」叠加无效。
  67. #------------------------------------------------------------------------------
  68.   P_STATE           = "发动状态P"      # 「行动时附加自身状态」属性名
  69.   M_STATE           = "发动状态M"      # 「行动时解除自身状态」属性名
  70.   HP_CORRECT        = "收招修正H"      # 「收招时修正使用者HP」属性名(1.03)
  71.   SP_CORRECT        = "收招修正S"      # 「收招时修正使用者SP」属性名(1.03)
  72. #------------------------------------------------------------------------------
  73. # 提示:在这个版本的战斗特殊效果属性中,
  74. #       除了"会心一击" 、"忽视躲闪"、"追加分散度" 这三个效果以外,
  75. #       其他的效果都支持负数,也就是逆转效果。
  76. #
  77. # 举例:想设置一个“敌我皆伤”的特技,只要附带HP吸收属性,效果设为负数就OK了。
  78. #
  79. # 举例:如果把"HP伤害负数" + "作用范围己方"设置为武器属性,
  80. #       就可以设置出回复己方HP的BT武器来。
  81. #
  82. # 更多创意想法等你来发挥!!
  83. #------------------------------------------------------------------------------
  84. # 二:追加伤害效果类的属性名称设定
  85. #------------------------------------------------------------------------------
  86. # 本类采用的英文单词缩写
  87. # NOW(N) = 当前 ;MAX(M) = 最大;DIF(D) = 差值 ;
  88. # HP(H) = 生命 ;SP(S) = 精力 ;  
  89. # TA(T) = target = 目标方;US(U) = user = 使用者 。
  90. #------------------------------------------------------------------------------
  91.   FIXDAMAGE_NOWHPTA = "NHT"            # 「目标方当前HP比例」属性名
  92.   FIXDAMAGE_MAXHPTA = "MHT"            # 「目标方最大HP比例」属性名
  93.   FIXDAMAGE_DIFHPTA = "DHT"            # 「目标方HP差值比例」属性名
  94.   FIXDAMAGE_NOWHPUS = "NHU"            # 「使用者当前HP比例」属性名  
  95.   FIXDAMAGE_MAXHPUS = "MHU"            # 「使用者最大HP比例」属性名
  96.   FIXDAMAGE_DIFHPUS = "DHU"            # 「使用者HP差值比例」属性名
  97.   FIXDAMAGE_NOWSPTA = "NST"            # 「目标方当前SP比例」属性名
  98.   FIXDAMAGE_MAXSPTA = "MST"            # 「目标方最大SP比例」属性名
  99.   FIXDAMAGE_DIFSPTA = "DST"            # 「目标方SP差值比例」属性名
  100.   FIXDAMAGE_NOWSPUS = "NSU"            # 「使用者当前SP比例」属性名
  101.   FIXDAMAGE_MAXSPUS = "MSU"            # 「使用者最大SP比例」属性名
  102.   FIXDAMAGE_DIFSPUS = "DSU"            # 「使用者SP差值比例」属性名
  103. #------------------------------------------------------------------------------
  104. # 提示:本类所有效果均不能互相叠加,具有唯一性;
  105. #       若特技属性中存在多个本类效果,则取最前面一个效果。  
  106. #------------------------------------------------------------------------------
  107. # 提示:特技附加本类属性的情况下,设特技的威力(pow)为比例基数,
  108. #       武器附加本类属性的情况下,设武器攻击力(atk)为比例基数,
  109. #       因此比例基数请通过数据库来设定。
  110. #------------------------------------------------------------------------------
  111. # 提示:本类所有效果均为普通伤害计算之后的追加伤害;
  112. #       本类所有效果“独立计算属性有效度”,不与其他属性有效度进行混合运算。
  113. #------------------------------------------------------------------------------
  114. # 举例1:某特技属性附加"NHT" ,威力为20,其实际效果为:
  115. #        造成 [目标方][当前][HP][20%] 的等量伤害。
  116. #------------------------------------------------------------------------------
  117. # 举例2:由于威力(power)这个值可以设为负数,
  118. #        因此MHT这个属性也可用于制作比例回复HP的特技效果。
  119. #------------------------------------------------------------------------------
  120. end
  121. #==============================================================================
  122. # ■ Game_BattleAction
  123. #==============================================================================
  124. class Game_BattleAction
  125.   attr_accessor :at_damage                # 「AT伤害值」    (Numeric)(1.03)
  126.   attr_accessor :hp_damage                # 「HP伤害率」    (Numeric)
  127.   attr_accessor :sp_damage                # 「SP伤害率」    (Numeric)
  128.   attr_accessor :hp_drain                 # 「HP吸收率」    (Numeric)
  129.   attr_accessor :sp_drain                 # 「SP吸收率」    (Numeric)
  130.   attr_accessor :hp_rate                  # 「现HP威力」    (true/false)
  131.   attr_accessor :sp_rate                  # 「现SP威力」    (true/false)
  132.   attr_accessor :critical_hit             # 「会心一击」    (Numeric)
  133.   attr_accessor :ignore_evade             # 「忽视躲闪」    (true/false)
  134.   attr_accessor :add_variance             # 「追加分散度」  (Numeric)
  135.   attr_accessor :fix_damage               # 「固定伤害值」 (Numeric)
  136.   attr_accessor :special_damage_kind      # 「追加伤害类」  (Numeric)
  137.   attr_accessor :scope_force              # 「对象强制值」  (Numeric)
  138.   attr_accessor :self_inclusion           # 「诸刃」        (true/false)
  139.   attr_accessor :self_exclusion           # 「自身以外」    (true/false)
  140.   attr_accessor :p_state                  # 「行动时附加自身状态」(Numeric)
  141.   attr_accessor :m_state                  # 「行动时解除自身状态」(Numeric)
  142.   attr_accessor :hp_correct               # 「收招时修正使用者HP」(Numeric)(1.03)
  143.   attr_accessor :sp_correct               # 「收招时修正使用者SP」(Numeric)(1.03)
  144.   def at_damage
  145.     return @at_damage.nil? ? 0 : @at_damage
  146. end
  147. #--------------------------------------------------------------------------
  148. # ● clear
  149. #--------------------------------------------------------------------------
  150.   alias xrxs19_clear clear
  151.   def clear
  152.     # recall
  153.     xrxs19_clear
  154.     # 初始化特殊效果
  155.     initialize_xrxs19_special_effect
  156.   end
  157. #--------------------------------------------------------------------------
  158. # ○ 初始化特殊效果
  159. #--------------------------------------------------------------------------
  160.   def initialize_xrxs19_special_effect
  161.     self.at_damage = 0#(1.03)
  162.     self.hp_damage = 0
  163.     self.sp_damage = 0
  164.     self.hp_drain  = 0
  165.     self.sp_drain  = 0
  166.     self.hp_rate  = false
  167.     self.sp_rate  = false
  168.     self.critical_hit = 0
  169.     self.ignore_evade = false
  170.     self.add_variance = 0
  171.     self.fix_damage = 0
  172.     self.special_damage_kind = 0
  173.     self.p_state = 0
  174.     self.m_state = 0
  175.     self.hp_correct = 0#(1.03)
  176.     self.sp_correct = 0#(1.03)
  177.   end
  178. #--------------------------------------------------------------------------
  179. # ○ 特殊效果设置
  180. #--------------------------------------------------------------------------
  181.   def set_xrxs19_special_effect(set)
  182.     # AT伤害值(数值)(1.03)
  183.     self.at_damage = XRXS.element_amount(set, XRXS19::AT_DAMAGE)
  184.     # HP/SP伤害率(数值%)
  185.     self.hp_damage = XRXS.element_percent(set, XRXS19::HP_DAMAGE)
  186.     self.sp_damage = XRXS.element_percent(set, XRXS19::SP_DAMAGE)
  187.     # HP/SP吸收率(数值%)
  188.     self.hp_drain  = XRXS.element_percent(set, XRXS19::HP_DRAIN)
  189.     self.sp_drain  = XRXS.element_percent(set, XRXS19::SP_DRAIN)
  190.     # 现HP/SP威力 (true/false)
  191.     self.hp_rate = XRXS.element_include?(set, XRXS19::HP_RATE)
  192.     self.sp_rate = XRXS.element_include?(set, XRXS19::SP_RATE)
  193.     # 会心一击率(数值%)
  194.     returnar = XRXS.element_check(set, XRXS19::CRITICAL_HIT)
  195.     percent = returnar[0] ? (returnar[2] == 0 ? 100 : returnar[2]) : 0
  196.     self.critical_hit = percent
  197.     # 忽视躲闪 (true/false)
  198.     self.ignore_evade = XRXS.element_include?(set, XRXS19::IGNORE_EVADE)
  199.     # 追加分散度(数值)
  200.     self.add_variance = XRXS.element_amount(set, XRXS19::ADD_VARIANCE)
  201.     # 固定伤害值(数值)
  202.     self.fix_damage = XRXS.element_amount(set, XRXS19::FIXDAMAGE)
  203.     # 追加伤害类
  204.     self.special_damage_kind =
  205.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWHPTA) ? 1 :
  206.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXHPTA) ? 2 :
  207.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFHPTA) ? 3 :
  208.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWHPUS) ? 4 :
  209.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXHPUS) ? 5 :
  210.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFHPUS) ? 6 :
  211.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWSPTA) ? 7 :
  212.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXSPTA) ? 8 :
  213.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFSPTA) ? 9 :
  214.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_NOWSPUS) ? 10 :
  215.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_MAXSPUS) ? 11 :
  216.       XRXS.element_include?(set, XRXS19::FIXDAMAGE_DIFSPUS) ? 12 :      
  217.       0
  218.     # 行动时附加/解除自身状态(ID)
  219.     self.p_state = XRXS.element_amount(set, XRXS19::P_STATE)
  220.     self.m_state = XRXS.element_amount(set, XRXS19::M_STATE)
  221.     # 收招时修正使用者HP/SP(数值)(1.03)
  222.     self.hp_correct = XRXS.element_amount(set, XRXS19::HP_CORRECT)
  223.     self.sp_correct = XRXS.element_amount(set, XRXS19::SP_CORRECT)
  224.   end
  225. #--------------------------------------------------------------------------
  226. # ○ 特殊效果clear
  227. #--------------------------------------------------------------------------
  228.   def clear_xrxs19_special_effect
  229.     self.at_damage = nil#(1.03)
  230.     self.hp_damage = nil
  231.     self.sp_damage = nil
  232.     self.hp_drain  = nil
  233.     self.sp_drain  = nil
  234.     self.hp_rate  = false
  235.     self.sp_rate  = false
  236.     self.critical_hit = nil
  237.     self.ignore_evade = false
  238.     self.add_variance = nil
  239.     self.fix_damage = nil
  240.     self.special_damage_kind = nil
  241.     self.scope_force = 0
  242.     self.self_exclusion = false
  243.     self.self_inclusion = false
  244.     self.p_state = nil
  245.     self.m_state = nil
  246.     self.hp_correct = 0#(1.03)
  247.     self.sp_correct = 0#(1.03)
  248.   end
  249. #--------------------------------------------------------------------------
  250. # ○ 无效化特殊效果
  251. #--------------------------------------------------------------------------
  252.   def nillize_xrxs19_special_effect
  253.     self.scope_force = nil
  254.     self.self_inclusion = nil
  255.     self.self_exclusion = nil
  256.   end
  257. end  
  258. #==============================================================================
  259. # □□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□
  260. #==============================================================================
  261. # ■ Game_Battler
  262. #==============================================================================
  263. class Game_Battler
  264. #--------------------------------------------------------------------------
  265. # ○ 公开实例变量
  266. #--------------------------------------------------------------------------
  267.   attr_accessor :maxat                  # 最大AT#(1.03)
  268.   attr_writer :ignore_evade             #(True为忽视对方躲闪判定)
  269.   attr_writer :hp_rate                  #(True为基础伤害根据HP/MAXHP比例修正)
  270.   attr_writer :sp_rate                  #(True为基础伤害根据SP/MAXSP比例修正)
  271. #--------------------------------------------------------------------------
  272. # ○特殊范围效果设定
  273. #--------------------------------------------------------------------------  
  274.   def set_xrxs19_special_scope(set)
  275. # 范围强制值
  276. self.current_action.scope_force =
  277. XRXS.element_include?(set, XRXS19::AREA_EXTEND)     ? 2 :
  278. XRXS.element_include?(set, XRXS19::AREA_ACTOR)      ? 3 :
  279. XRXS.element_include?(set, XRXS19::AREA_ACTOR_ALL)  ? 4 :
  280. XRXS.element_include?(set, XRXS19::AREA_SELF)       ? 7 :
  281. XRXS.element_include?(set, XRXS19::AREA_WHOLE)      ? 8 :
  282. XRXS.element_include?(set, XRXS19::AREA_ENEMY_RAND) ? 9 :
  283. XRXS.element_include?(set, XRXS19::AREA_ACTOR_RAND) ? 10 :
  284. XRXS.element_include?(set, XRXS19::AREA_ALL_RAND)   ? 11 :
  285. 0
  286. # 诸刃
  287. self.current_action.self_inclusion = XRXS.element_include?(set, XRXS19::SELF_INCLUSION)
  288. # 自身以外
  289. self.current_action.self_exclusion = XRXS.element_include?(set, XRXS19::SELF_EXCLUSION)
  290. end
  291. #--------------------------------------------------------------------------
  292. # ● 新定义状态变化 (+) 发动状态适用
  293. #--------------------------------------------------------------------------
  294.   def pp_state(battler, i)
  295.     # 清除有效标志
  296.     effective = false
  297.       # 无法防御本状态的情况下
  298.       unless self.state_guard?(i)
  299.         # 这个状态如果不是 full 的话就设置有效标志
  300.         effective |= self.state_full?(i) == false
  301.         # 状态为 [不能抵抗] 的情况下
  302.         if $data_states[i].nonresistance
  303.           # 设置状态变化标志
  304.           @state_changed = true
  305.           # 附加状态
  306.           self.state_p[battler].push(i)
  307.         # 这个状态不是 full 的情况下
  308.         elsif self.state_full?(i) == false
  309.           # 将状态的有效度变换为概率、与随机数比较
  310.           if rand(100) < [0,100,80,60,40,20,0][self.state_ranks[i]]
  311.             # 设置状态变化标志
  312.             @state_changed = true
  313.             # ステートを付加
  314.             self.add_state(i)
  315.         end
  316.       end
  317.     end
  318.     # 过程结束
  319.     return effective
  320.   end
  321. #--------------------------------------------------------------------------
  322. # ● 可以使用特技的判定
  323. #    skill_id : 特技 ID
  324. #--------------------------------------------------------------------------
  325.   alias xrxs19_skill_can_use? skill_can_use?
  326.   def skill_can_use?(skill_id)
  327.   # 获取特技
  328.   @skill = $data_skills[skill_id]
  329.   # 范围计算
  330.   set_xrxs19_special_scope(self.skill_element_set(@skill))
  331.   $data_skills[skill_id].scope = self.current_action.scope_force if self.current_action.scope_force > 0
  332.     # 范围是「自身以外」的情况
  333.     if self.current_action.self_exclusion
  334.       # 获取战斗者
  335.       battlers = (self.is_a?(Game_Actor) ? $game_party.actors : $game_troop.enemies)
  336.       # 范围的分歧
  337.       case $data_skills[skill_id].scope
  338.       when 3,4,10
  339.         # 获取生存的战斗者数量
  340.         n = 0
  341.         battlers.each {|battler| n += 1 unless battler.dead?}
  342.       when 5,6
  343.         # 获取战斗者总数
  344.         n = battlers.size
  345.       else
  346.         n = 2
  347.       end
  348.       # 对象不存在的情况
  349.       return false if n <= 1
  350.     end
  351.     # recall
  352.     return xrxs19_skill_can_use?(skill_id)
  353.   end   
  354. #--------------------------------------------------------------------------
  355. # ● 判断状态 [无法回避攻击]
  356. #--------------------------------------------------------------------------
  357. alias xrxs19_cant_evade? cant_evade?
  358. def cant_evade?
  359. return true if @ignore_evade
  360. return xrxs19_cant_evade?
  361. end
  362. #--------------------------------------------------------------------------
  363. # ○ 特殊效果设置
  364. #--------------------------------------------------------------------------
  365.   def set_xrxs19_special_effect(set)
  366.     self.current_action.set_xrxs19_special_effect(set)
  367.   end
  368. #--------------------------------------------------------------------------
  369. # ● 应用通常攻击效果
  370. #    attacker : 攻击者 (battler)
  371. #--------------------------------------------------------------------------
  372.   alias xrxs19_attack_effect attack_effect
  373.   def attack_effect(attacker)   
  374.     # 特殊效果:忽视躲闪
  375.       if  attacker.current_action.ignore_evade
  376.       self.ignore_evade = true
  377.     end
  378.     return xrxs19_attack_effect(attacker)
  379.   end
  380. #--------------------------------------------------------------------------
  381. # ● 应用特技效果
  382. #     user  : 特技的使用者 (battler)
  383. #     skill : 特技
  384. #--------------------------------------------------------------------------
  385.   alias xrxs19_skill_effect skill_effect
  386.   def skill_effect(user, skill)
  387.     # 特殊效果:忽视躲闪
  388.     if  user.current_action.ignore_evade
  389.     self.ignore_evade = true
  390.   end
  391.     return xrxs19_skill_effect(user, skill)
  392.   end
  393. #------------------------------------------------------------------------------
  394. # ○ 伤害计算(属于对基本伤害的再处理)
  395. #------------------------------------------------------------------------------
  396. # ● 基础伤害计算请在“应用通常攻击效果” 和“应用特技效果”部分定义  
  397. #------------------------------------------------------------------------------
  398.   alias xrxs19co_x1_damage_effect damage_effect
  399.   def damage_effect(battler, item, skill)
  400.     # recall
  401.     if item == 2 or self.damage[battler].class == String
  402.       return xrxs19co_x1_damage_effect(battler, item)
  403.     end
  404.     # 初始化
  405.     battler.current_action.at_damage    = 0 if battler.current_action.at_damage.nil?#(1.03)
  406.     battler.current_action.hp_damage    = 0 if battler.current_action.hp_damage.nil?
  407.     battler.current_action.sp_damage    = 0 if battler.current_action.sp_damage.nil?
  408.     battler.current_action.hp_drain     = 0 if battler.current_action.hp_drain.nil?
  409.     battler.current_action.sp_drain     = 0 if battler.current_action.sp_drain.nil?
  410.     battler.current_action.critical_hit = 0 if battler.current_action.critical_hit.nil?
  411.     battler.current_action.add_variance = 0 if battler.current_action.add_variance.nil?
  412.     battler.current_action.fix_damage   = 0 if battler.current_action.fix_damage.nil?
  413.     battler.current_action.special_damage_kind = 0 if battler.current_action.special_damage_kind.nil?
  414.     battler.current_action.p_state = 0 if battler.current_action.p_state.nil?
  415.     battler.current_action.m_state = 0 if battler.current_action.m_state.nil?
  416.     battler.current_action.hp_correct = 0 if battler.current_action.hp_correct.nil?#(1.03)
  417.     battler.current_action.sp_correct = 0 if battler.current_action.sp_correct.nil?#(1.03)
  418.     # 解除忽视躲闪
  419.     self.ignore_evade = false         
  420.  
  421.     # 基本伤害
  422.     self.damage[battler] = self.damage[battler].to_i
  423.  
  424.  
  425.     # 特殊效果:追加分散度
  426.   if battler.current_action.add_variance > 0 and self.damage[battler].abs > 0
  427.   amp = [self.damage[battler].abs * battler.current_action.add_variance / 100, 1].max
  428.   self.damage[battler]  += rand(amp+1) + rand(amp+1) - amp
  429. end
  430.     # 特殊效果:现HP威力
  431.     if battler.current_action.hp_rate
  432. self.damage[battler] = self.damage[battler] * battler.hp / battler.maxhp
  433. end
  434.     # 特殊效果:现SP威力
  435.     if battler.current_action.sp_rate
  436. self.damage[battler] = self.damage[battler] * battler.sp / battler.maxsp
  437. end
  438.  
  439.     # 特殊效果:会心一击
  440.     if battler.current_action.critical_hit > 0
  441.   if self.critical[battler]
  442. self.critical[battler] = false      
  443. self.damage[battler] /= 2           
  444. end
  445.     # critical重新判定
  446.     if rand(100) < battler.current_action.critical_hit
  447. self.critical[battler] = true
  448. self.damage[battler] *= 2
  449. end
  450. end
  451.     # 特殊效果:固定伤害
  452.     if battler.current_action.fix_damage != 0
  453. self.damage[battler] = battler.current_action.fix_damage.to_i
  454. self.critical[battler] = false
  455. end
  456. #------------------------------------------------------------------------------
  457. # 特殊效果:追加伤害效果类计算
  458. #------------------------------------------------------------------------------
  459. case battler.current_action.special_damage_kind
  460.     when 1# 「目标方当前HP比例」
  461.       if skill != nil
  462.       self.damage[battler] += self.hp * skill.power / 100
  463.     else
  464.       self.damage[battler] += self.hp * battler.atk / 10000
  465.     end
  466. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPTA))/100
  467. when 2# 「目标方最大HP比例」
  468.       if skill != nil
  469.       self.damage[battler] += self.maxhp * skill.power / 100
  470.     else
  471.       self.damage[battler] += self.maxhp * battler.atk / 10000
  472.     end   
  473. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPTA))/100
  474.     when 3# 「目标方HP差值比例」
  475.       if skill != nil
  476.       self.damage[battler] += (self.maxhp - self.hp) * skill.power / 100
  477.     else
  478.       self.damage[battler] += (self.maxhp - self.hp) * battler.atk / 10000
  479.     end      
  480. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPTA))/100
  481.     when 4# 「使用者当前HP比例」
  482.       if skill != nil
  483.       self.damage[battler] += battler.hp * skill.power / 100
  484.     else
  485.       self.damage[battler] += battler.hp * battler.atk / 10000
  486.     end
  487. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPUS))/100   
  488.     when 5# 「使用者最大HP比例」
  489.       if skill != nil
  490.       self.damage[battler] += battler.maxhp * skill.power / 100
  491.     else
  492.       self.damage[battler] += battler.maxhp * battler.atk / 10000
  493.     end
  494. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPUS))/100
  495.     when 6# 「使用者HP差值比例」
  496.       if skill != nil
  497.       self.damage[battler] += (battler.maxhp - battler.hp) * skill.power / 100
  498.     else
  499.       self.damage[battler] += (battler.maxhp - battler.hp) * battler.atk / 10000
  500.     end      
  501. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPUS))/100   
  502.     when 7# 「目标方当前SP比例」
  503.       if skill != nil
  504.       self.damage[battler] += self.sp * skill.power / 100
  505.     else
  506.       self.damage[battler] += self.sp * battler.atk / 10000
  507.     end
  508. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPTA))/100
  509.     when 8# 「目标方最大SP比例」   
  510.       if skill != nil
  511.       self.damage[battler] += self.maxsp * skill.power / 100
  512.     else
  513.       self.damage[battler] += self.maxsp * battler.atk / 10000
  514.     end   
  515. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPTA))/100
  516.     when 9# 「目标方SP差值比例」      
  517.       if skill != nil
  518.       self.damage[battler] += (self.maxsp - self.sp) * skill.power / 100
  519.     else
  520.       self.damage[battler] += (self.maxsp - self.sp) * battler.atk / 10000
  521.     end   
  522. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPTA))/100
  523.     when 10# 「使用者当前SP比例」  
  524.       if skill != nil
  525.       self.damage[battler] += battler.sp * skill.power / 100
  526.     else
  527.       self.damage[battler] += battler.sp * battler.atk / 10000
  528.     end
  529. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPUS))/100
  530.     when 11# 「使用者最大SP比例」     
  531.       if skill != nil
  532.       self.damage[battler] += battler.maxsp * skill.power / 100
  533.     else
  534.       self.damage[battler] += battler.maxsp * battler.atk / 10000
  535.     end
  536. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPUS))/100
  537.     when 12# 「使用者SP差值比例」   
  538.       if skill != nil
  539.       self.damage[battler] += (battler.maxsp - battler.sp) * skill.power / 100
  540.     else
  541.       self.damage[battler] += (battler.maxsp - battler.sp) * battler.atk / 10000
  542.     end  
  543. self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPUS))/100
  544. end
  545. #------------------------------------------------------------------------------
  546. # 特殊效果:AT伤害值(1.03)
  547.   if battler.current_action.at_damage != 0
  548.   self.at -= battler.current_action.at_damage * self.maxat / 100
  549.   self.at  = 0 if self.at < 0
  550.   self.atp = 100 * self.at / self.maxat
  551. end
  552. # 特殊效果:HP伤害率
  553.   if battler.current_action.hp_damage != 0 and battler.current_action.sp_damage == 0
  554. self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
  555. end
  556. # 特殊效果:SP伤害率
  557.   if battler.current_action.sp_damage != 0
  558. self.damage_sp[battler] = self.damage[battler] * battler.current_action.sp_damage / 100
  559. self.damage_sp[battler] = self.sp if self.damage_sp[battler] > self.sp
  560. self.damage_sp[battler] = "" if self.sp == 0
  561. self.sp      -= self.damage_sp[battler] if self.damage_sp[battler] != ""
  562.   if battler.current_action.hp_damage != 0 # 特殊效果:HP伤害率
  563. self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
  564. else
  565. self.damage[battler] = ""
  566. end
  567. end
  568. #------------------------------------------------------------------------------
  569. # 特殊效果:收招修正(1.03)
  570. battler.hp = battler.current_action.hp_correct.to_i if battler.current_action.hp_correct != 0
  571. battler.sp = battler.current_action.sp_correct.to_i if battler.current_action.sp_correct != 0
  572. #------------------------------------------------------------------------------   
  573. # 特殊效果:HP吸收
  574. if battler.current_action.hp_drain != 0
  575.    battler.damage[battler] = 0 if battler.damage[battler] == nil
  576.    drain_point = -1 * self.damage[battler].to_i * battler.current_action.hp_drain / 100
  577.    battler.damage[battler] += drain_point
  578.    battler.hp -= drain_point
  579. if battler.damage[battler] == 0
  580.    battler.damage[battler] = nil
  581.   end
  582. end
  583. # 特殊效果:SP吸收
  584. if battler.current_action.sp_drain != 0
  585.    battler.damage_sp[battler] = 0 if battler.damage_sp[battler] == nil
  586.    drain_point = -1 * self.damage_sp[battler].to_i * battler.current_action.sp_drain / 100
  587.    battler.damage_sp[battler] += drain_point
  588.    battler.sp -= drain_point
  589.    battler.damage_sp[battler] = drain_point
  590. if battler.damage_sp[battler] == 0
  591.    battler.damage_sp[battler] = nil
  592.   end
  593. end
  594.     # recall
  595.     xrxs19co_x1_damage_effect(battler, item)
  596.   end
  597. end
  598.  
  599. #==============================================================================
  600. # ■ Scene_Battle
  601. #==============================================================================
  602. class Scene_Battle
  603. #------------------------------------------------------------------------------
  604. # ○ ATB_SETUP (ATB = AT Bar,意思不要和RTAB搞错)(1.03)
  605. #------------------------------------------------------------------------------
  606.   alias xrxs19_atb_setup atb_setup
  607.   def atb_setup
  608.     # recall
  609.     xrxs19_atb_setup
  610.     # 保存最大AT
  611.     for battler in $game_party.actors + $game_troop.enemies
  612.       battler.maxat = @max
  613.     end
  614.   end  
  615. #--------------------------------------------------------------------------
  616. # ● 主处理
  617. #--------------------------------------------------------------------------
  618.   alias xrxs19_main main
  619.   def main
  620.     # 清空角色的伤害值
  621.     for actor in $game_party.actors
  622.       actor.damage = nil
  623.     end
  624.     # recall
  625.     xrxs19_main
  626.     # 清空角色的特殊效果设置
  627.     for actor in $game_party.actors
  628.       actor.current_action.clear_xrxs19_special_effect
  629.       actor.current_action.nillize_xrxs19_special_effect
  630.     end
  631.   end
  632. #--------------------------------------------------------------------------
  633. # ● 刷新画面 (主回合步骤 1 : 准备行动)
  634. #--------------------------------------------------------------------------
  635.   alias xrxs19co_x1_update_phase4_step1 update_phase4_step1
  636.   def update_phase4_step1(battler)
  637.     # 清空行动者的伤害值
  638.     battler.damage.clear
  639.     # recall
  640.     xrxs19co_x1_update_phase4_step1(battler)
  641.   end
  642.  
  643. #--------------------------------------------------------------------------
  644. # ● 刷新画面 (主回合步骤 2 : 开始行动)
  645. #--------------------------------------------------------------------------
  646.   alias xrxs19_update_phase4_step2 update_phase4_step2
  647.   def update_phase4_step2(battler)
  648.     # 清空行动者的伤害值
  649.     battler.damage.clear
  650.     # recall
  651.     xrxs19_update_phase4_step2(battler)   
  652.   end
  653. #--------------------------------------------------------------------------
  654. # ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
  655. #(武器范围定义必须)
  656. #--------------------------------------------------------------------------
  657.   def update_phase3_enemy_select
  658.     # コマンド選択中に行動不能になった場合
  659.     unless @active_actor.inputable?
  660.       # カメラを元に戻す
  661.       if @camera == "select"
  662.         @spriteset.screen_target(0, 0, 1)
  663.       end
  664.       @active_actor.current_action.clear
  665.       command_delete
  666.       # 次のアクターのコマンド入力へ
  667.       phase3_next_actor
  668.       return
  669.     end
  670.     @active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
  671.     @active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
  672.   case @active_actor.current_action.scope_force
  673.   when 2,4,6,7,8,9,10,11
  674.         # アクションを設定
  675.         @active_actor.current_action.kind = 0
  676.         @active_actor.current_action.basic = 0
  677.         # スキルの選択を終了
  678.         end_enemy_select
  679.         # 次のアクターのコマンド入力へ
  680.         phase3_next_actor
  681.   when 3
  682.         # アクターアローを更新
  683.     @actor_arrow.update
  684.     # B ボタンが押された場合
  685.     if Input.trigger?(Input::B)
  686.       # キャンセル SE を演奏
  687.       $game_system.se_play($data_system.cancel_se)
  688.       # アクターの選択を終了
  689.       end_enemy_select
  690.       return
  691.     end
  692.     # C ボタンが押された場合
  693.     if Input.trigger?(Input::C)
  694.     # 決定 SE を演奏
  695.       $game_system.se_play($data_system.decision_se)
  696.       # アクションを設定
  697.       @active_actor.current_action.kind = 0
  698.       @active_actor.current_action.basic = 0
  699.       @active_actor.current_action.target_index = @actor_arrow.index
  700.       # アクターの選択を終了
  701.       end_enemy_select
  702.       # 次のアクターのコマンド入力へ
  703.         phase3_next_actor
  704.      end
  705.      else
  706.     # エネミーアローを更新
  707.     @enemy_arrow.update
  708.     # B ボタンが押された場合
  709.     if Input.trigger?(Input::B)
  710.       # キャンセル SE を演奏
  711.       $game_system.se_play($data_system.cancel_se)
  712.       # カメラを元に戻す
  713.       if @camera == "select"
  714.         # カメラの設定
  715.         @camera = "command"
  716.         plus = ($game_party.actors.size - 1) / 2.0 - @actor_index
  717.         y = [(plus.abs - 1.5) * 10 , 0].min
  718.         @spriteset.screen_target(plus * 50, y, 1.0 + y * 0.002)
  719.       end
  720.       # エネミーの選択を終了
  721.       end_enemy_select
  722.       return
  723.     end
  724.     # C ボタンが押された場合
  725.     if Input.trigger?(Input::C)
  726.       # 決定 SE を演奏
  727.       $game_system.se_play($data_system.decision_se)
  728.       # アクションを設定
  729.       @active_actor.current_action.kind = 0
  730.       @active_actor.current_action.basic = 0
  731.       @active_actor.current_action.target_index = @enemy_arrow.index
  732.       # スキルウィンドウ表示中の場合
  733.       if @skill_window != nil
  734.         # アクションを再設定
  735.         @active_actor.current_action.kind = 1
  736.         # スキルの選択を終了
  737.         end_skill_select
  738.       end
  739.       # アイテムウィンドウ表示中の場合
  740.       if @item_window != nil
  741.         # アクションを再設定
  742.         @active_actor.current_action.kind = 2
  743.         # アイテムの選択を終了
  744.         end_item_select
  745.       end
  746.       # エネミーの選択を終了
  747.       end_enemy_select
  748.       # 次のアクターのコマンド入力へ
  749.       phase3_next_actor
  750.       end
  751.     end
  752.   end
  753. #--------------------------------------------------------------------------
  754. # ● 开始选择敌人#(武器范围定义必须)(1.03修正显示BUG)
  755. #--------------------------------------------------------------------------
  756.   def start_enemy_select   
  757.     @active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
  758.     @active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
  759. if @active_actor.current_action.scope_force == 3
  760.    # 生成敌人箭头
  761.    @actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
  762.    # 关联帮助窗口
  763.     @actor_arrow.help_window = @help_window
  764.   else
  765.     # 生成敌人箭头
  766.      @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
  767.      # 关联帮助窗口
  768.     @enemy_arrow.help_window = @help_window
  769.     end
  770.     # 无效化角色指令窗口
  771.     @actor_command_window.active = false
  772.     @actor_command_window.visible = false
  773.   end
  774. #--------------------------------------------------------------------------
  775. # ● 结束选择敌人#武器范围定义必须)
  776. #--------------------------------------------------------------------------
  777.   def end_enemy_select
  778.     # 释放敌人箭头
  779.     @enemy_arrow.dispose if @enemy_arrow != nil
  780.     @actor_arrow.dispose if @actor_arrow != nil
  781.     @enemy_arrow = nil
  782.     @actor_arrow = nil
  783.     # 指令为 [战斗] 的情况下
  784.     if @actor_command_window.index == 0
  785.       # 有效化角色指令窗口
  786.       @actor_command_window.active = true
  787.       @actor_command_window.visible = true
  788.       # 隐藏帮助窗口
  789.       @help_window.visible = false
  790.     end
  791.   end
  792.   #--------------------------------------------------------------------------
  793.   # ● 基本アクション 準備#(武器范围定义必须)
  794.   #--------------------------------------------------------------------------
  795.   def make_basic_action_preparation(battler)
  796.     # 攻撃の場合
  797.     if battler.current_action.basic == 0
  798.       # アニメーション ID を設定
  799.       battler.anime1 = battler.animation1_id
  800.       battler.anime2 = battler.animation2_id
  801.       # 行動側バトラーがエネミーの場合
  802.       if battler.is_a?(Game_Enemy)
  803.         if battler.restriction == 3
  804.           target = $game_troop.random_target_enemy
  805.         elsif battler.restriction == 2
  806.           target = $game_party.random_target_actor
  807.         else
  808.           index = battler.current_action.target_index
  809.           target = $game_party.smooth_target_actor(index)
  810.         end
  811.       end
  812.       # 行動側バトラーがアクターの場合
  813. battler.set_xrxs19_special_scope(battler.equip_element_set)   
  814.       if battler.is_a?(Game_Actor)
  815.         if battler.restriction == 3
  816.           target = $game_party.random_target_actor
  817.         elsif battler.restriction == 2
  818.           target = $game_troop.random_target_enemy
  819.         elsif battler.current_action.scope_force == 3 # 己方单体
  820.           index = battler.current_action.target_index
  821.           target = $game_party.smooth_target_actor(index)
  822.         else
  823.  
  824.           index = battler.current_action.target_index
  825.           target = $game_troop.smooth_target_enemy(index)
  826.         end
  827.       end
  828.  
  829.       # 対象側バトラーの配列を設定
  830.     case  battler.current_action.scope_force
  831.     when 2 # 敌方全体
  832.         for enemy in $game_troop.enemies
  833.           if enemy.exist?
  834.             battler.target.push(enemy)
  835.           end
  836.         end
  837.     battler.target.push(battler) if battler.current_action.self_inclusion     
  838.     when 4 # 己方全体
  839.         for actor in $game_party.actors
  840.           if actor.exist?
  841.             battler.target.push(actor)
  842.           end
  843.         end
  844.     battler.target -=[battler] if battler.current_action.self_exclusion   
  845.     when 7  # 使用者
  846.       battler.target.push(battler)
  847.          when 8  # 全域化
  848.         for enemy in $game_troop.enemies
  849.           if enemy.exist?
  850.             battler.target.push(enemy)
  851.           end
  852.         end
  853.       for actor in $game_party.actors
  854.           if actor.exist?
  855.             battler.target.push(actor)
  856.           end
  857.         end
  858. battler.target -=[battler] if battler.current_action.self_exclusion
  859.      when 9  # 敌方随机        
  860.         for enemy in $game_troop.enemies
  861.           if enemy.exist?
  862.             battler.target = [$game_troop.random_target_enemy]
  863.           end
  864.         end
  865. battler.target.push(battler) if battler.current_action.self_inclusion
  866.       when 10  # 己方随机
  867.       for actor in $game_party.actors
  868.           if actor.exist?
  869.             battler.target.push(actor)
  870.           end
  871.         end      
  872. battler.target -=[battler] if battler.current_action.self_exclusion
  873. battler.target = [battler.target[rand(battler.target.size)]]
  874.         when 11 #对象随机
  875.       battler.target = []
  876.         for enemy in $game_troop.enemies
  877.           if enemy.exist?
  878.             battler.target.push(enemy)
  879.           end
  880.         end
  881.       for actor in $game_party.actors
  882.           if actor.exist?
  883.             battler.target.push(actor)
  884.           end
  885.         end
  886. battler.target -=[battler] if battler.current_action.self_exclusion
  887. battler.target = [battler.target[rand(battler.target.size)]]
  888. else
  889.       battler.target = [target]
  890. battler.target.push(battler) if battler.current_action.self_inclusion and
  891. battler.current_action.scope_force != 3 and
  892. battler.restriction != 2 and
  893. battler.restriction != 3
  894.       end
  895.       return true
  896.     end
  897.     # 防御の場合
  898.     if battler.current_action.basic == 1
  899.       # ステップ 3 に移行
  900.       battler.phase = 3
  901.       return false
  902.     end
  903. #===============0.15b(RTAB官方更新)===========================================   
  904.     # 逃げるの場合
  905.     if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  906.       # ステップ 3 に移行
  907.       battler.phase = 3
  908.       return false
  909.     end
  910. #=============================================================================
  911.     # 何もしないの場合
  912.     if battler.current_action.basic == 3
  913.       # ステップ 6 に移行
  914.       battler.phase = 6
  915.       return false
  916.     end
  917.   end  
  918. #--------------------------------------------------------------------------
  919. # ● 生成基本行动结果
  920. #--------------------------------------------------------------------------
  921.   alias xrxs19_make_basic_action_result make_basic_action_result
  922.    def make_basic_action_result(battler)
  923.     # 攻击的情况
  924.     if battler.current_action.basic == 0
  925.       # 获取行动者武器附加的战斗特效
  926.       if battler.is_a?(Game_Actor)
  927.         battler.set_xrxs19_special_effect(battler.equip_element_set)
  928.       # 行动时附加自身状态
  929.         if battler.current_action.p_state > 0
  930.         battler.pp_state(battler,battler.current_action.p_state)
  931.       end
  932.       # 行动时解除自身状态
  933.       if battler.current_action.m_state > 0
  934.         battler.remove_state(battler.current_action.m_state)
  935.       end
  936.       end
  937. end
  938.     # recall
  939.     xrxs19_make_basic_action_result(battler)
  940.   end
  941.   #--------------------------------------------------------------------------
  942.   # ● スキルまたはアイテムの対象側バトラー設定
  943.   #     scope : スキルまたはアイテムの効果範囲
  944.   # (武器范围定义必须)特技/道具的范围定义
  945.   #--------------------------------------------------------------------------
  946.   def set_target_battlers(scope, battler)
  947.     #行动方战斗者是敌方的情况
  948.     if battler.is_a?(Game_Enemy)
  949.      # 效果范围的分歧
  950.       case scope
  951.       when 1  # 敌单体
  952. battler.target.push(battler) if battler.current_action.self_inclusion           
  953.         index =battler.current_action.target_index
  954.         battler.target.push($game_party.smooth_target_actor(index))
  955.  
  956.       when 2  # 敌全体
  957. battler.target.push(battler) if battler.current_action.self_inclusion   
  958.         for actor in $game_party.actors
  959.           if actor.exist?
  960.             battler.target.push(actor)
  961.           end
  962.         end
  963.  
  964.       when 3  # 己方单体
  965.  
  966.         index = battler.current_action.target_index
  967.         battler.target.push($game_troop.smooth_target_enemy(index))
  968.  
  969.       when 4  # 己方全体
  970.         for enemy in $game_troop.enemies
  971.           if enemy.exist?
  972.             battler.target.push(enemy)
  973.           end
  974.         end
  975. battler.target -=[battler] if battler.current_action.self_exclusion        
  976.       when 5  # 己方单体 (HP 0)   
  977.  
  978.         index = battler.current_action.target_index
  979.         enemy = $game_troop.enemies[index]
  980.         if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
  981.           battler.target.push(enemy)
  982.         end
  983.  
  984.       when 6  # 己方全体 (HP 0)
  985.         for enemy in $game_troop.enemies
  986.           if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
  987.             battler.target.push(enemy)
  988.           end
  989.         end
  990. battler.target -=[battler] if battler.current_action.self_exclusion        
  991.       when 7  # 使用者
  992.         battler.target.push(battler)
  993.       when 8  # 全域化
  994.         for enemy in $game_troop.enemies
  995.           if enemy.exist?
  996.             battler.target.push(enemy)
  997.           end
  998.         end
  999.       for actor in $game_party.actors
  1000.           if actor.exist?
  1001.             battler.target.push(actor)
  1002.           end
  1003.         end
  1004. battler.target -=[battler] if battler.current_action.self_exclusion        
  1005.      when 9  # 敌方随机
  1006. battler.target.push(battler) if battler.current_action.self_inclusion        
  1007.              for actor in $game_party.actors
  1008.           if actor.exist?
  1009.             battler.target = [$game_party.random_target_actor]
  1010.           end
  1011.         end
  1012.  
  1013.           when 10  # 己方随机
  1014.         for enemy in $game_troop.enemies
  1015.           if enemy.exist?
  1016.             battler.target.push(enemy)
  1017.           end
  1018.         end
  1019. battler.target -=[battler] if battler.current_action.self_exclusion
  1020. battler.target = [battler.target[rand(battler.target.size)]]
  1021.         when 11 #对象随机
  1022.       battler.target = []
  1023.         for enemy in $game_troop.enemies
  1024.           if enemy.exist?
  1025.             battler.target.push(enemy)
  1026.           end
  1027.         end
  1028.       for actor in $game_party.actors
  1029.           if actor.exist?
  1030.             battler.target.push(actor)
  1031.           end
  1032.         end
  1033. battler.target -=[battler] if battler.current_action.self_exclusion        
  1034. battler.target = [battler.target[rand(battler.target.size)]]         
  1035.       end
  1036.     end
  1037.  
  1038.  
  1039.     #行动方战斗者是己方的情况
  1040.     if battler.is_a?(Game_Actor)
  1041.       # 效果范围的分歧
  1042.       case scope
  1043.       when 1  # 敌单体
  1044.  
  1045.         index = battler.current_action.target_index
  1046.         battler.target.push($game_troop.smooth_target_enemy(index))
  1047. battler.target.push(battler) if battler.current_action.self_inclusion         
  1048.       when 2  # 敌全体
  1049.  
  1050.         for enemy in $game_troop.enemies
  1051.           if enemy.exist?
  1052.             battler.target.push(enemy)
  1053.           end
  1054.         end
  1055. battler.target.push(battler) if battler.current_action.self_inclusion        
  1056.       when 3  # 己方单体
  1057.  
  1058.         index = battler.current_action.target_index
  1059.         battler.target.push($game_party.smooth_target_actor(index))
  1060.  
  1061.       when 4  # 己方全体
  1062.         for actor in $game_party.actors
  1063.           if actor.exist?
  1064.             battler.target.push(actor)
  1065.           end
  1066.         end
  1067. battler.target -=[battler] if battler.current_action.self_exclusion        
  1068.       when 5  # 己方单体 (HP 0)
  1069.  
  1070.         index = battler.current_action.target_index
  1071.         actor = $game_party.actors[index]
  1072.         if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
  1073.           battler.target.push(actor)
  1074.         end
  1075.  
  1076.       when 6  # 己方全体 (HP 0)
  1077.         for actor in $game_party.actors
  1078.           if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
  1079.             battler.target.push(actor)
  1080.           end
  1081.         end
  1082. battler.target -=[battler] if battler.current_action.self_exclusion        
  1083.       when 7  # 使用者
  1084.         battler.target.push(battler)
  1085.       when 8  # 全域化
  1086.         for enemy in $game_troop.enemies
  1087.           if enemy.exist?
  1088.             battler.target.push(enemy)
  1089.           end
  1090.         end
  1091.       for actor in $game_party.actors
  1092.           if actor.exist?
  1093.             battler.target.push(actor)
  1094.           end
  1095.         end            
  1096. battler.target -=[battler] if battler.current_action.self_exclusion
  1097.      when 9  # 敌方随机
  1098.  
  1099.         for enemy in $game_troop.enemies
  1100.           if enemy.exist?
  1101.             battler.target = [$game_troop.random_target_enemy]
  1102.           end
  1103.         end
  1104. battler.target.push(battler) if battler.current_action.self_inclusion         
  1105.       when 10  # 己方随机
  1106.       for actor in $game_party.actors
  1107.           if actor.exist?
  1108.             battler.target.push(actor)
  1109.           end
  1110.         end      
  1111. battler.target -=[battler] if battler.current_action.self_exclusion
  1112. battler.target = [battler.target[rand(battler.target.size)]]
  1113.         when 11 #对象随机
  1114.       battler.target = []
  1115.         for enemy in $game_troop.enemies
  1116.           if enemy.exist?
  1117.             battler.target.push(enemy)
  1118.           end
  1119.         end
  1120.       for actor in $game_party.actors
  1121.           if actor.exist?
  1122.             battler.target.push(actor)
  1123.           end
  1124.         end
  1125. battler.target -=[battler] if battler.current_action.self_exclusion
  1126. battler.target = [battler.target[rand(battler.target.size)]]
  1127. end
  1128. end
  1129. end   
  1130. #--------------------------------------------------------------------------
  1131. # ● 生成特技行动结果
  1132. #--------------------------------------------------------------------------
  1133.   alias xrxs19_make_skill_action_result make_skill_action_result
  1134.     def make_skill_action_result(battler, plus_id)
  1135.     # 获取特技
  1136.     @skill = $data_skills[battler.current_action.skill_id + plus_id]
  1137.     # 获取行动者特技附加的战斗特效
  1138.     battler.set_xrxs19_special_effect(battler.skill_element_set(@skill))
  1139.     # 行动时附加自身状态
  1140.           if battler.current_action.p_state > 0
  1141.         battler.pp_state(battler,battler.current_action.p_state)
  1142.       end
  1143.     # 行动时解除自身状态  
  1144.       if battler.current_action.m_state > 0
  1145.         battler.remove_state(battler.current_action.m_state)
  1146.       end
  1147.     # recall
  1148.     xrxs19_make_skill_action_result(battler, plus_id)
  1149.   end
  1150. #--------------------------------------------------------------------------
  1151. # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  1152. #--------------------------------------------------------------------------
  1153.   alias xrxs19_update_phase4_step5 update_phase4_step5
  1154.   def update_phase4_step5(battler)
  1155.     # recall
  1156.     xrxs19_update_phase4_step5(battler)
  1157.     # 行动者伤害表示(HP/SP吸收的表示用)
  1158.     if battler.damage[battler] != nil or
  1159.        battler.damage_sp[battler] != nil
  1160.        battler.damage_pop[battler] = true
  1161.     # 行动者状态栏刷新
  1162.       status_refresh(battler)
  1163.     end
  1164.   end
  1165. end
  1166. #==============================================================================
  1167. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1168. #==============================================================================


使用的战斗系统是
RTAB战斗系统 Ver 1.16
RUBY 代码复制
  1. # リアルタイム・アクティブバトル(RTAB) Ver 1.16
  2. # 配布元・サポートURL
  3. # [url]http://members.jcom.home.ne.jp/cogwheel/[/url]
  4.  
  5. class Scene_Battle
  6.   #--------------------------------------------------------------------------
  7.   # ● 公開インスタンス変数
  8.   #--------------------------------------------------------------------------
  9.   attr_reader   :status_window            # ステータスウィンドウ
  10.   attr_reader   :spriteset                # バトルスプライト
  11.   attr_reader   :scroll_time              # スクリーン移動基本時間
  12.   attr_reader   :zoom_rate                # 敵バトラー基本位置
  13.   attr_reader   :drive                    # カメラ駆動
  14.   attr_accessor :force                    # アクション強制度
  15.   attr_accessor :camera                   # 現在のカメラ所持者
  16.   #--------------------------------------------------------------------------
  17.   # ● ATB基礎セットアップ
  18.   #--------------------------------------------------------------------------
  19.   def atb_setup
  20.     # ATB初期化
  21.     # speed   : バトルスピード決定。値が小さいほど早い
  22.     # @active : アクティブ度設定
  23.     #           3 : 常にアクティブ状態
  24.     #           2 : スキル・アイテム選択中のみアクティブゲージが止まる
  25.     #           1 : 2の状態に加え、ターゲット選択時もウェイトが掛かる
  26.     #           0 : 1の状態に加え、コマンド入力時にもウェイトが掛かる
  27.     # @action : 他人が行動中に自分も行動を起こすことを許すか
  28.     #           3 : 自分が行動不能でない限り限り許す
  29.     #           2 : 自分がダメージを受けていない限り許す
  30.     #           1 : 2の状態に加え、ターゲットが行動していない限り許す
  31.     #           0 : 行動を許さない。順番に行動し終えるまで待つ
  32.     # @anime_wait : trueにするとバトルアニメ・ダメージ表示中はウェイトが掛かる
  33.     # @damage_wait : ダメージ表示待ち時間(単位はフレーム)
  34.     # @after_wait : 味方・敵全滅時、次の処理に移るまでの待ち時間
  35.     #               [a, b] a は味方全滅時、b は敵全滅時(単位はフレーム)
  36.     # @enemy_speed : 敵の思考速度。1なら即時行動。
  37.     #                1フレーム毎に、1/@enemy_speedの確率で行動を起こす
  38.     # @force : 強制アクションでスキル使用時の強制具合
  39.     #          2:スキルは全て詠唱せず、必ず即時実行
  40.     #          1:単独スキルは詠唱し、連携スキルのみ即時実行
  41.     #          0:全スキル詠唱を行うだけ
  42.     # ($scene.force = x とすることにより、通常イベントのスクリプトから変更可能)
  43.     # @drive : カメラ駆動ON/OFF。trueで駆動ON、falseで駆動OFF
  44.     # @scroll_time : スクリーン移動に要する基本時間
  45.     # @zoom_rate = [i, j] : エネミーのズーム率
  46.     #                       i が画面最上部に配置した時の拡大率
  47.     #                       j が画面最下部に配置した時の拡大率
  48.     #                       1 倍としたいときも、1.0 と必ず小数で設定すること
  49.     speed = 150
  50.     @active = 1
  51.     @action = 0
  52.     @anime_wait = false
  53.     @damage_wait = 10
  54.     @after_wait = [80, 0]
  55.     @enemy_speed = 40
  56.     @force = 2
  57.     @drive = true
  58.     @scroll_time = 15
  59.     @zoom_rate = [0.2, 1.0]
  60.     @help_time = 40
  61.     @escape == false
  62.     @camera = nil
  63.     @max = 0
  64.     @turn_cnt = 0
  65.     @help_wait = 0
  66.     @action_battlers = []
  67.     @synthe = []
  68.     @spell_p = {}
  69.     @spell_e = {}
  70.     @command_a = false
  71.     @command = []
  72. #------------------------------------------------------------------------------   
  73. #RTAB观光游第一站,去除“战斗/逃跑”选项部分   
  74. #    @party = false
  75. #------------------------------------------------------------------------------
  76.     for battler in $game_party.actors + $game_troop.enemies
  77.       spell_reset(battler)
  78.       battler.at = battler.agi * rand(speed / 2)
  79.       battler.damage_pop = {}
  80.       battler.damage = {}
  81.       battler.damage_sp = {}
  82.       battler.critical = {}
  83.       battler.recover_hp = {}
  84.       battler.recover_sp = {}
  85.       battler.state_p = {}
  86.       battler.state_m = {}
  87.       battler.animation = []
  88.       if battler.is_a?(Game_Actor)
  89.         @max += battler.agi
  90.       end
  91.     end
  92.     @max *= speed
  93.     @max /= $game_party.actors.size
  94.     for battler in $game_party.actors + $game_troop.enemies
  95.       battler.atp = 100 * battler.at / @max
  96.     end
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ● ATゲージMax時SE
  100.   #--------------------------------------------------------------------------
  101.   def fullat_se
  102.     Audio.se_play("Audio/SE/033-switch02", 80, 100)
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # ● レベルアップSE
  106.   #--------------------------------------------------------------------------
  107.   def levelup_se
  108.     Audio.se_play("Audio/SE/056-Right02", 80, 100)
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ● スキル習得SE
  112.   #--------------------------------------------------------------------------
  113.   def skill_se
  114.     Audio.se_play("Audio/SE/056-Right02", 80, 150)
  115.   end
  116. end
  117.  
  118. class Window_Base < Window
  119.   #--------------------------------------------------------------------------
  120.   # ● ATG の描画
  121.   #     actor : アクター
  122.   #     x     : 描画先 X 座標
  123.   #     y     : 描画先 Y 座標
  124.   #     width : 描画先の幅
  125.   #--------------------------------------------------------------------------
  126.   def draw_actor_atg(actor, x, y, width = 144)
  127.     if @at_gauge == nil
  128.       # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
  129.       # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
  130.       # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
  131.       # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
  132.       # align3:ゲージタイプ 0:左詰め 1:右詰め
  133.       @plus_x = 0
  134.       @rate_x = 0
  135.       @plus_y = 16
  136.       @plus_width = 0
  137.       @rate_width = 100
  138.       @width = @plus_width + width * @rate_width / 100
  139.       @height = 16
  140.       @align1 = 0
  141.       @align2 = 1
  142.       @align3 = 0
  143.       # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
  144.       # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション)
  145.       grade1 = 1
  146.       grade2 = 0
  147.       # 色設定。color1:最外枠,color2:中枠
  148.       # color3:空枠ダークカラー,color4:空枠ライトカラー
  149.       color1 = Color.new(0, 0, 0)
  150.       color2 = Color.new(255, 255, 192)
  151.       color3 = Color.new(0, 0, 0, 192)
  152.       color4 = Color.new(0, 0, 64, 192)
  153.       # ゲージの色設定
  154.       # 通常時の色設定
  155.       color5 = Color.new(0, 64, 80)
  156.       color6 = Color.new(0, 128, 160)
  157.       # ゲージがMAXの時の色設定
  158.       color7 = Color.new(80, 0, 0)
  159.       color8 = Color.new(240, 0, 0)
  160.       # 連携スキル使用時の色設定
  161.       color9 = Color.new(80, 64, 32)
  162.       color10 = Color.new(240, 192, 96)
  163.       # スキル詠唱時の色設定
  164.       color11 = Color.new(80, 0, 64)
  165.       color12 = Color.new(240, 0, 192)
  166.       # ゲージの描画
  167.       gauge_rect_at(@width, @height, @align3, color1, color2,
  168.                   color3, color4, color5, color6, color7, color8,
  169.                   color9, color10, color11, color12, grade1, grade2)
  170.     end
  171.     # 変数atに描画するゲージの幅を代入
  172.     if actor.rtp == 0
  173.       at = (width + @plus_width) * actor.atp * @rate_width / 10000
  174.     else
  175.       at = (width + @plus_width) * actor.rt * @rate_width / actor.rtp / 100
  176.     end
  177.     if at > width
  178.       at = width
  179.     end
  180.     # ゲージの左詰・中央構え等の補正
  181.     case @align1
  182.     when 1
  183.       x += (@rect_width - width) / 2
  184.     when 2
  185.       x += @rect_width - width
  186.     end
  187.     case @align2
  188.     when 1
  189.       y -= @height / 2
  190.     when 2
  191.       y -= @height
  192.     end
  193.     self.contents.blt(x + @plus_x + width * @rate_x / 100, y + @plus_y,
  194.                       @at_gauge, Rect.new(0, 0, @width, @height))
  195.     if @align3 == 0
  196.       rect_x = 0
  197.     else
  198.       x += @width - at - 1
  199.       rect_x = @width - at - 1
  200.     end
  201.     # ゲージの色設定
  202.     if at == width
  203.         # MAX時のゲージ描画
  204.       self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
  205.                         @at_gauge, Rect.new(rect_x, @height * 2, at, @height))
  206.     else
  207.       if actor.rtp == 0
  208.         # 通常時のゲージ描画
  209.         self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
  210.                           @at_gauge, Rect.new(rect_x, @height, at, @height))
  211.       else
  212.         if actor.spell == true
  213.           # 連携スキル使用時のゲージ描画
  214.           self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
  215.                         @at_gauge, Rect.new(rect_x, @height * 3, at, @height))
  216.         else
  217.           # スキル詠唱時のゲージ描画
  218.           self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
  219.                         @at_gauge, Rect.new(rect_x, @height * 4, at, @height))
  220.         end
  221.       end
  222.     end
  223.   end
  224. end
  225.  
  226. #==============================================================================
  227. # ■ Scene_Battle (分割定義 1)
  228. #------------------------------------------------------------------------------
  229. #  バトル画面の処理を行うクラスです。
  230. #==============================================================================
  231.  
  232. class Scene_Battle
  233.   #--------------------------------------------------------------------------
  234.   # ● メイン処理
  235.   #--------------------------------------------------------------------------
  236.   def main
  237.     # 戦闘用の各種一時データを初期化
  238.    # Graphics.frame_rate = 60
  239.     $game_temp.in_battle = true
  240.     $game_temp.battle_turn = 0
  241.     $game_temp.battle_event_flags.clear
  242.     $game_temp.battle_abort = false
  243.     $game_temp.battle_main_phase = false
  244.     $game_temp.battleback_name = $game_map.battleback_name
  245.     $game_temp.forcing_battler = nil
  246.     # バトルイベント用インタプリタを初期化
  247.     $game_system.battle_interpreter.setup(nil, 0)
  248.     # トループを準備
  249.     @troop_id = $game_temp.battle_troop_id
  250.     $game_troop.setup(@troop_id)
  251.     atb_setup
  252.     # アクターコマンドウィンドウを作成
  253. #==============================================================================
  254. #RTAB观光游第三站,战斗菜单增加逃跑选项
  255. #==============================================================================   
  256.     s1 = $data_system.words.attack
  257.     s2 = $data_system.words.skill
  258.     s3 = $data_system.words.guard
  259.     s4 = $data_system.words.item
  260.     s5 = "逃跑"
  261.     @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4,s5])   
  262. #   @actor_command_window.y = 160
  263.     @actor_command_window.y = 128
  264.     @actor_command_window.back_opacity = 160
  265.     @actor_command_window.active = false
  266.     @actor_command_window.visible = false
  267. #==============================================================================   
  268.     # その他のウィンドウを作成
  269. #------------------------------------------------------------------------------
  270. #RTAB观光游第一站,去除“战斗/逃跑”选项部分   
  271. #    @party_command_window = Window_PartyCommand.new
  272. #------------------------------------------------------------------------------   
  273.     @help_window = Window_Help.new
  274.     @help_window.back_opacity = 160
  275.     @help_window.visible = false
  276.     @status_window = Window_BattleStatus.new
  277.     @message_window = Window_Message.new
  278.     # スプライトセットを作成
  279.     @spriteset = Spriteset_Battle.new
  280.     # ウェイトカウントを初期化
  281.     @wait_count = 0
  282.     # トランジション実行
  283.     if $data_system.battle_transition == ""
  284.       Graphics.transition(20)
  285.     else
  286.       Graphics.transition(40, "Graphics/Transitions/" +
  287.         $data_system.battle_transition)
  288.     end
  289.     # プレバトルフェーズ開始
  290.     start_phase1
  291.     # メインループ
  292.     loop do
  293.       # ゲーム画面を更新
  294.       Graphics.update
  295.       # 入力情報を更新
  296.       Input.update
  297.       # フレーム更新
  298.       update
  299.       # 画面が切り替わったらループを中断
  300.       if $scene != self
  301.         break
  302.       end
  303.     end
  304.     # マップをリフレッシュ
  305.     $game_map.refresh
  306.     # トランジション準備
  307.     Graphics.freeze
  308.     # ウィンドウを解放
  309.     @actor_command_window.dispose
  310. #------------------------------------------------------------------------------
  311. #RTAB观光游第一站,去除“战斗/逃跑”选项部分   
  312. #    @party_command_window.dispose
  313. #------------------------------------------------------------------------------   
  314.     @help_window.dispose
  315.     @status_window.dispose
  316.     @message_window.dispose
  317.     if @skill_window != nil
  318.       @skill_window.dispose
  319.     end
  320.     if @item_window != nil
  321.       @item_window.dispose
  322.     end
  323.     if @result_window != nil
  324.       @result_window.dispose
  325.     end
  326.     # スプライトセットを解放
  327.     @spriteset.dispose
  328.     # タイトル画面に切り替え中の場合
  329.     if $scene.is_a?(Scene_Title)
  330.       # 画面をフェードアウト
  331.       Graphics.transition
  332.       Graphics.freeze
  333.     end
  334.     # 戦闘テストからゲームオーバー画面以外に切り替え中の場合
  335.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  336.       $scene = nil
  337.     end
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # ● 勝敗判定
  341.   #--------------------------------------------------------------------------
  342.   def judge
  343.     # 全滅判定が真、またはパーティ人数が 0 人の場合
  344.     if $game_party.all_dead? or $game_party.actors.size == 0
  345.       # 敗北可能の場合
  346.       if $game_temp.battle_can_lose
  347.         # バトル開始前の BGM に戻す
  348.         $game_system.bgm_play($game_temp.map_bgm)
  349.         # バトル終了
  350.         battle_end(2)
  351.         # true を返す
  352.         return true
  353.       end
  354.       # ゲームオーバーフラグをセット
  355.       $game_temp.gameover = true
  356.       # true を返す
  357.       return true
  358.     end
  359.     # エネミーが 1 体でも存在すれば false を返す
  360.     for enemy in $game_troop.enemies
  361.       if enemy.exist?
  362.         return false
  363.       end
  364.     end
  365.     # アフターバトルフェーズ開始 (勝利)
  366.     start_phase5
  367.     # true を返す
  368.     return true
  369.   end
  370.   #--------------------------------------------------------------------------
  371.   # ● フレーム更新
  372.   #--------------------------------------------------------------------------
  373.   def update
  374.     # バトルイベント実行中の場合
  375.     if $game_system.battle_interpreter.running?
  376.       if @command.size > 0
  377.         @command_a = false
  378.         @command = []
  379.         command_delete
  380.       end
  381.       @status_window.at_refresh
  382.       # インタプリタを更新
  383.       $game_system.battle_interpreter.update
  384.       # アクションを強制されているバトラーが存在しない場合
  385.       if $game_temp.forcing_battler == nil
  386.         # バトルイベントの実行が終わった場合
  387.         unless $game_system.battle_interpreter.running?
  388.           # バトルイベントのセットアップを再実行
  389.           @status_window.refresh
  390.           setup_battle_event
  391.         end
  392.       end
  393.     end
  394.     # システム (タイマー)、画面を更新
  395.     $game_system.update
  396.     $game_screen.update
  397.     # タイマーが 0 になった場合
  398.     if $game_system.timer_working and $game_system.timer == 0
  399.       # バトル中断
  400.       $game_temp.battle_abort = true
  401.     end
  402.     # ウィンドウを更新
  403.     @help_window.update
  404. #------------------------------------------------------------------------------
  405. #RTAB观光游第一站,去除“战斗/逃跑”选项部分   
  406. #    @party_command_window.update
  407. #------------------------------------------------------------------------------
  408.     @actor_command_window.update
  409.     @status_window.update
  410.     @message_window.update
  411.     # スプライトセットを更新
  412.     @spriteset.update
  413.     # トランジション処理中の場合
  414.     if $game_temp.transition_processing
  415.       # トランジション処理中フラグをクリア
  416.       $game_temp.transition_processing = false
  417.       # トランジション実行
  418.       if $game_temp.transition_name == ""
  419.         Graphics.transition(20)
  420.       else
  421.         Graphics.transition(40, "Graphics/Transitions/" +
  422.           $game_temp.transition_name)
  423.       end
  424.     end
  425.     # メッセージウィンドウ表示中の場合
  426.     if $game_temp.message_window_showing
  427.       return
  428.     end
  429.     # ゲームオーバーの場合
  430.     if $game_temp.gameover
  431.       # ゲームオーバー画面に切り替え
  432.       $scene = Scene_Gameover.new
  433.       return
  434.     end
  435.     # タイトル画面に戻す場合
  436.     if $game_temp.to_title
  437.       # タイトル画面に切り替え
  438.       $scene = Scene_Title.new
  439.       return
  440.     end
  441.     # バトル中断の場合
  442.     if $game_temp.battle_abort
  443.       # バトル開始前の BGM に戻す
  444.       $game_system.bgm_play($game_temp.map_bgm)
  445.       # バトル終了
  446.       battle_end(1)
  447.       return
  448.     end
  449.     # ヘルプウィンドウ表示中の場合
  450.     if @help_wait > 0
  451.       @help_wait -= 1
  452.       if @help_wait == 0
  453.         # ヘルプウィンドウを隠す
  454.         @help_window.visible = false
  455.       end
  456.     end
  457.     # アクションを強制されているバトラーが存在せず、
  458.     # かつバトルイベントが実行中の場合
  459.     if $game_temp.forcing_battler == nil and
  460.        $game_system.battle_interpreter.running?
  461.       return
  462.     end
  463.     # フェーズによって分岐
  464.     case @phase
  465.     when 0  # ATゲージ更新フェーズ
  466.       if anime_wait_return
  467.         update_phase0
  468.       end
  469.     when 1  # プレバトルフェーズ
  470.       update_phase1
  471.       return
  472.     when 2  # パーティコマンドフェーズ
  473.       update_phase2
  474.       return
  475.     when 5  # アフターバトルフェーズ
  476.       update_phase5
  477.       return
  478.     end
  479.     if $scene != self
  480.       return
  481.     end
  482.     if @phase == 0
  483.       if @command.size != 0  # アクターコマンドフェーズ
  484.         if @command_a == false
  485.           start_phase3
  486.         end
  487.         update_phase3
  488.       end
  489.       # ウェイト中の場合
  490.       if @wait_count > 0
  491.         # ウェイトカウントを減らす
  492.         @wait_count -= 1
  493.         return
  494.       end
  495.       update_phase4
  496.     end
  497.   end
  498.  
  499. #==============================================================================
  500. # ■ Scene_Battle (分割定義 2)
  501. #------------------------------------------------------------------------------
  502. #  バトル画面の処理を行うクラスです。
  503. #==============================================================================
  504.  
  505.   #--------------------------------------------------------------------------
  506.   # ● フレーム更新 (ATゲージ更新フェーズ)
  507.   #--------------------------------------------------------------------------
  508.   def update_phase0
  509.     if $game_temp.battle_turn == 0
  510.       $game_temp.battle_turn = 1
  511.     end
  512.     # B ボタンが押された場合
  513.   #  if @command_a == false and @party == false
  514.    #   if Input.trigger?(Input::B)
  515.         # キャンセル SE を演奏
  516.    #     $game_system.se_play($data_system.cancel_se)
  517.    #     @party = true
  518.    #   end
  519.    # end
  520.    # if @party == true and
  521.    #     ((@action > 0 and @action_battlers.empty?) or (@action == 0 and
  522.    #     (@action_battlers.empty? or @action_battlers[0].phase == 1)))
  523.       # パーティコマンドフェーズへ
  524.    #   start_phase2
  525.    #   return
  526.    # end
  527.     # ATゲージ増加処理
  528.     cnt = 0
  529.     for battler in $game_party.actors + $game_troop.enemies
  530.       active?(battler)
  531.       if battler.rtp == 0
  532.         if battler.at >= @max
  533.           if battler.is_a?(Game_Actor)
  534.             if battler.inputable?
  535.               unless @action_battlers.include?(battler) or
  536.                   @command.include?(battler) or @escape == true
  537.                 if battler.current_action.forcing
  538.                   fullat_se
  539.                   force_action(battler)
  540.                   action_start(battler)
  541.                 else
  542.                   fullat_se
  543.                   @command.push(battler)
  544.                 end
  545.               end
  546.             else
  547.               unless @action_battlers.include?(battler) or
  548.                       battler == @command[0]
  549.                 battler.current_action.clear
  550.                 if @command.include?(battler)
  551.                   @command.delete(battler)
  552.                 else
  553.                   if battler.movable?
  554.                     fullat_se
  555.                   end
  556.                 end
  557.                 action_start(battler)
  558.               end
  559.             end
  560.           else
  561.             unless @action_battlers.include?(battler)
  562.               if battler.current_action.forcing
  563.                 force_action(battler)
  564.                 action_start(battler)
  565.               else
  566.                 if @enemy_speed != 0
  567.                   if rand(@enemy_speed) == 0
  568.                     number = cnt - $game_party.actors.size
  569.                     enemy_action(number)
  570.                   end
  571.                 else
  572.                   number = cnt - $game_party.actors.size
  573.                   enemy_action(number)
  574.                 end
  575.               end
  576.             end
  577.           end
  578.         else
  579.           battler.at += battler.agi
  580.           if battler.guarding?
  581.             battler.at += battler.agi
  582.           end
  583.           if battler.movable?
  584.             battler.atp = 100 * battler.at / @max
  585.           end
  586.         end
  587.       else
  588.         if battler.rt >= battler.rtp
  589.           speller = synthe?(battler)
  590.           if speller != nil
  591.             battler = speller[0]
  592.           end
  593.           unless @action_battlers.include?(battler)
  594.             if battler.is_a?(Game_Actor)
  595.               fullat_se
  596.             end
  597.             battler.rt = battler.rtp
  598.             action_start(battler)
  599.           end
  600.         else
  601.           battler.rt += battler.agi
  602.           speller = synthe?(battler)
  603.           if speller != nil
  604.             for spell in speller
  605.               if spell != battler
  606.                 spell.rt += battler.agi
  607.               end
  608.             end
  609.           end
  610.         end
  611.       end
  612.       cnt += 1
  613.     end
  614.     # ATゲージをリフレッシュ
  615.     @status_window.at_refresh
  616.     # 逃走処理
  617.     if @escape == true and
  618.         ((@action > 0 and @action_battlers.empty?) or (@action == 0 and
  619.         (@action_battlers.empty? or @action_battlers[0].phase == 1)))
  620.       temp = false
  621.       for battler in $game_party.actors
  622.         if battler.inputable?
  623.           temp = true
  624.         end
  625.       end
  626.       if temp == true
  627.         for battler in $game_party.actors
  628.           if battler.at < @max and battler.inputable?
  629.             temp = false
  630.             break
  631.           end
  632.         end
  633.         if temp == true
  634.           @escape = false
  635.           for battler in $game_party.actors
  636.             battler.at %= @max
  637.           end
  638.           $game_temp.battle_main_phase = false
  639.           update_phase2_escape
  640.         end
  641.       end
  642.     end
  643.   end
  644. #------------------------------------------------------------------------------
  645. #RTAB观光游第一站,去除“战斗/逃跑”选项部分  
  646.   #--------------------------------------------------------------------------
  647.   # ● パーティコマンドフェーズ開始
  648.   #--------------------------------------------------------------------------
  649. #  def start_phase2
  650.     # フェーズ 2 に移行
  651. #    @phase = 2
  652. #    @party = false
  653.     # パーティコマンドウィンドウを有効化
  654. #    @party_command_window.active = true
  655. #    @party_command_window.visible = true
  656.     # アクターを非選択状態に設定
  657. #    @actor_index = -1
  658.     # アクターコマンドウィンドウを無効化
  659. #    @actor_command_window.active = false
  660. #    @actor_command_window.visible = false
  661. #    if @command.size != 0
  662.       # アクターの明滅エフェクト OFF
  663. #      if @active_actor != nil
  664. #        @active_actor.blink = false
  665. #      end
  666. #    end
  667.     # カメラセット
  668. #    @camera == "party"
  669. #    @spriteset.screen_target(0, 0, 1)
  670.     # メインフェーズフラグをクリア
  671. #    $game_temp.battle_main_phase = false
  672. #  end
  673. #------------------------------------------------------------------------------
  674.   #--------------------------------------------------------------------------
  675.   # ● フレーム更新 (パーティコマンドフェーズ)
  676.   #--------------------------------------------------------------------------
  677.   def update_phase2
  678. #------------------------------------------------------------------------------
  679. #RTAB观光游第一站,去除“战斗/逃跑”选项部分  
  680.     # C ボタンが押された場合
  681.    # 去掉“战斗/逃跑”选项
  682. #    if Input.trigger?(Input::C)
  683.       # パーティコマンドウィンドウのカーソル位置で分岐
  684. #      case @party_command_window.index
  685. #      when 0  # 戦う
  686.         # パーティコマンドウィンドウを無効化
  687. #        @party_command_window.active = false
  688. #        @party_command_window.visible = false
  689.         # 決定 SE を演奏
  690. #        $game_system.se_play($data_system.decision_se)
  691. #------------------------------------------------------------------------------
  692.         @escape = false
  693.         @phase = 0
  694.         if $game_temp.battle_turn == 0
  695.           $game_temp.battle_turn = 1
  696.         end
  697.         if @command_a == true
  698.           # アクターコマンドフェーズ開始
  699.           start_phase3
  700.         else
  701.           $game_temp.battle_main_phase = true
  702.         end
  703. end         
  704. #------------------------------------------------------------------------------
  705. #RTAB观光游第一站,去除“战斗/逃跑”选项部分         
  706. #      when 1  # 逃げる
  707.         # 逃走可能ではない場合
  708. #        if $game_temp.battle_can_escape == false
  709.           # ブザー SE を演奏
  710. #          $game_system.se_play($data_system.buzzer_se)
  711. #          return
  712. #        end
  713.         # 決定 SE を演奏
  714. #        $game_system.se_play($data_system.decision_se)
  715. #        @phase = 0
  716.         # パーティコマンドウィンドウを無効化
  717. #        @party_command_window.active = false
  718. #        @party_command_window.visible = false
  719. #        $game_temp.battle_main_phase = true
  720. #        if $game_temp.battle_turn == 0
  721. #          update_phase2_escape
  722. #          $game_temp.battle_turn = 1
  723. #        for battler in $game_party.actors
  724. #           battler.at -= @max / 2
  725. #         end
  726. #         return
  727. #      end
  728.         # 決定 SE を演奏
  729. #       $game_system.se_play($data_system.decision_se)
  730. #       @escape = true
  731. #       for battler in $game_party.actors
  732. #         @command_a = false
  733. #         @command.delete(battler)
  734. #         @action_battlers.delete(battler)
  735. #         skill_reset(battler)
  736. #       end
  737. #     end
  738. #     return
  739. #   end
  740. #end
  741. #------------------------------------------------------------------------------
  742.   #--------------------------------------------------------------------------
  743.   # ● フレーム更新 (パーティコマンドフェーズ : 逃げる)
  744.   #--------------------------------------------------------------------------
  745.   def update_phase2_escape
  746.     # エネミーの素早さ平均値を計算
  747.     enemies_agi = 0
  748.     enemies_number = 0
  749.     for enemy in $game_troop.enemies
  750.       if enemy.exist?
  751.         enemies_agi += enemy.agi
  752.         enemies_number += 1
  753.       end
  754.     end
  755.     if enemies_number > 0
  756.       enemies_agi /= enemies_number
  757.     end
  758.     # アクターの素早さ平均値を計算
  759.     actors_agi = 0
  760.     actors_number = 0
  761.     for actor in $game_party.actors
  762.       if actor.exist?
  763.         actors_agi += actor.agi
  764.         actors_number += 1
  765.       end
  766.     end
  767.     if actors_number > 0
  768.       actors_agi /= actors_number
  769.     end
  770.     # 逃走成功判定
  771.     success = rand(100) < 50 * actors_agi / enemies_agi
  772.     # 逃走成功の場合
  773.     if success
  774.       # 逃走 SE を演奏
  775.       $game_system.se_play($data_system.escape_se)
  776.       # バトル開始前の BGM に戻す
  777.       $game_system.bgm_play($game_temp.map_bgm)
  778.       # バトル終了
  779.       battle_end(1)
  780.     # 逃走失敗の場合
  781.     else
  782.       @help_window.set_text("逃走失敗", 1)
  783.       @help_wait = @help_time
  784.       # パーティ全員のアクションをクリア
  785.       $game_party.clear_actions
  786.       # メインフェーズ開始
  787.       start_phase4
  788.     end
  789.   end
  790.   #--------------------------------------------------------------------------
  791.   # ● アフターバトルフェーズ開始
  792.   #--------------------------------------------------------------------------
  793.   def start_phase5
  794.     # フェーズ 5 に移行
  795.     @phase = 5
  796.     # バトル終了 ME を演奏
  797.     $game_system.me_play($game_system.battle_end_me)
  798.     # バトル開始前の BGM に戻す
  799.     $game_system.bgm_play($game_temp.map_bgm)
  800.     # EXP、ゴールド、トレジャーを初期化
  801.     exp = 0
  802.     gold = 0
  803.     treasures = []
  804.     if @active_actor != nil
  805.       @active_actor.blink = false
  806.     end
  807.     # メインフェーズフラグをセット
  808.     $game_temp.battle_main_phase = true
  809. #------------------------------------------------------------------------------
  810. #RTAB观光游第一站,去除“战斗/逃跑”选项部分   
  811.     # パーティコマンドウィンドウを無効化
  812. #    @party_command_window.active = false
  813. #    @party_command_window.visible = false
  814. #------------------------------------------------------------------------------
  815.     # アクターコマンドウィンドウを無効化
  816.     @actor_command_window.active = false
  817.     @actor_command_window.visible = false
  818.     if @skill_window != nil
  819.       # スキルウィンドウを解放
  820.       @skill_window.dispose
  821.       @skill_window = nil
  822.     end
  823.     if @item_window != nil
  824.       # アイテムウィンドウを解放
  825.       @item_window.dispose
  826.       @item_window = nil
  827.     end
  828.     # ヘルプウィンドウを隠す
  829.     @help_window.visible = false
  830.     # ループ
  831.     for enemy in $game_troop.enemies
  832.       # エネミーが隠れ状態でない場合
  833.       unless enemy.hidden
  834.         # 獲得 EXP、ゴールドを追加
  835.         exp += enemy.exp
  836.         gold += enemy.gold
  837.         # トレジャー出現判定
  838.         if rand(100) < enemy.treasure_prob
  839.           if enemy.item_id > 0
  840.             treasures.push($data_items[enemy.item_id])
  841.           end
  842.           if enemy.weapon_id > 0
  843.             treasures.push($data_weapons[enemy.weapon_id])
  844.           end
  845.           if enemy.armor_id > 0
  846.             treasures.push($data_armors[enemy.armor_id])
  847.           end
  848.         end
  849.       end
  850.     end
  851.     # トレジャーの数を 6 個までに限定
  852.     treasures = treasures[0..5]
  853.     # EXP 獲得
  854.     for i in 0...$game_party.actors.size
  855.       actor = $game_party.actors[i]
  856.       if actor.cant_get_exp? == false
  857.         last_level = actor.level
  858.         actor.exp += exp
  859.         if actor.level > last_level
  860.           @status_window.level_up(i)
  861.           actor.damage[[actor, -1]] = "Level up!"
  862.           actor.up_level = actor.level - last_level
  863.         end
  864.       end
  865.     end
  866.     # ゴールド獲得
  867.     $game_party.gain_gold(gold)
  868.     # トレジャー獲得
  869.     for item in treasures
  870.       case item
  871.       when RPG::Item
  872.         $game_party.gain_item(item.id, 1)
  873.       when RPG::Weapon
  874.         $game_party.gain_weapon(item.id, 1)
  875.       when RPG::Armor
  876.         $game_party.gain_armor(item.id, 1)
  877.       end
  878.     end
  879.     # バトルリザルトウィンドウを作成
  880.     @result_window = Window_BattleResult.new(exp, gold, treasures)
  881.     # ウェイトカウントを設定
  882.     @phase5_wait_count = 100
  883.   end
  884.   #--------------------------------------------------------------------------
  885.   # ● フレーム更新 (アフターバトルフェーズ)
  886.   #--------------------------------------------------------------------------
  887.   def update_phase5
  888.     # ウェイトカウントが 0 より大きい場合
  889.     if @phase5_wait_count > 0
  890.       # ウェイトカウントを減らす
  891.       @phase5_wait_count -= 1
  892.       # ウェイトカウントが 0 になった場合
  893.       if @phase5_wait_count == 0
  894.         # リザルトウィンドウを表示
  895.         @result_window.visible = true
  896.         # メインフェーズフラグをクリア
  897.         $game_temp.battle_main_phase = false
  898.         # ステータスウィンドウをリフレッシュ
  899.         @status_window.refresh
  900.         for actor in $game_party.actors
  901.           if actor.damage.include?([actor, 0])
  902.             @phase5_wait_count = 20
  903.             actor.damage_pop[[actor, 0]] = true
  904.           end
  905.           if actor.damage.include?([actor, -1])
  906.             @phase5_wait_count = 20
  907.             actor.damage_pop[[actor, -1]] = true
  908.             for level in actor.level - actor.up_level + 1..actor.level
  909.               for skill in $data_classes[actor.class_id].learnings
  910.                 if level == skill.level and not actor.skill_learn?(skill.id)
  911.                   actor.damage[[actor, 0]] = "New Skill!"
  912.                   break
  913.                 end
  914.               end
  915.             end
  916.           end
  917.         end
  918.       end
  919.       return
  920.     end
  921.     # C ボタンが押された場合
  922.     if Input.trigger?(Input::C)
  923.       # バトル終了
  924.       battle_end(0)
  925.     end
  926.   end
  927.  
  928. #==============================================================================
  929. # ■ Scene_Battle (分割定義 3)
  930. #------------------------------------------------------------------------------
  931. #  バトル画面の処理を行うクラスです。
  932. #==============================================================================
  933.  
  934.   #--------------------------------------------------------------------------
  935.   # ● アクターコマンドフェーズ開始
  936.   #--------------------------------------------------------------------------
  937.   def start_phase3
  938.     if victory?
  939.       return
  940.     end
  941.     # メインフェーズフラグをクリア
  942.     $game_temp.battle_main_phase = false
  943.     @command_a = true
  944.     @active_actor = @command[0]
  945.     cnt = 0
  946.     for actor in $game_party.actors
  947.       if actor == @active_actor
  948.         @actor_index = cnt
  949.       end
  950.       cnt += 1
  951.     end
  952.     @active_actor.blink = true
  953.     unless @active_actor.inputable?
  954.       @active_actor.current_action.clear
  955.       phase3_next_actor
  956.       return
  957.     end
  958.     phase3_setup_command_window
  959.     # カメラの設定
  960.     @camera = "command"
  961.     plus = ($game_party.actors.size - 1) / 2.0 - @actor_index
  962.     y = [(plus.abs - 1.5) * 10 , 0].min
  963.     @spriteset.screen_target(plus * 50, y, 1.0 + y * 0.002)
  964.   end
  965.   #--------------------------------------------------------------------------
  966.   # ● アクターのコマンド入力終了
  967.   #--------------------------------------------------------------------------
  968.   def phase3_next_actor
  969.     @command.shift
  970.     @command_a = false
  971.     # メインフェーズフラグをセット
  972.     $game_temp.battle_main_phase = true
  973.     # アクターコマンドウィンドウを無効化
  974.     @actor_command_window.active = false
  975.     @actor_command_window.visible = false
  976.     # アクターの明滅エフェクト OFF
  977.     if @active_actor != nil
  978.       @active_actor.blink = false
  979.     end
  980.     action_start(@active_actor)
  981.     # カメラを元に戻す
  982.     if @camera == "command"
  983.       @spriteset.screen_target(0, 0, 1)
  984.     end
  985.     return
  986.   end
  987.   #--------------------------------------------------------------------------
  988.   # ● アクターコマンドウィンドウのセットアップ
  989.   #--------------------------------------------------------------------------
  990.   def phase3_setup_command_window
  991. #------------------------------------------------------------------------------
  992. #RTAB观光游第一站,去除“战斗/逃跑”选项部分   
  993.     # パーティコマンドウィンドウを無効化
  994. #    @party_command_window.active = false
  995. #    @party_command_window.visible = false
  996. #------------------------------------------------------------------------------  
  997.     # アクターコマンドウィンドウを有効化
  998.     @actor_command_window.active = true
  999.     @actor_command_window.visible = true
  1000.     # アクターコマンドウィンドウの位置を設定
  1001.     @actor_command_window.x = @actor_index * 160 +
  1002.                               (4 - $game_party.actors.size) * 80
  1003.     # インデックスを 0 に設定
  1004.     @actor_command_window.index = 0
  1005.   end
  1006.   #--------------------------------------------------------------------------
  1007.   # ● エネミーアクション作成
  1008.   #--------------------------------------------------------------------------
  1009.   def enemy_action(number)
  1010.     enemy = $game_troop.enemies[number]
  1011.     unless enemy.current_action.forcing
  1012.       enemy.make_action
  1013.     end
  1014.     action_start(enemy)
  1015.   end
  1016.   #--------------------------------------------------------------------------
  1017.   # ● フレーム更新 (アクターコマンドフェーズ)
  1018.   #--------------------------------------------------------------------------
  1019.   def update_phase3
  1020.     if victory? and @command_a
  1021.       command_delete
  1022.       @command.push(@active_actor)
  1023.       return
  1024.     end
  1025.     # エネミーアローが有効の場合
  1026.     if @enemy_arrow != nil
  1027.       update_phase3_enemy_select
  1028.     # アクターアローが有効の場合
  1029.     elsif @actor_arrow != nil
  1030.       update_phase3_actor_select
  1031.     # スキルウィンドウが有効の場合
  1032.     elsif @skill_window != nil
  1033.       update_phase3_skill_select
  1034.     # アイテムウィンドウが有効の場合
  1035.     elsif @item_window != nil
  1036.       update_phase3_item_select
  1037.     # アクターコマンドウィンドウが有効の場合
  1038.     elsif @actor_command_window.active
  1039.       update_phase3_basic_command
  1040.     end
  1041.   end
  1042.   #--------------------------------------------------------------------------
  1043.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  1044.   #--------------------------------------------------------------------------
  1045.   def update_phase3_basic_command
  1046.     unless @active_actor.inputable?
  1047.       @active_actor.current_action.clear
  1048.       phase3_next_actor
  1049.       return
  1050.     end
  1051. #--------------------------------------------------------------------------
  1052. #RTAB观光游第一站,去除“战斗/逃跑”选项部分
  1053. # B ボタンが押された場合
  1054. #   if Input.trigger?(Input::B) and @party == false
  1055.       # キャンセル SE を演奏
  1056. #     $game_system.se_play($data_system.cancel_se)
  1057. #     @party = true
  1058. #   end
  1059. #   if @party == true and
  1060. #       ((@action > 0 and @action_battlers.empty?) or (@action == 0 and
  1061. #       (@action_battlers.empty? or @action_battlers[0].phase == 1)))
  1062.       # パーティコマンドフェーズへ
  1063. #     start_phase2
  1064. #     return
  1065. #   end
  1066. #==============================================================================
  1067. #RTAB观光游第二站,增加战斗快捷键ASD                      这段是官方增加的脚本
  1068. #==============================================================================
  1069.     # A : SKILL
  1070.     if Input.trigger?(Input::X)
  1071.       # 決定 SE を演奏
  1072.       $game_system.se_play($data_system.decision_se)
  1073.       # スキルの選択を開始
  1074.       start_skill_select
  1075.       return
  1076.     end
  1077.     # S : 防御
  1078.     if Input.trigger?(Input::Y)
  1079.       # 決定 SE を演奏
  1080.       $game_system.se_play($data_system.decision_se)
  1081.       # アクションを設定
  1082.       @active_actor.current_action.kind = 0
  1083.       @active_actor.current_action.basic = 1
  1084.       # 次のアクターのコマンド入力へ
  1085.       phase3_next_actor
  1086.       return
  1087.     end
  1088.     # D : ITEM
  1089.     if Input.trigger?(Input::Z)
  1090.       # 決定 SE を演奏
  1091.       $game_system.se_play($data_system.decision_se)
  1092.       # アイテムの選択を開始
  1093.       start_item_select
  1094.       return
  1095.     end
  1096. #==============================================================================
  1097.     # C ボタンが押された場合
  1098.     if Input.trigger?(Input::C)
  1099. #------------------------------------------------------------------------------
  1100. #RTAB观光游第一站,去除“战斗/逃跑”选项部分      
  1101. #      @party = false
  1102. #------------------------------------------------------------------------------
  1103.       # アクターコマンドウィンドウのカーソル位置で分岐
  1104.       case @actor_command_window.index
  1105.       when 0  # 攻撃
  1106. #==============================================================================
  1107. #RTAB观光游第二站,增加战斗快捷键ASD                      这段是官方增加的脚本
  1108. #==============================================================================        
  1109.         if victory?
  1110.           # ブザー SE を演奏
  1111.           $game_system.se_play($data_system.buzzer_se)
  1112.           return
  1113.         end
  1114. #==============================================================================        
  1115.         # 決定 SE を演奏
  1116.         $game_system.se_play($data_system.decision_se)
  1117.         # エネミーの選択を開始
  1118.         start_enemy_select
  1119.       when 1  # スキル
  1120.         # 決定 SE を演奏
  1121.         $game_system.se_play($data_system.decision_se)
  1122.         # スキルの選択を開始
  1123.         start_skill_select
  1124.       when 2  # 防御
  1125.         # 決定 SE を演奏
  1126.         $game_system.se_play($data_system.decision_se)
  1127.         # アクションを設定
  1128.         @active_actor.current_action.kind = 0
  1129.         @active_actor.current_action.basic = 1
  1130.         # 次のアクターのコマンド入力へ
  1131.         phase3_next_actor
  1132.       when 3  # アイテム
  1133.         # 決定 SE を演奏
  1134.         $game_system.se_play($data_system.decision_se)
  1135.         # アイテムの選択を開始
  1136.         start_item_select
  1137. #==============================================================================
  1138. #RTAB观光游第三站,战斗菜单增加逃跑选项
  1139. #==============================================================================
  1140.       when 4 #逃跑(添加内容)
  1141.         if $game_temp.battle_can_escape == false
  1142.           # ブザー SE を演奏
  1143.           $game_system.se_play($data_system.buzzer_se)
  1144.           return
  1145.        end
  1146.         # 決定 SE を演奏
  1147.         $game_system.se_play($data_system.decision_se)
  1148.        @phase = 0
  1149.         # パーティコマンドウィンドウを無効化
  1150.         @actor_command_window.active = false
  1151.         @actor_command_window.visible = false
  1152.         $game_temp.battle_main_phase = true
  1153.         if $game_temp.battle_turn == 0
  1154.           update_phase2_escape
  1155.          $game_temp.battle_turn = 1
  1156.          for battler in $game_party.actors
  1157.             battler.at -= @max / 2
  1158.           end
  1159.           return
  1160.        end
  1161.        # 決定 SE を演奏
  1162.         $game_system.se_play($data_system.decision_se)
  1163.         @escape = true
  1164.         for battler in $game_party.actors
  1165.           @command_a = false
  1166.           @command.delete(battler)
  1167.           @action_battlers.delete(battler)
  1168.           skill_reset(battler)
  1169.         end
  1170. #==============================================================================        
  1171.       end
  1172.       return
  1173.     end
  1174.     # キャラチェンジ
  1175.     if @command.size > 1
  1176.       # R ボタンが押された場合
  1177.       if Input.trigger?(Input::L)
  1178.         $game_system.se_play($data_system.cursor_se)
  1179. #------------------------------------------------------------------------------
  1180. #RTAB观光游第一站,去除“战斗/逃跑”选项部分        
  1181.        # @party = false
  1182. #------------------------------------------------------------------------------      
  1183.         # アクターの明滅エフェクト OFF
  1184.         if @active_actor != nil
  1185.           @active_actor.blink = false
  1186.         end
  1187.         @command.push(@command[0])
  1188.         @command.shift
  1189.         @command_a = false
  1190.         # 新たなコマンドウィンドウの立ち上げ
  1191.         start_phase3
  1192.       end
  1193.       # L ボタンが押された場合
  1194.       if Input.trigger?(Input::R)
  1195.         $game_system.se_play($data_system.cursor_se)
  1196. #------------------------------------------------------------------------------
  1197. #RTAB观光游第一站,去除“战斗/逃跑”选项部分      
  1198.      #   @party = false
  1199. #------------------------------------------------------------------------------      
  1200.         # アクターの明滅エフェクト OFF
  1201.         if @active_actor != nil
  1202.           @active_actor.blink = false
  1203.         end
  1204.         @command.unshift(@command[@command.size - 1])
  1205.         @command.delete_at(@command.size - 1)
  1206.         @command_a = false
  1207.         # 新たなコマンドウィンドウの立ち上げ
  1208.         start_phase3
  1209.       end
  1210.       # 右 ボタンが押された場合
  1211.       if Input.trigger?(Input::RIGHT)
  1212.         $game_system.se_play($data_system.cursor_se)
  1213. #------------------------------------------------------------------------------
  1214. #RTAB观光游第一站,去除“战斗/逃跑”选项部分        
  1215.    #     @party = false
  1216. #------------------------------------------------------------------------------      
  1217.         # アクターの明滅エフェクト OFF
  1218.         if @active_actor != nil
  1219.           @active_actor.blink = false
  1220.         end
  1221.         actor = $game_party.actors[@actor_index]
  1222.         while actor == @command[0] or (not @command.include?(actor))
  1223.           @actor_index += 1
  1224.           @actor_index %= $game_party.actors.size
  1225.           actor = $game_party.actors[@actor_index]
  1226.           if actor == @command[0]
  1227.             break
  1228.           end
  1229.         end
  1230.         while actor != @command[0]
  1231.           @command.push(@command.shift)
  1232.         end
  1233.         @command_a = false
  1234.         # 新たなコマンドウィンドウの立ち上げ
  1235.         start_phase3
  1236.       end
  1237.       # 左 ボタンが押された場合
  1238.       if Input.trigger?(Input::LEFT)
  1239.         $game_system.se_play($data_system.cursor_se)
  1240. #------------------------------------------------------------------------------
  1241. #RTAB观光游第一站,去除“战斗/逃跑”选项部分        
  1242.    #     @party = false
  1243. #------------------------------------------------------------------------------
  1244.         # アクターの明滅エフェクト OFF
  1245.         if @active_actor != nil
  1246.           @active_actor.blink = false
  1247.         end
  1248.         actor = $game_party.actors[@actor_index]
  1249.         while actor == @command[0] or (not @command.include?(actor))
  1250.           @actor_index -= 1
  1251.           @actor_index %= $game_party.actors.size
  1252.           actor = $game_party.actors[@actor_index]
  1253.           if actor == @command[0]
  1254.             break
  1255.           end
  1256.         end
  1257.         while actor != @command[0]
  1258.           @command.push(@command.shift)
  1259.         end
  1260.         @command_a = false
  1261.         # 新たなコマンドウィンドウの立ち上げ
  1262.         start_phase3
  1263.       end
  1264.     end
  1265.   end
  1266.   #--------------------------------------------------------------------------
  1267.   # ● フレーム更新 (アクターコマンドフェーズ : スキル選択)
  1268.   #--------------------------------------------------------------------------
  1269.   def update_phase3_skill_select
  1270.     # コマンド選択中に行動不能になった場合
  1271.     unless @active_actor.inputable?
  1272.       @active_actor.current_action.clear
  1273.       command_delete
  1274.       # 次のアクターのコマンド入力へ
  1275.       phase3_next_actor
  1276.       return
  1277.     end
  1278.     # スキルウィンドウを可視状態にする
  1279.     @skill_window.visible = true
  1280.     # スキルウィンドウを更新
  1281.     @skill_window.update
  1282.     # B ボタンが押された場合
  1283.     if Input.trigger?(Input::B)
  1284.       # キャンセル SE を演奏
  1285.       $game_system.se_play($data_system.cancel_se)
  1286.       # スキルの選択を終了
  1287.       end_skill_select
  1288.       return
  1289.     end
  1290.     # C ボタンが押された場合
  1291.     if Input.trigger?(Input::C)
  1292.       # スキルウィンドウで現在選択されているデータを取得
  1293.       @skill = @skill_window.skill
  1294.       # 使用できない場合
  1295.       if @skill == nil or not @active_actor.skill_can_use?(@skill.id)
  1296.         # ブザー SE を演奏
  1297.         $game_system.se_play($data_system.buzzer_se)
  1298.         return
  1299.       end
  1300.       # 決定 SE を演奏
  1301.       $game_system.se_play($data_system.decision_se)
  1302.       # アクションを設定
  1303.       @active_actor.current_action.skill_id = @skill.id
  1304.       # スキルウィンドウを不可視状態にする
  1305.       @skill_window.visible = false
  1306.       # 効果範囲が敵単体の場合
  1307.       if @skill.scope == 1
  1308.         # エネミーの選択を開始
  1309.         start_enemy_select
  1310.       # 効果範囲が味方単体の場合
  1311.       elsif @skill.scope == 3 or @skill.scope == 5
  1312.         # アクターの選択を開始
  1313.         start_actor_select
  1314.       # 効果範囲が単体ではない場合
  1315.       else
  1316.         # アクションを設定
  1317.         @active_actor.current_action.kind = 1
  1318.         # スキルの選択を終了
  1319.         end_skill_select
  1320.         # 次のアクターのコマンド入力へ
  1321.         phase3_next_actor
  1322.       end
  1323.       return
  1324.     end
  1325.   end
  1326.   #--------------------------------------------------------------------------
  1327.   # ● フレーム更新 (アクターコマンドフェーズ : アイテム選択)
  1328.   #--------------------------------------------------------------------------
  1329.   def update_phase3_item_select
  1330.     # コマンド選択中に行動不能になった場合
  1331.     unless @active_actor.inputable?
  1332.       @active_actor.current_action.clear
  1333.       command_delete
  1334.       # 次のアクターのコマンド入力へ
  1335.       phase3_next_actor
  1336.       return
  1337.     end
  1338.     # アイテムウィンドウを可視状態にする
  1339.     @item_window.visible = true
  1340.     # アイテムウィンドウを更新
  1341.     @item_window.update
  1342.     # B ボタンが押された場合
  1343.     if Input.trigger?(Input::B)
  1344.       # キャンセル SE を演奏
  1345.       $game_system.se_play($data_system.cancel_se)
  1346.       # アイテムの選択を終了
  1347.       end_item_select
  1348.       return
  1349.     end
  1350.     # C ボタンが押された場合
  1351.     if Input.trigger?(Input::C)
  1352.       # アイテムウィンドウで現在選択されているデータを取得
  1353.       @item = @item_window.item
  1354.       # 使用できない場合
  1355.       unless $game_party.item_can_use?(@item.id)
  1356.         # ブザー SE を演奏
  1357.         $game_system.se_play($data_system.buzzer_se)
  1358.         return
  1359.       end
  1360.       # 決定 SE を演奏
  1361.       $game_system.se_play($data_system.decision_se)
  1362.       # アクションを設定
  1363.       @active_actor.current_action.item_id = @item.id
  1364.       # アイテムウィンドウを不可視状態にする
  1365.       @item_window.visible = false
  1366.       # 効果範囲が敵単体の場合
  1367.       if @item.scope == 1
  1368.         # エネミーの選択を開始
  1369.         start_enemy_select
  1370.       # 効果範囲が味方単体の場合
  1371.       elsif @item.scope == 3 or @item.scope == 5
  1372.         # アクターの選択を開始
  1373.         start_actor_select
  1374.       # 効果範囲が単体ではない場合
  1375.       else
  1376.         # アクションを設定
  1377.         @active_actor.current_action.kind = 2
  1378.         # アイテムの選択を終了
  1379.         end_item_select
  1380.         # 次のアクターのコマンド入力へ
  1381.         phase3_next_actor
  1382.       end
  1383.       return
  1384.     end
  1385.   end
  1386.   #--------------------------------------------------------------------------
  1387.   # ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
  1388.   #--------------------------------------------------------------------------
  1389.   def update_phase3_enemy_select
  1390.     # コマンド選択中に行動不能になった場合
  1391.     unless @active_actor.inputable?
  1392.       # カメラを元に戻す
  1393.       if @camera == "select"
  1394.         @spriteset.screen_target(0, 0, 1)
  1395.       end
  1396.       @active_actor.current_action.clear
  1397.       command_delete
  1398.       # 次のアクターのコマンド入力へ
  1399.       phase3_next_actor
  1400.       return
  1401.     end
  1402.     # エネミーアローを更新
  1403.     @enemy_arrow.update
  1404.     # B ボタンが押された場合
  1405.     if Input.trigger?(Input::B)
  1406.       # キャンセル SE を演奏
  1407.       $game_system.se_play($data_system.cancel_se)
  1408.       # カメラを元に戻す
  1409.       if @camera == "select"
  1410.         # カメラの設定
  1411.         @camera = "command"
  1412.         plus = ($game_party.actors.size - 1) / 2.0 - @actor_index
  1413.         y = [(plus.abs - 1.5) * 10 , 0].min
  1414.         @spriteset.screen_target(plus * 50, y, 1.0 + y * 0.002)
  1415.       end
  1416.       # エネミーの選択を終了
  1417.       end_enemy_select
  1418.       return
  1419.     end
  1420.     # C ボタンが押された場合
  1421.     if Input.trigger?(Input::C)
  1422.       # 決定 SE を演奏
  1423.       $game_system.se_play($data_system.decision_se)
  1424.       # アクションを設定
  1425.       @active_actor.current_action.kind = 0
  1426.       @active_actor.current_action.basic = 0
  1427.       @active_actor.current_action.target_index = @enemy_arrow.index
  1428.       # スキルウィンドウ表示中の場合
  1429.       if @skill_window != nil
  1430.         # アクションを再設定
  1431.         @active_actor.current_action.kind = 1
  1432.         # スキルの選択を終了
  1433.         end_skill_select
  1434.       end
  1435.       # アイテムウィンドウ表示中の場合
  1436.       if @item_window != nil
  1437.         # アクションを再設定
  1438.         @active_actor.current_action.kind = 2
  1439.         # アイテムの選択を終了
  1440.         end_item_select
  1441.       end
  1442.       # エネミーの選択を終了
  1443.       end_enemy_select
  1444.       # 次のアクターのコマンド入力へ
  1445.       phase3_next_actor
  1446.     end
  1447.   end
  1448.   #--------------------------------------------------------------------------
  1449.   # ● フレーム更新 (アクターコマンドフェーズ : アクター選択)
  1450.   #--------------------------------------------------------------------------
  1451.   def update_phase3_actor_select
  1452.     # コマンド選択中に行動不能になった場合
  1453.     unless @active_actor.inputable?
  1454.       @active_actor.current_action.clear
  1455.       command_delete
  1456.       # 次のアクターのコマンド入力へ
  1457.       phase3_next_actor
  1458.       return
  1459.     end
  1460.     # アクターアローを更新
  1461.     @actor_arrow.update
  1462.     # B ボタンが押された場合
  1463.     if Input.trigger?(Input::B)
  1464.       # キャンセル SE を演奏
  1465.       $game_system.se_play($data_system.cancel_se)
  1466.       # アクターの選択を終了
  1467.       end_actor_select
  1468.       return
  1469.     end
  1470.     # C ボタンが押された場合
  1471.     if Input.trigger?(Input::C)
  1472.       # 決定 SE を演奏
  1473.       $game_system.se_play($data_system.decision_se)
  1474.       # アクションを設定
  1475.       @active_actor.current_action.kind = 0
  1476.       @active_actor.current_action.basic = 0
  1477.       @active_actor.current_action.target_index = @actor_arrow.index
  1478.       # アクターの選択を終了
  1479.       end_actor_select
  1480.       # スキルウィンドウ表示中の場合
  1481.       if @skill_window != nil
  1482.         # アクションを再設定
  1483.         @active_actor.current_action.kind = 1
  1484.         # スキルの選択を終了
  1485.         end_skill_select
  1486.       end
  1487.       # アイテムウィンドウ表示中の場合
  1488.       if @item_window != nil
  1489.         # アクションを再設定
  1490.         @active_actor.current_action.kind = 2
  1491.         # アイテムの選択を終了
  1492.         end_item_select
  1493.       end
  1494.       # 次のアクターのコマンド入力へ
  1495.       phase3_next_actor
  1496.     end
  1497.   end
  1498.   #--------------------------------------------------------------------------
  1499.   # ● エネミー選択開始
  1500.   #--------------------------------------------------------------------------
  1501.   alias :start_enemy_select_rtab :start_enemy_select
  1502.   def start_enemy_select
  1503.     @camera = "select"
  1504.     for enemy in $game_troop.enemies
  1505.       if enemy.exist?
  1506.         zoom = 1 / enemy.zoom
  1507.         @spriteset.screen_target(enemy.attack_x(zoom) * 0.75,
  1508.                                   enemy.attack_y(zoom) * 0.75, zoom)
  1509.         break
  1510.       end
  1511.     end
  1512.     # オリジナルの処理
  1513.     start_enemy_select_rtab
  1514.   end
  1515.   #--------------------------------------------------------------------------
  1516.   # ● エネミー選択終了
  1517.   #--------------------------------------------------------------------------
  1518.   alias :end_enemy_select_rtab :end_enemy_select
  1519.   def end_enemy_select
  1520.     # オリジナルの処理
  1521.     end_enemy_select_rtab
  1522.     if (@action == 0 and not @action_battlers.empty?) or
  1523.           (@camera == "select" and (@active_actor.current_action.kind != 0 or
  1524.                                             @active_actor.animation1_id != 0))
  1525.       @spriteset.screen_target(0, 0, 1)
  1526.     end
  1527.   end
  1528.   #--------------------------------------------------------------------------
  1529.   # ● スキル選択開始
  1530.   #--------------------------------------------------------------------------
  1531.   def start_skill_select
  1532.     # スキルウィンドウを作成
  1533.     @skill_window = Window_Skill.new(@active_actor)
  1534.     # ヘルプウィンドウを関連付け
  1535.     @skill_window.help_window = @help_window
  1536.     # アクターコマンドウィンドウを無効化
  1537.     @actor_command_window.active = false
  1538.     @actor_command_window.visible = false
  1539.   end
  1540.  
  1541. #==============================================================================
  1542. # ■ Scene_Battle (分割定義 4)
  1543. #------------------------------------------------------------------------------
  1544. #  バトル画面の処理を行うクラスです。
  1545. #==============================================================================
  1546.  
  1547.   #--------------------------------------------------------------------------
  1548.   # ● メインフェーズ開始
  1549.   #--------------------------------------------------------------------------
  1550.   def start_phase4
  1551.     $game_temp.battle_main_phase = true
  1552.   end
  1553.   #--------------------------------------------------------------------------
  1554.   # ● フレーム更新 (メインフェーズ)
  1555.   #--------------------------------------------------------------------------
  1556.   def update_phase4
  1557.     # アクションを強制されているバトラーが存在する場合
  1558.     if $game_temp.forcing_battler != nil
  1559.       battler = $game_temp.forcing_battler
  1560.       if battler.current_action.forcing == false
  1561.         if @action_battlers.include?(battler)
  1562.           if @action > 0 or @action_battlers[0].phase == 1
  1563.             @action_battlers.delete(battler)
  1564.             @action_battlers.push(battler)
  1565.           end
  1566.           if battler.phase == 1
  1567.             battler.current_action.forcing = true
  1568.             force_action(battler)
  1569.           end
  1570.         else
  1571.           battler.current_action.forcing = true
  1572.           force_action(battler)
  1573.           action_start(battler)
  1574.           @action_battlers.delete(battler)
  1575.           @action_battlers.push(battler)
  1576.         end
  1577.         battler.at = @max
  1578.         battler.atp = 100 * battler.at / @max
  1579.       end
  1580.     end
  1581.     # action が1以上の場合、一斉に行動を起こす
  1582.     for battler in @action_battlers.reverse
  1583.       # ウェイト中の場合
  1584.       if battler.wait > 0
  1585.         # ウェイトカウントを減らす
  1586.         battler.wait -= 1
  1587.         break if @action == 0
  1588.         next
  1589.       end
  1590.       unless fin? and battler.phase < 3 and
  1591.           not $game_system.battle_interpreter.running?
  1592.         action_phase(battler)
  1593.       end
  1594.       break if @action == 0
  1595.     end
  1596.     # アクションを強制されているバトラーが存在しない場合
  1597.     if $game_temp.forcing_battler == nil
  1598.       # バトルイベントをセットアップ
  1599.       setup_battle_event
  1600.       # バトルイベント実行中の場合
  1601.       if $game_system.battle_interpreter.running?
  1602.         return
  1603.       end
  1604.     end
  1605.     # 勝敗を決した際の処理
  1606.     if fin?
  1607.       # 敗北時、指定時間ウェイト
  1608.       if $game_party.all_dead? and @after_wait[0] > 0
  1609.         @after_wait[0] -= 1
  1610.         return
  1611.       end
  1612.       # 勝利時、指定時間ウェイト
  1613.       if victory? and @after_wait[1] > 0
  1614.         @after_wait[1] -= 1
  1615.         return
  1616.       end
  1617.       # 戦闘が終了し、かつアクターが行動直前の場合はアクターの行動を消去
  1618.       for battler in @action_battlers.reverse
  1619.         if battler.phase < 3 and not $game_system.battle_interpreter.running?
  1620.           @action_battlers.delete(battler)
  1621.         end
  1622.       end
  1623.       # 勝敗判定
  1624.       if @action_battlers.empty? and
  1625.           not $game_system.battle_interpreter.running?
  1626.         judge
  1627.       end
  1628.     end
  1629.   end
  1630.   #--------------------------------------------------------------------------
  1631.   # ● アクション更新 (メインフェーズ)
  1632.   #--------------------------------------------------------------------------
  1633.   def action_phase(battler)
  1634.     # action が 1 の場合、バトラーが行動中かどうか確認
  1635.     if @action == 1 and battler.phase <= 3
  1636.       for target in battler.target
  1637.         speller = synthe?(target)
  1638.         if speller == nil
  1639.           # ターゲットが通常行動中の場合
  1640.           if @action_battlers.include?(target)
  1641.             if target.phase > 2
  1642.               return
  1643.             end
  1644.           end
  1645.         else
  1646.           # ターゲットが連携スキル発動中の場合
  1647.           for spell in speller
  1648.             if @action_battlers.include?(spell)
  1649.               if spell.phase > 2
  1650.                 return
  1651.               end
  1652.             end
  1653.           end
  1654.         end
  1655.       end
  1656.     end
  1657.     case battler.phase
  1658.     when 1
  1659.       update_phase4_step1(battler)
  1660.     when 2
  1661.       update_phase4_step2(battler)
  1662.     when 3
  1663.       update_phase4_step3(battler)
  1664.     when 4
  1665.       update_phase4_step4(battler)
  1666.     when 5
  1667.       update_phase4_step5(battler)
  1668.     when 6
  1669.       update_phase4_step6(battler)
  1670.     end
  1671.   end
  1672.   #--------------------------------------------------------------------------
  1673.   # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  1674.   #--------------------------------------------------------------------------
  1675.   def update_phase4_step1(battler)
  1676.     # すでに戦闘から外されている場合
  1677.     if battler.index == nil
  1678.       @action_battlers.delete(battler)
  1679.       anime_wait_return
  1680.       return
  1681.     end
  1682.     speller = synthe?(battler)
  1683.     if speller == nil
  1684.       # ダメージ食らい中の場合
  1685.       unless battler.damage.empty? or @action > 2
  1686.         return
  1687.       end
  1688.       # 行動可能かどうか判定
  1689.       unless battler.movable?
  1690.         battler.phase = 6
  1691.         return
  1692.       end
  1693.     else
  1694.       # ダメージ食らい中の場合
  1695.       for spell in speller
  1696.         unless spell.damage.empty? or @action > 2
  1697.           return
  1698.         end
  1699.         # 行動可能かどうか判定
  1700.         unless spell.movable?
  1701.           battler.phase = 6
  1702.           return
  1703.         end
  1704.       end
  1705.     end
  1706.     # スキル使用時、詠唱時間設定
  1707.     # 強制アクションかつ @force が 2 の時はスキルを即時発動
  1708.     if battler.current_action.kind == 1 and
  1709.       (not battler.current_action.forcing or @force != 2)
  1710.       if battler.rtp == 0
  1711.         # スキル詠唱中ならば、解除
  1712.         skill_reset(battler)
  1713.         # スキル詠唱時間設定
  1714.         recite_time(battler)
  1715.         # 連携技設定
  1716.         synthe_spell(battler)
  1717.         # スキルを詠唱する場合
  1718.         if battler.rtp > 0
  1719.           # 強制アクションかつ @force が 1 の時は連携スキルのみ即時発動
  1720.           speller = synthe?(battler)
  1721.           if battler.current_action.forcing and @force > 0 and speller != nil
  1722.             for spell in speller
  1723.               spell.rt = spell.rtp
  1724.             end
  1725.           else
  1726.             battler.blink = true
  1727.             if battler.current_action.forcing
  1728.               $game_temp.forcing_battler = nil
  1729.               battler.current_action.forcing = false
  1730.             end
  1731.             @action_battlers.delete(battler)
  1732.             return
  1733.           end
  1734.         end
  1735.       end
  1736.     end
  1737.     # アクターの明滅エフェクト OFF
  1738.     if battler != nil
  1739.       battler.blink = false
  1740.     end
  1741.     speller = synthe?(battler)
  1742.     if speller == nil
  1743.       @spell_p.delete(battler)
  1744.       @spell_e.delete(battler)
  1745.     else
  1746.       for spell in speller
  1747.         spell.blink = false
  1748.         @spell_p.delete(spell)
  1749.         @spell_e.delete(spell)
  1750.       end
  1751.     end
  1752.     # ステップ 2 に移行
  1753.     battler.phase = 2
  1754.   end
  1755.   #--------------------------------------------------------------------------
  1756.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  1757.   #--------------------------------------------------------------------------
  1758.   def update_phase4_step2(battler)
  1759.     # 強制アクションでなければ
  1760.     unless battler.current_action.forcing
  1761.       # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  1762.       if battler.restriction == 2 or battler.restriction == 3
  1763.         # アクションに攻撃を設定
  1764.         battler.current_action.kind = 0
  1765.         battler.current_action.basic = 0
  1766.       end
  1767.     end
  1768.     # アクションの種別で分岐
  1769.     case battler.current_action.kind
  1770.     when 0  # 基本
  1771.       if fin?
  1772.         battler.phase = 6
  1773.         return
  1774.       end
  1775.       make_basic_action_result(battler)
  1776.     when 1  # スキル
  1777.       if fin? and $data_skills[battler.current_action.skill_id].scope == 1..2
  1778.         battler.phase = 6
  1779.         return
  1780.       end
  1781.       make_skill_action_result(battler)
  1782.     when 2  # アイテム
  1783.       if fin? and $data_items[battler.current_action.item_id].scope == 1..2
  1784.         battler.phase = 6
  1785.         return
  1786.       end
  1787.       make_item_action_result(battler)
  1788.     end
  1789.     if battler.phase == 2
  1790.       # ステップ 3 に移行
  1791.       battler.phase = 3
  1792.     end
  1793.   end
  1794.   #--------------------------------------------------------------------------
  1795.   # ● 基本アクション 結果作成
  1796.   #--------------------------------------------------------------------------
  1797.   def make_basic_action_result(battler)
  1798.     # 攻撃の場合
  1799.     if battler.current_action.basic == 0
  1800.       # アニメーション ID を設定
  1801.       battler.anime1 = battler.animation1_id
  1802.       battler.anime2 = battler.animation2_id
  1803.       # 行動側バトラーがエネミーの場合
  1804.       if battler.is_a?(Game_Enemy)
  1805.         if battler.restriction == 3
  1806.           target = $game_troop.random_target_enemy
  1807.         elsif battler.restriction == 2
  1808.           target = $game_party.random_target_actor
  1809.         else
  1810.           index = battler.current_action.target_index
  1811.           target = $game_party.smooth_target_actor(index)
  1812.         end
  1813.       end
  1814.       # 行動側バトラーがアクターの場合
  1815.       if battler.is_a?(Game_Actor)
  1816.         if battler.restriction == 3
  1817.           target = $game_party.random_target_actor
  1818.         elsif battler.restriction == 2
  1819.           target = $game_troop.random_target_enemy
  1820.         else
  1821.           index = battler.current_action.target_index
  1822.           target = $game_troop.smooth_target_enemy(index)
  1823.         end
  1824.       end
  1825.       # 対象側バトラーの配列を設定
  1826.       battler.target = [target]
  1827.       # 通常攻撃の効果を適用
  1828.       for target in battler.target
  1829.         target.attack_effect(battler)
  1830.       end
  1831.       return
  1832.     end
  1833.     # 防御の場合
  1834.     if battler.current_action.basic == 1
  1835.       return
  1836.     end
  1837.     # 逃げるの場合
  1838. #    if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  1839.       # 逃げる
  1840. #      @help_window.set_text("逃げる", 1)
  1841. #      @help_wait = @help_time
  1842. #      battler.escape
  1843. #      return
  1844. #    end
  1845. #========RTAB 1.16=====================================================   
  1846.     # 逃げるの場合
  1847.     if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  1848.       return
  1849.     end
  1850. #======================================================================
  1851.     # 何もしないの場合
  1852.     if battler.current_action.basic == 3
  1853.       # ステップ 6 に移行
  1854.       battler.phase = 6
  1855.       return
  1856.     end
  1857.   end
  1858.   #--------------------------------------------------------------------------
  1859.   # ● スキルまたはアイテムの対象側バトラー設定
  1860.   #     scope : スキルまたはアイテムの効果範囲
  1861.   #--------------------------------------------------------------------------
  1862.   def set_target_battlers(scope, battler)
  1863.     # 行動側バトラーがエネミーの場合
  1864.     if battler.is_a?(Game_Enemy)
  1865.       # 効果範囲で分岐
  1866.       case scope
  1867.       when 1  # 敵単体
  1868.         index =battler.current_action.target_index
  1869.         battler.target.push($game_party.smooth_target_actor(index))
  1870.       when 2  # 敵全体
  1871.         for actor in $game_party.actors
  1872.           if actor.exist?
  1873.             battler.target.push(actor)
  1874.           end
  1875.         end
  1876.       when 3  # 味方単体
  1877.         index = battler.current_action.target_index
  1878.         battler.target.push($game_troop.smooth_target_enemy(index))
  1879.       when 4  # 味方全体
  1880.         for enemy in $game_troop.enemies
  1881.           if enemy.exist?
  1882.             battler.target.push(enemy)
  1883.           end
  1884.         end
  1885.       when 5  # 味方単体 (HP 0)
  1886.         index = battler.current_action.target_index
  1887.         enemy = $game_troop.enemies[index]
  1888.         if enemy != nil and enemy.hp0?
  1889.           battler.target.push(enemy)
  1890.         end
  1891.       when 6  # 味方全体 (HP 0)
  1892.         for enemy in $game_troop.enemies
  1893.           if enemy != nil and enemy.hp0?
  1894.             battler.target.push(enemy)
  1895.           end
  1896.         end
  1897.       when 7  # 使用者
  1898.         battler.target.push(battler)
  1899.       end
  1900.     end
  1901.     # 行動側バトラーがアクターの場合
  1902.     if battler.is_a?(Game_Actor)
  1903.       # 効果範囲で分岐
  1904.       case scope
  1905.       when 1  # 敵単体
  1906.         index = battler.current_action.target_index
  1907.         battler.target.push($game_troop.smooth_target_enemy(index))
  1908.       when 2  # 敵全体
  1909.         for enemy in $game_troop.enemies
  1910.           if enemy.exist?
  1911.             battler.target.push(enemy)
  1912.           end
  1913.         end
  1914.       when 3  # 味方単体
  1915.         index = battler.current_action.target_index
  1916.         battler.target.push($game_party.smooth_target_actor(index))
  1917.       when 4  # 味方全体
  1918.         for actor in $game_party.actors
  1919.           if actor.exist?
  1920.             battler.target.push(actor)
  1921.           end
  1922.         end
  1923.       when 5  # 味方単体 (HP 0)
  1924.         index = battler.current_action.target_index
  1925.         actor = $game_party.actors[index]
  1926.         if actor != nil and actor.hp0?
  1927.           battler.target.push(actor)
  1928.         end
  1929.       when 6  # 味方全体 (HP 0)
  1930.         for actor in $game_party.actors
  1931.           if actor != nil and actor.hp0?
  1932.             battler.target.push(actor)
  1933.           end
  1934.         end
  1935.       when 7  # 使用者
  1936.         battler.target.push(battler)
  1937.       end
  1938.     end
  1939.   end
  1940.   #--------------------------------------------------------------------------
  1941.   # ● スキルアクション 結果作成
  1942.   #--------------------------------------------------------------------------
  1943.   def make_skill_action_result(battler)
  1944.     # スキルを取得
  1945.     @skill = $data_skills[battler.current_action.skill_id]
  1946.     # 連携スキルであるかどうか確認
  1947.     speller = synthe?(battler)
  1948.     # 強制アクションでなければ
  1949.     unless battler.current_action.forcing
  1950.       # SP 切れなどで使用できなくなった場合
  1951.       if speller == nil
  1952.         unless battler.skill_can_use?(@skill.id)
  1953.           # ステップ 6 に移行
  1954.           battler.phase = 6
  1955.          return
  1956.         end
  1957.       end
  1958.     end
  1959.     # SP 消費
  1960.     temp = false
  1961.     if speller != nil
  1962.       for spell in speller
  1963.         if spell.current_action.spell_id == 0
  1964.           spell.sp -= @skill.sp_cost
  1965.         else
  1966.           spell.sp -= $data_skills[spell.current_action.spell_id].sp_cost
  1967.         end
  1968.         # ステータスウィンドウをリフレッシュ
  1969.         status_refresh(spell)
  1970.       end
  1971.     else
  1972.       battler.sp -= @skill.sp_cost
  1973.       # ステータスウィンドウをリフレッシュ
  1974.       status_refresh(battler)
  1975.     end
  1976.     # アニメーション ID を設定
  1977.     battler.anime1 = @skill.animation1_id
  1978.     battler.anime2 = @skill.animation2_id
  1979.     # コモンイベント ID を設定
  1980.     battler.event = @skill.common_event_id
  1981.     # 対象側バトラーを設定
  1982.     set_target_battlers(@skill.scope, battler)
  1983.     # スキルの効果を適用
  1984.     for target in battler.target
  1985.       if speller != nil
  1986.         damage = 0
  1987.         d_result = false
  1988.         effective = false
  1989.         state_p = []
  1990.         state_m = []
  1991.         for spell in speller
  1992.           if spell.current_action.spell_id != 0
  1993.             @skill = $data_skills[spell.current_action.spell_id]
  1994.           end
  1995.           effective |= target.skill_effect(spell, @skill)
  1996.           if target.damage[spell].class != String
  1997.             d_result = true
  1998.             damage += target.damage[spell]
  1999.           elsif effective
  2000.             effect = target.damage[spell]
  2001.           end
  2002.           state_p += target.state_p[spell]
  2003.           state_m += target.state_m[spell]
  2004.           target.damage.delete(spell)
  2005.           target.state_p.delete(spell)
  2006.           target.state_m.delete(spell)
  2007.         end
  2008.         if d_result
  2009.           target.damage[battler] = damage
  2010.         elsif effective
  2011.           target.damage[battler] = effect
  2012.         else
  2013.           target.damage[battler] = 0
  2014.         end
  2015.         target.state_p[battler] = state_p
  2016.         target.state_m[battler] = state_m
  2017.       else
  2018.         target.skill_effect(battler, @skill)
  2019.       end
  2020.     end
  2021.   end
  2022.   #--------------------------------------------------------------------------
  2023.   # ● アイテムアクション 結果作成
  2024.   #--------------------------------------------------------------------------
  2025.   def make_item_action_result(battler)
  2026.     # アイテムを取得
  2027.     @item = $data_items[battler.current_action.item_id]
  2028.     # アイテム切れなどで使用できなくなった場合
  2029.     unless $game_party.item_can_use?(@item.id)
  2030.       # ステップ 6 に移行
  2031.       battler.phase = 6
  2032.       return
  2033.     end
  2034.     # 消耗品の場合
  2035.     if @item.consumable
  2036.       # 使用したアイテムを 1 減らす
  2037.       $game_party.lose_item(@item.id, 1)
  2038.     end
  2039.     # アニメーション ID を設定
  2040.     battler.anime1 = @item.animation1_id
  2041.     battler.anime2 = @item.animation2_id
  2042.     # コモンイベント ID を設定
  2043.     battler.event = @item.common_event_id
  2044.     # 対象を決定
  2045.     index = battler.current_action.target_index
  2046.     target = $game_party.smooth_target_actor(index)
  2047.     # 対象側バトラーを設定
  2048.     set_target_battlers(@item.scope, battler)
  2049.     # アイテムの効果を適用
  2050.     for target in battler.target
  2051.       target.item_effect(@item, battler)
  2052.     end
  2053.   end
  2054.   #--------------------------------------------------------------------------
  2055.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  2056.   #--------------------------------------------------------------------------
  2057.   def update_phase4_step3(battler)
  2058.     # ヘルプウィンドウの更新。アクションの種別で分岐
  2059.     case battler.current_action.kind
  2060.     when 0  # 基本
  2061.       if battler.current_action.basic == 1
  2062.         @help_window.set_text($data_system.words.guard, 1)
  2063.         @help_wait = @help_time
  2064.       end
  2065. #========RTAB 1.16==================================      
  2066.       if battler.current_action.basic == 2
  2067.         # 逃げる
  2068.         @help_window.set_text("逃げる", 1)
  2069.         @help_wait = @help_time
  2070.         battler.escape
  2071.         battler.phase = 4
  2072.         return
  2073.       end
  2074. #===================================================        
  2075.     when 1  # スキル
  2076.       skill =  $data_skills[battler.current_action.skill_id]
  2077.       @help_window.set_text(skill.name, 1)
  2078.       @help_wait = @help_time
  2079.     when 2  # アイテム
  2080.       item = $data_items[battler.current_action.item_id]
  2081.       @help_window.set_text(item.name, 1)
  2082.       @help_wait = @help_time
  2083.     end
  2084.     # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
  2085.     if battler.anime1 == 0
  2086.       battler.white_flash = true
  2087.       battler.wait = 5
  2088.       # カメラ設定
  2089.       if battler.target[0].is_a?(Game_Enemy)
  2090.         camera_set(battler)
  2091.       end
  2092.     else
  2093.       battler.animation.push([battler.anime1, true])
  2094.       speller = synthe?(battler)
  2095.       if speller != nil
  2096.         for spell in speller
  2097.           if spell != battler
  2098.             if spell.current_action.spell_id == 0
  2099.               spell.animation.push([battler.anime1, true])
  2100.             else
  2101.               skill = spell.current_action.spell_id
  2102.               spell.animation.push([$data_skills[skill].animation1_id, true])
  2103.               spell.current_action.spell_id = 0
  2104.             end
  2105.           end
  2106.         end
  2107.       end
  2108.       battler.wait = 2 * $data_animations[battler.anime1].frame_max - 10
  2109.     end
  2110.     # ステップ 4 に移行
  2111.     battler.phase = 4
  2112.   end
  2113.   #--------------------------------------------------------------------------
  2114.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  2115.   #--------------------------------------------------------------------------
  2116.   def update_phase4_step4(battler)
  2117.     # カメラ設定
  2118.     if battler.target[0].is_a?(Game_Enemy) and battler.anime1 != 0
  2119.        camera_set(battler)
  2120.     end
  2121.     # 対象側アニメーション
  2122.     for target in battler.target
  2123.       target.animation.push([battler.anime2,
  2124.                                           (target.damage[battler] != "Miss")])
  2125.       unless battler.anime2 == 0
  2126.         battler.wait = 2 * $data_animations[battler.anime2].frame_max - 10
  2127.       end
  2128.     end
  2129.     # ステップ 5 に移行
  2130.     battler.phase = 5
  2131.   end
  2132.   #--------------------------------------------------------------------------
  2133.   # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  2134.   #--------------------------------------------------------------------------
  2135.   def update_phase4_step5(battler)
  2136.     # ダメージ表示
  2137.     for target in battler.target
  2138.       if target.damage[battler] != nil
  2139.         target.damage_pop[battler] = true
  2140.         target.damage_effect(battler, battler.current_action.kind)
  2141.         battler.wait = @damage_wait
  2142.         # ステータスウィンドウをリフレッシュ
  2143.         status_refresh(target)
  2144.       end
  2145.     end
  2146.     # ステップ 6 に移行
  2147.     battler.phase = 6
  2148.   end
  2149.   #--------------------------------------------------------------------------
  2150.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  2151.   #--------------------------------------------------------------------------
  2152.   def update_phase4_step6(battler)
  2153.     # カメラを戻す
  2154.     if battler.target[0].is_a?(Game_Enemy) and @camera == battler
  2155.       @spriteset.screen_target(0, 0, 1)
  2156.     end
  2157.     # スキルラーニング
  2158.     if battler.target[0].is_a?(Game_Actor) and battler.current_action.kind == 1
  2159.       for target in battler.target
  2160.         skill_learning(target, target.class_id,
  2161.                         battler.current_action.skill_id)
  2162.       end
  2163.     end
  2164.     # アクション強制対象のバトラーをクリア
  2165.     if battler.current_action.forcing == true and
  2166.         battler.current_action.force_kind == 0 and
  2167.         battler.current_action.force_basic == 0 and
  2168.         battler.current_action.force_skill_id == 0
  2169.       $game_temp.forcing_battler = nil
  2170.       battler.current_action.forcing = false
  2171.     end
  2172.     refresh_phase(battler)
  2173.     speller = synthe?(battler)
  2174.     if speller != nil
  2175.       for spell in speller
  2176.         if spell != battler
  2177.           refresh_phase(spell)
  2178.         end
  2179.       end
  2180.       synthe_delete(speller)
  2181.     end
  2182.     # コモンイベント ID が有効の場合
  2183.     if battler.event > 0
  2184.       # イベントをセットアップ
  2185.       common_event = $data_common_events[battler.event]
  2186.       $game_system.battle_interpreter.setup(common_event.list, 0)
  2187.     end
  2188.     act = 0
  2189.     for actor in $game_party.actors + $game_troop.enemies
  2190.       if actor.movable?
  2191.         act += 1
  2192.       end
  2193.     end
  2194.     if @turn_cnt >= act and act > 0
  2195.       @turn_cnt %= act
  2196.       $game_temp.battle_turn += 1
  2197.       # バトルイベントの全ページを検索
  2198.       for index in 0...$data_troops[@troop_id].pages.size
  2199.         # イベントページを取得
  2200.         page = $data_troops[@troop_id].pages[index]
  2201.         # このページのスパンが [ターン] の場合
  2202.         if page.span == 1
  2203.           # 実行済みフラグをクリア
  2204.           $game_temp.battle_event_flags[index] = false
  2205.         end
  2206.       end
  2207.     end
  2208.     battler.phase = 1
  2209.     @action_battlers.delete(battler)
  2210.   end
  2211.   #--------------------------------------------------------------------------
  2212.   # ● リフレッシュ
  2213.   #--------------------------------------------------------------------------
  2214.   def refresh_phase(battler)
  2215.     battler.at -= @max
  2216.     if battler.movable?
  2217.       battler.atp = 100 * battler.at / @max
  2218.     end
  2219.     spell_reset(battler)
  2220.     # スリップダメージ
  2221.     if battler.hp > 0 and battler.slip_damage?
  2222.       battler.slip_damage_effect
  2223.       battler.damage_pop["slip"] = true
  2224.     end
  2225.     # ステート自然解除
  2226.     battler.remove_states_auto
  2227.     # ステータスウィンドウをリフレッシュ
  2228.     status_refresh(battler, true)
  2229.     unless battler.movable?
  2230.       return
  2231.     end
  2232.     # ターン数カウント
  2233.     @turn_cnt += 1
  2234.   end
  2235.   #--------------------------------------------------------------------------
  2236.   # ● バトラーアクションスタート
  2237.   #--------------------------------------------------------------------------
  2238.   def action_start(battler)
  2239.     battler.phase = 1
  2240.     battler.anime1 = 0
  2241.     battler.anime2 = 0
  2242.     battler.target = []
  2243.     battler.event = 0
  2244.     @action_battlers.unshift(battler)
  2245.   end
  2246.   #--------------------------------------------------------------------------
  2247.   # ● ステータスウィンドウをリフレッシュ
  2248.   #--------------------------------------------------------------------------
  2249.   def status_refresh(battler, at = false)
  2250.     if battler.is_a?(Game_Actor)
  2251.       for i in 0...$game_party.actors.size
  2252.         if battler == $game_party.actors[i]
  2253.           number = i + 1
  2254.         end
  2255.       end
  2256.       @status_window.refresh(number)
  2257.       if at == true
  2258.         @status_window.at_refresh(number)
  2259.       end
  2260.     end
  2261.   end
  2262.   #--------------------------------------------------------------------------
  2263.   # ● アニメウェイト判断処理
  2264.   #--------------------------------------------------------------------------
  2265.   def anime_wait_return
  2266.     if (@action_battlers.empty? or @anime_wait == false) and
  2267.         not $game_system.battle_interpreter.running?
  2268.       # エネミーアローが有効の場合
  2269.       if @enemy_arrow != nil
  2270.         return [@active - 2, 0].min == 0
  2271.       # アクターアローが有効の場合
  2272.       elsif @actor_arrow != nil
  2273.         return [@active - 2, 0].min == 0
  2274.       # スキルウィンドウが有効の場合
  2275.       elsif @skill_window != nil
  2276.         return [@active - 3, 0].min == 0
  2277.       # アイテムウィンドウが有効の場合
  2278.       elsif @item_window != nil
  2279.         return [@active - 3, 0].min == 0
  2280.       # アクターコマンドウィンドウが有効の場合
  2281.       elsif @actor_command_window.active
  2282.         return [@active - 1, 0].min == 0
  2283.       else
  2284.         return true
  2285.       end
  2286.     else
  2287.       return false
  2288.     end
  2289.   end
  2290.   #--------------------------------------------------------------------------
  2291.   # ● アクターコマンド消去判断
  2292.   #--------------------------------------------------------------------------
  2293.   def command_delete
  2294.     # エネミーアローが有効の場合
  2295.     if @enemy_arrow != nil
  2296.       end_enemy_select
  2297.     # アクターアローが有効の場合
  2298.     elsif @actor_arrow != nil
  2299.       end_actor_select
  2300.     end
  2301.     # スキルウィンドウが有効の場合
  2302.     if @skill_window != nil
  2303.       end_skill_select
  2304.     # アイテムウィンドウが有効の場合
  2305.     elsif @item_window != nil
  2306.       end_item_select
  2307.     end
  2308.     # アクターコマンドウィンドウが有効の場合
  2309.     if @actor_command_window.active
  2310.       @command.shift
  2311.       @command_a = false
  2312.       # メインフェーズフラグをセット
  2313.       $game_temp.battle_main_phase = true
  2314.       # アクターコマンドウィンドウを無効化
  2315.       @actor_command_window.active = false
  2316.       @actor_command_window.visible = false
  2317.       # アクターの明滅エフェクト OFF
  2318.       if @active_actor != nil
  2319.         @active_actor.blink = false
  2320.       end
  2321.     end
  2322.   end
  2323.   #--------------------------------------------------------------------------
  2324.   # ● 強制アクション設定
  2325.   #--------------------------------------------------------------------------
  2326.   def force_action(battler)
  2327.     battler.current_action.kind = battler.current_action.force_kind
  2328.     battler.current_action.basic = battler.current_action.force_basic
  2329.     battler.current_action.skill_id = battler.current_action.force_skill_id
  2330.     battler.current_action.force_kind = 0
  2331.     battler.current_action.force_basic = 0
  2332.     battler.current_action.force_skill_id = 0
  2333.   end
  2334.   #--------------------------------------------------------------------------
  2335.   # ● カメラセット
  2336.   #--------------------------------------------------------------------------
  2337.   def camera_set(battler)
  2338.     @camera = battler
  2339.     if battler.target.size == 1
  2340.       if battler.current_action.kind == 0
  2341.         zoom = 1.2 / battler.target[0].zoom
  2342.       elsif synthe?(battler) == nil
  2343.         zoom = 1.5 / battler.target[0].zoom
  2344.       else
  2345.         zoom = 2.0 / battler.target[0].zoom
  2346.       end
  2347.       @spriteset.screen_target(battler.target[0].attack_x(zoom),
  2348.                                 battler.target[0].attack_y(zoom), zoom)
  2349.     else
  2350.       @spriteset.screen_target(0, 0, 0.75)
  2351.     end
  2352.   end
  2353.   #--------------------------------------------------------------------------
  2354.   # ● スキル詠唱タイム作成
  2355.   #--------------------------------------------------------------------------
  2356.   def recite_time(battler)
  2357.   end
  2358.   #--------------------------------------------------------------------------
  2359.   # ● 連携スキル判別
  2360.   #--------------------------------------------------------------------------
  2361.   def synthe_spell(battler)
  2362.   end
  2363.   #--------------------------------------------------------------------------
  2364.   # ● スキルラーニングシステム
  2365.   #--------------------------------------------------------------------------
  2366.   def skill_learning(actor, class_id, skill_id)
  2367.   end
  2368.   #--------------------------------------------------------------------------
  2369.   # ● 行動可能判定
  2370.   #--------------------------------------------------------------------------
  2371.   def active?(battler)
  2372.     speller = synthe?(battler)
  2373.     if speller != nil
  2374.       if synthe_delete?(speller)
  2375.         return false
  2376.       end
  2377.     else
  2378.       unless battler.inputable?
  2379.         spell_reset(battler)
  2380.         unless battler.movable?
  2381.           battler.atp = 0
  2382.           return false
  2383.         end
  2384.       end
  2385.       if battler.current_action.forcing
  2386.         spell_reset(battler)
  2387.       end
  2388.     end
  2389.     return true
  2390.   end
  2391.   #--------------------------------------------------------------------------
  2392.   # ● 合成スキル詠唱中か?
  2393.   #--------------------------------------------------------------------------
  2394.   def synthe?(battler)
  2395.     for speller in @synthe
  2396.       if speller.include?(battler)
  2397.         return speller
  2398.       end
  2399.     end
  2400.     return nil
  2401.   end
  2402.   #--------------------------------------------------------------------------
  2403.   # ● 合成スキル消去判断
  2404.   #--------------------------------------------------------------------------
  2405.   def synthe_delete?(speller)
  2406.     for battler in speller
  2407.       if not battler.inputable? and dead_ok?(battler)
  2408.         synthe_delete(speller)
  2409.         return true
  2410.       end
  2411.     end
  2412.     return false
  2413.   end
  2414.   #--------------------------------------------------------------------------
  2415.   # ● 合成スキル消去
  2416.   #--------------------------------------------------------------------------
  2417.   def synthe_delete(speller)
  2418.     for battler in speller
  2419.       spell_reset(battler)
  2420.       if dead_ok?(battler)
  2421.         @action_battlers.delete(battler)
  2422.       end
  2423.     end
  2424.     @synthe.delete(speller)
  2425.   end
  2426.   #--------------------------------------------------------------------------
  2427.   # ● 連携含むスキル詠唱解除
  2428.   #--------------------------------------------------------------------------
  2429.   def skill_reset(battler)
  2430.     speller = synthe?(battler)
  2431.     if speller != nil
  2432.       synthe_delete(speller)
  2433.     else
  2434.       spell_reset(battler)
  2435.     end
  2436.   end
  2437.   #--------------------------------------------------------------------------
  2438.   # ● スキル詠唱解除
  2439.   #--------------------------------------------------------------------------
  2440.   def spell_reset(battler)
  2441.     battler.rt = 0
  2442.     battler.rtp = 0
  2443.     battler.blink = false
  2444.     battler.spell = false
  2445.     battler.current_action.spell_id = 0
  2446.     @spell_p.delete(battler)
  2447.     @spell_e.delete(battler)
  2448.   end
  2449.   #--------------------------------------------------------------------------
  2450.   # ● 戦闘終了判定
  2451.   #--------------------------------------------------------------------------
  2452.   def fin?
  2453.    return (victory? or $game_party.all_dead? or $game_party.actors.size == 0)
  2454.   end
  2455.   #--------------------------------------------------------------------------
  2456.   # ● 敵全滅判定
  2457.   #--------------------------------------------------------------------------
  2458.   def victory?
  2459.     for battler in $game_troop.enemies
  2460.       if not battler.hidden and (battler.rest_hp > 0 or
  2461.           battler.immortal or battler.damage_pop.size > 0)
  2462.         return false
  2463.       end
  2464.     end
  2465.     return true
  2466.   end
  2467.   #--------------------------------------------------------------------------
  2468.   # ● 死亡許可判定
  2469.   #--------------------------------------------------------------------------
  2470.   def dead_ok?(battler)
  2471.     speller = synthe?(battler)
  2472.     if speller == nil
  2473.       if @action_battlers.include?(battler)
  2474.         if battler.phase > 2
  2475.           return false
  2476.         end
  2477.       end
  2478.     else
  2479.       for battler in speller
  2480.         if @action_battlers.include?(battler)
  2481.           if battler.phase > 2
  2482.             return false
  2483.           end
  2484.         end
  2485.       end
  2486.     end
  2487.     return true
  2488.   end
  2489. end
  2490.  
  2491. #==============================================================================
  2492. # ■ Game_Actor
  2493. #------------------------------------------------------------------------------
  2494. #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
  2495. # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
  2496. #==============================================================================
  2497.  
  2498. class Game_Actor < Game_Battler
  2499.   #--------------------------------------------------------------------------
  2500.   # ● バトル画面 X 座標の取得
  2501.   #--------------------------------------------------------------------------
  2502.   def screen_x
  2503.     # パーティ内の並び順から X 座標を計算して返す
  2504.     if self.index != nil
  2505.       return self.index * 160 + (4 - $game_party.actors.size) * 80 + 80
  2506.     else
  2507.       return 0
  2508.     end
  2509.   end
  2510. end
  2511.  
  2512. #==============================================================================
  2513. # ■ Spriteset_Battle
  2514. #------------------------------------------------------------------------------
  2515. #  バトル画面のスプライトをまとめたクラスです。このクラスは Scene_Battle クラ
  2516. # スの内部で使用されます。
  2517. #==============================================================================
  2518.  
  2519. class Spriteset_Battle
  2520.   #--------------------------------------------------------------------------
  2521.   # ● 公開インスタンス変数
  2522.   #--------------------------------------------------------------------------
  2523.   attr_reader   :real_x                   # x座標補正(現在値)
  2524.   attr_reader   :real_y                   # y座標補正(現在値)
  2525.   attr_reader   :real_zoom                # 拡大率(現在値)
  2526.   #--------------------------------------------------------------------------
  2527.   # ● オブジェクト初期化
  2528.   #--------------------------------------------------------------------------
  2529.   def initialize
  2530.     # ビューポートを作成
  2531.     @viewport1 = Viewport.new(0, 0, 640, 480)
  2532.     @viewport2 = Viewport.new(0, 0, 640, 480)
  2533.     @viewport3 = Viewport.new(0, 0, 640, 480)
  2534.     @viewport4 = Viewport.new(0, 0, 640, 480)
  2535.     @viewport2.z = 101
  2536.     @viewport3.z = 200
  2537.     @viewport4.z = 5000
  2538.     @wait = 0
  2539.     @real_x = 0
  2540.     @real_y = 0
  2541.     @real_zoom = 1.0
  2542.     @target_x = 0
  2543.     @target_y = 0
  2544.     @target_zoom = 1.0
  2545.     @gap_x = 0
  2546.     @gap_y = 0
  2547.     @gap_zoom = 0.0
  2548.     # バトルバックスプライトを作成
  2549.     @battleback_sprite = Sprite.new(@viewport1)
  2550.     # エネミースプライトを作成
  2551.     @enemy_sprites = []
  2552.     for enemy in $game_troop.enemies.reverse
  2553.       @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  2554.     end
  2555.     # アクタースプライトを作成
  2556.     @actor_sprites = []
  2557.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  2558.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  2559.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  2560.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  2561.     # 天候を作成
  2562.     @weather = RPG::Weather.new(@viewport1)
  2563.     # ピクチャスプライトを作成
  2564.     @picture_sprites = []
  2565.     for i in 51..100
  2566.       @picture_sprites.push(Sprite_Picture.new(@viewport3,
  2567.         $game_screen.pictures[i]))
  2568.     end
  2569.     # タイマースプライトを作成
  2570.     @timer_sprite = Sprite_Timer.new
  2571.     # フレーム更新
  2572.     update
  2573.   end
  2574.   #--------------------------------------------------------------------------
  2575.   # ● フレーム更新
  2576.   #--------------------------------------------------------------------------
  2577.   def update
  2578.     # アクタースプライトの内容を更新 (アクターの入れ替えに対応)
  2579.     @actor_sprites[0].battler = $game_party.actors[0]
  2580.     @actor_sprites[1].battler = $game_party.actors[1]
  2581.     @actor_sprites[2].battler = $game_party.actors[2]
  2582.     @actor_sprites[3].battler = $game_party.actors[3]
  2583.     # バトルバックのファイル名が現在のものと違う場合
  2584.     if @battleback_name != $game_temp.battleback_name
  2585.       make_battleback
  2586.     end
  2587.     # 画面のスクロール
  2588.     screen_scroll
  2589.     # モンスターの位置補正
  2590.     for enemy in $game_troop.enemies
  2591.       enemy.real_x = @real_x
  2592.       enemy.real_y = @real_y
  2593.       enemy.real_zoom = @real_zoom
  2594.     end
  2595.     # バトラースプライトを更新
  2596.     for sprite in @enemy_sprites + @actor_sprites
  2597.       sprite.update
  2598.     end
  2599.     # 天候グラフィックを更新
  2600.     @weather.type = $game_screen.weather_type
  2601.     @weather.max = $game_screen.weather_max
  2602.     @weather.update
  2603.     # ピクチャスプライトを更新
  2604.     for sprite in @picture_sprites
  2605.       sprite.update
  2606.     end
  2607.     # タイマースプライトを更新
  2608.     @timer_sprite.update
  2609.     # 画面の色調とシェイク位置を設定
  2610.     @viewport1.tone = $game_screen.tone
  2611.     @viewport1.ox = $game_screen.shake
  2612.     # 画面のフラッシュ色を設定
  2613.     @viewport4.color = $game_screen.flash_color
  2614.     # ビューポートを更新
  2615.     @viewport1.update
  2616.     @viewport2.update
  2617.     @viewport4.update
  2618.   end
  2619.   #--------------------------------------------------------------------------
  2620.   # ● バトル背景の設定
  2621.   #--------------------------------------------------------------------------
  2622.   def make_battleback
  2623.     @battleback_name = $game_temp.battleback_name
  2624.     if @battleback_sprite.bitmap != nil
  2625.       @battleback_sprite.bitmap.dispose
  2626.     end
  2627.     @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  2628.     if @battleback_sprite.bitmap.width == 640 and
  2629.        @battleback_sprite.bitmap.height == 320
  2630.       @battleback_sprite.src_rect.set(0, 0, 1280, 640)
  2631.       @base_zoom = 2.0
  2632.       @battleback_sprite.zoom_x = @base_zoom
  2633.       @battleback_sprite.zoom_y = @base_zoom
  2634.       @real_y = 4
  2635.       @battleback_sprite.x = 320
  2636.       @battleback_sprite.y = @real_y
  2637.       @battleback_sprite.ox = @battleback_sprite.bitmap.width / 2
  2638.       @battleback_sprite.oy = @battleback_sprite.bitmap.height / 4
  2639.     elsif @battleback_sprite.bitmap.width == 640 and
  2640.           @battleback_sprite.bitmap.height == 480
  2641.       @battleback_sprite.src_rect.set(0, 0, 960, 720)
  2642.       @base_zoom = 1.5
  2643.       @battleback_sprite.zoom_x = @base_zoom
  2644.       @battleback_sprite.zoom_y = @base_zoom
  2645.       @battleback_sprite.x = 320
  2646.       @battleback_sprite.y = 0
  2647.       @battleback_sprite.ox = @battleback_sprite.bitmap.width / 2
  2648.       @battleback_sprite.oy = @battleback_sprite.bitmap.height / 4
  2649.     else
  2650.       @battleback_sprite.src_rect.set(0, 0, @battleback_sprite.bitmap.width,
  2651.                                       @battleback_sprite.bitmap.height)
  2652.       @base_zoom = 1.0
  2653.       @battleback_sprite.zoom_x = @base_zoom
  2654.       @battleback_sprite.zoom_y = @base_zoom
  2655.       @battleback_sprite.x = 320
  2656.       @battleback_sprite.y = 0
  2657.       @battleback_sprite.ox = @battleback_sprite.bitmap.width / 2
  2658.       @battleback_sprite.oy = @battleback_sprite.bitmap.height / 4
  2659.     end
  2660.   end
  2661.   #--------------------------------------------------------------------------
  2662.   # ● 画面のスクロール目標の位置・拡大率設定
  2663.   #--------------------------------------------------------------------------
  2664.   def screen_target(x, y, zoom)
  2665.     return unless $scene.drive
  2666.     @wait = $scene.scroll_time
  2667.     @target_x = x
  2668.     @target_y = y
  2669.     @target_zoom = zoom
  2670.     screen_over
  2671.     @gap_x = @target_x - @real_x
  2672.     @gap_y = @target_y - @real_y
  2673.     @gap_zoom = @target_zoom - @real_zoom
  2674.   end
  2675.   #--------------------------------------------------------------------------
  2676.   # ● 画面のスクロール
  2677.   #--------------------------------------------------------------------------
  2678.   def screen_scroll
  2679.     if @wait > 0
  2680.       @real_x = @target_x - @gap_x * (@wait ** 2) / ($scene.scroll_time ** 2)
  2681.       @real_y = @target_y - @gap_y * (@wait ** 2) / ($scene.scroll_time ** 2)
  2682.       @real_zoom = @target_zoom -
  2683.                     @gap_zoom * (@wait ** 2) / ($scene.scroll_time ** 2)
  2684.       @battleback_sprite.x = 320 + @real_x
  2685.       @battleback_sprite.y = @real_y
  2686.       @battleback_sprite.zoom_x = @base_zoom * @real_zoom
  2687.       @battleback_sprite.zoom_y = @base_zoom * @real_zoom
  2688.       @battleback_sprite.ox = @battleback_sprite.bitmap.width / 2
  2689.       @battleback_sprite.oy = @battleback_sprite.bitmap.height / 4
  2690.       @wait -= 1
  2691.     end
  2692.   end
  2693.   #--------------------------------------------------------------------------
  2694.   # ● スクリーンが画面外に出た時の補正処理
  2695.   #--------------------------------------------------------------------------
  2696.   def screen_over
  2697.     width = @battleback_sprite.bitmap.width * @base_zoom * @target_zoom / 2
  2698.     unless 324 + @target_x > width and 324 - @target_x > width
  2699.       if 324 + @target_x > width
  2700.         @target_x = width - 324
  2701.       elsif 324 - @target_x > width
  2702.         @target_x = 324 - width
  2703.       end
  2704.     end
  2705.     height = @battleback_sprite.bitmap.height * @base_zoom * @target_zoom / 4
  2706.     unless @target_y > height - 4 and 484 - @target_y > 3 * height
  2707.       if @target_y > height - 4
  2708.         @target_y = height - 4
  2709.       elsif 484 - @target_y > 3 * height
  2710.         @target_y = 484 - 3 * height
  2711.       end
  2712.     end
  2713.   end
  2714. end
  2715.  
  2716. #==============================================================================
  2717. # ■ Game_Battler (分割定義 1)
  2718. #------------------------------------------------------------------------------
  2719. #  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ
  2720. # スのスーパークラスとして使用されます。
  2721. #==============================================================================
  2722.  
  2723. class Game_Battler
  2724.   #--------------------------------------------------------------------------
  2725.   # ● 公開インスタンス変数追加
  2726.   #--------------------------------------------------------------------------
  2727.   attr_accessor :up_level                  # レベルアップ数
  2728.   attr_accessor :at                        # AT(タイムゲージ)
  2729.   attr_accessor :atp                       # AT(表示用)
  2730.   attr_accessor :rt                        # RP(詠唱ゲージ)
  2731.   attr_accessor :rtp                       # RP(詠唱必要量)
  2732.   attr_accessor :spell                     # 合成スキル発動中
  2733.   attr_accessor :recover_hp                # HP回復量
  2734.   attr_accessor :recover_sp                # SP回復量
  2735.   attr_accessor :state_p                   # ステータス異常配列
  2736.   attr_accessor :state_m                   # ステータス異常配列
  2737.   attr_accessor :damage_sp                 # SPダメージ表示フラグ
  2738.   attr_accessor :animation                 # アニメーション ID, Hitの配列
  2739.   attr_accessor :phase
  2740.   attr_accessor :wait
  2741.   attr_accessor :target
  2742.   attr_accessor :anime1
  2743.   attr_accessor :anime2
  2744.   attr_accessor :event
  2745.   #--------------------------------------------------------------------------
  2746.   # ● オブジェクト初期化
  2747.   #--------------------------------------------------------------------------
  2748.   alias :initialize_rtab :initialize
  2749.   def initialize
  2750.     initialize_rtab
  2751.     @damage_pop = {}
  2752.     @damage = {}
  2753.     @damage_sp = {}
  2754.     @critical = {}
  2755.     @recover_hp = {}
  2756.     @recover_sp = {}
  2757.     @state_p = {}
  2758.     @state_m = {}
  2759.     @animation = []
  2760.     @phase = 1
  2761.     @wait = 0
  2762.     @target = []
  2763.     @anime1 = 0
  2764.     @anime2 = 0
  2765.     @event = 0
  2766.   end
  2767.   #--------------------------------------------------------------------------
  2768.   # ● 存在判定
  2769.   #--------------------------------------------------------------------------
  2770.   def exist?
  2771.     return (not @hidden and (@hp > 0 or @immortal or @damage.size > 0))
  2772.   end
  2773.   #--------------------------------------------------------------------------
  2774.   # ● 残HP予測
  2775.   #--------------------------------------------------------------------------
  2776.   def rest_hp
  2777.     # rest_hp に現HPを代入
  2778.     rest_hp = @hp
  2779.     # バトラーが受ける全ダメージをrest_hpに反映させる
  2780.     for pre_damage in @damage
  2781.       if pre_damage[1].is_a?(Numeric)
  2782.         rest_hp -= pre_damage[1]
  2783.       end
  2784.     end
  2785.     return rest_hp
  2786.   end
  2787.   #--------------------------------------------------------------------------
  2788.   # ● ステートの解除
  2789.   #     state_id : ステート ID
  2790.   #     force    : 強制解除フラグ (オートステートの処理で使用)
  2791.   #--------------------------------------------------------------------------
  2792.   def remove_state(state_id, force = false)
  2793.     # このステートが付加されている場合
  2794.     if state?(state_id)
  2795.       # 強制付加されたステートで、かつ解除が強制ではない場合
  2796.       if @states_turn[state_id] == -1 and not force
  2797.         # メソッド終了
  2798.         return
  2799.       end
  2800.       # 現在の HP が 0 かつ オプション [HP 0 の状態とみなす] が有効の場合
  2801.       if @hp == 0 and $data_states[state_id].zero_hp
  2802.         # ほかに [HP 0 の状態とみなす] ステートがあるかどうか判定
  2803.         zero_hp = false
  2804.         for i in @states
  2805.           if i != state_id and $data_states[i].zero_hp
  2806.             zero_hp = true
  2807.           end
  2808.         end
  2809.         # 戦闘不能を解除してよければ、HP を 1 に変更
  2810.         if zero_hp == false
  2811.           @hp = 1
  2812.         end
  2813.       end
  2814.       unless self.movable?
  2815.         # ステート ID を @states 配列および @states_turn ハッシュから削除
  2816.         @states.delete(state_id)
  2817.         @states_turn.delete(state_id)
  2818.         if self.movable?
  2819.           self.at = 0
  2820.         end
  2821.       else
  2822.         # ステート ID を @states 配列および @states_turn ハッシュから削除
  2823.         @states.delete(state_id)
  2824.         @states_turn.delete(state_id)
  2825.       end
  2826.     end
  2827.     # HP および SP の最大値チェック
  2828.     @hp = [@hp, self.maxhp].min
  2829.     @sp = [@sp, self.maxsp].min
  2830.   end
  2831.   #--------------------------------------------------------------------------
  2832.   # ● 通常攻撃の効果適用
  2833.   #     attacker : 攻撃者 (バトラー)
  2834.   #--------------------------------------------------------------------------
  2835.   def attack_effect(attacker)
  2836.     # クリティカルフラグをクリア
  2837.     self.critical[attacker] = false
  2838.     state_p[attacker] = []
  2839.     state_m[attacker] = []
  2840.     # 第一命中判定
  2841.     hit_result = (rand(100) < attacker.hit)
  2842.     # 命中の場合
  2843.     if hit_result == true
  2844.       # 基本ダメージを計算
  2845.       atk = [attacker.atk - self.pdef / 2, 0].max
  2846.       self.damage[attacker] = atk * (20 + attacker.str) / 20
  2847.       # 属性修正
  2848.       self.damage[attacker] *= elements_correct(attacker.element_set)
  2849.       self.damage[attacker] /= 100
  2850.       # ダメージの符号が正の場合
  2851.       if self.damage[attacker] > 0
  2852.         # クリティカル修正
  2853.         if rand(100) < 4 * attacker.dex / self.agi
  2854.           self.damage[attacker] *= 2
  2855.           self.critical[attacker] = true
  2856.         end
  2857.         # 防御修正
  2858.         if self.guarding?
  2859.           self.damage[attacker] /= 2
  2860.         end
  2861.       end
  2862.       # 分散
  2863.       if self.damage[attacker].abs > 0
  2864.         amp = [self.damage[attacker].abs * 15 / 100, 1].max
  2865.         self.damage[attacker] += rand(amp+1) + rand(amp+1) - amp
  2866.       end
  2867.       # 第二命中判定
  2868.       eva = 8 * self.agi / attacker.dex + self.eva
  2869.       hit = self.damage[attacker] < 0 ? 100 : 100 - eva
  2870.       hit = self.cant_evade? ? 100 : hit
  2871.       hit_result = (rand(100) < hit)
  2872.     end
  2873.     # 命中の場合
  2874.     if hit_result == true
  2875.       # ステート衝撃解除
  2876.       remove_states_shock
  2877.       # HP からダメージを減算
  2878.       # ステート変化
  2879.       @state_changed = false
  2880.       states_plus(attacker, attacker.plus_state_set)
  2881.       states_minus(attacker, attacker.minus_state_set)
  2882.     # ミスの場合
  2883.     else
  2884.       # ダメージに "Miss" を設定
  2885.       self.damage[attacker] = "Miss"
  2886.       # クリティカルフラグをクリア
  2887.       self.critical[attacker] = false
  2888.     end
  2889.     # メソッド終了
  2890.     return true
  2891.   end
  2892.   #--------------------------------------------------------------------------
  2893.   # ● スキルの効果適用
  2894.   #     user  : スキルの使用者 (バトラー)
  2895.   #     skill : スキル
  2896.   #--------------------------------------------------------------------------
  2897.   def skill_effect(user, skill)
  2898.     # クリティカルフラグをクリア
  2899.     self.critical[user] = false
  2900.     state_p[user] = []
  2901.     state_m[user] = []
  2902.     # スキルの効果範囲が HP 1 以上の味方で、自分の HP が 0、
  2903.     # またはスキルの効果範囲が HP 0 の味方で、自分の HP が 1 以上の場合
  2904.     if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0)# or
  2905.   #     ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
  2906.       # メソッド終了
  2907.       return false
  2908.     end
  2909.     # 有効フラグをクリア
  2910.     effective = false
  2911.     # コモンイベント ID が有効の場合は有効フラグをセット
  2912.     effective |= skill.common_event_id > 0
  2913.     # 第一命中判定
  2914.     hit = skill.hit
  2915.     if skill.atk_f > 0
  2916.       hit *= user.hit / 100
  2917.     end
  2918.     hit_result = (rand(100) < hit)
  2919.     # 不確実なスキルの場合は有効フラグをセット
  2920.     effective |= hit < 100
  2921.     # 命中の場合
  2922.     if hit_result == true
  2923.       # 威力を計算
  2924.       power = skill.power + user.atk * skill.atk_f / 100
  2925.       if power > 0
  2926.         power -= self.pdef * skill.pdef_f / 200
  2927.         power -= self.mdef * skill.mdef_f / 200
  2928.         power = [power, 0].max
  2929.       end
  2930.       # 倍率を計算
  2931.       rate = 20
  2932.       rate += (user.str * skill.str_f / 100)
  2933.       rate += (user.dex * skill.dex_f / 100)
  2934.       rate += (user.agi * skill.agi_f / 100)
  2935.       rate += (user.int * skill.int_f / 100)
  2936.       # 基本ダメージを計算
  2937.       self.damage[user] = power * rate / 20
  2938.       # 属性修正
  2939.       self.damage[user] *= elements_correct(skill.element_set)
  2940.       self.damage[user] /= 100
  2941.       # ダメージの符号が正の場合
  2942.       if self.damage[user] > 0
  2943.         # 防御修正
  2944.         if self.guarding?
  2945.           self.damage[user] /= 2
  2946.         end
  2947.       end
  2948.       # 分散
  2949.       if skill.variance > 0 and self.damage[user].abs > 0
  2950.         amp = [self.damage[user].abs * skill.variance / 100, 1].max
  2951.         self.damage[user] += rand(amp+1) + rand(amp+1) - amp
  2952.       end
  2953.       # 第二命中判定
  2954.       eva = 8 * self.agi / user.dex + self.eva
  2955.       hit = self.damage[user] < 0 ? 100 : 100 - eva * skill.eva_f / 100
  2956.       hit = self.cant_evade? ? 100 : hit
  2957.       hit_result = (rand(100) < hit)
  2958.       # 不確実なスキルの場合は有効フラグをセット
  2959.       effective |= hit < 100
  2960.     end
  2961.     # 命中の場合
  2962.     if hit_result == true
  2963.       # 威力 0 以外の物理攻撃の場合
  2964.       if skill.power != 0 and skill.atk_f > 0
  2965.         # ステート衝撃解除
  2966.         remove_states_shock
  2967.         # 有効フラグをセット
  2968.         effective = true
  2969.       end
  2970.       # HP の変動判定
  2971.       last_hp = [[self.hp - self.damage[user], self.maxhp].min, 0].max
  2972.       # 効果判定
  2973.       effective |= self.hp != last_hp
  2974.       # ステート変化
  2975.       @state_changed = false
  2976.       effective |= states_plus(user, skill.plus_state_set)
  2977.       effective |= states_minus(user, skill.minus_state_set)
  2978.       unless $game_temp.in_battle
  2979.         self.damage_effect(user, 1, skill)
  2980.       end
  2981.       # 威力が 0 の場合
  2982.       if skill.power == 0
  2983.         # ダメージに空文字列を設定
  2984.         self.damage[user] = ""
  2985.         # ステートに変化がない場合
  2986.         unless @state_changed
  2987.           # ダメージに "Miss" を設定
  2988.           self.damage[user] = "Miss"
  2989.         end
  2990.       end
  2991.     # ミスの場合
  2992.     else
  2993.       # ダメージに "Miss" を設定
  2994.       self.damage[user] = "Miss"
  2995.     end
  2996.     # 戦闘中でない場合
  2997.     unless $game_temp.in_battle
  2998.       # ダメージに nil を設定
  2999.       self.damage[user] = nil
  3000.     end
  3001.     # メソッド終了
  3002.     return effective
  3003.   end
  3004.   #--------------------------------------------------------------------------
  3005.   # ● アイテムの効果適用
  3006.   #     item : アイテム
  3007.   #--------------------------------------------------------------------------
  3008.   def item_effect(item, user = $game_party.actors[0])
  3009.     # クリティカルフラグをクリア
  3010.     self.critical[user] = false
  3011.     state_p[user] = []
  3012.     state_m[user] = []
  3013.     self.recover_hp[user] = 0
  3014.     self.recover_sp[user] = 0
  3015.     # アイテムの効果範囲が HP 1 以上の味方で、自分の HP が 0、
  3016.     # またはアイテムの効果範囲が HP 0 の味方で、自分の HP が 1 以上の場合
  3017.     if ((item.scope == 3 or item.scope == 4) and self.hp == 0)# or
  3018.     #   ((item.scope == 5 or item.scope == 6) and self.hp >= 1)
  3019.       # メソッド終了
  3020.       return false
  3021.     end
  3022.     # 有効フラグをクリア
  3023.     effective = false
  3024.     # コモンイベント ID が有効の場合は有効フラグをセット
  3025.     effective |= item.common_event_id > 0
  3026.     # 命中判定
  3027.     hit_result = (rand(100) < item.hit)
  3028.     # 不確実なスキルの場合は有効フラグをセット
  3029.     effective |= item.hit < 100
  3030.     # 命中の場合
  3031.     if hit_result == true
  3032.       # 回復量を計算
  3033.       self.recover_hp[user] = maxhp * item.recover_hp_rate / 100 +
  3034.                               item.recover_hp
  3035.       self.recover_sp[user] = maxsp * item.recover_sp_rate / 100 +
  3036.                               item.recover_sp
  3037.       if self.recover_hp[user] < 0
  3038.         self.recover_hp[user] += self.pdef * item.pdef_f / 20
  3039.         self.recover_hp[user] += self.mdef * item.mdef_f / 20
  3040.         self.recover_hp[user] = [self.recover_hp[user], 0].min
  3041.       end
  3042.       # 属性修正
  3043.       self.recover_hp[user] *= elements_correct(item.element_set)
  3044.       self.recover_hp[user] /= 100
  3045.       self.recover_sp[user] *= elements_correct(item.element_set)
  3046.       self.recover_sp[user] /= 100
  3047.       # 分散
  3048.       if item.variance > 0 and self.recover_hp[user].abs > 0
  3049.         amp = [self.recover_hp[user].abs * item.variance / 100, 1].max
  3050.         self.recover_hp[user] += rand(amp+1) + rand(amp+1) - amp
  3051.       end
  3052.       if item.variance > 0 and self.recover_sp[user].abs > 0
  3053.         amp = [self.recover_sp[user].abs * item.variance / 100, 1].max
  3054.         self.recover_sp[user] += rand(amp+1) + rand(amp+1) - amp
  3055.       end
  3056.       # 回復量の符号が負の場合
  3057.       if self.recover_hp[user] < 0
  3058.         # 防御修正
  3059.         if self.guarding?
  3060.           self.recover_hp[user] /= 2
  3061.         end
  3062.       end
  3063.       # HP 回復量の符号を反転し、ダメージの値に設定
  3064.       self.damage[user] = -self.recover_hp[user]
  3065.       # HP および SP の変動判定
  3066.       last_hp = [[self.hp + self.recover_hp[user], self.maxhp].min, 0].max
  3067.       last_sp = [[self.sp + self.recover_sp[user], self.maxsp].min, 0].max
  3068.       effective |= self.hp != last_hp
  3069.       effective |= self.sp != last_sp
  3070.       # ステート変化
  3071.       @state_changed = false
  3072.       effective |= states_plus(user, item.plus_state_set)
  3073.       effective |= states_minus(user, item.minus_state_set)
  3074.       unless $game_temp.in_battle
  3075.         self.damage_effect(user, 2, nil)
  3076.       end
  3077.       # パラメータ上昇値が有効の場合
  3078.       if item.parameter_type > 0 and item.parameter_points != 0
  3079.         # パラメータで分岐
  3080.         case item.parameter_type
  3081.         when 1  # MaxHP
  3082.           @maxhp_plus += item.parameter_points
  3083.         when 2  # MaxSP
  3084.           @maxsp_plus += item.parameter_points
  3085.         when 3  # 腕力
  3086.           @str_plus += item.parameter_points
  3087.         when 4  # 器用さ
  3088.           @dex_plus += item.parameter_points
  3089.         when 5  # 素早さ
  3090.           @agi_plus += item.parameter_points
  3091.         when 6  # 魔力
  3092.           @int_plus += item.parameter_points
  3093.         end
  3094.         # 有効フラグをセット
  3095.         effective = true
  3096.       end
  3097.       # HP 回復率と回復量が 0 の場合
  3098.       if item.recover_hp_rate == 0 and item.recover_hp == 0
  3099.         # ダメージに空文字列を設定
  3100.         self.damage[user] = ""
  3101.         # SP 回復率と回復量が 0、パラメータ上昇値が無効の場合
  3102.         if item.recover_sp_rate == 0 and item.recover_sp == 0 and
  3103.            (item.parameter_type == 0 or item.parameter_points == 0)
  3104.           # ステートに変化がない場合
  3105.           unless @state_changed
  3106.             # ダメージに "Miss" を設定
  3107.             self.damage[user] = "Miss"
  3108.           end
  3109.         end
  3110.       end
  3111.     # ミスの場合
  3112.     else
  3113.       # ダメージに "Miss" を設定
  3114.       self.damage[user] = "Miss"
  3115.     end
  3116.     # 戦闘中でない場合
  3117.     unless $game_temp.in_battle
  3118.       # ダメージに nil を設定
  3119.       self.damage[user] = nil
  3120.     end
  3121.     # メソッド終了
  3122.     return effective
  3123.   end
  3124.   #--------------------------------------------------------------------------
  3125.   # ● ステート変化 (+) の適用
  3126.   #     plus_state_set  : ステート変化 (+)
  3127.   #--------------------------------------------------------------------------
  3128.   def states_plus(battler, plus_state_set)
  3129.     # 有効フラグをクリア
  3130.     effective = false
  3131.     # ループ (付加するステート)
  3132.     for i in plus_state_set
  3133.       # このステートが防御されていない場合
  3134.       unless self.state_guard?(i)
  3135.         # このステートがフルでなければ有効フラグをセット
  3136.         effective |= self.state_full?(i) == false
  3137.         # ステートが [抵抗しない] の場合
  3138.         if $data_states[i].nonresistance
  3139.           # ステート変化フラグをセット
  3140.           @state_changed = true
  3141.           # ステートを付加
  3142.           self.state_p[battler].push(i)
  3143.         # このステートがフルではない場合
  3144.         elsif self.state_full?(i) == false
  3145.           # ステート有効度を確率に変換し、乱数と比較
  3146.           if rand(100) < [0,100,80,60,40,20,0][self.state_ranks[i]]
  3147.             # ステート変化フラグをセット
  3148.             @state_changed = true
  3149.             # ステートを付加
  3150.             self.state_p[battler].push(i)
  3151.           end
  3152.         end
  3153.       end
  3154.     end
  3155.     # メソッド終了
  3156.     return effective
  3157.   end
  3158.   #--------------------------------------------------------------------------
  3159.   # ● ステート変化 (-) の適用
  3160.   #     minus_state_set : ステート変化 (-)
  3161.   #--------------------------------------------------------------------------
  3162.   def states_minus(battler, minus_state_set)
  3163.     # 有効フラグをクリア
  3164.     effective = false
  3165.     # ループ (解除するステート)
  3166.     for i in minus_state_set
  3167.       # このステートが付加されていれば有効フラグをセット
  3168.       effective |= self.state?(i)
  3169.       # ステート変化フラグをセット
  3170.       @state_changed = true
  3171.       # ステートを解除
  3172.       self.state_m[battler].push(i)
  3173.     end
  3174.     # メソッド終了
  3175.     return effective
  3176.   end
  3177.   #--------------------------------------------------------------------------
  3178.   # ● ダメージ演算
  3179.   #--------------------------------------------------------------------------
  3180.   def damage_effect(battler, item)
  3181.     if item == 2
  3182.       self.hp += self.recover_hp[battler]
  3183.       self.sp += self.recover_sp[battler]
  3184.       if self.recover_sp[battler] != 0
  3185.         self.damage_sp[battler] = -self.recover_sp[battler]
  3186.       end
  3187.       self.recover_hp.delete(battler)
  3188.       self.recover_sp.delete(battler)
  3189.     else
  3190.       if self.damage[battler].class != String
  3191.         self.hp -= self.damage[battler]
  3192.       end
  3193.     end
  3194.     for i in self.state_p[battler]
  3195.       add_state(i)
  3196.     end
  3197.     for i in self.state_m[battler]
  3198.       remove_state(i)
  3199.     end
  3200.   end
  3201.   #--------------------------------------------------------------------------
  3202.   # ● スリップダメージの効果適用
  3203.   #--------------------------------------------------------------------------
  3204.   def slip_damage_effect
  3205.     # ダメージを設定
  3206.     self.damage["slip"] = self.maxhp / 10
  3207.     # 分散
  3208.     if self.damage["slip"].abs > 0
  3209.       amp = [self.damage["slip"].abs * 15 / 100, 1].max
  3210.       self.damage["slip"] += rand(amp+1) + rand(amp+1) - amp
  3211.     end
  3212.     # HP からダメージを減算
  3213.     self.hp -= self.damage["slip"]
  3214.     # メソッド終了
  3215.     return true
  3216.   end
  3217. end
  3218.  
  3219. #==============================================================================
  3220. # ■ Game_BattleAction
  3221. #------------------------------------------------------------------------------
  3222. #  アクション (戦闘中の行動) を扱うクラスです。このクラスは Game_Battler クラ
  3223. # スの内部で使用されます。
  3224. #==============================================================================
  3225.  
  3226. class Game_BattleAction
  3227.   #--------------------------------------------------------------------------
  3228.   # ● 公開インスタンス変数
  3229.   #--------------------------------------------------------------------------
  3230.   attr_accessor :spell_id                 # 合体魔法用スキル ID
  3231.   attr_accessor :force_kind               # 種別 (基本 / スキル / アイテム)
  3232.   attr_accessor :force_basic              # 基本 (攻撃 / 防御 / 逃げる)
  3233.   attr_accessor :force_skill_id           # スキル ID
  3234.   #--------------------------------------------------------------------------
  3235.   # ● 有効判定
  3236.   #--------------------------------------------------------------------------
  3237.   def valid?
  3238.     return (not (@force_kind == 0 and @force_basic == 3))
  3239.   end
  3240. end
  3241.  
  3242. #==============================================================================
  3243. # ■ Game_Actor
  3244. #------------------------------------------------------------------------------
  3245. #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
  3246. # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
  3247. #==============================================================================
  3248.  
  3249. class Game_Actor < Game_Battler
  3250.   def skill_can_use?(skill_id)
  3251.     return super
  3252.   end
  3253. end
  3254.  
  3255. #==============================================================================
  3256. # ■ Game_Enemy
  3257. #------------------------------------------------------------------------------
  3258. #  エネミーを扱うクラスです。このクラスは Game_Troop クラス ($game_troop) の
  3259. # 内部で使用されます。
  3260. #==============================================================================
  3261.  
  3262. class Game_Enemy < Game_Battler
  3263.   #--------------------------------------------------------------------------
  3264.   # ● 公開インスタンス変数
  3265.   #--------------------------------------------------------------------------
  3266.   attr_accessor :height                  # 画像の高さ
  3267.   attr_accessor :real_x                  # X座標補正
  3268.   attr_accessor :real_y                  # Y座標補正
  3269.   attr_accessor :real_zoom               # 拡大率
  3270.   #--------------------------------------------------------------------------
  3271.   # ● オブジェクト初期化
  3272.   #     troop_id     : トループ ID
  3273.   #     member_index : トループメンバーのインデックス
  3274.   #--------------------------------------------------------------------------
  3275.   def initialize(troop_id, member_index)
  3276.     super()
  3277.     @troop_id = troop_id
  3278.     @member_index = member_index
  3279.     troop = $data_troops[@troop_id]
  3280.     @enemy_id = troop.members[@member_index].enemy_id
  3281.     enemy = $data_enemies[@enemy_id]
  3282.     @battler_name = enemy.battler_name
  3283.     @battler_hue = enemy.battler_hue
  3284.     @hp = maxhp
  3285.     @sp = maxsp
  3286.     @real_x = 0
  3287.     @real_y = 0
  3288.     @real_zoom = 1.0
  3289.     @fly = 0
  3290.     enemy.name.sub(/\\[Ff]\[([0-9]+)\]/) {@fly = $1.to_i}
  3291.     @hidden = troop.members[@member_index].hidden
  3292.     @immortal = troop.members[@member_index].immortal
  3293.   end
  3294.   alias :true_x :screen_x
  3295.   alias :true_y :screen_y
  3296.   #--------------------------------------------------------------------------
  3297.   # ● バトル画面 X 座標の取得
  3298.   #--------------------------------------------------------------------------
  3299.   def screen_x
  3300.     return 320 + (true_x - 320) * @real_zoom + @real_x
  3301.   end
  3302.   #--------------------------------------------------------------------------
  3303.   # ● バトル画面 Y 座標の取得
  3304.   #--------------------------------------------------------------------------
  3305.   def screen_y
  3306.     return true_y * @real_zoom + @real_y
  3307.   end
  3308.   #--------------------------------------------------------------------------
  3309.   # ● バトル画面 Z 座標の取得
  3310.   #--------------------------------------------------------------------------
  3311.   def screen_z
  3312.     return true_y + @fly
  3313.   end
  3314.   #--------------------------------------------------------------------------
  3315.   # ● バトル画面 拡大率の取得
  3316.   #--------------------------------------------------------------------------
  3317.   def zoom
  3318.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  3319.                           (true_y + @fly) / 320 + $scene.zoom_rate[0]
  3320.   end
  3321.   #--------------------------------------------------------------------------
  3322.   # ● 攻撃用、バトル画面 X 座標の取得
  3323.   #--------------------------------------------------------------------------
  3324.   def attack_x(z)
  3325.     return (320 - true_x) * z * 0.75
  3326.   end
  3327.   #--------------------------------------------------------------------------
  3328.   # ● 攻撃用、バトル画面 Y 座標の取得
  3329.   #--------------------------------------------------------------------------
  3330.   def attack_y(z)
  3331.     return (160 - (true_y + @fly / 4) * z + @height * zoom * z / 2) * 0.75
  3332.   end
  3333.   #--------------------------------------------------------------------------
  3334.   # ● アクション作成
  3335.   #--------------------------------------------------------------------------
  3336.   def make_action
  3337.     # カレントアクションをクリア
  3338.     self.current_action.clear
  3339.     # 動けない場合
  3340.     unless self.inputable?
  3341.       # メソッド終了
  3342.       return
  3343.     end
  3344.     # 現在有効なアクションを抽出
  3345.     available_actions = []
  3346.     rating_max = 0
  3347.     for action in self.actions
  3348.       # ターン 条件確認
  3349.       n = $game_temp.battle_turn
  3350.       a = action.condition_turn_a
  3351.       b = action.condition_turn_b
  3352.       if (b == 0 and n != a) or
  3353.          (b > 0 and (n < 1 or n < a or n % b != a % b))
  3354.         next
  3355.       end
  3356.       # HP 条件確認
  3357.       if self.hp * 100.0 / self.maxhp > action.condition_hp
  3358.         next
  3359.       end
  3360.       # レベル 条件確認
  3361.       if $game_party.max_level < action.condition_level
  3362.         next
  3363.       end
  3364.       # スイッチ 条件確認
  3365.       switch_id = action.condition_switch_id
  3366.       if switch_id > 0 and $game_switches[switch_id] == false
  3367.         next
  3368.       end
  3369.       # スキル使用可能 条件確認
  3370.       if action.kind == 1
  3371.         unless self.skill_can_use?(action.skill_id)
  3372.           next
  3373.         end
  3374.       end
  3375.       # 条件に該当 : このアクションを追加
  3376.       available_actions.push(action)
  3377.       if action.rating > rating_max
  3378.         rating_max = action.rating
  3379.       end
  3380.     end
  3381.     # 最大のレーティング値を 3 として合計を計算 (0 以下は除外)
  3382.     ratings_total = 0
  3383.     for action in available_actions
  3384.       if action.rating > rating_max - 3
  3385.         ratings_total += action.rating - (rating_max - 3)
  3386.       end
  3387.     end
  3388.     # レーティングの合計が 0 ではない場合
  3389.     if ratings_total > 0
  3390.       # 乱数を作成
  3391.       value = rand(ratings_total)
  3392.       # 作成した乱数に対応するものをカレントアクションに設定
  3393.       for action in available_actions
  3394.         if action.rating > rating_max - 3
  3395.           if value < action.rating - (rating_max - 3)
  3396.             self.current_action.kind = action.kind
  3397.             self.current_action.basic = action.basic
  3398.             self.current_action.skill_id = action.skill_id
  3399.             self.current_action.decide_random_target_for_enemy
  3400.             return
  3401.           else
  3402.             value -= action.rating - (rating_max - 3)
  3403.           end
  3404.         end
  3405.       end
  3406.     end
  3407.   end
  3408. end
  3409.  
  3410. #==============================================================================
  3411. # ■ Game_Party
  3412. #------------------------------------------------------------------------------
  3413. #  パーティを扱うクラスです。ゴールドやアイテムなどの情報が含まれます。このク
  3414. # ラスのインスタンスは $game_party で参照されます。
  3415. #==============================================================================
  3416.  
  3417. class Game_Party
  3418.   #--------------------------------------------------------------------------
  3419.   # ● 全滅判定
  3420.   #--------------------------------------------------------------------------
  3421.   def all_dead?
  3422.     # パーティ人数が 0 人の場合
  3423.     if $game_party.actors.size == 0
  3424.       return false
  3425.     end
  3426.     # HP 0 以上のアクターがパーティにいる場合
  3427.     for actor in @actors
  3428.       if actor.rest_hp > 0
  3429.         return false
  3430.       end
  3431.     end
  3432.     # 全滅
  3433.     return true
  3434.   end
  3435.   #--------------------------------------------------------------------------
  3436.   # ● 対象アクターのランダムな決定
  3437.   #     hp0 : HP 0 のアクターに限る
  3438.   #--------------------------------------------------------------------------
  3439.   # オリジナルのターゲット決定ルーチンを smooth_target_actor_rtab と名前変更
  3440.   alias :random_target_actor_rtab :random_target_actor
  3441.   def random_target_actor(hp0 = false)
  3442.     # ルーレットを初期化
  3443.     roulette = []
  3444.     # ループ
  3445.     for actor in @actors
  3446.       # 条件に該当する場合
  3447.       if (not hp0 and actor.exist? and actor.rest_hp > 0) or
  3448.           (hp0 and actor.hp0?)
  3449.         # アクターのクラスの [位置] を取得
  3450.         position = $data_classes[actor.class_id].position
  3451.         # 前衛のとき n = 4、中衛のとき n = 3、後衛のとき n = 2
  3452.         n = 4 - position
  3453.         # ルーレットにアクターを n 回追加
  3454.         n.times do
  3455.           roulette.push(actor)
  3456.         end
  3457.       end
  3458.     end
  3459.     # ルーレットのサイズが 0 の場合
  3460.     if roulette.size == 0
  3461.       return random_target_actor_rtab(hp0)
  3462.     end
  3463.     # ルーレットを回し、アクターを決定
  3464.     return roulette[rand(roulette.size)]
  3465.   end
  3466.   #--------------------------------------------------------------------------
  3467.   # ● 対象アクターのスムーズな決定
  3468.   #     actor_index : アクターインデックス
  3469.   #--------------------------------------------------------------------------
  3470.   # オリジナルのターゲット決定ルーチンを smooth_target_actor_rtab と名前変更
  3471.   alias :smooth_target_actor_rtab :smooth_target_actor
  3472.   def smooth_target_actor(actor_index)
  3473.     # アクターを取得
  3474.     actor = @actors[actor_index]
  3475.     # アクターが存在する場合
  3476.     if actor != nil and actor.exist? and actor.rest_hp > 0
  3477.       return actor
  3478.     end
  3479.     # ループ
  3480.     for actor in @actors
  3481.       # アクターが存在する場合
  3482.       if actor.exist? and actor.rest_hp > 0
  3483.         return actor
  3484.       end
  3485.     end
  3486.     # 味方が全滅している場合、オリジナルのターゲット決定ルーチンを実行する
  3487.     return smooth_target_actor_rtab(actor_index)
  3488.   end
  3489. end
  3490.  
  3491. #==============================================================================
  3492. # ■ Game_Troop
  3493. #------------------------------------------------------------------------------
  3494. #  トループを扱うクラスです。このクラスのインスタンスは $game_troop で参照さ
  3495. # れます。
  3496. #==============================================================================
  3497.  
  3498. class Game_Troop
  3499.   #--------------------------------------------------------------------------
  3500.   # ● 対象エネミーのランダムな決定
  3501.   #     hp0 : HP 0 のエネミーに限る
  3502.   #--------------------------------------------------------------------------
  3503.   # オリジナルのターゲット決定ルーチンを random_target_enemy_rtab と名前変更
  3504.   alias :random_target_enemy_rtab :random_target_enemy
  3505.   def random_target_enemy(hp0 = false)
  3506.     # ルーレットを初期化
  3507.     roulette = []
  3508.     # ループ
  3509.     for enemy in @enemies
  3510.       # 条件に該当する場合
  3511.       if (not hp0 and enemy.exist? and enemy.rest_hp > 0) or
  3512.           (hp0 and enemy.hp0?)
  3513.         # ルーレットにエネミーを追加
  3514.         roulette.push(enemy)
  3515.       end
  3516.     end
  3517.     # ルーレットのサイズが 0 の場合
  3518.     if roulette.size == 0
  3519.       return random_target_enemy_rtab(hp0)
  3520.     end
  3521.     # ルーレットを回し、エネミーを決定
  3522.     return roulette[rand(roulette.size)]
  3523.   end
  3524.   #--------------------------------------------------------------------------
  3525.   # ● 対象エネミーのスムーズな決定
  3526.   #     enemy_index : エネミーインデックス
  3527.   #--------------------------------------------------------------------------
  3528.   # オリジナルのターゲット決定ルーチンを smooth_target_enemy_rtab と名前変更
  3529.   alias :smooth_target_enemy_rtab :smooth_target_enemy
  3530.   def smooth_target_enemy(enemy_index)
  3531.     # エネミーを取得
  3532.     enemy = @enemies[enemy_index]
  3533.     # エネミーが存在する場合
  3534.     if enemy != nil and enemy.exist? and enemy.rest_hp > 0
  3535.       return enemy
  3536.     end
  3537.     # ループ
  3538.     for enemy in @enemies
  3539.       # エネミーが存在する場合
  3540.       if enemy.exist? and enemy.rest_hp > 0
  3541.         return enemy
  3542.       end
  3543.     end
  3544.     # 敵が全滅している場合、再度敵の検索を行う
  3545.     return smooth_target_enemy_rtab(enemy_index)
  3546.   end
  3547. end
  3548.  
  3549. #==============================================================================
  3550. # ■ Sprite_Battler
  3551. #------------------------------------------------------------------------------
  3552. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  3553. # スプライトの状態を自動的に変化させます。
  3554. #==============================================================================
  3555.  
  3556. class Sprite_Battler < RPG::Sprite
  3557.   #--------------------------------------------------------------------------
  3558.   # ● フレーム更新
  3559.   #--------------------------------------------------------------------------
  3560.   def update
  3561.     super
  3562.     # バトラーが nil の場合
  3563.     if @battler == nil
  3564.       self.bitmap = nil
  3565.       loop_animation(nil)
  3566.       return
  3567.     end
  3568.     # ファイル名か色相が現在のものと異なる場合
  3569.     if @battler.battler_name != @battler_name or
  3570.        @battler.battler_hue != @battler_hue
  3571.       # ビットマップを取得、設定
  3572.       @battler_name = @battler.battler_name
  3573.       @battler_hue = @battler.battler_hue
  3574.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  3575.       @width = bitmap.width
  3576.       @height = bitmap.height
  3577.       self.ox = @width / 2
  3578.       self.oy = @height
  3579.       if @battler.is_a?(Game_Enemy)
  3580.         @battler.height = @height
  3581.       end
  3582.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  3583.       if @battler.dead? or @battler.hidden
  3584.         self.opacity = 0
  3585.       end
  3586.     end
  3587.     # アニメーション ID が現在のものと異なる場合
  3588.     if @battler.state_animation_id != @state_animation_id
  3589.       @state_animation_id = @battler.state_animation_id
  3590.       loop_animation($data_animations[@state_animation_id])
  3591.     end
  3592.     # 表示されるべきアクターの場合
  3593.     if @battler.is_a?(Game_Actor) and @battler_visible
  3594.       # メインフェーズでないときは不透明度をやや下げる
  3595.       if $game_temp.battle_main_phase
  3596.         self.opacity += 3 if self.opacity < 255
  3597.       else
  3598.         self.opacity -= 3 if self.opacity > 207
  3599.       end
  3600.     end
  3601.     # 明滅
  3602.     if @battler.blink
  3603.       blink_on
  3604.     else
  3605.       blink_off
  3606.     end
  3607.     # 不可視の場合
  3608.     unless @battler_visible
  3609.       # 出現
  3610.       if not @battler.hidden and not @battler.dead? and
  3611.          (@battler.damage.size < 2 or @battler.damage_pop.size < 2)
  3612.         appear
  3613.         @battler_visible = true
  3614.       end
  3615.     end
  3616.     # ダメージ
  3617.     for battler in @battler.damage_pop
  3618.       if battler[0].class == Array
  3619.         if battler[0][1] >= 0
  3620.           $scene.skill_se
  3621.         else
  3622.           $scene.levelup_se
  3623.         end
  3624.         damage(@battler.damage[battler[0]], false, 2)
  3625.       else
  3626.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  3627.       end
  3628.       if @battler.damage_sp.include?(battler[0])
  3629.         damage(@battler.damage_sp[battler[0]],
  3630.                 @battler.critical[battler[0]], 1)
  3631.         @battler.damage_sp.delete(battler[0])
  3632.       end
  3633.       @battler.damage_pop.delete(battler[0])
  3634.       @battler.damage.delete(battler[0])
  3635.       @battler.critical.delete(battler[0])
  3636.     end
  3637.     # 可視の場合
  3638.     if @battler_visible
  3639.       # 逃走
  3640.       if @battler.hidden
  3641.         $game_system.se_play($data_system.escape_se)
  3642.         escape
  3643.         @battler_visible = false
  3644.       end
  3645.       # 白フラッシュ
  3646.       if @battler.white_flash
  3647.         whiten
  3648.         @battler.white_flash = false
  3649.       end
  3650.       # アニメーション
  3651.       unless @battler.animation.empty?
  3652.         for animation in @battler.animation.reverse
  3653.           animation($data_animations[animation[0]], animation[1])
  3654.           @battler.animation.delete(animation)
  3655.         end
  3656.       end
  3657.       # コラプス
  3658.       if @battler.damage.empty? and @battler.dead?
  3659.         if $scene.dead_ok?(@battler)
  3660.           if @battler.is_a?(Game_Enemy)
  3661.             $game_system.se_play($data_system.enemy_collapse_se)
  3662.           else
  3663.             $game_system.se_play($data_system.actor_collapse_se)
  3664.           end
  3665.           collapse
  3666.           @battler_visible = false
  3667.         end
  3668.       end
  3669.     end
  3670.     # スプライトの座標を設定
  3671.     self.x = @battler.screen_x
  3672.     self.y = @battler.screen_y
  3673.     self.z = @battler.screen_z
  3674.     if @battler.is_a?(Game_Enemy)
  3675.       self.zoom_x = @battler.real_zoom * @battler.zoom
  3676.       self.zoom_y = @battler.real_zoom * @battler.zoom
  3677.     end
  3678.   end
  3679. end
  3680.  
  3681. #==============================================================================
  3682. # ■ Window_Base
  3683. #------------------------------------------------------------------------------
  3684. #  ゲーム中のすべてのウィンドウのスーパークラスです。
  3685. #==============================================================================
  3686.  
  3687. class Window_Base < Window
  3688.   #--------------------------------------------------------------------------
  3689.   # ● ゲージの描画
  3690.   #--------------------------------------------------------------------------
  3691.   def gauge_rect_at(width, height, align3,
  3692.                     color1, color2, color3, color4, color5, color6, color7,
  3693.                     color8, color9, color10, color11, color12, grade1, grade2)
  3694.     # 枠描画
  3695.     @at_gauge = Bitmap.new(width, height * 5)
  3696.     @at_gauge.fill_rect(0, 0, width, height, color1)
  3697.     @at_gauge.fill_rect(1, 1, width - 2, height - 2, color2)
  3698.     if (align3 == 1 and grade1 == 0) or grade1 > 0
  3699.       color = color3
  3700.       color3 = color4
  3701.       color4 = color
  3702.     end
  3703.     if (align3 == 1 and grade2 == 0) or grade2 > 0
  3704.       color = color5
  3705.       color5 = color6
  3706.       color6 = color
  3707.       color = color7
  3708.       color7 = color8
  3709.       color8 = color
  3710.       color = color9
  3711.       color9 = color10
  3712.       color10 = color
  3713.       color = color11
  3714.       color11 = color12
  3715.       color12 = color
  3716.     end
  3717.     if align3 == 0
  3718.       if grade1 == 2
  3719.         grade1 = 3
  3720.       end
  3721.       if grade2 == 2
  3722.         grade2 = 3
  3723.       end
  3724.     end
  3725.     # 空ゲージの描画 縦にグラデーション表示
  3726.     @at_gauge.gradation_rect(2, 2, width - 4, height - 4,
  3727.                                   color3, color4, grade1)
  3728.     # 実ゲージの描画
  3729.     @at_gauge.gradation_rect(2, height + 2, width- 4, height - 4,
  3730.                                   color5, color6, grade2)
  3731.     @at_gauge.gradation_rect(2, height * 2 + 2, width- 4, height - 4,
  3732.                                   color7, color8, grade2)
  3733.     @at_gauge.gradation_rect(2, height * 3 + 2, width- 4, height - 4,
  3734.                                   color9, color10, grade2)
  3735.     @at_gauge.gradation_rect(2, height * 4 + 2, width- 4, height - 4,
  3736.                                   color11, color12, grade2)
  3737.   end
  3738. end
  3739.  
  3740. #==============================================================================
  3741. # ■ Window_Help
  3742. #------------------------------------------------------------------------------
  3743. #  スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
  3744. #==============================================================================
  3745.  
  3746. class Window_Help < Window_Base
  3747.   #--------------------------------------------------------------------------
  3748.   # ● エネミー設定
  3749.   #     enemy : 名前とステートを表示するエネミー
  3750.   #--------------------------------------------------------------------------
  3751.   def set_enemy(enemy)
  3752.     text = enemy.name.sub(/\\[Ff]\[([0-9]+)\]/) {""}
  3753.     state_text = make_battler_state_text(enemy, 112, false)
  3754.     if state_text != ""
  3755.       text += "  " + state_text
  3756.     end
  3757.     set_text(text, 1)
  3758.   end
  3759. end
  3760.  
  3761. #==============================================================================
  3762. # ■ Window_BattleStatus
  3763. #------------------------------------------------------------------------------
  3764. #  バトル画面でパーティメンバーのステータスを表示するウィンドウです。
  3765. #==============================================================================
  3766.  
  3767. class Window_BattleStatus < Window_Base
  3768.   #--------------------------------------------------------------------------
  3769.   # ● オブジェクト初期化
  3770.   #--------------------------------------------------------------------------
  3771.   def initialize
  3772.     x = (4 - $game_party.actors.size) * 80
  3773.     width = $game_party.actors.size * 160
  3774.     super(x, 320, width, 160)
  3775.     self.back_opacity = 160
  3776.     @actor_window = []
  3777.     for i in 0...$game_party.actors.size
  3778.       @actor_window.push(Window_ActorStatus.new(i, x + i * 160))
  3779.     end
  3780.     @level_up_flags = [false, false, false, false]
  3781.     refresh
  3782.   end
  3783.   #--------------------------------------------------------------------------
  3784.   # ● 解放
  3785.   #--------------------------------------------------------------------------
  3786.   def dispose
  3787.     for window in @actor_window
  3788.       window.dispose
  3789.     end
  3790.     super
  3791.   end
  3792.   #--------------------------------------------------------------------------
  3793.   # ● リフレッシュ
  3794.   #--------------------------------------------------------------------------
  3795.   def refresh(number = 0)
  3796.     if number == 0
  3797.       cnt = 0
  3798.       for window in @actor_window
  3799.         window.refresh(@level_up_flags[cnt])
  3800.         cnt += 1
  3801.       end
  3802.     else
  3803.       @actor_window[number - 1].refresh(@level_up_flags[number - 1])
  3804.     end
  3805.   end
  3806.   #--------------------------------------------------------------------------
  3807.   # ● ATゲージリフレッシュ
  3808.   #--------------------------------------------------------------------------
  3809.   def at_refresh(number = 0)
  3810.     if number == 0
  3811.       for window in @actor_window
  3812.         window.at_refresh
  3813.       end
  3814.     else
  3815.       @actor_window[number - 1].at_refresh
  3816.     end
  3817.   end
  3818.   #--------------------------------------------------------------------------
  3819.   # ● フレーム更新
  3820.   #--------------------------------------------------------------------------
  3821.   def update
  3822.     super
  3823.     if self.x != (4 - $game_party.actors.size) * 80
  3824.       self.x = (4 - $game_party.actors.size) * 80
  3825.       self.width = $game_party.actors.size * 160
  3826.       for window in @actor_window
  3827.         window.dispose
  3828.       end
  3829.       @actor_window = []
  3830.       for i in 0...$game_party.actors.size
  3831.         @actor_window.push(Window_ActorStatus.new(i, x + i * 160))
  3832.       end
  3833.       refresh
  3834.     end
  3835.     for window in @actor_window
  3836.       window.update
  3837.     end
  3838.   end
  3839. end
  3840.  
  3841. #==============================================================================
  3842. # ■ Window_ActorStatus
  3843. #------------------------------------------------------------------------------
  3844. #  バトル画面でパーティメンバーのステータスをそれぞれ表示するウィンドウです。
  3845. #==============================================================================
  3846.  
  3847. class Window_ActorStatus < Window_Base
  3848.   #--------------------------------------------------------------------------
  3849.   # ● オブジェクト初期化
  3850.   #--------------------------------------------------------------------------
  3851.   def initialize(id, x)
  3852.     @actor_num = id
  3853.     super(x, 320, 160, 160)
  3854.     self.contents = Bitmap.new(width - 32, height - 32)
  3855.     self.opacity = 0
  3856.     self.back_opacity = 0
  3857.     actor = $game_party.actors[@actor_num]
  3858.     @actor_nm = actor.name
  3859.     @actor_mhp = actor.maxhp
  3860.     @actor_msp = actor.maxsp
  3861.     @actor_hp = actor.hp
  3862.     @actor_sp = actor.sp
  3863.     @actor_st = make_battler_state_text(actor, 120, true)
  3864.     @status_window = []
  3865.     for i in 0...5
  3866.       @status_window.push(Window_DetailsStatus.new(actor, i, x))
  3867.     end
  3868.     refresh(false)
  3869.   end
  3870.   #--------------------------------------------------------------------------
  3871.   # ● 解放
  3872.   #--------------------------------------------------------------------------
  3873.   def dispose
  3874.     for i in 0...5
  3875.       @status_window[i].dispose
  3876.     end
  3877.     super
  3878.   end
  3879.   #--------------------------------------------------------------------------
  3880.   # ● リフレッシュ
  3881.   #--------------------------------------------------------------------------
  3882.   def refresh(level_up_flags)
  3883.     self.contents.clear
  3884.     actor = $game_party.actors[@actor_num]
  3885.     @status_window[0].refresh(actor) if @actor_nm != actor.name
  3886.     @status_window[1].refresh(actor) if
  3887.       @actor_mhp != actor.maxhp or @actor_hp != actor.hp
  3888.     @status_window[2].refresh(actor) if
  3889.       @actor_msp != actor.maxsp or @actor_sp != actor.sp
  3890.     @status_window[3].refresh(actor, level_up_flags) if
  3891.       @actor_st != make_battler_state_text(actor, 120, true) or level_up_flags
  3892.     @actor_nm = actor.name
  3893.     @actor_mhp = actor.maxhp
  3894.     @actor_msp = actor.maxsp
  3895.     @actor_hp = actor.hp
  3896.     @actor_sp = actor.sp
  3897.     @actor_st = make_battler_state_text(actor, 120, true)
  3898.   end
  3899.   #--------------------------------------------------------------------------
  3900.   # ● ATゲージリフレッシュ
  3901.   #--------------------------------------------------------------------------
  3902.   def at_refresh
  3903.     @status_window[4].refresh($game_party.actors[@actor_num])
  3904.   end
  3905.   #--------------------------------------------------------------------------
  3906.   # ● フレーム更新
  3907.   #--------------------------------------------------------------------------
  3908.   def update
  3909.     for window in @status_window
  3910.       window.update
  3911.     end
  3912.   end
  3913. end
  3914.  
  3915. #==============================================================================
  3916. # ■ Window_DetailsStatus
  3917. #------------------------------------------------------------------------------
  3918. #  バトル画面でアクターのステータスを個々に表示するウィンドウです。
  3919. #==============================================================================
  3920.  
  3921. class Window_DetailsStatus < Window_Base
  3922.   #--------------------------------------------------------------------------
  3923.   # ● オブジェクト初期化
  3924.   #--------------------------------------------------------------------------
  3925.   def initialize(actor, id, x)
  3926.     @status_id = id
  3927.     super(x, 320 + id * 26, 160, 64)
  3928.     self.contents = Bitmap.new(width - 32, height - 32)
  3929.     self.opacity = 0
  3930.     self.back_opacity = 0
  3931.     refresh(actor, false)
  3932.   end
  3933.   #--------------------------------------------------------------------------
  3934.   # ● 解放
  3935.   #--------------------------------------------------------------------------
  3936.   def dispose
  3937.     super
  3938.   end
  3939.   #--------------------------------------------------------------------------
  3940.   # ● リフレッシュ
  3941.   #--------------------------------------------------------------------------
  3942.   def refresh(actor, level_up_flags = false)
  3943.     self.contents.clear
  3944.     case @status_id
  3945.     when 0
  3946.       draw_actor_name(actor, 4, 0)
  3947.     when 1
  3948.       draw_actor_hp(actor, 4, 0, 120)
  3949.     when 2
  3950.       draw_actor_sp(actor, 4, 0, 120)
  3951.     when 3
  3952.       if level_up_flags
  3953.         self.contents.font.color = normal_color
  3954.         self.contents.draw_text(4, 0, 120, 32, "LEVEL UP!")
  3955.       else
  3956.         draw_actor_state(actor, 4, 0)
  3957.       end
  3958.     when 4
  3959.       draw_actor_atg(actor, 4, 0, 120)
  3960.     end
  3961.   end
  3962.   #--------------------------------------------------------------------------
  3963.   # ● フレーム更新
  3964.   #--------------------------------------------------------------------------
  3965.   def update
  3966.     # メインフェーズのときは不透明度をやや下げる
  3967.     if $game_temp.battle_main_phase
  3968.       self.contents_opacity -= 4 if self.contents_opacity > 191
  3969.     else
  3970.       self.contents_opacity += 4 if self.contents_opacity < 255
  3971.     end
  3972.   end
  3973. end
  3974.  
  3975. #==============================================================================
  3976. # ■ Arrow_Base
  3977. #------------------------------------------------------------------------------
  3978. #  バトル画面で使用するアローカーソル表示用のスプライトです。このクラスは
  3979. # Arrow_Enemy クラスと Arrow_Actor クラスのスーパークラスとして使用されます。
  3980. #==============================================================================
  3981.  
  3982. class Arrow_Base < Sprite
  3983.   #--------------------------------------------------------------------------
  3984.   # ● オブジェクト初期化
  3985.   #     viewport : ビューポート
  3986.   #--------------------------------------------------------------------------
  3987.   def initialize(viewport)
  3988.     super(viewport)
  3989.     self.bitmap = RPG::Cache.windowskin($game_system.windowskin_name)
  3990.     self.ox = 16
  3991.     self.oy = 32
  3992.     self.z = 2500
  3993.     @blink_count = 0
  3994.     @index = 0
  3995.     @help_window = nil
  3996.     update
  3997.   end
  3998. end
  3999.  
  4000. #==============================================================================
  4001. # ■ Arrow_Enemy
  4002. #------------------------------------------------------------------------------
  4003. #  エネミーを選択させるためのアローカーソルです。このクラスは Arrow_Base クラ
  4004. # スを継承します。
  4005. #==============================================================================
  4006.  
  4007. class Arrow_Enemy < Arrow_Base
  4008.   #--------------------------------------------------------------------------
  4009.   # ● フレーム更新
  4010.   #--------------------------------------------------------------------------
  4011.   def update
  4012.     super
  4013.     # 存在しないエネミーを指していたら飛ばす
  4014.     $game_troop.enemies.size.times do
  4015.       break if self.enemy.exist?
  4016.       @index += 1
  4017.       @index %= $game_troop.enemies.size
  4018.     end
  4019.     # カーソル右
  4020.     if Input.repeat?(Input::RIGHT)
  4021.       $game_system.se_play($data_system.cursor_se)
  4022.       $game_troop.enemies.size.times do
  4023.         @index += 1
  4024.         @index %= $game_troop.enemies.size
  4025.         break if self.enemy.exist?
  4026.       end
  4027.       $scene.camera = "select"
  4028.       zoom = 1 / self.enemy.zoom
  4029.       $scene.spriteset.screen_target(self.enemy.attack_x(zoom) * 0.75,
  4030.                                       self.enemy.attack_y(zoom) * 0.75, zoom)
  4031.     end
  4032.     # カーソル左
  4033.     if Input.repeat?(Input::LEFT)
  4034.       $game_system.se_play($data_system.cursor_se)
  4035.       $game_troop.enemies.size.times do
  4036.         @index += $game_troop.enemies.size - 1
  4037.         @index %= $game_troop.enemies.size
  4038.         break if self.enemy.exist?
  4039.       end
  4040.       $scene.camera = "select"
  4041.       zoom = 1 / self.enemy.zoom
  4042.       $scene.spriteset.screen_target(self.enemy.attack_x(zoom) * 0.75,
  4043.                                       self.enemy.attack_y(zoom) * 0.75, zoom)
  4044.     end
  4045.     # スプライトの座標を設定
  4046.     if self.enemy != nil
  4047.       self.x = self.enemy.screen_x
  4048.       self.y = self.enemy.screen_y
  4049.     end
  4050.   end
  4051. end
  4052.  
  4053. #==============================================================================
  4054. # ■ Interpreter
  4055. #------------------------------------------------------------------------------
  4056. #  イベントコマンドを実行するインタプリタです。このクラスは Game_System クラ
  4057. # スや Game_Event クラスの内部で使用されます。
  4058. #==============================================================================
  4059.  
  4060. class Interpreter
  4061.   #--------------------------------------------------------------------------
  4062.   # ● アクターの入れ替え
  4063.   #--------------------------------------------------------------------------
  4064.   def command_129
  4065.     # アクターを取得
  4066.     actor = $game_actors[@parameters[0]]
  4067.     # アクターが有効の場合
  4068.     if actor != nil
  4069.       # 操作で分岐
  4070.       if @parameters[1] == 0
  4071.         if @parameters[2] == 1
  4072.           $game_actors[@parameters[0]].setup(@parameters[0])
  4073.         end
  4074.         $game_party.add_actor(@parameters[0])
  4075.         if $game_temp.in_battle
  4076.           $game_actors[@parameters[0]].at = 0
  4077.           $game_actors[@parameters[0]].atp = 0
  4078.           $scene.spell_reset($game_actors[@parameters[0]])
  4079.           $game_actors[@parameters[0]].damage_pop = {}
  4080.           $game_actors[@parameters[0]].damage = {}
  4081.           $game_actors[@parameters[0]].damage_sp = {}
  4082.           $game_actors[@parameters[0]].critical = {}
  4083.           $game_actors[@parameters[0]].recover_hp = {}
  4084.           $game_actors[@parameters[0]].recover_sp = {}
  4085.           $game_actors[@parameters[0]].state_p = {}
  4086.           $game_actors[@parameters[0]].state_m = {}
  4087.           $game_actors[@parameters[0]].animation = []
  4088.         end
  4089.       else
  4090.         $game_party.remove_actor(@parameters[0])
  4091.       end
  4092.     end
  4093.     if $game_temp.in_battle
  4094.       $scene.status_window.update
  4095.     end
  4096.     # 継続
  4097.     return true
  4098.   end
  4099.   #--------------------------------------------------------------------------
  4100.   # ● HP の増減
  4101.   #--------------------------------------------------------------------------
  4102.   alias :command_311_rtab :command_311
  4103.   def command_311
  4104.     command_311_rtab
  4105.     if $game_temp.in_battle
  4106.       $scene.status_window.refresh
  4107.     end
  4108.   end
  4109.   #--------------------------------------------------------------------------
  4110.   # ● SP の増減
  4111.   #--------------------------------------------------------------------------
  4112.   alias :command_312_rtab :command_312
  4113.   def command_312
  4114.     command_312_rtab
  4115.     if $game_temp.in_battle
  4116.       $scene.status_window.refresh
  4117.     end
  4118.   end
  4119.   #--------------------------------------------------------------------------
  4120.   # ● ステートの変更
  4121.   #--------------------------------------------------------------------------
  4122.   alias :command_313_rtab :command_313
  4123.   def command_313
  4124.     command_313_rtab
  4125.     if $game_temp.in_battle
  4126.       $scene.status_window.refresh
  4127.     end
  4128.   end
  4129.   #--------------------------------------------------------------------------
  4130.   # ● 全回復
  4131.   #--------------------------------------------------------------------------
  4132.   alias :command_314_rtab :command_314
  4133.   def command_314
  4134.     command_314_rtab
  4135.     if $game_temp.in_battle
  4136.       $scene.status_window.refresh
  4137.     end
  4138.   end
  4139.   #--------------------------------------------------------------------------
  4140.   # ● EXP の増減
  4141.   #--------------------------------------------------------------------------
  4142.   alias :command_315_rtab :command_315
  4143.   def command_315
  4144.     command_315_rtab
  4145.     if $game_temp.in_battle
  4146.       $scene.status_window.refresh
  4147.     end
  4148.   end
  4149.   #--------------------------------------------------------------------------
  4150.   # ● レベルの増減
  4151.   #--------------------------------------------------------------------------
  4152.   alias :command_316_rtab :command_316
  4153.   def command_316
  4154.     command_316_rtab
  4155.     if $game_temp.in_battle
  4156.       $scene.status_window.refresh
  4157.     end
  4158.   end
  4159.   #--------------------------------------------------------------------------
  4160.   # ● パラメータの増減
  4161.   #--------------------------------------------------------------------------
  4162.   alias :command_317_rtab :command_317
  4163.   def command_317
  4164.     command_317_rtab
  4165.     if $game_temp.in_battle
  4166.       $scene.status_window.refresh
  4167.     end
  4168.   end
  4169.   #--------------------------------------------------------------------------
  4170.   # ● 装備の変更
  4171.   #--------------------------------------------------------------------------
  4172.   alias :command_319_rtab :command_319
  4173.   def command_319
  4174.     command_319_rtab
  4175.     if $game_temp.in_battle
  4176.       $scene.status_window.refresh
  4177.     end
  4178.   end
  4179.   #--------------------------------------------------------------------------
  4180.   # ● アクターの名前変更
  4181.   #--------------------------------------------------------------------------
  4182.   alias :command_320_rtab :command_320
  4183.   def command_320
  4184.     command_320_rtab
  4185.     if $game_temp.in_battle
  4186.       $scene.status_window.refresh
  4187.     end
  4188.   end
  4189.   #--------------------------------------------------------------------------
  4190.   # ● アクターのクラス変更
  4191.   #--------------------------------------------------------------------------
  4192.   alias :command_321_rtab :command_321
  4193.   def command_321
  4194.     command_321_rtab
  4195.     if $game_temp.in_battle
  4196.       $scene.status_window.refresh
  4197.     end
  4198.   end
  4199.   #--------------------------------------------------------------------------
  4200.   # ● アニメーションの表示
  4201.   #--------------------------------------------------------------------------
  4202.   def command_337
  4203.     # イテレータで処理
  4204.     iterate_battler(@parameters[0], @parameters[1]) do |battler|
  4205.       # バトラーが存在する場合
  4206.       if battler.exist?
  4207.         # アニメーション ID を設定
  4208.         battler.animation.push([@parameters[2], true])
  4209.       end
  4210.     end
  4211.     # 継続
  4212.     return true
  4213.   end
  4214.   #--------------------------------------------------------------------------
  4215.   # ● ダメージの処理
  4216.   #--------------------------------------------------------------------------
  4217.   def command_338
  4218.     # 操作する値を取得
  4219.     value = operate_value(0, @parameters[2], @parameters[3])
  4220.     # イテレータで処理
  4221.     iterate_battler(@parameters[0], @parameters[1]) do |battler|
  4222.       # バトラーが存在する場合
  4223.       if battler.exist?
  4224.         # HP を変更
  4225.         battler.hp -= value
  4226.         # 戦闘中なら
  4227.         if $game_temp.in_battle
  4228.           # ダメージを設定
  4229.           battler.damage["event"] = value
  4230.           battler.damage_pop["event"] = true
  4231.         end
  4232.       end
  4233.     end
  4234.     if $game_temp.in_battle
  4235.       $scene.status_window.refresh
  4236.     end
  4237.     # 継続
  4238.     return true
  4239.   end
  4240.   #--------------------------------------------------------------------------
  4241.   # ● アクションの強制
  4242.   #--------------------------------------------------------------------------
  4243.   def command_339
  4244.     # 戦闘中でなければ無視
  4245.     unless $game_temp.in_battle
  4246.       return true
  4247.     end
  4248.     # ターン数が 0 なら無視
  4249.     if $game_temp.battle_turn == 0
  4250.       return true
  4251.     end
  4252.     # イテレータで処理 (便宜的なもので、複数になることはない)
  4253.     iterate_battler(@parameters[0], @parameters[1]) do |battler|
  4254.       # バトラーが存在する場合
  4255.       if battler.exist?
  4256.         # アクションを設定
  4257.         battler.current_action.force_kind = @parameters[2]
  4258.         if battler.current_action.force_kind == 0
  4259.           battler.current_action.force_basic = @parameters[3]
  4260.         else
  4261.           battler.current_action.force_skill_id = @parameters[3]
  4262.         end
  4263.         # 行動対象を設定
  4264.         if @parameters[4] == -2
  4265.           if battler.is_a?(Game_Enemy)
  4266.             battler.current_action.decide_last_target_for_enemy
  4267.           else
  4268.             battler.current_action.decide_last_target_for_actor
  4269.           end
  4270.         elsif @parameters[4] == -1
  4271.           if battler.is_a?(Game_Enemy)
  4272.             battler.current_action.decide_random_target_for_enemy
  4273.           else
  4274.             battler.current_action.decide_random_target_for_actor
  4275.           end
  4276.         elsif @parameters[4] >= 0
  4277.           battler.current_action.target_index = @parameters[4]
  4278.         end
  4279.         # アクションが有効かつ [すぐに実行] の場合
  4280.         if battler.current_action.valid? and @parameters[5] == 1
  4281.           # 強制対象のバトラーを設定
  4282.           $game_temp.forcing_battler = battler
  4283.           # インデックスを進める
  4284.           @index += 1
  4285.           # 終了
  4286.           return false
  4287.         elsif battler.current_action.valid? and @parameters[5] == 0
  4288.           battler.current_action.forcing = true
  4289.         end
  4290.       end
  4291.     end
  4292.     # 継続
  4293.     return true
  4294.   end
  4295. end
  4296.  
  4297. #==============================================================================
  4298. # ■ Spriteモジュール
  4299. #------------------------------------------------------------------------------
  4300. #  アニメーションの管理を行うモジュールです。
  4301. #==============================================================================
  4302.  
  4303. module RPG
  4304.   class Sprite < ::Sprite
  4305.     def initialize(viewport = nil)
  4306.       super(viewport)
  4307.       @_whiten_duration = 0
  4308.       @_appear_duration = 0
  4309.       @_escape_duration = 0
  4310.       @_collapse_duration = 0
  4311.       @_damage = []
  4312.       @_animation = []
  4313.       @_animation_duration = 0
  4314.       @_blink = false
  4315.     end
  4316.     def damage(value, critical, type = 0)
  4317.       if value.is_a?(Numeric)
  4318.         damage_string = value.abs.to_s
  4319.       else
  4320.         damage_string = value.to_s
  4321.       end
  4322.       bitmap = Bitmap.new(160, 48)
  4323.       bitmap.font.name = "Arial Black"
  4324.       bitmap.font.size = 32
  4325.       bitmap.font.color.set(0, 0, 0)
  4326.       bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  4327.       bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  4328.       bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  4329.       bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  4330.       if value.is_a?(Numeric) and value < 0
  4331.         if type == 0
  4332.           bitmap.font.color.set(176, 255, 144)
  4333.         else
  4334.           bitmap.font.color.set(176, 144, 255)
  4335.         end
  4336.       else
  4337.         if type == 0
  4338.           bitmap.font.color.set(255, 255, 255)
  4339.         else
  4340.           bitmap.font.color.set(255, 176, 144)
  4341.         end
  4342.       end
  4343.       if type == 2
  4344.         bitmap.font.color.set(255, 224, 128)
  4345.       end
  4346.       bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  4347.       if critical
  4348.         string = "CRITICAL"
  4349.         bitmap.font.size = 20
  4350.         bitmap.font.color.set(0, 0, 0)
  4351.         bitmap.draw_text(-1, -1, 160, 20, string, 1)
  4352.         bitmap.draw_text(+1, -1, 160, 20, string, 1)
  4353.         bitmap.draw_text(-1, +1, 160, 20, string, 1)
  4354.         bitmap.draw_text(+1, +1, 160, 20, string, 1)
  4355.         bitmap.font.color.set(255, 255, 255)
  4356.         bitmap.draw_text(0, 0, 160, 20, string, 1)
  4357.       end
  4358.       num = @_damage.size
  4359.       if type != 2
  4360.         @_damage.push([::Sprite.new, 40, 0, rand(40) - 20, rand(30) + 50])
  4361.       else
  4362.         @_damage.push([::Sprite.new, 40, 0, rand(20) - 10, rand(20) + 60])
  4363.       end
  4364.       @_damage[num][0].bitmap = bitmap
  4365.       @_damage[num][0].ox = 80 + self.viewport.ox
  4366.       @_damage[num][0].oy = 20 + self.viewport.oy
  4367.       if self.battler.is_a?(Game_Actor)
  4368.         @_damage[num][0].x = self.x
  4369.         @_damage[num][0].y = self.y - self.oy / 2
  4370.       else
  4371.         @_damage[num][0].x = self.x + self.viewport.rect.x -
  4372.                             self.ox + self.src_rect.width / 2
  4373.         @_damage[num][0].y = self.y - self.oy * self.zoom_y / 2 +
  4374.                             self.viewport.rect.y
  4375.         @_damage[num][0].zoom_x = self.zoom_x
  4376.         @_damage[num][0].zoom_y = self.zoom_y
  4377.         @_damage[num][0].z = 3000
  4378.       end
  4379.     end
  4380.     def animation(animation, hit)
  4381.       return if animation == nil
  4382.       num = @_animation.size
  4383.       @_animation.push([animation, hit, animation.frame_max, []])
  4384.       bitmap = RPG::Cache.animation(animation.animation_name,
  4385.                                     animation.animation_hue)
  4386.       if @@_reference_count.include?(bitmap)
  4387.         @@_reference_count[bitmap] += 1
  4388.       else
  4389.         @@_reference_count[bitmap] = 1
  4390.       end
  4391.       if @_animation[num][0].position != 3 or
  4392.           not @@_animations.include?(animation)
  4393.         for i in 0..15
  4394.           sprite = ::Sprite.new
  4395.           sprite.bitmap = bitmap
  4396.           sprite.visible = false
  4397.           @_animation[num][3].push(sprite)
  4398.         end
  4399.         unless @@_animations.include?(animation)
  4400.           @@_animations.push(animation)
  4401.         end
  4402.       end
  4403.       update_animation(@_animation[num])
  4404.     end
  4405.     def loop_animation(animation)
  4406.       return if animation == @_loop_animation
  4407.       dispose_loop_animation
  4408.       @_loop_animation = animation
  4409.       return if @_loop_animation == nil
  4410.       @_loop_animation_index = 0
  4411.       animation_name = @_loop_animation.animation_name
  4412.       animation_hue = @_loop_animation.animation_hue
  4413.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  4414.       if @@_reference_count.include?(bitmap)
  4415.         @@_reference_count[bitmap] += 1
  4416.       else
  4417.         @@_reference_count[bitmap] = 1
  4418.       end
  4419.       @_loop_animation_sprites = []
  4420.       for i in 0..15
  4421.         sprite = ::Sprite.new
  4422.         sprite.bitmap = bitmap
  4423.         sprite.visible = false
  4424.         @_loop_animation_sprites.push(sprite)
  4425.       end
  4426.       # update_loop_animation
  4427.     end
  4428.     def dispose_damage
  4429.       for damage in @_damage.reverse
  4430.         damage[0].bitmap.dispose
  4431.         damage[0].dispose
  4432.         @_damage.delete(damage)
  4433.       end
  4434.     end
  4435.     def dispose_animation
  4436.       for anime in @_animation.reverse
  4437.         sprite = anime[3][0]
  4438.         if sprite != nil
  4439.           @@_reference_count[sprite.bitmap] -= 1
  4440.           if @@_reference_count[sprite.bitmap] == 0
  4441.             sprite.bitmap.dispose
  4442.           end
  4443.         end
  4444.         for sprite in anime[3]
  4445.           sprite.dispose
  4446.         end
  4447.         @_animation.delete(anime)
  4448.       end
  4449.     end
  4450.     def effect?
  4451.       @_whiten_duration > 0 or
  4452.       @_appear_duration > 0 or
  4453.       @_escape_duration > 0 or
  4454.       @_collapse_duration > 0 or
  4455.       @_damage.size == 0 or
  4456.       @_animation.size == 0
  4457.     end
  4458.     def update
  4459.       super
  4460.       if @_whiten_duration > 0
  4461.         @_whiten_duration -= 1
  4462.         self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  4463.       end
  4464.       if @_appear_duration > 0
  4465.         @_appear_duration -= 1
  4466.         self.opacity = (16 - @_appear_duration) * 16
  4467.       end
  4468.       if @_escape_duration > 0
  4469.         @_escape_duration -= 1
  4470.         self.opacity = 256 - (32 - @_escape_duration) * 10
  4471.       end
  4472.       if @_collapse_duration > 0
  4473.         @_collapse_duration -= 1
  4474.         self.opacity = 256 - (48 - @_collapse_duration) * 6
  4475.       end
  4476.       for damage in @_damage
  4477.         if damage[1] > 0
  4478.           damage[1] -= 1
  4479.           damage[4] -= 3
  4480.           damage[2] -= damage[4]
  4481.           if self.battler.is_a?(Game_Actor)
  4482.             damage[0].x = self.x + (40 - damage[1]) * damage[3] / 10
  4483.             damage[0].y = self.y - self.oy / 2 + damage[2] / 10
  4484.           else
  4485.             damage[0].x = self.x + self.viewport.rect.x -
  4486.                           self.ox + self.src_rect.width / 2 +
  4487.                           (40 - damage[1]) * damage[3] / 10
  4488.             damage[0].y = self.y - self.oy * self.zoom_y / 2 +
  4489.                           self.viewport.rect.y + damage[2] / 10
  4490.             damage[0].zoom_x = self.zoom_x
  4491.             damage[0].zoom_y = self.zoom_y
  4492.           end
  4493.           damage[0].z = 2960 + damage[1]
  4494.           damage[0].opacity = 256 - (12 - damage[1]) * 32
  4495.           if damage[1] == 0
  4496.             damage[0].bitmap.dispose
  4497.             damage[0].dispose
  4498.             @_damage.delete(damage)
  4499.           end
  4500.         end
  4501.       end
  4502.       for anime in @_animation
  4503.         if (Graphics.frame_count % 2 == 0)
  4504.           anime[2] -= 1
  4505.           update_animation(anime)
  4506.         end
  4507.       end
  4508.       if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  4509.         update_loop_animation
  4510.         @_loop_animation_index += 1
  4511.         @_loop_animation_index %= @_loop_animation.frame_max
  4512.       end
  4513.       if @_blink
  4514.         @_blink_count = (@_blink_count + 1) % 32
  4515.         if @_blink_count < 16
  4516.           alpha = (16 - @_blink_count) * 6
  4517.         else
  4518.           alpha = (@_blink_count - 16) * 6
  4519.         end
  4520.         self.color.set(255, 255, 255, alpha)
  4521.       end
  4522.       @@_animations.clear
  4523.     end
  4524.     def update_animation(anime)
  4525.       if anime[2] > 0
  4526.         frame_index = anime[0].frame_max - anime[2]
  4527.         cell_data = anime[0].frames[frame_index].cell_data
  4528.         position = anime[0].position
  4529.         animation_set_sprites(anime[3], cell_data, position)
  4530.         for timing in anime[0].timings
  4531.           if timing.frame == frame_index
  4532.             animation_process_timing(timing, anime[1])
  4533.           end
  4534.         end
  4535.       else
  4536.         @@_reference_count[anime[3][0].bitmap] -= 1
  4537.         if @@_reference_count[anime[3][0].bitmap] == 0
  4538.             anime[3][0].bitmap.dispose
  4539.         end
  4540.         for sprite in anime[3]
  4541.           sprite.dispose
  4542.         end
  4543.         @_animation.delete(anime)
  4544.       end
  4545.     end
  4546.     def animation_set_sprites(sprites, cell_data, position)
  4547.       for i in 0..15
  4548.         sprite = sprites[i]
  4549.         pattern = cell_data[i, 0]
  4550.         if sprite == nil or pattern == nil or pattern == -1
  4551.           sprite.visible = false if sprite != nil
  4552.           next
  4553.         end
  4554.         sprite.visible = true
  4555.         sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  4556.         if position == 3
  4557.           if self.viewport != nil
  4558.             sprite.x = self.viewport.rect.width / 2
  4559.             if $game_temp.in_battle and self.battler.is_a?(Game_Enemy)
  4560.               sprite.y = self.viewport.rect.height - 320
  4561.             else
  4562.               sprite.y = self.viewport.rect.height - 160
  4563.             end
  4564.           else
  4565.             sprite.x = 320
  4566.             sprite.y = 240
  4567.           end
  4568.         else
  4569.           sprite.x = self.x + self.viewport.rect.x -
  4570.                       self.ox + self.src_rect.width / 2
  4571.           if $game_temp.in_battle and self.battler.is_a?(Game_Enemy)
  4572.             sprite.y = self.y - self.oy * self.zoom_y / 2 +
  4573.                         self.viewport.rect.y
  4574.             if position == 0
  4575.               sprite.y -= self.src_rect.height * self.zoom_y / 4
  4576.             elsif position == 2
  4577.               sprite.y += self.src_rect.height * self.zoom_y / 4
  4578.             end
  4579.           else
  4580.             sprite.y = self.y + self.viewport.rect.y -
  4581.                         self.oy + self.src_rect.height / 2
  4582.             sprite.y -= self.src_rect.height / 4 if position == 0
  4583.             sprite.y += self.src_rect.height / 4 if position == 2
  4584.           end
  4585.         end
  4586.         sprite.x += cell_data[i, 1]
  4587.         sprite.y += cell_data[i, 2]
  4588.         sprite.z = 2000
  4589.         sprite.ox = 96
  4590.         sprite.oy = 96
  4591.         sprite.zoom_x = cell_data[i, 3] / 100.0
  4592.         sprite.zoom_y = cell_data[i, 3] / 100.0
  4593.         if position != 3
  4594.           sprite.zoom_x *= self.zoom_x
  4595.           sprite.zoom_y *= self.zoom_y
  4596.         end
  4597.         sprite.angle = cell_data[i, 4]
  4598.         sprite.mirror = (cell_data[i, 5] == 1)
  4599.         sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  4600.         sprite.blend_type = cell_data[i, 7]
  4601.       end
  4602.     end
  4603.     def x=(x)
  4604.       sx = x - self.x
  4605.       if sx != 0
  4606.         for anime in @_animation
  4607.           if anime[3] != nil
  4608.             for i in 0..15
  4609.               anime[3][i].x += sx
  4610.             end
  4611.           end
  4612.         end
  4613.         if @_loop_animation_sprites != nil
  4614.           for i in 0..15
  4615.             @_loop_animation_sprites[i].x += sx
  4616.           end
  4617.         end
  4618.       end
  4619.       super
  4620.     end
  4621.     def y=(y)
  4622.       sy = y - self.y
  4623.       if sy != 0
  4624.         for anime in @_animation
  4625.           if anime[3] != nil
  4626.             for i in 0..15
  4627.               anime[3][i].y += sy
  4628.             end
  4629.           end
  4630.         end
  4631.         if @_loop_animation_sprites != nil
  4632.           for i in 0..15
  4633.             @_loop_animation_sprites[i].y += sy
  4634.           end
  4635.         end
  4636.       end
  4637.       super
  4638.     end
  4639.   end
  4640. end
  4641.  
  4642. #------------------------------------------------------------------------------
  4643. #  Bitmapクラスに新たな機能を追加します。
  4644. #==============================================================================
  4645.  
  4646. class Bitmap
  4647.   #--------------------------------------------------------------------------
  4648.   # ● 矩形をグラデーション表示
  4649.   #     color1 : スタートカラー
  4650.   #     color2 : エンドカラー
  4651.   #     align  :  0:横にグラデーション
  4652.   #               1:縦にグラデーション
  4653.   #               2:斜めにグラデーション(激重につき注意)
  4654.   #--------------------------------------------------------------------------
  4655.   def gradation_rect(x, y, width, height, color1, color2, align = 0)
  4656.     if align == 0
  4657.       for i in x...x + width
  4658.         red   = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
  4659.         green = color1.green +
  4660.                 (color2.green - color1.green) * (i - x) / (width - 1)
  4661.         blue  = color1.blue +
  4662.                 (color2.blue - color1.blue) * (i - x) / (width - 1)
  4663.         alpha = color1.alpha +
  4664.                 (color2.alpha - color1.alpha) * (i - x) / (width - 1)
  4665.         color = Color.new(red, green, blue, alpha)
  4666.         fill_rect(i, y, 1, height, color)
  4667.       end
  4668.     elsif align == 1
  4669.       for i in y...y + height
  4670.         red   = color1.red +
  4671.                 (color2.red - color1.red) * (i - y) / (height - 1)
  4672.         green = color1.green +
  4673.                 (color2.green - color1.green) * (i - y) / (height - 1)
  4674.         blue  = color1.blue +
  4675.                 (color2.blue - color1.blue) * (i - y) / (height - 1)
  4676.         alpha = color1.alpha +
  4677.                 (color2.alpha - color1.alpha) * (i - y) / (height - 1)
  4678.         color = Color.new(red, green, blue, alpha)
  4679.         fill_rect(x, i, width, 1, color)
  4680.       end
  4681.     elsif align == 2
  4682.       for i in x...x + width
  4683.         for j in y...y + height
  4684.           red   = color1.red + (color2.red - color1.red) *
  4685.                   ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  4686.           green = color1.green + (color2.green - color1.green) *
  4687.                   ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  4688.           blue  = color1.blue + (color2.blue - color1.blue) *
  4689.                   ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  4690.           alpha = color1.alpha + (color2.alpha - color1.alpha) *
  4691.                   ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  4692.           color = Color.new(red, green, blue, alpha)
  4693.           set_pixel(i, j, color)
  4694.         end
  4695.       end
  4696.     elsif align == 3
  4697.       for i in x...x + width
  4698.         for j in y...y + height
  4699.           red   = color1.red + (color2.red - color1.red) *
  4700.               ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  4701.           green = color1.green + (color2.green - color1.green) *
  4702.               ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  4703.           blue  = color1.blue + (color2.blue - color1.blue) *
  4704.               ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  4705.           alpha = color1.alpha + (color2.alpha - color1.alpha) *
  4706.               ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  4707.           color = Color.new(red, green, blue, alpha)
  4708.           set_pixel(i, j, color)
  4709.         end
  4710.       end
  4711.     end
  4712.   end
  4713. end


加了 菜鸟横版modified
RUBY 代码复制
  1. =begin
  2.   #--------------------------------------------------------------------------
  3.  # ● 人物行走图做战斗图像(附加动画) ver1.02
  4.   #--------------------------------------------------------------------------
  5.   制作者 らい
  6.   翻译:忧郁的涟漪
  7.  
  8.     
  9.   图像文件的规格
  10.  
  11.   ● 巴特勒图像(似乎指的是战斗图像)
  12.  
  13.   使用步行图片。
  14.    
  15.   ● 武器的图像
  16.  
  17.   就是武器图标的图像(ICO图)  
  18.       
  19.  
  20. ###############################################################################
  21. 行走图横版战斗:
  22. ------------------------------------------------------------------------------
  23. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  24. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)
  25.  
  26. 这个脚本的更动分为2部分:
  27. 1)战斗动作 - 新加了数个动作,如:“弓箭攻击”、“远距离发动”等等
  28. 2)战斗动画 - 基本上是脚本原带的。只是这个功能被隐藏起来了。现在已恢复。
  29.  
  30. 用法:
  31. 在相应的脚本行加入武器/技能/道具的数据库id(id之间要用“,”来分开)
  32. 如果不要某些功能的话就随便填一个外太空id就行了(没有用到的id)
  33. 1)战斗动作(角色/行走图的动作)
  34. 脚本355行:  远程武器的id  (普通攻击时使用远程射击)
  35. 脚本357行:  回旋武器的id  (普通攻击时会飞回手上的武器,如:回力镖)
  36. 脚本370行:  远程技能的id  (使用技能时是远程射击)
  37. 脚本372行:  回旋技能的id  (使用技能时,飞出的武器会飞回手上)
  38.  
  39. 2)战斗动画(显示‘对象方的动画’之前先显示‘飞行武器射去敌人身上’的动画)
  40. 脚本453行:  回旋武器的id  (攻击时会显示一段类似回力镖的动画)
  41. 脚本455行:  弓箭武器的id  (攻击时会显示箭射去敌人身上的动画)
  42. 脚本457行:  铳类武器的id  (攻击时会显示子弹射去敌人身上的动画)
  43. 脚本470行:  回旋技能的id  (技能使用时会显示一段类似回力镖的动画)
  44. 脚本472行:  弓箭技能的id  (技能使用时会显示箭射去敌人身上的动画)
  45. 脚本474行:  铳类技能的id  (技能使用时会显示子弹射去敌人身上的动画)
  46. 脚本486行:  抛击道具的id  (使用该道具时,道具被丢到敌人身上)
  47.  
  48. 〉注意:
  49. 〉‘飞行武器射去敌人身上’的动画是在设定id之后的那句脚本里面设置
  50. 〉例子:(脚本第455和456行)
  51. 〉       when 17,18,19,20    #远程武器1(弓箭类)的id
  52. 〉       return [101,32,false,false]
  53. 〉这样,武器17~20(都是弓箭)在显示‘对象方的动画’之前会先显示第101号动画
  54. 〉而动画的轨道是从使用者身上直到敌人身上(实现子弹射出的效果)
  55.  
  56. 还有:
  57. 战斗队伍的画面位置已经被修改过,
  58. 让角色的位置与默认的战斗背景图不会有视觉上的冲突。
  59. 如果要更改请去脚本第113-116行改改就行了。
  60.  
  61. 脚本‘Arrow_Enemy’和‘Arrow_Actor’被稍微修改过(可以无视)
  62.  
  63. 这个范例附带了
  64. 一张经过修改的战斗背景图(027-castle03),其他的战斗背景图可以使用默认的。
  65. 一套横版的默认敌人的战斗图(从行走图改过来的)
  66.  
  67. =end                                                        #modify by darkten
  68. ###############################################################################
  69.  
  70. module Side_view
  71.   #--------------------------------------------------------------------------
  72.   # ● 是否与RATB并用 ☆自动识别(这到是不错~省了~)
  73.   #    在Scene_Battle计算方法是否是方法synthe?
  74.   #    在自动不想认识的时候,请重写。
  75.   #--------------------------------------------------------------------------
  76.   if Scene_Battle.method_defined?("synthe?")
  77.     RTAB = true
  78.   else
  79.     RTAB = false
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ● 改正RATB中的位置误差 ☆自动识别
  83.   #    在自动不想认识的时候,请重写。
  84.   #--------------------------------------------------------------------------
  85.   def camera_correctness
  86.     return false if !RTAB
  87.     begin
  88.       return $scene.drive
  89.     rescue
  90.       return false
  91.     end
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ● 队伍中的最大人数
  95.   #--------------------------------------------------------------------------
  96.   Party_max = 4
  97.   #--------------------------------------------------------------------------
  98.   # ● 战斗图的扩大率(1.0的时候是保持原有大小)
  99.   #--------------------------------------------------------------------------
  100.   CHAR_ZOOM = 1.0
  101.   #--------------------------------------------------------------------------
  102.   # ● 光标的位置修正(基本不需要改~)
  103.   #--------------------------------------------------------------------------
  104.   ARROW_OX = 0
  105.   ARROW_OY = 64
  106.   #--------------------------------------------------------------------------
  107.   # ● 名状态作为飞行管理的排列(不知道什么意思....)
  108.   #--------------------------------------------------------------------------
  109.   FLY_STATES = ["飛行"]
  110.   #--------------------------------------------------------------------------
  111.   # ● 战斗画面的位置
  112.   #--------------------------------------------------------------------------
  113.   PARTY_X = 455     # 队伍 X 位置
  114.   PARTY_Y = 200     # 队伍 Y 位置
  115.   FORMATION_X = 15  # 各个角色之间的间隔 X
  116.   FORMATION_Y = 35  # 各个角色之间的间隔 Y
  117.   #--------------------------------------------------------------------------
  118.   # ● 自定义常数
  119.   #--------------------------------------------------------------------------
  120.   NORMAL   = "NORMAL"
  121.   WALK_R   = "WALK_R"
  122.   WALK_L   = "WALK_L"
  123.   ATTACK   = "ATTACK"
  124.   ATTACK_R = "ATTACK_R"
  125.   ATTACK_L = "ATTACK_L"
  126.   MAGIC    = "MAGIC"
  127.   ITEM     = "ITEM"
  128.   # 动画的设定
  129.   ANIME = {
  130.     # [画像ID,是否循环,アニメスピード,动画速度,不能指向动画,武器放在右手or左手]
  131.     NORMAL            => [1,true , 0,false, true ,""    ], # 通常待击
  132.     WALK_R            => [2,true , 2,false, false,""    ], # 右移动
  133.     WALK_L            => [1,true , 2,false, false,""    ], # 左移动
  134.     ATTACK_R          => [1,false, 2,true , false,"右手"], # 右手攻击
  135.     ATTACK_L          => [1,false, 2,true , false,"左手"], # 左手攻击
  136.     MAGIC             => [1,false, 2,false, false,""    ], # 右手攻击
  137.     ITEM              => [1,false, 2,false, false,""    ], # 左手攻击
  138.     }
  139.  
  140.   # 债务不履行声明价值的设定(一个字一个字翻译的,不知道啥意思)  
  141.   ANIME.default = [1,false,12,false,"",""]
  142.  
  143.   # 在行动设定的时候 右手攻击 or 左手攻击 辨别を(这个不知道什么意思)的ANIME
  144.   # "角色动画变更#ATTACK"在玩了と(还是不知道啥意思..)的时候,辨别ATTACK_R或者ATTACK_L
  145.   DUAL_WEAPONS_ANIME = [ATTACK]
  146.  
  147.   #--------------------------------------------------------------------------
  148.   # ● 摇晃的设定
  149.   #--------------------------------------------------------------------------
  150.   SHAKE_FILE = "摇晃"  # 文件名
  151.   SHAKE_POWER = 5          # 强度
  152.   SHAKE_SPEED = 5          # 速度
  153.   SHAKE_DURATION = 5      # 时间
  154.   #--------------------------------------------------------------------------
  155.   # ● 上下反转地的设定
  156.   #--------------------------------------------------------------------------
  157.   UPSIDE_DOWN_FILE = "上下反转" # 文件名
  158.   #--------------------------------------------------------------------------
  159.   # ● 左右反转地的设定
  160.   #--------------------------------------------------------------------------
  161.   REVERSE_FILE = "左右反转" # 文件名
  162.   #--------------------------------------------------------------------------
  163.   # ● 回转地的设定
  164.   #--------------------------------------------------------------------------
  165.   TURNING_FILE = "回转" # 文件名
  166.   TURNING_DIRECTION = 1 # 方向(1.逆时针,-1.顺时针)(|||-_-汗..怎么还有用-1做带入值的...)
  167.   TURNING_SPEED = 40    # 速度
  168.   TURNING_DURATION = 1  # 回转数
  169.   #--------------------------------------------------------------------------
  170.   # ● 移动的设定
  171.   #--------------------------------------------------------------------------
  172.   MOVE_FILE = "移动"             # 文件名
  173.   MOVE_RETURN = 1                # 回到原来的位置吗?(光写了个1,也不知道不回到该怎么写?0?)
  174.   MOVE_SPEED = 32                # 速度
  175.   MOVE_COORDINATES = [0,-640]    # 原来位置的相对坐标
  176.   #--------------------------------------------------------------------------
  177.   # ● 动画追加的设定
  178.   #--------------------------------------------------------------------------
  179.   ADD_ANIME_FILE = "动画追加"  # 文件名
  180.   ADD_ANIME_ID = 0               # 动画的ID
  181.   #--------------------------------------------------------------------------
  182.   # ● 债务不履行声明和RTAB的数据转换
  183.   #--------------------------------------------------------------------------
  184.   def convert_battler
  185.     return RTAB ? @active_actor : @active_battler
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # ● 债务不履行声明和RTAB的数据转换2
  189.   #--------------------------------------------------------------------------
  190.   def convert_battler2(*arg)
  191.     return RTAB ? arg[0] : @active_battler
  192.   end
  193. end
  194.  
  195. #--------------------------------------------------------------------------
  196. # ● 行动設定
  197. #--------------------------------------------------------------------------
  198. module BattleActions
  199.  
  200.   # 下のものはあくまでも一例なので
  201.   # 独自に作ってください。
  202.  
  203.   Actions = {
  204.  
  205.   "通常攻撃" => [
  206.  
  207.   "閃きアニメ",
  208.   "アクターアニメ変更#WALK_L",
  209.   "移動#target,32,0,64,0",
  210.   "行動アニメ",
  211.   "アクターアニメ変更#ATTACK",
  212.   "遠距離アニメ",
  213.   "対象アニメ",
  214.   "アクターアニメ変更#WALK_L",
  215.   "SEの演奏#016-Jump02,80,100",
  216.   "移動#self,0,0,48,32",
  217.   "終了"
  218.   ],
  219.  
  220.   "エネミー攻撃" => [
  221.  
  222.   "閃きアニメ",
  223.   "アクターアニメ変更#WALK_L",
  224.   "移動#self,-36,0,12,0",
  225.   "行動アニメ",
  226.   "アクターアニメ変更#ATTACK",
  227.   "遠距離アニメ",
  228.   "対象アニメ",
  229.   "アクターアニメ変更#WALK_L",
  230.   "移動#self,0,0,12,0",
  231.   "終了"
  232.   ],
  233.  
  234.   "術発動" => [
  235.  
  236.   "閃きアニメ",
  237.   "アクターアニメ変更#WALK_L",
  238.   "移動#self,-32,0,4,0",
  239.   "アクターアニメ変更#MAGIC",
  240.   "行動アニメ",
  241.   "ウエイト#15",
  242.   "遠距離アニメ",
  243.   "対象アニメ",
  244.   "アクターアニメ変更#WALK_L",
  245.   "移動#self,0,0,4,2",
  246.   "終了"
  247.   ],
  248.  
  249.   "アイテム使用" => [
  250.  
  251.   "閃きアニメ",
  252.   "アクターアニメ変更#WALK_L",
  253.   "移動#self,-32,0,4,0",
  254.   "行動アニメ",
  255.   "アクターアニメ変更#ITEM",
  256.   "ウエイト#15",
  257.   "遠距離アニメ",
  258.   "対象アニメ",
  259.   "アクターアニメ変更#WALK_L",
  260.   "移動#self,0,0,4,2",
  261.   "終了"
  262.   ],
  263.  
  264.   "払い抜け" => [
  265.  
  266.   "閃きアニメ",
  267.   "アクターアニメ変更#WALK_L",
  268.   "移動#target_near,50,0,48,30",  
  269.   "左右反転",
  270.   "アクターアニメ固定#ATTACK#3",
  271.   "行動アニメ",
  272.   "SEの演奏#135-Light01,100,100",
  273.   "アニメーションの表示#self,42",
  274.   "ウエイト#15",
  275.   "左右反転",
  276.   "残像表示",
  277.   "移動#target_far,-50,0,48,0",
  278.   "対象アニメ",
  279.   "残像消去",
  280.   "アニメ固定解除",
  281.   "アクターアニメ変更#WALK_L",
  282.   "移動#self,0,0,48,1,0",
  283.   "終了"
  284.   ],
  285.  
  286.   "弓箭攻撃" => [
  287.  
  288.   "閃きアニメ",
  289.   "アクターアニメ変更#WALK_L",
  290.   "移動#self,-32,0,4,0",
  291.   "行動アニメ",
  292.   "アクターアニメ変更#ATTACK",
  293.   "遠距離アニメ",
  294.   "対象アニメ",
  295.   "アクターアニメ変更#WALK_L",
  296.   "移動#self,0,0,4,2",
  297.   "終了"
  298.   ],
  299.  
  300.   "回旋攻撃" => [
  301.  
  302.   "閃きアニメ",
  303.   "アクターアニメ変更#WALK_L",
  304.   "移動#self,-32,0,4,0",
  305.   "行動アニメ",
  306.   "アクターアニメ変更#STAND_L",  
  307.   "遠距離アニメ",
  308.   "対象アニメ",
  309.   "アクターアニメ変更#WALK_L",
  310.   "移動#self,0,0,4,2",
  311.   "終了"
  312.   ],
  313.  
  314.   "远距离発動" => [
  315.  
  316.   "閃きアニメ",
  317.   "アクターアニメ変更#WALK_L",
  318.   "移動#self,-32,0,4,0",
  319.   "アクターアニメ変更#MAGIC",
  320.   "行動アニメ",
  321.   "アクターアニメ変更#ATTACK",
  322.   "遠距離アニメ",
  323.   "対象アニメ",
  324.   "アクターアニメ変更#WALK_L",
  325.   "移動#self,0,0,4,2",
  326.   "終了"
  327.   ],
  328.  
  329.   "回旋発動" => [
  330.  
  331.   "閃きアニメ",
  332.   "アクターアニメ変更#WALK_L",
  333.   "移動#self,-32,0,4,0",
  334.   "アクターアニメ変更#MAGIC",
  335.   "行動アニメ",
  336.   "アクターアニメ変更#STAND_L",  
  337.   "遠距離アニメ",
  338.   "対象アニメ",
  339.   "アクターアニメ変更#WALK_L",
  340.   "移動#self,0,0,4,2",
  341.   "終了"
  342.   ],
  343.  
  344.   } # ここで終わり 消さないでください
  345.  
  346. end
  347.  
  348. module RPG
  349.   class Weapon
  350.     #--------------------------------------------------------------------------
  351.     # ● アクション設定
  352.     #--------------------------------------------------------------------------
  353.     def battle_actions
  354.       case @id
  355.       when 17,18,19,20,21,22,23,24  # 远程武器的id回旋攻撃
  356.         return BattleActions::Actions["弓箭攻撃"]
  357.       when 34                       # 回旋武器的id
  358.         return BattleActions::Actions["回旋攻撃"]
  359.       end
  360.       else
  361.       return BattleActions::Actions["通常攻撃"]
  362.     end
  363.   end
  364.   class Skill
  365.     #--------------------------------------------------------------------------
  366.     # ● アクション設定
  367.     #--------------------------------------------------------------------------
  368.     def battle_actions
  369.       case @id
  370.       when 73,74,75,76,77,78,79,80  # 远程技能的id
  371.         return BattleActions::Actions["远距离発動"]
  372.       when 82                       # 回旋技能的id
  373.         return BattleActions::Actions["回旋発動"]
  374.       end
  375.       else
  376.       if self.magic?
  377.         return BattleActions::Actions["術発動"]
  378.       else
  379.         return BattleActions::Actions["払い抜け"]
  380.       end
  381.     end
  382.   end
  383.   class Item
  384.     #--------------------------------------------------------------------------
  385.     # ● アクション設定
  386.     #--------------------------------------------------------------------------
  387.     def battle_actions
  388.       return BattleActions::Actions["アイテム使用"]
  389.     end
  390.   end
  391. end
  392. class Game_Enemy < Game_Battler
  393.   #--------------------------------------------------------------------------
  394.   # ● アクション設定
  395.   #--------------------------------------------------------------------------
  396.   def battle_actions
  397.     return BattleActions::Actions["エネミー攻撃"]
  398.   end
  399. end
  400. =begin
  401. #--------------------------------------------------------------------------
  402. # ● 遠距離アニメーション
  403. #--------------------------------------------------------------------------
  404.  ☆ 説明
  405.  
  406.    行動者から対象者にアニメを飛ばします。
  407.    飛ばすアニメを データベース‐アニメーション で作ります。
  408.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。
  409.  
  410.  
  411.   ● カスタマイズ方法
  412.     
  413.     case @id
  414.     when 17,18,19,20
  415.       return [101,32,false,false]
  416.     when 21,22,23,24
  417.       return [102,32,false,false]
  418.     end
  419.     return 0
  420.     
  421.     のように描くとID別に指定可能です。
  422.     
  423.     
  424.   ● アニメーションID
  425.  
  426.   飛ばすアニメーションIDです。短い場合は繰り返しで表示されます。
  427.  
  428.     
  429.   ● スピード
  430.  
  431.   大きいほうが早い(0だとアニメは移動しません)
  432.  
  433.   1 = 1フレームで1ドット進むと考えてください。
  434.  
  435.   ● 往復するか?
  436.  
  437.   true とした場合、ブーメランのようにアニメが戻ります。
  438.  
  439.   ● 直線(false)or曲線(true)
  440.  
  441.   true  = 対象に向かって曲線で、アニメが飛びます。(修正の余地ありですが・・・)
  442.   false = 対象に向かって直線で、アニメが飛びます。
  443.     
  444. =end
  445. module RPG
  446.   class Weapon
  447.     #--------------------------------------------------------------------------
  448.     # ● 遠距離アニメーション
  449.     #--------------------------------------------------------------------------
  450.     def flying_anime
  451.       # ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
  452.       case @id
  453.       when 34             #回旋武器(类似回力镖)的id
  454.         return [103,32,true,true]
  455.       when 17,18,19,20    #远程武器1(弓箭类)的id
  456.         return [101,32,false,false]
  457.       when 21,22,23,24    #远程武器2(铳类)的id
  458.         return [102,32,false,false]
  459.       end
  460.       return [0,0,false,false]
  461.     end
  462.   end
  463.   class Skill
  464.     #--------------------------------------------------------------------------
  465.     # ● 遠距離アニメーション
  466.     #--------------------------------------------------------------------------
  467.     def flying_anime
  468.       # ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
  469.       case @id
  470.       when 82             #回旋技能(类似回力镖)的id
  471.         return [103,32,true,true]
  472.       when 73,74,75,76    #远程技能1(弓箭类)的id
  473.         return [101,32,false,false]
  474.       when 77,78,79,80    #远程技能2(铳类)的id
  475.         return [102,32,false,false]
  476.       end
  477.       return [0,0,false,false]
  478.     end
  479.   end
  480.   class Item
  481.     #--------------------------------------------------------------------------
  482.     # ● 遠距離アニメーション
  483.     #--------------------------------------------------------------------------
  484.     def flying_anime
  485.       case @id
  486.       when 34    #抛击类道具(如炸弹一类)的id
  487.         return [104,32,false,true]
  488.       end
  489.       return [0,0,false,false]
  490.     end
  491.   end
  492. end
  493.  
  494. class Game_Enemy < Game_Battler
  495.   #--------------------------------------------------------------------------
  496.   # ● 遠距離アニメーション
  497.   #--------------------------------------------------------------------------
  498.   def flying_anime
  499.     return [0,0,false,false]
  500.   end
  501. end
  502. #==============================================================================
  503. # ■ Game_Battler
  504. #==============================================================================
  505. class Game_Battler
  506.   include Side_view
  507.   #--------------------------------------------------------------------------
  508.   # ● 追加・公開インスタンス変数
  509.   #--------------------------------------------------------------------------
  510.   attr_accessor :height                  # 画像の高さ
  511.   attr_accessor :real_x                  # X座標補正
  512.   attr_accessor :real_y                  # Y座標補正
  513.   attr_accessor :real_zoom               # 拡大率
  514.   attr_accessor :wait_count              # アニメーション 待ち時間
  515.   attr_accessor :wait_count2             # アニメーション 待ち時間2
  516.   attr_accessor :pattern                 # アニメーション カウント(キャラ)
  517.   attr_accessor :shake                   # シェイク開始フラッグ
  518.   attr_accessor :reverse                 # 左右反転フラッグ
  519.   attr_accessor :shadow                  # 残像フラッグ
  520.   attr_accessor :flash_flag              # 閃きフラッグ
  521.   attr_reader   :ox                      # X座標補正
  522.   attr_reader   :oy                      # Y座標補正
  523.   attr_reader   :flying_x                # 遠距離アニメX座標
  524.   attr_reader   :flying_y                # 遠距離アニメY座標
  525.   attr_reader   :flying_anime            # 遠距離アニメ
  526.   attr_reader   :animation1_on           # 行動アニメ開始フラッグ
  527.   attr_reader   :animation2_on           # 対象アニメ開始フラッグ
  528.   #--------------------------------------------------------------------------
  529.   # ● デフォルトのアニメーション待ち時間を取得
  530.   #--------------------------------------------------------------------------
  531.   def animation_duration=(animation_duration)
  532.     @_animation_duration = animation_duration
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ● バトル開始時のセットアップ
  536.   #--------------------------------------------------------------------------
  537.   def start_battle
  538.     @height = 0
  539.     @real_x = 0
  540.     @real_y = 0
  541.     @real_zoom = 1.0
  542.     @battler_condition = ""
  543.     @action = nil
  544.     @battle_actions = []
  545.     @battler_action = false
  546.     @step = 0
  547.     @anime_on = false
  548.     @wait_count = 0
  549.     @wait_count2 = 0
  550.     @ox = 0
  551.     @oy = 0
  552.     @pattern = 0
  553.     @pattern_log = true
  554.     @pattern_freeze = false
  555.     @condition_freeze = false
  556.     @active = false
  557.     @move_distance = nil
  558.     @move_wait = 0
  559.     @move_coordinates = [0,0,0,0]
  560.     @flying_distance = nil
  561.     @flying_wait = 0
  562.     @flying_x = 0
  563.     @flying_y = 0
  564.     @flash_flag = {}
  565.     self.flying_clear
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ● 移動中判定
  569.   #--------------------------------------------------------------------------
  570.   def moving?
  571.     # X座標補正または、Y座標補正が0でなければ、移動中
  572.     return (@ox != 0 or @oy != 0)
  573.   end
  574.   #--------------------------------------------------------------------------
  575.   # ● 移動終了判定
  576.   #--------------------------------------------------------------------------
  577.   def move_end?
  578.     return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # ● アクション開始設定
  582.   #--------------------------------------------------------------------------
  583.   def action(flag = true)
  584.     @battler_action = flag
  585.     @animation1_on = false
  586.     @animation2_on = false
  587.     @step = "setup"
  588.   end   
  589.   #--------------------------------------------------------------------------
  590.   # ● アクション中判定
  591.   #--------------------------------------------------------------------------
  592.   def action?
  593.     return @battler_action
  594.   end
  595.   #--------------------------------------------------------------------------
  596.   # ● 閃き判定
  597.   #--------------------------------------------------------------------------
  598.   def flash?
  599.     return @flash_flg
  600.   end
  601.   #--------------------------------------------------------------------------
  602.   # ● 戦闘不能判定
  603.   #--------------------------------------------------------------------------
  604.   def anime_dead?
  605.     if $game_temp.in_battle and !RTAB
  606.       if [2,3,4,5].include?($scene.phase4_step)
  607.         return @last_dead
  608.       end
  609.     end
  610.     return @last_dead = self.dead?
  611.   end
  612.   #--------------------------------------------------------------------------
  613.   # ● ピンチ状態判定
  614.   #--------------------------------------------------------------------------
  615.   def crisis?
  616.     if $game_temp.in_battle and !RTAB
  617.       if [2,3,4,5].include?($scene.phase4_step)
  618.         return @last_crisis
  619.       end
  620.     end
  621.     return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # ● バッドステート判定
  625.   #--------------------------------------------------------------------------
  626.   def badstate?
  627.     for i in @states
  628.       unless $data_states[i].nonresistance
  629.         return true
  630.       end
  631.     end
  632.     return false
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ● 飛行
  636.   #--------------------------------------------------------------------------
  637.   def fly
  638.     if @fly != nil
  639.       return @fly
  640.     end
  641.     for id in @states
  642.       if FLY_STATES.include?($data_states[id].name)
  643.         return 60
  644.       end
  645.     end
  646.     return 0
  647.   end
  648.   #--------------------------------------------------------------------------
  649.   # ● 遠距離アニメ目標座標の計算
  650.   #--------------------------------------------------------------------------
  651.   def flying_setup
  652.     # 二度目は実行しない
  653.     return if @flying_distance != nil && !camera_correctness
  654.     if RTAB
  655.       targets = @target
  656.     else
  657.       targets = $scene.target_battlers
  658.     end
  659.     # 目的座標を計算
  660.     @f_target_x = 0
  661.     @f_target_y = 0
  662.     for t in targets
  663.       @f_target_x += t.screen_x
  664.       @f_target_y += t.screen_y
  665.     end
  666.     if targets != []
  667.       @f_target_x /= targets.size
  668.       @f_target_y /= targets.size
  669.     else
  670.       @flying_distance = 0
  671.       return
  672.     end
  673.     # 距離の計算
  674.     @flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # ● 遠距離アニメ
  678.   #--------------------------------------------------------------------------
  679.   def flying_animation
  680.     # 戻る
  681.     if @step != "flying" or @flying_distance.nil?
  682.       return [false,true]
  683.     end
  684.     # あらかじめ計算
  685.     self_x = self.screen_x
  686.     self_y = self.screen_y
  687.     @flying_distance = @flying_distance == 0 ? 1 : @flying_distance
  688.     n1 = @flying_wait / @flying_distance.to_f
  689.     if @flying_distance - @flying_wait > @flying_distance / 2
  690.       n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
  691.     else
  692.       n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
  693.     end
  694.     if !@flying_anime[4]
  695.       # 直線移動
  696.       x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  697.       y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
  698.     else
  699.       # 曲線移動
  700.       if !@flying_proceed_end
  701.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  702.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
  703.       else
  704.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  705.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
  706.       end
  707.     end
  708.     # 座標代入
  709.     @flying_x = x
  710.     @flying_y = y
  711.     # ウエイト
  712.     if !@flying_proceed_end
  713.       # 開始
  714.       @flying_proceed_start = @flying_wait == 0
  715.       @flying_wait += @flying_anime[1]
  716.       @flying_wait = [@flying_wait,@flying_distance].min
  717.       @flying_proceed_end = @flying_wait == @flying_distance
  718.     else
  719.       # 開始
  720.       @flying_return_start = @flying_wait == @flying_distance
  721.       @flying_wait -= @flying_anime[1]
  722.       @flying_wait = [@flying_wait,0].max
  723.       @flying_return_end = @flying_wait == 0
  724.     end
  725.     if @flying_anime[1] == 0
  726.       @flying_end = true
  727.     elsif !@flying_anime[2]
  728.       @flying_end = @flying_proceed_end
  729.     else
  730.       @flying_end = @flying_return_end
  731.     end
  732.     # 値を返す(アニメ開始,アニメ終了)
  733.     return [@flying_proceed_start,@flying_end]
  734.   end
  735.   #--------------------------------------------------------------------------
  736.   # ● 遠距離アニメ初期化
  737.   #--------------------------------------------------------------------------
  738.   def flying_clear
  739.     @flying_proceed_start = false
  740.     @flying_proceed_end = false
  741.     @flying_return_start = false
  742.     @flying_return_end = false
  743.     @flying_end = false
  744.     @flying_anime = [0,0,false]
  745.   end
  746.   #--------------------------------------------------------------------------
  747.   # ● 移動
  748.   #--------------------------------------------------------------------------
  749.   def move
  750.     # 距離の計算
  751.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  752.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  753.     if @move_distance > 0
  754.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  755.       array = @move_coordinates
  756.       # ジャンプ補正値の計算
  757.       if @move_distance - @move_wait > @move_distance / 2
  758.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2
  759.       else
  760.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  761.       end
  762.       jump = @move_action[4] > 0 ? -jump : jump
  763.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  764.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  765.       # ウエイト
  766.       @move_wait -= @move_action[3]
  767.       @move_wait = [@move_wait,0].max
  768.     end
  769.   end
  770.   #--------------------------------------------------------------------------
  771.   # ● 移動アクションの取得
  772.   #--------------------------------------------------------------------------
  773.   def get_move_action
  774.     string = @action.split(/#/)[1]
  775.     string = string.split(/,/)
  776.     @move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
  777.   end
  778.   #--------------------------------------------------------------------------
  779.   # ● アクションの取得
  780.   #--------------------------------------------------------------------------
  781.   def get_step
  782.     if @action.nil?
  783.       @step = "finish"
  784.       return
  785.     end
  786.     string = @action.split(/#/)[0]
  787.     if string =~ "移動"
  788.       @step = "moving_setup"
  789.     elsif string =~ "アクターアニメ実行"
  790.       @step = "action"
  791.     elsif string =~ "遠距離アニメ"
  792.       @step = "flying"
  793.     elsif string =~ "アクターアニメ変更"
  794.       @step = "change"
  795.     elsif string =~ "行動アニメ"
  796.       @step = "animation1"
  797.     elsif string =~ "対象アニメ"
  798.       @step = "animation2"
  799.     elsif string =~ "ウエイト"
  800.       @step = "wait"
  801.     elsif string =~ "左右反転"
  802.       @step = "reverse"
  803.     elsif string =~ "閃きアニメ"
  804.       @step = "flash"
  805.     elsif string =~ "残像表示"
  806.       @step = "shadow_on"
  807.     elsif string =~ "残像消去"
  808.       @step = "shadow_off"
  809.     elsif string =~ "アクターアニメ固定"
  810.       @step = "freeze"
  811.     elsif string =~ "アニメ固定解除"
  812.       @step = "freeze_lifting"
  813.     elsif string =~ "アニメーションの表示"
  814.       @step = "animation_start"
  815.     elsif string =~ "SEの演奏"
  816.       @step = "play_se"
  817.     else
  818.       @step = "finish"
  819.     end
  820.   end
  821.   #--------------------------------------------------------------------------
  822.   # ● フレーム更新 (次のアクションへ)
  823.   #--------------------------------------------------------------------------
  824.   def update_next
  825.     @action = @battle_actions.shift
  826.     @step = get_step
  827.   end
  828.   #--------------------------------------------------------------------------
  829.   # ● フレーム更新 (動作取得)
  830.   #--------------------------------------------------------------------------
  831.   def update_setup
  832.     # アクションの取得
  833.     self.get_actions
  834.     @action = @battle_actions.shift
  835.     @step = get_step
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # ● フレーム更新 (移動取得)
  839.   #--------------------------------------------------------------------------
  840.   def update_moving_setup
  841.     # 移動アクションの取得
  842.     self.get_move_action
  843.     # 移動目標の設定
  844.     self.move_setup
  845.     @step = "moving"
  846.   end
  847.   #--------------------------------------------------------------------------
  848.   # ● フレーム更新 (移動)
  849.   #--------------------------------------------------------------------------
  850.   def update_moving
  851.     # 移動
  852.     self.move
  853.     self.condition = @battler_condition
  854.     # 移動完了したら次のステップへ
  855.     if move_end?
  856.       @wait_count = 2
  857.       @action = @battle_actions.shift
  858.       @step = get_step
  859.     end
  860.   end
  861.   #--------------------------------------------------------------------------
  862.   # ● フレーム更新 (アニメ実行)
  863.   #--------------------------------------------------------------------------
  864.   def update_action
  865.     con = @action.split(/#/)[1]
  866.     # 右手・左手を分ける
  867.     if DUAL_WEAPONS_ANIME.include?(con)
  868.       if !@first_weapon and @second_weapon
  869.         con = con + "_L"
  870.       else
  871.         con = con + "_R"
  872.       end
  873.     end
  874.     # アニメ変更
  875.     self.condition = con
  876.     # ループか否か
  877.     if !ANIME[@battler_condition][1]
  878.       self.anime_on
  879.     end
  880.     @action = @battle_actions.shift
  881.     @step = get_step
  882.   end
  883.   #--------------------------------------------------------------------------
  884.   # ● フレーム更新 (遠距離アニメ)
  885.   #--------------------------------------------------------------------------
  886.   def update_flying
  887.     # 目標の設定
  888.     self.flying_setup
  889.     # 遠距離アニメ終了
  890.     if @flying_end
  891.       self.flying_clear
  892.       @action = @battle_actions.shift
  893.       @step = get_step
  894.     end
  895.   end
  896.   #--------------------------------------------------------------------------
  897.   # ● フレーム更新 (アニメ変更)
  898.   #--------------------------------------------------------------------------
  899.   def update_change
  900.     con = @action.split(/#/)[1]
  901.     # 右手・左手を分ける
  902.     if DUAL_WEAPONS_ANIME.include?(con)
  903.       if !@first_weapon and @second_weapon
  904.         con = con + "_L"
  905.       else
  906.         con = con + "_R"
  907.       end
  908.     end
  909.     # アニメ変更
  910.     self.condition = con
  911.     # ループか否か
  912.     if !ANIME[@battler_condition][1]
  913.       self.anime_on
  914.     end
  915.     @action = @battle_actions.shift
  916.     @step = get_step
  917.   end
  918.   #--------------------------------------------------------------------------
  919.   # ● フレーム更新 (行動アニメ)
  920.   #--------------------------------------------------------------------------
  921.   def update_animation1
  922.     @animation1_on = true
  923.     # 行動アニメの後に行動を開始する
  924.     if $scene.phase4_step == 3
  925.       id = RTAB ? @anime1 : $scene.animation1_id
  926.       animation = $data_animations[id]
  927.       frame_max = animation != nil ? animation.frame_max : 0
  928.       @wait_count2 = frame_max * 2
  929.       return
  930.     end
  931.     @action = @battle_actions.shift
  932.     @step = get_step
  933.   end
  934.   #--------------------------------------------------------------------------
  935.   # ● フレーム更新 (対象アニメ)
  936.   #--------------------------------------------------------------------------
  937.   def update_animation2
  938.     @animation2_on = true
  939.     # 行動アニメの後に行動を開始する
  940.     if $scene.phase4_step == 4
  941.       id = RTAB ? @anime2 : $scene.animation2_id
  942.       animation = $data_animations[id]
  943.       frame_max = animation != nil ? animation.frame_max : 0
  944.       @wait_count2 = frame_max * 2
  945.       return
  946.     end
  947.     @action = @battle_actions.shift
  948.     @step = get_step
  949.   end
  950.   #--------------------------------------------------------------------------
  951.   # ● フレーム更新 (ウエイト)
  952.   #--------------------------------------------------------------------------
  953.   def update_wait
  954.     @wait_count2 = @action.split(/#/)[1].to_i
  955.     @action = @battle_actions.shift
  956.     @step = get_step
  957.   end
  958.   #--------------------------------------------------------------------------
  959.   # ● フレーム更新 (残像表示)
  960.   #--------------------------------------------------------------------------
  961.   def update_shadow_on
  962.     @shadow = true
  963.     @action = @battle_actions.shift
  964.     @step = get_step
  965.   end
  966.   #--------------------------------------------------------------------------
  967.   # ● フレーム更新 (残像消去)
  968.   #--------------------------------------------------------------------------
  969.   def update_shadow_off
  970.     @shadow = false
  971.     @action = @battle_actions.shift
  972.     @step = get_step
  973.   end
  974.   #--------------------------------------------------------------------------
  975.   # ● フレーム更新 (左右反転)
  976.   #--------------------------------------------------------------------------
  977.   def update_reverse
  978.     @reverse = @reverse ? false : true
  979.     @action = @battle_actions.shift
  980.     @step = get_step
  981.   end
  982.   #--------------------------------------------------------------------------
  983.   # ● フレーム更新 (閃きアニメ)
  984.   #--------------------------------------------------------------------------
  985.   def update_flash
  986.     # 閃きアニメの後に行動を開始する
  987.     if @flash_flag["normal"]
  988.       @wait_count = $scene.flash_duration
  989.       @flash_flag["normal"] = false
  990.       return
  991.     end
  992.     @action = @battle_actions.shift
  993.     @step = get_step
  994.   end
  995.   #--------------------------------------------------------------------------
  996.   # ● フレーム更新 (SEの演奏)
  997.   #--------------------------------------------------------------------------
  998.   def update_play_se
  999.     data = @action.split(/#/)[1]
  1000.     data = data.split(/,/)
  1001.     # SE を演奏
  1002.     Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
  1003.     @action = @battle_actions.shift
  1004.     @step = get_step
  1005.   end
  1006.   #--------------------------------------------------------------------------
  1007.   # ● フレーム更新 (アクターアニメ固定)
  1008.   #--------------------------------------------------------------------------
  1009.   def update_freeze
  1010.     con = @action.split(/#/)[1]
  1011.     # 右手・左手を分ける
  1012.     if DUAL_WEAPONS_ANIME.include?(con)
  1013.       if !@first_weapon and @second_weapon
  1014.         con = con + "_L"
  1015.       else
  1016.         con = con + "_R"
  1017.       end
  1018.     end
  1019.     # アニメ変更
  1020.     self.condition = con
  1021.     @pattern = @action.split(/#/)[2].to_i
  1022.     @pattern_freeze = true
  1023.     @condition_freeze = true
  1024.     @action = @battle_actions.shift
  1025.     @step = get_step
  1026.   end
  1027.   #--------------------------------------------------------------------------
  1028.   # ● フレーム更新 (アクターアニメ固定解除)
  1029.   #--------------------------------------------------------------------------
  1030.   def update_freeze_lifting
  1031.     @pattern_freeze = false
  1032.     @condition_freeze = false
  1033.     @action = @battle_actions.shift
  1034.     @step = get_step
  1035.   end
  1036.   #--------------------------------------------------------------------------
  1037.   # ● フレーム更新 (アニメーションの表示)
  1038.   #--------------------------------------------------------------------------
  1039.   def update_animation_start
  1040.     data = @action.split(/#/)[1]
  1041.     data = data.split(/,/)
  1042.     target = data[0]
  1043.     animation_id = data[1].to_i
  1044.     if RTAB
  1045.       case target
  1046.       when "self"
  1047.         @animation.push([animation_id,true])
  1048.       when "target"
  1049.         for tar in @target
  1050.           tar.animation.push([animation_id, true])
  1051.         end
  1052.       end
  1053.     else
  1054.       case target
  1055.       when "self"
  1056.         @animation_id = animation_id
  1057.         @animation_hit = true
  1058.       when "target"
  1059.         for tar in $scene.target_battlers
  1060.           tar.animation_id = animation_id
  1061.           tar.animation_hit = true
  1062.         end
  1063.       end
  1064.     end
  1065.     @action = @battle_actions.shift
  1066.     @step = get_step
  1067.   end
  1068.   #--------------------------------------------------------------------------
  1069.   # ● フレーム更新 (動作終了)
  1070.   #--------------------------------------------------------------------------
  1071.   def update_finish
  1072.     # 動作終了
  1073.     @battler_action = false
  1074.     @step = "setup"
  1075.   end
  1076.   #--------------------------------------------------------------------------
  1077.   # ● バトラーの状態 変更(バトラーグラフィックのタイプ)
  1078.   #--------------------------------------------------------------------------
  1079.   def condition=(condition)
  1080.     return if @condition_freeze
  1081.     @battler_condition = condition
  1082.     @wait_count = ANIME[condition][2]
  1083.   end
  1084.   #--------------------------------------------------------------------------
  1085.   # ● バトラーの状態(バトラーグラフィックのタイプ)
  1086.   #--------------------------------------------------------------------------
  1087.   def condition
  1088.     return @battler_condition
  1089.   end
  1090.   #--------------------------------------------------------------------------
  1091.   # ● フレーム更新
  1092.   #--------------------------------------------------------------------------
  1093.   def update
  1094.     # ウェイト中の場合
  1095.     if @wait_count > 0
  1096.       return
  1097.     end
  1098.     # パターン更新
  1099.     self.char_animation
  1100.     # ウェイト中の場合
  1101.     if @wait_count2 > 0
  1102.       return
  1103.     end
  1104.  
  1105.     # 行動アニメーション
  1106.     if @battler_action
  1107.       method("update_" + @step).call
  1108.       return
  1109.     end
  1110.  
  1111.     # データ初期化
  1112.     @animation1_on = false
  1113.     @animation2_on = false
  1114.     @action = nil
  1115.     @battle_actions = []
  1116.     @move_wait = 0
  1117.     @move_distance = nil
  1118.     @flying_wait = 0
  1119.     @flying_distance = nil
  1120.     @flash = false
  1121.  
  1122.     # RTAB対応
  1123.     # 通常・待機
  1124.     return self.condition = NORMAL
  1125.   end
  1126.   #--------------------------------------------------------------------------
  1127.   # ● アクションの取得
  1128.   #--------------------------------------------------------------------------
  1129.   def get_actions
  1130.     skill = $data_skills[self.current_action.skill_id]
  1131.     item = $data_items[self.current_action.item_id]
  1132.     kind = self.current_action.kind
  1133.     # 動作取得
  1134.     @battle_actions = []
  1135.     # スキル
  1136.     if skill != nil && kind == 1
  1137.       @battle_actions = skill.battle_actions.dup
  1138.       @flying_anime = skill.flying_anime
  1139.     # アイテム
  1140.     elsif item != nil && kind == 2
  1141.       @battle_actions = item.battle_actions.dup
  1142.       @flying_anime = item.flying_anime
  1143.     # 左手攻撃
  1144.     elsif !@first_weapon and @second_weapon and self.is_a?(Game_Actor)
  1145.       @battle_actions = self.battle_actions2.dup
  1146.       @flying_anime = self.flying_anime2
  1147.     # 右手攻撃
  1148.     elsif self.current_action.basic == 0 and
  1149.       self.is_a?(Game_Actor) and self.current_action.kind == 0
  1150.       @battle_actions = self.battle_actions1.dup
  1151.       @flying_anime = self.flying_anime1
  1152.     # 通常攻撃
  1153.     elsif self.current_action.basic == 0 and self.current_action.kind == 0
  1154.       @battle_actions = self.battle_actions.dup
  1155.       @flying_anime = self.flying_anime
  1156.     else
  1157.       @battle_actions = ["終了"]
  1158.       @flying_anime = [0,0,false,false]
  1159.     end
  1160.   end
  1161.   #--------------------------------------------------------------------------
  1162.   # ● ループしないアニメのセット
  1163.   #--------------------------------------------------------------------------
  1164.   def anime_on
  1165.     @pattern = 0
  1166.     @pattern_log = true
  1167.     return
  1168.   end
  1169.   #--------------------------------------------------------------------------
  1170.   # ● パターン更新
  1171.   #--------------------------------------------------------------------------
  1172.   def char_animation
  1173.     # パタン固定の場合もどる
  1174.     return if @pattern_freeze
  1175.     # ループしないアニメの場合 1234 で止まる
  1176.     if !ANIME[@battler_condition][1] && @pattern == 3
  1177.       return
  1178.     end
  1179.     # アニメさせない場合 1 で止まる
  1180.     if ANIME[@battler_condition][4]
  1181.       @pattern = 0
  1182.       return
  1183.     end
  1184.     @pattern = (@pattern + 1) % 4
  1185.   end
  1186.   #--------------------------------------------------------------------------
  1187.   # ● アニメタイプ
  1188.   #--------------------------------------------------------------------------
  1189.   def anime_type
  1190.     return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  1191.   end
  1192. end
  1193. #==============================================================================
  1194. # ■ Game_Actor
  1195. #==============================================================================
  1196. class Game_Actor < Game_Battler
  1197.   include Side_view
  1198.   #--------------------------------------------------------------------------
  1199.   # ● セットアップ
  1200.   #--------------------------------------------------------------------------
  1201.   alias side_view_setup setup
  1202.   def setup(actor_id)
  1203.     side_view_setup(actor_id)
  1204.     start_battle
  1205.   end
  1206.   #--------------------------------------------------------------------------
  1207.   # ● 二刀武器のID取得 ※エラー回避用
  1208.   #--------------------------------------------------------------------------
  1209.   def weapon2_id
  1210.     return @weapon2_id != nil ? @weapon2_id : 0
  1211.   end
  1212.   #--------------------------------------------------------------------------
  1213.   # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  1214.   #--------------------------------------------------------------------------
  1215.   def position
  1216.     return $data_classes[@class_id].position
  1217.   end
  1218.   #--------------------------------------------------------------------------
  1219.   # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  1220.   #--------------------------------------------------------------------------
  1221.   def position2
  1222.     return self.index
  1223.   end
  1224.   #--------------------------------------------------------------------------
  1225.   # ● 武器アニメタイプ
  1226.   #--------------------------------------------------------------------------
  1227.   def weapon_anime_type(type)
  1228.     file_name  = weapon_anime_type0(type)
  1229.     visible   = weapon_anime_type1(type)
  1230.     z         = weapon_anime_type2(type)
  1231.     return [file_name,visible,z]
  1232.   end
  1233.   # 武器アイコン取得
  1234.   def weapon_anime_type0(type)
  1235.     type = ANIME[type][5]
  1236.     return weapon_anime1 if type == "右手"
  1237.     return weapon_anime2 if type == "左手"
  1238.     return nil
  1239.   end
  1240.   # 表示・非表示の取得
  1241.   def weapon_anime_type1(type)
  1242.     return ANIME[type][3]
  1243.   end
  1244.   # バトラーより上に表示するかどうか
  1245.   def weapon_anime_type2(type)
  1246.     type = ANIME[type][5]
  1247.     return true if type == "左手"
  1248.     return false
  1249.   end
  1250.   #--------------------------------------------------------------------------
  1251.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1252.   #--------------------------------------------------------------------------
  1253.   def true_x
  1254.     return PARTY_X + position * FORMATION_X + @ox
  1255.   end
  1256.   #--------------------------------------------------------------------------
  1257.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1258.   #--------------------------------------------------------------------------
  1259.   def true_y
  1260.     # パーティ内の並び順から Y 座標を計算して返す
  1261.     if self.index != nil
  1262.       y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
  1263.       return y
  1264.     else
  1265.       return 0
  1266.     end
  1267.   end
  1268.   #--------------------------------------------------------------------------
  1269.   # ● バトル画面 X 座標の取得
  1270.   #--------------------------------------------------------------------------
  1271.   def screen_x(true_x = self.true_x)
  1272.     return 320 + (true_x - 320) * @real_zoom + @real_x
  1273.   end
  1274.   #--------------------------------------------------------------------------
  1275.   # ● バトル画面 Y 座標の取得
  1276.   #--------------------------------------------------------------------------
  1277.   def screen_y(true_y = self.true_y)
  1278.     return true_y * @real_zoom + @real_y
  1279.   end
  1280.   #--------------------------------------------------------------------------
  1281.   # ● バトル画面 Z 座標の取得
  1282.   #--------------------------------------------------------------------------
  1283.   def screen_z
  1284.     return screen_y + 1000
  1285.   end
  1286.   #--------------------------------------------------------------------------
  1287.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1288.   #--------------------------------------------------------------------------
  1289.   def base_x
  1290.     return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  1291.   end
  1292.   #--------------------------------------------------------------------------
  1293.   # ● バトル画面 Y 座標の取得
  1294.   #--------------------------------------------------------------------------
  1295.   def base_y
  1296.     return (true_y - @oy) * @real_zoom + @real_y
  1297.   end
  1298.   #--------------------------------------------------------------------------
  1299.   # ● バトル画面 拡大率の取得
  1300.   #--------------------------------------------------------------------------
  1301.   def zoom
  1302.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  1303.                           (true_x + @fly) / 480 + $scene.zoom_rate[0]
  1304.   end
  1305.   #--------------------------------------------------------------------------
  1306.   # ● 攻撃用、バトル画面 X 座標の取得
  1307.   #--------------------------------------------------------------------------
  1308.   def attack_x(z)
  1309.     return (320 - true_x) * z * 0.75
  1310.   end
  1311.   #--------------------------------------------------------------------------
  1312.   # ● 攻撃用、バトル画面 Y 座標の取得
  1313.   #--------------------------------------------------------------------------
  1314.   def attack_y(z)
  1315.     return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  1316.   end
  1317.   #--------------------------------------------------------------------------
  1318.   # ● 閃き待ち時間
  1319.   #--------------------------------------------------------------------------
  1320.   def flash_duration
  1321.     return $scene.flash_duration
  1322.   end
  1323.   #--------------------------------------------------------------------------
  1324.   # ● アニメーション取得
  1325.   #--------------------------------------------------------------------------
  1326.   def battle_actions1
  1327.     weapon = $data_weapons[@weapon_id]
  1328.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1329.   end
  1330.   #--------------------------------------------------------------------------
  1331.   # ● アニメーション取得
  1332.   #--------------------------------------------------------------------------
  1333.   def battle_actions2
  1334.     weapon = $data_weapons[@weapon2_id]
  1335.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1336.   end
  1337.   #--------------------------------------------------------------------------
  1338.   # ● 武器アニメーション取得
  1339.   #--------------------------------------------------------------------------
  1340.   def weapon_anime1
  1341.     weapon = $data_weapons[@weapon_id]
  1342.     return weapon != nil ? weapon.icon_name : ""
  1343.   end
  1344.   #--------------------------------------------------------------------------
  1345.   # ● 武器アニメーション取得
  1346.   #--------------------------------------------------------------------------
  1347.   def weapon_anime2
  1348.     weapon = $data_weapons[@weapon2_id]
  1349.     return weapon != nil ? weapon.icon_name : ""
  1350.   end
  1351.   #--------------------------------------------------------------------------
  1352.   # ● 遠距離アニメーション取得
  1353.   #--------------------------------------------------------------------------
  1354.   def flying_anime1
  1355.     weapon = $data_weapons[@weapon_id]
  1356.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1357.   end
  1358.   #--------------------------------------------------------------------------
  1359.   # ● 遠距離アニメーション取得
  1360.   #--------------------------------------------------------------------------
  1361.   def flying_anime2
  1362.     weapon = $data_weapons[@weapon2_id]
  1363.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1364.   end
  1365.   #--------------------------------------------------------------------------
  1366.   # ● 移動目標座標の計算
  1367.   #--------------------------------------------------------------------------
  1368.   def move_setup
  1369.     if RTAB
  1370.       targets = @target
  1371.     else
  1372.       targets = $scene.target_battlers
  1373.     end
  1374.     case @move_action[0]
  1375.     when "self" # 自分
  1376.       @target_x = self.base_x
  1377.       @target_y = self.base_y
  1378.     when "target_near" # 一番近くのターゲット
  1379.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1380.       targets.reverse!
  1381.       if targets != []
  1382.         @target_x = targets[0].screen_x
  1383.         @target_y = targets[0].screen_y
  1384.       else
  1385.         @target_x = self.base_x
  1386.         @target_y = self.base_y
  1387.       end
  1388.     when "target_far" # 一番遠くのターゲット
  1389.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1390.       if targets != []
  1391.         @target_x = targets[0].screen_x
  1392.         @target_y = targets[0].screen_y
  1393.       else
  1394.         @target_x = self.base_x
  1395.         @target_y = self.base_y
  1396.       end
  1397.     when "target" # ターゲット中央
  1398.       @target_x = 0
  1399.       @target_y = 0
  1400.       for t in targets
  1401.         @target_x += t.screen_x
  1402.         @target_y += t.screen_y
  1403.       end
  1404.       if targets != []
  1405.         @target_x /= targets.size
  1406.         @target_y /= targets.size
  1407.       end
  1408.     when "troop" # "トループ中央"
  1409.       @target_x = 0
  1410.       @target_y = 0
  1411.       for t in $game_troop.enemies
  1412.         @target_x += t.screen_x
  1413.         @target_y += t.screen_y
  1414.       end
  1415.       if $game_troop.enemies != []
  1416.         @target_x /= $game_troop.enemies.size
  1417.         @target_y /= $game_troop.enemies.size
  1418.       end
  1419.     when "party" # "パーティ中央"
  1420.       @target_x = 0
  1421.       @target_y = 0
  1422.       for t in $game_party.actors
  1423.         @target_x += t.screen_x
  1424.         @target_y += t.screen_y
  1425.       end
  1426.       if $game_party.actors != []
  1427.         @target_x /= $game_party.actors.size
  1428.         @target_y /= $game_party.actors.size
  1429.       end
  1430.     when "screen" # "画面"
  1431.       @target_x = self.base_x
  1432.       @target_y = self.base_y
  1433.     end
  1434.     # 補正
  1435.     @target_x += @move_action[1] - self.base_x
  1436.     @target_y += @move_action[2] - self.base_y
  1437.     # 移動目標の座標をセット
  1438.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1439.     # 距離の計算(ウエイトの設定)
  1440.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1441.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1442.   end
  1443. end
  1444. #==============================================================================
  1445. # ■ Game_Enemy
  1446. #==============================================================================
  1447. class Game_Enemy < Game_Battler
  1448.   #--------------------------------------------------------------------------
  1449.   # ● セットアップ
  1450.   #--------------------------------------------------------------------------
  1451.   alias side_view_initialize initialize
  1452.   def initialize(troop_id, member_index)
  1453.     side_view_initialize(troop_id, member_index)
  1454.     start_battle
  1455.   end
  1456.   #--------------------------------------------------------------------------
  1457.   # ● 移動
  1458.   #--------------------------------------------------------------------------
  1459.   def move
  1460.     # 距離の計算
  1461.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1462.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1463.     if @move_distance > 0
  1464.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  1465.       array = @move_coordinates
  1466.       # ジャンプ補正値の計算
  1467.       if @move_distance - @move_wait > @move_distance / 2
  1468.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2
  1469.       else
  1470.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  1471.       end
  1472.       jump = @move_action[4] > 0 ? -jump : jump
  1473.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  1474.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  1475.       # ウエイト
  1476.       @move_wait -= @move_action[3]
  1477.       @move_wait = [@move_wait,0].max
  1478.     end
  1479.   end
  1480.   #--------------------------------------------------------------------------
  1481.   # ● 移動目標座標の計算
  1482.   #--------------------------------------------------------------------------
  1483.   def move_setup
  1484.     if RTAB
  1485.       targets = @target
  1486.     else
  1487.       targets = $scene.target_battlers
  1488.     end
  1489.     case @move_action[0]
  1490.     when "self" # 自分
  1491.       @target_x = self.base_x
  1492.       @target_y = self.base_y
  1493.     when "target_near" # 一番近くのターゲット
  1494.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1495.       if targets != []
  1496.         @target_x = targets[0].screen_x
  1497.         @target_y = targets[0].screen_y
  1498.       else
  1499.         @target_x = self.base_x
  1500.         @target_y = self.base_y
  1501.       end
  1502.     when "target_far" # 一番遠くのターゲット
  1503.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1504.       targets.reverse!
  1505.       if targets != []
  1506.         @target_x = targets[0].screen_x
  1507.         @target_y = targets[0].screen_y
  1508.       else
  1509.         @target_x = self.base_x
  1510.         @target_y = self.base_y
  1511.       end
  1512.     when "target" # ターゲット中央
  1513.       @target_x = 0
  1514.       @target_y = 0
  1515.       for t in targets
  1516.         @target_x += t.screen_x
  1517.         @target_y += t.screen_y
  1518.       end
  1519.       if targets != []
  1520.         @target_x /= targets.size
  1521.         @target_y /= targets.size
  1522.       end
  1523.     when  "party" # "トループ中央"
  1524.       @target_x = 0
  1525.       @target_y = 0
  1526.       for t in $game_troop.enemies
  1527.         @target_x += t.screen_x
  1528.         @target_y += t.screen_y
  1529.       end
  1530.       if $game_troop.enemies != []
  1531.         @target_x /= $game_troop.enemies.size
  1532.         @target_y /= $game_troop.enemies.size
  1533.       end
  1534.     when "troop" # "パーティ中央"
  1535.       @target_x = 0
  1536.       @target_y = 0
  1537.       for t in $game_party.actors
  1538.         @target_x += t.screen_x
  1539.         @target_y += t.screen_y
  1540.       end
  1541.       if $game_party.actors != []
  1542.         @target_x /= $game_party.actors.size
  1543.         @target_y /= $game_party.actors.size
  1544.       end
  1545.     when "screen" # "画面"
  1546.       @target_x = self.base_x
  1547.       @target_y = self.base_y
  1548.     end
  1549.     # 補正
  1550.     @target_x -= @move_action[1] + self.base_x
  1551.     @target_y -= @move_action[2] + self.base_y
  1552.     # 移動目標の座標をセット
  1553.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1554.     # 距離の計算(ウエイトの設定)
  1555.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1556.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1557.   end
  1558.   if RTAB
  1559.   alias original_x true_x
  1560.   alias original_y true_y
  1561.   else
  1562.   alias original_x screen_x
  1563.   alias original_y screen_y
  1564.   end
  1565.   #--------------------------------------------------------------------------
  1566.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1567.   #--------------------------------------------------------------------------
  1568.   def true_x
  1569.     return original_x + @ox
  1570.   end
  1571.   #--------------------------------------------------------------------------
  1572.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1573.   #--------------------------------------------------------------------------
  1574.   def true_y
  1575.     return original_y - @height / 2 + @oy
  1576.   end
  1577.   #--------------------------------------------------------------------------
  1578.   # ● バトル画面 X 座標の取得
  1579.   #--------------------------------------------------------------------------
  1580.   def screen_x(true_x = self.true_x)
  1581.     return true_x * @real_zoom + @real_x
  1582.   end
  1583.   #--------------------------------------------------------------------------
  1584.   # ● バトル画面 Y 座標の取得
  1585.   #--------------------------------------------------------------------------
  1586.   def screen_y(true_y = self.true_y)
  1587.     return true_y * @real_zoom + @real_y
  1588.   end
  1589.   #--------------------------------------------------------------------------
  1590.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1591.   #--------------------------------------------------------------------------
  1592.   def base_x(true_x = self.true_x)
  1593.     return (true_x - @ox) * @real_zoom + @real_x
  1594.   end
  1595.   #--------------------------------------------------------------------------
  1596.   # ● バトル画面 Y 座標の取得(移動などしていない場合)
  1597.   #--------------------------------------------------------------------------
  1598.   def base_y(true_y = self.true_y)
  1599.     return (true_y - @oy) * @real_zoom + @real_y
  1600.   end
  1601. end
  1602. #==============================================================================
  1603. # ■ Game_Party
  1604. #==============================================================================
  1605. class Game_Party
  1606.   #--------------------------------------------------------------------------
  1607.   # ● アクターを加える
  1608.   #     actor_id : アクター ID
  1609.   #--------------------------------------------------------------------------
  1610.   alias side_view_add_actor add_actor
  1611.   def add_actor(actor_id)
  1612.     # アクターを取得
  1613.     actor = $game_actors[actor_id]
  1614.     # サイドビューデータの初期化
  1615.     actor.start_battle
  1616.     # 戻す
  1617.     side_view_add_actor(actor_id)
  1618.   end
  1619. end
  1620. #==============================================================================
  1621. # ■ Scene_Battle
  1622. #==============================================================================
  1623. class Scene_Battle
  1624.   include Side_view
  1625.   #--------------------------------------------------------------------------
  1626.   # ● 公開インスタンス変数
  1627.   #--------------------------------------------------------------------------
  1628.   attr_reader   :phase            # フェーズ
  1629.   attr_reader   :phase4_step      # フェーズ4ステップ
  1630.   attr_reader   :active_battler   # 対象の配列
  1631.   attr_reader   :target_battlers  # 対象の配列
  1632.   attr_reader   :animation1_id    # 行動アニメID
  1633.   attr_reader   :animation2_id    # 対象アニメID
  1634.   #--------------------------------------------------------------------------
  1635.   # ● メイン処理
  1636.   #--------------------------------------------------------------------------
  1637.   alias side_view_main main
  1638.   def main
  1639.     # バトラー初期化
  1640.     for battler in $game_party.actors + $game_troop.enemies
  1641.       battler.start_battle
  1642.     end
  1643.     # 戻す
  1644.     side_view_main
  1645.   end
  1646.   #--------------------------------------------------------------------------
  1647.   # ● 閃き判定
  1648.   #--------------------------------------------------------------------------
  1649.   def flash?
  1650.     return @flash_flag ? true : false
  1651.   end  
  1652.   #--------------------------------------------------------------------------
  1653.   # ● 閃きアニメ待ち時間取得
  1654.   #--------------------------------------------------------------------------
  1655.   def flash_duration
  1656.     animation = nil
  1657.     if FLASH_ANIME
  1658.       animation = $data_animations[FLASH_ANIMATION_ID]
  1659.     end
  1660.     return animation != nil ? animation.frame_max * 2 + 2 : 0
  1661.   end
  1662.   #--------------------------------------------------------------------------
  1663.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  1664.   #--------------------------------------------------------------------------
  1665.   alias side_view_update_phase4_step2 update_phase4_step2
  1666.   def update_phase4_step2(*arg)
  1667.     battler = convert_battler2(*arg)
  1668.     battler.action
  1669.     side_view_update_phase4_step2(*arg)
  1670.   end
  1671.   #--------------------------------------------------------------------------
  1672.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  1673.   #--------------------------------------------------------------------------
  1674.   alias side_view_update_phase4_step3 update_phase4_step3
  1675.   def update_phase4_step3(*arg)
  1676.     battler = convert_battler2(*arg)
  1677.     return if !battler.animation1_on and battler.action? and !battler.flash?
  1678.     if battler.flash? and FLASH_ANIME
  1679.       battler.flash_flag["normal"] = true
  1680.     end
  1681.     side_view_update_phase4_step3(*arg)
  1682.   end
  1683.   #--------------------------------------------------------------------------
  1684.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  1685.   #--------------------------------------------------------------------------
  1686.   alias side_view_update_phase4_step4 update_phase4_step4
  1687.   def update_phase4_step4(*arg)
  1688.     battler = convert_battler2(*arg)
  1689.     targets = RTAB ? battler.target : @target_battlers
  1690.     return if !battler.animation2_on and battler.action?
  1691.     side_view_update_phase4_step4(*arg)
  1692.     for target in targets
  1693.       if RTAB
  1694.         value = nil
  1695.         if target.damage_sp.include?(battler)
  1696.           value = target.damage_sp[battler]
  1697.         end
  1698.         if target.damage.include?(battler)
  1699.           if value == nil or value == "Miss"
  1700.             value = target.damage[battler]
  1701.           elsif value.is_a?(Numeric) && value > 0
  1702.             value = target.damage[battler] == "Miss" ? value : target.damage[battler]
  1703.           end
  1704.         end
  1705.       else
  1706.         value = target.damage
  1707.       end
  1708.       if target.is_a?(Game_Actor)
  1709.         # ダメージの場合
  1710.         if value.is_a?(Numeric) && value > 0
  1711.           # シェイクを開始
  1712.           target.shake = true
  1713.         end
  1714.       elsif target.is_a?(Game_Enemy)
  1715.         # ダメージの場合
  1716.         if value.is_a?(Numeric) && value > 0
  1717.           # シェイクを開始
  1718.           target.shake = true
  1719.         end
  1720.       end
  1721.     end
  1722.   end
  1723.   #--------------------------------------------------------------------------
  1724.   # ● プレバトルフェーズ開始
  1725.   #--------------------------------------------------------------------------
  1726.   alias start_phase1_correct start_phase1
  1727.   def start_phase1
  1728.     # カメラの設定
  1729.     # 元々フロントビュー向けの数値になっているため
  1730.     @zoom_rate = [1.0, 1.0]
  1731.     start_phase1_correct
  1732.   end
  1733.   #--------------------------------------------------------------------------
  1734.   # ● アクターコマンドフェーズ開始
  1735.   #--------------------------------------------------------------------------
  1736.   alias start_phase3_correct start_phase3
  1737.   def start_phase3
  1738.     battler = convert_battler
  1739.     start_phase3_correct
  1740.     if RTAB
  1741.       # カメラの設定
  1742.       # 元々フロントビュー向けの数値になっているため
  1743.       @camera = "command"
  1744.       @spriteset.screen_target(0, 0, 1.0)
  1745.     end
  1746.   end
  1747. end
  1748.  
  1749. class Spriteset_Battle
  1750.   include Side_view
  1751.   #--------------------------------------------------------------------------
  1752.   # ● オブジェクト初期化
  1753.   #--------------------------------------------------------------------------
  1754.   alias side_veiw_initialize initialize
  1755.   def initialize
  1756.     side_veiw_initialize
  1757.     # アクタースプライトを解放
  1758.     for sprite in @actor_sprites
  1759.       sprite.dispose
  1760.     end
  1761.     # アクタースプライトを作成
  1762.     @actor_sprites = []
  1763.     for i in 1..Party_max
  1764.       @actor_sprites.push(Sprite_Battler.new(@viewport1))
  1765.     end
  1766.     update
  1767.   end
  1768.   #--------------------------------------------------------------------------
  1769.   # ● 画面のスクロール
  1770.   #--------------------------------------------------------------------------
  1771.   if method_defined?("screen_scroll")
  1772.   alias side_view_screen_scroll screen_scroll
  1773.   def screen_scroll
  1774.     side_view_screen_scroll
  1775.     # アクターの位置補正
  1776.     for actor in $game_party.actors
  1777.       actor.real_x = @real_x
  1778.       actor.real_y = @real_y
  1779.       actor.real_zoom = @real_zoom
  1780.     end
  1781.   end
  1782.   end
  1783. end
  1784.  
  1785. class Sprite_Battler < RPG::Sprite
  1786.   include Side_view
  1787.   #--------------------------------------------------------------------------
  1788.   # ● オブジェクト初期化
  1789.   #     viewport : ビューポート
  1790.   #     battler  : バトラー (Game_Battler)
  1791.   #--------------------------------------------------------------------------
  1792.   def initialize(viewport, battler = nil)
  1793.     super(viewport)
  1794.     @battler = battler
  1795.     @battler_visible = false
  1796.     @weapon = Sprite_Weapon.new(viewport, battler)
  1797.     @flying = Sprite_Flying.new(viewport, battler)
  1798.     @shadow = []
  1799.     @fly = 0
  1800.     @fly_direction = 1
  1801.     @rand = rand(10)
  1802.     self.effect_clear
  1803.   end
  1804.   #--------------------------------------------------------------------------
  1805.   # ● 解放
  1806.   #--------------------------------------------------------------------------
  1807.   alias side_view_dispose dispose
  1808.   def dispose
  1809.     side_view_dispose
  1810.     @weapon.dispose
  1811.     @flying.dispose
  1812.     if @_target_sprite != nil
  1813.       @_target_sprite.bitmap.dispose
  1814.       @_target_sprite.dispose
  1815.       @_target_sprite = nil
  1816.     end
  1817.   end
  1818.   #--------------------------------------------------------------------------
  1819.   # ● フレーム更新
  1820.   #--------------------------------------------------------------------------
  1821.   def update
  1822.     super
  1823.     # バトラーが nil の場合
  1824.     if @battler == nil
  1825.       self.bitmap = nil
  1826.       @weapon.bitmap = nil
  1827.       loop_animation(nil)
  1828.       return
  1829.     end
  1830.     # バトラー更新
  1831.     @battler.update
  1832.     # バトラーアニメのデータ取得
  1833.     @anime_type = @battler.anime_type
  1834.     # ファイル名か色相が現在のものと異なる場合
  1835.     if @battler.is_a?(Game_Actor)
  1836.       change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
  1837.     elsif @battler.is_a?(Game_Enemy)
  1838.       change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
  1839.     else
  1840.       return
  1841.     end
  1842.     if change
  1843.       # ビットマップを取得、設定
  1844.       if @battler.is_a?(Game_Actor)
  1845.         @battler_name = @battler.character_name
  1846.         @battler_hue = @battler.character_hue
  1847.         self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
  1848.         @width = bitmap.width / 4
  1849.         @height = bitmap.height / 4
  1850.       else
  1851.         @battler_name = @battler.battler_name
  1852.         @battler_hue = @battler.battler_hue
  1853.         self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1854.         @width = bitmap.width
  1855.         @height = bitmap.height
  1856.       end
  1857.       self.ox = @width / 2
  1858.       self.oy = @height / 2
  1859.       @battler.height = @height
  1860.       @flag = true
  1861.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  1862.       if @battler.dead? or @battler.hidden
  1863.         self.opacity = 0
  1864.       end
  1865.     end
  1866.     if @battler.is_a?(Game_Actor) and
  1867.       (@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)
  1868.       # ビットマップを取得、設定
  1869.       @pattern = @battler.pattern
  1870.       self.ox = @width / 2
  1871.       self.oy = @height / 2
  1872.       @sx = @pattern * @width
  1873.       @sy = @anime_type % 4 * @height
  1874.       self.src_rect.set(@sx, @sy, @width, @height)
  1875.       self.zoom_x = CHAR_ZOOM
  1876.       self.zoom_y = CHAR_ZOOM
  1877.       @battler.height = @height
  1878.       @flag = false
  1879.     end
  1880.     # 飛行
  1881.     update_fly
  1882.     # シェイク
  1883.     update_shake
  1884.     # 回転
  1885.     update_turning
  1886.     # 反転
  1887.     update_reverse   
  1888.     # 移動
  1889.     update_moving
  1890.     # 追加アニメ
  1891.     update_add_anime
  1892.     # エフェクト効果の適用
  1893.     update_effect
  1894.     # アニメーション ID が現在のものと異なる場合
  1895.     flag = RTAB ? true : @battler.damage == nil
  1896.     if flag and @battler.state_animation_id != @state_animation_id
  1897.       @state_animation_id = @battler.state_animation_id
  1898.       loop_animation($data_animations[@state_animation_id])
  1899.     end
  1900.     # シェイク
  1901.     if @battler.shake
  1902.       self.start_shake(5, 5, 5)
  1903.       @battler.shake = false
  1904.     end
  1905.     # 明滅
  1906.     if @battler.blink
  1907.       blink_on
  1908.     else
  1909.       blink_off
  1910.     end
  1911.     # 不可視の場合
  1912.     unless @battler_visible
  1913.       flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
  1914.                     (@battler.damage == nil or @battler.damage_pop)
  1915.       # 出現
  1916.       if not @battler.hidden and not @battler.dead? and flag
  1917.         appear
  1918.         @battler_visible = true
  1919.       end
  1920.     end
  1921.     if RTAB
  1922.     # ダメージ
  1923.     for battler in @battler.damage_pop
  1924.       if battler[0].class == Array
  1925.         if battler[0][1] >= 0
  1926.           $scene.skill_se
  1927.         else
  1928.           $scene.levelup_se
  1929.         end
  1930.         damage(@battler.damage[battler[0]], false, 2)
  1931.       else
  1932.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  1933.       end
  1934.       if @battler.damage_sp.include?(battler[0])
  1935.         damage(@battler.damage_sp[battler[0]],
  1936.                 @battler.critical[battler[0]], 1)
  1937.         @battler.damage_sp.delete(battler[0])
  1938.       end
  1939.       @battler.damage_pop.delete(battler[0])
  1940.       @battler.damage.delete(battler[0])
  1941.       @battler.critical.delete(battler[0])
  1942.     end
  1943.     end
  1944.     # 可視の場合
  1945.     if @battler_visible
  1946.       # 武器アニメ
  1947.       @weapon.battler = @battler
  1948.       @weapon.update
  1949.       # 遠距離アニメ
  1950.       @flying.battler = @battler
  1951.       @flying.update
  1952.       # 逃走
  1953.       if @battler.hidden
  1954.         $game_system.se_play($data_system.escape_se)
  1955.         escape
  1956.         @battler_visible = false
  1957.       end
  1958.       # 白フラッシュ
  1959.       if @battler.white_flash
  1960.         whiten
  1961.         @battler.white_flash = false
  1962.       end
  1963.       if RTAB
  1964.       # アニメーション
  1965.       if !@battler.animation.empty?
  1966.         for animation in @battler.animation.reverse
  1967.           if animation[2]
  1968.             animation($data_animations[animation[0]], animation[1], true)
  1969.           else
  1970.             animation($data_animations[animation[0]], animation[1])
  1971.           end
  1972.           @battler.animation.delete(animation)
  1973.         end
  1974.       end
  1975.       else
  1976.       # アニメーション
  1977.       if @battler.animation_id != 0
  1978.         animation = $data_animations[@battler.animation_id]
  1979.         animation(animation, @battler.animation_hit)
  1980.         @battler.animation_id = 0
  1981.       end
  1982.       end
  1983.       # ダメージ
  1984.       if !RTAB and @battler.damage_pop
  1985.         damage(@battler.damage, @battler.critical)
  1986.         @battler.damage = nil
  1987.         @battler.critical = false
  1988.         @battler.damage_pop = false
  1989.       end
  1990.       flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
  1991.                      @battler.damage == nil
  1992.       # コラプス
  1993.       if flag and @battler.dead?
  1994.         if @battler.is_a?(Game_Actor)
  1995.           $game_system.se_play($data_system.actor_collapse_se)
  1996.         elsif @battler.is_a?(Game_Enemy)
  1997.           $game_system.se_play($data_system.enemy_collapse_se)
  1998.         end
  1999.         collapse
  2000.         @battler_visible = false
  2001.       end
  2002.     end
  2003.     # スプライトの座標を設定
  2004.     self.x = @battler.screen_x + @effect_ox
  2005.     self.y = @battler.screen_y + @effect_oy
  2006.     self.z = @battler.screen_z
  2007.     self.zoom_x = @battler.real_zoom
  2008.     self.zoom_y = @battler.real_zoom
  2009.     # ウェイトカウントを減らす
  2010.     @battler.wait_count -= 1
  2011.     @battler.wait_count2 -= 1
  2012.     # アニメーション待ち時間取得
  2013.     @battler.animation_duration = @_animation_duration
  2014.     if @battler.is_a?(Game_Actor)
  2015.       self.zoom_x *= CHAR_ZOOM
  2016.       self.zoom_y *= CHAR_ZOOM
  2017.       @weapon.x = self.x + 2
  2018.       @weapon.y = self.y + 6
  2019.       @weapon.angle = 75 - (4 - @battler.pattern) * 45
  2020.       if self.mirror
  2021.         @weapon.angle += @weapon.angle - 180
  2022.       end
  2023.     end
  2024.     # 残像
  2025.     if @battler.shadow
  2026.       if Graphics.frame_count % 2 == 0
  2027.         shadow = ::Sprite.new(self.viewport)
  2028.         shadow.bitmap = self.bitmap.dup
  2029.         shadow.x = self.x
  2030.         shadow.y = self.y
  2031.         shadow.ox = self.ox
  2032.         shadow.oy = self.oy
  2033.         shadow.mirror = self.mirror
  2034.         shadow.angle = self.angle
  2035.         shadow.opacity = 160
  2036.         shadow.zoom_x = self.zoom_x
  2037.         shadow.zoom_y = self.zoom_y
  2038.         if @battler.is_a?(Game_Actor)
  2039.           shadow.src_rect.set(@sx, @sy, @width, @height)
  2040.         else
  2041.           shadow.src_rect.set(0, 0, @width, @height)
  2042.         end
  2043.         @shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
  2044.       end
  2045.     end
  2046.     for s in @shadow
  2047.       if !s[0].disposed?
  2048.         s[0].update
  2049.         s[1] -= 1
  2050.         if s[1] < 1
  2051.           if s[0].bitmap != nil
  2052.             s[0].bitmap.dispose
  2053.           end
  2054.           s[0].dispose
  2055.         else
  2056.           s[0].x = @battler.screen_x(s[2])
  2057.           s[0].y = @battler.screen_y(s[3])
  2058.         end
  2059.       else
  2060.         s = nil
  2061.       end
  2062.     end
  2063.     @shadow.compact!
  2064.   end
  2065.   #--------------------------------------------------------------------------
  2066.   # ● エフェクトによる座標系の更新
  2067.   #--------------------------------------------------------------------------
  2068.   def update_effect
  2069.     # 角度の修正
  2070.     if @_upside_down
  2071.       self.angle = (@_turning + 180) % 360
  2072.     else
  2073.       self.angle = @_turning
  2074.     end
  2075.     # X 座標の修正値
  2076.     @effect_ox = @_shake + @_moving[0]
  2077.     # Y 座標の修正値
  2078.     @effect_oy = -@fly + @_moving[1]
  2079.     if  @_animation == nil or (RTAB and @_animation.empty?)
  2080.       self.effect_clear
  2081.     end
  2082.   end
  2083.   #--------------------------------------------------------------------------
  2084.   # ● シェイク更新
  2085.   #--------------------------------------------------------------------------
  2086.   def update_shake
  2087.     if @_shake_duration >= 1 or @_shake != 0
  2088.       delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
  2089.       if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
  2090.         @_shake = 0
  2091.       else
  2092.         @_shake += delta
  2093.       end
  2094.       if @_shake > @_shake_power * 2
  2095.         @_shake_direction = -1
  2096.       end
  2097.       if @_shake < - @_shake_power * 2
  2098.         @_shake_direction = 1
  2099.       end
  2100.       if @_shake_duration >= 1
  2101.         @_shake_duration -= 1
  2102.       end
  2103.     end
  2104.   end
  2105.   #--------------------------------------------------------------------------
  2106.   # ● 飛行更新
  2107.   #--------------------------------------------------------------------------
  2108.   def update_fly
  2109.     if @rand > 0
  2110.       @rand -= 1
  2111.       return
  2112.     end
  2113.     if @battler.fly != 0
  2114.       if @fly < @battler.fly / 4
  2115.         @fly_direction = 1
  2116.       elsif @fly > @battler.fly / 2
  2117.         @fly_direction = -1
  2118.       end
  2119.       @fly += 0.5 * @fly_direction
  2120.     end
  2121.   end
  2122.   #--------------------------------------------------------------------------
  2123.   # ● 回転更新
  2124.   #--------------------------------------------------------------------------
  2125.   def update_turning
  2126.     if @_turning_duration > 0 or @_turning != 0
  2127.       @_turning += @_turning_direction * @_turning_speed / 2.0
  2128.       # 残り回転数を減らす
  2129.       if @_turning_direction == -1
  2130.         if @_turning_duration > 0 and @_turning < 0
  2131.           @_turning_duration -= 1
  2132.         end
  2133.       elsif @_turning_direction == 1
  2134.         if @_turning_duration > 0 and @_turning >= 360
  2135.           @_turning_duration -= 1
  2136.         end
  2137.       end
  2138.       # 以下補正
  2139.       while @_turning < 0
  2140.         @_turning += 360
  2141.       end
  2142.       if @_turning_duration <= 0
  2143.         @_turning = 0
  2144.       end
  2145.       @_turning %= 360
  2146.     end
  2147.   end
  2148.   #--------------------------------------------------------------------------
  2149.   # ● 左右反転更新
  2150.   #--------------------------------------------------------------------------
  2151.   def update_reverse
  2152.     if @last_reverse != (@_reverse or @battler.reverse)
  2153.       self.mirror = (@_reverse or @battler.reverse)
  2154.       @last_reverse = (@_reverse or @battler.reverse)
  2155.     end
  2156.   end
  2157.   #--------------------------------------------------------------------------
  2158.   # ● 移動更新
  2159.   #--------------------------------------------------------------------------
  2160.   def update_moving
  2161.     @move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2162.                      (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2163.     if @move_distance > 0
  2164.       return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
  2165.       array = @_move_coordinates
  2166.       x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2167.       y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2168.       @_moving = [x, y]
  2169.       if @_move_quick_return and @_move_duration == 0
  2170.         @_move_coordinates = [0,0,array[0],array[1]]
  2171.         @_move_duration = @move_distance
  2172.       end
  2173.       @_move_duration -= @_move_speed
  2174.       @_move_duration = [@_move_duration, 0].max
  2175.     end
  2176.   end
  2177.   #--------------------------------------------------------------------------
  2178.   # ● 追加アニメ更新 (RTAB限定機能)
  2179.   #--------------------------------------------------------------------------
  2180.   def update_add_anime
  2181.     if RTAB
  2182.     # アニメーション
  2183.     if @_add_anime_id != 0
  2184.       animation = $data_animations[@_add_anime_id]
  2185.       animation(animation, true)
  2186.       @_add_anime_id = 0
  2187.     end
  2188.     end
  2189.   end
  2190.   #--------------------------------------------------------------------------
  2191.   # ● エフェクト初期化
  2192.   #--------------------------------------------------------------------------
  2193.   def effect_clear
  2194.     @_effect_ox = 0
  2195.     @_effect_oy = 0
  2196.     @_shake_power = 0
  2197.     @_shake_speed = 0
  2198.     @_shake_duration = 0
  2199.     @_shake_direction = 1
  2200.     @_shake = 0
  2201.     @_upside_down = false
  2202.     @_reverse = false
  2203.     @_turning_direction = 1
  2204.     @_turning_speed = 0
  2205.     @_turning_duration = 0
  2206.     @_turning = 0
  2207.     @_move_quick_return = true
  2208.     @_move_speed = 0
  2209.     @_move_coordinates = [0,0,0,0]
  2210.     @_move_jump = false
  2211.     @_move_duration = 0
  2212.     @_moving = [0,0]
  2213.     @_add_anime_id = 0
  2214.   end
  2215.   #--------------------------------------------------------------------------
  2216.   # ● シェイクの開始
  2217.   #     power    : 強さ
  2218.   #     speed    : 速さ
  2219.   #     duration : 時間
  2220.   #--------------------------------------------------------------------------
  2221.   def start_shake(power, speed, duration)
  2222.     @_shake_power = power
  2223.     @_shake_speed = speed
  2224.     @_shake_duration = duration
  2225.   end
  2226.   #--------------------------------------------------------------------------
  2227.   # ● 上下反転を開始
  2228.   #--------------------------------------------------------------------------
  2229.   def start_upside_down
  2230.     @_upside_down = @_upside_down ? false : true
  2231.   end
  2232.   #--------------------------------------------------------------------------
  2233.   # ● 左右反転を開始
  2234.   #--------------------------------------------------------------------------
  2235.   def start_reverse
  2236.     @_reverse = @_reverse ? false : true
  2237.   end
  2238.   #--------------------------------------------------------------------------
  2239.   # ● 回転を開始
  2240.   #     direction: 方向
  2241.   #     speed    : 速さ
  2242.   #     duration : 時間
  2243.   #--------------------------------------------------------------------------
  2244.   def start_turning(direction, speed, duration)
  2245.     @_turning_direction = direction
  2246.     @_turning_speed = speed
  2247.     @_turning_duration = duration
  2248.     @_turning = @_turning_direction == 1 ? 0 : 360
  2249.   end
  2250.   #--------------------------------------------------------------------------
  2251.   # ● 移動を開始
  2252.   #     quick_return : 戻るかどうか
  2253.   #     speed        : 速さ
  2254.   #     x            : X 座標
  2255.   #     y            : Y 座標
  2256.   #--------------------------------------------------------------------------
  2257.   def start_moving(quick_return, speed, x, y)
  2258.     @_move_quick_return = quick_return == 0 ? false : true
  2259.     @_move_speed = speed
  2260.     @_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
  2261.     distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2262.                (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2263.     @_move_duration = distance
  2264.   end
  2265.   #--------------------------------------------------------------------------
  2266.   # ● アニメ追加を開始
  2267.   #     id           : ID
  2268.   #     hit          : 命中フラッグ
  2269.   #--------------------------------------------------------------------------
  2270.   def start_add_anime(id)
  2271.     @_add_anime_id = id
  2272.   end
  2273.   #--------------------------------------------------------------------------
  2274.   # ● 各種エフェクトの開始判定
  2275.   #--------------------------------------------------------------------------
  2276.   if !method_defined?("side_view_animation_process_timing")
  2277.     alias side_view_animation_process_timing animation_process_timing
  2278.   end
  2279.   def animation_process_timing(timing, hit)
  2280.     side_view_animation_process_timing(timing, hit)
  2281.     if (timing.condition == 0) or
  2282.        (timing.condition == 1 and hit == true) or
  2283.        (timing.condition == 2 and hit == false)
  2284.       if timing.se.name =~ SHAKE_FILE
  2285.         names = timing.se.name.split(/#/)
  2286.         power    = names[1].nil? ? SHAKE_POWER    : names[1].to_i
  2287.         speed    = names[2].nil? ? SHAKE_SPEED    : names[2].to_i
  2288.         duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
  2289.         # シェイクを開始
  2290.         self.start_shake(power, speed, duration)
  2291.       end
  2292.       if timing.se.name == UPSIDE_DOWN_FILE
  2293.         # 上下反転を開始
  2294.         self.start_upside_down
  2295.       end
  2296.       if timing.se.name == REVERSE_FILE
  2297.         # 左右反転を開始
  2298.         self.start_reverse
  2299.       end
  2300.       if timing.se.name =~ TURNING_FILE
  2301.         names = timing.se.name.split(/#/)
  2302.         direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
  2303.         speed     = names[2].nil? ? TURNING_SPEED     : names[2].to_i
  2304.         duration  = names[3].nil? ? TURNING_DURATION  : names[3].to_i
  2305.         # 回転を開始
  2306.         self.start_turning(direction, speed, duration)
  2307.       end
  2308.       if timing.se.name =~ MOVE_FILE
  2309.         names = timing.se.name.split(/#/)
  2310.         quick_return= names[1].nil? ? MOVE_RETURN      : names[1].to_i
  2311.         speed       = names[2].nil? ? MOVE_SPEED       : names[2].to_i
  2312.         x           = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
  2313.         y           = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
  2314.         # 移動を開始
  2315.         self.start_moving(quick_return, speed, x, y)
  2316.       end
  2317.       if timing.se.name =~ ADD_ANIME_FILE
  2318.         names = timing.se.name.split(/#/)
  2319.         id = names[1].nil? ? ADD_ANIME_ID      : names[1].to_i
  2320.         # アニメ追加を開始
  2321.         self.start_add_anime(id)
  2322.       end
  2323.     end
  2324.   end
  2325. end
  2326. #==============================================================================
  2327. # ■ Sprite_Weapon
  2328. #------------------------------------------------------------------------------
  2329. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2330. # スプライトの状態を自動的に変化させます。
  2331. #==============================================================================
  2332.  
  2333. class Sprite_Weapon < RPG::Sprite
  2334.   include Side_view
  2335.   #--------------------------------------------------------------------------
  2336.   # ● 公開インスタンス変数
  2337.   #--------------------------------------------------------------------------
  2338.   attr_accessor :battler                  # バトラー
  2339.   attr_reader   :cw                       # グラフィックの幅
  2340.   attr_reader   :ch                       # グラフィックの高さ
  2341.   #--------------------------------------------------------------------------
  2342.   # ● オブジェクト初期化
  2343.   #     viewport : ビューポート
  2344.   #     battler  : バトラー (Game_Battler)
  2345.   #--------------------------------------------------------------------------
  2346.   def initialize(viewport, battler = nil)
  2347.     super(viewport)
  2348.     @battler = battler
  2349.     @battler_visible = false
  2350.   end
  2351.   #--------------------------------------------------------------------------
  2352.   # ● 解放
  2353.   #--------------------------------------------------------------------------
  2354.   def dispose
  2355.     if self.bitmap != nil
  2356.       self.bitmap.dispose
  2357.     end
  2358.     super
  2359.   end
  2360.   #--------------------------------------------------------------------------
  2361.   # ● フレーム更新
  2362.   #--------------------------------------------------------------------------
  2363.   def update
  2364.     super
  2365.     # バトラーが nil の場合
  2366.     if @battler == nil or !@battler.is_a?(Game_Actor)
  2367.       self.bitmap = nil
  2368.       return
  2369.     end
  2370.     # ウエポンアニメのデータ取得
  2371.     @weapon_anime_type = @battler.weapon_anime_type(@battler.condition)
  2372.     # 設定が「非表示」の場合
  2373.     if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
  2374.       self.visible = false
  2375.       return
  2376.     else
  2377.       self.visible = true
  2378.     end
  2379.     # ファイル名が現在のものと異なる場合
  2380.     if @weapon_anime_type[0] != @weapon_name
  2381.       @weapon_name = @weapon_anime_type[0]
  2382.       # ビットマップを取得、設定
  2383.       self.bitmap = RPG::Cache.icon(@weapon_name)
  2384.       @width = bitmap.width
  2385.       @height = bitmap.height
  2386.       @flag = true
  2387.     end
  2388.     # 現在アニメパターンが現在のものと異なる場合
  2389.     if @pattern != @battler.pattern or @flag or @condition != @battler.condition
  2390.       @pattern = @battler.pattern
  2391.       @condition = @battler.condition
  2392.       self.ox = @width
  2393.       self.oy = @height
  2394.       self.z = battler.screen_z
  2395.       self.zoom_x = @battler.real_zoom * CHAR_ZOOM
  2396.       self.zoom_y = @battler.real_zoom * CHAR_ZOOM
  2397.       self.src_rect.set(0, 0, @width, @height)
  2398.       self.opacity = 255
  2399.       # バトラーより手前に表示
  2400.       if @weapon_anime_type[2]
  2401.         self.z += 10
  2402.       # バトラーより奥に表示
  2403.       else
  2404.         self.z -= 10
  2405.       end
  2406.       @flag = false
  2407.     end
  2408.   end
  2409. end
  2410.  
  2411. #==============================================================================
  2412. # ■ Sprite_Flying
  2413. #------------------------------------------------------------------------------
  2414. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2415. # スプライトの状態を自動的に変化させます。
  2416. #==============================================================================
  2417.  
  2418. class Sprite_Flying < RPG::Sprite
  2419.   include Side_view
  2420.   #--------------------------------------------------------------------------
  2421.   # ● 公開インスタンス変数
  2422.   #--------------------------------------------------------------------------
  2423.   attr_accessor :battler                  # バトラー
  2424.   #--------------------------------------------------------------------------
  2425.   # ● オブジェクト初期化
  2426.   #     viewport : ビューポート
  2427.   #     battler  : バトラー (Game_Battler)
  2428.   #--------------------------------------------------------------------------
  2429.   def initialize(viewport, battler = nil)
  2430.     super(viewport)
  2431.     @battler = battler
  2432.     @battler_visible = false
  2433.   end
  2434.   #--------------------------------------------------------------------------
  2435.   # ● 解放
  2436.   #--------------------------------------------------------------------------
  2437.   def dispose
  2438.     if self.bitmap != nil
  2439.       self.bitmap.dispose
  2440.     end
  2441.     super
  2442.   end
  2443.   #--------------------------------------------------------------------------
  2444.   # ● フレーム更新
  2445.   #--------------------------------------------------------------------------
  2446.   def update
  2447.     super
  2448.     # バトラーが nil の場合
  2449.     if @battler == nil
  2450.       self.bitmap = nil
  2451.       loop_animation(nil)
  2452.       return
  2453.     end
  2454.     # 遠距離アニメ
  2455.     flying_animation = @battler.flying_animation
  2456.     flying_start = flying_animation[0]
  2457.     flying_end   = flying_animation[1]
  2458.     # アニメーション ID が現在のものと異なる場合
  2459.     if @anime_id != @battler.flying_anime[0]
  2460.       @anime_id = @battler.flying_anime[0]
  2461.       @animation = $data_animations[@anime_id]
  2462.     end
  2463.     # アニメーション 開始
  2464.     if flying_start
  2465.       loop_animation(@animation)
  2466.     elsif flying_end
  2467.       loop_animation(nil)
  2468.     end
  2469.     self.x = @battler.flying_x
  2470.     self.y = @battler.flying_y
  2471.     self.z = @battler.screen_z + 1000
  2472.   end
  2473. end
  2474.  
  2475. module RPG
  2476.   class Skill
  2477.     #--------------------------------------------------------------------------
  2478.     # ● 魔法かどうかの判断
  2479.     #--------------------------------------------------------------------------
  2480.     def magic?
  2481.       if @atk_f == 0
  2482.         return true
  2483.       else
  2484.         return false
  2485.       end
  2486.     end
  2487.   end
  2488. end
  2489.  
  2490. # アローカーソルの位置修正
  2491.  
  2492. class Arrow_Actor < Arrow_Base
  2493.   include Side_view
  2494.   #--------------------------------------------------------------------------
  2495.   # ● フレーム更新
  2496.   #--------------------------------------------------------------------------
  2497.   alias side_view_update update
  2498.   def update
  2499.     side_view_update
  2500.     # スプライトの座標を設定
  2501.     if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
  2502.       self.x = self.actor.screen_x + ARROW_OX
  2503.       self.y = self.actor.screen_y + ARROW_OY
  2504.     end
  2505.   end
  2506. end
  2507. class Arrow_Enemy < Arrow_Base
  2508.   include Side_view
  2509.   #--------------------------------------------------------------------------
  2510.   # ● フレーム更新
  2511.   #--------------------------------------------------------------------------
  2512.   alias side_view_update update
  2513.   def update
  2514.     side_view_update
  2515.     # スプライトの座標を設定
  2516.     if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
  2517.       self.x = self.enemy.screen_x
  2518.       self.y = self.enemy.screen_y + self.enemy.height/2
  2519.     end
  2520.   end
  2521. end
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-9-22 14:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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