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

Project1

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

[已经过期] 请问如何在rmxp中添加rmva脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
36 小时
注册时间
2013-11-17
帖子
72
跳转到指定楼层
1
发表于 2013-12-25 09:52:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 fux2 于 2013-12-25 14:07 编辑

  或者说有没有一种xp脚本和后知后觉的横版脚本差不多的脚本
我愿意用40经验买下它

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
2
发表于 2013-12-25 17:18:52 | 只看该作者
大多数VA脚本都是从XP移植的,再说了普通横板战斗无需外来脚本
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv4.逐梦者

【欧皇】

梦石
3
星屑
2046
在线时间
1004 小时
注册时间
2013-8-19
帖子
3486

开拓者

3
发表于 2013-12-25 18:23:55 | 只看该作者
本帖最后由 欧买歌 于 2013-12-25 18:25 编辑

这是菜鸟横版的脚本,复制后插入即可。
  1. =begin
  2. ###############################################################################

  3. 全局行走图战斗 v1.1
  4. 本版本只经低测试,可能存在某些bug。
  5. 请注意更新
  6. http://rpg.blue/viewthread.php?tid=129875&extra=page%3D1
  7. --烁灵 整合彩虹神剑
  8. ###############################################################################
  9. ------------------------------------------------------------------------------
  10. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  11. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)

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

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

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

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

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

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

  47. =end                                                        #modify by darkten

  48. ###############################################################################

  49. =begin

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

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

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

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

  209.   Actions = {

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

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

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

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

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

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

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


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

  490. #class Game_Enemy < Game_Battler
  491.   #--------------------------------------------------------------------------
  492.   # ● 遠距離アニメーション
  493.   #--------------------------------------------------------------------------
  494. #~  def flying_anime
  495. #~    return [0,0,false,false]
  496. #~  end
  497. #end



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

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

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

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

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

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

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

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

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

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

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

  2478. module RPG
  2479.   class Skill
  2480.     #--------------------------------------------------------------------------
  2481.     # ● 魔法かどうかの判断
  2482.     #--------------------------------------------------------------------------
  2483.     def magic?
  2484.       if @atk_f == 0
  2485.         return true
  2486.       else
  2487.         return false
  2488.       end
  2489.     end
  2490.   end
  2491. end

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

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

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


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

评分

参与人数 1星屑 +90 收起 理由
myownroc + 90 塞糖

查看全部评分

QQ:2223942063
Q群:365819625
贪吃方1.4
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-30 07:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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