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

Project1

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

[已经过期] 删了这个帖子吧

[复制链接]

Lv1.梦旅人

梦石
0
星屑
49
在线时间
124 小时
注册时间
2012-3-20
帖子
19
跳转到指定楼层
1
发表于 2012-9-7 19:33:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 54792798 于 2012-9-8 18:00 编辑

我修改了这个脚本
  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 = 455     # 队伍 X 位置
  104.   PARTY_Y = 200     # 队伍 Y 位置
  105.   FORMATION_X = 15  # 各个角色之间的间隔 X
  106.   FORMATION_Y = 35  # 各个角色之间的间隔 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 = [3]
  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.   "左右反転",
  272.   "アクターアニメ固定#ATTACK#3",
  273.   "行動アニメ",
  274.   "SEの演奏#135-Light01,100,100",
  275.   "アニメーションの表示#self,42",
  276.   "ウエイト#15",
  277.   "左右反転",
  278.   "残像表示",
  279.   "移動#target_far,-50,0,48,0",
  280.   "対象アニメ",
  281.   "残像消去",
  282.   "アニメ固定解除",
  283.   "アクターアニメ変更#WALK_L",
  284.   "移動#self,0,0,48,1,0",
  285.   "終了"
  286.   ],
  287.   
  288.    "剑气攻击" => [
  289.   
  290.   "閃きアニメ",
  291.   "アクターアニメ変更#WALK_L",
  292.   "移動#self,-32,0,4,0",
  293.   "行動アニメ",
  294.   "アクターアニメ変更#ATTACK",
  295.   "遠距離アニメ",
  296.   "対象アニメ",
  297.   "アクターアニメ変更#WALK_L",
  298.   "移動#self,0,0,4,2",
  299.   "終了"
  300.   ],
  301.   
  302.   "弓箭攻撃" => [
  303.   
  304.   "閃きアニメ",
  305.   "アクターアニメ変更#WALK_L",
  306.   "移動#self,-32,0,4,0",
  307.   "行動アニメ",
  308.   "アクターアニメ変更#ATTACK",
  309.   "遠距離アニメ",
  310.   "対象アニメ",
  311.   "アクターアニメ変更#WALK_L",
  312.   "移動#self,0,0,4,2",
  313.   "終了"
  314.   ],

  315.   "回旋攻撃" => [
  316.   
  317.   "閃きアニメ",
  318.   "アクターアニメ変更#WALK_L",
  319.   "移動#self,-32,0,4,0",
  320.   "行動アニメ",
  321.   "アクターアニメ変更#STAND_L",  
  322.   "遠距離アニメ",
  323.   "対象アニメ",
  324.   "アクターアニメ変更#WALK_L",
  325.   "移動#self,0,0,4,2",
  326.   "終了"
  327.   ],
  328.   
  329.   "远距离発動" => [
  330.   
  331.   "閃きアニメ",
  332.   "アクターアニメ変更#WALK_L",
  333.   "移動#self,-32,0,4,0",
  334.   "アクターアニメ変更#MAGIC",
  335.   "行動アニメ",
  336.   "アクターアニメ変更#ATTACK",
  337.   "遠距離アニメ",
  338.   "対象アニメ",
  339.   "アクターアニメ変更#WALK_L",
  340.   "移動#self,0,0,4,2",
  341.   "終了"
  342.   ],
  343.   
  344.   "回旋発動" => [
  345.   
  346.   "閃きアニメ",
  347.   "アクターアニメ変更#WALK_L",
  348.   "移動#self,-32,0,4,0",
  349.   "アクターアニメ変更#MAGIC",
  350.   "行動アニメ",
  351.   "アクターアニメ変更#STAND_L",  
  352.   "遠距離アニメ",
  353.   "対象アニメ",
  354.   "アクターアニメ変更#WALK_L",
  355.   "移動#self,0,0,4,2",
  356.   "終了"
  357.   ],

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

  359. end
  360.   
  361. module RPG
  362.   class Weapon
  363.     #--------------------------------------------------------------------------
  364.     # ● アクション設定
  365.     #--------------------------------------------------------------------------
  366.     def battle_actions
  367.       case @id
  368.       when 17,18,19,20,21,22,23,24,56   # 远程武器的id回旋攻撃
  369.         return BattleActions::Actions["弓箭攻撃"]
  370.       when 34                       # 回旋武器的id
  371.         return BattleActions::Actions["回旋攻撃"]
  372.       when 65
  373.         return BattleActions::Actions["剑气攻擊"]
  374.       else
  375.       return BattleActions::Actions["通常攻撃"]
  376.     end
  377.   end
  378.   class Skill
  379.     #--------------------------------------------------------------------------
  380.     # ● アクション設定
  381.     #--------------------------------------------------------------------------
  382.     def battle_actions
  383.       case @id
  384.       when 73,74,75,76,77,78,79,80  # 远程技能的id
  385.         return BattleActions::Actions["远距离発動"]
  386.       when 82                       # 回旋技能的id
  387.         return BattleActions::Actions["回旋発動"]
  388.       end
  389.       else
  390.       if self.magic?
  391.         return BattleActions::Actions["術発動"]
  392.       else
  393.         return BattleActions::Actions["払い抜け"]
  394.       end
  395.     end
  396.   end
  397.   class Item
  398.     #--------------------------------------------------------------------------
  399.     # ● アクション設定
  400.     #--------------------------------------------------------------------------
  401.     def battle_actions
  402.       return BattleActions::Actions["アイテム使用"]
  403.     end
  404.   end
  405. end
  406. #class Game_Enemy < Game_Battler
  407.   #--------------------------------------------------------------------------
  408.   # ● アクション設定
  409.   #--------------------------------------------------------------------------
  410. #~  def battle_actions
  411. #~    return BattleActions::Actions["エネミー攻撃"]
  412. #~  end
  413. #end
  414. =begin
  415. #--------------------------------------------------------------------------
  416. # ● 遠距離アニメーション
  417. #--------------------------------------------------------------------------
  418.  ☆ 説明
  419.   
  420.    行動者から対象者にアニメを飛ばします。
  421.    飛ばすアニメを データベース‐アニメーション で作ります。
  422.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。


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

  505. #class Game_Enemy < Game_Battler
  506.   #--------------------------------------------------------------------------
  507.   # ● 遠距離アニメーション
  508.   #--------------------------------------------------------------------------
  509. #~  def flying_anime
  510. #~    return [0,0,false,false]
  511. #~  end
  512. #end



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

  1133.     # RTAB対応
  1134.     # 通常・待機
  1135.     return self.condition = NORMAL
  1136.   end
  1137.   #--------------------------------------------------------------------------
  1138.   # ● アクションの取得
  1139.   #--------------------------------------------------------------------------
  1140.   def get_actions
  1141.     skill = $data_skills[self.current_action.skill_id]
  1142.     item = $data_items[self.current_action.item_id]
  1143.     kind = self.current_action.kind
  1144.     # 動作取得
  1145.     @battle_actions = []
  1146.     # スキル
  1147.     if skill != nil && kind == 1
  1148.       @battle_actions = skill.battle_actions.dup
  1149.       @flying_anime = skill.flying_anime
  1150.     # アイテム
  1151.     elsif item != nil && kind == 2
  1152.       @battle_actions = item.battle_actions.dup
  1153.       @flying_anime = item.flying_anime
  1154.     # 左手攻撃
  1155.     elsif !@first_weapon and @second_weapon and (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce))

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

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

  1696.   
  1697.   
  1698.   #--------------------------------------------------------------------------
  1699.   # ● アニメーション取得
  1700.   #--------------------------------------------------------------------------
  1701.   def battle_actions1
  1702.     weapon = $data_weapons[@weapon_id]
  1703.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1704.   end
  1705.   #--------------------------------------------------------------------------
  1706.   # ● アニメーション取得
  1707.   #--------------------------------------------------------------------------
  1708.   def battle_actions2
  1709.     weapon = $data_weapons[@weapon2_id]
  1710.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1711.   end
  1712.   #--------------------------------------------------------------------------
  1713.   # ● 武器アニメーション取得
  1714.   #--------------------------------------------------------------------------
  1715.   def weapon_anime1
  1716.     weapon = $data_weapons[@weapon_id]
  1717.     return weapon != nil ? weapon.icon_name : ""
  1718.   end
  1719.   #--------------------------------------------------------------------------
  1720.   # ● 武器アニメーション取得
  1721.   #--------------------------------------------------------------------------
  1722.   def weapon_anime2
  1723.     weapon = $data_weapons[@weapon2_id]
  1724.     return weapon != nil ? weapon.icon_name : ""
  1725.   end
  1726.   #--------------------------------------------------------------------------
  1727.   # ● 遠距離アニメーション取得
  1728.   #--------------------------------------------------------------------------
  1729.   def flying_anime1
  1730.     weapon = $data_weapons[@weapon_id]
  1731.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1732.   end
  1733.   #--------------------------------------------------------------------------
  1734.   # ● 遠距離アニメーション取得
  1735.   #--------------------------------------------------------------------------
  1736.   def flying_anime2
  1737.     weapon = $data_weapons[@weapon2_id]
  1738.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1739.   end  
  1740. end
  1741. #==============================================================================
  1742. # ■ Game_Party
  1743. #==============================================================================
  1744. class Game_Party
  1745.   #--------------------------------------------------------------------------
  1746.   # ● アクターを加える
  1747.   #     actor_id : アクター ID
  1748.   #--------------------------------------------------------------------------
  1749.   alias side_view_add_actor add_actor
  1750.   def add_actor(actor_id)
  1751.     # アクターを取得
  1752.     actor = $game_actors[actor_id]
  1753.     # サイドビューデータの初期化
  1754.     actor.start_battle
  1755.     # 戻す
  1756.     side_view_add_actor(actor_id)
  1757.   end
  1758. end

  1759. class Spriteset_Battle
  1760.   include Side_view
  1761.   #--------------------------------------------------------------------------
  1762.   # ● オブジェクト初期化
  1763.   #--------------------------------------------------------------------------
  1764.   alias side_veiw_initialize initialize
  1765.   def initialize
  1766.     side_veiw_initialize
  1767.     # アクタースプライトを解放
  1768.     for sprite in @actor_sprites
  1769.       sprite.dispose
  1770.     end
  1771.     # アクタースプライトを作成
  1772.     @actor_sprites = []
  1773.     for i in 1..Party_max
  1774.       @actor_sprites.push(Sprite_Battler.new(@viewport1))
  1775.     end
  1776.     update
  1777.   end
  1778.   #--------------------------------------------------------------------------
  1779.   # ● 画面のスクロール
  1780.   #--------------------------------------------------------------------------
  1781.   if method_defined?("screen_scroll")
  1782.   alias side_view_screen_scroll screen_scroll
  1783.   def screen_scroll
  1784.     side_view_screen_scroll
  1785.     # アクターの位置補正
  1786.     for actor in $game_party.actors
  1787.       actor.real_x = @real_x
  1788.       actor.real_y = @real_y
  1789.       actor.real_zoom = @real_zoom
  1790.     end
  1791.   end
  1792.   end
  1793. end

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

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

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

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

  2433. class Sprite_Flying < RPG::Sprite
  2434.   include Side_view
  2435.   #--------------------------------------------------------------------------
  2436.   # ● 公開インスタンス変数
  2437.   #--------------------------------------------------------------------------
  2438.   attr_accessor :battler                  # バトラー
  2439.   #--------------------------------------------------------------------------
  2440.   # ● オブジェクト初期化
  2441.   #     viewport : ビューポート
  2442.   #     battler  : バトラー (Game_Battler)
  2443.   #--------------------------------------------------------------------------
  2444.   def initialize(viewport, battler = nil)
  2445.     super(viewport)
  2446.     @battler = battler
  2447.     @battler_visible = false
  2448.   end
  2449.   #--------------------------------------------------------------------------
  2450.   # ● 解放
  2451.   #--------------------------------------------------------------------------
  2452.   def dispose
  2453.     if self.bitmap != nil
  2454.       self.bitmap.dispose
  2455.     end
  2456.     super
  2457.   end
  2458.   #--------------------------------------------------------------------------
  2459.   # ● フレーム更新
  2460.   #--------------------------------------------------------------------------
  2461.   def update
  2462.     super
  2463.     # バトラーが nil の場合
  2464.     if @battler == nil
  2465.       self.bitmap = nil
  2466.       loop_animation(nil)
  2467.       return
  2468.     end
  2469.     # 遠距離アニメ
  2470.     flying_animation = @battler.flying_animation
  2471.     flying_start = flying_animation[0]
  2472.     flying_end   = flying_animation[1]
  2473.     # アニメーション ID が現在のものと異なる場合
  2474.     if @anime_id != @battler.flying_anime[0]
  2475.       @anime_id = @battler.flying_anime[0]
  2476.       @animation = $data_animations[@anime_id]
  2477.     end
  2478.     # アニメーション 開始
  2479.     if flying_start
  2480.       loop_animation(@animation)
  2481.     elsif flying_end
  2482.       loop_animation(nil)
  2483.     end
  2484.     self.x = @battler.flying_x
  2485.     self.y = @battler.flying_y
  2486.     self.z = @battler.screen_z + 1000
  2487.   end
  2488. end

  2489. module RPG
  2490.   class Skill
  2491.     #--------------------------------------------------------------------------
  2492.     # ● 魔法かどうかの判断
  2493.     #--------------------------------------------------------------------------
  2494.     def magic?
  2495.       if @atk_f == 0
  2496.         return true
  2497.       else
  2498.         return false
  2499.       end
  2500.     end
  2501.   end
  2502. end

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

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

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


  2714.   def action_phase(battler)
  2715.     # action が 1 の場合、バトラーが行動中かどうか確認
  2716.     if @action == 1 and battler.phase < 3
  2717.       for target in battler.target
  2718.         speller = synthe?(target)
  2719.         if speller == nil
  2720.           # ターゲットが通常行動中の場合
  2721.           if @action_battlers.include?(target)
  2722.             if target.phase > 2
  2723.               return
  2724.             end
  2725.           end
  2726.         else
  2727.           # ターゲットが連携スキル発動中の場合
  2728.           for spell in speller
  2729.             if @action_battlers.include?(spell)
  2730.               if spell.phase > 2
  2731.                 return
  2732.               end
  2733.             end
  2734.           end
  2735.         end
  2736.       end
  2737.     end
  2738. case battler.phase
  2739.   when 1
  2740.     update_phase4_step1(battler)
  2741.   when 2
  2742.     update_phase4_step2(battler)
  2743.   when 3  
  2744.     update_phase4_step3(battler) if !(!battler.animation1_on and battler.action? and !battler.flash?)
  2745.   when 4
  2746.     update_phase4_step4(battler) if !(!battler.animation2_on and battler.action?)
  2747.   when 5
  2748.     update_phase4_step5(battler)
  2749.   when 6
  2750.     update_phase4_step6(battler)
  2751.   end
  2752. end
  2753. end
  2754. end
  2755. end
复制代码
让它多一种远程攻击方式。可是…到了测试的时候就这样了。求大触解决

Lv3.寻梦者

梦石
0
星屑
2607
在线时间
1967 小时
注册时间
2012-4-25
帖子
141
2
发表于 2012-9-7 21:01:56 | 只看该作者
"剑气攻击" =>
return BattleActions::Actions["剑气攻擊"]
为什么 击分繁简了??
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
124 小时
注册时间
2012-3-20
帖子
19
3
 楼主| 发表于 2012-9-7 21:09:43 | 只看该作者
本帖最后由 54792798 于 2012-9-7 21:22 编辑
乱糟糟 发表于 2012-9-7 21:01
"剑气攻击" =>
return BattleActions::Actions["剑气攻擊"]
为什么 击分繁简了??


........我打错字了。现在已经修好但是还是这样
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2607
在线时间
1967 小时
注册时间
2012-4-25
帖子
141
4
发表于 2012-9-7 21:31:37 | 只看该作者
54792798 发表于 2012-9-7 21:09
........我打错字了。现在已经修好但是还是这样

看出错信息:RPG::RPG::Game_Actor,,,,,应该是哪里少了个或者多了个end什么的。。导致结构错了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
124 小时
注册时间
2012-3-20
帖子
19
5
 楼主| 发表于 2012-9-7 21:35:18 | 只看该作者
乱糟糟 发表于 2012-9-7 21:31
看出错信息:RPG::RPG::Game_Actor,,,,,应该是哪里少了个或者多了个end什么的。。导致结构错了 ...

哦,我找找看。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2607
在线时间
1967 小时
注册时间
2012-4-25
帖子
141
6
发表于 2012-9-7 21:42:55 | 只看该作者
54792798 发表于 2012-9-7 21:35
哦,我找找看。

496和395行后面都少了end。。。貌似加了之后会出错。。把脚本最后没的两个end删了貌似就OK 了。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
124 小时
注册时间
2012-3-20
帖子
19
7
 楼主| 发表于 2012-9-7 22:01:15 | 只看该作者
乱糟糟 发表于 2012-9-7 21:42
496和395行后面都少了end。。。貌似加了之后会出错。。把脚本最后没的两个end删了貌似就OK 了。。 ...

我按照你说的做了,结果变成了这样
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2607
在线时间
1967 小时
注册时间
2012-4-25
帖子
141
8
发表于 2012-9-7 22:18:13 | 只看该作者
54792798 发表于 2012-9-7 22:01
我按照你说的做了,结果变成了这样

