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

Project1

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

[有事请教] 求修改菜鳥橫版或者教學

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1279
在线时间
302 小时
注册时间
2023-6-6
帖子
22
跳转到指定楼层
1
发表于 2023-7-1 20:08:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 xuprmpau 于 2023-7-1 20:35 编辑

大家好,菜鳥橫版想將死亡後角色不是消失而是行走圖倒在地板上
我已經知道
把      # コラプス
      if flag and @battler.dead?
        if @battler.is_a?(Game_Actor)
          $game_system.se_play($data_system.actor_collapse_se)
        elsif @battler.is_a?(Game_Enemy)
          $game_system.se_play($data_system.enemy_collapse_se)
        end
        collapse
        @battler_visible = false
      end
這裡頭的collapse移動到elsif @battler.is_a?(Game_Enemy)裡面即可不讓角色死亡後消失
但他會變成行走圖呆站在那邊
想修改成倒下(可寫成行走圖第四列背對的圖案向右轉90度) 並且使用復活術或道具能讓行走圖恢復正常(正常行動攻擊之類的)

(另外也想實現戰鬥勝利時角色可以跳躍慶祝)
希望有大神能夠修改或者教學
感激不盡

以下腳本





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

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
2
发表于 2023-7-5 22:20:46 | 只看该作者
我猜測應該是通過循環,找到死亡的角色ID,再通過$game_player.character_name  = ""可以更改行走圖,對應修改行走圖。如果沒有死亡在替換會原來的戰鬥圖。具體的可以自己再想想。只能提供大概的方向,我自己也不是很厲害。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1279
在线时间
302 小时
注册时间
2023-6-6
帖子
22
3
 楼主| 发表于 2023-7-7 00:52:41 | 只看该作者
契约师Vi 发表于 2023-7-5 22:20
我猜測應該是通過循環,找到死亡的角色ID,再通過$game_player.character_name  = ""可以更改行走圖,對應 ...

感謝回覆
自己有試過在判斷死亡那裏用$game_player.character_name  = ""去改變,但圖案直接變成四行四列的行走圖,且復活的話也不會變回正常行走圖QQ
腳本看不太懂
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33208
在线时间
10495 小时
注册时间
2009-3-15
帖子
4756
4
发表于 2023-7-7 16:25:53 | 只看该作者
1887行走图显示相关
1905行死亡消失的脚本
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 15:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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