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

Project1

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

[已经解决] 技能发动之前加入一个主角特写图片

[复制链接]

Lv1.梦旅人

梦石
0
星屑
94
在线时间
157 小时
注册时间
2006-7-2
帖子
299
跳转到指定楼层
1
发表于 2014-8-9 11:39:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
想在最终绝技的时候加入一些特色
譬如放绝招之前先出来一个人物特写

尝试用公共事件,但是公共事件要在绝招结束以后才能出来
有办法让公共事件先启动吗?或者有其他更好的办法?

谢谢各位大神

点评

可以考虑在主角大招的【攻击方动画】中进行一个动画设置,也是一种思路。  发表于 2014-8-18 18:52
甘泉幻想物语 试玩版4.0
https://rpg.blue/forum.php?mod=viewthread&tid=369490&page=1&extra=#pid2534710

Lv5.捕梦者

梦石
0
星屑
32069
在线时间
5082 小时
注册时间
2012-11-19
帖子
4877

开拓者

2
发表于 2014-8-9 13:07:55 | 只看该作者
本帖最后由 芯☆淡茹水 于 2014-8-9 14:29 编辑

下面这个把技能的公共事件提前了,试一下
url 自己删一下
  1. class Scene_Battle
  2.   #--------------------------------------------------------------------------
  3.   # ● 刷新画面 (主回合步骤 2 : 开始行动)
  4.   #--------------------------------------------------------------------------
  5.   def update_phase4_step2
  6.     # 如果不是强制行动
  7.     unless @active_battler.current_action.forcing
  8.       # 限制为 [敌人为普通攻击] 或 [我方为普通攻击] 的情况下
  9.       if @active_battler.restriction == 2 or @active_battler.restriction == 3
  10.         # 设置行动为攻击
  11.         @active_battler.current_action.kind = 0
  12.         @active_battler.current_action.basic = 0
  13.       end
  14.       # 限制为 [不能行动] 的情况下
  15.       if @active_battler.restriction == 4
  16.         # 清除行动强制对像的战斗者
  17.         $game_temp.forcing_battler = nil
  18.         # 移至步骤 1
  19.         @phase4_step = 1
  20.         return
  21.       end
  22.       
  23.       #########################################################################
  24.       if @active_battler.current_action.kind == 1
  25.         # 设置公共事件 ID
  26.         skill = $data_skills[@active_battler.current_action.skill_id]
  27.         @common_event_id = skill.common_event_id
  28.         if @common_event_id > 0
  29.           common_event = $data_common_events[@common_event_id]
  30.           $game_system.battle_interpreter.setup(common_event.list, 0)
  31.           @common_event_id = 0
  32.         end
  33.       end
  34.       #########################################################################
  35.       
  36.       
  37.     end
  38.     # 清除对像战斗者
  39.     @target_battlers = []
  40.     # 行动种类分支
  41.     case @active_battler.current_action.kind
  42.     when 0  # 基本
  43.       make_basic_action_result
  44.     when 1  # 特技
  45.       make_skill_action_result
  46.     when 2  # 物品
  47.       make_item_action_result
  48.     end
  49.     # 移至步骤 3
  50.     if @phase4_step == 2
  51.       @phase4_step = 3
  52.     end
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● 生成特技行动结果
  56.   #--------------------------------------------------------------------------
  57.   def make_skill_action_result
  58.     # 获取特技
  59.     [url=home.php?mod=space&uid=260100]@skill[/url] = $data_skills[@active_battler.current_action.skill_id]
  60.     # 如果不是强制行动
  61.     unless @active_battler.current_action.forcing
  62.       # 因为 SP 耗尽而无法使用的情况下
  63.       unless @active_battler.skill_can_use?(@skill.id)
  64.         # 清除强制行动对像的战斗者
  65.         $game_temp.forcing_battler = nil
  66.         # 移至步骤 1
  67.         @phase4_step = 1
  68.         return
  69.       end
  70.     end
  71.     # 消耗 SP
  72.     @active_battler.sp -= @skill.sp_cost
  73.     # 刷新状态窗口
  74.     @status_window.refresh
  75.     # 在帮助窗口显示特技名
  76.     @help_window.set_text(@skill.name, 1)
  77.     # 设置动画 ID
  78.     @animation1_id = @skill.animation1_id
  79.     @animation2_id = @skill.animation2_id
  80.     # 设置对像侧战斗者
  81.     set_target_battlers(@skill.scope)
  82.     # 应用特技效果
  83.     for target in @target_battlers
  84.       target.skill_effect(@active_battler, @skill)
  85.     end
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   def update_phase4_step6
  89.     # 清除强制行动对像的战斗者
  90.     $game_temp.forcing_battler = nil
  91.     # 公共事件 ID 有效的情况下
  92.     if @common_event_id > 0 and @active_battler.current_action.kind == 2
  93.       # 设置事件
  94.       common_event = $data_common_events[@common_event_id]
  95.       $game_system.battle_interpreter.setup(common_event.list, 0)
  96.     end
  97.     # 移至步骤 1
  98.     @phase4_step = 1
  99.   end
  100. end
