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

Project1

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

[已经解决] 行走图横版角色位置问题

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2934
在线时间
388 小时
注册时间
2010-12-4
帖子
141
跳转到指定楼层
1
发表于 2016-7-29 23:00:28 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x

这可能是个老问题了,但一直没找到相应的解决办法。问题是如图上角色是垂直的一条线,
请问怎么不通过前卫中卫后卫的调整,将角色的站位调成和敌人一样向外倾斜呢?

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

Lv1.梦旅人

梦石
0
星屑
50
在线时间
102 小时
注册时间
2016-5-9
帖子
58
2
发表于 2016-7-30 00:44:05 | 只看该作者
在你的脚本里找角色站位的XY距离进行调整。具体还得看你横版战斗的脚本是什么样的。不过原理相同。
回复 支持 1 反对 0

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2934
在线时间
388 小时
注册时间
2010-12-4
帖子
141
3
 楼主| 发表于 2016-7-30 17:19:57 | 只看该作者
脚本中的只有一个角色站位XY,只能调上下间隔,不能调左右间隔,横版战队脚步是1.02版的
回复 支持 0 反对 1

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
102 小时
注册时间
2016-5-9
帖子
58
4
发表于 2016-7-30 17:28:05 | 只看该作者
letppigogo 发表于 2016-7-30 17:19
脚本中的只有一个角色站位XY,只能调上下间隔,不能调左右间隔,横版战队脚步是1.02版的 ...

把脚本贴上来看看吧……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
125
在线时间
171 小时
注册时间
2014-4-14
帖子
151
5
发表于 2016-7-30 18:25:13 | 只看该作者
看吧,可以的。自己再调调。

捕获.PNG (504.48 KB, 下载次数: 4)

捕获.PNG

捕获2.PNG (46.67 KB, 下载次数: 4)

捕获2.PNG
Vanyogin
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2934
在线时间
388 小时
注册时间
2010-12-4
帖子
141
6
 楼主| 发表于 2016-7-30 23:48:25 | 只看该作者
本帖最后由 RyanBern 于 2016-7-31 10:03 编辑

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
125
在线时间
171 小时
注册时间
2014-4-14
帖子
151
7
发表于 2016-7-31 06:38:02 | 只看该作者
看图。看行数。自己可以再调调。

捕获.PNG (450.72 KB, 下载次数: 3)

捕获.PNG

捕获2.PNG (52.84 KB, 下载次数: 2)

捕获2.PNG

评分

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

查看全部评分

Vanyogin
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2934
在线时间
388 小时
注册时间
2010-12-4
帖子
141
8
 楼主| 发表于 2016-7-31 12:14:45 | 只看该作者
感谢2357691704的解答,这样设置后站位好了!但是又出现了新的问题,

如图

攻击时角色不再跳到目标跟前,而是走到正上方攻击。是不是还有地方要改?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2934
在线时间
388 小时
注册时间
2010-12-4
帖子
141
9
 楼主| 发表于 2016-7-31 12:33:20 | 只看该作者
根据2357691704解答,我自己进行了研究,现在问题已经迎刃而解了,感谢2357691704的帮助。


回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-22 06:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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