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

Project1

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

[已经解决] 求去除横版战斗人物的第三只手=、=...

[复制链接]

Lv1.梦旅人

梦石
0
星屑
195
在线时间
339 小时
注册时间
2012-7-16
帖子
148
跳转到指定楼层
1
发表于 2013-3-17 09:35:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 小夏坑面包 于 2013-3-18 18:22 编辑

如如所示。。。表示不懂如何去除=。=求高人解答。。脚本如下...
我还是上工程吧- =希望你们能解决- =
问题根源.rar (672.26 KB, 下载次数: 41) 就是这个了=。= 请大家帮忙
  1. =begin
  2.   #--------------------------------------------------------------------------
  3.  # ● 人物行走图做战斗图像(附加动画) ver1.02
  4.   #--------------------------------------------------------------------------
  5.   制作者 らい
  6.   翻译:忧郁的涟漪
  7.   
  8.    
  9.   图像文件的规格
  10.   
  11.   ● 巴特勒图像(似乎指的是战斗图像)
  12.   
  13.   使用步行图片。
  14.    
  15.   ● 武器的图像
  16.   
  17.   就是武器图标的图像(ICO图)  
  18.       

  19. ###############################################################################
  20. 行走图横版战斗:
  21. ------------------------------------------------------------------------------
  22. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  23. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)

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

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

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

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

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

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

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

  186. #--------------------------------------------------------------------------
  187. # ● 行动設定
  188. #--------------------------------------------------------------------------
  189. module BattleActions
  190.   
  191.   # 下のものはあくまでも一例なので
  192.   # 独自に作ってください。

  193.   Actions = {

  194.   "通常攻撃" => [
  195.   
  196.   "閃きアニメ",
  197.   "アクターアニメ変更#WALK_L",
  198.   "移動#target,32,0,64,0",
  199.   "行動アニメ",
  200.   "アクターアニメ変更#ATTACK",
  201.   "遠距離アニメ",
  202.   "対象アニメ",
  203.   "アクターアニメ変更#WALK_L",
  204.   "SEの演奏#016-Jump02,80,100",
  205.   "移動#self,0,0,48,32",
  206.   "終了"
  207.   ],

  208.   "エネミー攻撃" => [
  209.   
  210.   "閃きアニメ",
  211.   "アクターアニメ変更#WALK_L",
  212.   "移動#self,-36,0,12,0",
  213.   "行動アニメ",
  214.   "アクターアニメ変更#ATTACK",
  215.   "遠距離アニメ",
  216.   "対象アニメ",
  217.   "アクターアニメ変更#WALK_L",
  218.   "移動#self,0,0,12,0",
  219.   "終了"
  220.   ],
  221.   
  222.   "術発動" => [
  223.   
  224.   "閃きアニメ",
  225.   "アクターアニメ変更#WALK_L",
  226.   "移動#self,-32,0,4,0",
  227.   "アクターアニメ変更#MAGIC",
  228.   "行動アニメ",
  229.   "ウエイト#15",
  230.   "遠距離アニメ",
  231.   "対象アニメ",
  232.   "アクターアニメ変更#WALK_L",
  233.   "移動#self,0,0,4,2",
  234.   "終了"
  235.   ],

  236.   "アイテム使用" => [
  237.   
  238.   "閃きアニメ",
  239.   "アクターアニメ変更#WALK_L",
  240.   "移動#self,-32,0,4,0",
  241.   "行動アニメ",
  242.   "アクターアニメ変更#ITEM",
  243.   "ウエイト#15",
  244.   "遠距離アニメ",
  245.   "対象アニメ",
  246.   "アクターアニメ変更#WALK_L",
  247.   "移動#self,0,0,4,2",
  248.   "終了"
  249.   ],
  250.   
  251.   "払い抜け" => [
  252.   
  253.   "閃きアニメ",
  254.   "アクターアニメ変更#WALK_L",
  255.   "移動#target_near,50,0,48,30",  
  256.   "左右反転",
  257.   "アクターアニメ固定#ATTACK#3",
  258.   "行動アニメ",
  259.   "SEの演奏#135-Light01,100,100",
  260.   "アニメーションの表示#self,42",
  261.   "ウエイト#15",
  262.   "左右反転",
  263.   "残像表示",
  264.   "移動#target_far,-50,0,48,0",
  265.   "対象アニメ",
  266.   "残像消去",
  267.   "アニメ固定解除",
  268.   "アクターアニメ変更#WALK_L",
  269.   "移動#self,0,0,48,1,0",
  270.   "終了"
  271.   ],

  272.   "弓箭攻撃" => [
  273.   
  274.   "閃きアニメ",
  275.   "アクターアニメ変更#WALK_L",
  276.   "移動#self,-32,0,4,0",
  277.   "行動アニメ",
  278.   "アクターアニメ変更#ATTACK",
  279.   "遠距離アニメ",
  280.   "対象アニメ",
  281.   "アクターアニメ変更#WALK_L",
  282.   "移動#self,0,0,4,2",
  283.   "終了"
  284.   ],

  285.   "回旋攻撃" => [
  286.   
  287.   "閃きアニメ",
  288.   "アクターアニメ変更#WALK_L",
  289.   "移動#self,-32,0,4,0",
  290.   "行動アニメ",
  291.   "アクターアニメ変更#STAND_L",  
  292.   "遠距離アニメ",
  293.   "対象アニメ",
  294.   "アクターアニメ変更#WALK_L",
  295.   "移動#self,0,0,4,2",
  296.   "終了"
  297.   ],
  298.   
  299.   "远距离発動" => [
  300.   
  301.   "閃きアニメ",
  302.   "アクターアニメ変更#WALK_L",
  303.   "移動#self,-32,0,4,0",
  304.   "アクターアニメ変更#MAGIC",
  305.   "行動アニメ",
  306.   "アクターアニメ変更#ATTACK",
  307.   "遠距離アニメ",
  308.   "対象アニメ",
  309.   "アクターアニメ変更#WALK_L",
  310.   "移動#self,0,0,4,2",
  311.   "終了"
  312.   ],
  313.   
  314.   "回旋発動" => [
  315.   
  316.   "閃きアニメ",
  317.   "アクターアニメ変更#WALK_L",
  318.   "移動#self,-32,0,4,0",
  319.   "アクターアニメ変更#MAGIC",
  320.   "行動アニメ",
  321.   "アクターアニメ変更#STAND_L",  
  322.   "遠距離アニメ",
  323.   "対象アニメ",
  324.   "アクターアニメ変更#WALK_L",
  325.   "移動#self,0,0,4,2",
  326.   "終了"
  327.   ],

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

  329. end
  330.   
  331. module RPG
  332.   class Weapon
  333.     #--------------------------------------------------------------------------
  334.     # ● アクション設定
  335.     #--------------------------------------------------------------------------
  336.     def battle_actions
  337.       case @id
  338.       when 17,18,19,20,21,22,23,24,36,29,30,31,32,57,60,61,62,63,64  # 远程武器的id回旋攻撃
  339.         return BattleActions::Actions["弓箭攻撃"]
  340.       when 34                       # 回旋武器的id
  341.         return BattleActions::Actions["回旋攻撃"]
  342.       end
  343.       else
  344.       return BattleActions::Actions["通常攻撃"]
  345.     end
  346.   end
  347.   class Skill
  348.     #--------------------------------------------------------------------------
  349.     # ● アクション設定
  350.     #--------------------------------------------------------------------------
  351.     def battle_actions
  352.       case @id
  353.       when 73,74,75,76,77,78,79,80,86,88,89,91,92,94,96,97,99,100,101,104,112,113,123,124,125,126,127 # 远程技能的id
  354.         return BattleActions::Actions["远距离発動"]
  355.       when 82                       # 回旋技能的id
  356.         return BattleActions::Actions["回旋発動"]
  357.       end
  358.       else
  359.       if self.magic?
  360.         return BattleActions::Actions["術発動"]
  361.       else
  362.         return BattleActions::Actions["払い抜け"]
  363.       end
  364.     end
  365.   end
  366.   class Item
  367.     #--------------------------------------------------------------------------
  368.     # ● アクション設定
  369.     #--------------------------------------------------------------------------
  370.     def battle_actions
  371.       return BattleActions::Actions["アイテム使用"]
  372.     end
  373.   end
  374. end
  375. class Game_Enemy < Game_Battler
  376.   #--------------------------------------------------------------------------
  377.   # ● アクション設定
  378.   #--------------------------------------------------------------------------
  379.   def battle_actions
  380.     return BattleActions::Actions["エネミー攻撃"]
  381.   end
  382. end
  383. =begin
  384. #--------------------------------------------------------------------------
  385. # ● 遠距離アニメーション
  386. #--------------------------------------------------------------------------
  387.  ☆ 説明
  388.   
  389.    行動者から対象者にアニメを飛ばします。
  390.    飛ばすアニメを データベース‐アニメーション で作ります。
  391.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。


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

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

  1102.     # RTAB対応
  1103.     # 通常・待機
  1104.     return self.condition = NORMAL
  1105.   end
  1106.   #--------------------------------------------------------------------------
  1107.   # ● アクションの取得
  1108.   #--------------------------------------------------------------------------
  1109.   def get_actions
  1110.     skill = $data_skills[self.current_action.skill_id]
  1111.     item = $data_items[self.current_action.item_id]
  1112.     kind = self.current_action.kind
  1113.     # 動作取得
  1114.     @battle_actions = []
  1115.     # スキル
  1116.     if skill != nil && kind == 1
  1117.       @battle_actions = skill.battle_actions.dup
  1118.       @flying_anime = skill.flying_anime
  1119.     # アイテム
  1120.     elsif item != nil && kind == 2
  1121.       @battle_actions = item.battle_actions.dup
  1122.       @flying_anime = item.flying_anime
  1123.     # 左手攻撃
  1124.     elsif !@first_weapon and @second_weapon and self.is_a?(Game_Actor)
  1125.       @battle_actions = self.battle_actions2.dup
  1126.       @flying_anime = self.flying_anime2
  1127.     # 右手攻撃
  1128.     elsif self.current_action.basic == 0 and
  1129.       self.is_a?(Game_Actor) and self.current_action.kind == 0
  1130.       @battle_actions = self.battle_actions1.dup
  1131.       @flying_anime = self.flying_anime1
  1132.     # 通常攻撃
  1133.     elsif self.current_action.basic == 0 and self.current_action.kind == 0
  1134.       @battle_actions = self.battle_actions.dup
  1135.       @flying_anime = self.flying_anime
  1136.     else
  1137.       @battle_actions = ["終了"]
  1138.       @flying_anime = [0,0,false,false]
  1139.     end
  1140.   end
  1141.   #--------------------------------------------------------------------------
  1142.   # ● ループしないアニメのセット
  1143.   #--------------------------------------------------------------------------
  1144.   def anime_on
  1145.     @pattern = 0
  1146.     @pattern_log = true
  1147.     return
  1148.   end
  1149.   #--------------------------------------------------------------------------
  1150.   # ● パターン更新
  1151.   #--------------------------------------------------------------------------
  1152.   def char_animation
  1153.     # パタン固定の場合もどる
  1154.     return if @pattern_freeze
  1155.     # ループしないアニメの場合 1234 で止まる
  1156.     if !ANIME[@battler_condition][1] && @pattern == 3
  1157.       return
  1158.     end
  1159.     # アニメさせない場合 1 で止まる
  1160.     if ANIME[@battler_condition][4]
  1161.       @pattern = 0
  1162.       return
  1163.     end
  1164.     @pattern = (@pattern + 1) % 4
  1165.   end
  1166.   #--------------------------------------------------------------------------
  1167.   # ● アニメタイプ
  1168.   #--------------------------------------------------------------------------
  1169.   def anime_type
  1170.     return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  1171.   end
  1172. end
  1173. #==============================================================================
  1174. # ■ Game_Actor
  1175. #==============================================================================
  1176. class Game_Actor < Game_Battler
  1177.   include Side_view
  1178.   #--------------------------------------------------------------------------
  1179.   # ● セットアップ
  1180.   #--------------------------------------------------------------------------
  1181.   alias side_view_setup setup
  1182.   def setup(actor_id)
  1183.     side_view_setup(actor_id)
  1184.     start_battle
  1185.   end
  1186.   #--------------------------------------------------------------------------
  1187.   # ● 二刀武器のID取得 ※エラー回避用
  1188.   #--------------------------------------------------------------------------
  1189.   def weapon2_id
  1190.     return @weapon2_id != nil ? @weapon2_id : 0
  1191.   end
  1192.   #--------------------------------------------------------------------------
  1193.   # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  1194.   #--------------------------------------------------------------------------
  1195.   def position
  1196.     return $data_classes[@class_id].position
  1197.   end
  1198.   #--------------------------------------------------------------------------
  1199.   # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  1200.   #--------------------------------------------------------------------------
  1201.   def position2
  1202.     return self.index
  1203.   end
  1204.   #--------------------------------------------------------------------------
  1205.   # ● 武器アニメタイプ
  1206.   #--------------------------------------------------------------------------
  1207.   def weapon_anime_type(type)
  1208.     file_name  = weapon_anime_type0(type)
  1209.     visible   = weapon_anime_type1(type)
  1210.     z         = weapon_anime_type2(type)
  1211.     return [file_name,visible,z]
  1212.   end
  1213.   # 武器アイコン取得
  1214.   def weapon_anime_type0(type)
  1215.     type = ANIME[type][5]
  1216.     return weapon_anime1 if type == "右手"
  1217.     return weapon_anime2 if type == "左手"
  1218.     return nil
  1219.   end
  1220.   # 表示・非表示の取得
  1221.   def weapon_anime_type1(type)
  1222.     return ANIME[type][3]
  1223.   end
  1224.   # バトラーより上に表示するかどうか
  1225.   def weapon_anime_type2(type)
  1226.     type = ANIME[type][5]
  1227.     return true if type == "左手"
  1228.     return false
  1229.   end
  1230.   #--------------------------------------------------------------------------
  1231.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1232.   #--------------------------------------------------------------------------
  1233.   def true_x
  1234.     return PARTY_X + position * FORMATION_X + @ox
  1235.   end
  1236.   #--------------------------------------------------------------------------
  1237.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1238.   #--------------------------------------------------------------------------
  1239.   def true_y
  1240.     # パーティ内の並び順から Y 座標を計算して返す
  1241.     if self.index != nil
  1242.       y = position2 * FORMATION_Y + PARTY_Y + @oy - [url=home.php?mod=space&uid=291977]@height[/url] / 2
  1243.       return y
  1244.     else
  1245.       return 0
  1246.     end
  1247.   end
  1248.   #--------------------------------------------------------------------------
  1249.   # ● バトル画面 X 座標の取得
  1250.   #--------------------------------------------------------------------------
  1251.   def screen_x(true_x = self.true_x)
  1252.     return 320 + (true_x - 320) * @real_zoom + @real_x
  1253.   end
  1254.   #--------------------------------------------------------------------------
  1255.   # ● バトル画面 Y 座標の取得
  1256.   #--------------------------------------------------------------------------
  1257.   def screen_y(true_y = self.true_y)
  1258.     return true_y * @real_zoom + @real_y
  1259.   end
  1260.   #--------------------------------------------------------------------------
  1261.   # ● バトル画面 Z 座標の取得
  1262.   #--------------------------------------------------------------------------
  1263.   def screen_z
  1264.     return screen_y + 1000
  1265.   end
  1266.   #--------------------------------------------------------------------------
  1267.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1268.   #--------------------------------------------------------------------------
  1269.   def base_x
  1270.     return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  1271.   end
  1272.   #--------------------------------------------------------------------------
  1273.   # ● バトル画面 Y 座標の取得
  1274.   #--------------------------------------------------------------------------
  1275.   def base_y
  1276.     return (true_y - @oy) * @real_zoom + @real_y
  1277.   end
  1278.   #--------------------------------------------------------------------------
  1279.   # ● バトル画面 拡大率の取得
  1280.   #--------------------------------------------------------------------------
  1281.   def zoom
  1282.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  1283.                           (true_x + @fly) / 480 + $scene.zoom_rate[0]
  1284.   end
  1285.   #--------------------------------------------------------------------------
  1286.   # ● 攻撃用、バトル画面 X 座標の取得
  1287.   #--------------------------------------------------------------------------
  1288.   def attack_x(z)
  1289.     return (320 - true_x) * z * 0.75
  1290.   end
  1291.   #--------------------------------------------------------------------------
  1292.   # ● 攻撃用、バトル画面 Y 座標の取得
  1293.   #--------------------------------------------------------------------------
  1294.   def attack_y(z)
  1295.     return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  1296.   end
  1297.   #--------------------------------------------------------------------------
  1298.   # ● 閃き待ち時間
  1299.   #--------------------------------------------------------------------------
  1300.   def flash_duration
  1301.     return $scene.flash_duration
  1302.   end
  1303.   #--------------------------------------------------------------------------
  1304.   # ● アニメーション取得
  1305.   #--------------------------------------------------------------------------
  1306.   def battle_actions1
  1307.     weapon = $data_weapons[@weapon_id]
  1308.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1309.   end
  1310.   #--------------------------------------------------------------------------
  1311.   # ● アニメーション取得
  1312.   #--------------------------------------------------------------------------
  1313.   def battle_actions2
  1314.     weapon = $data_weapons[@weapon2_id]
  1315.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1316.   end
  1317.   #--------------------------------------------------------------------------
  1318.   # ● 武器アニメーション取得
  1319.   #--------------------------------------------------------------------------
  1320.   def weapon_anime1
  1321.     weapon = $data_weapons[@weapon_id]
  1322.     return weapon != nil ? weapon.icon_name : ""
  1323.   end
  1324.   #--------------------------------------------------------------------------
  1325.   # ● 武器アニメーション取得
  1326.   #--------------------------------------------------------------------------
  1327.   def weapon_anime2
  1328.     weapon = $data_weapons[@weapon2_id]
  1329.     return weapon != nil ? weapon.icon_name : ""
  1330.   end
  1331.   #--------------------------------------------------------------------------
  1332.   # ● 遠距離アニメーション取得
  1333.   #--------------------------------------------------------------------------
  1334.   def flying_anime1
  1335.     weapon = $data_weapons[@weapon_id]
  1336.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1337.   end
  1338.   #--------------------------------------------------------------------------
  1339.   # ● 遠距離アニメーション取得
  1340.   #--------------------------------------------------------------------------
  1341.   def flying_anime2
  1342.     weapon = $data_weapons[@weapon2_id]
  1343.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1344.   end
  1345.   #--------------------------------------------------------------------------
  1346.   # ● 移動目標座標の計算
  1347.   #--------------------------------------------------------------------------
  1348.   def move_setup
  1349.     if RTAB
  1350.       targets = @target
  1351.     else
  1352.       targets = $scene.target_battlers
  1353.     end
  1354.     case @move_action[0]
  1355.     when "self" # 自分
  1356.       @target_x = self.base_x
  1357.       @target_y = self.base_y
  1358.     when "target_near" # 一番近くのターゲット
  1359.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1360.       targets.reverse!
  1361.       if targets != []
  1362.         @target_x = targets[0].screen_x
  1363.         @target_y = targets[0].screen_y
  1364.       else
  1365.         @target_x = self.base_x
  1366.         @target_y = self.base_y
  1367.       end
  1368.     when "target_far" # 一番遠くのターゲット
  1369.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1370.       if targets != []
  1371.         @target_x = targets[0].screen_x
  1372.         @target_y = targets[0].screen_y
  1373.       else
  1374.         @target_x = self.base_x
  1375.         @target_y = self.base_y
  1376.       end
  1377.     when "target" # ターゲット中央
  1378.       @target_x = 0
  1379.       @target_y = 0
  1380.       for t in targets
  1381.         @target_x += t.screen_x
  1382.         @target_y += t.screen_y
  1383.       end
  1384.       if targets != []
  1385.         @target_x /= targets.size
  1386.         @target_y /= targets.size
  1387.       end
  1388.     when "troop" # "トループ中央"
  1389.       @target_x = 0
  1390.       @target_y = 0
  1391.       for t in $game_troop.enemies
  1392.         @target_x += t.screen_x
  1393.         @target_y += t.screen_y
  1394.       end
  1395.       if $game_troop.enemies != []
  1396.         @target_x /= $game_troop.enemies.size
  1397.         @target_y /= $game_troop.enemies.size
  1398.       end
  1399.     when "party" # "パーティ中央"
  1400.       @target_x = 0
  1401.       @target_y = 0
  1402.       for t in $game_party.actors
  1403.         @target_x += t.screen_x
  1404.         @target_y += t.screen_y
  1405.       end
  1406.       if $game_party.actors != []
  1407.         @target_x /= $game_party.actors.size
  1408.         @target_y /= $game_party.actors.size
  1409.       end
  1410.     when "screen" # "画面"
  1411.       @target_x = self.base_x
  1412.       @target_y = self.base_y
  1413.     end
  1414.     # 補正
  1415.     @target_x += @move_action[1] - self.base_x
  1416.     @target_y += @move_action[2] - self.base_y
  1417.     # 移動目標の座標をセット
  1418.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1419.     # 距離の計算(ウエイトの設定)
  1420.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1421.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1422.   end
  1423. end
  1424. #==============================================================================
  1425. # ■ Game_Enemy
  1426. #==============================================================================
  1427. class Game_Enemy < Game_Battler
  1428.   #--------------------------------------------------------------------------
  1429.   # ● セットアップ
  1430.   #--------------------------------------------------------------------------
  1431.   alias side_view_initialize initialize
  1432.   def initialize(troop_id, member_index)
  1433.     side_view_initialize(troop_id, member_index)
  1434.     start_battle
  1435.   end
  1436.   #--------------------------------------------------------------------------
  1437.   # ● 移動
  1438.   #--------------------------------------------------------------------------
  1439.   def move
  1440.     # 距離の計算
  1441.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1442.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1443.     if @move_distance > 0
  1444.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  1445.       array = @move_coordinates
  1446.       # ジャンプ補正値の計算
  1447.       if @move_distance - @move_wait > @move_distance / 2
  1448.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2
  1449.       else
  1450.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  1451.       end
  1452.       jump = @move_action[4] > 0 ? -jump : jump
  1453.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  1454.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  1455.       # ウエイト
  1456.       @move_wait -= @move_action[3]
  1457.       @move_wait = [@move_wait,0].max
  1458.     end
  1459.   end
  1460.   #--------------------------------------------------------------------------
  1461.   # ● 移動目標座標の計算
  1462.   #--------------------------------------------------------------------------
  1463.   def move_setup
  1464.     if RTAB
  1465.       targets = @target
  1466.     else
  1467.       targets = $scene.target_battlers
  1468.     end
  1469.     case @move_action[0]
  1470.     when "self" # 自分
  1471.       @target_x = self.base_x
  1472.       @target_y = self.base_y
  1473.     when "target_near" # 一番近くのターゲット
  1474.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1475.       if targets != []
  1476.         @target_x = targets[0].screen_x
  1477.         @target_y = targets[0].screen_y
  1478.       else
  1479.         @target_x = self.base_x
  1480.         @target_y = self.base_y
  1481.       end
  1482.     when "target_far" # 一番遠くのターゲット
  1483.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1484.       targets.reverse!
  1485.       if targets != []
  1486.         @target_x = targets[0].screen_x
  1487.         @target_y = targets[0].screen_y
  1488.       else
  1489.         @target_x = self.base_x
  1490.         @target_y = self.base_y
  1491.       end
  1492.     when "target" # ターゲット中央
  1493.       @target_x = 0
  1494.       @target_y = 0
  1495.       for t in targets
  1496.         @target_x += t.screen_x
  1497.         @target_y += t.screen_y
  1498.       end
  1499.       if targets != []
  1500.         @target_x /= targets.size
  1501.         @target_y /= targets.size
  1502.       end
  1503.     when  "party" # "トループ中央"
  1504.       @target_x = 0
  1505.       @target_y = 0
  1506.       for t in $game_troop.enemies
  1507.         @target_x += t.screen_x
  1508.         @target_y += t.screen_y
  1509.       end
  1510.       if $game_troop.enemies != []
  1511.         @target_x /= $game_troop.enemies.size
  1512.         @target_y /= $game_troop.enemies.size
  1513.       end
  1514.     when "troop" # "パーティ中央"
  1515.       @target_x = 0
  1516.       @target_y = 0
  1517.       for t in $game_party.actors
  1518.         @target_x += t.screen_x
  1519.         @target_y += t.screen_y
  1520.       end
  1521.       if $game_party.actors != []
  1522.         @target_x /= $game_party.actors.size
  1523.         @target_y /= $game_party.actors.size
  1524.       end
  1525.     when "screen" # "画面"
  1526.       @target_x = self.base_x
  1527.       @target_y = self.base_y
  1528.     end
  1529.     # 補正
  1530.     @target_x -= @move_action[1] + self.base_x
  1531.     @target_y -= @move_action[2] + self.base_y
  1532.     # 移動目標の座標をセット
  1533.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1534.     # 距離の計算(ウエイトの設定)
  1535.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1536.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1537.   end
  1538.   if RTAB
  1539.   alias original_x true_x
  1540.   alias original_y true_y
  1541.   else
  1542.   alias original_x screen_x
  1543.   alias original_y screen_y
  1544.   end
  1545.   #--------------------------------------------------------------------------
  1546.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1547.   #--------------------------------------------------------------------------
  1548.   def true_x
  1549.     return original_x + @ox
  1550.   end
  1551.   #--------------------------------------------------------------------------
  1552.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1553.   #--------------------------------------------------------------------------
  1554.   def true_y
  1555.     return original_y - @height / 2 + @oy
  1556.   end
  1557.   #--------------------------------------------------------------------------
  1558.   # ● バトル画面 X 座標の取得
  1559.   #--------------------------------------------------------------------------
  1560.   def screen_x(true_x = self.true_x)
  1561.     return true_x * @real_zoom + @real_x
  1562.   end
  1563.   #--------------------------------------------------------------------------
  1564.   # ● バトル画面 Y 座標の取得
  1565.   #--------------------------------------------------------------------------
  1566.   def screen_y(true_y = self.true_y)
  1567.     return true_y * @real_zoom + @real_y
  1568.   end
  1569.   #--------------------------------------------------------------------------
  1570.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1571.   #--------------------------------------------------------------------------
  1572.   def base_x(true_x = self.true_x)
  1573.     return (true_x - @ox) * @real_zoom + @real_x
  1574.   end
  1575.   #--------------------------------------------------------------------------
  1576.   # ● バトル画面 Y 座標の取得(移動などしていない場合)
  1577.   #--------------------------------------------------------------------------
  1578.   def base_y(true_y = self.true_y)
  1579.     return (true_y - @oy) * @real_zoom + @real_y
  1580.   end
  1581. end
  1582. #==============================================================================
  1583. # ■ Game_Party
  1584. #==============================================================================
  1585. class Game_Party
  1586.   #--------------------------------------------------------------------------
  1587.   # ● アクターを加える
  1588.   #     actor_id : アクター ID
  1589.   #--------------------------------------------------------------------------
  1590.   alias side_view_add_actor add_actor
  1591.   def add_actor(actor_id)
  1592.     # アクターを取得
  1593.     actor = $game_actors[actor_id]
  1594.     # サイドビューデータの初期化
  1595.     actor.start_battle
  1596.     # 戻す
  1597.     side_view_add_actor(actor_id)
  1598.   end
  1599. end
  1600. #==============================================================================
  1601. # ■ Scene_Battle
  1602. #==============================================================================
  1603. class Scene_Battle
  1604.   include Side_view
  1605.   #--------------------------------------------------------------------------
  1606.   # ● 公開インスタンス変数
  1607.   #--------------------------------------------------------------------------
  1608.   attr_reader   :phase            # フェーズ
  1609.   attr_reader   :phase4_step      # フェーズ4ステップ
  1610.   attr_reader   :active_battler   # 対象の配列
  1611.   attr_reader   :target_battlers  # 対象の配列
  1612.   attr_reader   :animation1_id    # 行動アニメID
  1613.   attr_reader   :animation2_id    # 対象アニメID
  1614.   #--------------------------------------------------------------------------
  1615.   # ● メイン処理
  1616.   #--------------------------------------------------------------------------
  1617.   alias side_view_main main
  1618.   def main
  1619.     # バトラー初期化
  1620.     for battler in $game_party.actors + $game_troop.enemies
  1621.       battler.start_battle
  1622.     end
  1623.     # 戻す
  1624.     side_view_main
  1625.   end
  1626.   #--------------------------------------------------------------------------
  1627.   # ● 閃き判定
  1628.   #--------------------------------------------------------------------------
  1629.   def flash?
  1630.     return @flash_flag ? true : false
  1631.   end  
  1632.   #--------------------------------------------------------------------------
  1633.   # ● 閃きアニメ待ち時間取得
  1634.   #--------------------------------------------------------------------------
  1635.   def flash_duration
  1636.     animation = nil
  1637.     if FLASH_ANIME
  1638.       animation = $data_animations[FLASH_ANIMATION_ID]
  1639.     end
  1640.     return animation != nil ? animation.frame_max * 2 + 2 : 0
  1641.   end
  1642.   #--------------------------------------------------------------------------
  1643.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  1644.   #--------------------------------------------------------------------------
  1645.   alias side_view_update_phase4_step2 update_phase4_step2
  1646.   def update_phase4_step2(*arg)
  1647.     battler = convert_battler2(*arg)
  1648.     battler.action
  1649.     side_view_update_phase4_step2(*arg)
  1650.   end
  1651.   #--------------------------------------------------------------------------
  1652.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  1653.   #--------------------------------------------------------------------------
  1654.   alias side_view_update_phase4_step3 update_phase4_step3
  1655.   def update_phase4_step3(*arg)
  1656.     battler = convert_battler2(*arg)
  1657.     return if !battler.animation1_on and battler.action? and !battler.flash?
  1658.     if battler.flash? and FLASH_ANIME
  1659.       battler.flash_flag["normal"] = true
  1660.     end
  1661.     side_view_update_phase4_step3(*arg)
  1662.   end
  1663.   #--------------------------------------------------------------------------
  1664.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  1665.   #--------------------------------------------------------------------------
  1666.   alias side_view_update_phase4_step4 update_phase4_step4
  1667.   def update_phase4_step4(*arg)
  1668.     battler = convert_battler2(*arg)
  1669.     targets = RTAB ? battler.target : @target_battlers
  1670.     return if !battler.animation2_on and battler.action?
  1671.     side_view_update_phase4_step4(*arg)
  1672.     for target in targets
  1673.       if RTAB
  1674.         value = nil
  1675.         if target.damage_sp.include?(battler)
  1676.           value = target.damage_sp[battler]
  1677.         end
  1678.         if target.damage.include?(battler)
  1679.           if value == nil or value == "Miss"
  1680.             value = target.damage[battler]
  1681.           elsif value.is_a?(Numeric) && value > 0
  1682.             value = target.damage[battler] == "Miss" ? value : target.damage[battler]
  1683.           end
  1684.         end
  1685.       else
  1686.         value = target.damage
  1687.       end
  1688.       if target.is_a?(Game_Actor)
  1689.         # ダメージの場合
  1690.         if value.is_a?(Numeric) && value > 0
  1691.           # シェイクを開始
  1692.           target.shake = true
  1693.         end
  1694.       elsif target.is_a?(Game_Enemy)
  1695.         # ダメージの場合
  1696.         if value.is_a?(Numeric) && value > 0
  1697.           # シェイクを開始
  1698.           target.shake = true
  1699.         end
  1700.       end
  1701.     end
  1702.   end
  1703.   #--------------------------------------------------------------------------
  1704.   # ● プレバトルフェーズ開始
  1705.   #--------------------------------------------------------------------------
  1706.   alias start_phase1_correct start_phase1
  1707.   def start_phase1
  1708.     # カメラの設定
  1709.     # 元々フロントビュー向けの数値になっているため
  1710.     @zoom_rate = [1.0, 1.0]
  1711.     start_phase1_correct
  1712.   end
  1713.   #--------------------------------------------------------------------------
  1714.   # ● アクターコマンドフェーズ開始
  1715.   #--------------------------------------------------------------------------
  1716.   alias start_phase3_correct start_phase3
  1717.   def start_phase3
  1718.     battler = convert_battler
  1719.     start_phase3_correct
  1720.     if RTAB
  1721.       # カメラの設定
  1722.       # 元々フロントビュー向けの数値になっているため
  1723.       @camera = "command"
  1724.       @spriteset.screen_target(0, 0, 1.0)
  1725.     end
  1726.   end
  1727. end

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

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

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

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

  2393. class Sprite_Flying < RPG::Sprite
  2394.   include Side_view
  2395.   #--------------------------------------------------------------------------
  2396.   # ● 公開インスタンス変数
  2397.   #--------------------------------------------------------------------------
  2398.   attr_accessor :battler                  # バトラー
  2399.   #--------------------------------------------------------------------------
  2400.   # ● オブジェクト初期化
  2401.   #     viewport : ビューポート
  2402.   #     battler  : バトラー (Game_Battler)
  2403.   #--------------------------------------------------------------------------
  2404.   def initialize(viewport, battler = nil)
  2405.     super(viewport)
  2406.     @battler = battler
  2407.     @battler_visible = false
  2408.   end
  2409.   #--------------------------------------------------------------------------
  2410.   # ● 解放
  2411.   #--------------------------------------------------------------------------
  2412.   def dispose
  2413.     if self.bitmap != nil
  2414.       self.bitmap.dispose
  2415.     end
  2416.     super
  2417.   end
  2418.   #--------------------------------------------------------------------------
  2419.   # ● フレーム更新
  2420.   #--------------------------------------------------------------------------
  2421.   def update
  2422.     super
  2423.     # バトラーが nil の場合
  2424.     if @battler == nil
  2425.       self.bitmap = nil
  2426.       loop_animation(nil)
  2427.       return
  2428.     end
  2429.     # 遠距離アニメ
  2430.     flying_animation = @battler.flying_animation
  2431.     flying_start = flying_animation[0]
  2432.     flying_end   = flying_animation[1]
  2433.     # アニメーション ID が現在のものと異なる場合
  2434.     if @anime_id != @battler.flying_anime[0]
  2435.       @anime_id = @battler.flying_anime[0]
  2436.       @animation = $data_animations[@anime_id]
  2437.     end
  2438.     # アニメーション 開始
  2439.     if flying_start
  2440.       loop_animation(@animation)
  2441.     elsif flying_end
  2442.       loop_animation(nil)
  2443.     end
  2444.     self.x = @battler.flying_x
  2445.     self.y = @battler.flying_y
  2446.     self.z = @battler.screen_z + 1000
  2447.   end
  2448. end

  2449. module RPG
  2450.   class Skill
  2451.     #--------------------------------------------------------------------------
  2452.     # ● 魔法かどうかの判断
  2453.     #--------------------------------------------------------------------------
  2454.     def magic?
  2455.       if @atk_f == 0
  2456.         return true
  2457.       else
  2458.         return false
  2459.       end
  2460.     end
  2461.   end
  2462. end

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

  2464. class Arrow_Actor < Arrow_Base
  2465.   include Side_view
  2466.   #--------------------------------------------------------------------------
  2467.   # ● フレーム更新
  2468.   #--------------------------------------------------------------------------
  2469.   alias side_view_update update
  2470.   def update
  2471.     side_view_update
  2472.     # スプライトの座標を設定
  2473.     if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
  2474.       self.x = self.actor.screen_x + ARROW_OX
  2475.       self.y = self.actor.screen_y + ARROW_OY
  2476.     end
  2477.   end
  2478. end
  2479. class Arrow_Enemy < Arrow_Base
  2480.   include Side_view
  2481.   #--------------------------------------------------------------------------
  2482.   # ● フレーム更新
  2483.   #--------------------------------------------------------------------------
  2484.   alias side_view_update update
  2485.   def update
  2486.     side_view_update
  2487.     # スプライトの座標を設定
  2488.     if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
  2489.       self.x = self.enemy.screen_x
  2490.       self.y = self.enemy.screen_y + self.enemy.height/2
  2491.     end
  2492.   end
  2493. end
复制代码
【6月份回归者】

Lv2.观梦者

梦石
0
星屑
585
在线时间
392 小时
注册时间
2012-1-20
帖子
223

开拓者

2
发表于 2013-3-17 09:49:07 | 只看该作者
其实只是战斗图重叠了?
支持一下下我的这个游戏吧~~
大雄与空间军团
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
195
在线时间
339 小时
注册时间
2012-7-16
帖子
148
3
 楼主| 发表于 2013-3-17 09:55:46 | 只看该作者
哆啦溯 发表于 2013-3-17 09:49

=。=不是啊 战斗图原来就是那样子- =  然后横版战斗的战斗图会加一个图标的战斗图..加入攻击的动画中..求去掉这个加入图标动画
【6月份回归者】
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
585
在线时间
392 小时
注册时间
2012-1-20
帖子
223

开拓者

4
发表于 2013-3-17 09:58:37 | 只看该作者
小夏坑面包 发表于 2013-3-17 09:55

额……脚本方面我不大懂,你可以重新去找一个横版脚本,或者在素材里找到这个图标,然后把这个图标设置成空白图片……
支持一下下我的这个游戏吧~~
大雄与空间军团
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
195
在线时间
339 小时
注册时间
2012-7-16
帖子
148
5
 楼主| 发表于 2013-3-17 10:19:32 | 只看该作者
哆啦溯 发表于 2013-3-17 09:58

=。=这个主意实在是太坑爹了...
【6月份回归者】
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
89 小时
注册时间
2009-3-7
帖子
144
6
发表于 2013-3-19 11:53:01 | 只看该作者
脚本用的是默认素材的,你的战斗图里本来人物就拿着武器的,而脚本又自动描绘出一个武器,所以就感觉BUG了,其实这脚本不太适合这素材使用,如果你要战斗时人物有动作,那么可以考虑其他的脚本。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2602
在线时间
1967 小时
注册时间
2012-4-25
帖子
141
7
发表于 2013-3-19 12:13:10 | 只看该作者
问题根源.rar (672.4 KB, 下载次数: 19)
加几个#的问题

评分

参与人数 1星屑 +66 收起 理由
hcm + 66 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
195
在线时间
339 小时
注册时间
2012-7-16
帖子
148
8
 楼主| 发表于 2013-3-19 12:19:12 | 只看该作者
乱糟糟 发表于 2013-3-19 12:13
加几个#的问题

哇塞- = 解决了..谢谢大哥..{:2_287:}  但是鄙人还想再问个问题..里面的内个..特技角色动画如何更改..
(=。= 斑竹,这不是一题多问-、...这真的不是一题多问哦- =)...无视这句话吧- =

点评

hcm
起码也给我用白字嘛。  发表于 2013-4-8 12:01
【6月份回归者】
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-27 23:48

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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