复制代码

点评

↓修改了一下,并已测试。  发表于 2014-8-9 14:30
不行诶,没有提前啊……  发表于 2014-8-9 13:45
没有设置,只是把公共事件提前到发动技能之前执行  发表于 2014-8-9 13:40
把脚本添加到main前面咩有效果诶。设id的地方是 if @active_battler.current_action.kind == 1 吗?  发表于 2014-8-9 13:21
xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
94
在线时间
157 小时
注册时间
2006-7-2
帖子
299
3
 楼主| 发表于 2014-8-9 16:57:01 | 只看该作者
芯☆淡茹水 发表于 2014-8-9 13:07
下面这个把技能的公共事件提前了,试一下
url 自己删一下


诶,还是不行诶,我有横版战斗的脚本会不会因为是有冲突?
不好意思三番五次麻烦你

甘泉幻想物语 试玩版4.0
https://rpg.blue/forum.php?mod=viewthread&tid=369490&page=1&extra=#pid2534710
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
32069
在线时间
5082 小时
注册时间
2012-11-19
帖子
4877

开拓者

4
发表于 2014-8-9 17:39:06 | 只看该作者
嘎~,把那个 菜鸟横版 贴上来,看能不能给你改下

点评

灰常感谢! 话说怎么像你一样地贴脚本?  发表于 2014-8-9 17:52
xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
32069
在线时间
5082 小时
注册时间
2012-11-19
帖子
4877

开拓者

5
发表于 2014-8-9 17:57:46 | 只看该作者
点击 红圈 那地方,把脚本复制进去,然后提交
xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
94
在线时间
157 小时
注册时间
2006-7-2
帖子
299
6
 楼主| 发表于 2014-8-9 18:01:40 | 只看该作者
本帖最后由 RyanBern 于 2014-8-30 18:58 编辑

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

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
32069
在线时间
5082 小时
注册时间
2012-11-19
帖子
4877

开拓者

7
发表于 2014-8-9 18:22:20 | 只看该作者
对的 啊

Project2.rar (203.68 KB, 下载次数: 33)

点评

确实我下载了工程是可以的……可能是其他脚本冲了要不,我自己再检查一下。不好意思啊  发表于 2014-8-9 18:38

评分

参与人数 1星屑 +200 收起 理由
RyanBern + 200 塞糖

查看全部评分

xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
805
在线时间
1 小时
注册时间
2014-8-18
帖子
4
8
发表于 2014-8-18 14:13:31 | 只看该作者
我是个新人不知道怎么弄脚本,不过我觉得可以直接在动画上弄吧,弄图片组然后放到动画里面因该可以吧

点评

原来可以这样啊!受教了。不过图片组工程很大吧。。  发表于 2014-8-19 14:34

评分

参与人数 1星屑 +100 收起 理由
RyanBern + 100 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-14 20:55

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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