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

Project1

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

[已经解决] 请问行走图做战斗图的菜鸟横版的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
117
在线时间
432 小时
注册时间
2010-7-14
帖子
111
跳转到指定楼层
1
发表于 2012-1-19 17:58:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 frostkankan 于 2012-1-19 18:03 编辑

求助:使用的菜鸟横版行走图做战斗图的脚本,在使用物理攻击技能时,主角跑到敌人身前后,总是先转身向后,然后再转过来攻击敌人,不知道这个是什么情况,能否让他不转身,谢谢!下面是我用的横版脚本
=begin
###############################################################################

全局行走图战斗 v1.1
本版本只经低测试,可能存在某些bug。
请注意更新
http://rpg.blue/viewthread.php?tid=129875&extra=page%3D1

###############################################################################
------------------------------------------------------------------------------
经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)

这个脚本的更动分为2部分:
1)战斗动作 - 新加了数个动作,如:“弓箭攻击”、“远距离发动”等等
2)战斗动画 - 基本上是脚本原带的。只是这个功能被隐藏起来了。现在已恢复。

用法:
在相应的脚本行加入武器/技能/道具的数据库id(id之间要用“,”来分开)
如果不要某些功能的话就随便填一个外太空id就行了(没有用到的id)
1)战斗动作(角色/行走图的动作)
脚本355行:  远程武器的id  (普通攻击时使用远程射击)
脚本357行:  回旋武器的id  (普通攻击时会飞回手上的武器,如:回力镖)
脚本370行:  远程技能的id  (使用技能时是远程射击)
脚本372行:  回旋技能的id  (使用技能时,飞出的武器会飞回手上)

2)战斗动画(显示‘对象方的动画’之前先显示‘飞行武器射去敌人身上’的动画)
脚本453行:  回旋武器的id  (攻击时会显示一段类似回力镖的动画)
脚本455行:  弓箭武器的id  (攻击时会显示箭射去敌人身上的动画)
脚本457行:  铳类武器的id  (攻击时会显示子弹射去敌人身上的动画)
脚本470行:  回旋技能的id  (技能使用时会显示一段类似回力镖的动画)
脚本472行:  弓箭技能的id  (技能使用时会显示箭射去敌人身上的动画)
脚本474行:  铳类技能的id  (技能使用时会显示子弹射去敌人身上的动画)
脚本486行:  抛击道具的id  (使用该道具时,道具被丢到敌人身上)

〉注意:
〉‘飞行武器射去敌人身上’的动画是在设定id之后的那句脚本里面设置
〉例子:(脚本第455和456行)
〉       when 17,18,19,20    #远程武器1(弓箭类)的id
〉       return [101,32,false,false]
〉这样,武器17~20(都是弓箭)在显示‘对象方的动画’之前会先显示第101号动画
〉而动画的轨道是从使用者身上直到敌人身上(实现子弹射出的效果)
  
还有:
战斗队伍的画面位置已经被修改过,
让角色的位置与默认的战斗背景图不会有视觉上的冲突。
如果要更改请去脚本第113-116行改改就行了。

脚本‘Arrow_Enemy’和‘Arrow_Actor’被稍微修改过(可以无视)

这个范例附带了
一张经过修改的战斗背景图(027-castle03),其他的战斗背景图可以使用默认的。
一套横版的默认敌人的战斗图(从行走图改过来的)

=end                                                        #modify by darkten

###############################################################################

=begin

此版本更新了以下几点:
1.支持敌人行走图战斗
2.修正与RTAB并用的bug。
3.支持敌人也玩小石头

使用方法:
1.敌人的战斗图名称要与敌人的行走图名称相一致,具体查看本范例编号为2的敌人。
2.请自行设置 160 ~ 173 行的内容。

                                                                  by ONEWateR
=end
###############################################################################
  
module Side_view
  #--------------------------------------------------------------------------
  # ● 是否与RATB并用 ☆自动识别(这到是不错~省了~)
  #    在Scene_Battle计算方法是否是方法synthe?
  #    在自动不想认识的时候,请重写。
  #--------------------------------------------------------------------------
  if Scene_Battle.method_defined?("synthe?")
    RTAB = true
  else
    RTAB = false
  end
  #--------------------------------------------------------------------------
  # ● 改正RATB中的位置误差 ☆自动识别
  #    在自动不想认识的时候,请重写。
  #--------------------------------------------------------------------------
  def camera_correctness
    return false if !RTAB
    begin
      return $scene.drive
    rescue
      return false
    end
  end
  #--------------------------------------------------------------------------
  # ● 队伍中的最大人数
  #--------------------------------------------------------------------------
  Party_max = 4
  #--------------------------------------------------------------------------
  # ● 战斗图的扩大率(1.0的时候是保持原有大小)
  #--------------------------------------------------------------------------
  CHAR_ZOOM = 1.0
  #--------------------------------------------------------------------------
  # ● 光标的位置修正(基本不需要改~)
  #--------------------------------------------------------------------------
  ARROW_OX = 0
  ARROW_OY = 64
  #--------------------------------------------------------------------------
  # ● 名状态作为飞行管理的排列(不知道什么意思....)
  #--------------------------------------------------------------------------
  FLY_STATES = ["飛行"]
  #--------------------------------------------------------------------------
  # ● 战斗画面的位置
  #--------------------------------------------------------------------------
  PARTY_X = 470    # 队伍 X 位置
  PARTY_Y = 240     # 队伍 Y 位置
  FORMATION_X = 30  # 各个角色之间的间隔 X
  FORMATION_Y = 30 # 各个角色之间的间隔 Y
  #--------------------------------------------------------------------------
  # ● 自定义常数
  #--------------------------------------------------------------------------
  NORMAL   = "NORMAL"
  WALK_R   = "WALK_R"
  WALK_L   = "WALK_L"
  ATTACK   = "ATTACK"
  ATTACK_R = "ATTACK_R"
  ATTACK_L = "ATTACK_L"
  MAGIC    = "MAGIC"
  ITEM     = "ITEM"
  # 动画的设定
  ANIME = {
    # [画像ID,是否循环,アニメスピード,动画速度,不能指向动画,武器放在右手or左手]
    NORMAL            => [1,true , 0,false, true ,""    ], # 通常待击
    WALK_R            => [2,true , 2,false, false,""    ], # 右移动
    WALK_L            => [1,true , 2,false, false,""    ], # 左移动
    ATTACK_R          => [1,false, 2,true , false,"右手"], # 右手攻击
    ATTACK_L          => [1,false, 2,true , false,"左手"], # 左手攻击
    MAGIC             => [1,false, 2,false, false,""    ], # 右手攻击
    ITEM              => [1,false, 2,false, false,""    ], # 左手攻击
    }
   
  # 债务不履行声明价值的设定(一个字一个字翻译的,不知道啥意思)  
  ANIME.default = [1,false,12,false,"",""]
  
  # 在行动设定的时候 右手攻击 or 左手攻击 辨别を(这个不知道什么意思)的ANIME
  # "角色动画变更#ATTACK"在玩了と(还是不知道啥意思..)的时候,辨别ATTACK_R或者ATTACK_L
  DUAL_WEAPONS_ANIME = [ATTACK]
  
  
  #--------------------------------------------------------------------------
  # ● 战斗图不是行走图的敌人编号
  #--------------------------------------------------------------------------
  NOT_CHARACTER_EMEMY = [900]
  #--------------------------------------------------------------------------
  # ● 敌人使用的武器
  #    敌人编号=>武器编号
  #--------------------------------------------------------------------------
  EMEMY_WEAPO = {2=>1,7=>17}
  #--------------------------------------------------------------------------
  # ● 敌人使用的武器 (二刀流)
  #    敌人编号=>武器编号
  #--------------------------------------------------------------------------
  EMEMY_WEAPO2 = {}
  
  
  #--------------------------------------------------------------------------
  # ● 摇晃的设定
  #--------------------------------------------------------------------------
  SHAKE_FILE = "摇晃"  # 文件名
  SHAKE_POWER = 5          # 强度
  SHAKE_SPEED = 5          # 速度
  SHAKE_DURATION = 5      # 时间
  #--------------------------------------------------------------------------
  # ● 上下反转地的设定
  #--------------------------------------------------------------------------
  UPSIDE_DOWN_FILE = "上下反转" # 文件名
  #--------------------------------------------------------------------------
  # ● 左右反转地的设定
  #--------------------------------------------------------------------------
  REVERSE_FILE = "左右反转" # 文件名
  #--------------------------------------------------------------------------
  # ● 回转地的设定
  #--------------------------------------------------------------------------
  TURNING_FILE = "回转" # 文件名
  TURNING_DIRECTION = 1 # 方向(1.逆时针,-1.顺时针)(|||-_-汗..怎么还有用-1做带入值的...)
  TURNING_SPEED = 40    # 速度
  TURNING_DURATION = 1  # 回转数
  #--------------------------------------------------------------------------
  # ● 移动的设定
  #--------------------------------------------------------------------------
  MOVE_FILE = "移动"             # 文件名
  MOVE_RETURN = 1                # 回到原来的位置吗?(光写了个1,也不知道不回到该怎么写?0?)
  MOVE_SPEED = 32                # 速度
  MOVE_COORDINATES = [0,-640]    # 原来位置的相对坐标
  #--------------------------------------------------------------------------
  # ● 动画追加的设定
  #--------------------------------------------------------------------------
  ADD_ANIME_FILE = "动画追加"  # 文件名
  ADD_ANIME_ID = 0               # 动画的ID
  #--------------------------------------------------------------------------
  # ● 债务不履行声明和RTAB的数据转换
  #--------------------------------------------------------------------------
  def convert_battler
    return RTAB ? @active_actor : @active_battler
  end
  #--------------------------------------------------------------------------
  # ● 债务不履行声明和RTAB的数据转换2
  #--------------------------------------------------------------------------
  def convert_battler2(*arg)
    return RTAB ? arg[0] : @active_battler
  end
end

#--------------------------------------------------------------------------
# ● 行动設定
#--------------------------------------------------------------------------
module BattleActions
  
  # 下のものはあくまでも一例なので
  # 独自に作ってください。

  Actions = {

  "通常攻撃" => [
  
  "閃きアニメ",
  "アクターアニメ変更#WALK_L",
  "移動#target,32,0,64,0",
  "行動アニメ",
  "アクターアニメ変更#ATTACK",
  "遠距離アニメ",
  "対象アニメ",
  "アクターアニメ変更#WALK_L",
  "SEの演奏#016-Jump02,80,100",
  "移動#self,0,0,48,32",
  "終了"
  ],

  "エネミー攻撃" => [
  
  "閃きアニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,-36,0,12,0",
  "行動アニメ",
  "アクターアニメ変更#ATTACK",
  "遠距離アニメ",
  "対象アニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,0,0,12,0",
  "終了"
  ],
  
  "術発動" => [
  
  "閃きアニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,-32,0,4,0",
  "アクターアニメ変更#MAGIC",
  "行動アニメ",
  "ウエイト#15",
  "遠距離アニメ",
  "対象アニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,0,0,4,2",
  "終了"
  ],

  "アイテム使用" => [
  
  "閃きアニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,-32,0,4,0",
  "行動アニメ",
  "アクターアニメ変更#ITEM",
  "ウエイト#15",
  "遠距離アニメ",
  "対象アニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,0,0,4,2",
  "終了"
  ],
  
  "払い抜け" => [
  
  "閃きアニメ",
  "アクターアニメ変更#WALK_L",
  "移動#target_near,50,0,48,30",  
  "左右反転",
  "アクターアニメ固定#ATTACK#3",
  "行動アニメ",
  "SEの演奏#135-Light01,100,100",
  "アニメーションの表示#self,42",
  "ウエイト#15",
  "左右反転",
  "残像表示",
  "移動#target_far,-50,0,48,0",
  "対象アニメ",
  "残像消去",
  "アニメ固定解除",
  "アクターアニメ変更#WALK_L",
  "移動#self,0,0,48,1,0",
  "終了"
  ],

  "弓箭攻撃" => [
  
  "閃きアニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,-32,0,4,0",
  "行動アニメ",
  "アクターアニメ変更#ATTACK",
  "遠距離アニメ",
  "対象アニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,0,0,4,2",
  "終了"
  ],

  "回旋攻撃" => [
  
  "閃きアニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,-32,0,4,0",
  "行動アニメ",
  "アクターアニメ変更#STAND_L",  
  "遠距離アニメ",
  "対象アニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,0,0,4,2",
  "終了"
  ],
  
  "远距离発動" => [
  
  "閃きアニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,-32,0,4,0",
  "アクターアニメ変更#MAGIC",
  "行動アニメ",
  "アクターアニメ変更#ATTACK",
  "遠距離アニメ",
  "対象アニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,0,0,4,2",
  "終了"
  ],
  
  "回旋発動" => [
  
  "閃きアニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,-32,0,4,0",
  "アクターアニメ変更#MAGIC",
  "行動アニメ",
  "アクターアニメ変更#STAND_L",  
  "遠距離アニメ",
  "対象アニメ",
  "アクターアニメ変更#WALK_L",
  "移動#self,0,0,4,2",
  "終了"
  ],

  } # ここで終わり 消さないでください

end
  
module RPG
  class Weapon
    #--------------------------------------------------------------------------
    # ● アクション設定
    #--------------------------------------------------------------------------
    def battle_actions
      case @id
      when 500  # 远程武器的id回旋攻撃
        return BattleActions::Actions["弓箭攻撃"]
      when 501                       # 回旋武器的id
        return BattleActions::Actions["回旋攻撃"]
      end
      else
      return BattleActions::Actions["通常攻撃"]
    end
  end
  class Skill
    #--------------------------------------------------------------------------
    # ● アクション設定
    #--------------------------------------------------------------------------
    def battle_actions
      case @id
      when 400  # 远程技能的id
        return BattleActions::Actions["远距离発動"]
      when 401                      # 回旋技能的id
        return BattleActions::Actions["回旋発動"]
      end
      else
      if self.magic?
        return BattleActions::Actions["術発動"]
      else
        return BattleActions::Actions["払い抜け"]
      end
    end
  end
  class Item
    #--------------------------------------------------------------------------
    # ● アクション設定
    #--------------------------------------------------------------------------
    def battle_actions
      return BattleActions::Actions["アイテム使用"]
    end
  end
end
#class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # ● アクション設定
  #--------------------------------------------------------------------------
