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

Project1

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

[已经过期] 菜鸟横版modified 脚本如何改魔法释放也能显示武器

[复制链接]

Lv1.梦旅人

梦石
0
星屑
102
在线时间
43 小时
注册时间
2014-6-16
帖子
29
跳转到指定楼层
1
发表于 2014-12-4 22:15:12 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 RyanBern 于 2014-12-4 22:17 编辑

菜鸟横版modified脚本设定: 在数据库特技中 攻击力为大于0则为除魔法以外的特技,在脚本释放动作中 就会跳到敌人面前,旋转。
      那么问题来了,设定为0的话 就是魔法 释放的时候就只是往前走一步,而且  不显示武器!  辛苦多年寻找的素材就无法得到显示

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


  

QQ截图20141204215149.png (187.48 KB, 下载次数: 1)

QQ截图20141204215149.png
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-6-14 13:09

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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