RUBY 代码复制
  1. =begin
  2.  
  3. ###############################################################################
  4.  
  5.  
  6. 全局行走图战斗 v1.1
  7.  
  8. 本版本只经低测试,可能存在某些bug。
  9.  
  10. 请注意更新
  11.  
  12. [url]http://rpg.blue/viewthread.php?tid=129875&extra=page%3D1[/url]
  13.  
  14.  
  15. ###############################################################################
  16.  
  17. ------------------------------------------------------------------------------
  18.  
  19. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  20.  
  21. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)
  22.  
  23.  
  24. 这个脚本的更动分为2部分:
  25.  
  26. 1)战斗动作 - 新加了数个动作,如:“弓箭攻击”、“远距离发动”等等
  27.  
  28. 2)战斗动画 - 基本上是脚本原带的。只是这个功能被隐藏起来了。现在已恢复。
  29.  
  30.  
  31. 用法:
  32.  
  33. 在相应的脚本行加入武器/技能/道具的数据库id(id之间要用“,”来分开)
  34.  
  35. 如果不要某些功能的话就随便填一个外太空id就行了(没有用到的id)
  36.  
  37. 1)战斗动作(角色/行走图的动作)
  38.  
  39. 脚本355行:  远程武器的id  (普通攻击时使用远程射击)
  40.  
  41. 脚本357行:  回旋武器的id  (普通攻击时会飞回手上的武器,如:回力镖)
  42.  
  43. 脚本370行:  远程技能的id  (使用技能时是远程射击)
  44.  
  45. 脚本372行:  回旋技能的id  (使用技能时,飞出的武器会飞回手上)
  46.  
  47.  
  48. 2)战斗动画(显示‘对象方的动画’之前先显示‘飞行武器射去敌人身上’的动画)
  49.  
  50. 脚本453行:  回旋武器的id  (攻击时会显示一段类似回力镖的动画)
  51.  
  52. 脚本455行:  弓箭武器的id  (攻击时会显示箭射去敌人身上的动画)
  53.  
  54. 脚本457行:  铳类武器的id  (攻击时会显示子弹射去敌人身上的动画)
  55.  
  56. 脚本470行:  回旋技能的id  (技能使用时会显示一段类似回力镖的动画)
  57.  
  58. 脚本472行:  弓箭技能的id  (技能使用时会显示箭射去敌人身上的动画)
  59.  
  60. 脚本474行:  铳类技能的id  (技能使用时会显示子弹射去敌人身上的动画)
  61.  
  62. 脚本486行:  抛击道具的id  (使用该道具时,道具被丢到敌人身上)
  63.  
  64.  
  65. 〉注意:
  66.  
  67. 〉‘飞行武器射去敌人身上’的动画是在设定id之后的那句脚本里面设置
  68. 〉例子:(脚本第455和456行)
  69.  
  70. 〉       when 17,18,19,20    #远程武器1(弓箭类)的id
  71.  
  72. 〉       return [101,32,false,false]
  73.  
  74. 〉这样,武器17~20(都是弓箭)在显示‘对象方的动画’之前会先显示第101号动画
  75.  
  76. 〉而动画的轨道是从使用者身上直到敌人身上(实现子弹射出的效果)
  77.  
  78.  
  79.  
  80. 还有:
  81.  
  82. 战斗队伍的画面位置已经被修改过,
  83.  
  84. 让角色的位置与默认的战斗背景图不会有视觉上的冲突。
  85.  
  86. 如果要更改请去脚本第113-116行改改就行了。
  87.  
  88.  
  89. 脚本‘Arrow_Enemy’和‘Arrow_Actor’被稍微修改过(可以无视)
  90.  
  91.  
  92. 这个范例附带了
  93.  
  94. 一张经过修改的战斗背景图(027-castle03),其他的战斗背景图可以使用默认的。
  95.  
  96. 一套横版的默认敌人的战斗图(从行走图改过来的)
  97.  
  98.  
  99. =end                                                        #modify by darkten
  100.  
  101.  
  102. ###############################################################################
  103.  
  104.  
  105. =begin
  106.  
  107.  
  108. 此版本更新了以下几点:
  109.  
  110. 1.支持敌人行走图战斗
  111.  
  112. 2.修正与RTAB并用的bug。
  113.  
  114. 3.支持敌人也玩小石头
  115.  
  116.  
  117. 使用方法:
  118.  
  119. 1.敌人的战斗图名称要与敌人的行走图名称相一致,具体查看本范例编号为2的敌人。
  120.  
  121. 2.请自行设置 160 ~ 173 行的内容。
  122.  
  123.  
  124.                                                                   by ONEWateR
  125.  
  126. =end
  127.  
  128. ###############################################################################
  129.  
  130.  
  131.  
  132. module Side_view
  133.  
  134.   #--------------------------------------------------------------------------
  135.  
  136.   # ● 是否与RATB并用 ☆自动识别(这到是不错~省了~)
  137.  
  138.   #    在Scene_Battle计算方法是否是方法synthe?
  139.   #    在自动不想认识的时候,请重写。
  140.  
  141.   #--------------------------------------------------------------------------
  142.  
  143.   if Scene_Battle.method_defined?("synthe?")
  144.  
  145.     RTAB = true
  146.  
  147.   else
  148.  
  149.     RTAB = false
  150.  
  151.   end
  152.  
  153.   #--------------------------------------------------------------------------
  154.  
  155.   # ● 改正RATB中的位置误差 ☆自动识别
  156.  
  157.   #    在自动不想认识的时候,请重写。
  158.  
  159.   #--------------------------------------------------------------------------
  160.  
  161.   def camera_correctness
  162.  
  163.     return false if !RTAB
  164.  
  165.     begin
  166.       return $scene.drive
  167.  
  168.     rescue
  169.  
  170.       return false
  171.  
  172.     end
  173.  
  174.   end
  175.  
  176.   #--------------------------------------------------------------------------
  177.  
  178.   # ● 队伍中的最大人数
  179.  
  180.   #--------------------------------------------------------------------------
  181.  
  182.   Party_max = 4
  183.  
  184.   #--------------------------------------------------------------------------
  185.  
  186.   # ● 战斗图的扩大率(1.0的时候是保持原有大小)
  187.  
  188.   #--------------------------------------------------------------------------
  189.  
  190.   CHAR_ZOOM = 1.0
  191.  
  192.   #--------------------------------------------------------------------------
  193.  
  194.   # ● 光标的位置修正(基本不需要改~)
  195.  
  196.   #--------------------------------------------------------------------------
  197.  
  198.   ARROW_OX = 0
  199.  
  200.   ARROW_OY = 64
  201.  
  202.   #--------------------------------------------------------------------------
  203.  
  204.   # ● 名状态作为飞行管理的排列(不知道什么意思....)
  205.  
  206.   #--------------------------------------------------------------------------
  207.  
  208.   FLY_STATES = ["飛行"]
  209.  
  210.   #--------------------------------------------------------------------------
  211.  
  212.   # ● 战斗画面的位置
  213.  
  214.   #--------------------------------------------------------------------------
  215.  
  216.   PARTY_X = 455     # 队伍 X 位置
  217.  
  218.   PARTY_Y = 200     # 队伍 Y 位置
  219.  
  220.   FORMATION_X = 15  # 各个角色之间的间隔 X
  221.  
  222.   FORMATION_Y = 35  # 各个角色之间的间隔 Y
  223.  
  224.   #--------------------------------------------------------------------------
  225.  
  226.   # ● 自定义常数
  227.  
  228.   #--------------------------------------------------------------------------
  229.  
  230.   NORMAL   = "NORMAL"
  231.  
  232.   WALK_R   = "WALK_R"
  233.  
  234.   WALK_L   = "WALK_L"
  235.  
  236.   ATTACK   = "ATTACK"
  237.  
  238.   ATTACK_R = "ATTACK_R"
  239.  
  240.   ATTACK_L = "ATTACK_L"
  241.  
  242.   MAGIC    = "MAGIC"
  243.  
  244.   ITEM     = "ITEM"
  245.  
  246.   # 动画的设定
  247.  
  248.   ANIME = {
  249.     # [画像ID,是否循环,アニメスピード,动画速度,不能指向动画,武器放在右手or左手]
  250.  
  251.     NORMAL            => [1,true , 0,false, true ,""    ], # 通常待击
  252.  
  253.     WALK_R            => [2,true , 2,false, false,""    ], # 右移动
  254.  
  255.     WALK_L            => [1,true , 2,false, false,""    ], # 左移动
  256.  
  257.     ATTACK_R          => [1,false, 2,true , false,"右手"], # 右手攻击
  258.  
  259.     ATTACK_L          => [1,false, 2,true , false,"左手"], # 左手攻击
  260.  
  261.     MAGIC             => [1,false, 2,false, false,""    ], # 右手攻击
  262.  
  263.     ITEM              => [1,false, 2,false, false,""    ], # 左手攻击
  264.  
  265.     }
  266.  
  267.  
  268.   # 债务不履行声明价值的设定(一个字一个字翻译的,不知道啥意思)  
  269.  
  270.   ANIME.default = [1,false,12,false,"",""]
  271.  
  272.  
  273.  
  274.   # 在行动设定的时候 右手攻击 or 左手攻击 辨别を(这个不知道什么意思)的ANIME
  275.  
  276.   # "角色动画变更#ATTACK"在玩了と(还是不知道啥意思..)的时候,辨别ATTACK_R或者ATTACK_L
  277.  
  278.   DUAL_WEAPONS_ANIME = [ATTACK]
  279.  
  280.  
  281.  
  282.  
  283.  
  284.   #--------------------------------------------------------------------------
  285.  
  286.   # ● 战斗图不是行走图的敌人编号
  287.  
  288.   #--------------------------------------------------------------------------
  289.  
  290.   NOT_CHARACTER_EMEMY = [3]
  291.  
  292.   #--------------------------------------------------------------------------
  293.  
  294.   # ● 敌人使用的武器
  295.  
  296.   #    敌人编号=>武器编号
  297.  
  298.   #--------------------------------------------------------------------------
  299.  
  300.   EMEMY_WEAPO = {2=>1,7=>17}
  301.  
  302.   #--------------------------------------------------------------------------
  303.  
  304.   # ● 敌人使用的武器 (二刀流)
  305.  
  306.   #    敌人编号=>武器编号
  307.  
  308.   #--------------------------------------------------------------------------
  309.  
  310.   EMEMY_WEAPO2 = {}
  311.  
  312.  
  313.  
  314.  
  315.  
  316.   #--------------------------------------------------------------------------
  317.  
  318.   # ● 摇晃的设定
  319.  
  320.   #--------------------------------------------------------------------------
  321.  
  322.   SHAKE_FILE = "摇晃"  # 文件名
  323.  
  324.   SHAKE_POWER = 5          # 强度
  325.  
  326.   SHAKE_SPEED = 5          # 速度
  327.  
  328.   SHAKE_DURATION = 5      # 时间
  329.  
  330.   #--------------------------------------------------------------------------
  331.  
  332.   # ● 上下反转地的设定
  333.  
  334.   #--------------------------------------------------------------------------
  335.  
  336.   UPSIDE_DOWN_FILE = "上下反转" # 文件名
  337.  
  338.   #--------------------------------------------------------------------------
  339.  
  340.   # ● 左右反转地的设定
  341.  
  342.   #--------------------------------------------------------------------------
  343.  
  344.   REVERSE_FILE = "左右反转" # 文件名
  345.  
  346.   #--------------------------------------------------------------------------
  347.  
  348.   # ● 回转地的设定
  349.  
  350.   #--------------------------------------------------------------------------
  351.  
  352.   TURNING_FILE = "回转" # 文件名
  353.  
  354.   TURNING_DIRECTION = 1 # 方向(1.逆时针,-1.顺时针)(|||-_-汗..怎么还有用-1做带入值的...)
  355.  
  356.   TURNING_SPEED = 40    # 速度
  357.  
  358.   TURNING_DURATION = 1  # 回转数
  359.  
  360.   #--------------------------------------------------------------------------
  361.  
  362.   # ● 移动的设定
  363.  
  364.   #--------------------------------------------------------------------------
  365.  
  366.   MOVE_FILE = "移动"             # 文件名
  367.  
  368.   MOVE_RETURN = 1                # 回到原来的位置吗?(光写了个1,也不知道不回到该怎么写?0?)
  369.  
  370.   MOVE_SPEED = 32                # 速度
  371.  
  372.   MOVE_COORDINATES = [0,-640]    # 原来位置的相对坐标
  373.  
  374.   #--------------------------------------------------------------------------
  375.  
  376.   # ● 动画追加的设定
  377.  
  378.   #--------------------------------------------------------------------------
  379.  
  380.   ADD_ANIME_FILE = "动画追加"  # 文件名
  381.  
  382.   ADD_ANIME_ID = 0               # 动画的ID
  383.   #--------------------------------------------------------------------------
  384.  
  385.   # ● 债务不履行声明和RTAB的数据转换
  386.  
  387.   #--------------------------------------------------------------------------
  388.  
  389.   def convert_battler
  390.  
  391.     return RTAB ? @active_actor : @active_battler
  392.  
  393.   end
  394.  
  395.   #--------------------------------------------------------------------------
  396.  
  397.   # ● 债务不履行声明和RTAB的数据转换2
  398.  
  399.   #--------------------------------------------------------------------------
  400.  
  401.   def convert_battler2(*arg)
  402.  
  403.     return RTAB ? arg[0] : @active_battler
  404.  
  405.   end
  406.  
  407. end
  408.  
  409.  
  410. #--------------------------------------------------------------------------
  411.  
  412. # ● 行动設定
  413.  
  414. #--------------------------------------------------------------------------
  415.  
  416. module BattleActions
  417.  
  418.  
  419.  
  420.   # 下のものはあくまでも一例なので
  421.  
  422.   # 独自に作ってください。
  423.  
  424.  
  425.   Actions = {
  426.  
  427.  
  428.   "通常攻撃" => [
  429.  
  430.  
  431.  
  432.   "閃きアニメ",
  433.  
  434.   "アクターアニメ変更#WALK_L",
  435.  
  436.   "移動#target,32,0,64,0",
  437.  
  438.   "行動アニメ",
  439.  
  440.   "アクターアニメ変更#ATTACK",
  441.  
  442.   "遠距離アニメ",
  443.  
  444.   "対象アニメ",
  445.  
  446.   "アクターアニメ変更#WALK_L",
  447.  
  448.   "SEの演奏#016-Jump02,80,100",
  449.  
  450.   "移動#self,0,0,48,32",
  451.  
  452.   "終了"
  453.  
  454.   ],
  455.  
  456.  
  457.   "エネミー攻撃" => [
  458.  
  459.  
  460.  
  461.   "閃きアニメ",
  462.  
  463.   "アクターアニメ変更#WALK_L",
  464.  
  465.   "移動#self,-36,0,12,0",
  466.  
  467.   "行動アニメ",
  468.  
  469.   "アクターアニメ変更#ATTACK",
  470.  
  471.   "遠距離アニメ",
  472.  
  473.   "対象アニメ",
  474.  
  475.   "アクターアニメ変更#WALK_L",
  476.  
  477.   "移動#self,0,0,12,0",
  478.  
  479.   "終了"
  480.  
  481.   ],
  482.  
  483.  
  484.  
  485.   "術発動" => [
  486.  
  487.  
  488.  
  489.   "閃きアニメ",
  490.  
  491.   "アクターアニメ変更#WALK_L",
  492.  
  493.   "移動#self,-32,0,4,0",
  494.  
  495.   "アクターアニメ変更#MAGIC",
  496.  
  497.   "行動アニメ",
  498.  
  499.   "ウエイト#15",
  500.  
  501.   "遠距離アニメ",
  502.  
  503.   "対象アニメ",
  504.  
  505.   "アクターアニメ変更#WALK_L",
  506.  
  507.   "移動#self,0,0,4,2",
  508.  
  509.   "終了"
  510.  
  511.   ],
  512.  
  513.  
  514.   "アイテム使用" => [
  515.  
  516.  
  517.  
  518.   "閃きアニメ",
  519.  
  520.   "アクターアニメ変更#WALK_L",
  521.  
  522.   "移動#self,-32,0,4,0",
  523.  
  524.   "行動アニメ",
  525.  
  526.   "アクターアニメ変更#ITEM",
  527.  
  528.   "ウエイト#15",
  529.  
  530.   "遠距離アニメ",
  531.  
  532.   "対象アニメ",
  533.  
  534.   "アクターアニメ変更#WALK_L",
  535.  
  536.   "移動#self,0,0,4,2",
  537.  
  538.   "終了"
  539.  
  540.   ],
  541.  
  542.  
  543.  
  544.   "払い抜け" => [
  545.  
  546.  
  547.  
  548.   "閃きアニメ",
  549.  
  550.   "アクターアニメ変更#WALK_L",
  551.  
  552.   "移動#target_near,50,0,48,30",  
  553.  
  554.   "左右反転",
  555.  
  556.   "アクターアニメ固定#ATTACK#3",
  557.  
  558.   "行動アニメ",
  559.  
  560.   "SEの演奏#135-Light01,100,100",
  561.  
  562.   "アニメーションの表示#self,42",
  563.  
  564.   "ウエイト#15",
  565.  
  566.   "左右反転",
  567.  
  568.   "残像表示",
  569.  
  570.   "移動#target_far,-50,0,48,0",
  571.  
  572.   "対象アニメ",
  573.  
  574.   "残像消去",
  575.  
  576.   "アニメ固定解除",
  577.  
  578.   "アクターアニメ変更#WALK_L",
  579.  
  580.   "移動#self,0,0,48,1,0",
  581.  
  582.   "終了"
  583.  
  584.   ],
  585.  
  586.  
  587.  
  588.    "剑气攻击" => [
  589.  
  590.  
  591.  
  592.   "閃きアニメ",
  593.  
  594.   "アクターアニメ変更#WALK_L",
  595.  
  596.   "移動#self,-32,0,4,0",
  597.  
  598.   "行動アニメ",
  599.  
  600.   "アクターアニメ変更#ATTACK",
  601.  
  602.   "遠距離アニメ",
  603.  
  604.   "対象アニメ",
  605.  
  606.   "アクターアニメ変更#WALK_L",
  607.  
  608.   "移動#self,0,0,4,2",
  609.  
  610.   "終了"
  611.  
  612.   ],
  613.  
  614.  
  615.  
  616.   "弓箭攻撃" => [
  617.  
  618.  
  619.  
  620.   "閃きアニメ",
  621.  
  622.   "アクターアニメ変更#WALK_L",
  623.  
  624.   "移動#self,-32,0,4,0",
  625.  
  626.   "行動アニメ",
  627.  
  628.   "アクターアニメ変更#ATTACK",
  629.  
  630.   "遠距離アニメ",
  631.  
  632.   "対象アニメ",
  633.  
  634.   "アクターアニメ変更#WALK_L",
  635.  
  636.   "移動#self,0,0,4,2",
  637.  
  638.   "終了"
  639.  
  640.   ],
  641.  
  642.  
  643.   "回旋攻撃" => [
  644.  
  645.  
  646.  
  647.   "閃きアニメ",
  648.  
  649.   "アクターアニメ変更#WALK_L",
  650.  
  651.   "移動#self,-32,0,4,0",
  652.  
  653.   "行動アニメ",
  654.  
  655.   "アクターアニメ変更#STAND_L",  
  656.  
  657.   "遠距離アニメ",
  658.  
  659.   "対象アニメ",
  660.  
  661.   "アクターアニメ変更#WALK_L",
  662.  
  663.   "移動#self,0,0,4,2",
  664.  
  665.   "終了"
  666.  
  667.   ],
  668.  
  669.  
  670.  
  671.   "远距离発動" => [
  672.  
  673.  
  674.  
  675.   "閃きアニメ",
  676.  
  677.   "アクターアニメ変更#WALK_L",
  678.  
  679.   "移動#self,-32,0,4,0",
  680.  
  681.   "アクターアニメ変更#MAGIC",
  682.  
  683.   "行動アニメ",
  684.  
  685.   "アクターアニメ変更#ATTACK",
  686.  
  687.   "遠距離アニメ",
  688.  
  689.   "対象アニメ",
  690.  
  691.   "アクターアニメ変更#WALK_L",
  692.  
  693.   "移動#self,0,0,4,2",
  694.  
  695.   "終了"
  696.  
  697.   ],
  698.  
  699.  
  700.  
  701.   "回旋発動" => [
  702.  
  703.  
  704.  
  705.   "閃きアニメ",
  706.  
  707.   "アクターアニメ変更#WALK_L",
  708.  
  709.   "移動#self,-32,0,4,0",
  710.  
  711.   "アクターアニメ変更#MAGIC",
  712.  
  713.   "行動アニメ",
  714.  
  715.   "アクターアニメ変更#STAND_L",  
  716.  
  717.   "遠距離アニメ",
  718.  
  719.   "対象アニメ",
  720.  
  721.   "アクターアニメ変更#WALK_L",
  722.  
  723.   "移動#self,0,0,4,2",
  724.  
  725.   "終了"
  726.  
  727.   ],
  728.  
  729.  
  730.   } # ここで終わり 消さないでください
  731.  
  732.  
  733. end
  734.  
  735.  
  736.  
  737. module RPG
  738.  
  739.   class Weapon
  740.  
  741.     #--------------------------------------------------------------------------
  742.  
  743.     # ● アクション設定
  744.  
  745.     #--------------------------------------------------------------------------
  746.  
  747.     def battle_actions
  748.  
  749.       case @id
  750.  
  751.       when 17,18,19,20,21,22,23,24,56   # 远程武器的id回旋攻撃
  752.  
  753.         return BattleActions::Actions["弓箭攻撃"]
  754.  
  755.       when 34                       # 回旋武器的id
  756.  
  757.         return BattleActions::Actions["回旋攻撃"]
  758.  
  759.       when 65
  760.  
  761.         return BattleActions::Actions["剑气攻擊"]
  762.       end####
  763.       else
  764.       return BattleActions::Actions["通常攻撃"]
  765.  
  766.     end
  767.  
  768.   end
  769.  
  770.   class Skill
  771.  
  772.     #--------------------------------------------------------------------------
  773.  
  774.     # ● アクション設定
  775.  
  776.     #--------------------------------------------------------------------------
  777.  
  778.     def battle_actions
  779.  
  780.       case @id
  781.  
  782.       when 73,74,75,76,77,78,79,80  # 远程技能的id
  783.  
  784.         return BattleActions::Actions["远距离発動"]
  785.  
  786.       when 82                       # 回旋技能的id
  787.  
  788.         return BattleActions::Actions["回旋発動"]
  789.  
  790.       end
  791.  
  792.       else
  793.  
  794.       if self.magic?
  795.  
  796.         return BattleActions::Actions["術発動"]
  797.  
  798.       else
  799.  
  800.         return BattleActions::Actions["払い抜け"]
  801.  
  802.       end
  803.  
  804.     end
  805.  
  806.   end
  807.  
  808.   class Item
  809.  
  810.     #--------------------------------------------------------------------------
  811.  
  812.     # ● アクション設定
  813.  
  814.     #--------------------------------------------------------------------------
  815.  
  816.     def battle_actions
  817.  
  818.       return BattleActions::Actions["アイテム使用"]
  819.  
  820.     end
  821.  
  822.   end
  823.  
  824. end
  825.  
  826. #class Game_Enemy < Game_Battler
  827.  
  828.   #--------------------------------------------------------------------------
  829.  
  830.   # ● アクション設定
  831.  
  832.   #--------------------------------------------------------------------------
  833.  
  834. #~  def battle_actions
  835.  
  836. #~    return BattleActions::Actions["エネミー攻撃"]
  837.  
  838. #~  end
  839.  
  840. #end
  841.  
  842. =begin
  843.  
  844. #--------------------------------------------------------------------------
  845.  
  846. # ● 遠距離アニメーション
  847.  
  848. #--------------------------------------------------------------------------
  849.  
  850.  ☆ 説明
  851.  
  852.  
  853.  
  854.    行動者から対象者にアニメを飛ばします。
  855.  
  856.    飛ばすアニメを データベース‐アニメーション で作ります。
  857.  
  858.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。
  859.  
  860.  
  861.  
  862.   ● カスタマイズ方法
  863.  
  864.     
  865.     case @id
  866.  
  867.     when 17,18,19,20
  868.  
  869.       return [101,32,false,false]
  870.  
  871.     when 21,22,23,24
  872.  
  873.       return [102,32,false,false]
  874.  
  875.     end
  876.  
  877.     return 0
  878.  
  879.     
  880.     のように描くとID別に指定可能です。
  881.  
  882.     
  883.     
  884.   ● アニメーションID
  885.  
  886.  
  887.  
  888.   飛ばすアニメーションIDです。短い場合は繰り返しで表示されます。
  889.  
  890.  
  891.  
  892.     
  893.   ● スピード
  894.  
  895.  
  896.  
  897.   大きいほうが早い(0だとアニメは移動しません)
  898.  
  899.  
  900.  
  901.   1 = 1フレームで1ドット進むと考えてください。
  902.  
  903.  
  904.  
  905.   ● 往復するか?
  906.  
  907.  
  908.  
  909.   true とした場合、ブーメランのようにアニメが戻ります。
  910.  
  911.  
  912.  
  913.   ● 直線(false)or曲線(true)
  914.  
  915.  
  916.  
  917.   true  = 対象に向かって曲線で、アニメが飛びます。(修正の余地ありですが・・・)
  918.  
  919.   false = 対象に向かって直線で、アニメが飛びます。
  920.  
  921.     
  922. =end
  923.  
  924. module RPG
  925.  
  926.   class Weapon
  927.  
  928.     #--------------------------------------------------------------------------
  929.  
  930.     # ● 遠距離アニメーション
  931.  
  932.     #--------------------------------------------------------------------------
  933.  
  934.     def flying_anime
  935.  
  936.       # ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
  937.  
  938.       case @id
  939.  
  940.       when 34             #回旋武器(类似回力镖)的id
  941.  
  942.         return [103,32,true,true]
  943.  
  944.       when 17,18,19,20    #远程武器1(弓箭类)的id
  945.  
  946.         return [101,32,false,false]
  947.  
  948.       when 21,22,23,24,56      #远程武器2(铳类)的id
  949.  
  950.         return [102,32,false,false]
  951.  
  952.       when 65                  #远程武器3(剑气)的id  
  953.  
  954.       return [115,32,false,false]
  955.       end####
  956.       return [0,0,false,false]
  957.     end
  958.  
  959.   end
  960.  
  961.   class Skill
  962.  
  963.     #--------------------------------------------------------------------------
  964.  
  965.     # ● 遠距離アニメーション
  966.  
  967.     #--------------------------------------------------------------------------
  968.  
  969.     def flying_anime
  970.  
  971.       # ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
  972.  
  973.       case @id
  974.  
  975.       when 82             #回旋技能(类似回力镖)的id
  976.  
  977.         return [103,32,true,true]
  978.  
  979.       when 73,74,75,76    #远程技能1(弓箭类)的id
  980.  
  981.         return [101,32,false,false]
  982.  
  983.       when 77,78,79,80    #远程技能2(铳类)的id
  984.  
  985.         return [102,32,false,false]
  986.  
  987.       end
  988.  
  989.       return [0,0,false,false]
  990.  
  991.     end
  992.  
  993.   end
  994.  
  995.   class Item
  996.  
  997.     #--------------------------------------------------------------------------
  998.  
  999.     # ● 遠距離アニメーション
  1000.  
  1001.     #--------------------------------------------------------------------------
  1002.  
  1003.     def flying_anime
  1004.  
  1005.       case @id
  1006.  
  1007.       when 34    #抛击类道具(如炸弹一类)的id
  1008.  
  1009.         return [104,32,false,true]
  1010.  
  1011.       end
  1012.  
  1013.       return [0,0,false,false]
  1014.  
  1015.     end
  1016.  
  1017.   end
  1018.  
  1019. end
  1020.  
  1021.  
  1022. #class Game_Enemy < Game_Battler
  1023.  
  1024.   #--------------------------------------------------------------------------
  1025.  
  1026.   # ● 遠距離アニメーション
  1027.  
  1028.   #--------------------------------------------------------------------------
  1029.  
  1030. #~  def flying_anime
  1031.  
  1032. #~    return [0,0,false,false]
  1033.  
  1034. #~  end
  1035.  
  1036. #end
  1037.  
  1038.  
  1039.  
  1040.  
  1041. #==============================================================================
  1042.  
  1043. # ■ Game_Battler
  1044.  
  1045. #==============================================================================
  1046.  
  1047. class Game_Battler
  1048.  
  1049.   include Side_view
  1050.  
  1051.   #--------------------------------------------------------------------------
  1052.  
  1053.   # ● 追加・公開インスタンス変数
  1054.  
  1055.   #--------------------------------------------------------------------------
  1056.  
  1057.   attr_accessor :height                  # 画像の高さ
  1058.  
  1059.   attr_accessor :real_x                  # X座標補正
  1060.  
  1061.   attr_accessor :real_y                  # Y座標補正
  1062.  
  1063.   attr_accessor :real_zoom               # 拡大率
  1064.  
  1065.   attr_accessor :wait_count              # アニメーション 待ち時間
  1066.  
  1067.   attr_accessor :wait_count2             # アニメーション 待ち時間2
  1068.  
  1069.   attr_accessor :pattern                 # アニメーション カウント(キャラ)
  1070.  
  1071.   attr_accessor :shake                   # シェイク開始フラッグ
  1072.  
  1073.   attr_accessor :reverse                 # 左右反転フラッグ
  1074.  
  1075.   attr_accessor :shadow                  # 残像フラッグ
  1076.  
  1077.   attr_accessor :flash_flag              # 閃きフラッグ
  1078.  
  1079.   attr_reader   :ox                      # X座標補正
  1080.  
  1081.   attr_reader   :oy                      # Y座標補正
  1082.  
  1083.   attr_reader   :flying_x                # 遠距離アニメX座標
  1084.  
  1085.   attr_reader   :flying_y                # 遠距離アニメY座標
  1086.  
  1087.   attr_reader   :flying_anime            # 遠距離アニメ
  1088.  
  1089.   attr_reader   :animation1_on           # 行動アニメ開始フラッグ
  1090.  
  1091.   attr_reader   :animation2_on           # 対象アニメ開始フラッグ
  1092.  
  1093.   #--------------------------------------------------------------------------
  1094.  
  1095.   # ● デフォルトのアニメーション待ち時間を取得
  1096.  
  1097.   #--------------------------------------------------------------------------
  1098.  
  1099.   def animation_duration=(animation_duration)
  1100.  
  1101.     @_animation_duration = animation_duration
  1102.  
  1103.   end
  1104.  
  1105.   #--------------------------------------------------------------------------
  1106.  
  1107.   # ● バトル開始時のセットアップ
  1108.  
  1109.   #--------------------------------------------------------------------------
  1110.  
  1111.   def start_battle
  1112.  
  1113.     @height = 0
  1114.  
  1115.     @real_x = 0
  1116.  
  1117.     @real_y = 0
  1118.  
  1119.     @real_zoom = 1.0
  1120.  
  1121.     @battler_condition = ""
  1122.  
  1123.     @action = nil
  1124.  
  1125.     @battle_actions = []
  1126.  
  1127.     @battler_action = false
  1128.  
  1129.     @step = 0
  1130.  
  1131.     @anime_on = false
  1132.  
  1133.     @wait_count = 0
  1134.  
  1135.     @wait_count2 = 0
  1136.  
  1137.     @ox = 0
  1138.  
  1139.     @oy = 0
  1140.  
  1141.     @pattern = 0
  1142.  
  1143.     @pattern_log = true
  1144.  
  1145.     @pattern_freeze = false
  1146.  
  1147.     @condition_freeze = false
  1148.  
  1149.     @active = false
  1150.  
  1151.     @move_distance = nil
  1152.  
  1153.     @move_wait = 0
  1154.  
  1155.     @move_coordinates = [0,0,0,0]
  1156.  
  1157.     @flying_distance = nil
  1158.  
  1159.     @flying_wait = 0
  1160.  
  1161.     @flying_x = 0
  1162.  
  1163.     @flying_y = 0
  1164.  
  1165.     @flash_flag = {}
  1166.  
  1167.     self.flying_clear
  1168.  
  1169.   end
  1170.  
  1171.   #--------------------------------------------------------------------------
  1172.  
  1173.   # ● 移動中判定
  1174.  
  1175.   #--------------------------------------------------------------------------
  1176.  
  1177.   def moving?
  1178.  
  1179.     # X座標補正または、Y座標補正が0でなければ、移動中
  1180.  
  1181.     return (@ox != 0 or @oy != 0)
  1182.  
  1183.   end
  1184.  
  1185.   #--------------------------------------------------------------------------
  1186.  
  1187.   # ● 移動終了判定
  1188.  
  1189.   #--------------------------------------------------------------------------
  1190.  
  1191.   def move_end?
  1192.  
  1193.     return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
  1194.  
  1195.   end
  1196.  
  1197.   #--------------------------------------------------------------------------
  1198.  
  1199.   # ● アクション開始設定
  1200.  
  1201.   #--------------------------------------------------------------------------
  1202.  
  1203.   def action(flag = true)
  1204.  
  1205.     @battler_action = flag
  1206.  
  1207.     @animation1_on = false
  1208.  
  1209.     @animation2_on = false
  1210.  
  1211.     @step = "setup"
  1212.  
  1213.   end   
  1214.   #--------------------------------------------------------------------------
  1215.  
  1216.   # ● アクション中判定
  1217.  
  1218.   #--------------------------------------------------------------------------
  1219.  
  1220.   def action?
  1221.  
  1222.     return @battler_action
  1223.   end
  1224.  
  1225.   #--------------------------------------------------------------------------
  1226.  
  1227.   # ● 閃き判定
  1228.  
  1229.   #--------------------------------------------------------------------------
  1230.  
  1231.   def flash?
  1232.  
  1233.     return @flash_flg
  1234.  
  1235.   end
  1236.  
  1237.   #--------------------------------------------------------------------------
  1238.  
  1239.   # ● 戦闘不能判定
  1240.  
  1241.   #--------------------------------------------------------------------------
  1242.  
  1243.   def anime_dead?
  1244.  
  1245.     if $game_temp.in_battle and !RTAB
  1246.  
  1247.       if [2,3,4,5].include?($scene.phase4_step)
  1248.  
  1249.         return @last_dead
  1250.  
  1251.       end
  1252.  
  1253.     end
  1254.  
  1255.     return @last_dead = self.dead?
  1256.  
  1257.   end
  1258.  
  1259.   #--------------------------------------------------------------------------
  1260.  
  1261.   # ● ピンチ状態判定
  1262.  
  1263.   #--------------------------------------------------------------------------
  1264.  
  1265.   def crisis?
  1266.  
  1267.     if $game_temp.in_battle and !RTAB
  1268.  
  1269.       if [2,3,4,5].include?($scene.phase4_step)
  1270.  
  1271.         return @last_crisis
  1272.  
  1273.       end
  1274.  
  1275.     end
  1276.  
  1277.     return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
  1278.  
  1279.   end
  1280.  
  1281.   #--------------------------------------------------------------------------
  1282.  
  1283.   # ● バッドステート判定
  1284.  
  1285.   #--------------------------------------------------------------------------
  1286.  
  1287.   def badstate?
  1288.  
  1289.     for i in @states
  1290.  
  1291.       unless $data_states[i].nonresistance
  1292.  
  1293.         return true
  1294.  
  1295.       end
  1296.  
  1297.     end
  1298.  
  1299.     return false
  1300.  
  1301.   end
  1302.  
  1303.   #--------------------------------------------------------------------------
  1304.  
  1305.   # ● 飛行
  1306.  
  1307.   #--------------------------------------------------------------------------
  1308.  
  1309.   def fly
  1310.  
  1311.     if @fly != nil
  1312.  
  1313.       return @fly
  1314.  
  1315.     end
  1316.  
  1317.     for id in @states
  1318.  
  1319.       if FLY_STATES.include?($data_states[id].name)
  1320.  
  1321.         return 60
  1322.  
  1323.       end
  1324.  
  1325.     end
  1326.  
  1327.     return 0
  1328.  
  1329.   end
  1330.  
  1331.   #--------------------------------------------------------------------------
  1332.  
  1333.   # ● 遠距離アニメ目標座標の計算
  1334.  
  1335.   #--------------------------------------------------------------------------
  1336.  
  1337.   def flying_setup
  1338.  
  1339.     # 二度目は実行しない
  1340.  
  1341.     return if @flying_distance != nil && !camera_correctness
  1342.  
  1343.     if RTAB
  1344.  
  1345.       targets = @target
  1346.  
  1347.     else
  1348.  
  1349.       targets = $scene.target_battlers
  1350.  
  1351.     end
  1352.  
  1353.     # 目的座標を計算
  1354.  
  1355.     @f_target_x = 0
  1356.  
  1357.     @f_target_y = 0
  1358.  
  1359.     for t in targets
  1360.  
  1361.       @f_target_x += t.screen_x
  1362.       @f_target_y += t.screen_y
  1363.  
  1364.     end
  1365.  
  1366.     if targets != []
  1367.  
  1368.       @f_target_x /= targets.size
  1369.  
  1370.       @f_target_y /= targets.size
  1371.  
  1372.     else
  1373.  
  1374.       @flying_distance = 0
  1375.  
  1376.       return
  1377.  
  1378.     end
  1379.  
  1380.     # 距離の計算
  1381.  
  1382.     @flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
  1383.  
  1384.   end
  1385.  
  1386.   #--------------------------------------------------------------------------
  1387.  
  1388.   # ● 遠距離アニメ
  1389.  
  1390.   #--------------------------------------------------------------------------
  1391.  
  1392.   def flying_animation
  1393.  
  1394.     # 戻る
  1395.  
  1396.     if @step != "flying" or @flying_distance.nil?
  1397.  
  1398.       return [false,true]
  1399.  
  1400.     end
  1401.  
  1402.     # あらかじめ計算
  1403.  
  1404.     self_x = self.screen_x
  1405.  
  1406.     self_y = self.screen_y
  1407.  
  1408.     @flying_distance = @flying_distance == 0 ? 1 : @flying_distance
  1409.  
  1410.     n1 = @flying_wait / @flying_distance.to_f
  1411.  
  1412.     if @flying_distance - @flying_wait > @flying_distance / 2
  1413.  
  1414.       n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
  1415.  
  1416.     else
  1417.  
  1418.       n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
  1419.  
  1420.     end
  1421.  
  1422.     if !@flying_anime[4]
  1423.  
  1424.       # 直線移動
  1425.  
  1426.       x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  1427.  
  1428.       y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
  1429.  
  1430.     else
  1431.  
  1432.       # 曲線移動
  1433.  
  1434.       if !@flying_proceed_end
  1435.  
  1436.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  1437.  
  1438.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
  1439.  
  1440.       else
  1441.  
  1442.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  1443.  
  1444.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
  1445.  
  1446.       end
  1447.  
  1448.     end
  1449.  
  1450.     # 座標代入
  1451.  
  1452.     @flying_x = x
  1453.  
  1454.     @flying_y = y
  1455.  
  1456.     # ウエイト
  1457.  
  1458.     if !@flying_proceed_end
  1459.  
  1460.       # 開始
  1461.  
  1462.       @flying_proceed_start = @flying_wait == 0
  1463.  
  1464.       @flying_wait += @flying_anime[1]
  1465.  
  1466.       @flying_wait = [@flying_wait,@flying_distance].min
  1467.  
  1468.       @flying_proceed_end = @flying_wait == @flying_distance
  1469.  
  1470.     else
  1471.  
  1472.       # 開始
  1473.  
  1474.       @flying_return_start = @flying_wait == @flying_distance
  1475.  
  1476.       @flying_wait -= @flying_anime[1]
  1477.  
  1478.       @flying_wait = [@flying_wait,0].max
  1479.  
  1480.       @flying_return_end = @flying_wait == 0
  1481.  
  1482.     end
  1483.  
  1484.     if @flying_anime[1] == 0
  1485.  
  1486.       @flying_end = true
  1487.  
  1488.     elsif !@flying_anime[2]
  1489.  
  1490.       @flying_end = @flying_proceed_end
  1491.  
  1492.     else
  1493.  
  1494.       @flying_end = @flying_return_end
  1495.  
  1496.     end
  1497.  
  1498.     # 値を返す(アニメ開始,アニメ終了)
  1499.  
  1500.     return [@flying_proceed_start,@flying_end]
  1501.  
  1502.   end
  1503.  
  1504.   #--------------------------------------------------------------------------
  1505.  
  1506.   # ● 遠距離アニメ初期化
  1507.  
  1508.   #--------------------------------------------------------------------------
  1509.  
  1510.   def flying_clear
  1511.  
  1512.     @flying_proceed_start = false
  1513.  
  1514.     @flying_proceed_end = false
  1515.  
  1516.     @flying_return_start = false
  1517.  
  1518.     @flying_return_end = false
  1519.  
  1520.     @flying_end = false
  1521.  
  1522.     @flying_anime = [0,0,false]
  1523.  
  1524.   end
  1525.  
  1526.   #--------------------------------------------------------------------------
  1527.  
  1528.   # ● 移動
  1529.  
  1530.   #--------------------------------------------------------------------------
  1531.  
  1532.   def move
  1533.  
  1534.     # 距離の計算
  1535.  
  1536.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1537.  
  1538.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1539.  
  1540.     if @move_distance > 0
  1541.  
  1542.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  1543.  
  1544.       array = @move_coordinates
  1545.  
  1546.       # ジャンプ補正値の計算
  1547.  
  1548.       if @move_distance - @move_wait > @move_distance / 2
  1549.  
  1550.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  1551.  
  1552.       else
  1553.  
  1554.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  1555.  
  1556.       end
  1557.  
  1558.       jump = @move_action[4] > 0 ? -jump : jump
  1559.  
  1560.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  1561.  
  1562.  
  1563.  
  1564.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  1565.  
  1566.       # ウエイト
  1567.  
  1568.       @move_wait -= @move_action[3]
  1569.  
  1570.       @move_wait = [@move_wait,0].max
  1571.  
  1572.     end
  1573.  
  1574.   end
  1575.  
  1576.   #--------------------------------------------------------------------------
  1577.  
  1578.   # ● 移動アクションの取得
  1579.  
  1580.   #--------------------------------------------------------------------------
  1581.  
  1582.   def get_move_action
  1583.  
  1584.     string = @action.split(/#/)[1]
  1585.  
  1586.     string = string.split(/,/)
  1587.  
  1588.     @move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
  1589.  
  1590.   end
  1591.  
  1592.   #--------------------------------------------------------------------------
  1593.  
  1594.   # ● アクションの取得
  1595.  
  1596.   #--------------------------------------------------------------------------
  1597.  
  1598.   def get_step
  1599.  
  1600.     if @action.nil?
  1601.  
  1602.       @step = "finish"
  1603.  
  1604.       return
  1605.     end
  1606.  
  1607.     string = @action.split(/#/)[0]
  1608.  
  1609.     if string =~ "移動"
  1610.  
  1611.       @step = "moving_setup"
  1612.  
  1613.     elsif string =~ "アクターアニメ実行"
  1614.  
  1615.       @step = "action"
  1616.  
  1617.     elsif string =~ "遠距離アニメ"
  1618.  
  1619.       @step = "flying"
  1620.  
  1621.     elsif string =~ "アクターアニメ変更"
  1622.  
  1623.       @step = "change"
  1624.  
  1625.     elsif string =~ "行動アニメ"
  1626.  
  1627.       @step = "animation1"
  1628.  
  1629.     elsif string =~ "対象アニメ"
  1630.  
  1631.       @step = "animation2"
  1632.  
  1633.     elsif string =~ "ウエイト"
  1634.  
  1635.       @step = "wait"
  1636.  
  1637.     elsif string =~ "左右反転"
  1638.  
  1639.       @step = "reverse"
  1640.  
  1641.     elsif string =~ "閃きアニメ"
  1642.  
  1643.       @step = "flash"
  1644.  
  1645.     elsif string =~ "残像表示"
  1646.  
  1647.       @step = "shadow_on"
  1648.  
  1649.     elsif string =~ "残像消去"
  1650.  
  1651.       @step = "shadow_off"
  1652.  
  1653.     elsif string =~ "アクターアニメ固定"
  1654.  
  1655.       @step = "freeze"
  1656.  
  1657.     elsif string =~ "アニメ固定解除"
  1658.  
  1659.       @step = "freeze_lifting"
  1660.  
  1661.     elsif string =~ "アニメーションの表示"
  1662.  
  1663.       @step = "animation_start"
  1664.  
  1665.     elsif string =~ "SEの演奏"
  1666.  
  1667.       @step = "play_se"
  1668.  
  1669.     else
  1670.  
  1671.       @step = "finish"
  1672.  
  1673.     end
  1674.  
  1675.   end
  1676.  
  1677.   #--------------------------------------------------------------------------
  1678.  
  1679.   # ● フレーム更新 (次のアクションへ)
  1680.  
  1681.   #--------------------------------------------------------------------------
  1682.  
  1683.   def update_next
  1684.  
  1685.     @action = @battle_actions.shift
  1686.  
  1687.     @step = get_step
  1688.  
  1689.   end
  1690.  
  1691.   #--------------------------------------------------------------------------
  1692.  
  1693.   # ● フレーム更新 (動作取得)
  1694.  
  1695.   #--------------------------------------------------------------------------
  1696.  
  1697.   def update_setup
  1698.  
  1699.     # アクションの取得
  1700.  
  1701.     self.get_actions
  1702.  
  1703.     @action = @battle_actions.shift
  1704.  
  1705.     @step = get_step
  1706.  
  1707.   end
  1708.  
  1709.   #--------------------------------------------------------------------------
  1710.  
  1711.   # ● フレーム更新 (移動取得)
  1712.  
  1713.   #--------------------------------------------------------------------------
  1714.  
  1715.   def update_moving_setup
  1716.  
  1717.     # 移動アクションの取得
  1718.  
  1719.     self.get_move_action
  1720.  
  1721.     # 移動目標の設定
  1722.  
  1723.     self.move_setup
  1724.  
  1725.     @step = "moving"
  1726.  
  1727.   end
  1728.  
  1729.   #--------------------------------------------------------------------------
  1730.  
  1731.   # ● フレーム更新 (移動)
  1732.  
  1733.   #--------------------------------------------------------------------------
  1734.  
  1735.   def update_moving
  1736.  
  1737.     # 移動
  1738.  
  1739.     self.move
  1740.  
  1741.     self.condition = @battler_condition
  1742.  
  1743.     # 移動完了したら次のステップへ
  1744.  
  1745.     if move_end?
  1746.  
  1747.       @wait_count = 2
  1748.  
  1749.       @action = @battle_actions.shift
  1750.  
  1751.       @step = get_step
  1752.  
  1753.     end
  1754.  
  1755.   end
  1756.  
  1757.   #--------------------------------------------------------------------------
  1758.  
  1759.   # ● フレーム更新 (アニメ実行)
  1760.  
  1761.   #--------------------------------------------------------------------------
  1762.  
  1763.   def update_action
  1764.  
  1765.     con = @action.split(/#/)[1]
  1766.  
  1767.     # 右手・左手を分ける
  1768.  
  1769.     if DUAL_WEAPONS_ANIME.include?(con)
  1770.  
  1771.       if !@first_weapon and @second_weapon
  1772.  
  1773.         con = con + "_L"
  1774.  
  1775.       else
  1776.  
  1777.         con = con + "_R"
  1778.  
  1779.       end
  1780.  
  1781.     end
  1782.  
  1783.     # アニメ変更
  1784.  
  1785.     self.condition = con
  1786.  
  1787.     # ループか否か
  1788.  
  1789.     if !ANIME[@battler_condition][1]
  1790.  
  1791.       self.anime_on
  1792.  
  1793.     end
  1794.  
  1795.     @action = @battle_actions.shift
  1796.  
  1797.     @step = get_step
  1798.  
  1799.   end
  1800.  
  1801.   #--------------------------------------------------------------------------
  1802.  
  1803.   # ● フレーム更新 (遠距離アニメ)
  1804.  
  1805.   #--------------------------------------------------------------------------
  1806.  
  1807.   def update_flying
  1808.  
  1809.     # 目標の設定
  1810.  
  1811.     self.flying_setup
  1812.  
  1813.     # 遠距離アニメ終了
  1814.  
  1815.     if @flying_end
  1816.  
  1817.       self.flying_clear
  1818.  
  1819.       @action = @battle_actions.shift
  1820.  
  1821.       @step = get_step
  1822.  
  1823.     end
  1824.  
  1825.   end
  1826.  
  1827.   #--------------------------------------------------------------------------
  1828.  
  1829.   # ● フレーム更新 (アニメ変更)
  1830.  
  1831.   #--------------------------------------------------------------------------
  1832.  
  1833.   def update_change
  1834.  
  1835.     con = @action.split(/#/)[1]
  1836.  
  1837.     # 右手・左手を分ける
  1838.  
  1839.     if DUAL_WEAPONS_ANIME.include?(con)
  1840.  
  1841.       if !@first_weapon and @second_weapon
  1842.  
  1843.         con = con + "_L"
  1844.  
  1845.       else
  1846.  
  1847.         con = con + "_R"
  1848.  
  1849.       end
  1850.  
  1851.     end
  1852.  
  1853.     # アニメ変更
  1854.  
  1855.     self.condition = con
  1856.  
  1857.     # ループか否か
  1858.  
  1859.     if !ANIME[@battler_condition][1]
  1860.  
  1861.       self.anime_on
  1862.  
  1863.     end
  1864.  
  1865.     @action = @battle_actions.shift
  1866.  
  1867.     @step = get_step
  1868.  
  1869.   end
  1870.  
  1871.   #--------------------------------------------------------------------------
  1872.  
  1873.   # ● フレーム更新 (行動アニメ)
  1874.  
  1875.   #--------------------------------------------------------------------------
  1876.  
  1877.   def update_animation1
  1878.  
  1879.     @animation1_on = true
  1880.  
  1881.     # 行動アニメの後に行動を開始する
  1882.  
  1883.     if $scene.phase4_step == 3
  1884.  
  1885.       id = RTAB ? @anime1 : $scene.animation1_id
  1886.  
  1887.       animation = $data_animations[id]
  1888.  
  1889.       frame_max = animation != nil ? animation.frame_max : 0
  1890.  
  1891.       @wait_count2 = frame_max * 2
  1892.  
  1893.       return
  1894.  
  1895.     end
  1896.  
  1897.     @action = @battle_actions.shift
  1898.  
  1899.     @step = get_step
  1900.  
  1901.   end
  1902.  
  1903.   #--------------------------------------------------------------------------
  1904.  
  1905.   # ● フレーム更新 (対象アニメ)
  1906.  
  1907.   #--------------------------------------------------------------------------
  1908.  
  1909.   def update_animation2
  1910.  
  1911.     @animation2_on = true
  1912.  
  1913.     # 行動アニメの後に行動を開始する
  1914.  
  1915.     if $scene.phase4_step == 4
  1916.  
  1917.       id = RTAB ? @anime2 : $scene.animation2_id
  1918.  
  1919.       animation = $data_animations[id]
  1920.  
  1921.       frame_max = animation != nil ? animation.frame_max : 0
  1922.  
  1923.       @wait_count2 = frame_max * 2
  1924.  
  1925.       return
  1926.  
  1927.     end
  1928.  
  1929.     @action = @battle_actions.shift
  1930.  
  1931.     @step = get_step
  1932.  
  1933.   end
  1934.  
  1935.   #--------------------------------------------------------------------------
  1936.  
  1937.   # ● フレーム更新 (ウエイト)
  1938.  
  1939.   #--------------------------------------------------------------------------
  1940.  
  1941.   def update_wait
  1942.  
  1943.     @wait_count2 = @action.split(/#/)[1].to_i
  1944.  
  1945.     @action = @battle_actions.shift
  1946.  
  1947.     @step = get_step
  1948.  
  1949.   end
  1950.  
  1951.   #--------------------------------------------------------------------------
  1952.  
  1953.   # ● フレーム更新 (残像表示)
  1954.  
  1955.   #--------------------------------------------------------------------------
  1956.  
  1957.   def update_shadow_on
  1958.  
  1959.     @shadow = true
  1960.  
  1961.     @action = @battle_actions.shift
  1962.  
  1963.     @step = get_step
  1964.  
  1965.   end
  1966.  
  1967.   #--------------------------------------------------------------------------
  1968.  
  1969.   # ● フレーム更新 (残像消去)
  1970.  
  1971.   #--------------------------------------------------------------------------
  1972.  
  1973.   def update_shadow_off
  1974.  
  1975.     @shadow = false
  1976.  
  1977.     @action = @battle_actions.shift
  1978.  
  1979.     @step = get_step
  1980.  
  1981.   end
  1982.  
  1983.   #--------------------------------------------------------------------------
  1984.  
  1985.   # ● フレーム更新 (左右反転)
  1986.  
  1987.   #--------------------------------------------------------------------------
  1988.  
  1989.   def update_reverse
  1990.  
  1991.     @reverse = @reverse ? false : true
  1992.  
  1993.     @action = @battle_actions.shift
  1994.  
  1995.     @step = get_step
  1996.  
  1997.   end
  1998.  
  1999.   #--------------------------------------------------------------------------
  2000.  
  2001.   # ● フレーム更新 (閃きアニメ)
  2002.  
  2003.   #--------------------------------------------------------------------------
  2004.  
  2005.   def update_flash
  2006.  
  2007.     # 閃きアニメの後に行動を開始する
  2008.  
  2009.     if @flash_flag["normal"]
  2010.  
  2011.       @wait_count = $scene.flash_duration
  2012.  
  2013.       @flash_flag["normal"] = false
  2014.  
  2015.       return
  2016.  
  2017.     end
  2018.  
  2019.     @action = @battle_actions.shift
  2020.  
  2021.     @step = get_step
  2022.  
  2023.   end
  2024.  
  2025.   #--------------------------------------------------------------------------
  2026.  
  2027.   # ● フレーム更新 (SEの演奏)
  2028.  
  2029.   #--------------------------------------------------------------------------
  2030.  
  2031.   def update_play_se
  2032.  
  2033.     data = @action.split(/#/)[1]
  2034.  
  2035.     data = data.split(/,/)
  2036.  
  2037.     # SE を演奏
  2038.  
  2039.     Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
  2040.  
  2041.     @action = @battle_actions.shift
  2042.  
  2043.     @step = get_step
  2044.  
  2045.   end
  2046.  
  2047.   #--------------------------------------------------------------------------
  2048.  
  2049.   # ● フレーム更新 (アクターアニメ固定)
  2050.  
  2051.   #--------------------------------------------------------------------------
  2052.  
  2053.   def update_freeze
  2054.  
  2055.     con = @action.split(/#/)[1]
  2056.  
  2057.     # 右手・左手を分ける
  2058.  
  2059.     if DUAL_WEAPONS_ANIME.include?(con)
  2060.  
  2061.       if !@first_weapon and @second_weapon
  2062.  
  2063.         con = con + "_L"
  2064.  
  2065.       else
  2066.  
  2067.         con = con + "_R"
  2068.  
  2069.       end
  2070.  
  2071.     end
  2072.  
  2073.     # アニメ変更
  2074.  
  2075.     self.condition = con
  2076.  
  2077.     @pattern = @action.split(/#/)[2].to_i
  2078.  
  2079.     @pattern_freeze = true
  2080.  
  2081.     @condition_freeze = true
  2082.  
  2083.     @action = @battle_actions.shift
  2084.  
  2085.     @step = get_step
  2086.  
  2087.   end
  2088.  
  2089.   #--------------------------------------------------------------------------
  2090.  
  2091.   # ● フレーム更新 (アクターアニメ固定解除)
  2092.  
  2093.   #--------------------------------------------------------------------------
  2094.  
  2095.   def update_freeze_lifting
  2096.  
  2097.     @pattern_freeze = false
  2098.  
  2099.     @condition_freeze = false
  2100.  
  2101.     @action = @battle_actions.shift
  2102.  
  2103.     @step = get_step
  2104.  
  2105.   end
  2106.  
  2107.   #--------------------------------------------------------------------------
  2108.  
  2109.   # ● フレーム更新 (アニメーションの表示)
  2110.  
  2111.   #--------------------------------------------------------------------------
  2112.  
  2113.   def update_animation_start
  2114.  
  2115.     data = @action.split(/#/)[1]
  2116.  
  2117.     data = data.split(/,/)
  2118.  
  2119.     target = data[0]
  2120.     animation_id = data[1].to_i
  2121.  
  2122.     if RTAB
  2123.  
  2124.       case target
  2125.  
  2126.       when "self"
  2127.  
  2128.         @animation.push([animation_id,true])
  2129.  
  2130.       when "target"
  2131.  
  2132.         for tar in @target
  2133.  
  2134.           tar.animation.push([animation_id, true])
  2135.  
  2136.         end
  2137.  
  2138.       end
  2139.  
  2140.     else
  2141.  
  2142.       case target
  2143.  
  2144.       when "self"
  2145.  
  2146.         @animation_id = animation_id
  2147.  
  2148.         @animation_hit = true
  2149.  
  2150.       when "target"
  2151.  
  2152.         for tar in $scene.target_battlers
  2153.  
  2154.           tar.animation_id = animation_id
  2155.  
  2156.           tar.animation_hit = true
  2157.  
  2158.         end
  2159.  
  2160.       end
  2161.  
  2162.     end
  2163.  
  2164.     @action = @battle_actions.shift
  2165.  
  2166.     @step = get_step
  2167.  
  2168.   end
  2169.  
  2170.   #--------------------------------------------------------------------------
  2171.  
  2172.   # ● フレーム更新 (動作終了)
  2173.  
  2174.   #--------------------------------------------------------------------------
  2175.  
  2176.   def update_finish
  2177.  
  2178.     # 動作終了
  2179.  
  2180.     @battler_action = false
  2181.  
  2182.     @step = "setup"
  2183.  
  2184.   end
  2185.  
  2186.   #--------------------------------------------------------------------------
  2187.  
  2188.   # ● バトラーの状態 変更(バトラーグラフィックのタイプ)
  2189.  
  2190.   #--------------------------------------------------------------------------
  2191.  
  2192.   def condition=(condition)
  2193.  
  2194.     return if @condition_freeze
  2195.  
  2196.     @battler_condition = condition
  2197.  
  2198.     @wait_count = ANIME[condition][2]
  2199.  
  2200.   end
  2201.  
  2202.   #--------------------------------------------------------------------------
  2203.  
  2204.   # ● バトラーの状態(バトラーグラフィックのタイプ)
  2205.  
  2206.   #--------------------------------------------------------------------------
  2207.  
  2208.   def condition
  2209.  
  2210.     return @battler_condition
  2211.  
  2212.   end
  2213.  
  2214.   #--------------------------------------------------------------------------
  2215.  
  2216.   # ● フレーム更新
  2217.  
  2218.   #--------------------------------------------------------------------------
  2219.  
  2220.   def update
  2221.  
  2222.     # ウェイト中の場合
  2223.  
  2224.     if @wait_count > 0
  2225.  
  2226.       return
  2227.  
  2228.     end
  2229.  
  2230.     # パターン更新
  2231.  
  2232.     self.char_animation
  2233.  
  2234.     # ウェイト中の場合
  2235.  
  2236.     if @wait_count2 > 0
  2237.  
  2238.       return
  2239.  
  2240.     end
  2241.  
  2242.  
  2243.     # 行動アニメーション
  2244.  
  2245.     if @battler_action
  2246.  
  2247.       method("update_" + @step).call
  2248.  
  2249.       return
  2250.  
  2251.     end
  2252.  
  2253.  
  2254.     # データ初期化
  2255.  
  2256.     @animation1_on = false
  2257.  
  2258.     @animation2_on = false
  2259.  
  2260.     @action = nil
  2261.  
  2262.     @battle_actions = []
  2263.  
  2264.     @move_wait = 0
  2265.  
  2266.     @move_distance = nil
  2267.  
  2268.     @flying_wait = 0
  2269.  
  2270.     @flying_distance = nil
  2271.  
  2272.     @flash = false
  2273.  
  2274.  
  2275.     # RTAB対応
  2276.  
  2277.     # 通常・待機
  2278.  
  2279.     return self.condition = NORMAL
  2280.  
  2281.   end
  2282.  
  2283.   #--------------------------------------------------------------------------
  2284.  
  2285.   # ● アクションの取得
  2286.  
  2287.   #--------------------------------------------------------------------------
  2288.  
  2289.   def get_actions
  2290.  
  2291.     skill = $data_skills[self.current_action.skill_id]
  2292.  
  2293.     item = $data_items[self.current_action.item_id]
  2294.  
  2295.     kind = self.current_action.kind
  2296.  
  2297.     # 動作取得
  2298.  
  2299.     @battle_actions = []
  2300.  
  2301.     # スキル
  2302.  
  2303.     if skill != nil && kind == 1
  2304.  
  2305.       @battle_actions = skill.battle_actions.dup
  2306.  
  2307.       @flying_anime = skill.flying_anime
  2308.  
  2309.     # アイテム
  2310.  
  2311.     elsif item != nil && kind == 2
  2312.  
  2313.       @battle_actions = item.battle_actions.dup
  2314.  
  2315.       @flying_anime = item.flying_anime
  2316.  
  2317.     # 左手攻撃
  2318.  
  2319.     elsif !@first_weapon and @second_weapon and (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce))
  2320.  
  2321.  
  2322.       @battle_actions = self.battle_actions2.dup
  2323.  
  2324.       @flying_anime = self.flying_anime2
  2325.  
  2326.     # 右手攻撃
  2327.  
  2328.     elsif self.current_action.basic == 0 and
  2329.  
  2330.       (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce)) and self.current_action.kind == 0
  2331.  
  2332.       @battle_actions = self.battle_actions1.dup
  2333.  
  2334.       @flying_anime = self.flying_anime1
  2335.  
  2336.     # 通常攻撃
  2337.  
  2338.     elsif self.current_action.basic == 0 and self.current_action.kind == 0
  2339.  
  2340.       # 这里啊~~ =。=b
  2341.  
  2342.       if !self.is_a?(Game_Actor) and !self.nce
  2343.  
  2344.         @battle_actions = self.battle_actions1.dup
  2345.  
  2346.       else
  2347.  
  2348.         @battle_actions = BattleActions::Actions["エネミー攻撃"].dup
  2349.  
  2350.       end
  2351.  
  2352.       @flying_anime = self.flying_anime
  2353.  
  2354.     else
  2355.  
  2356.       @battle_actions = ["終了"]
  2357.  
  2358.       @flying_anime = [0,0,false,false]
  2359.  
  2360.     end
  2361.  
  2362.   end
  2363.  
  2364.   #--------------------------------------------------------------------------
  2365.  
  2366.   # ● ループしないアニメのセット
  2367.  
  2368.   #--------------------------------------------------------------------------
  2369.  
  2370.   def anime_on
  2371.  
  2372.     @pattern = 0
  2373.  
  2374.     @pattern_log = true
  2375.  
  2376.     return
  2377.  
  2378.   end
  2379.  
  2380.   #--------------------------------------------------------------------------
  2381.  
  2382.   # ● パターン更新
  2383.  
  2384.   #--------------------------------------------------------------------------
  2385.  
  2386.   def char_animation
  2387.  
  2388.     # パタン固定の場合もどる
  2389.  
  2390.     return if @pattern_freeze
  2391.  
  2392.     # ループしないアニメの場合 1234 で止まる
  2393.  
  2394.     if !ANIME[@battler_condition][1] && @pattern == 3
  2395.  
  2396.       return
  2397.  
  2398.     end
  2399.  
  2400.     # アニメさせない場合 1 で止まる
  2401.  
  2402.     if ANIME[@battler_condition][4]
  2403.  
  2404.       @pattern = 0
  2405.  
  2406.       return
  2407.  
  2408.     end
  2409.  
  2410.     @pattern = (@pattern + 1) % 4
  2411.  
  2412.   end
  2413.  
  2414.   #--------------------------------------------------------------------------
  2415.  
  2416.   # ● アニメタイプ
  2417.  
  2418.   #--------------------------------------------------------------------------
  2419.  
  2420.   def anime_type
  2421.  
  2422.     return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  2423.  
  2424.   end
  2425.  
  2426. end
  2427.  
  2428. #==============================================================================
  2429.  
  2430. # ■ Game_Actor
  2431.  
  2432. #==============================================================================
  2433.  
  2434. class Game_Actor < Game_Battler
  2435.  
  2436.   include Side_view
  2437.  
  2438.   #--------------------------------------------------------------------------
  2439.  
  2440.   # ● セットアップ
  2441.  
  2442.   #--------------------------------------------------------------------------
  2443.  
  2444.   alias side_view_setup setup
  2445.   def setup(actor_id)
  2446.  
  2447.     side_view_setup(actor_id)
  2448.  
  2449.     start_battle
  2450.  
  2451.   end
  2452.  
  2453.   #--------------------------------------------------------------------------
  2454.  
  2455.   # ● 二刀武器のID取得 ※エラー回避用
  2456.  
  2457.   #--------------------------------------------------------------------------
  2458.  
  2459.   def weapon2_id
  2460.  
  2461.     return @weapon2_id != nil ? @weapon2_id : 0
  2462.  
  2463.   end
  2464.  
  2465.   #--------------------------------------------------------------------------
  2466.  
  2467.   # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  2468.  
  2469.   #--------------------------------------------------------------------------
  2470.  
  2471.   def position
  2472.  
  2473.     return $data_classes[@class_id].position
  2474.  
  2475.   end
  2476.  
  2477.   #--------------------------------------------------------------------------
  2478.  
  2479.   # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  2480.  
  2481.   #--------------------------------------------------------------------------
  2482.  
  2483.   def position2
  2484.  
  2485.     return self.index
  2486.  
  2487.   end
  2488.  
  2489.   #--------------------------------------------------------------------------
  2490.  
  2491.   # ● 武器アニメタイプ
  2492.  
  2493.   #--------------------------------------------------------------------------
  2494.  
  2495.   def weapon_anime_type(type)
  2496.  
  2497.     file_name  = weapon_anime_type0(type)
  2498.  
  2499.     visible   = weapon_anime_type1(type)
  2500.  
  2501.     z         = weapon_anime_type2(type)
  2502.  
  2503.     return [file_name,visible,z]
  2504.  
  2505.   end
  2506.  
  2507.   # 武器アイコン取得
  2508.  
  2509.   def weapon_anime_type0(type)
  2510.  
  2511.     type = ANIME[type][5]
  2512.  
  2513.     return weapon_anime1 if type == "右手"
  2514.  
  2515.     return weapon_anime2 if type == "左手"
  2516.  
  2517.     return nil
  2518.  
  2519.   end
  2520.  
  2521.   # 表示・非表示の取得
  2522.  
  2523.   def weapon_anime_type1(type)
  2524.  
  2525.     return ANIME[type][3]
  2526.  
  2527.   end
  2528.  
  2529.   # バトラーより上に表示するかどうか
  2530.  
  2531.   def weapon_anime_type2(type)
  2532.  
  2533.     type = ANIME[type][5]
  2534.  
  2535.     return true if type == "左手"
  2536.  
  2537.     return false
  2538.  
  2539.   end
  2540.  
  2541.   #--------------------------------------------------------------------------
  2542.  
  2543.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  2544.  
  2545.   #--------------------------------------------------------------------------
  2546.  
  2547.   def true_x
  2548.  
  2549.     return PARTY_X + position * FORMATION_X + @ox
  2550.  
  2551.   end
  2552.  
  2553.   #--------------------------------------------------------------------------
  2554.  
  2555.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  2556.  
  2557.   #--------------------------------------------------------------------------
  2558.  
  2559.   def true_y
  2560.  
  2561.     # パーティ内の並び順から Y 座標を計算して返す
  2562.  
  2563.     if self.index != nil
  2564.  
  2565.       y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
  2566.  
  2567.       return y
  2568.  
  2569.     else
  2570.  
  2571.       return 0
  2572.  
  2573.     end
  2574.  
  2575.   end
  2576.  
  2577.   #--------------------------------------------------------------------------
  2578.  
  2579.   # ● バトル画面 X 座標の取得
  2580.  
  2581.   #--------------------------------------------------------------------------
  2582.  
  2583.   def screen_x(true_x = self.true_x)
  2584.  
  2585.     return 320 + (true_x - 320) * @real_zoom + @real_x
  2586.  
  2587.   end
  2588.  
  2589.   #--------------------------------------------------------------------------
  2590.  
  2591.   # ● バトル画面 Y 座標の取得
  2592.  
  2593.   #--------------------------------------------------------------------------
  2594.  
  2595.   def screen_y(true_y = self.true_y)
  2596.  
  2597.     return true_y * @real_zoom + @real_y
  2598.  
  2599.   end
  2600.  
  2601.   #--------------------------------------------------------------------------
  2602.  
  2603.   # ● バトル画面 Z 座標の取得
  2604.  
  2605.   #--------------------------------------------------------------------------
  2606.  
  2607.   def screen_z
  2608.  
  2609.     return screen_y + 1000
  2610.  
  2611.   end
  2612.  
  2613.   #--------------------------------------------------------------------------
  2614.  
  2615.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  2616.  
  2617.   #--------------------------------------------------------------------------
  2618.  
  2619.   def base_x
  2620.  
  2621.     return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  2622.  
  2623.   end
  2624.  
  2625.   #--------------------------------------------------------------------------
  2626.  
  2627.   # ● バトル画面 Y 座標の取得
  2628.  
  2629.   #--------------------------------------------------------------------------
  2630.  
  2631.   def base_y
  2632.  
  2633.     return (true_y - @oy) * @real_zoom + @real_y
  2634.  
  2635.   end
  2636.  
  2637.   #--------------------------------------------------------------------------
  2638.  
  2639.   # ● バトル画面 拡大率の取得
  2640.  
  2641.   #--------------------------------------------------------------------------
  2642.  
  2643.   def zoom
  2644.  
  2645.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  2646.  
  2647.                           (true_x + @fly) / 480 + $scene.zoom_rate[0]
  2648.  
  2649.   end
  2650.  
  2651.   #--------------------------------------------------------------------------
  2652.  
  2653.   # ● 攻撃用、バトル画面 X 座標の取得
  2654.  
  2655.   #--------------------------------------------------------------------------
  2656.  
  2657.   def attack_x(z)
  2658.  
  2659.     return (320 - true_x) * z * 0.75
  2660.  
  2661.   end
  2662.  
  2663.   #--------------------------------------------------------------------------
  2664.  
  2665.   # ● 攻撃用、バトル画面 Y 座標の取得
  2666.  
  2667.   #--------------------------------------------------------------------------
  2668.  
  2669.   def attack_y(z)
  2670.  
  2671.     return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  2672.  
  2673.   end
  2674.  
  2675.   #--------------------------------------------------------------------------
  2676.  
  2677.   # ● 閃き待ち時間
  2678.  
  2679.   #--------------------------------------------------------------------------
  2680.  
  2681.   def flash_duration
  2682.  
  2683.     return $scene.flash_duration
  2684.  
  2685.   end
  2686.  
  2687.   #--------------------------------------------------------------------------
  2688.  
  2689.   # ● アニメーション取得
  2690.  
  2691.   #--------------------------------------------------------------------------
  2692.  
  2693.   def battle_actions1
  2694.  
  2695.     weapon = $data_weapons[@weapon_id]
  2696.  
  2697.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  2698.  
  2699.   end
  2700.  
  2701.   #--------------------------------------------------------------------------
  2702.  
  2703.   # ● アニメーション取得
  2704.  
  2705.   #--------------------------------------------------------------------------
  2706.  
  2707.   def battle_actions2
  2708.  
  2709.     weapon = $data_weapons[@weapon2_id]
  2710.  
  2711.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  2712.  
  2713.   end
  2714.  
  2715.   #--------------------------------------------------------------------------
  2716.  
  2717.   # ● 武器アニメーション取得
  2718.  
  2719.   #--------------------------------------------------------------------------
  2720.  
  2721.   def weapon_anime1
  2722.  
  2723.     weapon = $data_weapons[@weapon_id]
  2724.  
  2725.     return weapon != nil ? weapon.icon_name : ""
  2726.  
  2727.   end
  2728.  
  2729.   #--------------------------------------------------------------------------
  2730.  
  2731.   # ● 武器アニメーション取得
  2732.  
  2733.   #--------------------------------------------------------------------------
  2734.  
  2735.   def weapon_anime2
  2736.  
  2737.     weapon = $data_weapons[@weapon2_id]
  2738.  
  2739.     return weapon != nil ? weapon.icon_name : ""
  2740.  
  2741.   end
  2742.  
  2743.   #--------------------------------------------------------------------------
  2744.  
  2745.   # ● 遠距離アニメーション取得
  2746.  
  2747.   #--------------------------------------------------------------------------
  2748.  
  2749.   def flying_anime1
  2750.  
  2751.     weapon = $data_weapons[@weapon_id]
  2752.  
  2753.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  2754.  
  2755.   end
  2756.  
  2757.   #--------------------------------------------------------------------------
  2758.  
  2759.   # ● 遠距離アニメーション取得
  2760.  
  2761.   #--------------------------------------------------------------------------
  2762.  
  2763.   def flying_anime2
  2764.  
  2765.     weapon = $data_weapons[@weapon2_id]
  2766.  
  2767.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  2768.  
  2769.   end
  2770.  
  2771.   #--------------------------------------------------------------------------
  2772.  
  2773.   # ● 移動目標座標の計算
  2774.  
  2775.   #--------------------------------------------------------------------------
  2776.  
  2777.   def move_setup
  2778.  
  2779.     if RTAB
  2780.  
  2781.       targets = @target
  2782.  
  2783.     else
  2784.  
  2785.       targets = $scene.target_battlers
  2786.  
  2787.     end
  2788.  
  2789.     case @move_action[0]
  2790.  
  2791.     when "self" # 自分
  2792.  
  2793.       @target_x = self.base_x
  2794.  
  2795.       @target_y = self.base_y
  2796.  
  2797.     when "target_near" # 一番近くのターゲット
  2798.  
  2799.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  2800.  
  2801.       targets.reverse!
  2802.  
  2803.       if targets != []
  2804.  
  2805.         @target_x = targets[0].screen_x
  2806.  
  2807.         @target_y = targets[0].screen_y
  2808.  
  2809.       else
  2810.  
  2811.         @target_x = self.base_x
  2812.  
  2813.         @target_y = self.base_y
  2814.  
  2815.       end
  2816.  
  2817.     when "target_far" # 一番遠くのターゲット
  2818.  
  2819.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  2820.  
  2821.       if targets != []
  2822.  
  2823.         @target_x = targets[0].screen_x
  2824.  
  2825.         @target_y = targets[0].screen_y
  2826.  
  2827.       else
  2828.  
  2829.         @target_x = self.base_x
  2830.  
  2831.         @target_y = self.base_y
  2832.  
  2833.       end
  2834.  
  2835.     when "target" # ターゲット中央
  2836.  
  2837.       @target_x = 0
  2838.  
  2839.       @target_y = 0
  2840.  
  2841.       for t in targets
  2842.  
  2843.         @target_x += t.screen_x
  2844.  
  2845.         @target_y += t.screen_y
  2846.  
  2847.       end
  2848.  
  2849.       if targets != []
  2850.  
  2851.         @target_x /= targets.size
  2852.  
  2853.         @target_y /= targets.size
  2854.  
  2855.       end
  2856.  
  2857.     when "troop" # "トループ中央"
  2858.  
  2859.       @target_x = 0
  2860.  
  2861.       @target_y = 0
  2862.  
  2863.       for t in $game_troop.enemies
  2864.  
  2865.         @target_x += t.screen_x
  2866.  
  2867.         @target_y += t.screen_y
  2868.  
  2869.       end
  2870.  
  2871.       if $game_troop.enemies != []
  2872.  
  2873.         @target_x /= $game_troop.enemies.size
  2874.  
  2875.         @target_y /= $game_troop.enemies.size
  2876.  
  2877.       end
  2878.  
  2879.     when "party" # "パーティ中央"
  2880.  
  2881.       @target_x = 0
  2882.  
  2883.       @target_y = 0
  2884.  
  2885.       for t in $game_party.actors
  2886.  
  2887.         @target_x += t.screen_x
  2888.  
  2889.         @target_y += t.screen_y
  2890.  
  2891.       end
  2892.  
  2893.       if $game_party.actors != []
  2894.  
  2895.         @target_x /= $game_party.actors.size
  2896.  
  2897.         @target_y /= $game_party.actors.size
  2898.  
  2899.       end
  2900.  
  2901.     when "screen" # "画面"
  2902.  
  2903.       @target_x = self.base_x
  2904.  
  2905.       @target_y = self.base_y
  2906.  
  2907.     end
  2908.  
  2909.     # 補正
  2910.  
  2911.     @target_x += @move_action[1] - self.base_x
  2912.  
  2913.     @target_y += @move_action[2] - self.base_y
  2914.  
  2915.     # 移動目標の座標をセット
  2916.  
  2917.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  2918.  
  2919.     # 距離の計算(ウエイトの設定)
  2920.  
  2921.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  2922.  
  2923.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  2924.  
  2925.   end
  2926.  
  2927. end
  2928.  
  2929. #==============================================================================
  2930.  
  2931. # ■ Game_Enemy
  2932.  
  2933. #==============================================================================
  2934.  
  2935. class Game_Enemy < Game_Battler
  2936.  
  2937.   attr_reader   :nce
  2938.  
  2939.   #--------------------------------------------------------------------------
  2940.  
  2941.   # ● セットアップ
  2942.  
  2943.   #--------------------------------------------------------------------------
  2944.  
  2945.   alias side_view_initialize initialize
  2946.  
  2947.   def initialize(troop_id, member_index)
  2948.  
  2949.     side_view_initialize(troop_id, member_index)
  2950.  
  2951.     start_battle
  2952.  
  2953.     @nce = NOT_CHARACTER_EMEMY.include? @enemy_id
  2954.  
  2955.     @weapon_id  = EMEMY_WEAPO[@enemy_id] != nil ? EMEMY_WEAPO[@enemy_id] : 0
  2956.  
  2957.     @weapon_id2  = EMEMY_WEAPO2[@enemy_id] != nil ? EMEMY_WEAPO2[@enemy_id] : 0
  2958.  
  2959.   end
  2960.  
  2961.   def character_name
  2962.  
  2963.     return self.battler_name
  2964.  
  2965.   end
  2966.  
  2967.   def character_hue
  2968.  
  2969.     return self.battler_hue
  2970.  
  2971.   end
  2972.  
  2973.   #--------------------------------------------------------------------------
  2974.  
  2975.   # ● 移動
  2976.  
  2977.   #--------------------------------------------------------------------------
  2978.  
  2979.   def move
  2980.  
  2981.     # 距離の計算
  2982.  
  2983.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  2984.  
  2985.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  2986.  
  2987.     if @move_distance > 0
  2988.  
  2989.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  2990.  
  2991.       array = @move_coordinates
  2992.  
  2993.       # ジャンプ補正値の計算
  2994.  
  2995.       if @move_distance - @move_wait > @move_distance / 2
  2996.  
  2997.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  2998.  
  2999.       else
  3000.  
  3001.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  3002.  
  3003.       end
  3004.  
  3005.       jump = @move_action[4] > 0 ? -jump : jump
  3006.  
  3007.       jump = 0 if @weapon_id + @weapon_id2 == 0
  3008.  
  3009.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  3010.  
  3011.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  3012.  
  3013.       # ウエイト
  3014.  
  3015.       @move_wait -= @move_action[3]
  3016.  
  3017.       @move_wait = [@move_wait,0].max
  3018.  
  3019.     end
  3020.  
  3021.   end
  3022.  
  3023.   #--------------------------------------------------------------------------
  3024.  
  3025.   # ● 武器アニメタイプ
  3026.  
  3027.   #--------------------------------------------------------------------------
  3028.  
  3029.   def weapon_anime_type(type)
  3030.  
  3031.     file_name  = weapon_anime_type0(type)
  3032.  
  3033.     visible   = weapon_anime_type1(type)
  3034.  
  3035.     z         = weapon_anime_type2(type)
  3036.  
  3037.     return [file_name,visible,z]
  3038.  
  3039.   end
  3040.  
  3041.   # 武器アイコン取得
  3042.  
  3043.   def weapon_anime_type0(type)
  3044.  
  3045.     type = ANIME[type][5]
  3046.  
  3047.     return weapon_anime1 if type == "右手"
  3048.  
  3049.     return weapon_anime2 if type == "左手"
  3050.  
  3051.     return nil
  3052.  
  3053.   end
  3054.  
  3055.   # 表示・非表示の取得
  3056.  
  3057.   def weapon_anime_type1(type)
  3058.  
  3059.     return ANIME[type][3]
  3060.  
  3061.   end
  3062.  
  3063.   # バトラーより上に表示するかどうか
  3064.  
  3065.   def weapon_anime_type2(type)
  3066.  
  3067.     type = ANIME[type][5]
  3068.  
  3069.     return true if type == "左手"
  3070.  
  3071.     return false
  3072.  
  3073.   end
  3074.  
  3075.  
  3076.   #--------------------------------------------------------------------------
  3077.  
  3078.   # ● 移動目標座標の計算
  3079.  
  3080.   #--------------------------------------------------------------------------
  3081.  
  3082.   def move_setup
  3083.  
  3084.     if RTAB
  3085.  
  3086.       targets = @target
  3087.  
  3088.     else
  3089.  
  3090.       targets = $scene.target_battlers
  3091.  
  3092.     end
  3093.  
  3094.     case @move_action[0]
  3095.  
  3096.     when "self" # 自分
  3097.  
  3098.       @target_x = self.base_x
  3099.  
  3100.       @target_y = self.base_y
  3101.  
  3102.     when "target_near" # 一番近くのターゲット
  3103.  
  3104.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  3105.  
  3106.       if targets != []
  3107.  
  3108.         @target_x = targets[0].screen_x
  3109.  
  3110.         @target_y = targets[0].screen_y
  3111.  
  3112.       else
  3113.  
  3114.         @target_x = self.base_x
  3115.  
  3116.         @target_y = self.base_y
  3117.  
  3118.       end
  3119.  
  3120.     when "target_far" # 一番遠くのターゲット
  3121.  
  3122.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  3123.  
  3124.       targets.reverse!
  3125.  
  3126.       if targets != []
  3127.  
  3128.         @target_x = targets[0].screen_x
  3129.  
  3130.         @target_y = targets[0].screen_y
  3131.  
  3132.       else
  3133.  
  3134.         @target_x = self.base_x
  3135.  
  3136.         @target_y = self.base_y
  3137.  
  3138.       end
  3139.  
  3140.     when "target" # ターゲット中央
  3141.  
  3142.       @target_x = 0
  3143.  
  3144.       @target_y = 0
  3145.  
  3146.       for t in targets
  3147.  
  3148.         @target_x += t.screen_x
  3149.  
  3150.         @target_y += t.screen_y
  3151.  
  3152.       end
  3153.  
  3154.       if targets != []
  3155.  
  3156.         @target_x /= targets.size
  3157.  
  3158.         @target_y /= targets.size
  3159.  
  3160.       end
  3161.  
  3162.     when  "party" # "トループ中央"
  3163.  
  3164.       @target_x = 0
  3165.  
  3166.       @target_y = 0
  3167.  
  3168.       for t in $game_troop.enemies
  3169.  
  3170.         @target_x += t.screen_x
  3171.  
  3172.         @target_y += t.screen_y
  3173.  
  3174.       end
  3175.  
  3176.       if $game_troop.enemies != []
  3177.  
  3178.         @target_x /= $game_troop.enemies.size
  3179.  
  3180.         @target_y /= $game_troop.enemies.size
  3181.  
  3182.       end
  3183.  
  3184.     when "troop" # "パーティ中央"
  3185.  
  3186.       @target_x = 0
  3187.  
  3188.       @target_y = 0
  3189.  
  3190.       for t in $game_party.actors
  3191.  
  3192.         @target_x += t.screen_x
  3193.  
  3194.         @target_y += t.screen_y
  3195.  
  3196.       end
  3197.  
  3198.       if $game_party.actors != []
  3199.  
  3200.         @target_x /= $game_party.actors.size
  3201.  
  3202.         @target_y /= $game_party.actors.size
  3203.  
  3204.       end
  3205.  
  3206.     when "screen" # "画面"
  3207.  
  3208.       @target_x = self.base_x
  3209.  
  3210.       @target_y = self.base_y
  3211.  
  3212.     end
  3213.  
  3214.     # 補正
  3215.  
  3216.     @target_x -= @move_action[1] + self.base_x
  3217.  
  3218.     @target_y -= @move_action[2] + self.base_y
  3219.  
  3220.     # 移動目標の座標をセット
  3221.  
  3222.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  3223.  
  3224.     # 距離の計算(ウエイトの設定)
  3225.  
  3226.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  3227.  
  3228.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  3229.  
  3230.   end
  3231.  
  3232.   if RTAB
  3233.  
  3234.   alias original_x true_x
  3235.  
  3236.   alias original_y true_y
  3237.  
  3238.   else
  3239.  
  3240.   alias original_x screen_x
  3241.  
  3242.   alias original_y screen_y
  3243.  
  3244.   end
  3245.  
  3246.   #--------------------------------------------------------------------------
  3247.  
  3248.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  3249.  
  3250.   #--------------------------------------------------------------------------
  3251.  
  3252.   def true_x
  3253.  
  3254.     return original_x + @ox
  3255.  
  3256.   end
  3257.  
  3258.   #--------------------------------------------------------------------------
  3259.  
  3260.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  3261.  
  3262.   #--------------------------------------------------------------------------
  3263.  
  3264.   def true_y
  3265.  
  3266.     return original_y - @height / 2 + @oy
  3267.  
  3268.   end
  3269.  
  3270.   #--------------------------------------------------------------------------
  3271.  
  3272.   # ● バトル画面 X 座標の取得
  3273.  
  3274.   #--------------------------------------------------------------------------
  3275.  
  3276.   def screen_x(true_x = self.true_x)
  3277.  
  3278.     return true_x * @real_zoom + @real_x
  3279.   end
  3280.  
  3281.   #--------------------------------------------------------------------------
  3282.  
  3283.   # ● バトル画面 Y 座標の取得
  3284.  
  3285.   #--------------------------------------------------------------------------
  3286.  
  3287.   def screen_y(true_y = self.true_y)
  3288.  
  3289.     return true_y * @real_zoom + @real_y
  3290.  
  3291.   end
  3292.  
  3293.   #--------------------------------------------------------------------------
  3294.  
  3295.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  3296.  
  3297.   #--------------------------------------------------------------------------
  3298.  
  3299.   def base_x(true_x = self.true_x)
  3300.  
  3301.     return (true_x - @ox) * @real_zoom + @real_x
  3302.  
  3303.   end
  3304.  
  3305.   #--------------------------------------------------------------------------
  3306.  
  3307.   # ● バトル画面 Y 座標の取得(移動などしていない場合)
  3308.  
  3309.   #--------------------------------------------------------------------------
  3310.  
  3311.   # ● アニメーション取得
  3312.  
  3313.   #--------------------------------------------------------------------------
  3314.  
  3315.   def battle_actions1
  3316.  
  3317.     weapon = $data_weapons[@weapon_id]
  3318.  
  3319.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  3320.  
  3321.   end
  3322.  
  3323.   #--------------------------------------------------------------------------
  3324.  
  3325.   # ● アニメーション取得
  3326.  
  3327.   #--------------------------------------------------------------------------
  3328.  
  3329.   def battle_actions2
  3330.  
  3331.     weapon = $data_weapons[@weapon2_id]
  3332.  
  3333.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  3334.  
  3335.   end
  3336.  
  3337.   #--------------------------------------------------------------------------
  3338.  
  3339.   # ● 武器アニメーション取得
  3340.  
  3341.   #--------------------------------------------------------------------------
  3342.  
  3343.   def weapon_anime1
  3344.  
  3345.     weapon = $data_weapons[@weapon_id]
  3346.  
  3347.     return weapon != nil ? weapon.icon_name : ""
  3348.  
  3349.   end
  3350.  
  3351.   #--------------------------------------------------------------------------
  3352.  
  3353.   # ● 武器アニメーション取得
  3354.  
  3355.   #--------------------------------------------------------------------------
  3356.  
  3357.   def weapon_anime2
  3358.  
  3359.     weapon = $data_weapons[@weapon2_id]
  3360.  
  3361.     return weapon != nil ? weapon.icon_name : ""
  3362.  
  3363.   end
  3364.  
  3365.   #--------------------------------------------------------------------------
  3366.  
  3367.   # ● 遠距離アニメーション取得
  3368.  
  3369.   #--------------------------------------------------------------------------
  3370.  
  3371.   def flying_anime1
  3372.  
  3373.     weapon = $data_weapons[@weapon_id]
  3374.  
  3375.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  3376.  
  3377.   end
  3378.  
  3379.   #--------------------------------------------------------------------------
  3380.  
  3381.   # ● 遠距離アニメーション取得
  3382.  
  3383.   #--------------------------------------------------------------------------
  3384.  
  3385.   def flying_anime2
  3386.  
  3387.     weapon = $data_weapons[@weapon2_id]
  3388.  
  3389.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  3390.  
  3391.   end
  3392.  
  3393.   def base_y(true_y = self.true_y)
  3394.  
  3395.     return (true_y - @oy) * @real_zoom + @real_y
  3396.  
  3397.   end
  3398.  
  3399.   #--------------------------------------------------------------------------
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.   #--------------------------------------------------------------------------
  3407.  
  3408.   # ● アニメーション取得
  3409.  
  3410.   #--------------------------------------------------------------------------
  3411.  
  3412.   def battle_actions1
  3413.  
  3414.     weapon = $data_weapons[@weapon_id]
  3415.  
  3416.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  3417.  
  3418.   end
  3419.  
  3420.   #--------------------------------------------------------------------------
  3421.  
  3422.   # ● アニメーション取得
  3423.  
  3424.   #--------------------------------------------------------------------------
  3425.  
  3426.   def battle_actions2
  3427.  
  3428.     weapon = $data_weapons[@weapon2_id]
  3429.  
  3430.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  3431.  
  3432.   end
  3433.  
  3434.   #--------------------------------------------------------------------------
  3435.  
  3436.   # ● 武器アニメーション取得
  3437.  
  3438.   #--------------------------------------------------------------------------
  3439.  
  3440.   def weapon_anime1
  3441.  
  3442.     weapon = $data_weapons[@weapon_id]
  3443.  
  3444.     return weapon != nil ? weapon.icon_name : ""
  3445.  
  3446.   end
  3447.  
  3448.   #--------------------------------------------------------------------------
  3449.  
  3450.   # ● 武器アニメーション取得
  3451.  
  3452.   #--------------------------------------------------------------------------
  3453.  
  3454.   def weapon_anime2
  3455.  
  3456.     weapon = $data_weapons[@weapon2_id]
  3457.  
  3458.     return weapon != nil ? weapon.icon_name : ""
  3459.  
  3460.   end
  3461.  
  3462.   #--------------------------------------------------------------------------
  3463.  
  3464.   # ● 遠距離アニメーション取得
  3465.  
  3466.   #--------------------------------------------------------------------------
  3467.  
  3468.   def flying_anime1
  3469.  
  3470.     weapon = $data_weapons[@weapon_id]
  3471.  
  3472.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  3473.  
  3474.   end
  3475.  
  3476.   #--------------------------------------------------------------------------
  3477.  
  3478.   # ● 遠距離アニメーション取得
  3479.  
  3480.   #--------------------------------------------------------------------------
  3481.  
  3482.   def flying_anime2
  3483.  
  3484.     weapon = $data_weapons[@weapon2_id]
  3485.  
  3486.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  3487.  
  3488.   end  
  3489.  
  3490. end
  3491.  
  3492. #==============================================================================
  3493.  
  3494. # ■ Game_Party
  3495.  
  3496. #==============================================================================
  3497.  
  3498. class Game_Party
  3499.  
  3500.   #--------------------------------------------------------------------------
  3501.  
  3502.   # ● アクターを加える
  3503.  
  3504.   #     actor_id : アクター ID
  3505.  
  3506.   #--------------------------------------------------------------------------
  3507.  
  3508.   alias side_view_add_actor add_actor
  3509.  
  3510.   def add_actor(actor_id)
  3511.  
  3512.     # アクターを取得
  3513.  
  3514.     actor = $game_actors[actor_id]
  3515.  
  3516.     # サイドビューデータの初期化
  3517.  
  3518.     actor.start_battle
  3519.  
  3520.     # 戻す
  3521.  
  3522.     side_view_add_actor(actor_id)
  3523.  
  3524.   end
  3525.  
  3526. end
  3527.  
  3528.  
  3529. class Spriteset_Battle
  3530.  
  3531.   include Side_view
  3532.  
  3533.   #--------------------------------------------------------------------------
  3534.  
  3535.   # ● オブジェクト初期化
  3536.  
  3537.   #--------------------------------------------------------------------------
  3538.  
  3539.   alias side_veiw_initialize initialize
  3540.  
  3541.   def initialize
  3542.  
  3543.     side_veiw_initialize
  3544.  
  3545.     # アクタースプライトを解放
  3546.  
  3547.     for sprite in @actor_sprites
  3548.  
  3549.       sprite.dispose
  3550.  
  3551.     end
  3552.  
  3553.     # アクタースプライトを作成
  3554.  
  3555.     @actor_sprites = []
  3556.  
  3557.     for i in 1..Party_max
  3558.  
  3559.       @actor_sprites.push(Sprite_Battler.new(@viewport1))
  3560.  
  3561.     end
  3562.  
  3563.     update
  3564.  
  3565.   end
  3566.  
  3567.   #--------------------------------------------------------------------------
  3568.  
  3569.   # ● 画面のスクロール
  3570.  
  3571.   #--------------------------------------------------------------------------
  3572.  
  3573.   if method_defined?("screen_scroll")
  3574.  
  3575.   alias side_view_screen_scroll screen_scroll
  3576.  
  3577.   def screen_scroll
  3578.  
  3579.     side_view_screen_scroll
  3580.  
  3581.     # アクターの位置補正
  3582.  
  3583.     for actor in $game_party.actors
  3584.  
  3585.       actor.real_x = @real_x
  3586.  
  3587.       actor.real_y = @real_y
  3588.  
  3589.       actor.real_zoom = @real_zoom
  3590.  
  3591.     end
  3592.  
  3593.   end
  3594.  
  3595.   end
  3596.  
  3597. end
  3598.  
  3599.  
  3600. class Sprite_Battler < RPG::Sprite
  3601.  
  3602.   include Side_view
  3603.  
  3604.   #--------------------------------------------------------------------------
  3605.  
  3606.   # ● オブジェクト初期化
  3607.  
  3608.   #     viewport : ビューポート
  3609.  
  3610.   #     battler  : バトラー (Game_Battler)
  3611.  
  3612.   #--------------------------------------------------------------------------
  3613.  
  3614.   def initialize(viewport, battler = nil)
  3615.  
  3616.     super(viewport)
  3617.  
  3618.     @battler = battler
  3619.  
  3620.     @battler_visible = false
  3621.  
  3622.     @weapon = Sprite_Weapon.new(viewport, battler)
  3623.  
  3624.     @flying = Sprite_Flying.new(viewport, battler)
  3625.  
  3626.     @shadow = []
  3627.  
  3628.     @fly = 0
  3629.  
  3630.     @fly_direction = 1
  3631.  
  3632.     @rand = rand(10)
  3633.  
  3634.     self.effect_clear
  3635.  
  3636.   end
  3637.  
  3638.   #--------------------------------------------------------------------------
  3639.  
  3640.   # ● 解放
  3641.  
  3642.   #--------------------------------------------------------------------------
  3643.  
  3644.   alias side_view_dispose dispose
  3645.  
  3646.   def dispose
  3647.  
  3648.     side_view_dispose
  3649.  
  3650.     @weapon.dispose
  3651.  
  3652.     @flying.dispose
  3653.  
  3654.     if @_target_sprite != nil
  3655.  
  3656.       @_target_sprite.bitmap.dispose
  3657.  
  3658.       @_target_sprite.dispose
  3659.  
  3660.       @_target_sprite = nil
  3661.  
  3662.     end
  3663.  
  3664.   end
  3665.  
  3666.   #--------------------------------------------------------------------------
  3667.  
  3668.   # ● フレーム更新
  3669.  
  3670.   #--------------------------------------------------------------------------
  3671.  
  3672.   def update
  3673.  
  3674.     super
  3675.  
  3676.     # バトラーが nil の場合
  3677.  
  3678.     if @battler == nil
  3679.  
  3680.       self.bitmap = nil
  3681.  
  3682.       @weapon.bitmap = nil
  3683.  
  3684.       loop_animation(nil)
  3685.  
  3686.       return
  3687.  
  3688.     end
  3689.  
  3690.     # バトラー更新
  3691.  
  3692.     @battler.update
  3693.     # バトラーアニメのデータ取得
  3694.  
  3695.     @anime_type = @battler.anime_type
  3696.  
  3697.     # ファイル名か色相が現在のものと異なる場合
  3698.  
  3699.     if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  3700.  
  3701.       change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
  3702.  
  3703.     elsif @battler.is_a?(Game_Enemy)
  3704.  
  3705.       change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
  3706.  
  3707.     else
  3708.  
  3709.       return
  3710.  
  3711.     end
  3712.  
  3713.     if change
  3714.  
  3715.       # ビットマップを取得、設定
  3716.  
  3717.       if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  3718.  
  3719.         @battler_name = @battler.character_name
  3720.  
  3721.         @battler_hue = @battler.character_hue
  3722.  
  3723.         self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
  3724.  
  3725.         @width = bitmap.width / 4
  3726.  
  3727.         @height = bitmap.height / 4
  3728.  
  3729.       else
  3730.  
  3731.         @battler_name = @battler.battler_name
  3732.  
  3733.         @battler_hue = @battler.battler_hue
  3734.  
  3735.         self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  3736.  
  3737.         @width = bitmap.width
  3738.  
  3739.         @height = bitmap.height
  3740.  
  3741.       end
  3742.  
  3743.       self.ox = @width / 2
  3744.  
  3745.       self.oy = @height / 2
  3746.  
  3747.       @battler.height = @height
  3748.  
  3749.       @flag = true
  3750.  
  3751.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  3752.  
  3753.       if @battler.dead? or @battler.hidden
  3754.  
  3755.         self.opacity = 0
  3756.  
  3757.       end
  3758.  
  3759.     end
  3760.  
  3761.     if (@battler.is_a?(Game_Actor) and
  3762.  
  3763.       (@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)) or
  3764.  
  3765.       (!@battler.is_a?(Game_Actor) and !@battler.nce)
  3766.  
  3767.       # ビットマップを取得、設定
  3768.  
  3769.       @pattern = @battler.pattern
  3770.  
  3771.       self.ox = @width / 2
  3772.  
  3773.       self.oy = @height / 2
  3774.  
  3775.       @sx = @pattern * @width
  3776.  
  3777.       sy = @anime_type % 4 * @height
  3778.  
  3779.       x   = sy / (@height * 2) + 4
  3780.  
  3781.       if !@battler.is_a?(Game_Actor) and !@battler.nce and x == 4
  3782.  
  3783.         x = 6
  3784.  
  3785.       end    # here!!
  3786.  
  3787.       @sy = (x - 2) / 2 * @height
  3788.  
  3789.       self.src_rect.set(@sx, @sy, @width, @height)
  3790.  
  3791.       self.zoom_x = CHAR_ZOOM
  3792.  
  3793.       self.zoom_y = CHAR_ZOOM
  3794.  
  3795.       @battler.height = @height
  3796.  
  3797.       @flag = false
  3798.  
  3799.     end
  3800.  
  3801.     # 飛行
  3802.  
  3803.     update_fly
  3804.  
  3805.     # シェイク
  3806.  
  3807.     update_shake
  3808.  
  3809.     # 回転
  3810.  
  3811.     update_turning
  3812.  
  3813.     # 反転
  3814.  
  3815.     update_reverse   
  3816.     # 移動
  3817.  
  3818.     update_moving
  3819.  
  3820.     # 追加アニメ
  3821.  
  3822.     update_add_anime
  3823.  
  3824.     # エフェクト効果の適用
  3825.  
  3826.     update_effect
  3827.  
  3828.     # アニメーション ID が現在のものと異なる場合
  3829.  
  3830.     flag = RTAB ? true : @battler.damage == nil
  3831.  
  3832.     if flag and @battler.state_animation_id != @state_animation_id
  3833.  
  3834.       @state_animation_id = @battler.state_animation_id
  3835.  
  3836.       loop_animation($data_animations[@state_animation_id])
  3837.  
  3838.     end
  3839.  
  3840.     # シェイク
  3841.  
  3842.     if @battler.shake
  3843.  
  3844.       self.start_shake(5, 5, 5)
  3845.  
  3846.       @battler.shake = false
  3847.  
  3848.     end
  3849.  
  3850.     # 明滅
  3851.  
  3852.     if @battler.blink
  3853.  
  3854.       blink_on
  3855.  
  3856.     else
  3857.  
  3858.       blink_off
  3859.  
  3860.     end
  3861.  
  3862.     # 不可視の場合
  3863.  
  3864.     unless @battler_visible
  3865.  
  3866.       flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
  3867.  
  3868.                     (@battler.damage == nil or @battler.damage_pop)
  3869.  
  3870.       # 出現
  3871.  
  3872.       if not @battler.hidden and not @battler.dead? and flag
  3873.  
  3874.         appear
  3875.  
  3876.         @battler_visible = true
  3877.  
  3878.       end
  3879.  
  3880.     end
  3881.  
  3882.     if RTAB
  3883.  
  3884.     # ダメージ
  3885.  
  3886.     for battler in @battler.damage_pop
  3887.  
  3888.       if battler[0].class == Array
  3889.  
  3890.         if battler[0][1] >= 0
  3891.  
  3892.           $scene.skill_se
  3893.  
  3894.         else
  3895.  
  3896.           $scene.levelup_se
  3897.  
  3898.         end
  3899.  
  3900.         damage(@battler.damage[battler[0]], false, 2)
  3901.  
  3902.       else
  3903.  
  3904.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  3905.  
  3906.       end
  3907.  
  3908.       if @battler.damage_sp.include?(battler[0])
  3909.  
  3910.         damage(@battler.damage_sp[battler[0]],
  3911.  
  3912.                 @battler.critical[battler[0]], 1)
  3913.  
  3914.         @battler.damage_sp.delete(battler[0])
  3915.  
  3916.       end
  3917.  
  3918.       @battler.damage_pop.delete(battler[0])
  3919.  
  3920.       @battler.damage.delete(battler[0])
  3921.  
  3922.       @battler.critical.delete(battler[0])
  3923.  
  3924.     end
  3925.  
  3926.     end
  3927.  
  3928.     # 可視の場合
  3929.  
  3930.     if @battler_visible
  3931.  
  3932.       # 武器アニメ
  3933.  
  3934.       @weapon.battler = @battler
  3935.  
  3936.       @weapon.update
  3937.  
  3938.       # 遠距離アニメ
  3939.  
  3940.       @flying.battler = @battler
  3941.  
  3942.       @flying.update
  3943.  
  3944.       # 逃走
  3945.  
  3946.       if @battler.hidden
  3947.  
  3948.         $game_system.se_play($data_system.escape_se)
  3949.  
  3950.         escape
  3951.  
  3952.         @battler_visible = false
  3953.  
  3954.       end
  3955.  
  3956.       # 白フラッシュ
  3957.  
  3958.       if @battler.white_flash
  3959.  
  3960.         whiten
  3961.  
  3962.         @battler.white_flash = false
  3963.  
  3964.       end
  3965.  
  3966.       if RTAB
  3967.  
  3968.       # アニメーション
  3969.  
  3970.       if !@battler.animation.empty?
  3971.  
  3972.         for animation in @battler.animation.reverse
  3973.  
  3974.           if animation[2]
  3975.  
  3976.             animation($data_animations[animation[0]], animation[1], true)
  3977.  
  3978.           else
  3979.  
  3980.             animation($data_animations[animation[0]], animation[1])
  3981.  
  3982.           end
  3983.  
  3984.           @battler.animation.delete(animation)
  3985.  
  3986.         end
  3987.  
  3988.       end
  3989.  
  3990.       else
  3991.  
  3992.       # アニメーション
  3993.  
  3994.       if @battler.animation_id != 0
  3995.  
  3996.         animation = $data_animations[@battler.animation_id]
  3997.  
  3998.         animation(animation, @battler.animation_hit)
  3999.  
  4000.         @battler.animation_id = 0
  4001.  
  4002.       end
  4003.  
  4004.       end
  4005.  
  4006.       # ダメージ
  4007.  
  4008.       if !RTAB and @battler.damage_pop
  4009.  
  4010.         damage(@battler.damage, @battler.critical)
  4011.  
  4012.         @battler.damage = nil
  4013.  
  4014.         @battler.critical = false
  4015.  
  4016.         @battler.damage_pop = false
  4017.  
  4018.       end
  4019.  
  4020.       flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
  4021.  
  4022.                      @battler.damage == nil
  4023.  
  4024.       # コラプス
  4025.  
  4026.       if flag and @battler.dead?
  4027.  
  4028.         if @battler.is_a?(Game_Actor)
  4029.  
  4030.           $game_system.se_play($data_system.actor_collapse_se)
  4031.  
  4032.         elsif @battler.is_a?(Game_Enemy)
  4033.  
  4034.           $game_system.se_play($data_system.enemy_collapse_se)
  4035.  
  4036.         end
  4037.  
  4038.         collapse
  4039.  
  4040.         @battler_visible = false
  4041.  
  4042.       end
  4043.  
  4044.     end
  4045.  
  4046.     # スプライトの座標を設定
  4047.  
  4048.     self.x = @battler.screen_x + @effect_ox
  4049.  
  4050.     self.y = @battler.screen_y + @effect_oy
  4051.  
  4052.     self.z = @battler.screen_z
  4053.  
  4054.     self.zoom_x = @battler.real_zoom
  4055.  
  4056.     self.zoom_y = @battler.real_zoom
  4057.  
  4058.     # ウェイトカウントを減らす
  4059.  
  4060.     @battler.wait_count -= 1
  4061.  
  4062.     @battler.wait_count2 -= 1
  4063.  
  4064.     # アニメーション待ち時間取得
  4065.  
  4066.     @battler.animation_duration = @_animation_duration
  4067.  
  4068.     if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  4069.  
  4070.       self.zoom_x *= CHAR_ZOOM
  4071.  
  4072.       self.zoom_y *= CHAR_ZOOM
  4073.  
  4074.       @weapon.x = self.x + 2
  4075.  
  4076.       @weapon.y = self.y + 6
  4077.  
  4078.       @weapon.angle = 75 - (4 - @battler.pattern) * 45
  4079.  
  4080.       if self.mirror
  4081.  
  4082.         @weapon.angle += @weapon.angle - 180
  4083.  
  4084.       end
  4085.  
  4086.       if (!@battler.is_a?(Game_Actor) and !@battler.nce)
  4087.  
  4088.         @weapon.angle = [email]-@weapon.angle[/email]-90
  4089.  
  4090.       end
  4091.  
  4092.     end
  4093.  
  4094.     # 残像
  4095.  
  4096.     if @battler.shadow
  4097.  
  4098.       if Graphics.frame_count % 2 == 0
  4099.  
  4100.         shadow = ::Sprite.new(self.viewport)
  4101.  
  4102.         shadow.bitmap = self.bitmap.dup
  4103.  
  4104.         shadow.x = self.x
  4105.  
  4106.         shadow.y = self.y
  4107.  
  4108.         shadow.ox = self.ox
  4109.  
  4110.         shadow.oy = self.oy
  4111.  
  4112.         shadow.mirror = self.mirror
  4113.  
  4114.         shadow.angle = self.angle
  4115.  
  4116.         shadow.opacity = 160
  4117.  
  4118.         shadow.zoom_x = self.zoom_x
  4119.  
  4120.         shadow.zoom_y = self.zoom_y
  4121.  
  4122.         if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  4123.  
  4124.           shadow.src_rect.set(@sx, @sy, @width, @height)
  4125.  
  4126.         else
  4127.  
  4128.           shadow.src_rect.set(0, 0, @width, @height)
  4129.  
  4130.         end
  4131.  
  4132.         @shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
  4133.  
  4134.       end
  4135.  
  4136.     end
  4137.  
  4138.     for s in @shadow
  4139.  
  4140.       if !s[0].disposed?
  4141.  
  4142.         s[0].update
  4143.  
  4144.         s[1] -= 1
  4145.  
  4146.         if s[1] < 1
  4147.  
  4148.           if s[0].bitmap != nil
  4149.  
  4150.             s[0].bitmap.dispose
  4151.  
  4152.           end
  4153.  
  4154.           s[0].dispose
  4155.  
  4156.         else
  4157.  
  4158.           s[0].x = @battler.screen_x(s[2])
  4159.  
  4160.           s[0].y = @battler.screen_y(s[3])
  4161.  
  4162.         end
  4163.  
  4164.       else
  4165.  
  4166.         s = nil
  4167.  
  4168.       end
  4169.  
  4170.     end
  4171.  
  4172.     @shadow.compact!
  4173.  
  4174.   end
  4175.  
  4176.   #--------------------------------------------------------------------------
  4177.  
  4178.   # ● エフェクトによる座標系の更新
  4179.  
  4180.   #--------------------------------------------------------------------------
  4181.  
  4182.   def update_effect
  4183.  
  4184.     # 角度の修正
  4185.  
  4186.     if @_upside_down
  4187.  
  4188.       self.angle = (@_turning + 180) % 360
  4189.  
  4190.     else
  4191.  
  4192.       self.angle = @_turning
  4193.  
  4194.     end
  4195.  
  4196.     # X 座標の修正値
  4197.  
  4198.     @effect_ox = @_shake + @_moving[0]
  4199.  
  4200.     # Y 座標の修正値
  4201.  
  4202.     @effect_oy = -@fly + @_moving[1]
  4203.  
  4204.     if  @_animation == nil or (RTAB and @_animation.empty?)
  4205.  
  4206.       self.effect_clear
  4207.  
  4208.     end
  4209.  
  4210.   end
  4211.  
  4212.   #--------------------------------------------------------------------------
  4213.  
  4214.   # ● シェイク更新
  4215.  
  4216.   #--------------------------------------------------------------------------
  4217.  
  4218.   def update_shake
  4219.  
  4220.     if @_shake_duration >= 1 or @_shake != 0
  4221.  
  4222.       delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
  4223.  
  4224.       if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
  4225.  
  4226.         @_shake = 0
  4227.  
  4228.       else
  4229.  
  4230.         @_shake += delta
  4231.  
  4232.       end
  4233.  
  4234.       if @_shake > @_shake_power * 2
  4235.  
  4236.         @_shake_direction = -1
  4237.  
  4238.       end
  4239.  
  4240.       if @_shake < - @_shake_power * 2
  4241.  
  4242.         @_shake_direction = 1
  4243.  
  4244.       end
  4245.  
  4246.       if @_shake_duration >= 1
  4247.  
  4248.         @_shake_duration -= 1
  4249.  
  4250.       end
  4251.  
  4252.     end
  4253.  
  4254.   end
  4255.  
  4256.   #--------------------------------------------------------------------------
  4257.  
  4258.   # ● 飛行更新
  4259.  
  4260.   #--------------------------------------------------------------------------
  4261.  
  4262.   def update_fly
  4263.  
  4264.     if @rand > 0
  4265.  
  4266.       @rand -= 1
  4267.  
  4268.       return
  4269.  
  4270.     end
  4271.  
  4272.     if @battler.fly != 0
  4273.  
  4274.       if @fly < @battler.fly / 4
  4275.  
  4276.         @fly_direction = 1
  4277.  
  4278.       elsif @fly > @battler.fly / 2
  4279.  
  4280.         @fly_direction = -1
  4281.  
  4282.       end
  4283.  
  4284.       @fly += 0.5 * @fly_direction
  4285.  
  4286.     end
  4287.  
  4288.   end
  4289.  
  4290.   #--------------------------------------------------------------------------
  4291.  
  4292.   # ● 回転更新
  4293.  
  4294.   #--------------------------------------------------------------------------
  4295.  
  4296.   def update_turning
  4297.  
  4298.     if @_turning_duration > 0 or @_turning != 0
  4299.  
  4300.       @_turning += @_turning_direction * @_turning_speed / 2.0
  4301.  
  4302.       # 残り回転数を減らす
  4303.  
  4304.       if @_turning_direction == -1
  4305.  
  4306.         if @_turning_duration > 0 and @_turning < 0
  4307.  
  4308.           @_turning_duration -= 1
  4309.  
  4310.         end
  4311.  
  4312.       elsif @_turning_direction == 1
  4313.  
  4314.         if @_turning_duration > 0 and @_turning >= 360
  4315.  
  4316.           @_turning_duration -= 1
  4317.  
  4318.         end
  4319.  
  4320.       end
  4321.  
  4322.       # 以下補正
  4323.  
  4324.       while @_turning < 0
  4325.  
  4326.         @_turning += 360
  4327.  
  4328.       end
  4329.  
  4330.       if @_turning_duration <= 0
  4331.  
  4332.         @_turning = 0
  4333.  
  4334.       end
  4335.  
  4336.       @_turning %= 360
  4337.  
  4338.     end
  4339.  
  4340.   end
  4341.  
  4342.   #--------------------------------------------------------------------------
  4343.  
  4344.   # ● 左右反転更新
  4345.  
  4346.   #--------------------------------------------------------------------------
  4347.  
  4348.   def update_reverse
  4349.  
  4350.     if @last_reverse != (@_reverse or @battler.reverse)
  4351.  
  4352.       self.mirror = (@_reverse or @battler.reverse)
  4353.  
  4354.       @last_reverse = (@_reverse or @battler.reverse)
  4355.  
  4356.     end
  4357.  
  4358.   end
  4359.  
  4360.   #--------------------------------------------------------------------------
  4361.  
  4362.   # ● 移動更新
  4363.  
  4364.   #--------------------------------------------------------------------------
  4365.  
  4366.   def update_moving
  4367.  
  4368.     @move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  4369.  
  4370.                      (@_move_coordinates[3] - @_move_coordinates[1]).abs
  4371.  
  4372.     if @move_distance > 0
  4373.  
  4374.       return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
  4375.  
  4376.       array = @_move_coordinates
  4377.  
  4378.       x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  4379.  
  4380.       y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  4381.  
  4382.       @_moving = [x, y]
  4383.  
  4384.       if @_move_quick_return and @_move_duration == 0
  4385.  
  4386.         @_move_coordinates = [0,0,array[0],array[1]]
  4387.  
  4388.         @_move_duration = @move_distance
  4389.  
  4390.       end
  4391.  
  4392.       @_move_duration -= @_move_speed
  4393.  
  4394.       @_move_duration = [@_move_duration, 0].max
  4395.  
  4396.     end
  4397.  
  4398.   end
  4399.  
  4400.   #--------------------------------------------------------------------------
  4401.  
  4402.   # ● 追加アニメ更新 (RTAB限定機能)
  4403.  
  4404.   #--------------------------------------------------------------------------
  4405.  
  4406.   def update_add_anime
  4407.  
  4408.     if RTAB
  4409.  
  4410.     # アニメーション
  4411.  
  4412.     if @_add_anime_id != 0
  4413.  
  4414.       animation = $data_animations[@_add_anime_id]
  4415.  
  4416.       animation(animation, true)
  4417.  
  4418.       @_add_anime_id = 0
  4419.  
  4420.     end
  4421.  
  4422.     end
  4423.  
  4424.   end
  4425.  
  4426.   #--------------------------------------------------------------------------
  4427.  
  4428.   # ● エフェクト初期化
  4429.  
  4430.   #--------------------------------------------------------------------------
  4431.  
  4432.   def effect_clear
  4433.  
  4434.     @_effect_ox = 0
  4435.  
  4436.     @_effect_oy = 0
  4437.  
  4438.     @_shake_power = 0
  4439.  
  4440.     @_shake_speed = 0
  4441.  
  4442.     @_shake_duration = 0
  4443.  
  4444.     @_shake_direction = 1
  4445.  
  4446.     @_shake = 0
  4447.  
  4448.     @_upside_down = false
  4449.  
  4450.     @_reverse = false
  4451.  
  4452.     @_turning_direction = 1
  4453.  
  4454.     @_turning_speed = 0
  4455.  
  4456.     @_turning_duration = 0
  4457.  
  4458.     @_turning = 0
  4459.  
  4460.     @_move_quick_return = true
  4461.  
  4462.     @_move_speed = 0
  4463.  
  4464.     @_move_coordinates = [0,0,0,0]
  4465.  
  4466.     @_move_jump = false
  4467.  
  4468.     @_move_duration = 0
  4469.  
  4470.     @_moving = [0,0]
  4471.  
  4472.     @_add_anime_id = 0
  4473.  
  4474.   end
  4475.  
  4476.   #--------------------------------------------------------------------------
  4477.  
  4478.   # ● シェイクの開始
  4479.  
  4480.   #     power    : 強さ
  4481.  
  4482.   #     speed    : 速さ
  4483.  
  4484.   #     duration : 時間
  4485.  
  4486.   #--------------------------------------------------------------------------
  4487.  
  4488.   def start_shake(power, speed, duration)
  4489.  
  4490.     @_shake_power = power
  4491.  
  4492.     @_shake_speed = speed
  4493.  
  4494.     @_shake_duration = duration
  4495.  
  4496.   end
  4497.  
  4498.   #--------------------------------------------------------------------------
  4499.  
  4500.   # ● 上下反転を開始
  4501.  
  4502.   #--------------------------------------------------------------------------
  4503.  
  4504.   def start_upside_down
  4505.  
  4506.     @_upside_down = @_upside_down ? false : true
  4507.  
  4508.   end
  4509.  
  4510.   #--------------------------------------------------------------------------
  4511.  
  4512.   # ● 左右反転を開始
  4513.  
  4514.   #--------------------------------------------------------------------------
  4515.  
  4516.   def start_reverse
  4517.  
  4518.     @_reverse = @_reverse ? false : true
  4519.  
  4520.   end
  4521.  
  4522.   #--------------------------------------------------------------------------
  4523.  
  4524.   # ● 回転を開始
  4525.  
  4526.   #     direction: 方向
  4527.  
  4528.   #     speed    : 速さ
  4529.  
  4530.   #     duration : 時間
  4531.  
  4532.   #--------------------------------------------------------------------------
  4533.  
  4534.   def start_turning(direction, speed, duration)
  4535.  
  4536.     @_turning_direction = direction
  4537.  
  4538.     @_turning_speed = speed
  4539.  
  4540.     @_turning_duration = duration
  4541.  
  4542.     @_turning = @_turning_direction == 1 ? 0 : 360
  4543.  
  4544.   end
  4545.  
  4546.   #--------------------------------------------------------------------------
  4547.  
  4548.   # ● 移動を開始
  4549.  
  4550.   #     quick_return : 戻るかどうか
  4551.  
  4552.   #     speed        : 速さ
  4553.  
  4554.   #     x            : X 座標
  4555.  
  4556.   #     y            : Y 座標
  4557.  
  4558.   #--------------------------------------------------------------------------
  4559.  
  4560.   def start_moving(quick_return, speed, x, y)
  4561.  
  4562.     @_move_quick_return = quick_return == 0 ? false : true
  4563.  
  4564.     @_move_speed = speed
  4565.  
  4566.     @_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
  4567.  
  4568.     distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  4569.  
  4570.                (@_move_coordinates[3] - @_move_coordinates[1]).abs
  4571.  
  4572.     @_move_duration = distance
  4573.  
  4574.   end
  4575.  
  4576.   #--------------------------------------------------------------------------
  4577.  
  4578.   # ● アニメ追加を開始
  4579.  
  4580.   #     id           : ID
  4581.  
  4582.   #     hit          : 命中フラッグ
  4583.  
  4584.   #--------------------------------------------------------------------------
  4585.  
  4586.   def start_add_anime(id)
  4587.  
  4588.     @_add_anime_id = id
  4589.  
  4590.   end
  4591.  
  4592.   #--------------------------------------------------------------------------
  4593.  
  4594.   # ● 各種エフェクトの開始判定
  4595.  
  4596.   #--------------------------------------------------------------------------
  4597.  
  4598.   if !method_defined?("side_view_animation_process_timing")
  4599.  
  4600.     alias side_view_animation_process_timing animation_process_timing
  4601.  
  4602.   end
  4603.  
  4604.   def animation_process_timing(timing, hit)
  4605.  
  4606.     side_view_animation_process_timing(timing, hit)
  4607.  
  4608.     if (timing.condition == 0) or
  4609.  
  4610.        (timing.condition == 1 and hit == true) or
  4611.  
  4612.        (timing.condition == 2 and hit == false)
  4613.  
  4614.       if timing.se.name =~ SHAKE_FILE
  4615.  
  4616.         names = timing.se.name.split(/#/)
  4617.  
  4618.         power    = names[1].nil? ? SHAKE_POWER    : names[1].to_i
  4619.  
  4620.         speed    = names[2].nil? ? SHAKE_SPEED    : names[2].to_i
  4621.  
  4622.         duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
  4623.  
  4624.         # シェイクを開始
  4625.  
  4626.         self.start_shake(power, speed, duration)
  4627.  
  4628.       end
  4629.  
  4630.       if timing.se.name == UPSIDE_DOWN_FILE
  4631.  
  4632.         # 上下反転を開始
  4633.  
  4634.         self.start_upside_down
  4635.  
  4636.       end
  4637.  
  4638.       if timing.se.name == REVERSE_FILE
  4639.  
  4640.         # 左右反転を開始
  4641.  
  4642.         self.start_reverse
  4643.  
  4644.       end
  4645.  
  4646.       if timing.se.name =~ TURNING_FILE
  4647.  
  4648.         names = timing.se.name.split(/#/)
  4649.  
  4650.         direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
  4651.  
  4652.         speed     = names[2].nil? ? TURNING_SPEED     : names[2].to_i
  4653.  
  4654.         duration  = names[3].nil? ? TURNING_DURATION  : names[3].to_i
  4655.  
  4656.         # 回転を開始
  4657.  
  4658.         self.start_turning(direction, speed, duration)
  4659.  
  4660.       end
  4661.  
  4662.       if timing.se.name =~ MOVE_FILE
  4663.  
  4664.         names = timing.se.name.split(/#/)
  4665.  
  4666.         quick_return= names[1].nil? ? MOVE_RETURN      : names[1].to_i
  4667.  
  4668.         speed       = names[2].nil? ? MOVE_SPEED       : names[2].to_i
  4669.  
  4670.         x           = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
  4671.  
  4672.         y           = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
  4673.  
  4674.         # 移動を開始
  4675.  
  4676.         self.start_moving(quick_return, speed, x, y)
  4677.  
  4678.       end
  4679.  
  4680.       if timing.se.name =~ ADD_ANIME_FILE
  4681.  
  4682.         names = timing.se.name.split(/#/)
  4683.  
  4684.         id = names[1].nil? ? ADD_ANIME_ID      : names[1].to_i
  4685.  
  4686.         # アニメ追加を開始
  4687.  
  4688.         self.start_add_anime(id)
  4689.  
  4690.       end
  4691.  
  4692.     end
  4693.  
  4694.   end
  4695.  
  4696. end
  4697.  
  4698.  
  4699. #==============================================================================
  4700.  
  4701. # ■ Sprite_Weapon
  4702.  
  4703. #------------------------------------------------------------------------------
  4704.  
  4705. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  4706.  
  4707. # スプライトの状態を自動的に変化させます。
  4708.  
  4709. #==============================================================================
  4710.  
  4711.  
  4712. class Sprite_Weapon < RPG::Sprite
  4713.  
  4714.   include Side_view
  4715.  
  4716.   #--------------------------------------------------------------------------
  4717.  
  4718.   # ● 公開インスタンス変数
  4719.  
  4720.   #--------------------------------------------------------------------------
  4721.  
  4722.   attr_accessor :battler                  # バトラー
  4723.  
  4724.   attr_reader   :cw                       # グラフィックの幅
  4725.  
  4726.   attr_reader   :ch                       # グラフィックの高さ
  4727.  
  4728.   #--------------------------------------------------------------------------
  4729.  
  4730.   # ● オブジェクト初期化
  4731.  
  4732.   #     viewport : ビューポート
  4733.  
  4734.   #     battler  : バトラー (Game_Battler)
  4735.  
  4736.   #--------------------------------------------------------------------------
  4737.  
  4738.   def initialize(viewport, battler = nil)
  4739.  
  4740.     super(viewport)
  4741.  
  4742.     @battler = battler
  4743.  
  4744.     @battler_visible = false
  4745.  
  4746.   end
  4747.  
  4748.   #--------------------------------------------------------------------------
  4749.  
  4750.   # ● 解放
  4751.  
  4752.   #--------------------------------------------------------------------------
  4753.  
  4754.   def dispose
  4755.  
  4756.     if self.bitmap != nil
  4757.  
  4758.       self.bitmap.dispose
  4759.  
  4760.     end
  4761.  
  4762.     super
  4763.  
  4764.   end
  4765.  
  4766.   #--------------------------------------------------------------------------
  4767.  
  4768.   # ● フレーム更新
  4769.  
  4770.   #--------------------------------------------------------------------------
  4771.  
  4772.   def update
  4773.  
  4774.     super
  4775.  
  4776.     # バトラーが nil の場合
  4777.  
  4778.     if @battler == nil or (!@battler.is_a?(Game_Actor) and @battler.nce)
  4779.  
  4780.       self.bitmap = nil
  4781.  
  4782.       return
  4783.  
  4784.     end
  4785.  
  4786.     # ウエポンアニメのデータ取得
  4787.  
  4788.     @weapon_anime_type = @battler.weapon_anime_type(@battler.condition)
  4789.  
  4790.     # 設定が「非表示」の場合
  4791.  
  4792.     if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
  4793.  
  4794.       self.visible = false
  4795.  
  4796.       return
  4797.  
  4798.     else
  4799.  
  4800.       self.visible = true
  4801.  
  4802.     end
  4803.  
  4804.     # ファイル名が現在のものと異なる場合
  4805.  
  4806.     if @weapon_anime_type[0] != @weapon_name
  4807.  
  4808.       @weapon_name = @weapon_anime_type[0]
  4809.  
  4810.       # ビットマップを取得、設定
  4811.  
  4812.       self.bitmap = RPG::Cache.icon(@weapon_name)
  4813.  
  4814.       @width = bitmap.width
  4815.  
  4816.       @height = bitmap.height
  4817.  
  4818.       @flag = true
  4819.  
  4820.     end
  4821.  
  4822.     # 現在アニメパターンが現在のものと異なる場合
  4823.  
  4824.     if @pattern != @battler.pattern or @flag or @condition != @battler.condition
  4825.  
  4826.       @pattern = @battler.pattern
  4827.  
  4828.       @condition = @battler.condition
  4829.  
  4830.       self.ox = @width
  4831.  
  4832.       self.oy = @height
  4833.  
  4834.       self.z = battler.screen_z
  4835.  
  4836.       self.zoom_x = @battler.real_zoom * CHAR_ZOOM
  4837.  
  4838.       self.zoom_y = @battler.real_zoom * CHAR_ZOOM
  4839.  
  4840.       self.src_rect.set(0, 0, @width, @height)
  4841.  
  4842.       self.opacity = 255
  4843.  
  4844.       # バトラーより手前に表示
  4845.  
  4846.       if @weapon_anime_type[2]
  4847.  
  4848.         self.z += 10
  4849.  
  4850.       # バトラーより奥に表示
  4851.  
  4852.       else
  4853.  
  4854.         self.z -= 10
  4855.  
  4856.       end
  4857.  
  4858.       @flag = false
  4859.  
  4860.     end
  4861.  
  4862.   end
  4863.  
  4864. end
  4865.  
  4866.  
  4867. #==============================================================================
  4868.  
  4869. # ■ Sprite_Flying
  4870.  
  4871. #------------------------------------------------------------------------------
  4872.  
  4873. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  4874.  
  4875. # スプライトの状態を自動的に変化させます。
  4876.  
  4877. #==============================================================================
  4878.  
  4879.  
  4880. class Sprite_Flying < RPG::Sprite
  4881.  
  4882.   include Side_view
  4883.  
  4884.   #--------------------------------------------------------------------------
  4885.  
  4886.   # ● 公開インスタンス変数
  4887.  
  4888.   #--------------------------------------------------------------------------
  4889.  
  4890.   attr_accessor :battler                  # バトラー
  4891.  
  4892.   #--------------------------------------------------------------------------
  4893.  
  4894.   # ● オブジェクト初期化
  4895.  
  4896.   #     viewport : ビューポート
  4897.  
  4898.   #     battler  : バトラー (Game_Battler)
  4899.  
  4900.   #--------------------------------------------------------------------------
  4901.  
  4902.   def initialize(viewport, battler = nil)
  4903.  
  4904.     super(viewport)
  4905.  
  4906.     @battler = battler
  4907.  
  4908.     @battler_visible = false
  4909.  
  4910.   end
  4911.  
  4912.   #--------------------------------------------------------------------------
  4913.  
  4914.   # ● 解放
  4915.  
  4916.   #--------------------------------------------------------------------------
  4917.  
  4918.   def dispose
  4919.  
  4920.     if self.bitmap != nil
  4921.  
  4922.       self.bitmap.dispose
  4923.  
  4924.     end
  4925.  
  4926.     super
  4927.  
  4928.   end
  4929.  
  4930.   #--------------------------------------------------------------------------
  4931.  
  4932.   # ● フレーム更新
  4933.  
  4934.   #--------------------------------------------------------------------------
  4935.  
  4936.   def update
  4937.  
  4938.     super
  4939.  
  4940.     # バトラーが nil の場合
  4941.  
  4942.     if @battler == nil
  4943.  
  4944.       self.bitmap = nil
  4945.  
  4946.       loop_animation(nil)
  4947.  
  4948.       return
  4949.  
  4950.     end
  4951.  
  4952.     # 遠距離アニメ
  4953.  
  4954.     flying_animation = @battler.flying_animation
  4955.  
  4956.     flying_start = flying_animation[0]
  4957.  
  4958.     flying_end   = flying_animation[1]
  4959.  
  4960.     # アニメーション ID が現在のものと異なる場合
  4961.  
  4962.     if @anime_id != @battler.flying_anime[0]
  4963.  
  4964.       @anime_id = @battler.flying_anime[0]
  4965.  
  4966.       @animation = $data_animations[@anime_id]
  4967.  
  4968.     end
  4969.  
  4970.     # アニメーション 開始
  4971.  
  4972.     if flying_start
  4973.  
  4974.       loop_animation(@animation)
  4975.  
  4976.     elsif flying_end
  4977.  
  4978.       loop_animation(nil)
  4979.  
  4980.     end
  4981.  
  4982.     self.x = @battler.flying_x
  4983.  
  4984.     self.y = @battler.flying_y
  4985.  
  4986.     self.z = @battler.screen_z + 1000
  4987.  
  4988.   end
  4989.  
  4990. end
  4991.  
  4992.  
  4993. module RPG
  4994.  
  4995.   class Skill
  4996.  
  4997.     #--------------------------------------------------------------------------
  4998.  
  4999.     # ● 魔法かどうかの判断
  5000.  
  5001.     #--------------------------------------------------------------------------
  5002.  
  5003.     def magic?
  5004.  
  5005.       if @atk_f == 0
  5006.  
  5007.         return true
  5008.  
  5009.       else
  5010.  
  5011.         return false
  5012.  
  5013.       end
  5014.  
  5015.     end
  5016.  
  5017.   end
  5018.  
  5019. end
  5020.  
  5021.  
  5022. # アローカーソルの位置修正
  5023.  
  5024.  
  5025. class Arrow_Actor < Arrow_Base
  5026.  
  5027.   include Side_view
  5028.  
  5029.   #--------------------------------------------------------------------------
  5030.  
  5031.   # ● フレーム更新
  5032.  
  5033.   #--------------------------------------------------------------------------
  5034.  
  5035.   alias side_view_update update
  5036.  
  5037.   def update
  5038.  
  5039.     side_view_update
  5040.  
  5041.     # スプライトの座標を設定
  5042.  
  5043.     if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
  5044.  
  5045.       self.x = self.actor.screen_x + ARROW_OX
  5046.  
  5047.       self.y = self.actor.screen_y + ARROW_OY
  5048.  
  5049.     end
  5050.  
  5051.   end
  5052.  
  5053. end
  5054.  
  5055. class Arrow_Enemy < Arrow_Base
  5056.  
  5057.   include Side_view
  5058.  
  5059.   #--------------------------------------------------------------------------
  5060.  
  5061.   # ● フレーム更新
  5062.  
  5063.   #--------------------------------------------------------------------------
  5064.  
  5065.   alias side_view_update update
  5066.  
  5067.   def update
  5068.  
  5069.     side_view_update
  5070.  
  5071.     # スプライトの座標を設定
  5072.  
  5073.     if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
  5074.  
  5075.       self.x = self.enemy.screen_x
  5076.  
  5077.       self.y = self.enemy.screen_y + self.enemy.height/2
  5078.  
  5079.     end
  5080.  
  5081.   end
  5082.  
  5083. end
  5084.  
  5085. module Rtab_use
  5086.  
  5087.   def update_phase4_step3(battler)
  5088.  
  5089.     # ヘルプウィンドウの更新。アクションの種別で分岐
  5090.  
  5091.     case battler.current_action.kind
  5092.  
  5093.     when 0  # 基本
  5094.  
  5095.       if battler.current_action.basic == 1
  5096.  
  5097.         @help_window.set_text($data_system.words.guard, 1)
  5098.  
  5099.         @help_wait = @help_time
  5100.  
  5101.       end
  5102.  
  5103.       if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  5104.  
  5105.         @help_window.set_text("逃げる", 1)
  5106.  
  5107.         @help_wait = @help_time
  5108.  
  5109.       end
  5110.  
  5111.     when 1  # スキル
  5112.  
  5113.       skill =  $data_skills[battler.current_action.skill_id]
  5114.  
  5115.       @help_window.set_text(skill.name, 1)
  5116.  
  5117.       @help_wait = @help_time
  5118.  
  5119.     when 2  # アイテム
  5120.  
  5121.       item = $data_items[battler.current_action.item_id]
  5122.  
  5123.       @help_window.set_text(item.name, 1)
  5124.  
  5125.       @help_wait = @help_time
  5126.  
  5127.     end
  5128.  
  5129.     # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
  5130.  
  5131.     if battler.anime1 == 0
  5132.  
  5133.       battler.white_flash = true
  5134.  
  5135.       battler.wait = 5
  5136.  
  5137.       # カメラ設定
  5138.  
  5139.       if battler.target[0].is_a?(Game_Enemy)
  5140.  
  5141.         camera_set(battler)
  5142.  
  5143.       end
  5144.  
  5145.     else
  5146.  
  5147.       battler.animation.push([battler.anime1, true])
  5148.  
  5149.       speller = synthe?(battler)
  5150.  
  5151.       if speller != nil
  5152.  
  5153.         for spell in speller
  5154.  
  5155.           if spell != battler
  5156.  
  5157.             if spell.current_action.spell_id == 0
  5158.  
  5159.               spell.animation.push([battler.anime1, true])
  5160.  
  5161.             else
  5162.  
  5163.               skill = spell.current_action.spell_id
  5164.  
  5165.               spell.animation.push([$data_skills[skill].animation1_id, true])
  5166.  
  5167.               spell.current_action.spell_id = 0
  5168.  
  5169.             end
  5170.  
  5171.           end
  5172.  
  5173.         end
  5174.  
  5175.       end
  5176.  
  5177.       battler.wait = 2 * $data_animations[battler.anime1].frame_max - 10
  5178.  
  5179.       battler.anime1 = 0
  5180.  
  5181.     end
  5182.  
  5183.     # ステップ 4 に移行
  5184.  
  5185.     battler.phase = 4 if !(!battler.animation1_on and battler.action? and !battler.flash?)
  5186.  
  5187.   end
  5188.  
  5189. end
  5190.  
  5191.  
  5192. #==============================================================================
  5193.  
  5194. # ■ Scene_Battle
  5195.  
  5196. #==============================================================================
  5197.  
  5198. class Scene_Battle
  5199.  
  5200.   include Side_view
  5201.  
  5202.   include Rtab_use if RTAB
  5203.  
  5204.   #--------------------------------------------------------------------------
  5205.  
  5206.   # ● 公開インスタンス変数
  5207.  
  5208.   #--------------------------------------------------------------------------
  5209.  
  5210.   attr_reader   :phase            # フェーズ
  5211.  
  5212.   attr_reader   :phase4_step      # フェーズ4ステップ
  5213.  
  5214.   attr_reader   :active_battler   # 対象の配列
  5215.  
  5216.   attr_reader   :target_battlers  # 対象の配列
  5217.  
  5218.   attr_reader   :animation1_id    # 行動アニメID
  5219.  
  5220.   attr_reader   :animation2_id    # 対象アニメID
  5221.  
  5222.   #--------------------------------------------------------------------------
  5223.  
  5224.   # ● メイン処理
  5225.  
  5226.   #--------------------------------------------------------------------------
  5227.  
  5228.   alias side_view_main main
  5229.  
  5230.   def main
  5231.  
  5232.     # バトラー初期化
  5233.  
  5234.     for battler in $game_party.actors + $game_troop.enemies
  5235.  
  5236.       battler.start_battle
  5237.  
  5238.     end
  5239.  
  5240.     # 戻す
  5241.  
  5242.     side_view_main
  5243.  
  5244.   end
  5245.  
  5246.   #--------------------------------------------------------------------------
  5247.  
  5248.   # ● 閃き判定
  5249.  
  5250.   #--------------------------------------------------------------------------
  5251.  
  5252.   def flash?
  5253.  
  5254.     return @flash_flag ? true : false
  5255.  
  5256.   end  
  5257.  
  5258.   #--------------------------------------------------------------------------
  5259.  
  5260.   # ● 閃きアニメ待ち時間取得
  5261.  
  5262.   #--------------------------------------------------------------------------
  5263.  
  5264.   def flash_duration
  5265.  
  5266.     animation = nil
  5267.  
  5268.     if FLASH_ANIME
  5269.  
  5270.       animation = $data_animations[FLASH_ANIMATION_ID]
  5271.  
  5272.     end
  5273.  
  5274.     return animation != nil ? animation.frame_max * 2 + 2 : 0
  5275.  
  5276.   end
  5277.  
  5278.   #--------------------------------------------------------------------------
  5279.  
  5280.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  5281.  
  5282.   #--------------------------------------------------------------------------
  5283.  
  5284.   alias side_view_update_phase4_step2 update_phase4_step2
  5285.  
  5286.   def update_phase4_step2(*arg)
  5287.  
  5288.     battler = convert_battler2(*arg)
  5289.  
  5290.     battler.action
  5291.  
  5292.     side_view_update_phase4_step2(*arg)
  5293.  
  5294.   end
  5295.  
  5296.   #--------------------------------------------------------------------------
  5297.  
  5298.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  5299.  
  5300.   #--------------------------------------------------------------------------
  5301.  
  5302.   alias side_view_update_phase4_step3 update_phase4_step3
  5303.  
  5304.   def update_phase4_step3(*arg)
  5305.  
  5306.     battler = convert_battler2(*arg)
  5307.  
  5308.     if battler.flash? and FLASH_ANIME
  5309.  
  5310.       battler.flash_flag["normal"] = true
  5311.  
  5312.     end
  5313.  
  5314.     side_view_update_phase4_step3(*arg)
  5315.  
  5316.   end
  5317.  
  5318.   #--------------------------------------------------------------------------
  5319.  
  5320.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  5321.  
  5322.   #--------------------------------------------------------------------------
  5323.  
  5324.   alias side_view_update_phase4_step4 update_phase4_step4
  5325.  
  5326.   def update_phase4_step4(*arg)
  5327.  
  5328.     battler = convert_battler2(*arg)
  5329.  
  5330.     targets = RTAB ? battler.target : @target_battlers
  5331.  
  5332.     return if !battler.animation2_on and battler.action? if !RTAB
  5333.  
  5334.     side_view_update_phase4_step4(*arg)
  5335.  
  5336.     for target in targets
  5337.  
  5338.       if RTAB
  5339.  
  5340.         value = nil
  5341.  
  5342.         if target.damage_sp.include?(battler)
  5343.  
  5344.           value = target.damage_sp[battler]
  5345.  
  5346.         end
  5347.  
  5348.         if target.damage.include?(battler)
  5349.  
  5350.           if value == nil or value == "Miss"
  5351.  
  5352.             value = target.damage[battler]
  5353.  
  5354.           elsif value.is_a?(Numeric) && value > 0
  5355.  
  5356.             value = target.damage[battler] == "Miss" ? value : target.damage[battler]
  5357.  
  5358.           end
  5359.  
  5360.         end
  5361.  
  5362.       else
  5363.  
  5364.         value = target.damage
  5365.  
  5366.       end
  5367.  
  5368.       if target.is_a?(Game_Actor)
  5369.  
  5370.         # ダメージの場合
  5371.  
  5372.         if value.is_a?(Numeric) && value > 0
  5373.  
  5374.           # シェイクを開始
  5375.  
  5376.           target.shake = true
  5377.  
  5378.         end
  5379.  
  5380.       elsif target.is_a?(Game_Enemy)
  5381.  
  5382.         # ダメージの場合
  5383.  
  5384.         if value.is_a?(Numeric) && value > 0
  5385.  
  5386.           # シェイクを開始
  5387.  
  5388.           target.shake = true
  5389.  
  5390.         end
  5391.  
  5392.       end
  5393.  
  5394.     end
  5395.  
  5396.   end
  5397.  
  5398.   #--------------------------------------------------------------------------
  5399.  
  5400.   # ● プレバトルフェーズ開始
  5401.  
  5402.   #--------------------------------------------------------------------------
  5403.  
  5404.   alias start_phase1_correct start_phase1
  5405.   def start_phase1
  5406.  
  5407.     # カメラの設定
  5408.  
  5409.     # 元々フロントビュー向けの数値になっているため
  5410.  
  5411.     @zoom_rate = [1.0, 1.0]
  5412.  
  5413.     start_phase1_correct
  5414.  
  5415.   end
  5416.  
  5417.   #--------------------------------------------------------------------------
  5418.  
  5419.   # ● アクターコマンドフェーズ開始
  5420.  
  5421.   #--------------------------------------------------------------------------
  5422.  
  5423.   alias start_phase3_correct start_phase3
  5424.   def start_phase3
  5425.  
  5426.     battler = convert_battler
  5427.  
  5428.     start_phase3_correct
  5429.  
  5430.     if RTAB
  5431.  
  5432.       # カメラの設定
  5433.  
  5434.       # 元々フロントビュー向けの数値になっているため
  5435.  
  5436.       @camera = "command"
  5437.  
  5438. #      @spriteset.screen_target(0, 0, 1.0)
  5439.  
  5440.     end
  5441.  
  5442.   end
  5443.  
  5444.  
  5445.  
  5446.   def action_phase(battler)
  5447.  
  5448.     # action が 1 の場合、バトラーが行動中かどうか確認
  5449.  
  5450.     if @action == 1 and battler.phase < 3
  5451.  
  5452.       for target in battler.target
  5453.  
  5454.         speller = synthe?(target)
  5455.  
  5456.         if speller == nil
  5457.  
  5458.           # ターゲットが通常行動中の場合
  5459.  
  5460.           if @action_battlers.include?(target)
  5461.  
  5462.             if target.phase > 2
  5463.  
  5464.               return
  5465.  
  5466.             end
  5467.  
  5468.           end
  5469.  
  5470.         else
  5471.  
  5472.           # ターゲットが連携スキル発動中の場合
  5473.  
  5474.           for spell in speller
  5475.  
  5476.             if @action_battlers.include?(spell)
  5477.  
  5478.               if spell.phase > 2
  5479.  
  5480.                 return
  5481.  
  5482.               end
  5483.  
  5484.             end
  5485.  
  5486.           end
  5487.  
  5488.         end
  5489.  
  5490.       end
  5491.  
  5492.     end
  5493.  
  5494. case battler.phase
  5495.  
  5496.   when 1
  5497.  
  5498.     update_phase4_step1(battler)
  5499.  
  5500.   when 2
  5501.  
  5502.     update_phase4_step2(battler)
  5503.  
  5504.   when 3  
  5505.  
  5506.     update_phase4_step3(battler) if !(!battler.animation1_on and battler.action? and !battler.flash?)
  5507.   when 4
  5508.  
  5509.     update_phase4_step4(battler) if !(!battler.animation2_on and battler.action?)
  5510.  
  5511.   when 5
  5512.  
  5513.     update_phase4_step5(battler)
  5514.  
  5515.   when 6
  5516.  
  5517.     update_phase4_step6(battler)
  5518.  
  5519.   end
  5520.  
  5521. end
  5522.  
  5523. #end
  5524.  
  5525. #end
  5526.  
  5527. end
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-29 09:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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