#~  def battle_actions
#~    return BattleActions::Actions["エネミー攻撃"]
#~  end
#end
=begin
#--------------------------------------------------------------------------
# ● 遠距離アニメーション
#--------------------------------------------------------------------------
 ☆ 説明
  
   行動者から対象者にアニメを飛ばします。
   飛ばすアニメを データベース‐アニメーション で作ります。
    [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。


  ● カスタマイズ方法
   
    case @id
    when 17,18,19,20
      return [101,32,false,false]
    when 21,22,23,24
      return [102,32,false,false]
    end
    return 0
   
    のように描くとID別に指定可能です。
   
   
  ● アニメーションID
  
  飛ばすアニメーションIDです。短い場合は繰り返しで表示されます。
  
   
  ● スピード
  
  大きいほうが早い(0だとアニメは移動しません)
  
  1 = 1フレームで1ドット進むと考えてください。
  
  ● 往復するか?
  
  true とした場合、ブーメランのようにアニメが戻ります。
  
  ● 直線(false)or曲線(true)
  
  true  = 対象に向かって曲線で、アニメが飛びます。(修正の余地ありですが・・・)
  false = 対象に向かって直線で、アニメが飛びます。
   
=end
module RPG
  class Weapon
    #--------------------------------------------------------------------------
    # ● 遠距離アニメーション
    #--------------------------------------------------------------------------
    def flying_anime
      # ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
      case @id
      when 34             #回旋武器(类似回力镖)的id
        return [103,32,true,true]
      when 17,18,19,20    #远程武器1(弓箭类)的id
        return [101,32,false,false]
      when 21,22,23,24    #远程武器2(铳类)的id
        return [102,32,false,false]
      end
      return [0,0,false,false]
    end
  end
  class Skill
    #--------------------------------------------------------------------------
    # ● 遠距離アニメーション
    #--------------------------------------------------------------------------
    def flying_anime
      # ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
      case @id
      when 82             #回旋技能(类似回力镖)的id
        return [103,32,true,true]
      when 73,74,75,76    #远程技能1(弓箭类)的id
        return [101,32,false,false]
      when 77,78,79,80    #远程技能2(铳类)的id
        return [102,32,false,false]
      end
      return [0,0,false,false]
    end
  end
  class Item
    #--------------------------------------------------------------------------
    # ● 遠距離アニメーション
    #--------------------------------------------------------------------------
    def flying_anime
      case @id
      when 34    #抛击类道具(如炸弹一类)的id
        return [104,32,false,true]
      end
      return [0,0,false,false]
    end
  end
end

#class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # ● 遠距離アニメーション
  #--------------------------------------------------------------------------
#~  def flying_anime
#~    return [0,0,false,false]
#~  end
#end



#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
  include Side_view
  #--------------------------------------------------------------------------
  # ● 追加・公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :height                  # 画像の高さ
  attr_accessor :real_x                  # X座標補正
  attr_accessor :real_y                  # Y座標補正
  attr_accessor :real_zoom               # 拡大率
  attr_accessor :wait_count              # アニメーション 待ち時間
  attr_accessor :wait_count2             # アニメーション 待ち時間2
  attr_accessor :pattern                 # アニメーション カウント(キャラ)
  attr_accessor :shake                   # シェイク開始フラッグ
  attr_accessor :reverse                 # 左右反転フラッグ
  attr_accessor :shadow                  # 残像フラッグ
  attr_accessor :flash_flag              # 閃きフラッグ
  attr_reader   :ox                      # X座標補正
  attr_reader   :oy                      # Y座標補正
  attr_reader   :flying_x                # 遠距離アニメX座標
  attr_reader   :flying_y                # 遠距離アニメY座標
  attr_reader   :flying_anime            # 遠距離アニメ
  attr_reader   :animation1_on           # 行動アニメ開始フラッグ
  attr_reader   :animation2_on           # 対象アニメ開始フラッグ
  #--------------------------------------------------------------------------
  # ● デフォルトのアニメーション待ち時間を取得
  #--------------------------------------------------------------------------
  def animation_duration=(animation_duration)
    @_animation_duration = animation_duration
  end
  #--------------------------------------------------------------------------
  # ● バトル開始時のセットアップ
  #--------------------------------------------------------------------------
  def start_battle
    @height = 0
    @real_x = 0
    @real_y = 0
    @real_zoom = 1.0
    @battler_condition = ""
    @action = nil
    @battle_actions = []
    @battler_action = false
    @step = 0
    @anime_on = false
    @wait_count = 0
    @wait_count2 = 0
    @ox = 0
    @oy = 0
    @pattern = 0
    @pattern_log = true
    @pattern_freeze = false
    @condition_freeze = false
    @active = false
    @move_distance = nil
    @move_wait = 0
    @move_coordinates = [0,0,0,0]
    @flying_distance = nil
    @flying_wait = 0
    @flying_x = 0
    @flying_y = 0
    @flash_flag = {}
    self.flying_clear
  end
  #--------------------------------------------------------------------------
  # ● 移動中判定
  #--------------------------------------------------------------------------
  def moving?
    # X座標補正または、Y座標補正が0でなければ、移動中
    return (@ox != 0 or @oy != 0)
  end
  #--------------------------------------------------------------------------
  # ● 移動終了判定
  #--------------------------------------------------------------------------
  def move_end?
    return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
  end
  #--------------------------------------------------------------------------
  # ● アクション開始設定
  #--------------------------------------------------------------------------
  def action(flag = true)
    @battler_action = flag
    @animation1_on = false
    @animation2_on = false
    @step = "setup"
  end   
  #--------------------------------------------------------------------------
  # ● アクション中判定
  #--------------------------------------------------------------------------
  def action?
    return @battler_action
  end
  #--------------------------------------------------------------------------
  # ● 閃き判定
  #--------------------------------------------------------------------------
  def flash?
    return @flash_flg
  end
  #--------------------------------------------------------------------------
  # ● 戦闘不能判定
  #--------------------------------------------------------------------------
  def anime_dead?
    if $game_temp.in_battle and !RTAB
      if [2,3,4,5].include?($scene.phase4_step)
        return @last_dead
      end
    end
    return @last_dead = self.dead?
  end
  #--------------------------------------------------------------------------
  # ● ピンチ状態判定
  #--------------------------------------------------------------------------
  def crisis?
    if $game_temp.in_battle and !RTAB
      if [2,3,4,5].include?($scene.phase4_step)
        return @last_crisis
      end
    end
    return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
  end
  #--------------------------------------------------------------------------
  # ● バッドステート判定
  #--------------------------------------------------------------------------
  def badstate?
    for i in @states
      unless $data_states.nonresistance
        return true
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ● 飛行
  #--------------------------------------------------------------------------
  def fly
    if @fly != nil
      return @fly
    end
    for id in @states
      if FLY_STATES.include?($data_states[id].name)
        return 60
      end
    end
    return 0
  end
  #--------------------------------------------------------------------------
  # ● 遠距離アニメ目標座標の計算
  #--------------------------------------------------------------------------
  def flying_setup
    # 二度目は実行しない
    return if @flying_distance != nil && !camera_correctness
    if RTAB
      targets = @target
    else
      targets = $scene.target_battlers
    end
    # 目的座標を計算
    @f_target_x = 0
    @f_target_y = 0
    for t in targets
      @f_target_x += t.screen_x
      @f_target_y += t.screen_y
    end
    if targets != []
      @f_target_x /= targets.size
      @f_target_y /= targets.size
    else
      @flying_distance = 0
      return
    end
    # 距離の計算
    @flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
  end
  #--------------------------------------------------------------------------
  # ● 遠距離アニメ
  #--------------------------------------------------------------------------
  def flying_animation
    # 戻る
    if @step != "flying" or @flying_distance.nil?
      return [false,true]
    end
    # あらかじめ計算
    self_x = self.screen_x
    self_y = self.screen_y
    @flying_distance = @flying_distance == 0 ? 1 : @flying_distance
    n1 = @flying_wait / @flying_distance.to_f
    if @flying_distance - @flying_wait > @flying_distance / 2
      n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
    else
      n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
    end
    if !@flying_anime[4]
      # 直線移動
      x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
      y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
    else
      # 曲線移動
      if !@flying_proceed_end
        x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
        y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
      else
        x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
        y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
      end
    end
    # 座標代入
    @flying_x = x
    @flying_y = y
    # ウエイト
    if !@flying_proceed_end
      # 開始
      @flying_proceed_start = @flying_wait == 0
      @flying_wait += @flying_anime[1]
      @flying_wait = [@flying_wait,@flying_distance].min
      @flying_proceed_end = @flying_wait == @flying_distance
    else
      # 開始
      @flying_return_start = @flying_wait == @flying_distance
      @flying_wait -= @flying_anime[1]
      @flying_wait = [@flying_wait,0].max
      @flying_return_end = @flying_wait == 0
    end
    if @flying_anime[1] == 0
      @flying_end = true
    elsif !@flying_anime[2]
      @flying_end = @flying_proceed_end
    else
      @flying_end = @flying_return_end
    end
    # 値を返す(アニメ開始,アニメ終了)
    return [@flying_proceed_start,@flying_end]
  end
  #--------------------------------------------------------------------------
  # ● 遠距離アニメ初期化
  #--------------------------------------------------------------------------
  def flying_clear
    @flying_proceed_start = false
    @flying_proceed_end = false
    @flying_return_start = false
    @flying_return_end = false
    @flying_end = false
    @flying_anime = [0,0,false]
  end
  #--------------------------------------------------------------------------
  # ● 移動
  #--------------------------------------------------------------------------
  def move
    # 距離の計算
    @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
                     (@move_coordinates[3] - @move_coordinates[1]).abs
    if @move_distance > 0
      return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
      array = @move_coordinates
      # ジャンプ補正値の計算
      if @move_distance - @move_wait > @move_distance / 2
        jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
      else
        jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
      end
      jump = @move_action[4] > 0 ? -jump : jump
      @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
      
      @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
      # ウエイト
      @move_wait -= @move_action[3]
      @move_wait = [@move_wait,0].max
    end
  end
  #--------------------------------------------------------------------------
  # ● 移動アクションの取得
  #--------------------------------------------------------------------------
  def get_move_action
    string = @action.split(/#/)[1]
    string = string.split(/,/)
    @move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
  end
  #--------------------------------------------------------------------------
  # ● アクションの取得
  #--------------------------------------------------------------------------
  def get_step
    if @action.nil?
      @step = "finish"
      return
    end
    string = @action.split(/#/)[0]
    if string =~ "移動"
      @step = "moving_setup"
    elsif string =~ "アクターアニメ実行"
      @step = "action"
    elsif string =~ "遠距離アニメ"
      @step = "flying"
    elsif string =~ "アクターアニメ変更"
      @step = "change"
    elsif string =~ "行動アニメ"
      @step = "animation1"
    elsif string =~ "対象アニメ"
      @step = "animation2"
    elsif string =~ "ウエイト"
      @step = "wait"
    elsif string =~ "左右反転"
      @step = "reverse"
    elsif string =~ "閃きアニメ"
      @step = "flash"
    elsif string =~ "残像表示"
      @step = "shadow_on"
    elsif string =~ "残像消去"
      @step = "shadow_off"
    elsif string =~ "アクターアニメ固定"
      @step = "freeze"
    elsif string =~ "アニメ固定解除"
      @step = "freeze_lifting"
    elsif string =~ "アニメーションの表示"
      @step = "animation_start"
    elsif string =~ "SEの演奏"
      @step = "play_se"
    else
      @step = "finish"
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (次のアクションへ)
  #--------------------------------------------------------------------------
  def update_next
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (動作取得)
  #--------------------------------------------------------------------------
  def update_setup
    # アクションの取得
    self.get_actions
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (移動取得)
  #--------------------------------------------------------------------------
  def update_moving_setup
    # 移動アクションの取得
    self.get_move_action
    # 移動目標の設定
    self.move_setup
    @step = "moving"
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (移動)
  #--------------------------------------------------------------------------
  def update_moving
    # 移動
    self.move
    self.condition = @battler_condition
    # 移動完了したら次のステップへ
    if move_end?
      @wait_count = 2
      @action = @battle_actions.shift
      @step = get_step
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (アニメ実行)
  #--------------------------------------------------------------------------
  def update_action
    con = @action.split(/#/)[1]
    # 右手・左手を分ける
    if DUAL_WEAPONS_ANIME.include?(con)
      if !@first_weapon and @second_weapon
        con = con + "_L"
      else
        con = con + "_R"
      end
    end
    # アニメ変更
    self.condition = con
    # ループか否か
    if !ANIME[@battler_condition][1]
      self.anime_on
    end
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (遠距離アニメ)
  #--------------------------------------------------------------------------
  def update_flying
    # 目標の設定
    self.flying_setup
    # 遠距離アニメ終了
    if @flying_end
      self.flying_clear
      @action = @battle_actions.shift
      @step = get_step
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (アニメ変更)
  #--------------------------------------------------------------------------
  def update_change
    con = @action.split(/#/)[1]
    # 右手・左手を分ける
    if DUAL_WEAPONS_ANIME.include?(con)
      if !@first_weapon and @second_weapon
        con = con + "_L"
      else
        con = con + "_R"
      end
    end
    # アニメ変更
    self.condition = con
    # ループか否か
    if !ANIME[@battler_condition][1]
      self.anime_on
    end
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (行動アニメ)
  #--------------------------------------------------------------------------
  def update_animation1
    @animation1_on = true
    # 行動アニメの後に行動を開始する
    if $scene.phase4_step == 3
      id = RTAB ? @anime1 : $scene.animation1_id
      animation = $data_animations[id]
      frame_max = animation != nil ? animation.frame_max : 0
      @wait_count2 = frame_max * 2
      return
    end
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (対象アニメ)
  #--------------------------------------------------------------------------
  def update_animation2
    @animation2_on = true
    # 行動アニメの後に行動を開始する
    if $scene.phase4_step == 4
      id = RTAB ? @anime2 : $scene.animation2_id
      animation = $data_animations[id]
      frame_max = animation != nil ? animation.frame_max : 0
      @wait_count2 = frame_max * 2
      return
    end
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (ウエイト)
  #--------------------------------------------------------------------------
  def update_wait
    @wait_count2 = @action.split(/#/)[1].to_i
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (残像表示)
  #--------------------------------------------------------------------------
  def update_shadow_on
    @shadow = true
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (残像消去)
  #--------------------------------------------------------------------------
  def update_shadow_off
    @shadow = false
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (左右反転)
  #--------------------------------------------------------------------------
  def update_reverse
    @reverse = @reverse ? false : true
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (閃きアニメ)
  #--------------------------------------------------------------------------
  def update_flash
    # 閃きアニメの後に行動を開始する
    if @flash_flag["normal"]
      @wait_count = $scene.flash_duration
      @flash_flag["normal"] = false
      return
    end
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (SEの演奏)
  #--------------------------------------------------------------------------
  def update_play_se
    data = @action.split(/#/)[1]
    data = data.split(/,/)
    # SE を演奏
    Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (アクターアニメ固定)
  #--------------------------------------------------------------------------
  def update_freeze
    con = @action.split(/#/)[1]
    # 右手・左手を分ける
    if DUAL_WEAPONS_ANIME.include?(con)
      if !@first_weapon and @second_weapon
        con = con + "_L"
      else
        con = con + "_R"
      end
    end
    # アニメ変更
    self.condition = con
    @pattern = @action.split(/#/)[2].to_i
    @pattern_freeze = true
    @condition_freeze = true
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (アクターアニメ固定解除)
  #--------------------------------------------------------------------------
  def update_freeze_lifting
    @pattern_freeze = false
    @condition_freeze = false
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (アニメーションの表示)
  #--------------------------------------------------------------------------
  def update_animation_start
    data = @action.split(/#/)[1]
    data = data.split(/,/)
    target = data[0]
    animation_id = data[1].to_i
    if RTAB
      case target
      when "self"
        @animation.push([animation_id,true])
      when "target"
        for tar in @target
          tar.animation.push([animation_id, true])
        end
      end
    else
      case target
      when "self"
        @animation_id = animation_id
        @animation_hit = true
      when "target"
        for tar in $scene.target_battlers
          tar.animation_id = animation_id
          tar.animation_hit = true
        end
      end
    end
    @action = @battle_actions.shift
    @step = get_step
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (動作終了)
  #--------------------------------------------------------------------------
  def update_finish
    # 動作終了
    @battler_action = false
    @step = "setup"
  end
  #--------------------------------------------------------------------------
  # ● バトラーの状態 変更(バトラーグラフィックのタイプ)
  #--------------------------------------------------------------------------
  def condition=(condition)
    return if @condition_freeze
    @battler_condition = condition
    @wait_count = ANIME[condition][2]
  end
  #--------------------------------------------------------------------------
  # ● バトラーの状態(バトラーグラフィックのタイプ)
  #--------------------------------------------------------------------------
  def condition
    return @battler_condition
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    # ウェイト中の場合
    if @wait_count > 0
      return
    end
    # パターン更新
    self.char_animation
    # ウェイト中の場合
    if @wait_count2 > 0
      return
    end
   
    # 行動アニメーション
    if @battler_action
      method("update_" + @step).call
      return
    end
   
    # データ初期化
    @animation1_on = false
    @animation2_on = false
    @action = nil
    @battle_actions = []
    @move_wait = 0
    @move_distance = nil
    @flying_wait = 0
    @flying_distance = nil
    @flash = false

    # RTAB対応
    # 通常・待機
    return self.condition = NORMAL
  end
  #--------------------------------------------------------------------------
  # ● アクションの取得
  #--------------------------------------------------------------------------
  def get_actions
    skill = $data_skills[self.current_action.skill_id]
    item = $data_items[self.current_action.item_id]
    kind = self.current_action.kind
    # 動作取得
    @battle_actions = []
    # スキル
    if skill != nil && kind == 1
      @battle_actions = skill.battle_actions.dup
      @flying_anime = skill.flying_anime
    # アイテム
    elsif item != nil && kind == 2
      @battle_actions = item.battle_actions.dup
      @flying_anime = item.flying_anime
    # 左手攻撃
    elsif !@first_weapon and @second_weapon and (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce))

      @battle_actions = self.battle_actions2.dup
      @flying_anime = self.flying_anime2
    # 右手攻撃
    elsif self.current_action.basic == 0 and
      (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce)) and self.current_action.kind == 0
      @battle_actions = self.battle_actions1.dup
      @flying_anime = self.flying_anime1
    # 通常攻撃
    elsif self.current_action.basic == 0 and self.current_action.kind == 0
      # 这里啊~~ =。=b
      if !self.is_a?(Game_Actor) and !self.nce
        @battle_actions = self.battle_actions1.dup
      else
        @battle_actions = BattleActions::Actions["エネミー攻撃"].dup
      end
      @flying_anime = self.flying_anime
    else
      @battle_actions = ["終了"]
      @flying_anime = [0,0,false,false]
    end
  end
  #--------------------------------------------------------------------------
  # ● ループしないアニメのセット
  #--------------------------------------------------------------------------
  def anime_on
    @pattern = 0
    @pattern_log = true
    return
  end
  #--------------------------------------------------------------------------
  # ● パターン更新
  #--------------------------------------------------------------------------
  def char_animation
    # パタン固定の場合もどる
    return if @pattern_freeze
    # ループしないアニメの場合 1234 で止まる
    if !ANIME[@battler_condition][1] && @pattern == 3
      return
    end
    # アニメさせない場合 1 で止まる
    if ANIME[@battler_condition][4]
      @pattern = 0
      return
    end
    @pattern = (@pattern + 1) % 4
  end
  #--------------------------------------------------------------------------
  # ● アニメタイプ
  #--------------------------------------------------------------------------
  def anime_type
    return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  end
end
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
  include Side_view
  #--------------------------------------------------------------------------
  # ● セットアップ
  #--------------------------------------------------------------------------
  alias side_view_setup setup
  def setup(actor_id)
    side_view_setup(actor_id)
    start_battle
  end
  #--------------------------------------------------------------------------
  # ● 二刀武器のID取得 ※エラー回避用
  #--------------------------------------------------------------------------
  def weapon2_id
    return @weapon2_id != nil ? @weapon2_id : 0
  end
  #--------------------------------------------------------------------------
  # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  #--------------------------------------------------------------------------
  def position
    return $data_classes[@class_id].position
  end
  #--------------------------------------------------------------------------
  # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  #--------------------------------------------------------------------------
  def position2
    return self.index
  end
  #--------------------------------------------------------------------------
  # ● 武器アニメタイプ
  #--------------------------------------------------------------------------
  def weapon_anime_type(type)
    file_name  = weapon_anime_type0(type)
    visible   = weapon_anime_type1(type)
    z         = weapon_anime_type2(type)
    return [file_name,visible,z]
  end
  # 武器アイコン取得
  def weapon_anime_type0(type)
    type = ANIME[type][5]
    return weapon_anime1 if type == "右手"
    return weapon_anime2 if type == "左手"
    return nil
  end
  # 表示・非表示の取得
  def weapon_anime_type1(type)
    return ANIME[type][3]
  end
  # バトラーより上に表示するかどうか
  def weapon_anime_type2(type)
    type = ANIME[type][5]
    return true if type == "左手"
    return false
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得(カメラ補正無し)
  #--------------------------------------------------------------------------
  def true_x
    return PARTY_X + position * FORMATION_X + @ox
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得(カメラ補正無し)
  #--------------------------------------------------------------------------
  def true_y
    # パーティ内の並び順から Y 座標を計算して返す
    if self.index != nil
      y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
      return y
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得
  #--------------------------------------------------------------------------
  def screen_x(true_x = self.true_x)
    return 320 + (true_x - 320) * @real_zoom + @real_x
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def screen_y(true_y = self.true_y)
    return true_y * @real_zoom + @real_y
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    return screen_y + 1000
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得(移動などしていない場合)
  #--------------------------------------------------------------------------
  def base_x
    return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def base_y
    return (true_y - @oy) * @real_zoom + @real_y
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 拡大率の取得
  #--------------------------------------------------------------------------
  def zoom
    return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
                          (true_x + @fly) / 480 + $scene.zoom_rate[0]
  end
  #--------------------------------------------------------------------------
  # ● 攻撃用、バトル画面 X 座標の取得
  #--------------------------------------------------------------------------
  def attack_x(z)
    return (320 - true_x) * z * 0.75
  end
  #--------------------------------------------------------------------------
  # ● 攻撃用、バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def attack_y(z)
    return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  end
  #--------------------------------------------------------------------------
  # ● 閃き待ち時間
  #--------------------------------------------------------------------------
  def flash_duration
    return $scene.flash_duration
  end
  #--------------------------------------------------------------------------
  # ● アニメーション取得
  #--------------------------------------------------------------------------
  def battle_actions1
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  end
  #--------------------------------------------------------------------------
  # ● アニメーション取得
  #--------------------------------------------------------------------------
  def battle_actions2
    weapon = $data_weapons[@weapon2_id]
    return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  end
  #--------------------------------------------------------------------------
  # ● 武器アニメーション取得
  #--------------------------------------------------------------------------
  def weapon_anime1
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.icon_name : ""
  end
  #--------------------------------------------------------------------------
  # ● 武器アニメーション取得
  #--------------------------------------------------------------------------
  def weapon_anime2
    weapon = $data_weapons[@weapon2_id]
    return weapon != nil ? weapon.icon_name : ""
  end
  #--------------------------------------------------------------------------
  # ● 遠距離アニメーション取得
  #--------------------------------------------------------------------------
  def flying_anime1
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  end
  #--------------------------------------------------------------------------
  # ● 遠距離アニメーション取得
  #--------------------------------------------------------------------------
  def flying_anime2
    weapon = $data_weapons[@weapon2_id]
    return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  end
  #--------------------------------------------------------------------------
  # ● 移動目標座標の計算
  #--------------------------------------------------------------------------
  def move_setup
    if RTAB
      targets = @target
    else
      targets = $scene.target_battlers
    end
    case @move_action[0]
    when "self" # 自分
      @target_x = self.base_x
      @target_y = self.base_y
    when "target_near" # 一番近くのターゲット
      targets.sort!{|a,b| a.screen_x<=>b.screen_x }
      targets.reverse!
      if targets != []
        @target_x = targets[0].screen_x
        @target_y = targets[0].screen_y
      else
        @target_x = self.base_x
        @target_y = self.base_y
      end
    when "target_far" # 一番遠くのターゲット
      targets.sort!{|a,b| a.screen_x<=>b.screen_x }
      if targets != []
        @target_x = targets[0].screen_x
        @target_y = targets[0].screen_y
      else
        @target_x = self.base_x
        @target_y = self.base_y
      end
    when "target" # ターゲット中央
      @target_x = 0
      @target_y = 0
      for t in targets
        @target_x += t.screen_x
        @target_y += t.screen_y
      end
      if targets != []
        @target_x /= targets.size
        @target_y /= targets.size
      end
    when "troop" # "トループ中央"
      @target_x = 0
      @target_y = 0
      for t in $game_troop.enemies
        @target_x += t.screen_x
        @target_y += t.screen_y
      end
      if $game_troop.enemies != []
        @target_x /= $game_troop.enemies.size
        @target_y /= $game_troop.enemies.size
      end
    when "party" # "パーティ中央"
      @target_x = 0
      @target_y = 0
      for t in $game_party.actors
        @target_x += t.screen_x
        @target_y += t.screen_y
      end
      if $game_party.actors != []
        @target_x /= $game_party.actors.size
        @target_y /= $game_party.actors.size
      end
    when "screen" # "画面"
      @target_x = self.base_x
      @target_y = self.base_y
    end
    # 補正
    @target_x += @move_action[1] - self.base_x
    @target_y += @move_action[2] - self.base_y
    # 移動目標の座標をセット
    @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
    # 距離の計算(ウエイトの設定)
    @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
                     (@move_coordinates[3] - @move_coordinates[1]).abs
  end
end
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
  attr_reader   :nce
  #--------------------------------------------------------------------------
  # ● セットアップ
  #--------------------------------------------------------------------------
  alias side_view_initialize initialize
  def initialize(troop_id, member_index)
    side_view_initialize(troop_id, member_index)
    start_battle
    @nce = NOT_CHARACTER_EMEMY.include? @enemy_id
    @weapon_id  = EMEMY_WEAPO[@enemy_id] != nil ? EMEMY_WEAPO[@enemy_id] : 0
    @weapon_id2  = EMEMY_WEAPO2[@enemy_id] != nil ? EMEMY_WEAPO2[@enemy_id] : 0
  end
  def character_name
    return self.battler_name
  end
  def character_hue
    return self.battler_hue
  end
  #--------------------------------------------------------------------------
  # ● 移動
  #--------------------------------------------------------------------------
  def move
    # 距離の計算
    @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
                     (@move_coordinates[3] - @move_coordinates[1]).abs
    if @move_distance > 0
      return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
      array = @move_coordinates
      # ジャンプ補正値の計算
      if @move_distance - @move_wait > @move_distance / 2
        jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
      else
        jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
      end
      jump = @move_action[4] > 0 ? -jump : jump
      jump = 0 if @weapon_id + @weapon_id2 == 0
      @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
      @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
      # ウエイト
      @move_wait -= @move_action[3]
      @move_wait = [@move_wait,0].max
    end
  end
  #--------------------------------------------------------------------------
  # ● 武器アニメタイプ
  #--------------------------------------------------------------------------
  def weapon_anime_type(type)
    file_name  = weapon_anime_type0(type)
    visible   = weapon_anime_type1(type)
    z         = weapon_anime_type2(type)
    return [file_name,visible,z]
  end
  # 武器アイコン取得
  def weapon_anime_type0(type)
    type = ANIME[type][5]
    return weapon_anime1 if type == "右手"
    return weapon_anime2 if type == "左手"
    return nil
  end
  # 表示・非表示の取得
  def weapon_anime_type1(type)
    return ANIME[type][3]
  end
  # バトラーより上に表示するかどうか
  def weapon_anime_type2(type)
    type = ANIME[type][5]
    return true if type == "左手"
    return false
  end

  #--------------------------------------------------------------------------
  # ● 移動目標座標の計算
  #--------------------------------------------------------------------------
  def move_setup
    if RTAB
      targets = @target
    else
      targets = $scene.target_battlers
    end
    case @move_action[0]
    when "self" # 自分
      @target_x = self.base_x
      @target_y = self.base_y
    when "target_near" # 一番近くのターゲット
      targets.sort!{|a,b| a.screen_x<=>b.screen_x }
      if targets != []
        @target_x = targets[0].screen_x
        @target_y = targets[0].screen_y
      else
        @target_x = self.base_x
        @target_y = self.base_y
      end
    when "target_far" # 一番遠くのターゲット
      targets.sort!{|a,b| a.screen_x<=>b.screen_x }
      targets.reverse!
      if targets != []
        @target_x = targets[0].screen_x
        @target_y = targets[0].screen_y
      else
        @target_x = self.base_x
        @target_y = self.base_y
      end
    when "target" # ターゲット中央
      @target_x = 0
      @target_y = 0
      for t in targets
        @target_x += t.screen_x
        @target_y += t.screen_y
      end
      if targets != []
        @target_x /= targets.size
        @target_y /= targets.size
      end
    when  "party" # "トループ中央"
      @target_x = 0
      @target_y = 0
      for t in $game_troop.enemies
        @target_x += t.screen_x
        @target_y += t.screen_y
      end
      if $game_troop.enemies != []
        @target_x /= $game_troop.enemies.size
        @target_y /= $game_troop.enemies.size
      end
    when "troop" # "パーティ中央"
      @target_x = 0
      @target_y = 0
      for t in $game_party.actors
        @target_x += t.screen_x
        @target_y += t.screen_y
      end
      if $game_party.actors != []
        @target_x /= $game_party.actors.size
        @target_y /= $game_party.actors.size
      end
    when "screen" # "画面"
      @target_x = self.base_x
      @target_y = self.base_y
    end
    # 補正
    @target_x -= @move_action[1] + self.base_x
    @target_y -= @move_action[2] + self.base_y
    # 移動目標の座標をセット
    @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
    # 距離の計算(ウエイトの設定)
    @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
                     (@move_coordinates[3] - @move_coordinates[1]).abs
  end
  if RTAB
  alias original_x true_x
  alias original_y true_y
  else
  alias original_x screen_x
  alias original_y screen_y
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得(カメラ補正無し)
  #--------------------------------------------------------------------------
  def true_x
    return original_x + @ox
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得(カメラ補正無し)
  #--------------------------------------------------------------------------
  def true_y
    return original_y - @height / 2 + @oy
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得
  #--------------------------------------------------------------------------
  def screen_x(true_x = self.true_x)
    return true_x * @real_zoom + @real_x
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def screen_y(true_y = self.true_y)
    return true_y * @real_zoom + @real_y
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得(移動などしていない場合)
  #--------------------------------------------------------------------------
  def base_x(true_x = self.true_x)
    return (true_x - @ox) * @real_zoom + @real_x
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得(移動などしていない場合)
  #--------------------------------------------------------------------------
  # ● アニメーション取得
  #--------------------------------------------------------------------------
  def battle_actions1
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  end
  #--------------------------------------------------------------------------
  # ● アニメーション取得
  #--------------------------------------------------------------------------
  def battle_actions2
    weapon = $data_weapons[@weapon2_id]
    return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  end
  #--------------------------------------------------------------------------
  # ● 武器アニメーション取得
  #--------------------------------------------------------------------------
  def weapon_anime1
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.icon_name : ""
  end
  #--------------------------------------------------------------------------
  # ● 武器アニメーション取得
  #--------------------------------------------------------------------------
  def weapon_anime2
    weapon = $data_weapons[@weapon2_id]
    return weapon != nil ? weapon.icon_name : ""
  end
  #--------------------------------------------------------------------------
  # ● 遠距離アニメーション取得
  #--------------------------------------------------------------------------
  def flying_anime1
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  end
  #--------------------------------------------------------------------------
  # ● 遠距離アニメーション取得
  #--------------------------------------------------------------------------
  def flying_anime2
    weapon = $data_weapons[@weapon2_id]
    return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  end
  def base_y(true_y = self.true_y)
    return (true_y - @oy) * @real_zoom + @real_y
  end
  #--------------------------------------------------------------------------

  
  
  #--------------------------------------------------------------------------
  # ● アニメーション取得
  #--------------------------------------------------------------------------
  def battle_actions1
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  end
  #--------------------------------------------------------------------------
  # ● アニメーション取得
  #--------------------------------------------------------------------------
  def battle_actions2
    weapon = $data_weapons[@weapon2_id]
    return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  end
  #--------------------------------------------------------------------------
  # ● 武器アニメーション取得
  #--------------------------------------------------------------------------
  def weapon_anime1
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.icon_name : ""
  end
  #--------------------------------------------------------------------------
  # ● 武器アニメーション取得
  #--------------------------------------------------------------------------
  def weapon_anime2
    weapon = $data_weapons[@weapon2_id]
    return weapon != nil ? weapon.icon_name : ""
  end
  #--------------------------------------------------------------------------
  # ● 遠距離アニメーション取得
  #--------------------------------------------------------------------------
  def flying_anime1
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  end
  #--------------------------------------------------------------------------
  # ● 遠距離アニメーション取得
  #--------------------------------------------------------------------------
  def flying_anime2
    weapon = $data_weapons[@weapon2_id]
    return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  end  
end
#==============================================================================
# ■ Game_Party
#==============================================================================
class Game_Party
  #--------------------------------------------------------------------------
  # ● アクターを加える
  #     actor_id : アクター ID
  #--------------------------------------------------------------------------
  alias side_view_add_actor add_actor
  def add_actor(actor_id)
    # アクターを取得
    actor = $game_actors[actor_id]
    # サイドビューデータの初期化
    actor.start_battle
    # 戻す
    side_view_add_actor(actor_id)
  end
end

class Spriteset_Battle
  include Side_view
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias side_veiw_initialize initialize
  def initialize
    side_veiw_initialize
    # アクタースプライトを解放
    for sprite in @actor_sprites
      sprite.dispose
    end
    # アクタースプライトを作成
    @actor_sprites = []
    for i in 1..Party_max
      @actor_sprites.push(Sprite_Battler.new(@viewport1))
    end
    update
  end
  #--------------------------------------------------------------------------
  # ● 画面のスクロール
  #--------------------------------------------------------------------------
  if method_defined?("screen_scroll")
  alias side_view_screen_scroll screen_scroll
  def screen_scroll
    side_view_screen_scroll
    # アクターの位置補正
    for actor in $game_party.actors
      actor.real_x = @real_x
      actor.real_y = @real_y
      actor.real_zoom = @real_zoom
    end
  end
  end
end

class Sprite_Battler < RPG::Sprite
  include Side_view
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     viewport : ビューポート
  #     battler  : バトラー (Game_Battler)
  #--------------------------------------------------------------------------
  def initialize(viewport, battler = nil)
    super(viewport)
    @battler = battler
    @battler_visible = false
    @weapon = Sprite_Weapon.new(viewport, battler)
    @flying = Sprite_Flying.new(viewport, battler)
    @shadow = []
    @fly = 0
    @fly_direction = 1
    @rand = rand(10)
    self.effect_clear
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  alias side_view_dispose dispose
  def dispose
    side_view_dispose
    @weapon.dispose
    @flying.dispose
    if @_target_sprite != nil
      @_target_sprite.bitmap.dispose
      @_target_sprite.dispose
      @_target_sprite = nil
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    # バトラーが nil の場合
    if @battler == nil
      self.bitmap = nil
      @weapon.bitmap = nil
      loop_animation(nil)
      return
    end
    # バトラー更新
    @battler.update
    # バトラーアニメのデータ取得
    @anime_type = @battler.anime_type
    # ファイル名か色相が現在のものと異なる場合
    if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
      change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
    elsif @battler.is_a?(Game_Enemy)
      change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
    else
      return
    end
    if change
      # ビットマップを取得、設定
      if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
        @battler_name = @battler.character_name
        @battler_hue = @battler.character_hue
        self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
        @width = bitmap.width / 4
        @height = bitmap.height / 4
      else
        @battler_name = @battler.battler_name
        @battler_hue = @battler.battler_hue
        self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
        @width = bitmap.width
        @height = bitmap.height
      end
      self.ox = @width / 2
      self.oy = @height / 2
      @battler.height = @height
      @flag = true
      # 戦闘不能または隠れ状態なら不透明度を 0 にする
      if @battler.dead? or @battler.hidden
        self.opacity = 0
      end
    end
    if (@battler.is_a?(Game_Actor) and
      (@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)) or
      ([email protected]_a?(Game_Actor) and [email protected])
      # ビットマップを取得、設定
      @pattern = @battler.pattern
      self.ox = @width / 2
      self.oy = @height / 2
      @sx = @pattern * @width
      sy = @anime_type % 4 * @height
      x   = sy / (@height * 2) + 4
      if [email protected]_a?(Game_Actor) and [email protected] and x == 4
        x = 6
      end    # here!!
      @sy = (x - 2) / 2 * @height
      self.src_rect.set(@sx, @sy, @width, @height)
      self.zoom_x = CHAR_ZOOM
      self.zoom_y = CHAR_ZOOM
      @battler.height = @height
      @flag = false
    end
    # 飛行
    update_fly
    # シェイク
    update_shake
    # 回転
    update_turning
    # 反転
    update_reverse   
    # 移動
    update_moving
    # 追加アニメ
    update_add_anime
    # エフェクト効果の適用
    update_effect
    # アニメーション ID が現在のものと異なる場合
    flag = RTAB ? true : @battler.damage == nil
    if flag and @battler.state_animation_id != @state_animation_id
      @state_animation_id = @battler.state_animation_id
      loop_animation($data_animations[@state_animation_id])
    end
    # シェイク
    if @battler.shake
      self.start_shake(5, 5, 5)
      @battler.shake = false
    end
    # 明滅
    if @battler.blink
      blink_on
    else
      blink_off
    end
    # 不可視の場合
    unless @battler_visible
      flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
                    (@battler.damage == nil or @battler.damage_pop)
      # 出現
      if not @battler.hidden and not @battler.dead? and flag
        appear
        @battler_visible = true
      end
    end
    if RTAB
    # ダメージ
    for battler in @battler.damage_pop
      if battler[0].class == Array
        if battler[0][1] >= 0
          $scene.skill_se
        else
          $scene.levelup_se
        end
        damage(@battler.damage[battler[0]], false, 2)
      else
        damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
      end
      if @battler.damage_sp.include?(battler[0])
        damage(@battler.damage_sp[battler[0]],
                @battler.critical[battler[0]], 1)
        @battler.damage_sp.delete(battler[0])
      end
      @battler.damage_pop.delete(battler[0])
      @battler.damage.delete(battler[0])
      @battler.critical.delete(battler[0])
    end
    end
    # 可視の場合
    if @battler_visible
      # 武器アニメ
      @weapon.battler = @battler
      @weapon.update
      # 遠距離アニメ
      @flying.battler = @battler
      @flying.update
      # 逃走
      if @battler.hidden
        $game_system.se_play($data_system.escape_se)
        escape
        @battler_visible = false
      end
      # 白フラッシュ
      if @battler.white_flash
        whiten
        @battler.white_flash = false
      end
      if RTAB
      # アニメーション
      if [email protected]?
        for animation in @battler.animation.reverse
          if animation[2]
            animation($data_animations[animation[0]], animation[1], true)
          else
            animation($data_animations[animation[0]], animation[1])
          end
          @battler.animation.delete(animation)
        end
      end
      else
      # アニメーション
      if @battler.animation_id != 0
        animation = $data_animations[@battler.animation_id]
        animation(animation, @battler.animation_hit)
        @battler.animation_id = 0
      end
      end
      # ダメージ
      if !RTAB and @battler.damage_pop
        damage(@battler.damage, @battler.critical)
        @battler.damage = nil
        @battler.critical = false
        @battler.damage_pop = false
      end
      flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
                     @battler.damage == nil
      # コラプス
      if flag and @battler.dead?
        if @battler.is_a?(Game_Actor)
          $game_system.se_play($data_system.actor_collapse_se)
        elsif @battler.is_a?(Game_Enemy)
          $game_system.se_play($data_system.enemy_collapse_se)
        end
        collapse
        @battler_visible = false
      end
    end
    # スプライトの座標を設定
    self.x = @battler.screen_x + @effect_ox
    self.y = @battler.screen_y + @effect_oy
    self.z = @battler.screen_z
    self.zoom_x = @battler.real_zoom
    self.zoom_y = @battler.real_zoom
    # ウェイトカウントを減らす
    @battler.wait_count -= 1
    @battler.wait_count2 -= 1
    # アニメーション待ち時間取得
    @battler.animation_duration = @_animation_duration
    if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
      self.zoom_x *= CHAR_ZOOM
      self.zoom_y *= CHAR_ZOOM
      @weapon.x = self.x + 2
      @weapon.y = self.y + 6
      @weapon.angle = 75 - (4 - @battler.pattern) * 45
      if self.mirror
        @weapon.angle += @weapon.angle - 180
      end
      if ([email protected]_a?(Game_Actor) and [email protected])
        @weapon.angle = [email protected]-90
      end
    end
    # 残像
    if @battler.shadow
      if Graphics.frame_count % 2 == 0
        shadow = ::Sprite.new(self.viewport)
        shadow.bitmap = self.bitmap.dup
        shadow.x = self.x
        shadow.y = self.y
        shadow.ox = self.ox
        shadow.oy = self.oy
        shadow.mirror = self.mirror
        shadow.angle = self.angle
        shadow.opacity = 160
        shadow.zoom_x = self.zoom_x
        shadow.zoom_y = self.zoom_y
        if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
          shadow.src_rect.set(@sx, @sy, @width, @height)
        else
          shadow.src_rect.set(0, 0, @width, @height)
        end
        @shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
      end
    end
    for s in @shadow
      if !s[0].disposed?
        s[0].update
        s[1] -= 1
        if s[1] < 1
          if s[0].bitmap != nil
            s[0].bitmap.dispose
          end
          s[0].dispose
        else
          s[0].x = @battler.screen_x(s[2])
          s[0].y = @battler.screen_y(s[3])
        end
      else
        s = nil
      end
    end
    @shadow.compact!
  end
  #--------------------------------------------------------------------------
  # ● エフェクトによる座標系の更新
  #--------------------------------------------------------------------------
  def update_effect
    # 角度の修正
    if @_upside_down
      self.angle = (@_turning + 180) % 360
    else
      self.angle = @_turning
    end
    # X 座標の修正値
    @effect_ox = @_shake + @_moving[0]
    # Y 座標の修正値
    @effect_oy = -@fly + @_moving[1]
    if  @_animation == nil or (RTAB and @_animation.empty?)
      self.effect_clear
    end
  end
  #--------------------------------------------------------------------------
  # ● シェイク更新
  #--------------------------------------------------------------------------
  def update_shake
    if @_shake_duration >= 1 or @_shake != 0
      delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
      if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
        @_shake = 0
      else
        @_shake += delta
      end
      if @_shake > @_shake_power * 2
        @_shake_direction = -1
      end
      if @_shake < - @_shake_power * 2
        @_shake_direction = 1
      end
      if @_shake_duration >= 1
        @_shake_duration -= 1
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 飛行更新
  #--------------------------------------------------------------------------
  def update_fly
    if @rand > 0
      @rand -= 1
      return
    end
    if @battler.fly != 0
      if @fly < @battler.fly / 4
        @fly_direction = 1
      elsif @fly > @battler.fly / 2
        @fly_direction = -1
      end
      @fly += 0.5 * @fly_direction
    end
  end
  #--------------------------------------------------------------------------
  # ● 回転更新
  #--------------------------------------------------------------------------
  def update_turning
    if @_turning_duration > 0 or @_turning != 0
      @_turning += @_turning_direction * @_turning_speed / 2.0
      # 残り回転数を減らす
      if @_turning_direction == -1
        if @_turning_duration > 0 and @_turning < 0
          @_turning_duration -= 1
        end
      elsif @_turning_direction == 1
        if @_turning_duration > 0 and @_turning >= 360
          @_turning_duration -= 1
        end
      end
      # 以下補正
      while @_turning < 0
        @_turning += 360
      end
      if @_turning_duration <= 0
        @_turning = 0
      end
      @_turning %= 360
    end
  end
  #--------------------------------------------------------------------------
  # ● 左右反転更新
  #--------------------------------------------------------------------------
  def update_reverse
    if @last_reverse != (@_reverse or @battler.reverse)
      self.mirror = (@_reverse or @battler.reverse)
      @last_reverse = (@_reverse or @battler.reverse)
    end
  end
  #--------------------------------------------------------------------------
  # ● 移動更新
  #--------------------------------------------------------------------------
  def update_moving
    @move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
                     (@_move_coordinates[3] - @_move_coordinates[1]).abs
    if @move_distance > 0
      return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
      array = @_move_coordinates
      x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
      y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
      @_moving = [x, y]
      if @_move_quick_return and @_move_duration == 0
        @_move_coordinates = [0,0,array[0],array[1]]
        @_move_duration = @move_distance
      end
      @_move_duration -= @_move_speed
      @_move_duration = [@_move_duration, 0].max
    end
  end
  #--------------------------------------------------------------------------
  # ● 追加アニメ更新 (RTAB限定機能)
  #--------------------------------------------------------------------------
  def update_add_anime
    if RTAB
    # アニメーション
    if @_add_anime_id != 0
      animation = $data_animations[@_add_anime_id]
      animation(animation, true)
      @_add_anime_id = 0
    end
    end
  end
  #--------------------------------------------------------------------------
  # ● エフェクト初期化
  #--------------------------------------------------------------------------
  def effect_clear
    @_effect_ox = 0
    @_effect_oy = 0
    @_shake_power = 0
    @_shake_speed = 0
    @_shake_duration = 0
    @_shake_direction = 1
    @_shake = 0
    @_upside_down = false
    @_reverse = false
    @_turning_direction = 1
    @_turning_speed = 0
    @_turning_duration = 0
    @_turning = 0
    @_move_quick_return = true
    @_move_speed = 0
    @_move_coordinates = [0,0,0,0]
    @_move_jump = false
    @_move_duration = 0
    @_moving = [0,0]
    @_add_anime_id = 0
  end
  #--------------------------------------------------------------------------
  # ● シェイクの開始
  #     power    : 強さ
  #     speed    : 速さ
  #     duration : 時間
  #--------------------------------------------------------------------------
  def start_shake(power, speed, duration)
    @_shake_power = power
    @_shake_speed = speed
    @_shake_duration = duration
  end
  #--------------------------------------------------------------------------
  # ● 上下反転を開始
  #--------------------------------------------------------------------------
  def start_upside_down
    @_upside_down = @_upside_down ? false : true
  end
  #--------------------------------------------------------------------------
  # ● 左右反転を開始
  #--------------------------------------------------------------------------
  def start_reverse
    @_reverse = @_reverse ? false : true
  end
  #--------------------------------------------------------------------------
  # ● 回転を開始
  #     direction: 方向
  #     speed    : 速さ
  #     duration : 時間
  #--------------------------------------------------------------------------
  def start_turning(direction, speed, duration)
    @_turning_direction = direction
    @_turning_speed = speed
    @_turning_duration = duration
    @_turning = @_turning_direction == 1 ? 0 : 360
  end
  #--------------------------------------------------------------------------
  # ● 移動を開始
  #     quick_return : 戻るかどうか
  #     speed        : 速さ
  #     x            : X 座標
  #     y            : Y 座標
  #--------------------------------------------------------------------------
  def start_moving(quick_return, speed, x, y)
    @_move_quick_return = quick_return == 0 ? false : true
    @_move_speed = speed
    @_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
    distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
               (@_move_coordinates[3] - @_move_coordinates[1]).abs
    @_move_duration = distance
  end
  #--------------------------------------------------------------------------
  # ● アニメ追加を開始
  #     id           : ID
  #     hit          : 命中フラッグ
  #--------------------------------------------------------------------------
  def start_add_anime(id)
    @_add_anime_id = id
  end
  #--------------------------------------------------------------------------
  # ● 各種エフェクトの開始判定
  #--------------------------------------------------------------------------
  if !method_defined?("side_view_animation_process_timing")
    alias side_view_animation_process_timing animation_process_timing
  end
  def animation_process_timing(timing, hit)
    side_view_animation_process_timing(timing, hit)
    if (timing.condition == 0) or
       (timing.condition == 1 and hit == true) or
       (timing.condition == 2 and hit == false)
      if timing.se.name =~ SHAKE_FILE
        names = timing.se.name.split(/#/)
        power    = names[1].nil? ? SHAKE_POWER    : names[1].to_i
        speed    = names[2].nil? ? SHAKE_SPEED    : names[2].to_i
        duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
        # シェイクを開始
        self.start_shake(power, speed, duration)
      end
      if timing.se.name == UPSIDE_DOWN_FILE
        # 上下反転を開始
        self.start_upside_down
      end
      if timing.se.name == REVERSE_FILE
        # 左右反転を開始
        self.start_reverse
      end
      if timing.se.name =~ TURNING_FILE
        names = timing.se.name.split(/#/)
        direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
        speed     = names[2].nil? ? TURNING_SPEED     : names[2].to_i
        duration  = names[3].nil? ? TURNING_DURATION  : names[3].to_i
        # 回転を開始
        self.start_turning(direction, speed, duration)
      end
      if timing.se.name =~ MOVE_FILE
        names = timing.se.name.split(/#/)
        quick_return= names[1].nil? ? MOVE_RETURN      : names[1].to_i
        speed       = names[2].nil? ? MOVE_SPEED       : names[2].to_i
        x           = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
        y           = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
        # 移動を開始
        self.start_moving(quick_return, speed, x, y)
      end
      if timing.se.name =~ ADD_ANIME_FILE
        names = timing.se.name.split(/#/)
        id = names[1].nil? ? ADD_ANIME_ID      : names[1].to_i
        # アニメ追加を開始
        self.start_add_anime(id)
      end
    end
  end
end

#==============================================================================
# ■ Sprite_Weapon
#------------------------------------------------------------------------------
#  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
# スプライトの状態を自動的に変化させます。
#==============================================================================

class Sprite_Weapon < RPG::Sprite
  include Side_view
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :battler                  # バトラー
  attr_reader   :cw                       # グラフィックの幅
  attr_reader   :ch                       # グラフィックの高さ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     viewport : ビューポート
  #     battler  : バトラー (Game_Battler)
  #--------------------------------------------------------------------------
  def initialize(viewport, battler = nil)
    super(viewport)
    @battler = battler
    @battler_visible = false
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    if self.bitmap != nil
      self.bitmap.dispose
    end
    super
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    # バトラーが nil の場合
    if @battler == nil or ([email protected]_a?(Game_Actor) and @battler.nce)
      self.bitmap = nil
      return
    end
    # ウエポンアニメのデータ取得
    @weapon_anime_type = @battler.weapon_anime_type(@battler.condition)
    # 設定が「非表示」の場合
    if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
      self.visible = false
      return
    else
      self.visible = true
    end
    # ファイル名が現在のものと異なる場合
    if @weapon_anime_type[0] != @weapon_name
      @weapon_name = @weapon_anime_type[0]
      # ビットマップを取得、設定
      self.bitmap = RPG::Cache.icon(@weapon_name)
      @width = bitmap.width
      @height = bitmap.height
      @flag = true
    end
    # 現在アニメパターンが現在のものと異なる場合
    if @pattern != @battler.pattern or @flag or @condition != @battler.condition
      @pattern = @battler.pattern
      @condition = @battler.condition
      self.ox = @width
      self.oy = @height
      self.z = battler.screen_z
      self.zoom_x = @battler.real_zoom * CHAR_ZOOM
      self.zoom_y = @battler.real_zoom * CHAR_ZOOM
      self.src_rect.set(0, 0, @width, @height)
      self.opacity = 255
      # バトラーより手前に表示
      if @weapon_anime_type[2]
        self.z += 10
      # バトラーより奥に表示
      else
        self.z -= 10
      end
      @flag = false
    end
  end
end

#==============================================================================
# ■ Sprite_Flying
#------------------------------------------------------------------------------
#  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
# スプライトの状態を自動的に変化させます。
#==============================================================================

class Sprite_Flying < RPG::Sprite
  include Side_view
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :battler                  # バトラー
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     viewport : ビューポート
  #     battler  : バトラー (Game_Battler)
  #--------------------------------------------------------------------------
  def initialize(viewport, battler = nil)
    super(viewport)
    @battler = battler
    @battler_visible = false
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    if self.bitmap != nil
      self.bitmap.dispose
    end
    super
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    # バトラーが nil の場合
    if @battler == nil
      self.bitmap = nil
      loop_animation(nil)
      return
    end
    # 遠距離アニメ
    flying_animation = @battler.flying_animation
    flying_start = flying_animation[0]
    flying_end   = flying_animation[1]
    # アニメーション ID が現在のものと異なる場合
    if @anime_id != @battler.flying_anime[0]
      @anime_id = @battler.flying_anime[0]
      @animation = $data_animations[@anime_id]
    end
    # アニメーション 開始
    if flying_start
      loop_animation(@animation)
    elsif flying_end
      loop_animation(nil)
    end
    self.x = @battler.flying_x
    self.y = @battler.flying_y
    self.z = @battler.screen_z + 1000
  end
end

module RPG
  class Skill
    #--------------------------------------------------------------------------
    # ● 魔法かどうかの判断
    #--------------------------------------------------------------------------
    def magic?
      if @atk_f == 0
        return true
      else
        return false
      end
    end
  end
end

# アローカーソルの位置修正

class Arrow_Actor < Arrow_Base
  include Side_view
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias side_view_update update
  def update
    side_view_update
    # スプライトの座標を設定
    if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
      self.x = self.actor.screen_x + ARROW_OX
      self.y = self.actor.screen_y + ARROW_OY
    end
  end
end
class Arrow_Enemy < Arrow_Base
  include Side_view
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias side_view_update update
  def update
    side_view_update
    # スプライトの座標を設定
    if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
      self.x = self.enemy.screen_x
      self.y = self.enemy.screen_y + self.enemy.height/2
    end
  end
end
module Rtab_use
  def update_phase4_step3(battler)
    # ヘルプウィンドウの更新。アクションの種別で分岐
    case battler.current_action.kind
    when 0  # 基本
      if battler.current_action.basic == 1
        @help_window.set_text($data_system.words.guard, 1)
        @help_wait = @help_time
      end
      if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
        @help_window.set_text("逃げる", 1)
        @help_wait = @help_time
      end
    when 1  # スキル
      skill =  $data_skills[battler.current_action.skill_id]
      @help_window.set_text(skill.name, 1)
      @help_wait = @help_time
    when 2  # アイテム
      item = $data_items[battler.current_action.item_id]
      @help_window.set_text(item.name, 1)
      @help_wait = @help_time
    end
    # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
    if battler.anime1 == 0
      battler.white_flash = true
      battler.wait = 5
      # カメラ設定
      if battler.target[0].is_a?(Game_Enemy)
        camera_set(battler)
      end
    else
      battler.animation.push([battler.anime1, true])
      speller = synthe?(battler)
      if speller != nil
        for spell in speller
          if spell != battler
            if spell.current_action.spell_id == 0
              spell.animation.push([battler.anime1, true])
            else
              skill = spell.current_action.spell_id
              spell.animation.push([$data_skills[skill].animation1_id, true])
              spell.current_action.spell_id = 0
            end
          end
        end
      end
      battler.wait = 2 * $data_animations[battler.anime1].frame_max - 10
      battler.anime1 = 0
    end
    # ステップ 4 に移行
    battler.phase = 4 if !(!battler.animation1_on and battler.action? and !battler.flash?)
  end
end

#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
  include Side_view
  include Rtab_use if RTAB
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :phase            # フェーズ
  attr_reader   :phase4_step      # フェーズ4ステップ
  attr_reader   :active_battler   # 対象の配列
  attr_reader   :target_battlers  # 対象の配列
  attr_reader   :animation1_id    # 行動アニメID
  attr_reader   :animation2_id    # 対象アニメID
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  alias side_view_main main
  def main
    # バトラー初期化
    for battler in $game_party.actors + $game_troop.enemies
      battler.start_battle
    end
    # 戻す
    side_view_main
  end
  #--------------------------------------------------------------------------
  # ● 閃き判定
  #--------------------------------------------------------------------------
  def flash?
    return @flash_flag ? true : false
  end  
  #--------------------------------------------------------------------------
  # ● 閃きアニメ待ち時間取得
  #--------------------------------------------------------------------------
  def flash_duration
    animation = nil
    if FLASH_ANIME
      animation = $data_animations[FLASH_ANIMATION_ID]
    end
    return animation != nil ? animation.frame_max * 2 + 2 : 0
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  #--------------------------------------------------------------------------
  alias side_view_update_phase4_step2 update_phase4_step2
  def update_phase4_step2(*arg)
    battler = convert_battler2(*arg)
    battler.action
    side_view_update_phase4_step2(*arg)
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  #--------------------------------------------------------------------------
  alias side_view_update_phase4_step3 update_phase4_step3
  def update_phase4_step3(*arg)
    battler = convert_battler2(*arg)
    if battler.flash? and FLASH_ANIME
      battler.flash_flag["normal"] = true
    end
    side_view_update_phase4_step3(*arg)
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  #--------------------------------------------------------------------------
  alias side_view_update_phase4_step4 update_phase4_step4
  def update_phase4_step4(*arg)
    battler = convert_battler2(*arg)
    targets = RTAB ? battler.target : @target_battlers
    return if !battler.animation2_on and battler.action? if !RTAB
    side_view_update_phase4_step4(*arg)
    for target in targets
      if RTAB
        value = nil
        if target.damage_sp.include?(battler)
          value = target.damage_sp[battler]
        end
        if target.damage.include?(battler)
          if value == nil or value == "Miss"
            value = target.damage[battler]
          elsif value.is_a?(Numeric) && value > 0
            value = target.damage[battler] == "Miss" ? value : target.damage[battler]
          end
        end
      else
        value = target.damage
      end
      if target.is_a?(Game_Actor)
        # ダメージの場合
        if value.is_a?(Numeric) && value > 0
          # シェイクを開始
          target.shake = true
        end
      elsif target.is_a?(Game_Enemy)
        # ダメージの場合
        if value.is_a?(Numeric) && value > 0
          # シェイクを開始
          target.shake = true
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● プレバトルフェーズ開始
  #--------------------------------------------------------------------------
  alias start_phase1_correct start_phase1
  def start_phase1
    # カメラの設定
    # 元々フロントビュー向けの数値になっているため
    @zoom_rate = [1.0, 1.0]
    start_phase1_correct
  end
  #--------------------------------------------------------------------------
  # ● アクターコマンドフェーズ開始
  #--------------------------------------------------------------------------
  alias start_phase3_correct start_phase3
  def start_phase3
    battler = convert_battler
    start_phase3_correct
    if RTAB
      # カメラの設定
      # 元々フロントビュー向けの数値になっているため
      @camera = "command"
#      @spriteset.screen_target(0, 0, 1.0)
    end
  end


  def action_phase(battler)
    # action が 1 の場合、バトラーが行動中かどうか確認
    if @action == 1 and battler.phase < 3
      for target in battler.target
        speller = synthe?(target)
        if speller == nil
          # ターゲットが通常行動中の場合
          if @action_battlers.include?(target)
            if target.phase > 2
              return
            end
          end
        else
          # ターゲットが連携スキル発動中の場合
          for spell in speller
            if @action_battlers.include?(spell)
              if spell.phase > 2
                return
              end
            end
          end
        end
      end
    end
case battler.phase
  when 1
    update_phase4_step1(battler)
  when 2
    update_phase4_step2(battler)
  when 3  
    update_phase4_step3(battler) if !(!battler.animation1_on and battler.action? and !battler.flash?)
  when 4
    update_phase4_step4(battler) if !(!battler.animation2_on and battler.action?)
  when 5
    update_phase4_step5(battler)
  when 6
    update_phase4_step6(battler)
  end
end
end

点评

现在没时间翻译啦,你自己看看,就能知道大概的意思了,我也是这样  发表于 2012-1-20 21:40

Lv3.寻梦者

梦石
0
星屑
3176
在线时间
1442 小时
注册时间
2009-7-27
帖子
1454
2
发表于 2012-1-19 19:55:18 | 只看该作者
什么情况?当然是脚本设定的情况嘛,我改好了,有哪里还需要改的再问。原理是…………说了你也不懂,直接用吧。。。。
  1. =begin
  2. ###############################################################################

  3. 全局行走图战斗 v1.1
  4. 本版本只经低测试,可能存在某些bug。
  5. 请注意更新
  6. http://rpg.blue/viewthread.php?tid=129875&extra=page%3D1

  7. ###############################################################################
  8. ------------------------------------------------------------------------------
  9. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  10. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)

  11. 这个脚本的更动分为2部分:
  12. 1)战斗动作 - 新加了数个动作,如:“弓箭攻击”、“远距离发动”等等
  13. 2)战斗动画 - 基本上是脚本原带的。只是这个功能被隐藏起来了。现在已恢复。

  14. 用法:
  15. 在相应的脚本行加入武器/技能/道具的数据库id(id之间要用“,”来分开)
  16. 如果不要某些功能的话就随便填一个外太空id就行了(没有用到的id)
  17. 1)战斗动作(角色/行走图的动作)
  18. 脚本355行:  远程武器的id  (普通攻击时使用远程射击)
  19. 脚本357行:  回旋武器的id  (普通攻击时会飞回手上的武器,如:回力镖)
  20. 脚本370行:  远程技能的id  (使用技能时是远程射击)
  21. 脚本372行:  回旋技能的id  (使用技能时,飞出的武器会飞回手上)

  22. 2)战斗动画(显示‘对象方的动画’之前先显示‘飞行武器射去敌人身上’的动画)
  23. 脚本453行:  回旋武器的id  (攻击时会显示一段类似回力镖的动画)
  24. 脚本455行:  弓箭武器的id  (攻击时会显示箭射去敌人身上的动画)
  25. 脚本457行:  铳类武器的id  (攻击时会显示子弹射去敌人身上的动画)
  26. 脚本470行:  回旋技能的id  (技能使用时会显示一段类似回力镖的动画)
  27. 脚本472行:  弓箭技能的id  (技能使用时会显示箭射去敌人身上的动画)
  28. 脚本474行:  铳类技能的id  (技能使用时会显示子弹射去敌人身上的动画)
  29. 脚本486行:  抛击道具的id  (使用该道具时,道具被丢到敌人身上)

  30. 〉注意:
  31. 〉‘飞行武器射去敌人身上’的动画是在设定id之后的那句脚本里面设置
  32. 〉例子:(脚本第455和456行)
  33. 〉       when 17,18,19,20    #远程武器1(弓箭类)的id
  34. 〉       return [101,32,false,false]
  35. 〉这样,武器17~20(都是弓箭)在显示‘对象方的动画’之前会先显示第101号动画
  36. 〉而动画的轨道是从使用者身上直到敌人身上(实现子弹射出的效果)
  37.   
  38. 还有:
  39. 战斗队伍的画面位置已经被修改过,
  40. 让角色的位置与默认的战斗背景图不会有视觉上的冲突。
  41. 如果要更改请去脚本第113-116行改改就行了。

  42. 脚本‘Arrow_Enemy’和‘Arrow_Actor’被稍微修改过(可以无视)

  43. 这个范例附带了
  44. 一张经过修改的战斗背景图(027-castle03),其他的战斗背景图可以使用默认的。
  45. 一套横版的默认敌人的战斗图(从行走图改过来的)

  46. =end                                                        #modify by darkten

  47. ###############################################################################

  48. =begin

  49. 此版本更新了以下几点:
  50. 1.支持敌人行走图战斗
  51. 2.修正与RTAB并用的bug。
  52. 3.支持敌人也玩小石头

  53. 使用方法:
  54. 1.敌人的战斗图名称要与敌人的行走图名称相一致,具体查看本范例编号为2的敌人。
  55. 2.请自行设置 160 ~ 173 行的内容。

  56.                                                                   by ONEWateR
  57. =end
  58. ###############################################################################
  59.   
  60. module Side_view
  61.   #--------------------------------------------------------------------------
  62.   # ● 是否与RATB并用 ☆自动识别(这到是不错~省了~)
  63.   #    在Scene_Battle计算方法是否是方法synthe?
  64.   #    在自动不想认识的时候,请重写。
  65.   #--------------------------------------------------------------------------
  66.   if Scene_Battle.method_defined?("synthe?")
  67.     RTAB = true
  68.   else
  69.     RTAB = false
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 改正RATB中的位置误差 ☆自动识别
  73.   #    在自动不想认识的时候,请重写。
  74.   #--------------------------------------------------------------------------
  75.   def camera_correctness
  76.     return false if !RTAB
  77.     begin
  78.       return $scene.drive
  79.     rescue
  80.       return false
  81.     end
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● 队伍中的最大人数
  85.   #--------------------------------------------------------------------------
  86.   Party_max = 4
  87.   #--------------------------------------------------------------------------
  88.   # ● 战斗图的扩大率(1.0的时候是保持原有大小)
  89.   #--------------------------------------------------------------------------
  90.   CHAR_ZOOM = 1.0
  91.   #--------------------------------------------------------------------------
  92.   # ● 光标的位置修正(基本不需要改~)
  93.   #--------------------------------------------------------------------------
  94.   ARROW_OX = 0
  95.   ARROW_OY = 64
  96.   #--------------------------------------------------------------------------
  97.   # ● 名状态作为飞行管理的排列(不知道什么意思....)
  98.   #--------------------------------------------------------------------------
  99.   FLY_STATES = ["飛行"]
  100.   #--------------------------------------------------------------------------
  101.   # ● 战斗画面的位置
  102.   #--------------------------------------------------------------------------
  103.   PARTY_X = 470    # 队伍 X 位置
  104.   PARTY_Y = 240     # 队伍 Y 位置
  105.   FORMATION_X = 30  # 各个角色之间的间隔 X
  106.   FORMATION_Y = 30 # 各个角色之间的间隔 Y
  107.   #--------------------------------------------------------------------------
  108.   # ● 自定义常数
  109.   #--------------------------------------------------------------------------
  110.   NORMAL   = "NORMAL"
  111.   WALK_R   = "WALK_R"
  112.   WALK_L   = "WALK_L"
  113.   ATTACK   = "ATTACK"
  114.   ATTACK_R = "ATTACK_R"
  115.   ATTACK_L = "ATTACK_L"
  116.   MAGIC    = "MAGIC"
  117.   ITEM     = "ITEM"
  118.   # 动画的设定
  119.   ANIME = {
  120.     # [画像ID,是否循环,アニメスピード,动画速度,不能指向动画,武器放在右手or左手]
  121.     NORMAL            => [1,true , 0,false, true ,""    ], # 通常待击
  122.     WALK_R            => [2,true , 2,false, false,""    ], # 右移动
  123.     WALK_L            => [1,true , 2,false, false,""    ], # 左移动
  124.     ATTACK_R          => [1,false, 2,true , false,"右手"], # 右手攻击
  125.     ATTACK_L          => [1,false, 2,true , false,"左手"], # 左手攻击
  126.     MAGIC             => [1,false, 2,false, false,""    ], # 右手攻击
  127.     ITEM              => [1,false, 2,false, false,""    ], # 左手攻击
  128.     }
  129.    
  130.   # 债务不履行声明价值的设定(一个字一个字翻译的,不知道啥意思)  
  131.   ANIME.default = [1,false,12,false,"",""]
  132.   
  133.   # 在行动设定的时候 右手攻击 or 左手攻击 辨别を(这个不知道什么意思)的ANIME
  134.   # "角色动画变更#ATTACK"在玩了と(还是不知道啥意思..)的时候,辨别ATTACK_R或者ATTACK_L
  135.   DUAL_WEAPONS_ANIME = [ATTACK]
  136.   
  137.   
  138.   #--------------------------------------------------------------------------
  139.   # ● 战斗图不是行走图的敌人编号
  140.   #--------------------------------------------------------------------------
  141.   NOT_CHARACTER_EMEMY = [900]
  142.   #--------------------------------------------------------------------------
  143.   # ● 敌人使用的武器
  144.   #    敌人编号=>武器编号
  145.   #--------------------------------------------------------------------------
  146.   EMEMY_WEAPO = {2=>1,7=>17}
  147.   #--------------------------------------------------------------------------
  148.   # ● 敌人使用的武器 (二刀流)
  149.   #    敌人编号=>武器编号
  150.   #--------------------------------------------------------------------------
  151.   EMEMY_WEAPO2 = {}
  152.   
  153.   
  154.   #--------------------------------------------------------------------------
  155.   # ● 摇晃的设定
  156.   #--------------------------------------------------------------------------
  157.   SHAKE_FILE = "摇晃"  # 文件名
  158.   SHAKE_POWER = 5          # 强度
  159.   SHAKE_SPEED = 5          # 速度
  160.   SHAKE_DURATION = 5      # 时间
  161.   #--------------------------------------------------------------------------
  162.   # ● 上下反转地的设定
  163.   #--------------------------------------------------------------------------
  164.   UPSIDE_DOWN_FILE = "上下反转" # 文件名
  165.   #--------------------------------------------------------------------------
  166.   # ● 左右反转地的设定
  167.   #--------------------------------------------------------------------------
  168.   REVERSE_FILE = "左右反转" # 文件名
  169.   #--------------------------------------------------------------------------
  170.   # ● 回转地的设定
  171.   #--------------------------------------------------------------------------
  172.   TURNING_FILE = "回转" # 文件名
  173.   TURNING_DIRECTION = 1 # 方向(1.逆时针,-1.顺时针)(|||-_-汗..怎么还有用-1做带入值的...)
  174.   TURNING_SPEED = 40    # 速度
  175.   TURNING_DURATION = 1  # 回转数
  176.   #--------------------------------------------------------------------------
  177.   # ● 移动的设定
  178.   #--------------------------------------------------------------------------
  179.   MOVE_FILE = "移动"             # 文件名
  180.   MOVE_RETURN = 1                # 回到原来的位置吗?(光写了个1,也不知道不回到该怎么写?0?)
  181.   MOVE_SPEED = 32                # 速度
  182.   MOVE_COORDINATES = [0,-640]    # 原来位置的相对坐标
  183.   #--------------------------------------------------------------------------
  184.   # ● 动画追加的设定
  185.   #--------------------------------------------------------------------------
  186.   ADD_ANIME_FILE = "动画追加"  # 文件名
  187.   ADD_ANIME_ID = 0               # 动画的ID
  188.   #--------------------------------------------------------------------------
  189.   # ● 债务不履行声明和RTAB的数据转换
  190.   #--------------------------------------------------------------------------
  191.   def convert_battler
  192.     return RTAB ? @active_actor : @active_battler
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ● 债务不履行声明和RTAB的数据转换2
  196.   #--------------------------------------------------------------------------
  197.   def convert_battler2(*arg)
  198.     return RTAB ? arg[0] : @active_battler
  199.   end
  200. end

  201. #--------------------------------------------------------------------------
  202. # ● 行动設定
  203. #--------------------------------------------------------------------------
  204. module BattleActions
  205.   
  206.   # 下のものはあくまでも一例なので
  207.   # 独自に作ってください。

  208.   Actions = {

  209.   "通常攻撃" => [
  210.   
  211.   "閃きアニメ",
  212.   "アクターアニメ変更#WALK_L",
  213.   "移動#target,32,0,64,0",
  214.   "行動アニメ",
  215.   "アクターアニメ変更#ATTACK",
  216.   "遠距離アニメ",
  217.   "対象アニメ",
  218.   "アクターアニメ変更#WALK_L",
  219.   "SEの演奏#016-Jump02,80,100",
  220.   "移動#self,0,0,48,32",
  221.   "終了"
  222.   ],

  223.   "エネミー攻撃" => [
  224.   
  225.   "閃きアニメ",
  226.   "アクターアニメ変更#WALK_L",
  227.   "移動#self,-36,0,12,0",
  228.   "行動アニメ",
  229.   "アクターアニメ変更#ATTACK",
  230.   "遠距離アニメ",
  231.   "対象アニメ",
  232.   "アクターアニメ変更#WALK_L",
  233.   "移動#self,0,0,12,0",
  234.   "終了"
  235.   ],
  236.   
  237.   "術発動" => [
  238.   
  239.   "閃きアニメ",
  240.   "アクターアニメ変更#WALK_L",
  241.   "移動#self,-32,0,4,0",
  242.   "アクターアニメ変更#MAGIC",
  243.   "行動アニメ",
  244.   "ウエイト#15",
  245.   "遠距離アニメ",
  246.   "対象アニメ",
  247.   "アクターアニメ変更#WALK_L",
  248.   "移動#self,0,0,4,2",
  249.   "終了"
  250.   ],

  251.   "アイテム使用" => [
  252.   
  253.   "閃きアニメ",
  254.   "アクターアニメ変更#WALK_L",
  255.   "移動#self,-32,0,4,0",
  256.   "行動アニメ",
  257.   "アクターアニメ変更#ITEM",
  258.   "ウエイト#15",
  259.   "遠距離アニメ",
  260.   "対象アニメ",
  261.   "アクターアニメ変更#WALK_L",
  262.   "移動#self,0,0,4,2",
  263.   "終了"
  264.   ],
  265.   
  266.   "払い抜け" => [
  267.   
  268.   "閃きアニメ",
  269.   "アクターアニメ変更#WALK_L",
  270.   "移動#target_near,50,0,48,30",  
  271.   "アクターアニメ固定#ATTACK#3",
  272.   "行動アニメ",
  273.   "ウエイト#15",
  274.   "残像表示",
  275.   "移動#target_far,-50,0,48,0",
  276.   "対象アニメ",
  277.   "残像消去",
  278.   "アニメ固定解除",
  279.   "アクターアニメ変更#WALK_L",
  280.   "移動#self,0,0,48,1,0",
  281.   "終了"
  282.   ],

  283.   "弓箭攻撃" => [
  284.   
  285.   "閃きアニメ",
  286.   "アクターアニメ変更#WALK_L",
  287.   "移動#self,-32,0,4,0",
  288.   "行動アニメ",
  289.   "アクターアニメ変更#ATTACK",
  290.   "遠距離アニメ",
  291.   "対象アニメ",
  292.   "アクターアニメ変更#WALK_L",
  293.   "移動#self,0,0,4,2",
  294.   "終了"
  295.   ],

  296.   "回旋攻撃" => [
  297.   
  298.   "閃きアニメ",
  299.   "アクターアニメ変更#WALK_L",
  300.   "移動#self,-32,0,4,0",
  301.   "行動アニメ",
  302.   "アクターアニメ変更#STAND_L",  
  303.   "遠距離アニメ",
  304.   "対象アニメ",
  305.   "アクターアニメ変更#WALK_L",
  306.   "移動#self,0,0,4,2",
  307.   "終了"
  308.   ],
  309.   
  310.   "远距离発動" => [
  311.   
  312.   "閃きアニメ",
  313.   "アクターアニメ変更#WALK_L",
  314.   "移動#self,-32,0,4,0",
  315.   "アクターアニメ変更#MAGIC",
  316.   "行動アニメ",
  317.   "アクターアニメ変更#ATTACK",
  318.   "遠距離アニメ",
  319.   "対象アニメ",
  320.   "アクターアニメ変更#WALK_L",
  321.   "移動#self,0,0,4,2",
  322.   "終了"
  323.   ],
  324.   
  325.   "回旋発動" => [
  326.   
  327.   "閃きアニメ",
  328.   "アクターアニメ変更#WALK_L",
  329.   "移動#self,-32,0,4,0",
  330.   "アクターアニメ変更#MAGIC",
  331.   "行動アニメ",
  332.   "アクターアニメ変更#STAND_L",  
  333.   "遠距離アニメ",
  334.   "対象アニメ",
  335.   "アクターアニメ変更#WALK_L",
  336.   "移動#self,0,0,4,2",
  337.   "終了"
  338.   ],

  339.   } # ここで終わり 消さないでください

  340. end
  341.   
  342. module RPG
  343.   class Weapon
  344.     #--------------------------------------------------------------------------
  345.     # ● アクション設定
  346.     #--------------------------------------------------------------------------
  347.     def battle_actions
  348.       case @id
  349.       when 500  # 远程武器的id回旋攻撃
  350.         return BattleActions::Actions["弓箭攻撃"]
  351.       when 501                       # 回旋武器的id
  352.         return BattleActions::Actions["回旋攻撃"]
  353.       end
  354.       else
  355.       return BattleActions::Actions["通常攻撃"]
  356.     end
  357.   end
  358.   class Skill
  359.     #--------------------------------------------------------------------------
  360.     # ● アクション設定
  361.     #--------------------------------------------------------------------------
  362.     def battle_actions
  363.       case @id
  364.       when 400  # 远程技能的id
  365.         return BattleActions::Actions["远距离発動"]
  366.       when 401                      # 回旋技能的id
  367.         return BattleActions::Actions["回旋発動"]
  368.       end
  369.       else
  370.       if self.magic?
  371.         return BattleActions::Actions["術発動"]
  372.       else
  373.         return BattleActions::Actions["払い抜け"]
  374.       end
  375.     end
  376.   end
  377.   class Item
  378.     #--------------------------------------------------------------------------
  379.     # ● アクション設定
  380.     #--------------------------------------------------------------------------
  381.     def battle_actions
  382.       return BattleActions::Actions["アイテム使用"]
  383.     end
  384.   end
  385. end
  386. #class Game_Enemy < Game_Battler
  387.   #--------------------------------------------------------------------------
  388.   # ● アクション設定
  389.   #--------------------------------------------------------------------------
  390. #~  def battle_actions
  391. #~    return BattleActions::Actions["エネミー攻撃"]
  392. #~  end
  393. #end
  394. =begin
  395. #--------------------------------------------------------------------------
  396. # ● 遠距離アニメーション
  397. #--------------------------------------------------------------------------
  398.  ☆ 説明
  399.   
  400.    行動者から対象者にアニメを飛ばします。
  401.    飛ばすアニメを データベース‐アニメーション で作ります。
  402.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。


  403.   ● カスタマイズ方法
  404.    
  405.     case @id
  406.     when 17,18,19,20
  407.       return [101,32,false,false]
  408.     when 21,22,23,24
  409.       return [102,32,false,false]
  410.     end
  411.     return 0
  412.    
  413.     のように描くとID別に指定可能です。
  414.    
  415.    
  416.   ● アニメーションID
  417.   
  418.   飛ばすアニメーションIDです。短い場合は繰り返しで表示されます。
  419.   
  420.    
  421.   ● スピード
  422.   
  423.   大きいほうが早い(0だとアニメは移動しません)
  424.   
  425.   1 = 1フレームで1ドット進むと考えてください。
  426.   
  427.   ● 往復するか?
  428.   
  429.   true とした場合、ブーメランのようにアニメが戻ります。
  430.   
  431.   ● 直線(false)or曲線(true)
  432.   
  433.   true  = 対象に向かって曲線で、アニメが飛びます。(修正の余地ありですが・・・)
  434.   false = 対象に向かって直線で、アニメが飛びます。
  435.    
  436. =end
  437. module RPG
  438.   class Weapon
  439.     #--------------------------------------------------------------------------
  440.     # ● 遠距離アニメーション
  441.     #--------------------------------------------------------------------------
  442.     def flying_anime
  443.       # ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
  444.       case @id
  445.       when 34             #回旋武器(类似回力镖)的id
  446.         return [103,32,true,true]
  447.       when 17,18,19,20    #远程武器1(弓箭类)的id
  448.         return [101,32,false,false]
  449.       when 21,22,23,24    #远程武器2(铳类)的id
  450.         return [102,32,false,false]
  451.       end
  452.       return [0,0,false,false]
  453.     end
  454.   end
  455.   class Skill
  456.     #--------------------------------------------------------------------------
  457.     # ● 遠距離アニメーション
  458.     #--------------------------------------------------------------------------
  459.     def flying_anime
  460.       # ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
  461.       case @id
  462.       when 82             #回旋技能(类似回力镖)的id
  463.         return [103,32,true,true]
  464.       when 73,74,75,76    #远程技能1(弓箭类)的id
  465.         return [101,32,false,false]
  466.       when 77,78,79,80    #远程技能2(铳类)的id
  467.         return [102,32,false,false]
  468.       end
  469.       return [0,0,false,false]
  470.     end
  471.   end
  472.   class Item
  473.     #--------------------------------------------------------------------------
  474.     # ● 遠距離アニメーション
  475.     #--------------------------------------------------------------------------
  476.     def flying_anime
  477.       case @id
  478.       when 34    #抛击类道具(如炸弹一类)的id
  479.         return [104,32,false,true]
  480.       end
  481.       return [0,0,false,false]
  482.     end
  483.   end
  484. end

  485. #class Game_Enemy < Game_Battler
  486.   #--------------------------------------------------------------------------
  487.   # ● 遠距離アニメーション
  488.   #--------------------------------------------------------------------------
  489. #~  def flying_anime
  490. #~    return [0,0,false,false]
  491. #~  end
  492. #end



  493. #==============================================================================
  494. # ■ Game_Battler
  495. #==============================================================================
  496. class Game_Battler
  497.   include Side_view
  498.   #--------------------------------------------------------------------------
  499.   # ● 追加・公開インスタンス変数
  500.   #--------------------------------------------------------------------------
  501.   attr_accessor :height                  # 画像の高さ
  502.   attr_accessor :real_x                  # X座標補正
  503.   attr_accessor :real_y                  # Y座標補正
  504.   attr_accessor :real_zoom               # 拡大率
  505.   attr_accessor :wait_count              # アニメーション 待ち時間
  506.   attr_accessor :wait_count2             # アニメーション 待ち時間2
  507.   attr_accessor :pattern                 # アニメーション カウント(キャラ)
  508.   attr_accessor :shake                   # シェイク開始フラッグ
  509.   attr_accessor :reverse                 # 左右反転フラッグ
  510.   attr_accessor :shadow                  # 残像フラッグ
  511.   attr_accessor :flash_flag              # 閃きフラッグ
  512.   attr_reader   :x                      # X座標補正
  513.   attr_reader   :y                      # Y座標補正
  514.   attr_reader   :flying_x                # 遠距離アニメX座標
  515.   attr_reader   :flying_y                # 遠距離アニメY座標
  516.   attr_reader   :flying_anime            # 遠距離アニメ
  517.   attr_reader   :animation1_on           # 行動アニメ開始フラッグ
  518.   attr_reader   :animation2_on           # 対象アニメ開始フラッグ
  519.   #--------------------------------------------------------------------------
  520.   # ● デフォルトのアニメーション待ち時間を取得
  521.   #--------------------------------------------------------------------------
  522.   def animation_duration=(animation_duration)
  523.     @_animation_duration = animation_duration
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ● バトル開始時のセットアップ
  527.   #--------------------------------------------------------------------------
  528.   def start_battle
  529.     @height = 0
  530.     @real_x = 0
  531.     @real_y = 0
  532.     @real_zoom = 1.0
  533.     @battler_condition = ""
  534.     @action = nil
  535.     @battle_actions = []
  536.     @battler_action = false
  537.     @step = 0
  538.     @anime_on = false
  539.     @wait_count = 0
  540.     @wait_count2 = 0
  541.     @ox = 0
  542.     @oy = 0
  543.     @pattern = 0
  544.     @pattern_log = true
  545.     @pattern_freeze = false
  546.     @condition_freeze = false
  547.     @active = false
  548.     @move_distance = nil
  549.     @move_wait = 0
  550.     @move_coordinates = [0,0,0,0]
  551.     @flying_distance = nil
  552.     @flying_wait = 0
  553.     @flying_x = 0
  554.     @flying_y = 0
  555.     @flash_flag = {}
  556.     self.flying_clear
  557.   end
  558.   #--------------------------------------------------------------------------
  559.   # ● 移動中判定
  560.   #--------------------------------------------------------------------------
  561.   def moving?
  562.     # X座標補正または、Y座標補正が0でなければ、移動中
  563.     return (@ox != 0 or @oy != 0)
  564.   end
  565.   #--------------------------------------------------------------------------
  566.   # ● 移動終了判定
  567.   #--------------------------------------------------------------------------
  568.   def move_end?
  569.     return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # ● アクション開始設定
  573.   #--------------------------------------------------------------------------
  574.   def action(flag = true)
  575.     @battler_action = flag
  576.     @animation1_on = false
  577.     @animation2_on = false
  578.     @step = "setup"
  579.   end   
  580.   #--------------------------------------------------------------------------
  581.   # ● アクション中判定
  582.   #--------------------------------------------------------------------------
  583.   def action?
  584.     return @battler_action
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # ● 閃き判定
  588.   #--------------------------------------------------------------------------
  589.   def flash?
  590.     return @flash_flg
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ● 戦闘不能判定
  594.   #--------------------------------------------------------------------------
  595.   def anime_dead?
  596.     if $game_temp.in_battle and !RTAB
  597.       if [2,3,4,5].include?($scene.phase4_step)
  598.         return @last_dead
  599.       end
  600.     end
  601.     return @last_dead = self.dead?
  602.   end
  603.   #--------------------------------------------------------------------------
  604.   # ● ピンチ状態判定
  605.   #--------------------------------------------------------------------------
  606.   def crisis?
  607.     if $game_temp.in_battle and !RTAB
  608.       if [2,3,4,5].include?($scene.phase4_step)
  609.         return @last_crisis
  610.       end
  611.     end
  612.     return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ● バッドステート判定
  616.   #--------------------------------------------------------------------------
  617.   def badstate?
  618.     for i in @states
  619.       unless $data_states.nonresistance
  620.         return true
  621.       end
  622.     end
  623.     return false
  624.   end
  625.   #--------------------------------------------------------------------------
  626.   # ● 飛行
  627.   #--------------------------------------------------------------------------
  628.   def fly
  629.     if @fly != nil
  630.       return @fly
  631.     end
  632.     for id in @states
  633.       if FLY_STATES.include?($data_states[id].name)
  634.         return 60
  635.       end
  636.     end
  637.     return 0
  638.   end
  639.   #--------------------------------------------------------------------------
  640.   # ● 遠距離アニメ目標座標の計算
  641.   #--------------------------------------------------------------------------
  642.   def flying_setup
  643.     # 二度目は実行しない
  644.     return if @flying_distance != nil && !camera_correctness
  645.     if RTAB
  646.       targets = @target
  647.     else
  648.       targets = $scene.target_battlers
  649.     end
  650.     # 目的座標を計算
  651.     @f_target_x = 0
  652.     @f_target_y = 0
  653.     for t in targets
  654.       @f_target_x += t.screen_x
  655.       @f_target_y += t.screen_y
  656.     end
  657.     if targets != []
  658.       @f_target_x /= targets.size
  659.       @f_target_y /= targets.size
  660.     else
  661.       @flying_distance = 0
  662.       return
  663.     end
  664.     # 距離の計算
  665.     @flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
  666.   end
  667.   #--------------------------------------------------------------------------
  668.   # ● 遠距離アニメ
  669.   #--------------------------------------------------------------------------
  670.   def flying_animation
  671.     # 戻る
  672.     if @step != "flying" or @flying_distance.nil?
  673.       return [false,true]
  674.     end
  675.     # あらかじめ計算
  676.     self_x = self.screen_x
  677.     self_y = self.screen_y
  678.     @flying_distance = @flying_distance == 0 ? 1 : @flying_distance
  679.     n1 = @flying_wait / @flying_distance.to_f
  680.     if @flying_distance - @flying_wait > @flying_distance / 2
  681.       n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
  682.     else
  683.       n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
  684.     end
  685.     if !@flying_anime[4]
  686.       # 直線移動
  687.       x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  688.       y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
  689.     else
  690.       # 曲線移動
  691.       if !@flying_proceed_end
  692.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  693.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
  694.       else
  695.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  696.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
  697.       end
  698.     end
  699.     # 座標代入
  700.     @flying_x = x
  701.     @flying_y = y
  702.     # ウエイト
  703.     if !@flying_proceed_end
  704.       # 開始
  705.       @flying_proceed_start = @flying_wait == 0
  706.       @flying_wait += @flying_anime[1]
  707.       @flying_wait = [@flying_wait,@flying_distance].min
  708.       @flying_proceed_end = @flying_wait == @flying_distance
  709.     else
  710.       # 開始
  711.       @flying_return_start = @flying_wait == @flying_distance
  712.       @flying_wait -= @flying_anime[1]
  713.       @flying_wait = [@flying_wait,0].max
  714.       @flying_return_end = @flying_wait == 0
  715.     end
  716.     if @flying_anime[1] == 0
  717.       @flying_end = true
  718.     elsif !@flying_anime[2]
  719.       @flying_end = @flying_proceed_end
  720.     else
  721.       @flying_end = @flying_return_end
  722.     end
  723.     # 値を返す(アニメ開始,アニメ終了)
  724.     return [@flying_proceed_start,@flying_end]
  725.   end
  726.   #--------------------------------------------------------------------------
  727.   # ● 遠距離アニメ初期化
  728.   #--------------------------------------------------------------------------
  729.   def flying_clear
  730.     @flying_proceed_start = false
  731.     @flying_proceed_end = false
  732.     @flying_return_start = false
  733.     @flying_return_end = false
  734.     @flying_end = false
  735.     @flying_anime = [0,0,false]
  736.   end
  737.   #--------------------------------------------------------------------------
  738.   # ● 移動
  739.   #--------------------------------------------------------------------------
  740.   def move
  741.     # 距離の計算
  742.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  743.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  744.     if @move_distance > 0
  745.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  746.       array = @move_coordinates
  747.       # ジャンプ補正値の計算
  748.       if @move_distance - @move_wait > @move_distance / 2
  749.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  750.       else
  751.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  752.       end
  753.       jump = @move_action[4] > 0 ? -jump : jump
  754.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  755.       
  756.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  757.       # ウエイト
  758.       @move_wait -= @move_action[3]
  759.       @move_wait = [@move_wait,0].max
  760.     end
  761.   end
  762.   #--------------------------------------------------------------------------
  763.   # ● 移動アクションの取得
  764.   #--------------------------------------------------------------------------
  765.   def get_move_action
  766.     string = @action.split(/#/)[1]
  767.     string = string.split(/,/)
  768.     @move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
  769.   end
  770.   #--------------------------------------------------------------------------
  771.   # ● アクションの取得
  772.   #--------------------------------------------------------------------------
  773.   def get_step
  774.     if @action.nil?
  775.       @step = "finish"
  776.       return
  777.     end
  778.     string = @action.split(/#/)[0]
  779.     if string =~ "移動"
  780.       @step = "moving_setup"
  781.     elsif string =~ "アクターアニメ実行"
  782.       @step = "action"
  783.     elsif string =~ "遠距離アニメ"
  784.       @step = "flying"
  785.     elsif string =~ "アクターアニメ変更"
  786.       @step = "change"
  787.     elsif string =~ "行動アニメ"
  788.       @step = "animation1"
  789.     elsif string =~ "対象アニメ"
  790.       @step = "animation2"
  791.     elsif string =~ "ウエイト"
  792.       @step = "wait"
  793.     elsif string =~ "左右反転"
  794.       @step = "reverse"
  795.     elsif string =~ "閃きアニメ"
  796.       @step = "flash"
  797.     elsif string =~ "残像表示"
  798.       @step = "shadow_on"
  799.     elsif string =~ "残像消去"
  800.       @step = "shadow_off"
  801.     elsif string =~ "アクターアニメ固定"
  802.       @step = "freeze"
  803.     elsif string =~ "アニメ固定解除"
  804.       @step = "freeze_lifting"
  805.     elsif string =~ "アニメーションの表示"
  806.       @step = "animation_start"
  807.     elsif string =~ "SEの演奏"
  808.       @step = "play_se"
  809.     else
  810.       @step = "finish"
  811.     end
  812.   end
  813.   #--------------------------------------------------------------------------
  814.   # ● フレーム更新 (次のアクションへ)
  815.   #--------------------------------------------------------------------------
  816.   def update_next
  817.     @action = @battle_actions.shift
  818.     @step = get_step
  819.   end
  820.   #--------------------------------------------------------------------------
  821.   # ● フレーム更新 (動作取得)
  822.   #--------------------------------------------------------------------------
  823.   def update_setup
  824.     # アクションの取得
  825.     self.get_actions
  826.     @action = @battle_actions.shift
  827.     @step = get_step
  828.   end
  829.   #--------------------------------------------------------------------------
  830.   # ● フレーム更新 (移動取得)
  831.   #--------------------------------------------------------------------------
  832.   def update_moving_setup
  833.     # 移動アクションの取得
  834.     self.get_move_action
  835.     # 移動目標の設定
  836.     self.move_setup
  837.     @step = "moving"
  838.   end
  839.   #--------------------------------------------------------------------------
  840.   # ● フレーム更新 (移動)
  841.   #--------------------------------------------------------------------------
  842.   def update_moving
  843.     # 移動
  844.     self.move
  845.     self.condition = @battler_condition
  846.     # 移動完了したら次のステップへ
  847.     if move_end?
  848.       @wait_count = 2
  849.       @action = @battle_actions.shift
  850.       @step = get_step
  851.     end
  852.   end
  853.   #--------------------------------------------------------------------------
  854.   # ● フレーム更新 (アニメ実行)
  855.   #--------------------------------------------------------------------------
  856.   def update_action
  857.     con = @action.split(/#/)[1]
  858.     # 右手・左手を分ける
  859.     if DUAL_WEAPONS_ANIME.include?(con)
  860.       if !@first_weapon and @second_weapon
  861.         con = con + "_L"
  862.       else
  863.         con = con + "_R"
  864.       end
  865.     end
  866.     # アニメ変更
  867.     self.condition = con
  868.     # ループか否か
  869.     if !ANIME[@battler_condition][1]
  870.       self.anime_on
  871.     end
  872.     @action = @battle_actions.shift
  873.     @step = get_step
  874.   end
  875.   #--------------------------------------------------------------------------
  876.   # ● フレーム更新 (遠距離アニメ)
  877.   #--------------------------------------------------------------------------
  878.   def update_flying
  879.     # 目標の設定
  880.     self.flying_setup
  881.     # 遠距離アニメ終了
  882.     if @flying_end
  883.       self.flying_clear
  884.       @action = @battle_actions.shift
  885.       @step = get_step
  886.     end
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● フレーム更新 (アニメ変更)
  890.   #--------------------------------------------------------------------------
  891.   def update_change
  892.     con = @action.split(/#/)[1]
  893.     # 右手・左手を分ける
  894.     if DUAL_WEAPONS_ANIME.include?(con)
  895.       if !@first_weapon and @second_weapon
  896.         con = con + "_L"
  897.       else
  898.         con = con + "_R"
  899.       end
  900.     end
  901.     # アニメ変更
  902.     self.condition = con
  903.     # ループか否か
  904.     if !ANIME[@battler_condition][1]
  905.       self.anime_on
  906.     end
  907.     @action = @battle_actions.shift
  908.     @step = get_step
  909.   end
  910.   #--------------------------------------------------------------------------
  911.   # ● フレーム更新 (行動アニメ)
  912.   #--------------------------------------------------------------------------
  913.   def update_animation1
  914.     @animation1_on = true
  915.     # 行動アニメの後に行動を開始する
  916.     if $scene.phase4_step == 3
  917.       id = RTAB ? @anime1 : $scene.animation1_id
  918.       animation = $data_animations[id]
  919.       frame_max = animation != nil ? animation.frame_max : 0
  920.       @wait_count2 = frame_max * 2
  921.       return
  922.     end
  923.     @action = @battle_actions.shift
  924.     @step = get_step
  925.   end
  926.   #--------------------------------------------------------------------------
  927.   # ● フレーム更新 (対象アニメ)
  928.   #--------------------------------------------------------------------------
  929.   def update_animation2
  930.     @animation2_on = true
  931.     # 行動アニメの後に行動を開始する
  932.     if $scene.phase4_step == 4
  933.       id = RTAB ? @anime2 : $scene.animation2_id
  934.       animation = $data_animations[id]
  935.       frame_max = animation != nil ? animation.frame_max : 0
  936.       @wait_count2 = frame_max * 2
  937.       return
  938.     end
  939.     @action = @battle_actions.shift
  940.     @step = get_step
  941.   end
  942.   #--------------------------------------------------------------------------
  943.   # ● フレーム更新 (ウエイト)
  944.   #--------------------------------------------------------------------------
  945.   def update_wait
  946.     @wait_count2 = @action.split(/#/)[1].to_i
  947.     @action = @battle_actions.shift
  948.     @step = get_step
  949.   end
  950.   #--------------------------------------------------------------------------
  951.   # ● フレーム更新 (残像表示)
  952.   #--------------------------------------------------------------------------
  953.   def update_shadow_on
  954.     @shadow = true
  955.     @action = @battle_actions.shift
  956.     @step = get_step
  957.   end
  958.   #--------------------------------------------------------------------------
  959.   # ● フレーム更新 (残像消去)
  960.   #--------------------------------------------------------------------------
  961.   def update_shadow_off
  962.     @shadow = false
  963.     @action = @battle_actions.shift
  964.     @step = get_step
  965.   end
  966.   #--------------------------------------------------------------------------
  967.   # ● フレーム更新 (左右反転)
  968.   #--------------------------------------------------------------------------
  969.   def update_reverse
  970.     @reverse = @reverse ? false : true
  971.     @action = @battle_actions.shift
  972.     @step = get_step
  973.   end
  974.   #--------------------------------------------------------------------------
  975.   # ● フレーム更新 (閃きアニメ)
  976.   #--------------------------------------------------------------------------
  977.   def update_flash
  978.     # 閃きアニメの後に行動を開始する
  979.     if @flash_flag["normal"]
  980.       @wait_count = $scene.flash_duration
  981.       @flash_flag["normal"] = false
  982.       return
  983.     end
  984.     @action = @battle_actions.shift
  985.     @step = get_step
  986.   end
  987.   #--------------------------------------------------------------------------
  988.   # ● フレーム更新 (SEの演奏)
  989.   #--------------------------------------------------------------------------
  990.   def update_play_se
  991.     data = @action.split(/#/)[1]
  992.     data = data.split(/,/)
  993.     # SE を演奏
  994.     Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
  995.     @action = @battle_actions.shift
  996.     @step = get_step
  997.   end
  998.   #--------------------------------------------------------------------------
  999.   # ● フレーム更新 (アクターアニメ固定)
  1000.   #--------------------------------------------------------------------------
  1001.   def update_freeze
  1002.     con = @action.split(/#/)[1]
  1003.     # 右手・左手を分ける
  1004.     if DUAL_WEAPONS_ANIME.include?(con)
  1005.       if !@first_weapon and @second_weapon
  1006.         con = con + "_L"
  1007.       else
  1008.         con = con + "_R"
  1009.       end
  1010.     end
  1011.     # アニメ変更
  1012.     self.condition = con
  1013.     @pattern = @action.split(/#/)[2].to_i
  1014.     @pattern_freeze = true
  1015.     @condition_freeze = true
  1016.     @action = @battle_actions.shift
  1017.     @step = get_step
  1018.   end
  1019.   #--------------------------------------------------------------------------
  1020.   # ● フレーム更新 (アクターアニメ固定解除)
  1021.   #--------------------------------------------------------------------------
  1022.   def update_freeze_lifting
  1023.     @pattern_freeze = false
  1024.     @condition_freeze = false
  1025.     @action = @battle_actions.shift
  1026.     @step = get_step
  1027.   end
  1028.   #--------------------------------------------------------------------------
  1029.   # ● フレーム更新 (アニメーションの表示)
  1030.   #--------------------------------------------------------------------------
  1031.   def update_animation_start
  1032.     data = @action.split(/#/)[1]
  1033.     data = data.split(/,/)
  1034.     target = data[0]
  1035.     animation_id = data[1].to_i
  1036.     if RTAB
  1037.       case target
  1038.       when "self"
  1039.         @animation.push([animation_id,true])
  1040.       when "target"
  1041.         for tar in @target
  1042.           tar.animation.push([animation_id, true])
  1043.         end
  1044.       end
  1045.     else
  1046.       case target
  1047.       when "self"
  1048.         @animation_id = animation_id
  1049.         @animation_hit = true
  1050.       when "target"
  1051.         for tar in $scene.target_battlers
  1052.           tar.animation_id = animation_id
  1053.           tar.animation_hit = true
  1054.         end
  1055.       end
  1056.     end
  1057.     @action = @battle_actions.shift
  1058.     @step = get_step
  1059.   end
  1060.   #--------------------------------------------------------------------------
  1061.   # ● フレーム更新 (動作終了)
  1062.   #--------------------------------------------------------------------------
  1063.   def update_finish
  1064.     # 動作終了
  1065.     @battler_action = false
  1066.     @step = "setup"
  1067.   end
  1068.   #--------------------------------------------------------------------------
  1069.   # ● バトラーの状態 変更(バトラーグラフィックのタイプ)
  1070.   #--------------------------------------------------------------------------
  1071.   def condition=(condition)
  1072.     return if @condition_freeze
  1073.     @battler_condition = condition
  1074.     @wait_count = ANIME[condition][2]
  1075.   end
  1076.   #--------------------------------------------------------------------------
  1077.   # ● バトラーの状態(バトラーグラフィックのタイプ)
  1078.   #--------------------------------------------------------------------------
  1079.   def condition
  1080.     return @battler_condition
  1081.   end
  1082.   #--------------------------------------------------------------------------
  1083.   # ● フレーム更新
  1084.   #--------------------------------------------------------------------------
  1085.   def update
  1086.     # ウェイト中の場合
  1087.     if @wait_count > 0
  1088.       return
  1089.     end
  1090.     # パターン更新
  1091.     self.char_animation
  1092.     # ウェイト中の場合
  1093.     if @wait_count2 > 0
  1094.       return
  1095.     end
  1096.    
  1097.     # 行動アニメーション
  1098.     if @battler_action
  1099.       method("update_" + @step).call
  1100.       return
  1101.     end
  1102.    
  1103.     # データ初期化
  1104.     @animation1_on = false
  1105.     @animation2_on = false
  1106.     @action = nil
  1107.     @battle_actions = []
  1108.     @move_wait = 0
  1109.     @move_distance = nil
  1110.     @flying_wait = 0
  1111.     @flying_distance = nil
  1112.     @flash = false

  1113.     # RTAB対応
  1114.     # 通常・待機
  1115.     return self.condition = NORMAL
  1116.   end
  1117.   #--------------------------------------------------------------------------
  1118.   # ● アクションの取得
  1119.   #--------------------------------------------------------------------------
  1120.   def get_actions
  1121.     skill = $data_skills[self.current_action.skill_id]
  1122.     item = $data_items[self.current_action.item_id]
  1123.     kind = self.current_action.kind
  1124.     # 動作取得
  1125.     @battle_actions = []
  1126.     # スキル
  1127.     if skill != nil && kind == 1
  1128.       @battle_actions = skill.battle_actions.dup
  1129.       @flying_anime = skill.flying_anime
  1130.     # アイテム
  1131.     elsif item != nil && kind == 2
  1132.       @battle_actions = item.battle_actions.dup
  1133.       @flying_anime = item.flying_anime
  1134.     # 左手攻撃
  1135.     elsif !@first_weapon and @second_weapon and (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce))

  1136.       @battle_actions = self.battle_actions2.dup
  1137.       @flying_anime = self.flying_anime2
  1138.     # 右手攻撃
  1139.     elsif self.current_action.basic == 0 and
  1140.       (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce)) and self.current_action.kind == 0
  1141.       @battle_actions = self.battle_actions1.dup
  1142.       @flying_anime = self.flying_anime1
  1143.     # 通常攻撃
  1144.     elsif self.current_action.basic == 0 and self.current_action.kind == 0
  1145.       # 这里啊~~ =。=b
  1146.       if !self.is_a?(Game_Actor) and !self.nce
  1147.         @battle_actions = self.battle_actions1.dup
  1148.       else
  1149.         @battle_actions = BattleActions::Actions["エネミー攻撃"].dup
  1150.       end
  1151.       @flying_anime = self.flying_anime
  1152.     else
  1153.       @battle_actions = ["終了"]
  1154.       @flying_anime = [0,0,false,false]
  1155.     end
  1156.   end
  1157.   #--------------------------------------------------------------------------
  1158.   # ● ループしないアニメのセット
  1159.   #--------------------------------------------------------------------------
  1160.   def anime_on
  1161.     @pattern = 0
  1162.     @pattern_log = true
  1163.     return
  1164.   end
  1165.   #--------------------------------------------------------------------------
  1166.   # ● パターン更新
  1167.   #--------------------------------------------------------------------------
  1168.   def char_animation
  1169.     # パタン固定の場合もどる
  1170.     return if @pattern_freeze
  1171.     # ループしないアニメの場合 1234 で止まる
  1172.     if !ANIME[@battler_condition][1] && @pattern == 3
  1173.       return
  1174.     end
  1175.     # アニメさせない場合 1 で止まる
  1176.     if ANIME[@battler_condition][4]
  1177.       @pattern = 0
  1178.       return
  1179.     end
  1180.     @pattern = (@pattern + 1) % 4
  1181.   end
  1182.   #--------------------------------------------------------------------------
  1183.   # ● アニメタイプ
  1184.   #--------------------------------------------------------------------------
  1185.   def anime_type
  1186.     return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  1187.   end
  1188. end
  1189. #==============================================================================
  1190. # ■ Game_Actor
  1191. #==============================================================================
  1192. class Game_Actor < Game_Battler
  1193.   include Side_view
  1194.   #--------------------------------------------------------------------------
  1195.   # ● セットアップ
  1196.   #--------------------------------------------------------------------------
  1197.   alias side_view_setup setup
  1198.   def setup(actor_id)
  1199.     side_view_setup(actor_id)
  1200.     start_battle
  1201.   end
  1202.   #--------------------------------------------------------------------------
  1203.   # ● 二刀武器のID取得 ※エラー回避用
  1204.   #--------------------------------------------------------------------------
  1205.   def weapon2_id
  1206.     return @weapon2_id != nil ? @weapon2_id : 0
  1207.   end
  1208.   #--------------------------------------------------------------------------
  1209.   # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  1210.   #--------------------------------------------------------------------------
  1211.   def position
  1212.     return $data_classes[@class_id].position
  1213.   end
  1214.   #--------------------------------------------------------------------------
  1215.   # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  1216.   #--------------------------------------------------------------------------
  1217.   def position2
  1218.     return self.index
  1219.   end
  1220.   #--------------------------------------------------------------------------
  1221.   # ● 武器アニメタイプ
  1222.   #--------------------------------------------------------------------------
  1223.   def weapon_anime_type(type)
  1224.     file_name  = weapon_anime_type0(type)
  1225.     visible   = weapon_anime_type1(type)
  1226.     z         = weapon_anime_type2(type)
  1227.     return [file_name,visible,z]
  1228.   end
  1229.   # 武器アイコン取得
  1230.   def weapon_anime_type0(type)
  1231.     type = ANIME[type][5]
  1232.     return weapon_anime1 if type == "右手"
  1233.     return weapon_anime2 if type == "左手"
  1234.     return nil
  1235.   end
  1236.   # 表示・非表示の取得
  1237.   def weapon_anime_type1(type)
  1238.     return ANIME[type][3]
  1239.   end
  1240.   # バトラーより上に表示するかどうか
  1241.   def weapon_anime_type2(type)
  1242.     type = ANIME[type][5]
  1243.     return true if type == "左手"
  1244.     return false
  1245.   end
  1246.   #--------------------------------------------------------------------------
  1247.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1248.   #--------------------------------------------------------------------------
  1249.   def true_x
  1250.     return PARTY_X + position * FORMATION_X + @ox
  1251.   end
  1252.   #--------------------------------------------------------------------------
  1253.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1254.   #--------------------------------------------------------------------------
  1255.   def true_y
  1256.     # パーティ内の並び順から Y 座標を計算して返す
  1257.     if self.index != nil
  1258.       y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
  1259.       return y
  1260.     else
  1261.       return 0
  1262.     end
  1263.   end
  1264.   #--------------------------------------------------------------------------
  1265.   # ● バトル画面 X 座標の取得
  1266.   #--------------------------------------------------------------------------
  1267.   def screen_x(true_x = self.true_x)
  1268.     return 320 + (true_x - 320) * @real_zoom + @real_x
  1269.   end
  1270.   #--------------------------------------------------------------------------
  1271.   # ● バトル画面 Y 座標の取得
  1272.   #--------------------------------------------------------------------------
  1273.   def screen_y(true_y = self.true_y)
  1274.     return true_y * @real_zoom + @real_y
  1275.   end
  1276.   #--------------------------------------------------------------------------
  1277.   # ● バトル画面 Z 座標の取得
  1278.   #--------------------------------------------------------------------------
  1279.   def screen_z
  1280.     return screen_y + 1000
  1281.   end
  1282.   #--------------------------------------------------------------------------
  1283.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1284.   #--------------------------------------------------------------------------
  1285.   def base_x
  1286.     return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  1287.   end
  1288.   #--------------------------------------------------------------------------
  1289.   # ● バトル画面 Y 座標の取得
  1290.   #--------------------------------------------------------------------------
  1291.   def base_y
  1292.     return (true_y - @oy) * @real_zoom + @real_y
  1293.   end
  1294.   #--------------------------------------------------------------------------
  1295.   # ● バトル画面 拡大率の取得
  1296.   #--------------------------------------------------------------------------
  1297.   def zoom
  1298.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  1299.                           (true_x + @fly) / 480 + $scene.zoom_rate[0]
  1300.   end
  1301.   #--------------------------------------------------------------------------
  1302.   # ● 攻撃用、バトル画面 X 座標の取得
  1303.   #--------------------------------------------------------------------------
  1304.   def attack_x(z)
  1305.     return (320 - true_x) * z * 0.75
  1306.   end
  1307.   #--------------------------------------------------------------------------
  1308.   # ● 攻撃用、バトル画面 Y 座標の取得
  1309.   #--------------------------------------------------------------------------
  1310.   def attack_y(z)
  1311.     return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  1312.   end
  1313.   #--------------------------------------------------------------------------
  1314.   # ● 閃き待ち時間
  1315.   #--------------------------------------------------------------------------
  1316.   def flash_duration
  1317.     return $scene.flash_duration
  1318.   end
  1319.   #--------------------------------------------------------------------------
  1320.   # ● アニメーション取得
  1321.   #--------------------------------------------------------------------------
  1322.   def battle_actions1
  1323.     weapon = $data_weapons[@weapon_id]
  1324.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1325.   end
  1326.   #--------------------------------------------------------------------------
  1327.   # ● アニメーション取得
  1328.   #--------------------------------------------------------------------------
  1329.   def battle_actions2
  1330.     weapon = $data_weapons[@weapon2_id]
  1331.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1332.   end
  1333.   #--------------------------------------------------------------------------
  1334.   # ● 武器アニメーション取得
  1335.   #--------------------------------------------------------------------------
  1336.   def weapon_anime1
  1337.     weapon = $data_weapons[@weapon_id]
  1338.     return weapon != nil ? weapon.icon_name : ""
  1339.   end
  1340.   #--------------------------------------------------------------------------
  1341.   # ● 武器アニメーション取得
  1342.   #--------------------------------------------------------------------------
  1343.   def weapon_anime2
  1344.     weapon = $data_weapons[@weapon2_id]
  1345.     return weapon != nil ? weapon.icon_name : ""
  1346.   end
  1347.   #--------------------------------------------------------------------------
  1348.   # ● 遠距離アニメーション取得
  1349.   #--------------------------------------------------------------------------
  1350.   def flying_anime1
  1351.     weapon = $data_weapons[@weapon_id]
  1352.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1353.   end
  1354.   #--------------------------------------------------------------------------
  1355.   # ● 遠距離アニメーション取得
  1356.   #--------------------------------------------------------------------------
  1357.   def flying_anime2
  1358.     weapon = $data_weapons[@weapon2_id]
  1359.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1360.   end
  1361.   #--------------------------------------------------------------------------
  1362.   # ● 移動目標座標の計算
  1363.   #--------------------------------------------------------------------------
  1364.   def move_setup
  1365.     if RTAB
  1366.       targets = @target
  1367.     else
  1368.       targets = $scene.target_battlers
  1369.     end
  1370.     case @move_action[0]
  1371.     when "self" # 自分
  1372.       @target_x = self.base_x
  1373.       @target_y = self.base_y
  1374.     when "target_near" # 一番近くのターゲット
  1375.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1376.       targets.reverse!
  1377.       if targets != []
  1378.         @target_x = targets[0].screen_x
  1379.         @target_y = targets[0].screen_y
  1380.       else
  1381.         @target_x = self.base_x
  1382.         @target_y = self.base_y
  1383.       end
  1384.     when "target_far" # 一番遠くのターゲット
  1385.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1386.       if targets != []
  1387.         @target_x = targets[0].screen_x
  1388.         @target_y = targets[0].screen_y
  1389.       else
  1390.         @target_x = self.base_x
  1391.         @target_y = self.base_y
  1392.       end
  1393.     when "target" # ターゲット中央
  1394.       @target_x = 0
  1395.       @target_y = 0
  1396.       for t in targets
  1397.         @target_x += t.screen_x
  1398.         @target_y += t.screen_y
  1399.       end
  1400.       if targets != []
  1401.         @target_x /= targets.size
  1402.         @target_y /= targets.size
  1403.       end
  1404.     when "troop" # "トループ中央"
  1405.       @target_x = 0
  1406.       @target_y = 0
  1407.       for t in $game_troop.enemies
  1408.         @target_x += t.screen_x
  1409.         @target_y += t.screen_y
  1410.       end
  1411.       if $game_troop.enemies != []
  1412.         @target_x /= $game_troop.enemies.size
  1413.         @target_y /= $game_troop.enemies.size
  1414.       end
  1415.     when "party" # "パーティ中央"
  1416.       @target_x = 0
  1417.       @target_y = 0
  1418.       for t in $game_party.actors
  1419.         @target_x += t.screen_x
  1420.         @target_y += t.screen_y
  1421.       end
  1422.       if $game_party.actors != []
  1423.         @target_x /= $game_party.actors.size
  1424.         @target_y /= $game_party.actors.size
  1425.       end
  1426.     when "screen" # "画面"
  1427.       @target_x = self.base_x
  1428.       @target_y = self.base_y
  1429.     end
  1430.     # 補正
  1431.     @target_x += @move_action[1] - self.base_x
  1432.     @target_y += @move_action[2] - self.base_y
  1433.     # 移動目標の座標をセット
  1434.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1435.     # 距離の計算(ウエイトの設定)
  1436.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1437.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1438.   end
  1439. end
  1440. #==============================================================================
  1441. # ■ Game_Enemy
  1442. #==============================================================================
  1443. class Game_Enemy < Game_Battler
  1444.   attr_reader   :nce
  1445.   #--------------------------------------------------------------------------
  1446.   # ● セットアップ
  1447.   #--------------------------------------------------------------------------
  1448.   alias side_view_initialize initialize
  1449.   def initialize(troop_id, member_index)
  1450.     side_view_initialize(troop_id, member_index)
  1451.     start_battle
  1452.     @nce = NOT_CHARACTER_EMEMY.include? @enemy_id
  1453.     @weapon_id  = EMEMY_WEAPO[@enemy_id] != nil ? EMEMY_WEAPO[@enemy_id] : 0
  1454.     @weapon_id2  = EMEMY_WEAPO2[@enemy_id] != nil ? EMEMY_WEAPO2[@enemy_id] : 0
  1455.   end
  1456.   def character_name
  1457.     return self.battler_name
  1458.   end
  1459.   def character_hue
  1460.     return self.battler_hue
  1461.   end
  1462.   #--------------------------------------------------------------------------
  1463.   # ● 移動
  1464.   #--------------------------------------------------------------------------
  1465.   def move
  1466.     # 距離の計算
  1467.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1468.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1469.     if @move_distance > 0
  1470.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  1471.       array = @move_coordinates
  1472.       # ジャンプ補正値の計算
  1473.       if @move_distance - @move_wait > @move_distance / 2
  1474.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  1475.       else
  1476.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  1477.       end
  1478.       jump = @move_action[4] > 0 ? -jump : jump
  1479.       jump = 0 if @weapon_id + @weapon_id2 == 0
  1480.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  1481.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  1482.       # ウエイト
  1483.       @move_wait -= @move_action[3]
  1484.       @move_wait = [@move_wait,0].max
  1485.     end
  1486.   end
  1487.   #--------------------------------------------------------------------------
  1488.   # ● 武器アニメタイプ
  1489.   #--------------------------------------------------------------------------
  1490.   def weapon_anime_type(type)
  1491.     file_name  = weapon_anime_type0(type)
  1492.     visible   = weapon_anime_type1(type)
  1493.     z         = weapon_anime_type2(type)
  1494.     return [file_name,visible,z]
  1495.   end
  1496.   # 武器アイコン取得
  1497.   def weapon_anime_type0(type)
  1498.     type = ANIME[type][5]
  1499.     return weapon_anime1 if type == "右手"
  1500.     return weapon_anime2 if type == "左手"
  1501.     return nil
  1502.   end
  1503.   # 表示・非表示の取得
  1504.   def weapon_anime_type1(type)
  1505.     return ANIME[type][3]
  1506.   end
  1507.   # バトラーより上に表示するかどうか
  1508.   def weapon_anime_type2(type)
  1509.     type = ANIME[type][5]
  1510.     return true if type == "左手"
  1511.     return false
  1512.   end

  1513.   #--------------------------------------------------------------------------
  1514.   # ● 移動目標座標の計算
  1515.   #--------------------------------------------------------------------------
  1516.   def move_setup
  1517.     if RTAB
  1518.       targets = @target
  1519.     else
  1520.       targets = $scene.target_battlers
  1521.     end
  1522.     case @move_action[0]
  1523.     when "self" # 自分
  1524.       @target_x = self.base_x
  1525.       @target_y = self.base_y
  1526.     when "target_near" # 一番近くのターゲット
  1527.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1528.       if targets != []
  1529.         @target_x = targets[0].screen_x
  1530.         @target_y = targets[0].screen_y
  1531.       else
  1532.         @target_x = self.base_x
  1533.         @target_y = self.base_y
  1534.       end
  1535.     when "target_far" # 一番遠くのターゲット
  1536.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1537.       targets.reverse!
  1538.       if targets != []
  1539.         @target_x = targets[0].screen_x
  1540.         @target_y = targets[0].screen_y
  1541.       else
  1542.         @target_x = self.base_x
  1543.         @target_y = self.base_y
  1544.       end
  1545.     when "target" # ターゲット中央
  1546.       @target_x = 0
  1547.       @target_y = 0
  1548.       for t in targets
  1549.         @target_x += t.screen_x
  1550.         @target_y += t.screen_y
  1551.       end
  1552.       if targets != []
  1553.         @target_x /= targets.size
  1554.         @target_y /= targets.size
  1555.       end
  1556.     when  "party" # "トループ中央"
  1557.       @target_x = 0
  1558.       @target_y = 0
  1559.       for t in $game_troop.enemies
  1560.         @target_x += t.screen_x
  1561.         @target_y += t.screen_y
  1562.       end
  1563.       if $game_troop.enemies != []
  1564.         @target_x /= $game_troop.enemies.size
  1565.         @target_y /= $game_troop.enemies.size
  1566.       end
  1567.     when "troop" # "パーティ中央"
  1568.       @target_x = 0
  1569.       @target_y = 0
  1570.       for t in $game_party.actors
  1571.         @target_x += t.screen_x
  1572.         @target_y += t.screen_y
  1573.       end
  1574.       if $game_party.actors != []
  1575.         @target_x /= $game_party.actors.size
  1576.         @target_y /= $game_party.actors.size
  1577.       end
  1578.     when "screen" # "画面"
  1579.       @target_x = self.base_x
  1580.       @target_y = self.base_y
  1581.     end
  1582.     # 補正
  1583.     @target_x -= @move_action[1] + self.base_x
  1584.     @target_y -= @move_action[2] + self.base_y
  1585.     # 移動目標の座標をセット
  1586.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1587.     # 距離の計算(ウエイトの設定)
  1588.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1589.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1590.   end
  1591.   if RTAB
  1592.   alias original_x true_x
  1593.   alias original_y true_y
  1594.   else
  1595.   alias original_x screen_x
  1596.   alias original_y screen_y
  1597.   end
  1598.   #--------------------------------------------------------------------------
  1599.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1600.   #--------------------------------------------------------------------------
  1601.   def true_x
  1602.     return original_x + @ox
  1603.   end
  1604.   #--------------------------------------------------------------------------
  1605.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1606.   #--------------------------------------------------------------------------
  1607.   def true_y
  1608.     return original_y - @height / 2 + @oy
  1609.   end
  1610.   #--------------------------------------------------------------------------
  1611.   # ● バトル画面 X 座標の取得
  1612.   #--------------------------------------------------------------------------
  1613.   def screen_x(true_x = self.true_x)
  1614.     return true_x * @real_zoom + @real_x
  1615.   end
  1616.   #--------------------------------------------------------------------------
  1617.   # ● バトル画面 Y 座標の取得
  1618.   #--------------------------------------------------------------------------
  1619.   def screen_y(true_y = self.true_y)
  1620.     return true_y * @real_zoom + @real_y
  1621.   end
  1622.   #--------------------------------------------------------------------------
  1623.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1624.   #--------------------------------------------------------------------------
  1625.   def base_x(true_x = self.true_x)
  1626.     return (true_x - @ox) * @real_zoom + @real_x
  1627.   end
  1628.   #--------------------------------------------------------------------------
  1629.   # ● バトル画面 Y 座標の取得(移動などしていない場合)
  1630.   #--------------------------------------------------------------------------
  1631.   # ● アニメーション取得
  1632.   #--------------------------------------------------------------------------
  1633.   def battle_actions1
  1634.     weapon = $data_weapons[@weapon_id]
  1635.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1636.   end
  1637.   #--------------------------------------------------------------------------
  1638.   # ● アニメーション取得
  1639.   #--------------------------------------------------------------------------
  1640.   def battle_actions2
  1641.     weapon = $data_weapons[@weapon2_id]
  1642.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1643.   end
  1644.   #--------------------------------------------------------------------------
  1645.   # ● 武器アニメーション取得
  1646.   #--------------------------------------------------------------------------
  1647.   def weapon_anime1
  1648.     weapon = $data_weapons[@weapon_id]
  1649.     return weapon != nil ? weapon.icon_name : ""
  1650.   end
  1651.   #--------------------------------------------------------------------------
  1652.   # ● 武器アニメーション取得
  1653.   #--------------------------------------------------------------------------
  1654.   def weapon_anime2
  1655.     weapon = $data_weapons[@weapon2_id]
  1656.     return weapon != nil ? weapon.icon_name : ""
  1657.   end
  1658.   #--------------------------------------------------------------------------
  1659.   # ● 遠距離アニメーション取得
  1660.   #--------------------------------------------------------------------------
  1661.   def flying_anime1
  1662.     weapon = $data_weapons[@weapon_id]
  1663.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1664.   end
  1665.   #--------------------------------------------------------------------------
  1666.   # ● 遠距離アニメーション取得
  1667.   #--------------------------------------------------------------------------
  1668.   def flying_anime2
  1669.     weapon = $data_weapons[@weapon2_id]
  1670.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1671.   end
  1672.   def base_y(true_y = self.true_y)
  1673.     return (true_y - @oy) * @real_zoom + @real_y
  1674.   end
  1675.   #--------------------------------------------------------------------------

  1676.   
  1677.   
  1678.   #--------------------------------------------------------------------------
  1679.   # ● アニメーション取得
  1680.   #--------------------------------------------------------------------------
  1681.   def battle_actions1
  1682.     weapon = $data_weapons[@weapon_id]
  1683.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1684.   end
  1685.   #--------------------------------------------------------------------------
  1686.   # ● アニメーション取得
  1687.   #--------------------------------------------------------------------------
  1688.   def battle_actions2
  1689.     weapon = $data_weapons[@weapon2_id]
  1690.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1691.   end
  1692.   #--------------------------------------------------------------------------
  1693.   # ● 武器アニメーション取得
  1694.   #--------------------------------------------------------------------------
  1695.   def weapon_anime1
  1696.     weapon = $data_weapons[@weapon_id]
  1697.     return weapon != nil ? weapon.icon_name : ""
  1698.   end
  1699.   #--------------------------------------------------------------------------
  1700.   # ● 武器アニメーション取得
  1701.   #--------------------------------------------------------------------------
  1702.   def weapon_anime2
  1703.     weapon = $data_weapons[@weapon2_id]
  1704.     return weapon != nil ? weapon.icon_name : ""
  1705.   end
  1706.   #--------------------------------------------------------------------------
  1707.   # ● 遠距離アニメーション取得
  1708.   #--------------------------------------------------------------------------
  1709.   def flying_anime1
  1710.     weapon = $data_weapons[@weapon_id]
  1711.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1712.   end
  1713.   #--------------------------------------------------------------------------
  1714.   # ● 遠距離アニメーション取得
  1715.   #--------------------------------------------------------------------------
  1716.   def flying_anime2
  1717.     weapon = $data_weapons[@weapon2_id]
  1718.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1719.   end  
  1720. end
  1721. #==============================================================================
  1722. # ■ Game_Party
  1723. #==============================================================================
  1724. class Game_Party
  1725.   #--------------------------------------------------------------------------
  1726.   # ● アクターを加える
  1727.   #     actor_id : アクター ID
  1728.   #--------------------------------------------------------------------------
  1729.   alias side_view_add_actor add_actor
  1730.   def add_actor(actor_id)
  1731.     # アクターを取得
  1732.     actor = $game_actors[actor_id]
  1733.     # サイドビューデータの初期化
  1734.     actor.start_battle
  1735.     # 戻す
  1736.     side_view_add_actor(actor_id)
  1737.   end
  1738. end

  1739. class Spriteset_Battle
  1740.   include Side_view
  1741.   #--------------------------------------------------------------------------
  1742.   # ● オブジェクト初期化
  1743.   #--------------------------------------------------------------------------
  1744.   alias side_veiw_initialize initialize
  1745.   def initialize
  1746.     side_veiw_initialize
  1747.     # アクタースプライトを解放
  1748.     for sprite in @actor_sprites
  1749.       sprite.dispose
  1750.     end
  1751.     # アクタースプライトを作成
  1752.     @actor_sprites = []
  1753.     for i in 1..Party_max
  1754.       @actor_sprites.push(Sprite_Battler.new(@viewport1))
  1755.     end
  1756.     update
  1757.   end
  1758.   #--------------------------------------------------------------------------
  1759.   # ● 画面のスクロール
  1760.   #--------------------------------------------------------------------------
  1761.   if method_defined?("screen_scroll")
  1762.   alias side_view_screen_scroll screen_scroll
  1763.   def screen_scroll
  1764.     side_view_screen_scroll
  1765.     # アクターの位置補正
  1766.     for actor in $game_party.actors
  1767.       actor.real_x = @real_x
  1768.       actor.real_y = @real_y
  1769.       actor.real_zoom = @real_zoom
  1770.     end
  1771.   end
  1772.   end
  1773. end

  1774. class Sprite_Battler < RPG::Sprite
  1775.   include Side_view
  1776.   #--------------------------------------------------------------------------
  1777.   # ● オブジェクト初期化
  1778.   #     viewport : ビューポート
  1779.   #     battler  : バトラー (Game_Battler)
  1780.   #--------------------------------------------------------------------------
  1781.   def initialize(viewport, battler = nil)
  1782.     super(viewport)
  1783.     @battler = battler
  1784.     @battler_visible = false
  1785.     @weapon = Sprite_Weapon.new(viewport, battler)
  1786.     @flying = Sprite_Flying.new(viewport, battler)
  1787.     @shadow = []
  1788.     @fly = 0
  1789.     @fly_direction = 1
  1790.     @rand = rand(10)
  1791.     self.effect_clear
  1792.   end
  1793.   #--------------------------------------------------------------------------
  1794.   # ● 解放
  1795.   #--------------------------------------------------------------------------
  1796.   alias side_view_dispose dispose
  1797.   def dispose
  1798.     side_view_dispose
  1799.     @weapon.dispose
  1800.     @flying.dispose
  1801.     if @_target_sprite != nil
  1802.       @_target_sprite.bitmap.dispose
  1803.       @_target_sprite.dispose
  1804.       @_target_sprite = nil
  1805.     end
  1806.   end
  1807.   #--------------------------------------------------------------------------
  1808.   # ● フレーム更新
  1809.   #--------------------------------------------------------------------------
  1810.   def update
  1811.     super
  1812.     # バトラーが nil の場合
  1813.     if @battler == nil
  1814.       self.bitmap = nil
  1815.       @weapon.bitmap = nil
  1816.       loop_animation(nil)
  1817.       return
  1818.     end
  1819.     # バトラー更新
  1820.     @battler.update
  1821.     # バトラーアニメのデータ取得
  1822.     @anime_type = @battler.anime_type
  1823.     # ファイル名か色相が現在のものと異なる場合
  1824.     if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
  1825.       change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
  1826.     elsif @battler.is_a?(Game_Enemy)
  1827.       change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
  1828.     else
  1829.       return
  1830.     end
  1831.     if change
  1832.       # ビットマップを取得、設定
  1833.       if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
  1834.         @battler_name = @battler.character_name
  1835.         @battler_hue = @battler.character_hue
  1836.         self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
  1837.         @width = bitmap.width / 4
  1838.         @height = bitmap.height / 4
  1839.       else
  1840.         @battler_name = @battler.battler_name
  1841.         @battler_hue = @battler.battler_hue
  1842.         self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1843.         @width = bitmap.width
  1844.         @height = bitmap.height
  1845.       end
  1846.       self.ox = @width / 2
  1847.       self.oy = @height / 2
  1848.       @battler.height = @height
  1849.       @flag = true
  1850.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  1851.       if @battler.dead? or @battler.hidden
  1852.         self.opacity = 0
  1853.       end
  1854.     end
  1855.     if (@battler.is_a?(Game_Actor) and
  1856.       (@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)) or
  1857.       ([email protected]_a?(Game_Actor) and [email protected])
  1858.       # ビットマップを取得、設定
  1859.       @pattern = @battler.pattern
  1860.       self.ox = @width / 2
  1861.       self.oy = @height / 2
  1862.       @sx = @pattern * @width
  1863.       sy = @anime_type % 4 * @height
  1864.       x   = sy / (@height * 2) + 4
  1865.       if [email protected]_a?(Game_Actor) and [email protected] and x == 4
  1866.         x = 6
  1867.       end    # here!!
  1868.       @sy = (x - 2) / 2 * @height
  1869.       self.src_rect.set(@sx, @sy, @width, @height)
  1870.       self.zoom_x = CHAR_ZOOM
  1871.       self.zoom_y = CHAR_ZOOM
  1872.       @battler.height = @height
  1873.       @flag = false
  1874.     end
  1875.     # 飛行
  1876.     update_fly
  1877.     # シェイク
  1878.     update_shake
  1879.     # 回転
  1880.     update_turning
  1881.     # 反転
  1882.     update_reverse   
  1883.     # 移動
  1884.     update_moving
  1885.     # 追加アニメ
  1886.     update_add_anime
  1887.     # エフェクト効果の適用
  1888.     update_effect
  1889.     # アニメーション ID が現在のものと異なる場合
  1890.     flag = RTAB ? true : @battler.damage == nil
  1891.     if flag and @battler.state_animation_id != @state_animation_id
  1892.       @state_animation_id = @battler.state_animation_id
  1893.       loop_animation($data_animations[@state_animation_id])
  1894.     end
  1895.     # シェイク
  1896.     if @battler.shake
  1897.       self.start_shake(5, 5, 5)
  1898.       @battler.shake = false
  1899.     end
  1900.     # 明滅
  1901.     if @battler.blink
  1902.       blink_on
  1903.     else
  1904.       blink_off
  1905.     end
  1906.     # 不可視の場合
  1907.     unless @battler_visible
  1908.       flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
  1909.                     (@battler.damage == nil or @battler.damage_pop)
  1910.       # 出現
  1911.       if not @battler.hidden and not @battler.dead? and flag
  1912.         appear
  1913.         @battler_visible = true
  1914.       end
  1915.     end
  1916.     if RTAB
  1917.     # ダメージ
  1918.     for battler in @battler.damage_pop
  1919.       if battler[0].class == Array
  1920.         if battler[0][1] >= 0
  1921.           $scene.skill_se
  1922.         else
  1923.           $scene.levelup_se
  1924.         end
  1925.         damage(@battler.damage[battler[0]], false, 2)
  1926.       else
  1927.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  1928.       end
  1929.       if @battler.damage_sp.include?(battler[0])
  1930.         damage(@battler.damage_sp[battler[0]],
  1931.                 @battler.critical[battler[0]], 1)
  1932.         @battler.damage_sp.delete(battler[0])
  1933.       end
  1934.       @battler.damage_pop.delete(battler[0])
  1935.       @battler.damage.delete(battler[0])
  1936.       @battler.critical.delete(battler[0])
  1937.     end
  1938.     end
  1939.     # 可視の場合
  1940.     if @battler_visible
  1941.       # 武器アニメ
  1942.       @weapon.battler = @battler
  1943.       @weapon.update
  1944.       # 遠距離アニメ
  1945.       @flying.battler = @battler
  1946.       @flying.update
  1947.       # 逃走
  1948.       if @battler.hidden
  1949.         $game_system.se_play($data_system.escape_se)
  1950.         escape
  1951.         @battler_visible = false
  1952.       end
  1953.       # 白フラッシュ
  1954.       if @battler.white_flash
  1955.         whiten
  1956.         @battler.white_flash = false
  1957.       end
  1958.       if RTAB
  1959.       # アニメーション
  1960.       if [email protected]?
  1961.         for animation in @battler.animation.reverse
  1962.           if animation[2]
  1963.             animation($data_animations[animation[0]], animation[1], true)
  1964.           else
  1965.             animation($data_animations[animation[0]], animation[1])
  1966.           end
  1967.           @battler.animation.delete(animation)
  1968.         end
  1969.       end
  1970.       else
  1971.       # アニメーション
  1972.       if @battler.animation_id != 0
  1973.         animation = $data_animations[@battler.animation_id]
  1974.         animation(animation, @battler.animation_hit)
  1975.         @battler.animation_id = 0
  1976.       end
  1977.       end
  1978.       # ダメージ
  1979.       if !RTAB and @battler.damage_pop
  1980.         damage(@battler.damage, @battler.critical)
  1981.         @battler.damage = nil
  1982.         @battler.critical = false
  1983.         @battler.damage_pop = false
  1984.       end
  1985.       flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
  1986.                      @battler.damage == nil
  1987.       # コラプス
  1988.       if flag and @battler.dead?
  1989.         if @battler.is_a?(Game_Actor)
  1990.           $game_system.se_play($data_system.actor_collapse_se)
  1991.         elsif @battler.is_a?(Game_Enemy)
  1992.           $game_system.se_play($data_system.enemy_collapse_se)
  1993.         end
  1994.         collapse
  1995.         @battler_visible = false
  1996.       end
  1997.     end
  1998.     # スプライトの座標を設定
  1999.     self.x = @battler.screen_x + @effect_ox
  2000.     self.y = @battler.screen_y + @effect_oy
  2001.     self.z = @battler.screen_z
  2002.     self.zoom_x = @battler.real_zoom
  2003.     self.zoom_y = @battler.real_zoom
  2004.     # ウェイトカウントを減らす
  2005.     @battler.wait_count -= 1
  2006.     @battler.wait_count2 -= 1
  2007.     # アニメーション待ち時間取得
  2008.     @battler.animation_duration = @_animation_duration
  2009.     if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
  2010.       self.zoom_x *= CHAR_ZOOM
  2011.       self.zoom_y *= CHAR_ZOOM
  2012.       @weapon.x = self.x + 2
  2013.       @weapon.y = self.y + 6
  2014.       @weapon.angle = 75 - (4 - @battler.pattern) * 45
  2015.       if self.mirror
  2016.         @weapon.angle += @weapon.angle - 180
  2017.       end
  2018.       if ([email protected]_a?(Game_Actor) and [email protected])
  2019.         @weapon.angle = [email protected]
  2020.       end
  2021.     end
  2022.     # 残像
  2023.     if @battler.shadow
  2024.       if Graphics.frame_count % 2 == 0
  2025.         shadow = ::Sprite.new(self.viewport)
  2026.         shadow.bitmap = self.bitmap.dup
  2027.         shadow.x = self.x
  2028.         shadow.y = self.y
  2029.         shadow.ox = self.ox
  2030.         shadow.oy = self.oy
  2031.         shadow.mirror = self.mirror
  2032.         shadow.angle = self.angle
  2033.         shadow.opacity = 160
  2034.         shadow.zoom_x = self.zoom_x
  2035.         shadow.zoom_y = self.zoom_y
  2036.         if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
  2037.           shadow.src_rect.set(@sx, @sy, @width, @height)
  2038.         else
  2039.           shadow.src_rect.set(0, 0, @width, @height)
  2040.         end
  2041.         @shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
  2042.       end
  2043.     end
  2044.     for s in @shadow
  2045.       if !s[0].disposed?
  2046.         s[0].update
  2047.         s[1] -= 1
  2048.         if s[1] < 1
  2049.           if s[0].bitmap != nil
  2050.             s[0].bitmap.dispose
  2051.           end
  2052.           s[0].dispose
  2053.         else
  2054.           s[0].x = @battler.screen_x(s[2])
  2055.           s[0].y = @battler.screen_y(s[3])
  2056.         end
  2057.       else
  2058.         s = nil
  2059.       end
  2060.     end
  2061.     @shadow.compact!
  2062.   end
  2063.   #--------------------------------------------------------------------------
  2064.   # ● エフェクトによる座標系の更新
  2065.   #--------------------------------------------------------------------------
  2066.   def update_effect
  2067.     # 角度の修正
  2068.     if @_upside_down
  2069.       self.angle = (@_turning + 180) % 360
  2070.     else
  2071.       self.angle = @_turning
  2072.     end
  2073.     # X 座標の修正値
  2074.     @effect_ox = @_shake + @_moving[0]
  2075.     # Y 座標の修正値
  2076.     @effect_oy = -@fly + @_moving[1]
  2077.     if  @_animation == nil or (RTAB and @_animation.empty?)
  2078.       self.effect_clear
  2079.     end
  2080.   end
  2081.   #--------------------------------------------------------------------------
  2082.   # ● シェイク更新
  2083.   #--------------------------------------------------------------------------
  2084.   def update_shake
  2085.     if @_shake_duration >= 1 or @_shake != 0
  2086.       delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
  2087.       if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
  2088.         @_shake = 0
  2089.       else
  2090.         @_shake += delta
  2091.       end
  2092.       if @_shake > @_shake_power * 2
  2093.         @_shake_direction = -1
  2094.       end
  2095.       if @_shake < - @_shake_power * 2
  2096.         @_shake_direction = 1
  2097.       end
  2098.       if @_shake_duration >= 1
  2099.         @_shake_duration -= 1
  2100.       end
  2101.     end
  2102.   end
  2103.   #--------------------------------------------------------------------------
  2104.   # ● 飛行更新
  2105.   #--------------------------------------------------------------------------
  2106.   def update_fly
  2107.     if @rand > 0
  2108.       @rand -= 1
  2109.       return
  2110.     end
  2111.     if @battler.fly != 0
  2112.       if @fly < @battler.fly / 4
  2113.         @fly_direction = 1
  2114.       elsif @fly > @battler.fly / 2
  2115.         @fly_direction = -1
  2116.       end
  2117.       @fly += 0.5 * @fly_direction
  2118.     end
  2119.   end
  2120.   #--------------------------------------------------------------------------
  2121.   # ● 回転更新
  2122.   #--------------------------------------------------------------------------
  2123.   def update_turning
  2124.     if @_turning_duration > 0 or @_turning != 0
  2125.       @_turning += @_turning_direction * @_turning_speed / 2.0
  2126.       # 残り回転数を減らす
  2127.       if @_turning_direction == -1
  2128.         if @_turning_duration > 0 and @_turning < 0
  2129.           @_turning_duration -= 1
  2130.         end
  2131.       elsif @_turning_direction == 1
  2132.         if @_turning_duration > 0 and @_turning >= 360
  2133.           @_turning_duration -= 1
  2134.         end
  2135.       end
  2136.       # 以下補正
  2137.       while @_turning < 0
  2138.         @_turning += 360
  2139.       end
  2140.       if @_turning_duration <= 0
  2141.         @_turning = 0
  2142.       end
  2143.       @_turning %= 360
  2144.     end
  2145.   end
  2146.   #--------------------------------------------------------------------------
  2147.   # ● 左右反転更新
  2148.   #--------------------------------------------------------------------------
  2149.   def update_reverse
  2150.     if @last_reverse != (@_reverse or @battler.reverse)
  2151.       self.mirror = (@_reverse or @battler.reverse)
  2152.       @last_reverse = (@_reverse or @battler.reverse)
  2153.     end
  2154.   end
  2155.   #--------------------------------------------------------------------------
  2156.   # ● 移動更新
  2157.   #--------------------------------------------------------------------------
  2158.   def update_moving
  2159.     @move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2160.                      (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2161.     if @move_distance > 0
  2162.       return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
  2163.       array = @_move_coordinates
  2164.       x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2165.       y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2166.       @_moving = [x, y]
  2167.       if @_move_quick_return and @_move_duration == 0
  2168.         @_move_coordinates = [0,0,array[0],array[1]]
  2169.         @_move_duration = @move_distance
  2170.       end
  2171.       @_move_duration -= @_move_speed
  2172.       @_move_duration = [@_move_duration, 0].max
  2173.     end
  2174.   end
  2175.   #--------------------------------------------------------------------------
  2176.   # ● 追加アニメ更新 (RTAB限定機能)
  2177.   #--------------------------------------------------------------------------
  2178.   def update_add_anime
  2179.     if RTAB
  2180.     # アニメーション
  2181.     if @_add_anime_id != 0
  2182.       animation = $data_animations[@_add_anime_id]
  2183.       animation(animation, true)
  2184.       @_add_anime_id = 0
  2185.     end
  2186.     end
  2187.   end
  2188.   #--------------------------------------------------------------------------
  2189.   # ● エフェクト初期化
  2190.   #--------------------------------------------------------------------------
  2191.   def effect_clear
  2192.     @_effect_ox = 0
  2193.     @_effect_oy = 0
  2194.     @_shake_power = 0
  2195.     @_shake_speed = 0
  2196.     @_shake_duration = 0
  2197.     @_shake_direction = 1
  2198.     @_shake = 0
  2199.     @_upside_down = false
  2200.     @_reverse = false
  2201.     @_turning_direction = 1
  2202.     @_turning_speed = 0
  2203.     @_turning_duration = 0
  2204.     @_turning = 0
  2205.     @_move_quick_return = true
  2206.     @_move_speed = 0
  2207.     @_move_coordinates = [0,0,0,0]
  2208.     @_move_jump = false
  2209.     @_move_duration = 0
  2210.     @_moving = [0,0]
  2211.     @_add_anime_id = 0
  2212.   end
  2213.   #--------------------------------------------------------------------------
  2214.   # ● シェイクの開始
  2215.   #     power    : 強さ
  2216.   #     speed    : 速さ
  2217.   #     duration : 時間
  2218.   #--------------------------------------------------------------------------
  2219.   def start_shake(power, speed, duration)
  2220.     @_shake_power = power
  2221.     @_shake_speed = speed
  2222.     @_shake_duration = duration
  2223.   end
  2224.   #--------------------------------------------------------------------------
  2225.   # ● 上下反転を開始
  2226.   #--------------------------------------------------------------------------
  2227.   def start_upside_down
  2228.     @_upside_down = @_upside_down ? false : true
  2229.   end
  2230.   #--------------------------------------------------------------------------
  2231.   # ● 左右反転を開始
  2232.   #--------------------------------------------------------------------------
  2233.   def start_reverse
  2234.     @_reverse = @_reverse ? false : true
  2235.   end
  2236.   #--------------------------------------------------------------------------
  2237.   # ● 回転を開始
  2238.   #     direction: 方向
  2239.   #     speed    : 速さ
  2240.   #     duration : 時間
  2241.   #--------------------------------------------------------------------------
  2242.   def start_turning(direction, speed, duration)
  2243.     @_turning_direction = direction
  2244.     @_turning_speed = speed
  2245.     @_turning_duration = duration
  2246.     @_turning = @_turning_direction == 1 ? 0 : 360
  2247.   end
  2248.   #--------------------------------------------------------------------------
  2249.   # ● 移動を開始
  2250.   #     quick_return : 戻るかどうか
  2251.   #     speed        : 速さ
  2252.   #     x            : X 座標
  2253.   #     y            : Y 座標
  2254.   #--------------------------------------------------------------------------
  2255.   def start_moving(quick_return, speed, x, y)
  2256.     @_move_quick_return = quick_return == 0 ? false : true
  2257.     @_move_speed = speed
  2258.     @_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
  2259.     distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2260.                (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2261.     @_move_duration = distance
  2262.   end
  2263.   #--------------------------------------------------------------------------
  2264.   # ● アニメ追加を開始
  2265.   #     id           : ID
  2266.   #     hit          : 命中フラッグ
  2267.   #--------------------------------------------------------------------------
  2268.   def start_add_anime(id)
  2269.     @_add_anime_id = id
  2270.   end
  2271.   #--------------------------------------------------------------------------
  2272.   # ● 各種エフェクトの開始判定
  2273.   #--------------------------------------------------------------------------
  2274.   if !method_defined?("side_view_animation_process_timing")
  2275.     alias side_view_animation_process_timing animation_process_timing
  2276.   end
  2277.   def animation_process_timing(timing, hit)
  2278.     side_view_animation_process_timing(timing, hit)
  2279.     if (timing.condition == 0) or
  2280.        (timing.condition == 1 and hit == true) or
  2281.        (timing.condition == 2 and hit == false)
  2282.       if timing.se.name =~ SHAKE_FILE
  2283.         names = timing.se.name.split(/#/)
  2284.         power    = names[1].nil? ? SHAKE_POWER    : names[1].to_i
  2285.         speed    = names[2].nil? ? SHAKE_SPEED    : names[2].to_i
  2286.         duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
  2287.         # シェイクを開始
  2288.         self.start_shake(power, speed, duration)
  2289.       end
  2290.       if timing.se.name == UPSIDE_DOWN_FILE
  2291.         # 上下反転を開始
  2292.         self.start_upside_down
  2293.       end
  2294.       if timing.se.name == REVERSE_FILE
  2295.         # 左右反転を開始
  2296.         self.start_reverse
  2297.       end
  2298.       if timing.se.name =~ TURNING_FILE
  2299.         names = timing.se.name.split(/#/)
  2300.         direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
  2301.         speed     = names[2].nil? ? TURNING_SPEED     : names[2].to_i
  2302.         duration  = names[3].nil? ? TURNING_DURATION  : names[3].to_i
  2303.         # 回転を開始
  2304.         self.start_turning(direction, speed, duration)
  2305.       end
  2306.       if timing.se.name =~ MOVE_FILE
  2307.         names = timing.se.name.split(/#/)
  2308.         quick_return= names[1].nil? ? MOVE_RETURN      : names[1].to_i
  2309.         speed       = names[2].nil? ? MOVE_SPEED       : names[2].to_i
  2310.         x           = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
  2311.         y           = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
  2312.         # 移動を開始
  2313.         self.start_moving(quick_return, speed, x, y)
  2314.       end
  2315.       if timing.se.name =~ ADD_ANIME_FILE
  2316.         names = timing.se.name.split(/#/)
  2317.         id = names[1].nil? ? ADD_ANIME_ID      : names[1].to_i
  2318.         # アニメ追加を開始
  2319.         self.start_add_anime(id)
  2320.       end
  2321.     end
  2322.   end
  2323. end

  2324. #==============================================================================
  2325. # ■ Sprite_Weapon
  2326. #------------------------------------------------------------------------------
  2327. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2328. # スプライトの状態を自動的に変化させます。
  2329. #==============================================================================

  2330. class Sprite_Weapon < RPG::Sprite
  2331.   include Side_view
  2332.   #--------------------------------------------------------------------------
  2333.   # ● 公開インスタンス変数
  2334.   #--------------------------------------------------------------------------
  2335.   attr_accessor :battler                  # バトラー
  2336.   attr_reader   :cw                       # グラフィックの幅
  2337.   attr_reader   :ch                       # グラフィックの高さ
  2338.   #--------------------------------------------------------------------------
  2339.   # ● オブジェクト初期化
  2340.   #     viewport : ビューポート
  2341.   #     battler  : バトラー (Game_Battler)
  2342.   #--------------------------------------------------------------------------
  2343.   def initialize(viewport, battler = nil)
  2344.     super(viewport)
  2345.     @battler = battler
  2346.     @battler_visible = false
  2347.   end
  2348.   #--------------------------------------------------------------------------
  2349.   # ● 解放
  2350.   #--------------------------------------------------------------------------
  2351.   def dispose
  2352.     if self.bitmap != nil
  2353.       self.bitmap.dispose
  2354.     end
  2355.     super
  2356.   end
  2357.   #--------------------------------------------------------------------------
  2358.   # ● フレーム更新
  2359.   #--------------------------------------------------------------------------
  2360.   def update
  2361.     super
  2362.     # バトラーが nil の場合
  2363.     if @battler == nil or ([email protected]_a?(Game_Actor) and @battler.nce)
  2364.       self.bitmap = nil
  2365.       return
  2366.     end
  2367.     # ウエポンアニメのデータ取得
  2368.     @weapon_anime_type = @battler.weapon_anime_type(@battler.condition)
  2369.     # 設定が「非表示」の場合
  2370.     if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
  2371.       self.visible = false
  2372.       return
  2373.     else
  2374.       self.visible = true
  2375.     end
  2376.     # ファイル名が現在のものと異なる場合
  2377.     if @weapon_anime_type[0] != @weapon_name
  2378.       @weapon_name = @weapon_anime_type[0]
  2379.       # ビットマップを取得、設定
  2380.       self.bitmap = RPG::Cache.icon(@weapon_name)
  2381.       @width = bitmap.width
  2382.       @height = bitmap.height
  2383.       @flag = true
  2384.     end
  2385.     # 現在アニメパターンが現在のものと異なる場合
  2386.     if @pattern != @battler.pattern or @flag or @condition != @battler.condition
  2387.       @pattern = @battler.pattern
  2388.       @condition = @battler.condition
  2389.       self.ox = @width
  2390.       self.oy = @height
  2391.       self.z = battler.screen_z
  2392.       self.zoom_x = @battler.real_zoom * CHAR_ZOOM
  2393.       self.zoom_y = @battler.real_zoom * CHAR_ZOOM
  2394.       self.src_rect.set(0, 0, @width, @height)
  2395.       self.opacity = 255
  2396.       # バトラーより手前に表示
  2397.       if @weapon_anime_type[2]
  2398.         self.z += 10
  2399.       # バトラーより奥に表示
  2400.       else
  2401.         self.z -= 10
  2402.       end
  2403.       @flag = false
  2404.     end
  2405.   end
  2406. end

  2407. #==============================================================================
  2408. # ■ Sprite_Flying
  2409. #------------------------------------------------------------------------------
  2410. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2411. # スプライトの状態を自動的に変化させます。
  2412. #==============================================================================

  2413. class Sprite_Flying < RPG::Sprite
  2414.   include Side_view
  2415.   #--------------------------------------------------------------------------
  2416.   # ● 公開インスタンス変数
  2417.   #--------------------------------------------------------------------------
  2418.   attr_accessor :battler                  # バトラー
  2419.   #--------------------------------------------------------------------------
  2420.   # ● オブジェクト初期化
  2421.   #     viewport : ビューポート
  2422.   #     battler  : バトラー (Game_Battler)
  2423.   #--------------------------------------------------------------------------
  2424.   def initialize(viewport, battler = nil)
  2425.     super(viewport)
  2426.     @battler = battler
  2427.     @battler_visible = false
  2428.   end
  2429.   #--------------------------------------------------------------------------
  2430.   # ● 解放
  2431.   #--------------------------------------------------------------------------
  2432.   def dispose
  2433.     if self.bitmap != nil
  2434.       self.bitmap.dispose
  2435.     end
  2436.     super
  2437.   end
  2438.   #--------------------------------------------------------------------------
  2439.   # ● フレーム更新
  2440.   #--------------------------------------------------------------------------
  2441.   def update
  2442.     super
  2443.     # バトラーが nil の場合
  2444.     if @battler == nil
  2445.       self.bitmap = nil
  2446.       loop_animation(nil)
  2447.       return
  2448.     end
  2449.     # 遠距離アニメ
  2450.     flying_animation = @battler.flying_animation
  2451.     flying_start = flying_animation[0]
  2452.     flying_end   = flying_animation[1]
  2453.     # アニメーション ID が現在のものと異なる場合
  2454.     if @anime_id != @battler.flying_anime[0]
  2455.       @anime_id = @battler.flying_anime[0]
  2456.       @animation = $data_animations[@anime_id]
  2457.     end
  2458.     # アニメーション 開始
  2459.     if flying_start
  2460.       loop_animation(@animation)
  2461.     elsif flying_end
  2462.       loop_animation(nil)
  2463.     end
  2464.     self.x = @battler.flying_x
  2465.     self.y = @battler.flying_y
  2466.     self.z = @battler.screen_z + 1000
  2467.   end
  2468. end

  2469. module RPG
  2470.   class Skill
  2471.     #--------------------------------------------------------------------------
  2472.     # ● 魔法かどうかの判断
  2473.     #--------------------------------------------------------------------------
  2474.     def magic?
  2475.       if @atk_f == 0
  2476.         return true
  2477.       else
  2478.         return false
  2479.       end
  2480.     end
  2481.   end
  2482. end

  2483. # アローカーソルの位置修正

  2484. class Arrow_Actor < Arrow_Base
  2485.   include Side_view
  2486.   #--------------------------------------------------------------------------
  2487.   # ● フレーム更新
  2488.   #--------------------------------------------------------------------------
  2489.   alias side_view_update update
  2490.   def update
  2491.     side_view_update
  2492.     # スプライトの座標を設定
  2493.     if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
  2494.       self.x = self.actor.screen_x + ARROW_OX
  2495.       self.y = self.actor.screen_y + ARROW_OY
  2496.     end
  2497.   end
  2498. end
  2499. class Arrow_Enemy < Arrow_Base
  2500.   include Side_view
  2501.   #--------------------------------------------------------------------------
  2502.   # ● フレーム更新
  2503.   #--------------------------------------------------------------------------
  2504.   alias side_view_update update
  2505.   def update
  2506.     side_view_update
  2507.     # スプライトの座標を設定
  2508.     if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
  2509.       self.x = self.enemy.screen_x
  2510.       self.y = self.enemy.screen_y + self.enemy.height/2
  2511.     end
  2512.   end
  2513. end
  2514. module Rtab_use
  2515.   def update_phase4_step3(battler)
  2516.     # ヘルプウィンドウの更新。アクションの種別で分岐
  2517.     case battler.current_action.kind
  2518.     when 0  # 基本
  2519.       if battler.current_action.basic == 1
  2520.         @help_window.set_text($data_system.words.guard, 1)
  2521.         @help_wait = @help_time
  2522.       end
  2523.       if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  2524.         @help_window.set_text("逃げる", 1)
  2525.         @help_wait = @help_time
  2526.       end
  2527.     when 1  # スキル
  2528.       skill =  $data_skills[battler.current_action.skill_id]
  2529.       @help_window.set_text(skill.name, 1)
  2530.       @help_wait = @help_time
  2531.     when 2  # アイテム
  2532.       item = $data_items[battler.current_action.item_id]
  2533.       @help_window.set_text(item.name, 1)
  2534.       @help_wait = @help_time
  2535.     end
  2536.     # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
  2537.     if battler.anime1 == 0
  2538.       battler.white_flash = true
  2539.       battler.wait = 5
  2540.       # カメラ設定
  2541.       if battler.target[0].is_a?(Game_Enemy)
  2542.         camera_set(battler)
  2543.       end
  2544.     else
  2545.       battler.animation.push([battler.anime1, true])
  2546.       speller = synthe?(battler)
  2547.       if speller != nil
  2548.         for spell in speller
  2549.           if spell != battler
  2550.             if spell.current_action.spell_id == 0
  2551.               spell.animation.push([battler.anime1, true])
  2552.             else
  2553.               skill = spell.current_action.spell_id
  2554.               spell.animation.push([$data_skills[skill].animation1_id, true])
  2555.               spell.current_action.spell_id = 0
  2556.             end
  2557.           end
  2558.         end
  2559.       end
  2560.       battler.wait = 2 * $data_animations[battler.anime1].frame_max - 10
  2561.       battler.anime1 = 0
  2562.     end
  2563.     # ステップ 4 に移行
  2564.     battler.phase = 4 if !(!battler.animation1_on and battler.action? and !battler.flash?)
  2565.   end
  2566. end

  2567. #==============================================================================
  2568. # ■ Scene_Battle
  2569. #==============================================================================
  2570. class Scene_Battle
  2571.   include Side_view
  2572.   include Rtab_use if RTAB
  2573.   #--------------------------------------------------------------------------
  2574.   # ● 公開インスタンス変数
  2575.   #--------------------------------------------------------------------------
  2576.   attr_reader   :phase            # フェーズ
  2577.   attr_reader   :phase4_step      # フェーズ4ステップ
  2578.   attr_reader   :active_battler   # 対象の配列
  2579.   attr_reader   :target_battlers  # 対象の配列
  2580.   attr_reader   :animation1_id    # 行動アニメID
  2581.   attr_reader   :animation2_id    # 対象アニメID
  2582.   #--------------------------------------------------------------------------
  2583.   # ● メイン処理
  2584.   #--------------------------------------------------------------------------
  2585.   alias side_view_main main
  2586.   def main
  2587.     # バトラー初期化
  2588.     for battler in $game_party.actors + $game_troop.enemies
  2589.       battler.start_battle
  2590.     end
  2591.     # 戻す
  2592.     side_view_main
  2593.   end
  2594.   #--------------------------------------------------------------------------
  2595.   # ● 閃き判定
  2596.   #--------------------------------------------------------------------------
  2597.   def flash?
  2598.     return @flash_flag ? true : false
  2599.   end  
  2600.   #--------------------------------------------------------------------------
  2601.   # ● 閃きアニメ待ち時間取得
  2602.   #--------------------------------------------------------------------------
  2603.   def flash_duration
  2604.     animation = nil
  2605.     if FLASH_ANIME
  2606.       animation = $data_animations[FLASH_ANIMATION_ID]
  2607.     end
  2608.     return animation != nil ? animation.frame_max * 2 + 2 : 0
  2609.   end
  2610.   #--------------------------------------------------------------------------
  2611.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  2612.   #--------------------------------------------------------------------------
  2613.   alias side_view_update_phase4_step2 update_phase4_step2
  2614.   def update_phase4_step2(*arg)
  2615.     battler = convert_battler2(*arg)
  2616.     battler.action
  2617.     side_view_update_phase4_step2(*arg)
  2618.   end
  2619.   #--------------------------------------------------------------------------
  2620.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  2621.   #--------------------------------------------------------------------------
  2622.   alias side_view_update_phase4_step3 update_phase4_step3
  2623.   def update_phase4_step3(*arg)
  2624.     battler = convert_battler2(*arg)
  2625.     if battler.flash? and FLASH_ANIME
  2626.       battler.flash_flag["normal"] = true
  2627.     end
  2628.     side_view_update_phase4_step3(*arg)
  2629.   end
  2630.   #--------------------------------------------------------------------------
  2631.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  2632.   #--------------------------------------------------------------------------
  2633.   alias side_view_update_phase4_step4 update_phase4_step4
  2634.   def update_phase4_step4(*arg)
  2635.     battler = convert_battler2(*arg)
  2636.     targets = RTAB ? battler.target : @target_battlers
  2637.     return if !battler.animation2_on and battler.action? if !RTAB
  2638.     side_view_update_phase4_step4(*arg)
  2639.     for target in targets
  2640.       if RTAB
  2641.         value = nil
  2642.         if target.damage_sp.include?(battler)
  2643.           value = target.damage_sp[battler]
  2644.         end
  2645.         if target.damage.include?(battler)
  2646.           if value == nil or value == "Miss"
  2647.             value = target.damage[battler]
  2648.           elsif value.is_a?(Numeric) && value > 0
  2649.             value = target.damage[battler] == "Miss" ? value : target.damage[battler]
  2650.           end
  2651.         end
  2652.       else
  2653.         value = target.damage
  2654.       end
  2655.       if target.is_a?(Game_Actor)
  2656.         # ダメージの場合
  2657.         if value.is_a?(Numeric) && value > 0
  2658.           # シェイクを開始
  2659.           target.shake = true
  2660.         end
  2661.       elsif target.is_a?(Game_Enemy)
  2662.         # ダメージの場合
  2663.         if value.is_a?(Numeric) && value > 0
  2664.           # シェイクを開始
  2665.           target.shake = true
  2666.         end
  2667.       end
  2668.     end
  2669.   end
  2670.   #--------------------------------------------------------------------------
  2671.   # ● プレバトルフェーズ開始
  2672.   #--------------------------------------------------------------------------
  2673.   alias start_phase1_correct start_phase1
  2674.   def start_phase1
  2675.     # カメラの設定
  2676.     # 元々フロントビュー向けの数値になっているため
  2677.     @zoom_rate = [1.0, 1.0]
  2678.     start_phase1_correct
  2679.   end
  2680.   #--------------------------------------------------------------------------
  2681.   # ● アクターコマンドフェーズ開始
  2682.   #--------------------------------------------------------------------------
  2683.   alias start_phase3_correct start_phase3
  2684.   def start_phase3
  2685.     battler = convert_battler
  2686.     start_phase3_correct
  2687.     if RTAB
  2688.       # カメラの設定
  2689.       # 元々フロントビュー向けの数値になっているため
  2690.       @camera = "command"
  2691. #      @spriteset.screen_target(0, 0, 1.0)
  2692.     end
  2693.   end


  2694.   def action_phase(battler)
  2695.     # action が 1 の場合、バトラーが行動中かどうか確認
  2696.     if @action == 1 and battler.phase < 3
  2697.       for target in battler.target
  2698.         speller = synthe?(target)
  2699.         if speller == nil
  2700.           # ターゲットが通常行動中の場合
  2701.           if @action_battlers.include?(target)
  2702.             if target.phase > 2
  2703.               return
  2704.             end
  2705.           end
  2706.         else
  2707.           # ターゲットが連携スキル発動中の場合
  2708.           for spell in speller
  2709.             if @action_battlers.include?(spell)
  2710.               if spell.phase > 2
  2711.                 return
  2712.               end
  2713.             end
  2714.           end
  2715.         end
  2716.       end
  2717.     end
  2718. case battler.phase
  2719.   when 1
  2720.     update_phase4_step1(battler)
  2721.   when 2
  2722.     update_phase4_step2(battler)
  2723.   when 3  
  2724.     update_phase4_step3(battler) if !(!battler.animation1_on and battler.action? and !battler.flash?)
  2725.   when 4
  2726.     update_phase4_step4(battler) if !(!battler.animation2_on and battler.action?)
  2727.   when 5
  2728.     update_phase4_step5(battler)
  2729.   when 6
  2730.     update_phase4_step6(battler)
  2731.   end
  2732. end
  2733. end
复制代码

博客:我的博客
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
117
在线时间
432 小时
注册时间
2010-7-14
帖子
111
3
 楼主| 发表于 2012-1-19 20:35:18 | 只看该作者
谢谢! 解决了 能不能麻烦告诉一下修改的是哪里 我在学习阶段 谢谢
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3176
在线时间
1442 小时
注册时间
2009-7-27
帖子
1454
4
发表于 2012-1-19 21:51:23 | 只看该作者
frostkankan 发表于 2012-1-19 20:35
谢谢! 解决了 能不能麻烦告诉一下修改的是哪里 我在学习阶段 谢谢

在这里改。需要一段一段翻译吗?
  1. "通常攻撃" => [
  2.   
  3.   "閃きアニメ",
  4.   "アクターアニメ変更#WALK_L",
  5.   "移動#target,32,0,64,0",
  6.   "行動アニメ",
  7.   "アクターアニメ変更#ATTACK",
  8.   "遠距離アニメ",
  9.   "対象アニメ",
  10.   "アクターアニメ変更#WALK_L",
  11.   "SEの演奏#016-Jump02,80,100",
  12.   "移動#self,0,0,48,32",
  13.   "終了"
  14.   ],

  15.   "エネミー攻撃" => [
  16.   
  17.   "閃きアニメ",
  18.   "アクターアニメ変更#WALK_L",
  19.   "移動#self,-36,0,12,0",
  20.   "行動アニメ",
  21.   "アクターアニメ変更#ATTACK",
  22.   "遠距離アニメ",
  23.   "対象アニメ",
  24.   "アクターアニメ変更#WALK_L",
  25.   "移動#self,0,0,12,0",
  26.   "終了"
  27.   ],
  28.   
  29.   "術発動" => [
  30.   
  31.   "閃きアニメ",
  32.   "アクターアニメ変更#WALK_L",
  33.   "移動#self,-32,0,4,0",
  34.   "アクターアニメ変更#MAGIC",
  35.   "行動アニメ",
  36.   "ウエイト#15",
  37.   "遠距離アニメ",
  38.   "対象アニメ",
  39.   "アクターアニメ変更#WALK_L",
  40.   "移動#self,0,0,4,2",
  41.   "終了"
  42.   ],

  43.   "アイテム使用" => [
  44.   
  45.   "閃きアニメ",
  46.   "アクターアニメ変更#WALK_L",
  47.   "移動#self,-32,0,4,0",
  48.   "行動アニメ",
  49.   "アクターアニメ変更#ITEM",
  50.   "ウエイト#15",
  51.   "遠距離アニメ",
  52.   "対象アニメ",
  53.   "アクターアニメ変更#WALK_L",
  54.   "移動#self,0,0,4,2",
  55.   "終了"
  56.   ],
  57.   
  58.   "払い抜け" => [
  59.   
  60.   "閃きアニメ",
  61.   "アクターアニメ変更#WALK_L",
  62.   "移動#target_near,50,0,48,30",  
  63.   "左右反転",
  64.   "アクターアニメ固定#ATTACK#3",
  65.   "行動アニメ",
  66.   "SEの演奏#135-Light01,100,100",
  67.   "アニメーションの表示#self,42",
  68.   "ウエイト#15",
  69.   "左右反転",
  70.   "残像表示",
  71.   "移動#target_far,-50,0,48,0",
  72.   "対象アニメ",
  73.   "残像消去",
  74.   "アニメ固定解除",
  75.   "アクターアニメ変更#WALK_L",
  76.   "移動#self,0,0,48,1,0",
  77.   "終了"
  78.   ],

  79.   "弓箭攻撃" => [
  80.   
  81.   "閃きアニメ",
  82.   "アクターアニメ変更#WALK_L",
  83.   "移動#self,-32,0,4,0",
  84.   "行動アニメ",
  85.   "アクターアニメ変更#ATTACK",
  86.   "遠距離アニメ",
  87.   "対象アニメ",
  88.   "アクターアニメ変更#WALK_L",
  89.   "移動#self,0,0,4,2",
  90.   "終了"
  91.   ],

  92.   "回旋攻撃" => [
  93.   
  94.   "閃きアニメ",
  95.   "アクターアニメ変更#WALK_L",
  96.   "移動#self,-32,0,4,0",
  97.   "行動アニメ",
  98.   "アクターアニメ変更#STAND_L",  
  99.   "遠距離アニメ",
  100.   "対象アニメ",
  101.   "アクターアニメ変更#WALK_L",
  102.   "移動#self,0,0,4,2",
  103.   "終了"
  104.   ],
  105.   
  106.   "远距离発動" => [
  107.   
  108.   "閃きアニメ",
  109.   "アクターアニメ変更#WALK_L",
  110.   "移動#self,-32,0,4,0",
  111.   "アクターアニメ変更#MAGIC",
  112.   "行動アニメ",
  113.   "アクターアニメ変更#ATTACK",
  114.   "遠距離アニメ",
  115.   "対象アニメ",
  116.   "アクターアニメ変更#WALK_L",
  117.   "移動#self,0,0,4,2",
  118.   "終了"
  119.   ],
  120.   
  121.   "回旋発動" => [
  122.   
  123.   "閃きアニメ",
  124.   "アクターアニメ変更#WALK_L",
  125.   "移動#self,-32,0,4,0",
  126.   "アクターアニメ変更#MAGIC",
  127.   "行動アニメ",
  128.   "アクターアニメ変更#STAND_L",  
  129.   "遠距離アニメ",
  130.   "対象アニメ",
  131.   "アクターアニメ変更#WALK_L",
  132.   "移動#self,0,0,4,2",
  133.   "終了"
复制代码

博客:我的博客
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
117
在线时间
432 小时
注册时间
2010-7-14
帖子
111
5
 楼主| 发表于 2012-1-20 20:58:03 | 只看该作者
爆焰 发表于 2012-1-19 21:51
在这里改。需要一段一段翻译吗?

严重需要啊!如果可以的话那真的多谢了!:handshake
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-10-1 17:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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