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

Project1

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

[原创发布] SideView 木头汉化版【2014-1-23更新】

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
91 小时
注册时间
2012-3-3
帖子
65
跳转到指定楼层
1
发表于 2014-1-19 15:08:30 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 Mr丶木头 于 2014-1-23 22:21 编辑

话说花了三天时间来翻译这个脚本呢,开始本来时准备自用,后来翻译着翻译着眼看就快翻译完了- -|(木头君有很强烈的强迫症{:2_270:} )
所以干脆翻译完来方便大家创建自己的华丽丽的战斗系统吧!
模板来自@hcm 君的
【RMVA全动画脚本】Sideview横版战斗系统改编版(2013.1.17更新)

感谢@破晓记录线 发现的问题
2014年1月23日
已重新发布范例包,如已使用该脚本的玩家只需将脚本动画设定部分844行的“”改成“展示弓”即可。范例包还在character目录下加入了bow和arrow的动画图片。
新的范例包请自行提取RGSS300。
SideView mt汉化版.zip (898.92 KB, 下载次数: 272)

SideView动画设置部分
RUBY 代码复制
  1. =begin
  2. #==============================================================================
  3.  
  4. 译者注:这是使用了hcm君提供的全动态SideView脚本作为翻译的模板。
  5.         [url=http://rpg.blue/thread-236237-1-1.html]http://rpg.blue/thread-236237-1-1.html[/url]
  6.        
  7.        其实mt君不懂日文呢,用了林格斯翻译家后麻麻再也不用担心我的翻译了!
  8.        好多不懂的地方也是实践后用自己的话表达出来的。翻译错误肯定是有的,
  9.        但是大概意思不会错。
  10.  
  11.        那么关于所有SideView的动画设定都在此页了,使用前请详细阅读该脚本的设置页。
  12.        使用时请注意将该范例下Graphics文件夹下的图像素材拷贝到你的游戏中哦。
  13.        拷贝时可以不复制数据库内的113-116号动画,因为你需要开始自己设计动画了哦。
  14.  
  15.        已知BUG:  在选择单体技能后,选择目标敌人时技能已经开始吟唱了??
  16.  
  17.   ps.话说SideView的脚本自定义功能真的很强大呢
  18.  
  19.     2014年1月17日由mt君译。
  20. #==============================================================================
  21. =end
  22.  
  23. #==============================================================================
  24. # ■ SideView动画設定 v100
  25. #------------------------------------------------------------------------------
  26. #  横版战斗全部的动画设定
  27. #==============================================================================
  28. module N03
  29. #--------------------------------------------------------------------------
  30. # ● 全局设置
  31. #--------------------------------------------------------------------------
  32.  
  33.   #位置统一修正
  34.   XADJ = -40
  35.   YADJ = -20
  36.  
  37.   # 角色初期位置(H:角色的高度(位于空中))
  38.   ACTOR_POSITION=[
  39.   #   X轴       Y轴     H轴
  40.   [ 415+XADJ, 165+YADJ,  0],  #1号位置
  41.   [ 415+XADJ, 195+YADJ,  0],  #2号位置
  42.   [ 475+XADJ, 215+YADJ,  0],  #3号位置
  43.   [ 475+XADJ, 195+YADJ,  0]   #4号位置
  44.  
  45.   ]
  46.  
  47.   # 战斗中行动结束后、到下个角色行动开始之间的等待时间。
  48.   ACTION_END_WAIT = 8
  49.  
  50.   # 回合结束时的等待时间
  51.   TURN_END_WAIT = 12
  52.  
  53.   # 被偷袭时背对敌人。允许true 不允许false
  54.   BACK_ATTACK = true
  55.  
  56.   # 是否允许我方受伤时采用默认的效果。
  57.   ACTOR_DAMAGE = false
  58.  
  59.   # 是否允许地方受伤时采用默认的效果。
  60.   ENEMY_DAMAGE = false
  61.  
  62.   # 敌人图像,动作,动画是否翻转显示。
  63.   ENEMY_MIRROR = true
  64.  
  65.   # 不死的状态ID
  66.   IMMORTAL_ID = 10
  67.  
  68.   # 战斗日志开关 打开true
  69.   BATTLE_LOG = true
  70.  
  71.   # 以下技能不使用特效。
  72.   NO_DISPLAY_SKILL_ID = [1,2,3,4,5,6,7]
  73.  
  74.   # 伤害数字显示开关 打开true
  75.   DAMAGE_POP = true
  76.  
  77.   # 状态付加显示开关 打开true
  78.   STATE_POP = true
  79.  
  80.   # 伤害数字图像文件名(放在System下)
  81.   DAMAGE_PLUS = "damage_num+"
  82.   # 恢复数字图像文件名(放在System下)
  83.   DAMAGE_MINUS = "damage_num-"
  84.   # MP伤害数字图像文件名(放在System下)
  85.   DAMAGE_MP = "damage_mp"
  86.   # TP伤害数字图像文件名(放在System下)
  87.   DAMAGE_TP = "damage_tp"
  88.   # 伤害数字文字间距调整
  89.   DAMAGE_ADJUST = -4
  90.  
  91.   # 战斗前镜头位置调整   [X轴, Y轴]
  92.   CAMERA_POSITION = [  0,   -40]
  93.  
  94. #--------------------------------------------------------------------------
  95. # ● 战斗背景环境  背景放大倍率和坐标的调整
  96. #--------------------------------------------------------------------------
  97.   # 地面文件名…设定地面(Battlebacks1)图像文件名。
  98.   #             "全Battlebacks1"指定统一的Battlebacks1设定
  99.   # 背景文件名…设定背景(Battlebacks2)图像文件名。
  100.   #               "全Battlebacks2"指定统一的Battlebacks2设定
  101.   # 坐标调整…[X轴, Y轴]
  102.   # 放大率……[横放大率, 纵放大率]
  103.   # 允许晃动……如果允许晃动画面true 否则false
  104.   # 开关ー…战斗开始时自动打开该开关。如果设置为负数则使用SideView专用开关。
  105.   #       在特定的场合下ON可以管理一套战斗方案和背景。
  106.   #       如果不想这么做 0
  107.  
  108.    FLOOR1_DATA = {
  109. #――地面文件名―――           坐标調整      放大率   允许晃动   开关
  110.   "Sea_ex01"              => [ [   0, 0], [  75,  75], false,    0],
  111.   "全Battlebacks1"        => [ [   0, 0], [ 100, 100],  true,    0],
  112.  
  113.   }
  114.    FLOOR2_DATA = {
  115.   #――背景文件名―――          坐标調整        放大率   允许晃动  开关
  116.   "Ship_ex"               => [ [   0, 120], [ 150, 150],  true,    0],
  117.   "全Battlebacks2"        => [ [   0, 120], [ 150, 150],  true,    0],
  118.  
  119.  
  120. }  
  121.  
  122. #==============================================================================
  123. # ■ 动画
  124. #------------------------------------------------------------------------------
  125. #  这里设置战斗中基础动作。用来组合动画
  126. #==============================================================================
  127. # 这里是一个动画检索表
  128.   ACTION = {
  129.  
  130. #--------------------------------------------------------------------------
  131. # ● 动画设置
  132. #--------------------------------------------------------------------------
  133.   # 默认可以多个角色放置在一个图像文件中。
  134.   # 如果你想使用单个角色文件,请制作适合人物动作的图片放置其中。
  135.   # 一人用一个图像文件(在文件头部有个$号)情况下也没有问题
  136.  
  137.   # 文件名后缀…要使用的角色图像文件名后面加上后缀。
  138.   #              角色文件名+后缀作为图像完整的文件名
  139.   #              例)Actor1角色添加"_1"为Actor1_1
  140.   #              如果你只想使用一个角色文件请设置为空""
  141.   #              角色的图像文件放在Characters下,敌人的图像文件放在Battlers下
  142.   #
  143.   # 纵行…图像纵位置。一般是0-3代表第1~4行。不过没有数量上的限制
  144.   #       不要超过图像设定的行数
  145.   # 横行…图像横位置、动画开始的位置。左从0~3开始。
  146.   #       单元格的动画会从这个数字的位置到右边。
  147.   # 模式… 0:固定 1:单向 2:往復 3:单向循环 4:往復循环
  148.   # 速度…动画播放速度。数字越大越快
  149.   # Z轴…动画叠放次序。数字越大越靠前
  150.   # 循环…动画播放到最后会从头播放 允许true
  151.   # 影…是否允许显示一个图像阴影 如果允许true 否则false
  152.   # 武器…显示武器。如果不想留空""
  153.   #       武器动画允许叠加
  154.  
  155.   #―动作名(待机系)―     判别        后缀   纵行 横行 模式 速度   Z轴  循环   影   武器
  156.   "待机"            => ["motion",   "",      1,   0,   4,   12,   0, true, true, "待机武器" ],
  157.   "待机(固定)WT"    => ["motion",   "",      1,   0,   0,   12,   0, true, true, "" ],
  158.   "敌待机(固定)WT"  => ["motion",   "",      0,   0,   0,   12,   0, true, true, "" ],
  159.   "待机(固定)"      => ["motion",   "",      1,   2,   0,   12,   0,false, true, "" ],
  160.   "死亡"            => ["motion",   "_1",    1,   1,   0,   12,   0, true,false, "" ],
  161.   "魔法"            => ["motion",   "_1",    1,   0,   3,   12,   0, true,false, "" ],
  162.   "特技"            => ["motion",   "_1",    2,   0,   3,   12,   0, true,false, "" ],
  163.   "面向右边待机"    => ["motion",     "",    3,   0,   4,   12,   0, true, true, "待机武器M" ],
  164.   "胜利动作"        => ["motion",     "",    0,   0,   1,   6,    0, true, true, "" ],
  165.  
  166.   #―动作名(移动系)―    判别       后缀   纵行 横行 模式 速度  Z轴  循环   影    武器
  167.   "左移动画"        => ["motion",   "",    1,   0,   4,    6, 100, true, true, "待机武器" ],
  168.   "右移动画"        => ["motion",   "",    2,   0,   4,    6, 100, true, true, "待机武器M" ],
  169.  
  170.   #―动作名(攻击系)―    判别             纵行 横行 模式 速度  Z轴 循环   影    武器
  171.   "展示武器"        => ["motion",   "",    0,   0,   1,    2, 200,false, true, "纵摇摆"],
  172.   "展示盾牌"        => ["motion",   "",    0,   0,   1,    2, 200,false, true, "纵摇摆L"],
  173.   "展示盾牌和武器"  => ["motion",   "",    0,   0,   1,    2, 200,false, true, "纵摇摆","纵摇摆L"],
  174.   "盾防御"          => ["motion",   "",    1,   0,   1,    2, 200,false, true, "盾"],
  175.   "武器拳套"        => ["motion",   "",    1,   0,   1,    2, 200,false, true, "拳戳刺" ],
  176.   "用武器横戳"      => ["motion",   "",    1,   0,   1,    2, 200,false, true, "戳刺" ],
  177.   "举起武器"        => ["motion",   "",    1,   0,   1,    2, 200,false, true, "举起" ],
  178.   "展示弓"          => ["motion",   "",    1,   0,   1,    2, 200,false, true, "弓"],
  179.  
  180. #--------------------------------------------------------------------------
  181. # ● 角色移动  敌人将做反向的移动
  182. #--------------------------------------------------------------------------
  183.   # 目標…设置目标坐标的参照物。正数参照现在的位置,负数参照初期位置,如果你不想设置输入-7
  184.   #       [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标] [6=画面]
  185.   # X轴…对象的X坐标
  186.   # Y轴…对象的Y坐标
  187.   # H轴…对象的H坐标(距离地面的高度) nil为只有XY方向移动
  188.   # 速度…每帧移动的像素数。负数指定时间,得到帧的总数量。
  189.   # 曲线…移动时的曲线轨道、负数则弯曲向下。
  190.   # 跳跃…抛物线轨道。[从开始到顶点, 从顶点下落]
  191.   # 动画…移动时播放的动画名。
  192.  
  193.   #――动作名(系统系)―― 判别 目標  X轴  Y轴  H轴 速度  曲线  跳跃    动画
  194.   "战斗前我方配置"  => ["move",-7, 180,   0,   0,  0,   0, [  0,  0], "待机"],
  195.   "退场"            => ["move",-7, 180,   0,   0,  7,   0, [  0,  0], "右移动画"],
  196.   "逃跑途中"        => ["move",-7,  80,   0,   0,  7,   0, [  0,  0], "右移动画"],
  197.   "输入命令移动"    => ["move",-7, -20,   0, nil,-10,   0, [  0,  0], "待机"],
  198.   "受到伤害时后退"  => ["move", 0,  20,   0, nil,-10,   0, [  0,  0], ""],
  199.   "受到暴击时后退"  => ["move", 0,  60,   0, nil,-10,   0, [  0,  0], ""],
  200.  
  201.   #――动作名(复位系)――  判别 目標 X轴  Y轴  H轴 速度  曲线   跳跃    动画
  202.   "坐标复位早"       => ["move",-7,   0,   0,   0,-10,   0, [  0,  0], "右移动画"],
  203.   "坐标复位"         => ["move",-7,   0,   0,   0,-20,   0, [  0,  0], "右移动画"],
  204.   "坐标复位曲线"     => ["move",-7,   0,   0,   0,-20,  -2, [  0,  0], "右移动画"],
  205.   "坐标复位面向左"   => ["move",-7,   0,   0,   0,-20,   0, [  0,  0], "待机"],
  206.  
  207.   #――动作名(自身系)――   判别  目標 X轴  Y轴  H轴 速度  曲线   跳跃    动画
  208.   "前移一步"           => ["move", 0, -20,   0,   0,-10,   0, [  0,  0], "左移动画"],
  209.   "后退一步"           => ["move", 0,  20,   0,   0,-10,   0, [  0,  0], "左移动画"],
  210.   "前跳一步"           => ["move", 0, -30,   0,   0,-10,   0, [ 20,-20], "左移动画"],
  211.   "后跳一步"           => ["move", 0,  30,   0,   0,-10,   0, [ 20,-20], "左移动画"],
  212.   "胜利动作"           => ["move", 0,  10,   0,   0,-25,   0, [ 30,-30], "待机(固定)"],
  213.   "胜利跳跃武器"       => ["move", 0,   0,   0,   0,-15,   0, [ 20,  0], "举起武器"],
  214.   "胜利跳跃着地"       => ["move",-7,   0,   0,   0,-10,   0, [  0,  0], "展示武器"],
  215.   "飞起"               => ["move", 0,   0,   0,  20, -2,   0, [  0,  0], ""],
  216.   "降落"               => ["move", 0,   0,   0, -20, -2,   0, [  0,  0], ""],
  217.  
  218.   #――动作名(目標系)――   判别  目標  X轴  Y轴  H轴 速度  曲线   跳跃    动画
  219.   "移动到目标面前"      => ["move", 1,  30,   0,   0,-20,   0, [  0,  0], "左移动画"],
  220.   "移动到目标后方"      => ["move", 1, -60,   0,   0,-20,   0, [  0,  0], "左移动画"],
  221.   "移动到目标身上"      => ["move", 1,   0,   0,   0,-10,   0, [  0,  0], "左移动画"],
  222.   "跳到目标头上"        => ["move",-1,   0,   0, 100,-20,   0, [ 40,-20], "举起武器"],
  223. "移动到敌人身上并展示武器"=> ["move",-1,   0,   0,   0,-10,   0, [  0,  0], "展示武器"],
  224.  
  225. #--------------------------------------------------------------------------
  226. # ● 武器动画
  227. #--------------------------------------------------------------------------
  228.   # 类型…[0…使用图标Icons]
  229.   #       [1…独自图像(图像名使用默认的武器设定名。位于Characters文件夹下)]
  230.   #       [2…动画元素(仿RM2003。像角色行走图一样的动画图像。图像名使用默认的武器设定名。位于Characters文件夹下)]
  231.   # 移动…图像移动距离。[X轴, Y轴]
  232.   # 調整…微整武器坐标。[X轴, Y轴]
  233.   # 始度…动作前开始角度。顺指针0~360度。負逆时针
  234.   # 終度…动作后角度
  235.   # 原点…图像原点。[0…中心] [1…左上] [2…右上] [3…左下] [4…右下] [5…与角色相同]
  236.   # 翻转…设置为true水平翻转表示图像
  237.   # 放大…[X轴放大率, Y轴放大率] 允许使用浮点数。
  238.   # Z轴…图像是否显示在手的前方,如果是true
  239.   # 逆手…是否显示右手武器的图像(盾牌或者二刀流)
  240.   # 更新…-1与角色动画同时更新。如果你想独立更新 [更新时间间隔, 更新格子数, 是否循环]
  241.   #         
  242.   # 后缀…虽然你已经设定了武器(副武器)的图像。
  243.   #          如果你设置了后缀,那么新的文件名将加上后缀。
  244.   #          例) "纵摇摆"加后缀"" => 图像文件名"IconSet"
  245.   #          例) "纵摇摆2"加后缀"_1" => 图像文件名"IconSet_1"
  246.   #          如果你使用图标文件,在System下,独立动画在Characters下
  247.   #         
  248.   # 图像…如果你想直接指定武器名在这里输入,会忽略头部的图标设定。
  249.   #      图像放在Characters文件夹下。
  250.  
  251.   #―动作名―    判别  类型   移动      調整   始度 終度 原点  翻转   放大    Z轴   逆手   更新   后缀  图像
  252.   "纵摇摆"    => ["wp", 0,[  6, 0],[ -4,-10], -45,  45,  4, false, [1,1], false, false,   -1,   "",    ""],
  253.   "待机武器"  => ["wp", 0,[  6,-4],[ -4, -8],   10, 10,  4, false, [1,1], false, false,   -1,   "",    ""],
  254.   "待机武器M" => ["wp", 0,[  6,-4],[ -8,-12],   30, 30,  4,  true, [1,1],  true, false,   -1,   "",    ""],
  255.   "盾"        => ["wp", 0,[  0, 0],[ 12,  0],   0,   0,  4, false, [1,1],  true,  true,   -1,   "",    ""],
  256.   "纵摇摆L"   => ["wp", 0,[  6, 0],[  0, -8],-135,  45,  4, false, [1,1],  true,  true,   -1,   "",    ""],
  257.   "拳戳刺"    => ["wp", 0,[-20, 0],[  5,  5], -45, -45,  4, false, [1,1], false, false,   -1,   "",    ""],
  258.   "戳刺"      => ["wp", 0,[-25, 0],[ 25,-10],  45,  45,  4, false, [1,1], false, false,   -1,   "",    ""],
  259.   "举起"      => ["wp", 0,[  6,-4],[ -4,-10],  90, -45,  4, false, [1,1], false, false,   -1,   "",    ""],
  260.  
  261.   #―2003仕様―   判别  タイプ   移动      調整   始度 終度 原点 翻转   放大    Z轴   逆手   更新  インデックス  图像
  262.   "弓"        => ["wp", 0,[  1, 0],[  -1,  0],   50,   45,  5, false, [1,1],  true, false,   -1,   "",    ""],
  263.  
  264.   # 飞行类武器    判别 タイプ    移动     調整   始度 終度 原点   翻转   放大    Z轴   二刀     更新      インデックス   图像
  265.   "箭支"      => ["wp", 0,[  0, 0],[  0,  0],   0,  45,  0, false, [1,1],  true, false,[2,6,false],   "",    "arrow01"],
  266.   "旋转"      => ["wp", 0,[  0, 0],[  0,  0],   0, 360,  0, false, [1,1],  true, false,[1,8, true],   "",    ""],
  267.  
  268. #--------------------------------------------------------------------------
  269. # ● 武器飞行动画 让子弹飞
  270. #--------------------------------------------------------------------------
  271.   # ID…数据库的动画ID。0动画不表示。[移动过程动画ID, 命中的动画ID]
  272.   # 始…动画移动开始位置。如果你输入负数,则在多个目标上只播放一个动画。
  273.   #     [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标] [6=画面]
  274.   # 后…动画移动结束位置。如果你输入负数,则在多个目标上只播放一个动画。
  275.   #     [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标] [6=画面]
  276.   # 始調整…移动开始坐标调整。[X轴, Y轴] 敌人进行负向计算
  277.   # 后調整…移动结束坐标调整。[X轴, Y轴]
  278.   # 速度…在X轴上每帧移动的像素数。如果你设置负数,打击速度将根据距离改变 ???
  279.   # 类型…移动后处理方法。[0=消失] [1=贯穿] [2=消失??]
  280.   # 軌道…移动軌道。[从开始到顶点, 从顶点到结束]
  281.   # Z轴…是否允许武器覆盖角色
  282.   # 等待…动画结束是否等待动作true [移动过程动画等待, 命中时动画等待]
  283.   # 伤害…运动到目标时计算伤害
  284.   # 归位…运动完是否归位(回旋镖)
  285.   # 镜头…是否允许镜头缩放
  286.   # 循环…是否允许循环
  287.   # 翻转不可…在任何情况下动画不翻转设置为true
  288.   # 武器…武器动作名。利用否则""
  289.  
  290.   #――动作名――       判别     ID   始 后   始調整   后調整  速度 类型  軌道    Z轴       循环       伤害   归位    镜头   循环 翻转不可   武器
  291.   "箭支发射WT"     => ["m_a",[ 0,-1], 0, 1, [ 0, 0], [ 0, 0], 20,  0, [ 0, 0], true, [ true, true],  true,  true,  true, false, false,  "箭支"],
  292.   "箭支发射"       => ["m_a",[ 0,-1], 0, 1, [ 0, 0], [ 0, 0], 20,  0, [ 0, 0], true, [false,false],  true,  true,  true, false, false,  "箭支"],
  293.   "水鉄砲发射"     => ["m_a",[69,69], 0, 1, [ 0, 0], [ 0, 0], 10,  0, [ 0, 0], true, [ true, true],  true,  true,  true,  true, false,  ""],
  294.   "武器投掷开始"   => ["m_a",[ 0,-1], 0, 1, [ 4,-6], [ 0, 0], 10,  2, [-3,-3], true, [ true,false],  true,  true,  true, false, false,  "旋转"],
  295.   "武器投掷戻し"   => ["m_a",[ 0, 0], 1, 0, [ 0, 0], [ 4,-6], 10,  0, [ 3, 3], true, [ true,false], false,  true,  true, false, false,  "旋转"],
  296.  
  297. #--------------------------------------------------------------------------
  298. # ● 战斗动画
  299. #--------------------------------------------------------------------------
  300.   # ID…数据库动画ID。-1主武器动画  -2副武器动画
  301.   #                 -3技能设置的动画
  302.   # 对象…[0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标]
  303.  
  304.   #―动作名(伤害系)―      判别    ID 对象  归位    循环   伤害   镜头 翻转不可   翻转  Z轴
  305.   "对象动画武器"      => ["anime",  -1,  1, false, false,  true,  true, false,  false,  true],
  306.   "对象动画武器WT"    => ["anime",  -1,  1, false,  true,  true,  true, false,  false,  true],
  307.   "对象动画武器LWT"   => ["anime",  -2,  1, false,  true,  true,  true, false,  false,  true],
  308.   "对象动画"          => ["anime",  -3,  1, false, false,  true,  true, false,  false,  true],
  309.   "对象动画WT"        => ["anime",  -3,  1, false,  true,  true,  true, false,  false,  true],
  310.  
  311.   #――动作名(自身系)――
  312.   "魔法咏唱中"          => ["anime", 113,  0,  true,  true, false,  true, false,  false,  true],
  313.   "特技待机中"          => ["anime", 114,  0,  true,  true, false,  true, false,  false,  true],
  314.   "魔法发动动画"      => ["anime", 115,  0, false,  true, false,  true, false,  false, false],
  315.   "特技发动动画"      => ["anime", 116,  0, false,  true, false,  true, false,  false, false],
  316.  
  317. #--------------------------------------------------------------------------
  318. # ● 镜头动画
  319. #--------------------------------------------------------------------------
  320.   # 对象…移动和缩放的对象
  321.   #      [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标] [6=画面]
  322.   # 調整坐标…镜头坐标的调整 [X轴(正方向画面→), Y轴(正方向画面↓)]
  323.   # 时间…镜头动作的时间
  324.   # 放大…镜头的放大率(%)。100原大小。
  325.   # 等待…是否等待镜头移动完成。如果是true。
  326.  
  327.   #――动作名――    判别    对象  調整坐标   放大率 时间  等待
  328.   "镜头复位"  => ["camera",   6, [   0,   0], 100,  40, false],
  329.   "放大"      => ["camera",   6, [   0, 100], 120,  40, false],
  330.   "缩小"      => ["camera",   6, [   0,   0],  80,  40, false],
  331.  
  332. #--------------------------------------------------------------------------
  333. # ● 画面晃动  空中(H坐标大于0)的角色不会晃动
  334. #--------------------------------------------------------------------------
  335.   # 方向…晃动的方向 [横,纵] 数值越大幅度越大
  336.   # 速度…摇晃的速度。
  337.   # 时间…摇晃的时间。摆动幅度会随着时间推移而减小
  338.   # 等待…是否等待镜头移动完成。如果是true。
  339.  
  340.   #――动作名――    判别      方向   速度  时间   等待
  341.   "晃动小"     => ["shake", [  0, 4],  2,    16, false],
  342.   "晃动中"     => ["shake", [  0, 6],  3,    30, false],
  343.   "晃动大"     => ["shake", [  0,12],  3,    40, false],
  344.  
  345. #--------------------------------------------------------------------------
  346. # ● 画面色调改变 改变背景和角色的色调
  347. #--------------------------------------------------------------------------
  348.   # 对象…色调改变对象
  349.   #       [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标]
  350.   #       [6=背景] [7=自分+目标] [8=自分以外] [9=自分+目标以外] [10=所有]
  351.   # 色调…[ R, G, B, 强度, 时间, 返回]
  352.   #             返回…变更完成返回原来色调的时间。如果不则设置为0
  353.   # 等待…是否等待镜头移动完成。如果是true。
  354.  
  355.   # 改变名                        判别  对象     R,   G,   B, 强度  时间 返回  等待
  356.   "色调初始化"             => ["color",  10, [   0,   0,   0,   0,  30,   0], false],
  357.   "虚弱色调"               => ["color",   0, [ 255,  50,  50, 100,  40,  40], false],
  358.   "毒色调"                 => ["color",   0, [ 170,  50, 255, 170,  30,  30], false],
  359.   "泛用异常状态色调"       => ["color",    0, [ 255, 255,  50, 170,  40,  40], false],
  360.   "昏暗背景"               => ["color",   6, [   0,   0,   0, 255,  30,   0], false],
  361.   "自身和目标以外暗淡"     => ["color",   9, [   0,   0,   0, 255,  30,   0], false],
  362.  
  363. #--------------------------------------------------------------------------
  364. # ● 过渡 更变画面使用的过渡
  365. #--------------------------------------------------------------------------
  366.   # 执行"画面固定"操作运行之前请保持画面静止。
  367.   #
  368.   # 边界…边界的模糊值。越大越模糊。
  369.   # 时间…画面转变的时间。游戏画面在过渡时是静止的。
  370.   # 过渡文件名…。文件位于Pictures下。
  371.  
  372.   #―――动作名―――   判别  边界  时间  文件名
  373.   "圈圈过渡"         => ["ts",  40,   60,  "circle"],
  374.  
  375. #--------------------------------------------------------------------------
  376. # ● 幻影
  377. #--------------------------------------------------------------------------
  378.   # 数…幻影数。0用来关闭幻影。幻影越多程序负载越大
  379.   # 间隔…幻影间隔。单位帧。
  380.   # 处理…对幻影的处理。true为消失、false不消失
  381.   # 透明度…幻影透明度
  382.  
  383.   #――动作名――       判别     数  间隔  处理  透明度
  384.   "幻影ON"        => ["mirage",  4,   3,  true,  160],
  385.   "幻影OFF"       => ["mirage",  0,   0,  true,    0],
  386.  
  387. #--------------------------------------------------------------------------
  388. # ● 角色旋转 图像旋转
  389. #--------------------------------------------------------------------------
  390.   # 角色被旋转完成后角度会复位。
  391.   # 旋转中心是图像几何中心。武器动作不会播放。
  392.   #
  393.   # 时间…旋转时间。0会立即处理
  394.   # 始度…旋转开始时角度。0~360度。正逆时针,敌人计算相反
  395.   # 終度…旋转结束时角度。0~360度。
  396.   # 类型…旋转结束后处理。[0…旋转复位] [1…定在结束角度] [2…循环]
  397.  
  398.   #――动作名――     判别    时间   始    終   类型
  399.   "右1旋转"      => ["angle",  12,    0, -360,   0],
  400.   "左1旋转"      => ["angle",  12,    0,  360,   0],
  401.  
  402. #--------------------------------------------------------------------------
  403. # ● 角色放大縮小 图像放大縮小
  404. #--------------------------------------------------------------------------
  405.  
  406. # 角色被缩放完成后大小会复位。
  407.   # 武器动作不会播放。
  408.  
  409.   # 时间…放大縮小时间。
  410.   # 开始大小…放大縮小开始时的大小。允许小数点。[X轴(横), Y轴(纵)]
  411.   # 结束大小…放大縮小结束时的大小。[X轴(横), Y轴(纵)]
  412.   # 类型…放大縮小结束后处理。[0…还原大小] [1…保持大小] [2…循环]
  413.  
  414.   #――动作名――     判别   时间    开始大小     结束大小   类型
  415.   "横向缩放"      => ["zoom",  12,  [1.0, 1.0],  [0.5, 1.0],  0],
  416.   "纵向缩放"      => ["zoom",  12,  [1.0, 1.0],  [1.0, 0.5],  0],
  417.  
  418. #--------------------------------------------------------------------------
  419. # ● 角色透明度操作 图像透明度改变
  420. #--------------------------------------------------------------------------
  421.   # 时间…透明度改变时间。
  422.   # 开始…改变开始时不透明度。0透明、255不透明
  423.   # 结束…改变结束时透明度
  424.   # 影…是否存在影子
  425.   # 武器…武器是否同时透明
  426.   # 循环…透明度更变完成后是否允许反向操作。
  427.   # 等待…是否等待透明度操作完成。
  428.  
  429.   #――动作名――         判别      时间  开始  结束    影    武器   循环  等待
  430.   "逃跑透明"         => ["opacity",   30,  255,   0,  true,  true, false, false],
  431.   "透明化"           => ["opacity",   60,  255,   0,  true,  true, false, false],
  432.   "透明化WT"         => ["opacity",   60,  255,   0,  true,  true, false,  true],
  433.   "透明化解除"       => ["opacity",   60,    0, 255,  true,  true, false, false],
  434.   "透明化解除WT"     => ["opacity",   60,    0, 255,  true,  true, false,  true],
  435.  
  436. #--------------------------------------------------------------------------
  437. # ● 气泡动画  源于事件中的气泡动画
  438. #--------------------------------------------------------------------------
  439.   # 类型…气泡类型(纵位置)
  440.   # 速度…更新速度。元素将从第二针开始播放
  441.   # 大小…气泡大小
  442.  
  443.   # 气泡名             判别      类型 速度  サイズ
  444.   "异常状态/泛用"   => ["balloon",   6,  10,  1],
  445.   "异常状态/虚弱"   => ["balloon",   5,  10,  1],
  446.   "异常状态/睡眠"   => ["balloon",   9,  10,  1],
  447.  
  448. #--------------------------------------------------------------------------
  449. # ● 图片显示
  450. #--------------------------------------------------------------------------
  451.   # 番号…使用图片的编号。用于管理图片。可以显示任意数量的图片
  452.   #       所有动画结束然后自动擦除(Bitmap解放)
  453.   # 开始坐标…移动开始位置。图片的左上为原点。[X轴, Y轴]
  454.   #           如果图片已经出现,留空[]将设置为默认的地方。
  455.   # 结束坐标…移动结束位置。如果你只是显示图片,把它设定为和开始坐标一样。
  456.   #           使用平面时设置开始坐标和结束坐标为空[]
  457.   # 时间…移动时间。0用于擦除图片。
  458.   # Z轴…图片的Z坐标。100以上则显示在角色上方
  459.   # 透明度…透明度設定。[初始透明度, 每1帧增加的透明度]
  460.   # 平面使用…平面类(图像被放置的像瓷砖)使用的矩形。[X轴,Y轴]
  461.   #            如果不使用平面请留空[]
  462.   # BA反転…被偷袭时是否逆向显示图片。
  463.   #         使用平面时也一样。
  464.   # 图片文件名…存放在pictures内的文件名。
  465.  
  466.   #                      判别  番号  开始坐标      结束坐标   时间 Z轴   透明度    平面使用   BA翻转    文件名
  467.   "插入A1"          => ["pic",  0, [-300,   8], [ 100,   8],  30, 50, [  0, 10],        [],  true, "示例图片_01"],
  468.   "插入A2"          => ["pic",  0, [-300,   8], [ 100,   8],  30, 90, [  0, 10],        [],  true, "Actor4-2"],
  469.   "插入A3"          => ["pic",  0, [-300,   8], [ 100,   8],  30, 90, [  0, 10],        [],  true, "Actor5-2"],
  470.   "插入A4"          => ["pic",  0, [-300,   8], [ 100,   8],  30, 90, [  0, 10],        [],  true, "Actor5-3"],
  471.   "插入終"          => ["pic",  0,          [], [ 600,   8],  30, 90, [255,  0],        [],  true, ""],
  472.   "插入背景始"      => ["pic",  1, [   0,   8], [ 100,   8],  10, 80, [  0, 10], [544,288],  true, "cutin_back"],
  473.   "插入背景終"      => ["pic",  1,          [],          [],  10, 80, [255, -7], [544,288],  true, ""],
  474.   "白色淡入"        => ["pic",  0, [   0,   0], [   0,   0],  50,500, [  0,  6],        [], false, "white"],
  475.   "白色淡出"        => ["pic",  0, [   0,   0], [   0,   0],  50,500, [255, -6],        [], false, "white"],
  476.  
  477. #--------------------------------------------------------------------------
  478. # ● 状态操作
  479. #--------------------------------------------------------------------------
  480.   # 对象…[0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标]
  481.   # 括展…对上面设置的对象进行拓展 [0=不] [1=随机1体] [2=自身除外]
  482.   # 操作…状态附加"+" 解除"-"
  483.   # ID…操作状态ID
  484.  
  485.   # 状态付与名                判别  对象  拡張 操作   ID
  486.   "战斗不能付与"         => ["sta",   0,   0,  "+",   [1]],
  487.  
  488. #--------------------------------------------------------------------------
  489. # ● FPS(游戏整体的速率)改变
  490. #--------------------------------------------------------------------------
  491.   # 游戏速率…60为默认值 
  492.  
  493.   #――动作名――   判别   速率
  494.   "慢速"       => ["fps",  15],
  495.   "常速"       => ["fps",  60],
  496.  
  497. #--------------------------------------------------------------------------
  498. # ● 角色图像改变
  499. #--------------------------------------------------------------------------
  500.   # 维持…战斗结束后是否继续保持更变后的状态。(永久改变)
  501.   # 指数…设置变身后角色行走图的位置
  502.   #        [0][1][2][3]
  503.   #        [4][5][6][7]
  504.   #
  505.   # 文件名…行走图的文件名。位于Characters下
  506.   #         敌人位于Battlers下
  507.   # 脸部…如果要改变角色脸部头像 [头像位置,文件名]
  508.   #        如果不改变留空[]
  509.  
  510.   #―――动作名―――      判别     维持   指数       文件        脸部
  511.   "化妆成狼"         => ["change", false,    6,    "Animal", [0, "Actor4"]],
  512.  
  513. #--------------------------------------------------------------------------
  514. # ● 技能派生
  515. #--------------------------------------------------------------------------
  516.   # 习得…没有学习的技能是否允许被派生发动。
  517.   # 发动条件…派生的技能是否需要发动条件。
  518.   # 技能ID…派生的技能ID
  519.  
  520.   #―――动作名―――    判别   习得  条件 技能ID
  521.   "多段攻击に派生"   => ["der",  true,  false,   130],
  522.  
  523. #--------------------------------------------------------------------------
  524. # ● 音效系统  BGM・BGS・SE
  525. #--------------------------------------------------------------------------
  526.   # 类别…音效"se"  背景音乐"bgm"  背景音效"bgs"
  527.   # 速率…50~150。
  528.   # 音量…50~150。
  529.   # 文件名…""BGM、BGS留空""则不改变任何数据。
  530.  
  531.   #――动作名――       判别     类别  速率  音量  文件名
  532.   "Bow1"          => ["sound",  "se", 100,  80, "Bow1"],
  533.  
  534. #--------------------------------------------------------------------------
  535. # ● 电影播放  ogv文件
  536. #--------------------------------------------------------------------------
  537.   # 文件名…要播放的文件名。在Movies文件夹下
  538.  
  539.   #――动作名――           判别     文件名
  540.   "死亡标志播放" => ["movie", "sample1"],
  541.  
  542. #--------------------------------------------------------------------------
  543. # ● 开关操作
  544. #--------------------------------------------------------------------------
  545.   # 开关如果被设置为负数将会只在SideView中进行操作。
  546.   #
  547.   # ON编号…放置在数列中的开关ID将被统一打开。
  548.   # OFF编号
  549.   #
  550.   #――动作名――       判别     ON编号   OFF编号
  551.   "スイッチNo1/ON"  => ["switch",  [ 1],   []],
  552.   "进入太空背景改变"=> ["switch",  [-4],   []],
  553.   "太空背景解除"  => ["switch",    [],   [-4]],
  554.   "魔方陣ON"        => ["switch",  [-5],   []],
  555.   "魔方陣OFF"       => ["switch",    [],   [-5]],
  556.  
  557. #--------------------------------------------------------------------------
  558. # ● 变量操作
  559. #--------------------------------------------------------------------------
  560.   # 变量编号
  561.   # 操作…[0=代入] [1=加法] [2=减法] [3=乘法] [4=除法] [5=求余]
  562.   # 操作数…指定一个数字作为操作的目标。如果为负数,则该数字指向的变量为实际操作数。
  563.   #
  564.   # ――动作名――     判别      変数No  操作  操作数
  565.   "変数No1/+1"     => ["variable",   1,     1,     1],
  566.  
  567. #--------------------------------------------------------------------------
  568. # ● 条件分歧 (游戏开关) 设置条件、动画的分歧
  569. #--------------------------------------------------------------------------
  570.   # 开关编号…如果是负数则只操作SideView的开关。
  571.   # 操作…ON-true、OFF-false
  572.   # 分歧…满足条件时的处理。
  573.   #       [0=执行下列动作] [1=取消执行操作] [2=动作结束]
  574.   #
  575.   #―――动作名―――        判别  开关号  条件  分歧
  576.   "スイッチNo1=ONで実行" => ["n_1",   1,   true,   0],
  577.  
  578. #--------------------------------------------------------------------------
  579. # ● 条件分歧 (变量)
  580. #--------------------------------------------------------------------------
  581.   # ID…变量的ID
  582.   # 数值…需要对比的数字。如果是负数,将比较该数字变量存储的数字。
  583.   # 条件…对比条件…[0=等于] [1=小] [2=大]
  584.   # 分歧…当满足条件时。
  585.   #       [0=执行以下操作:] [1=取消以下操作:] [2=全部动作取消]
  586.   #
  587.   #―――动作名―――       判别  ID 数值  条件  分歧
  588.   "変数No1=1で実行"      => ["n_2",   1,    1,    0,    0],
  589.  
  590. #--------------------------------------------------------------------------
  591. # ● 条件分歧 (状态)
  592. #--------------------------------------------------------------------------
  593.   # 对象…要参照的对象 [0=自身] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  594.   # 状态ID…无论在任何状态下??
  595.   # 条件…[0=获得状态] [1=未获得此状态]
  596.   # 人数…在人数上需要满足的条件,0指全体
  597.   # 分歧…满足条件时执行的操作。
  598.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  599.   #
  600.   #―――动作名―――         判别   对象   ID   条件  人数  分歧
  601.   "死亡确认"             => ["n_3",   1,    1,    0,     1,   1],
  602.  
  603. #--------------------------------------------------------------------------
  604. # ● 条件分歧 (技能)
  605. #--------------------------------------------------------------------------
  606.   # 对象…要参照的对象 [0=自分] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  607.   # 技能ID
  608.   # 条件…[0=可用] [1=不可用]
  609.   # 人数…在人数上需要满足的条件,0指全体
  610.   # 分歧…满足条件时执行的操作。
  611.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  612.   #
  613.   #―――动作名―――       判别  对象 ID  条件  人数  分歧
  614.   "強撃使用可限定"       => ["n_4",  0,   80,    0,    1,   0],
  615.  
  616. #--------------------------------------------------------------------------
  617. # ● 条件分歧 (参数)
  618. #--------------------------------------------------------------------------
  619.   # 对象…要参照的对象 [0=自分] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  620.   # 种类…要比较参数的种类:
  621.   #       [1=Lv] [2=最大HP] [3=最大MP] [4=HP] [5=MP] [6=TP] [7=攻击力]
  622.   #       [8=防御力] [9=魔法力] [10=魔法防御] [11=敏捷性] [12=運]
  623.   #
  624.   # 数值…需要对比的条件。负数将使用最大值的百分比。(只限于HP MP TP)
  625.   # 条件…比较数字的条件…[0=相同] [1=小于] [2=大于]
  626.   # 人数…在人数上需要满足的条件,0指全体
  627.   # 分歧…满足条件时执行的操作。
  628.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  629.   #
  630.   #―――动作名―――       判别  对象  种类  数值  条件  人数  分歧
  631.   "HP50%以上で実行"      => ["n_5",  0,    4,  -50,    2,    1,   0],
  632.  
  633. #--------------------------------------------------------------------------
  634. # ● 条件分歧 (装备)
  635. #--------------------------------------------------------------------------
  636.   # 对象… [0=自分] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  637.   # 类型…装备种类。 [0=武器] [1=防具]
  638.   # 装备ID…上述类型物品的装备。要指定多个装备则放于数组中统一设置[]。
  639.   #         如果指定为负数,则指该装备类型。
  640.   # 条件…[0=已装备] [1=为装备]
  641.   # 人数…在人数上需要满足的条件,0指全体
  642.   # 分歧…满足条件时执行的操作。
  643.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  644.   #
  645.   #―――动作名―――       判别  对象  类型     ID   条件  人数  分歧
  646.   "手斧限定"             => ["n_6",  0,    0,    [1],    0,    1,   0],
  647.   "拳限定"               => ["n_6",  0,    0,   [-2],    0,    1,   0],
  648.   "拳除外"               => ["n_6",  0,    0,   [-2],    0,    1,   1],
  649.   "弓限定"               => ["n_6",  0,    0,   [-6],    0,    1,   0],
  650.   "弓除外"               => ["n_6",  0,    0,   [-6],    0,    1,   1],
  651.   "拳弓除外"             => ["n_6",  0,    0,[-2,-6],    0,    1,   1],
  652.  
  653. #--------------------------------------------------------------------------
  654. # ● 条件分歧 (脚本) 
  655. #--------------------------------------------------------------------------
  656.   # 分歧…满足条件时执行的操作。
  657.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  658.   # 脚本…返回类型为布尔值(true,false)
  659.   #
  660.   #―――动作名―――       判别   分歧  脚本
  661.   "50%的概率执行"    => ["n_7",   0,  "rand(100) < 50"],
  662.   "角色限定"         => ["n_7",   0,  "@battler.actor?"],
  663.   "角色ID1限定"      => ["n_7",   0,  "@battler.actor? && @battler.actor_id == 1"],
  664.   "角色ID2限定"      => ["n_7",   0,  "@battler.actor? && @battler.actor_id == 2"],
  665.   "角色ID6限定"      => ["n_7",   0,  "@battler.actor? && @battler.actor_id == 6"],
  666.   "角色ID7限定"      => ["n_7",   0,  "@battler.actor? && @battler.actor_id == 7"],
  667.   "敌人限定"         => ["n_7",   0,  "[email protected]?"],
  668.   "敌人中止"         => ["n_7",   2,  "[email protected]?"],
  669.   "二刀流限定"       => ["n_7",   0,  "@battler.dual_wield?"],
  670.  
  671. #--------------------------------------------------------------------------
  672. # ● 第二个目标操作
  673. #--------------------------------------------------------------------------
  674.   # 第二目标:独立于指定的普通目标以外的目标。
  675.   # 如果你不想做任何事情,通常把它定为相同的目标。
  676.   #
  677.   # 对象…[0=自分] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  678.   #
  679.   # INDEX…将限定目标方的引索值 INDEX = [指数, 判别]
  680.   #        指数…目标方的数值
  681.   #        判别…数值的条件 [0=不指定] [1=该指数为目标] [2=该指数以外]
  682.   #
  683.   # ID…目标角色(敌人)ID限定。0不限定
  684.   #     如果指定为负数,则该目标除外。
  685.   #
  686.   # 状态…限定为拥有该状态的目标。0不限定
  687.   #       如果设置为负数,限定为没有该状态的目标。
  688.   #
  689.   # 技能…限定为能使用该技能的目标。0不限定
  690.   #      如果设置为负数,则限定为不能使用该技能的目标。
  691.   #
  692.   # 参数…限定参数的目标 参数 = [种类, 数值, 判别]
  693.   #         种类…[0=不限定] [1=Lv] [2=最大HP] [3=最大MP] [4=HP] [5=MP] [6=TP]
  694.   #               [7=攻击力] [8=防御力] [9=魔法力] [10=魔法防御] [11=敏捷性] [12=运气]
  695.   #         数值…比较的参数数值。负数将指定为百分比(HP・MP・TP限定)
  696.   #         判别…数值的条件 [0=相同] [1=小于] [2=大于]
  697.   #
  698.   # 装备…限定装备与否的目标。 装备 = [类型, ID]
  699.   #       类型…[0=武器] [1=防具]
  700.   #       ID…可以将装备ID放入数组中[]。0不限定
  701.   #           如果指定为负数,则指装备类型。
  702.   #
  703.   # 拓展…拓展上述目标以外的目标 [0=不] [1=随机1体]  [2=除了自己]
  704.   # 操作…[0=不操作] [1=将第二目标更变为主目标]  [2=初始化第二目标]
  705.  
  706.   #――动作名――        判别 对象  INDEX  ID 状态技能  参数     装备   拓展 操作
  707.   "我方全员(除自身)" => ["s_t", 3, [ 0, 0], 0,  0,   0, [ 0, 0, 0], [ 0,[0]],  2,   0],
  708.   "全体"            => ["s_t", 4, [ 0, 0], 0, -1,   0, [ 0, 0, 0], [ 0,[0]],  0,   1],
  709.  
  710. #--------------------------------------------------------------------------
  711. # ● 调用公共事件
  712. #--------------------------------------------------------------------------
  713.   # ID…公共事件ID
  714.   # 等待…是否等待公共事件运行完成
  715.   #
  716.   #―――动作名―――        判别    ID   等待
  717.   "1号公共事件"       => ["common",  1,  true],
  718.  
  719. #--------------------------------------------------------------------------
  720. # ● 脚本操作
  721. #--------------------------------------------------------------------------
  722.   # 运行该脚本。
  723.   #
  724.   #―――动作名―――  
  725.   "测试脚本"            => ["p = 1 "],
  726.  
  727. #--------------------------------------------------------------------------
  728. # ● 其他 不允许设置的项目
  729. #--------------------------------------------------------------------------
  730.   # 伤害动画…遵循之前的Pop伤害设置。
  731.   # 翻转…图像的水平翻转。再次翻转则还原。
  732.   # 武器消去…强制不显示武器图像。
  733.   # 武器消去解除…解除强制不显示武器图像。
  734.   # 敌消失…运行消失的效果。用它来显示敌人的战斗不能
  735.   # 消失禁止…目标的HP减为0时不允许消失。一般用在连击技能发动前。
  736.   # 消失禁止解除…解除消失禁止。连击技能发动结束时请调用它。
  737.   # 待机取消…不执行待机动画。如战斗中发生事件。
  738.   # 待机取消解除…解除待机取消。
  739.   # 初期位置改变…将现在的坐标变为初期位置
  740.   # 初期位置改变解除…初期位置改变原坐标
  741.   # 强制…强制目标进行下一个动作
  742.   # 强制2…强制目标进行下两个动作
  743.   # 下一个行动者…当前角色行动立即结束,切换到下个行动者
  744.   # 个人开始…多目标行为时个人的动作,他是开始标志。
  745.   # 个人结束…个人动作结束标志
  746.   # 循环开始…"循环开始"到"循环结束"之间的动画反复执行
  747.   # 循环结束…
  748.  
  749.   #―――动作名―――       判别
  750.   "伤害动画"          => ["damage_anime"],
  751.   "翻转"              => ["mirror"],
  752.   "武器消去"          => ["weapon_off"],
  753.   "武器消去解除"      => ["weapon_on"],
  754.   "敌消失"            => ["normal_collapse"],
  755.   "禁止消失"          => ["no_collapse"],
  756.   "允许消失"          => ["collapse"],
  757.   "待机取消"          => ["non_motion"],
  758.   "待机取消解除"      => ["non_motion_cancel"],
  759.   "初期位置改变"      => ["change_base_position"],
  760.   "初期位置改变解除"  => ["set_base_position"],
  761.   "强制"              => ["force_action"],
  762.   "强制2"             => ["force_action2"],
  763.   "下一个行动者"      => ["next_battler"],
  764.   "个人开始"          => ["individual_start"],
  765.   "个人结束"          => ["individual_end"],
  766.   "循环开始"          => ["loop_start"],
  767.   "循环结束"          => ["loop_end"],
  768.  
  769. #--------------------------------------------------------------------------
  770. # ● 等待时间
  771. #--------------------------------------------------------------------------
  772.   # (例) "20" …等待20帧
  773.   #
  774.   # (例) "-20" …在0~20间随机等待
  775.  
  776. #--------------------------------------------------------------------------
  777. # ● 快捷命令
  778. #--------------------------------------------------------------------------
  779.   # 这些快捷命令可以让你减少工作强度
  780.   # 所以对于经常使用的操作可以在这里设置。
  781.   #
  782.   # [战斗动画]
  783.   # (例) "anime(20)" …播放数据库20号动画(有等待)
  784.   # (例) "anime(20,false)" …播放数据库20号动画(无等待)
  785.   # (例) "anime_me(20)" …对自身播放数据库20号动画(有等待)
  786.   # (例) "anime_me(20,false)" …对自身播放数据库20号动画(有等待)
  787.   #
  788.   # [等待 延迟指数] 
  789.   # (例) "delay(12)"…指数1号等待0帧 2号等待12帧  3号等待24帧…
  790.   #
  791.   # [效果音(SE)]
  792.   # (例) "se('Bow1')" …播放'Bow1'SE文件
  793.   # (例) "se('Bow1',50)" …播放'Bow1'SE文件并且音量为50
  794.   #
  795.   # [强制执行动画(全部动作)]
  796.   # (例) "target('受到伤害时后退')" …目标强制执行"受到伤害时后退"
  797.   # (例) "target2('受伤')" …第二目标强制执行"受伤"
  798.  
  799.   }  
  800. #==============================================================================
  801. # ■ 动画表
  802. #==============================================================================
  803.   FULLACTION = {
  804.  
  805.   # ―――待机系―――
  806.   "通常待机"        => ["待机武器","待机"],
  807.   "通常待机固定"    => ["待机(固定)WT"],
  808.   "虚弱待机"        => ["异常状态/虚弱","虚弱色调","待机","待机"],
  809.   "防御待机"        => ["待机(固定)WT"],
  810.   "毒待机"          => ["异常状态/泛用","毒色调","待机","待机","敌人限定","80"],
  811.   "睡眠待机"        => ["异常状态/睡眠","敌人限定","40","敌人中止","死亡","死亡"],
  812.   "泛用异常状态待机" => ["异常状态/泛用","泛用异常状态色调","待机","待机","敌人限定","80"],
  813.   "等待"            => ["待机","60"],
  814.   "战斗不能"        => ["死亡"],
  815.  
  816.   # ――システム系――
  817.   "战斗开始我方"    => ["战斗前我方配置","delay(4)","坐标复位面向左"],
  818.   "我方退场"        => ["退场"],
  819.   "逃跑"            => ["镜头复位","delay(4)","退场"],
  820.   "敌逃跑"          => ["对象动画","逃跑透明","退场"],
  821.   "逃跑失败"        => ["镜头复位","delay(4)","逃跑途中","后退一步","坐标复位面向左"],
  822.   "输入命令"        => ["输入命令移动"],
  823.   "输入命令后"      => ["坐标复位早"],
  824.   "命令后防御"      => ["坐标复位早","循环开始","待机(固定)WT","循环结束"],
  825.   "命令后魔法"      => ["坐标复位早","待机(固定)","循环开始","魔法咏唱中","循环结束"],
  826.   "命令后特技"      => ["坐标复位早","待机(固定)","循环开始","特技待机中","循环结束"],
  827.   "防御"            => ["对象动画","待机(固定)WT"],
  828.   "回避"            => ["角色限定","右1旋转","后跳一步","10","坐标复位面向左"],
  829.   "盾躲避"          => ["se('Evasion2')","盾防御","60"],
  830.   "保护开始"        => ["移动到目标身上","初期位置改变"],
  831.   "保护结束"        => ["初期位置改变解除","坐标复位面向左"],
  832.   "被保护开始"      => ["后退一步","后退一步","待机(固定)WT"],
  833.   "被保护结束"      => ["坐标复位面向左"],
  834.   "胜利姿势摇摆"    => ["胜利动作","120"],#"胜利跳跃武器","胜利跳跃着地","120"],
  835.   "后空翻姿势"      => ["右1旋转","胜利动作","拳限定","武器拳套","拳除外","展示武器","120"],
  836.  
  837.   # ―リ动画系―
  838.   "受伤"            => ["受到伤害时后退","坐标复位面向左"],
  839.   "被暴击"          => ["受到暴击时后退","坐标复位面向左"],
  840.   "纵揺れ"          => ["飞起","降落","飞起","降落","飞起","降落"],
  841.  
  842.   # ―快捷动作系―
  843.   "斬り"            => ["展示武器","对象动画武器","10"],
  844.   "拳"              => ["武器拳套","对象动画武器","10"],
  845.   "弓"              => ["Bow1","弓","箭支发射","9"],
  846.   "攻击"            => ["拳限定","拳","弓限定","弓","拳弓除外","斬り"],
  847.   "准备开始攻击"    => ["移动到目标面前","禁止消失","个人开始","二刀流限定","二刀左"],
  848.   "攻击结束返回"    => ["死亡确认","对象动画武器WT","个人结束","允许消失","下一个行动者","坐标复位"],
  849.   "二刀左"          => ["展示盾牌","对象动画武器LWT"],
  850.   "特技发动"        => ["前移一步","举起武器","特技发动动画"],
  851.   "魔法发动"        => ["前移一步","举起武器","魔法发动动画"],
  852.   "插入"            => ["插入背景始","插入分歧","70","插入終","插入背景終","20"],
  853.   "插入分歧"        => ["角色ID1限定","插入A1","角色ID2限定","插入A2","角色ID6限定","插入A3","角色ID7限定","插入A4"],
  854.   "死亡标志动画"    => ["白色淡入","50","死亡标志播放","白色淡出","50"],
  855.   "进入太空背景"    => ["昏暗背景","se('Blind',70)","30","进入太空背景改变","色调初始化"],
  856.   "太空背景解除"    => ["昏暗背景","50","太空背景解除","色调初始化"],
  857.   "魔方陣表示"      => ["se('Blind',70)","画面固定","魔方陣ON","サークル"],
  858.   "魔方陣消去"      => ["40","画面固定","魔方陣OFF","サークル"],
  859.  
  860.   # ――通常攻击系――
  861.   "通常攻击"        => ["准备开始攻击","待机(固定)","攻击结束返回"],
  862.   "斩击攻击"        => ["准备开始攻击","展示武器","攻击结束返回"],
  863.   "拳攻击"          => ["准备开始攻击","武器拳套","攻击结束返回"],
  864.   "横戳攻击"        => ["准备开始攻击","用武器横戳","攻击结束返回"],
  865.   "弓攻击"          => ["前移一步","禁止消失","个人开始","Bow1","弓",
  866.                         "箭支发射WT","个人结束","允许消失","坐标复位"],
  867.  
  868.   # ――技能系―――
  869.   "泛用技能"        => ["特技发动","展示武器","伤害动画","坐标复位"],
  870.   "泛用魔法"        => ["魔法发动","展示武器","伤害动画","坐标复位"],
  871.  
  872.   "水鉄砲"          => ["特技发动","展示武器","水鉄砲发射","坐标复位"],
  873.   "武器投掷"        => ["特技发动","Bow1","展示武器","6","待机(固定)","武器投掷开始","武器投掷戻し","坐标复位"],
  874.   "插入攻击"        => ["特技发动","插入","准备开始攻击","展示武器","攻击结束返回"],
  875.   "播放攻击"        => ["特技发动","待机(固定)","死亡标志动画","准备开始攻击","展示武器","攻击结束返回"],
  876.   "变身狼"          => ["特技发动","化妆成狼","待机(固定)","40","坐标复位"],
  877.   "5回攻击"         => ["特技发动","禁止消失","弓除外","移动到目标面前","攻击","攻击","攻击","攻击","攻击","允许消失","坐标复位"],
  878.   "技能派生"        => ["武器投掷","多段攻击に派生"],
  879.   "背景改变攻击"    => ["魔法发动","展示武器","缩小","进入太空背景","伤害动画","镜头复位","太空背景解除","坐标复位"],
  880.   "ピクチャ攻撃"    => ["魔法发动","魔方陣表示","举起武器","anime(80,false)","60","摇晃大","对象动画","魔方陣消去","坐标复位"],
  881.   "暗転攻击"        => ["特技发动","自身和目标以外暗淡","se('Laser',150)",
  882.                         "幻影ON","移动到目标面前","anime(35,false)","移动到目标后方","对象动画",
  883.                         "展示武器","20","色调初始化","坐标复位","幻影OFF"],
  884.   "空中攻击"        => ["特技发动","Bow1","前跳一步","跳到目标头上",
  885.                         "待机(固定)","左1旋转","10","anime(117,false)","移动到敌人身上并展示武器",
  886.                         "对象动画","晃动中","强制","纵揺れ","20",
  887.                         "后跳一步","坐标复位"],
  888.  
  889.   # ――物品系―――
  890.   "物品使用"     => ["移动到目标面前","待机(固定)","对象动画WT","坐标复位面向左"],
  891.  
  892.   "测试动作"     => ["插入A1"#"200","200","200","200","200","200","200","200","200","300"
  893.  
  894.  
  895.  
  896.  
  897.   ],
  898.  
  899.   }
  900.  
  901. #==============================================================================
  902. # ■ 战斗计划
  903. #------------------------------------------------------------------------------
  904. #  战斗场景的控制管理
  905. #  游戏控制开关・SideView专用开关
  906. #==============================================================================
  907.   BATTLE_PROGRAM = {
  908.  
  909. #--------------------------------------------------------------------------
  910. # ● 开关控制
  911. #--------------------------------------------------------------------------
  912.   # 开关…程序控制开关。如果是负数将制定SideView专用的开关。
  913.   #       如果是off,被执行的程序将强制终止。
  914.   #       SideView专用开关将在战斗结束时被重置(全OFF)。
  915.   #       如果你想控制事件战斗前SideView专用开关操作,在事件脚本中加入
  916.   #       $sv_camera.switches[1] = true
  917.   #       (打开1号开关)
  918.   #
  919.   # ON编号…批量打开开关操作。如果是负数将制定SideView专用的开关。
  920.   #        统一操作的开关数组。
  921.   #         例…[1,2,-5] 将游戏开关1,2号和SideView专用开关5号打开。
  922.   #
  923.   # OFF编号…批量关闭开关操作。如果是负数将制定SideView专用的开关。
  924.   #          如果你不想则留空[]。
  925.   #
  926.   # 时间…对开关操作进行的延时动作(单位帧)
  927.   #       例如设置为100,将从程序开始时的100帧后进行开关操作。
  928.   #       [参考值] 30秒…1800 1分…3600 5分…18000 10分…36000 1小时…216000
  929.   #
  930.   # 随机修正…最终时间将由上述时间值至加上该修正的时间值。单位帧。
  931.   #          例如时间设置为300修正设置为300,开关最终时间将在300-600中随机打开。
  932.  
  933.   #――程序名――          判别    开关   ON番号  OFF番号  时间  修正值
  934.   "背景要塞"         => ["switch",  -1,   [-2],      [],  1200,     0],
  935.   "背景大海"         => ["switch",  -2,   [-3],      [],  2400,     0],
  936.  
  937. #--------------------------------------------------------------------------
  938. # ● SE/BGM/BGS播放  
  939. #--------------------------------------------------------------------------
  940.   # 开关…控制开关。如果是负数将制定SideView专用的开关。
  941.   #
  942.   # 种类…音效"se"  背景音乐"bgm"  背景音效"bgs"
  943.   #
  944.   # 音调…50~150
  945.   # 音量…50~150
  946.   # 文件名…如果留空则不改变当前的音效。
  947.  
  948.   #―程序名――          判别   开关   种类   音调 音量 文件名
  949.   "潮汐"           => ["sound",  -1, "bgs",  100,  80, "Sea"],
  950.  
  951. #--------------------------------------------------------------------------
  952. # ● 背景控制  对背景自动控制
  953. #--------------------------------------------------------------------------
  954.   # 开关…控制开关
  955.   #
  956.   # 种类…对操作的背景种类选择。1地面、2远景图
  957.   #
  958.   # 滚动速度…背景的卷动速度。[X轴, Y轴]
  959.   #            单位为每100帧移动的像素数。
  960.   #            高速移动时,1000是一个标准值。
  961.   #
  962.   # BA翻转…被偷袭时是否反向滚动背景。
  963.   #
  964.   # 图像…需要更变背景图的情况下输入。如果不改变留空""
  965.   #       地面位于Battlebacks1下,背景(远景)位于Battlebacks2下
  966.   #       如果设置了,将会永久改变。
  967.   #
  968.   # 填充图像…背景滚动时,为了时背景更自然化所使用的填充图像。
  969.   #
  970.   # 中断…当背景运行时突然显示其他背景时的处理方法。
  971.   #       允许被打断设置为true
  972.   #       不允许被打断设置为false(其他背景挂起当前背景完成后显示被挂起的背景)
  973.  
  974.   #――程序名――         判别   开关 种类     速度     BA翻转      图像       填充图像    中断
  975.   "远景右移动"      => ["scroll", -1,  1, [  40,    0],  true,  "",                 "",  true],
  976.   "海背景3改变"     => ["scroll", -2,  1, [ 120,    0],  true,  "Sea_ex03", "Sea_ex02",  true],
  977.   "海背景4改变"     => ["scroll", -3,  1, [  40,    0],  true,  "Sea_ex01", "Sea_ex04",  true],
  978.   "宇宙改变1"       => ["scroll", -4,  1, [   0,    0],  true,  "DarkSpace",        "", false],
  979.   "宇宙改变2"       => ["scroll", -4,  2, [   0,    0],  true,  "DarkSpace",        "", false],
  980.  
  981. #--------------------------------------------------------------------------
  982. # ● 周期图片 周期性出现的图片。比如大风或者魔法阵
  983. #--------------------------------------------------------------------------
  984.   # 开关…周期图片控制开关
  985.   # No.…对图片操作的编号。
  986.   # 移动速度…每100帧移动的像素数。[X轴, Y轴] 如果设置为零则与背景同时滚动
  987.   # 间隔…图片出现周期间隔。单位1帧。0表示无限制循环
  988.   #
  989.   # 透明操作…图像的透明度操作。[初始透明度, 每100帧增加的透明度]
  990.   #           如果回到起始透明度255,会重复。
  991.   # Z轴…图像的Z坐标。100以上会被现实到窗口前面。
  992.   # 允许晃动…如果允许晃动则设置为true
  993.   # BA翻转…被偷袭时是否反向播放图片。
  994.   # 文件名…位于Pictures文件夹下。
  995.  
  996.   #――程序名――       判别   开关 No.    速度     间隔   透明操作   Z轴 允许晃动 BA翻转   文件名
  997.   "大风"           => ["kpic", -1,  0,[ 500,   0],   0, [ 255,   0], 90, false,  true, "back_wind"],
  998.  
  999. #--------------------------------------------------------------------------
  1000. # ● 周期SE 周期响起se音效。如雷鸣。
  1001. #--------------------------------------------------------------------------
  1002.   # 开关…控制音效的开关。
  1003.   # 周期…音效出现的周期。单位帧。
  1004.   # 随机修正…周期会增加该随机值作为修正值。
  1005.   #
  1006.   # 音调。50~150。
  1007.   # 音量…50~150。
  1008.   # 开始执行…如果设置为true则打开开关时立即播放音效。
  1009.   # 文件名…
  1010.  
  1011.   #――程序名――       判别    开关 周期  修正  音调 音量 开始执行  文件名
  1012.   "海鸥"         => ["keep_se", -1,  400,  100, 150, 60,  false,  "Crow"],
  1013.   "海鸥2"        => ["keep_se", -1,  300,  200, 140, 45,   true,  "Crow"],
  1014.  
  1015. #--------------------------------------------------------------------------
  1016. # ● 周期晃动 如地震、船上场合。
  1017. #--------------------------------------------------------------------------
  1018.   # 开关…对晃动进行控制的开关。设置为ON则开始晃动。
  1019.   # 周期…晃动的周期。单位帧。
  1020.   # 随机修正…周期会增加该随机值作为修正值。
  1021.   #
  1022.   # 方向…晃动的方向 [横,纵] 数字越大幅度越大。
  1023.   # 速度…摇晃的速度。越小越快。
  1024.   # 时间…摇晃持续时间。摇晃的幅度会随着时间推移而减轻。
  1025.   # 开始执行…如果打开则立即执行不需要等待周期。
  1026.  
  1027.   #―程序名――        判别   开关  周期  修正  方向   速度  时间 开始执行
  1028.   "船摇摆"      => ["keep_sk", -1,  130,   0,[  0, 4], 80,  120,  true],
  1029.  
  1030. #--------------------------------------------------------------------------
  1031. # ● 周期色调改变 
  1032. #--------------------------------------------------------------------------
  1033.   # 开关…控制色调改变的开关。
  1034.   # 周期…单位帧。
  1035.   # 随机修正…周期会增加该随机值作为修正值。
  1036.   #
  1037.   # 对象…色调改变对象 [0=背景] [1=敌全] [2=我方全] [3=敌我方全] [4=全部]
  1038.   # 色调…[ R, G, B, 强度, 改变时间, 回归]
  1039.   #             回归…改变完成后回归原色调需要的时间。设置为0则不回归。
  1040.   # 开始执行…如果打开则立即执行不需要等待周期。
  1041.  
  1042.   #――程序名――     判别   开关 周期  修正  对象  R,  G, B, 强度 时间 回归  开始执行
  1043.   "雷光"       => ["keep_c",  0,  300,  100,  4,[255,255,255,255,  8,   8],  true],
  1044.   "紧急"       => ["keep_c",  0,  150,    0,  4,[255,  0,  0,100, 40,  40],  true],
  1045.  
  1046. }
  1047. #==============================================================================
  1048. # ■ 镜头设置
  1049. #------------------------------------------------------------------------------
  1050. #  在这里设置镜头改变的时机以及参数。
  1051. #  请不要改变名称。
  1052. #==============================================================================
  1053.   BATTLE_CAMERA = {
  1054. #--------------------------------------------------------------------------
  1055. # ● 镜头  画面的缩放或者移动。
  1056. #--------------------------------------------------------------------------
  1057.   # 对象…操作的对象 [2=敌全] [3=我方全] [4=敌我方全] [6=画面]
  1058.   # 調整坐标…镜头最终坐标的微调 [X轴(正方向→), Y轴(正方向↓)]
  1059.   # 时间…镜头调整的用时。
  1060.   # 放大率…100为原大小。
  1061.  
  1062.   #――动作名――       判别    对象 調整坐标 放大率 时间
  1063.   "回合开始前"   => ["camera",   3, [ 0,   0], 100, 40],
  1064.   "回合开始后"   => ["camera",   6, [ 0,   0], 100, 40],
  1065.   "战斗结束时"   => ["camera",   3, [ 0,   0], 100, 50],
  1066.  
  1067. }  
  1068. end


SideView图像设定部分
RUBY 代码复制
  1. #==============================================================================
  2. # ■ SideView图像設定
  3. #------------------------------------------------------------------------------
  4. #  角色动画贴图的设定。
  5. #  图像的详细设定请参阅每个实例。
  6. #==============================================================================
  7. class SideView
  8.   #--------------------------------------------------------------------------
  9.   # ● 动画图像横纵格子数 = [ 横, 縦] 动画默认的情况下为[1, 1]
  10.   #--------------------------------------------------------------------------
  11.   def max_pattern
  12.     # 对每个角色的分别设定
  13.     case id
  14.     when  1 # 1号角色
  15.       return [ 3, 4]
  16.     when -1 # 1号敌人(敌人的ID要指定为负数)
  17.       return [ 1, 1]
  18.     else # 没有指定ID的情况下
  19.       return [ 3, 4] if id > 0 # 全角色(ID为正)
  20.       return [ 1, 1] if id < 0 # 全敌人(ID负数)
  21.     end
  22.     # 要分行设置ID请参阅此例
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 阴影文件名  图像在Characters下 false为无阴影
  26.   #--------------------------------------------------------------------------
  27.   def shadow
  28.     return "shadow01" if id > 0 # 全角色
  29.     return false      if id < 0 # 全敌人
  30.   end
  31.   #--------------------------------------------------------------------------
  32.   # ● 角色图像翻转設定 默认状态下为翻转true
  33.   #--------------------------------------------------------------------------
  34.   def graphic_mirror_flag
  35.     return false if id > 0 # 全角色
  36.     return true  if id < 0 # 全敌人
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 角色画像参照先固定 バトラーアニメ設定のインデックス参照を必ず""にするならtrue
  40.   #--------------------------------------------------------------------------
  41.   def graphic_fix
  42.     return false if id > 0 # 全アクター
  43.     return true  if id < 0 # 全エネミー
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 通常待机
  47.   #--------------------------------------------------------------------------
  48.   def normal
  49.     return "通常待机"   if id > 0 # 全角色
  50.     return "敌待机(固定)WT" if id < 0 # 全敌人
  51.     # 你可以为每个角色设置不同的待机动画
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 虚弱待机  HP在1/4以下的待机动画
  55.   #--------------------------------------------------------------------------
  56.   def pinch
  57.     return "虚弱待机" if id > 0 # 全角色
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 状态动画  如果多个状态重叠,则优先显示高优先度的状态
  61.   #--------------------------------------------------------------------------
  62.   def state(state_id)
  63.     # 状态ID分岐
  64.     case state_id
  65.     when 1
  66.       return "战斗不能"     if id > 0 # 全角色"战斗不能"
  67.       return "敌消失"       if id < 0 # 全敌人
  68.     when 2
  69.       return "毒待机"
  70.     when 6
  71.       return "睡眠待机"
  72.     when 3,4,5,7,8
  73.       return "泛用异常状态待机"
  74.     when 9
  75.       return "防御待机"
  76.     end
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 命令动画
  80.   #--------------------------------------------------------------------------
  81.   def command
  82.     # 选择技能ID分岐
  83.     case skill_id
  84.     when 2
  85.       return "命令后防御"
  86.     end
  87.     # 技能类型分歧
  88.     case skill_type
  89.     when 1 # 特技
  90.       return "命令后特技"
  91.     when 2 # 魔法
  92.       return "命令后魔法"
  93.     when 5 # 开枪
  94.       return "命令后开枪"
  95.     when 6 # 聚能
  96.       return "命令后聚能"
  97.     end
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● 战斗开始动画
  101.   #--------------------------------------------------------------------------
  102.   def first_action
  103.     return "战斗开始我方" if id > 0 # 全角色
  104.     return "敌待机(固定)WT"   if id < 0 # 全敌人
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 胜利动画
  108.   #--------------------------------------------------------------------------
  109.   def win
  110.     case id
  111.     when  2,7,10 # 2・7・10号角色
  112.       return "后空翻姿势"
  113.     else
  114.       return "胜利姿势摇摆"
  115.     end
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ● 战斗退场动画  完成战斗时的退场动画
  119.   #--------------------------------------------------------------------------
  120.   def remove_action
  121.     return "我方退场"
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 逃跑动画
  125.   #--------------------------------------------------------------------------
  126.   def escape
  127.     return "逃跑"   if id > 0 # 全角色
  128.     return "敌逃跑" if id < 0 # 全敌人
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ● 逃跑失败动画
  132.   #--------------------------------------------------------------------------
  133.   def escape_ng
  134.     return "逃跑失败"
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 输入命令前的等待动作
  138.   #--------------------------------------------------------------------------
  139.   def command_b
  140.     return "输入命令"
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● 输入命令后的等待动作
  144.   #--------------------------------------------------------------------------
  145.   def command_a
  146.     return "输入命令后"
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● 受伤动画 
  150.   #--------------------------------------------------------------------------
  151.   def damage(attacker)
  152.     # 被暴击的情况
  153.     if critical?
  154.       return "被暴击"
  155.     # 治疗的情况下
  156.     elsif recovery?
  157.       # 不想设定动画则只需要return
  158.       return
  159.     end
  160.     # 受到X号技能显示的动画
  161.     case damage_skill_id
  162.     when 1 # 技能1号的情况下
  163.       return "受伤"
  164.     when 136 # 不想设定动画则只需要return
  165.       return
  166.     end
  167.     # 受到物品ID分歧
  168.     case damage_item_id
  169.     when 1 # 物品1号的情况下
  170.       return
  171.     else
  172.       # 以上物品ID以外
  173.       if damage_item_id != 0
  174.         return
  175.       end  
  176.     end
  177.     # 伤害为零的情况 (如敌人逃跑、法术被免疫)
  178.     if damage_zero?
  179.       return
  180.     end
  181.     # 上述情况外
  182.     return "受伤"
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● 回避动作
  186.   #--------------------------------------------------------------------------
  187.   def evasion(attacker)
  188.     return "盾躲避" if shield? # 如果装备了盾牌
  189.     return "回避"
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ● 攻击失手时的动作
  193.   #--------------------------------------------------------------------------
  194.   def miss(attacker)
  195.     #return "盾防御" if shield?
  196.     return "回避"
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● 武器动画  装备武器后的普通攻击
  200.   #             也可以设定敌人装备武器。
  201.   #--------------------------------------------------------------------------
  202.   def weapon_action
  203.     # 武器ID指定
  204.     case weapon_id
  205.     when 0 # 武器0号的情况下(徒手)
  206.       return "通常攻击"
  207.     when 1 # 武器1号的情况下
  208.       return "斩击攻击"
  209.     end
  210.     # 武器类型指定
  211.     case weapon_type
  212.     when 1 # 武器类型1号的情况下
  213.       return "斩击攻击"
  214.     when 4,5,7,8,9 # 同时指定多个武器
  215.       return "斩击攻击"
  216.     when 2
  217.       return "拳攻击"
  218.     when 3
  219.       return "横戳攻击"
  220.     when 6
  221.       return "弓攻击"
  222.     end
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ● 敌人主武器 指定ID的敌人装备武器
  226.   #--------------------------------------------------------------------------
  227.   def enemy_weapon1_id
  228.     case id
  229.     when -1 # 1号敌人(敌人的ID为负数)
  230.       return 0 # 武器ID分歧。0则指空手
  231.     else
  232.       return 0
  233.     end
  234.   end
  235.   #--------------------------------------------------------------------------
  236.   # ● 敌人副武器 指定ID的敌人装备副武器
  237.   #--------------------------------------------------------------------------
  238.   def enemy_weapon2_id
  239.     case id
  240.     when -1 # 1号敌人(敌人的ID为负数)
  241.       return 0 # 武器ID分歧。0则指空手
  242.     else
  243.       return 0
  244.     end
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 敌人盾 指定ID的敌人装备盾牌,它的优先度高于副武器
  248.   #--------------------------------------------------------------------------
  249.   def enemy_shield_id
  250.     case id
  251.     when -1 # 1号敌人(敌人的ID为负数)
  252.       return 0 # 防具ID分歧。0则无防具
  253.     else
  254.       return 0
  255.     end
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ● 武器图像指定 
  259.   #--------------------------------------------------------------------------
  260.   # 武器动画类型[1:独自图像] [2:2003仕様]
  261.   # 参考之前的武器动画设定。
  262.   # return "001-Weapon01" ←请把这个文件放在同一个Characters文件夹中
  263.   def weapon_graphic(weapon_id, weapon_type)
  264.     # 武器ID分歧
  265.     case weapon_id
  266.     when 1 # 武器1号图像文件名
  267.       return ""
  268.     end
  269.     # 武器类型分歧
  270.     case weapon_type
  271.     when 6 # 武器类型6号图像文件名
  272.       return "bow01"
  273.     end
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● 盾图像指定 
  277.   #--------------------------------------------------------------------------
  278.   # 动画类型 [1:独自图像] [2:2003仕様]
  279.   # 副武器参照之前的副武器动画设定。
  280.   #
  281.   # return "001-Shield01" ←请把这个文件放在同一个Characters文件夹中
  282.   def shield_graphic(weapon_id, shield_type)
  283.     # 防具ID分歧
  284.     case shield_id
  285.     when 41 # 41号防具图像文件名
  286.       return ""
  287.     end
  288.     # 防具类型分歧
  289.     case shield_type
  290.     when 5 # 5号防具类型图像文件名
  291.       return ""
  292.     end
  293.   end
  294.  
  295.   #--------------------------------------------------------------------------
  296.   # ● 技能动画
  297.   #--------------------------------------------------------------------------
  298.   def skill_action
  299.     case skill_id # 技能ID分歧
  300.     when 1 # 普通攻击
  301.       return weapon_action
  302.     when 2
  303.       return "防御"
  304.     when 3,4,5 # 对多个敌人发动攻击
  305.       return weapon_action
  306.     when 6 # 逃跑
  307.       return escape
  308.     when 7
  309.       return "等待"
  310. #--------
  311.     when 150
  312.       return "测试动作"
  313.     when 128
  314.       return "水鉄砲"
  315.     when 129
  316.       return "武器投掷"
  317.     when 130
  318.       return "5回攻击"
  319.     when 131
  320.       return "カットイン攻击"
  321.     when 132
  322.       return "播放攻击"
  323.     when 133
  324.       return "オオカミ変身"
  325.     when 134
  326.       return "技能派生"
  327.     when 36#135
  328.       return "暗転攻击"
  329.     when 37#136
  330.       return "空中攻击"
  331.     end
  332.  
  333.     # 指定技能名称分歧
  334.     # 建议使用此类型指定技能,因为这在数据库中被移动可以不用重新修改。
  335.     case skill_name
  336.     when "背景変更サンプル"
  337.       return "背景変更攻撃"
  338.     when "ピクチャ攻撃サンプル"
  339.       return "ピクチャ攻撃"
  340.     end
  341.  
  342.     case skill_type # 技能类型分歧
  343.     when 1 # 特技
  344.       return "泛用技能"
  345.     when 2 # 魔法
  346.       return "泛用魔法"
  347.     when 3 # 特技
  348.       return "汎用开枪"
  349.     when 4 # 魔法
  350.       return "汎用聚能"
  351.     end
  352.     return "泛用技能"
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ● 物品动画
  356.   #--------------------------------------------------------------------------
  357.   def item_action
  358.     case item_id # 物品ID分歧
  359.     when 1
  360.       return "物品使用"
  361.     else
  362.       return "物品使用"
  363.     end
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ● 反击技能ID 反击的技能ID分歧
  367.   #--------------------------------------------------------------------------
  368.   # ※数据库で設定された技能や武器、图像の複数回攻击は反映されません
  369.   def counter_skill_id
  370.     return 1
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● 魔法反射动画ID 魔法反射时的技能动画
  374.   #--------------------------------------------------------------------------
  375.   def reflection_anime_id
  376.     return 118
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # ● 保护开始动画
  380.   #--------------------------------------------------------------------------
  381.   def substitute_start_action
  382.     return "保护开始"
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   # ● 保护结束动画
  386.   #--------------------------------------------------------------------------
  387.   def substitute_end_action
  388.     return "保护结束"
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # ● 被保护目标动画开始
  392.   #--------------------------------------------------------------------------
  393.   def substitute_receiver_start_action
  394.     return "被保护开始"
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ● 被保护目标动画结束
  398.   #--------------------------------------------------------------------------
  399.   def substitute_receiver_end_action
  400.     return "被保护结束"
  401.   end
  402.   #--------------------------------------------------------------------------
  403.   # ● 敌人级别  利用条件分歧应用。
  404.   #--------------------------------------------------------------------------
  405.   def level
  406.     case id
  407.     when -1 # 1号敌人
  408.       return 0
  409.     end
  410.     return 0
  411.   end
  412.  
  413. end



Sideview核心脚本部分
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Sideview Ver100
  3. #------------------------------------------------------------------------------
  4. #  サイドビューバトラーを管理するクラスです。
  5. #==============================================================================
  6. class SideView
  7.   #--------------------------------------------------------------------------
  8.   # ● 公開インスタンス変数 
  9.   #--------------------------------------------------------------------------
  10.   attr_accessor   :x                    # 画面X座標
  11.   attr_accessor   :y                    # 画面Y座標
  12.   attr_accessor   :z                    # 画面Z座標
  13.   attr_accessor   :h                    # 高さ座標
  14.   attr_accessor   :j                    # ジャンプ座標
  15.   attr_accessor   :c                    # カーブ座標
  16.   attr_accessor   :ox                   # 横原点
  17.   attr_accessor   :oy                   # 縦原点
  18.   attr_accessor   :oy_adjust            # 縦原点補正
  19.   attr_accessor   :angle                # 回転角度
  20.   attr_accessor   :zoom_x               # 横の拡大率
  21.   attr_accessor   :zoom_y               # 縦の拡大率
  22.   attr_accessor   :pattern_w            # セル横位置(矩形内)
  23.   attr_accessor   :pattern_h            # セル縦位置(矩形内)
  24.   attr_accessor   :sx                   # セル横位置(画像全体)
  25.   attr_accessor   :sy                   # セル縦位置(画像全体)
  26.   attr_accessor   :pattern_type         # セル更新タイプ
  27.   attr_accessor   :pattern_time         # セル更新間隔
  28.   attr_accessor   :graphic_name         # バトラー画像ファイル名
  29.   attr_accessor   :graphic_file_index   # バトラー画像ファイル名インデックス
  30.   attr_accessor   :graphic_index        # バトラー画像インデックス
  31.   attr_accessor   :cw                   # セル横矩形
  32.   attr_accessor   :ch                   # セル縦矩形
  33.   attr_accessor   :shadow_visible       # 影表示
  34.   attr_accessor   :weapon_visible       # 武器表示
  35.  
  36.   attr_accessor   :wait                 # 次の動作待ち時間
  37.   attr_accessor   :weapon_index         # 表示中の武器画像インデックス配列
  38.   attr_accessor   :weapon_end           # 武器アニメ終了フラグ
  39.   attr_accessor   :force_action         # 強制アクション
  40.   attr_accessor   :target_battler       # ターゲットバトラー情報
  41.   attr_accessor   :second_targets       # セカンドターゲット情報
  42.   attr_accessor   :m_a_targets          # アニメ飛ばしターゲット情報
  43.   attr_accessor   :individual_targets   # 個別処理ターゲットバトラー情報
  44.   attr_accessor   :effect_data          # エフェクトデータ
  45.   attr_accessor   :anime_id             # アニメID配列
  46.   attr_accessor   :anime_move_id        # 飛ばしアニメID配列
  47.   attr_accessor   :mirror               # 反転フラグ
  48.   attr_accessor   :opacity              # 透明度
  49.   attr_accessor   :opacity_data         # 透明度操作情報
  50.   attr_accessor   :set_damage           # バトルシーンでのダメージ処理
  51.   attr_accessor   :m_a_data             # アニメ飛ばし情報
  52.   attr_accessor   :m_a_starter          # アニメ飛ばし開始ターゲット情報
  53.   attr_accessor   :action_end           # バトルシーンでの行動終了
  54.   attr_accessor   :damage_anime_data    # ダメージ戦闘アニメのデータ
  55.   attr_accessor   :anime_no_mirror      # 戦闘アニメの反転禁止フラグ
  56.   attr_accessor   :anime_horming        # 戦闘アニメのホーミングフラグ
  57.   attr_accessor   :anime_camera_zoom    # 戦闘アニメがカメラに合わせて拡大縮小するか
  58.   attr_accessor   :anime_plus_z         # 戦闘アニメZ座標補正
  59.   attr_accessor   :derivation_skill_id  # スキル派生ID
  60.   attr_accessor   :immortal             # 不死身フラグ
  61.   attr_accessor   :mirage               # 残像データ
  62.   attr_accessor   :balloon_data         # ふきだしデータ
  63.   attr_accessor   :timing               # 別バトラーからのタイミングデータ
  64.   attr_accessor   :timing_targets       # タイミングデータを渡す別バトラー
  65.   attr_accessor   :color_set            # 色調変更データ
  66.   attr_accessor   :color                # 色調データ
  67.   attr_accessor   :change_up            # 画像変更フラグ
  68.   attr_accessor   :hit                  # 被攻撃回数
  69.   attr_accessor   :add_state            # 何度も付加ステートの表示を防ぐフラグ
  70.   attr_accessor   :counter_id           # カウンター時のスキルID
  71.   attr_accessor   :reflection_id        # 魔法反射時のアニメID
  72.   attr_accessor   :result_damage        # ターン終了時のHP変動データ
  73.   attr_accessor   :active               # 行動権
  74.   attr_accessor   :anime_off            # 戦闘アニメ消去
  75.   attr_accessor   :command_action       # コマンドアクションフラグ
  76.  
  77.   attr_accessor   :base_x               # 初期位置 X座標
  78.   attr_accessor   :base_y               # 初期位置 Y座標
  79.   attr_accessor   :base_h               # 初期位置 高さ座標
  80.   attr_accessor   :max_pattern_w        # セルの横分割数
  81.   attr_accessor   :max_pattern_h        # セルの縦分割数
  82.  
  83.   attr_reader     :collapse             # コラプスフラグ
  84.   attr_reader     :picture              # ピクチャ表示フラグ
  85.   #--------------------------------------------------------------------------
  86.   # ● オブジェクト初期化
  87.   #--------------------------------------------------------------------------
  88.   def initialize(battler)
  89.     [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  90.     reset
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ● 初期化
  94.   #--------------------------------------------------------------------------
  95.   def reset
  96.     @x = 0
  97.     @y = 0
  98.     @z = 0
  99.     @h = 0
  100.     @j = 0
  101.     @c = 0
  102.     [url=home.php?mod=space&uid=271873]@jump[/url] = []
  103.     @curve = []
  104.     @ox = 0
  105.     @oy = 0
  106.     @oy_adjust = 0
  107.     @z_plus = 0
  108.     @move_time = 0
  109.     [url=home.php?mod=space&uid=124954]@Angle[/url] = 0
  110.     @angle_time = 0
  111.     @zoom_x = 1
  112.     @zoom_y = 1
  113.     @zoom_time = 0
  114.     @pattern_w = 0
  115.     @pattern_h = 0
  116.     @sx = 0
  117.     @sy = 0
  118.     @pattern_type = 0
  119.     @pattern_time = 0
  120.     @pattern_rest_time = 0
  121.     @graphic_name = ""
  122.     @graphic_file_index = ""
  123.     @graphic_index = 0
  124.     @cw = 0
  125.     @ch = 0
  126.     @shadow_visible = false
  127.     @weapon_visible = true
  128.  
  129.     [url=home.php?mod=space&uid=36110]@Wait[/url] = 0
  130.     @weapon_index = []
  131.     @weapon_end = true
  132.     @full_action = []
  133.     @action = []
  134.     @force_action = ""
  135.     @target_battler = []
  136.     @second_targets = []
  137.     @individual_targets = []
  138.     @m_a_targets = []
  139.     @effect_data = []
  140.     @anime_id = []
  141.     @anime_move_id = []
  142.     [url=home.php?mod=space&uid=316553]@opacity[/url] = 255
  143.     @opacity_data = []
  144.     @set_damage = false
  145.     @m_a_data = []
  146.     @m_a_starter = []
  147.     @action_end = false
  148.     @damage_anime_data = []
  149.     @anime_no_mirror = false
  150.     @anime_horming = false
  151.     @anime_camera_zoom = false
  152.     @anime_plus_z = true
  153.     @derivation_skill_id = 0
  154.     @immortal = false
  155.     @mirage = []
  156.     @play_data = []
  157.     @balloon_data = []
  158.     @picture = false
  159.     @timing = []
  160.     @timing_targets = []
  161.     @color_set = []
  162.     [url=home.php?mod=space&uid=10453]@color[/url] = []
  163.     @change_up = false
  164.     @non_motion = false
  165.     @graphics_change = false
  166.     @hit = []
  167.     @add_state = []
  168.     @collapse = false
  169.     @counter_id = 0
  170.     @reflection_id = 0
  171.     @result_damage = [0,0]
  172.     @active = false
  173.     @anime_off = false
  174.     @command_action = false
  175.  
  176.     @base_x = 0
  177.     @base_y = 0
  178.     @base_z = 0
  179.     @base_h = 0
  180.     @max_pattern_w = 0
  181.     @max_pattern_h = 0
  182.     @pattern_kind = 0
  183.     @pattern_count = 0
  184.     @move_time = 0
  185.     [url=home.php?mod=space&uid=111303]@mirror[/url] = false
  186.     @battler.set_graphic(@pre_change_data[0], @pre_change_data[1], @pre_change_data[2], @pre_change_data[3]) if @pre_change_data != nil
  187.     @pre_change_data = nil
  188.   end  
  189.   #--------------------------------------------------------------------------
  190.   # ● セットアップ
  191.   #--------------------------------------------------------------------------
  192.   def setup(bitmap_width, bitmap_height, first_action_flag)
  193.     reset if first_action_flag
  194.     set_data
  195.     set_base_position if !@graphics_change
  196.     set_graphics(bitmap_width, bitmap_height)
  197.     set_target
  198.     setup_graphics_change if @graphics_change
  199.     first_battler_anime_set if first_action_flag
  200.   end  
  201.   #--------------------------------------------------------------------------
  202.   # ● バトラーデータ取得
  203.   #--------------------------------------------------------------------------
  204.   def set_data
  205.     return if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
  206.     if @battler.actor?
  207.       @graphic_name = @battler.character_name
  208.       @graphic_index = @battler.character_index
  209.     else
  210.       @graphic_name = @battler.battler_name
  211.       @graphic_index = 0
  212.     end
  213.     @max_pattern_w = max_pattern[0]
  214.     @max_pattern_h = max_pattern[1]
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ● ベース座標をセット data = [X軸, Y軸, H軸]  moment_set…瞬間配置
  218.   #--------------------------------------------------------------------------
  219.   def set_base_position(moment_set = true)
  220.     mirroring_reset
  221.     if @battler.actor?
  222.       data = N03::ACTOR_POSITION[@battler.index].dup
  223.       @base_x = data[0] * 100 if !@mirror
  224.       @base_x = (Graphics.width - data[0]) * 100 if @mirror
  225.     else
  226.       data = [@battler.screen_x, @battler.screen_y, 0].dup
  227.       @base_x = data[0] * 100 if !$sv_camera.mirror
  228.       @base_x = (Graphics.width - data[0]) * 100 if $sv_camera.mirror
  229.     end
  230.     @base_y = data[1] * 100
  231.     @base_h = data[2] * 100
  232.     @base_z = @y
  233.     return if !moment_set
  234.     @x = @base_x
  235.     @y = @base_y
  236.     @z = @base_z
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ● グラフィックデータ取得
  240.   #--------------------------------------------------------------------------
  241.   def set_graphics(bitmap_width, bitmap_height)
  242.     sign = @graphic_name[/^[\!\$]./]
  243.     if sign && sign.include?('$')
  244.       @cw = bitmap_width / @max_pattern_w
  245.       @ch = bitmap_height / @max_pattern_h
  246.     elsif @max_pattern_w == 1 && @max_pattern_h == 1
  247.       @cw = bitmap_width
  248.       @ch = bitmap_height
  249.     else
  250.       @cw = bitmap_width / (@max_pattern_w * 4)
  251.       @ch = bitmap_height / (@max_pattern_h * 2)
  252.     end
  253.     @ox = @cw / 2
  254.     @oy = @ch
  255.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  256.     @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● ターゲットをセット
  260.   #--------------------------------------------------------------------------
  261.   def set_target(target = nil)
  262.     @target_battler = target
  263.     @target_battler = [@battler] if target == nil
  264.     @second_targets = @target_battler
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ● 画像変更用のセットアップ
  268.   #--------------------------------------------------------------------------
  269.   def setup_graphics_change
  270.     @graphics_change = false
  271.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  272.     @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  273.   end  
  274.   #--------------------------------------------------------------------------
  275.   # ● 戦闘開始時の待機アニメ画像データ取得
  276.   #--------------------------------------------------------------------------
  277.   def first_battler_anime_set
  278.     loop do
  279.       update
  280.       break if @action_data == nil
  281.       break if @action_data[0] == "motion"
  282.       break if @action_data[0] == "move" && @action_data[8] != ""
  283.       break if @full_action == []
  284.     end
  285.     start_action(first_action) if @battler.movable?
  286.   end
  287.   #--------------------------------------------------------------------------
  288.   # ● アクション開始
  289.   #--------------------------------------------------------------------------
  290.   def start_action(kind = nil)
  291.     return if @event_fix && $game_troop.interpreter.running?
  292.     # ウェイト中の場合キャンセル
  293.     return @wait -= 1 if @wait > 0 && kind == nil
  294.     action_setup(false) if kind != nil
  295.     set_action(kind)
  296.     @action = kind if @action == nil
  297.     # 行動配列が無い場合は行動終了処理へ移行
  298.     action_terminate if @action == nil
  299.     # 次のアクション決定
  300.     @action_data = N03::ACTION[@action]
  301.     next_action
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ● 行動パラメータの初期化
  305.   #--------------------------------------------------------------------------
  306.   def action_setup(reset = true)
  307.     @event_fix = false
  308.     @set_damage = false
  309.     @action_end = false
  310.     @balloon_data = []
  311.     @loop_act = []
  312.     angle_reset if reset
  313.     zoom_reset if reset
  314.     opacity_reset if reset
  315.     @curve = []
  316.     @c = 0
  317.     convert_jump
  318.   end  
  319.   #--------------------------------------------------------------------------
  320.   # ● 行動終了処理
  321.   #--------------------------------------------------------------------------
  322.   def action_terminate
  323.     @mirage = [] if @mirage_end
  324.     mirroring_reset
  325.     @picture = false
  326.     @individual_targets = []
  327.     action_setup if @active
  328.     action_setup(false) if !@active
  329.     # 待機アクションへ移行
  330.     stand_by_action if !@non_motion
  331.     # 戦闘行動のアクティブ権を終了
  332.     next_battler
  333.   end  
  334.   #--------------------------------------------------------------------------
  335.   # ● 新しいアクション内容の決定
  336.   #--------------------------------------------------------------------------
  337.   def set_action(kind = nil)
  338.     full_act = N03::FULLACTION[kind]
  339.     @full_action = full_act.dup if full_act != nil
  340.     @action = @full_action.shift
  341.     # 参照したアクションがフルアクションであれば全体のアクションを統合
  342.     full_act2 = N03::FULLACTION[@action]
  343.     @full_action = full_act2.dup + @full_action if full_act2 != nil
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 次のアクションへ
  347.   #--------------------------------------------------------------------------
  348.   def next_action
  349.     @wait = 0
  350.     # ショートカット確認
  351.     eval(@action) if @action != nil && @action_data == nil && N03::FULLACTION[@action] == nil
  352.     # ウエイト設定
  353.     @wait = @action.to_i if @wait == 0 && @action_data == nil
  354.     @wait = rand(@wait.abs + 1) if @wait < 0
  355.     # アクション開始
  356.     action_play
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ● 待機アクションへ移行
  360.   #--------------------------------------------------------------------------
  361.   def stand_by_action
  362.     # 通常待機に
  363.     stand_by_act = normal
  364.     # HPが1/4でピンチアクションに
  365.     stand_by_act = pinch if @battler.hp <= @battler.mhp / 4
  366.     # ステートチェック
  367.     stand_by_act = state(@battler.states[0].id) if @battler.states[0] != nil && state(@battler.states[0].id) != nil
  368.     # コマンドチェック
  369.     stand_by_act = command if @command_action && command != nil
  370.     set_action(stand_by_act)
  371.     @action = stand_by_act if @action == nil
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # ● 強制アクション開始
  375.   #--------------------------------------------------------------------------
  376.   def start_force_action
  377.     return if @active
  378.     start_action(@force_action)
  379.     @force_action = ""
  380.   end  
  381.   #--------------------------------------------------------------------------
  382.   # ● アクション追加
  383.   #--------------------------------------------------------------------------
  384.   def add_action(kind)
  385.     @full_action.push(kind)
  386.   end  
  387.   #--------------------------------------------------------------------------
  388.   # ● アクションの挿入
  389.   #--------------------------------------------------------------------------
  390.   def unshift_action(kind)
  391.     @full_action.unshift(kind)
  392.   end  
  393.   #--------------------------------------------------------------------------
  394.   # ● フレーム更新
  395.   #--------------------------------------------------------------------------
  396.   def update
  397.     # アクション開始
  398.     start_action
  399.     # 強制アクション開始
  400.     start_force_action if @force_action != ""
  401.     # アニメパターン更新
  402.     update_pattern
  403.     # 移動更新
  404.     update_move
  405.     # 回転更新
  406.     update_angle if @angle_time != 0
  407.     # 拡大縮小更新
  408.     update_zoom if @zoom_time != 0
  409.     # 透明度更新
  410.     update_opacity if @opacity_data != []
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # ● アニメパターン更新
  414.   #--------------------------------------------------------------------------
  415.   def update_pattern
  416.     return @pattern_rest_time -= 1 if @pattern_rest_time != 0
  417.     return if @max_pattern_w == 1 && @max_pattern_h == 1
  418.     @pattern_rest_time = @pattern_time
  419.     # 再生開始・終了セル位置を取得
  420.     if @pattern_kind > 0 # 通常再生中
  421.       @pattern_start = 0
  422.       @pattern_end = @max_pattern_w - 1
  423.     elsif @pattern_kind < 0 # 逆転再生中
  424.       @pattern_start = @max_pattern_w - 1
  425.       @pattern_end = 0
  426.     end
  427.     # 片道の再生が終了
  428.     @pattern_count += 1 if @pattern_w == @pattern_end && @pattern_kind != 0
  429.     # ループ処理
  430.     case @pattern_type.abs
  431.     when  1,3 # 片道
  432.       @pattern_kind =  0 if @pattern_count != 0 && @pattern_type ==  1
  433.       @pattern_kind =  0 if @pattern_count != 0 && @pattern_type == -1
  434.       @pattern_kind =  1 if @pattern_count != 0 && @pattern_type ==  3
  435.       @pattern_kind = -1 if @pattern_count != 0 && @pattern_type == -3
  436.       @pattern_w = @pattern_start - @pattern_kind if @pattern_count != 0 && @pattern_type.abs == 3
  437.       @pattern_count = 0
  438.     when  2,4 # 往復
  439.       @pattern_kind = -1 if @pattern_count == 1 && @pattern_type ==  2
  440.       @pattern_kind =  1 if @pattern_count == 1 && @pattern_type == -2
  441.       @pattern_kind =  0 if @pattern_count == 2 && @pattern_type ==  2
  442.       @pattern_kind =  0 if @pattern_count == 2 && @pattern_type == -2
  443.       @pattern_kind = -1 if @pattern_count == 1 && @pattern_type ==  4
  444.       @pattern_kind =  1 if @pattern_count == 1 && @pattern_type == -4
  445.       @pattern_kind =  1 if @pattern_count == 2 && @pattern_type ==  4
  446.       @pattern_kind = -1 if @pattern_count == 2 && @pattern_type == -4
  447.       @pattern_count = 0 if @pattern_count == 2
  448.     end
  449.     # セル更新
  450.     @pattern_w += 1 * @pattern_kind
  451.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ● 移動の更新
  455.   #--------------------------------------------------------------------------
  456.   def update_move
  457.     @z = @y / 100 + @z_plus
  458.     return if @move_time == 0
  459.     target_position_set if @horming_move
  460.     @x = (@x * (@move_time - 1) + @target_x) / @move_time
  461.     @y = (@y * (@move_time - 1) + @target_y) / @move_time
  462.     @h = (@h * (@move_time - 1) + @target_h) / @move_time if @move_h != nil
  463.     @c += @curve[@move_time - 1] if @curve[@move_time - 1] != nil
  464.     @j += @jump[@move_time - 1] if @jump[@move_time - 1] != nil
  465.     @move_time -= 1
  466.     convert_jump if @move_time == 0
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ● 移動目標の更新
  470.   #--------------------------------------------------------------------------
  471.   def target_position_set
  472.     target_position = N03.get_targets_position(@move_targets, @horming_move)
  473.     @target_x = target_position[0] + @move_x
  474.     @target_y = target_position[1] + @move_y
  475.     @target_h = target_position[2] + @move_h if @move_h != nil
  476.   end  
  477.   #--------------------------------------------------------------------------
  478.   # ● 回転更新
  479.   #--------------------------------------------------------------------------
  480.   def update_angle
  481.     @angle += @angling
  482.     @angle_time -= 1
  483.     return if @angle_time != 0
  484.     return angle_reset if @angle_data[4] == 0
  485.     angling(@angle_data) if @angle_data[4] == 2
  486.   end  
  487.   #--------------------------------------------------------------------------
  488.   # ● 拡大縮小更新
  489.   #--------------------------------------------------------------------------
  490.   def update_zoom
  491.     @zoom_x += @zooming_x
  492.     @zoom_y += @zooming_y
  493.     @zoom_time -= 1
  494.     return if @zoom_time != 0
  495.     return zoom_reset if @zoom_data[4] == 0
  496.     zooming(@zoom_data) if @zoom_data[4] == 2
  497.   end
  498.   #--------------------------------------------------------------------------
  499.   # ● 透明度更新
  500.   #--------------------------------------------------------------------------
  501.   def update_opacity
  502.     @opacity += @opacity_data[2]
  503.     @opacity_data[0] -= 1
  504.     return if @opacity_data[0] != 0
  505.     return if !@opacity_data[5]
  506.     @opacity_data[2] *= -1
  507.     @opacity_data[0] = @opacity_data[1]
  508.   end
  509.   #--------------------------------------------------------------------------
  510.   # ● アクション実行
  511.   #--------------------------------------------------------------------------
  512.   def action_play
  513.     return if @action_data == nil
  514.     action = @action_data[0]
  515.     # バトラー反転の場合
  516.     return mirroring                    if action == "mirror"
  517.     # 残像の場合
  518.     return mirage_set                   if action == "mirage"
  519.     # 回転の場合  
  520.     return angling                      if action == "angle"
  521.     # 拡大縮小の場合  
  522.     return zooming                      if action == "zoom"
  523.     # 透明度操作の場合  
  524.     return set_opacity                  if action == "opacity"
  525.     # バトラーアニメの場合
  526.     return battler_anime                if action == "motion"
  527.     # 移動の場合
  528.     return move                         if action == "move"
  529.     # 武器アニメの場合
  530.     return weapon_anime([@action_data]) if action == "wp"
  531.     # アニメ飛ばしの場合
  532.     return move_anime                   if action == "m_a"
  533.     # 戦闘シーン通信の場合(コラプス)
  534.     return set_play_data                if action == "collapse" or action == "no_collapse"
  535.     # データベース戦闘アニメ表示の場合  
  536.     return battle_anime                 if action == "anime"
  537.     # カメラワークの場合
  538.     return camera                       if action == "camera"
  539.     # 画面のシェイクの場合
  540.     return shake                        if action == "shake"
  541.     # 画面色調変更の場合
  542.     return color_effect                 if action == "color"
  543.     # トランジションの場合
  544.     return transition                   if action == "ts"
  545.     # ふきだしアニメ表示の場合  
  546.     return balloon_anime                if action == "balloon"
  547.     # ピクチャ表示の場合
  548.     return picture_set                  if action == "pic"
  549.     # ステート操作の場合
  550.     return state_set                    if action == "sta"
  551.     # FPS変更の場合
  552.     return fps                          if action == "fps"
  553.     # バトラー画像変更の場合  
  554.     return graphics_change              if action == "change"
  555.     # スキル派生の場合  
  556.     return derivating_skill             if action == "der"
  557.     # BGM/BGS/SE演奏の場合  
  558.     return sound                        if action == "sound"
  559.     # ムービー再生の場合  
  560.     return movie                        if action == "movie"
  561.     # ゲームスイッチ操作の場合  
  562.     return switches                     if action == "switch"
  563.     # ゲーム変数操作の場合  
  564.     return variable                     if action == "variable"
  565.     # 条件分岐(ゲームスイッチ)の場合
  566.     return nece_1                       if action == "n_1"
  567.     # 条件分岐(ゲーム変数)の場合
  568.     return nece_2                       if action == "n_2"
  569.     # 条件分岐(ステート)の場合
  570.     return nece_3                       if action == "n_3"
  571.     # 条件分岐(スキル)の場合
  572.     return nece_4                       if action == "n_4"
  573.     # 条件分岐(パラメータ)の場合
  574.     return nece_5                       if action == "n_5"
  575.     # 条件分岐(装備)の場合
  576.     return nece_6                       if action == "n_6"
  577.     # 条件分岐(スクリプト)の場合
  578.     return nece_7                       if action == "n_7"
  579.     # セカンドターゲット操作の場合  
  580.     return second_targets_set           if action == "s_t"
  581.     # コモンイベント呼び出しの場合  
  582.     return call_common_event            if action == "common"
  583.     # 戦闘アニメ消去の場合  
  584.     return @anime_off = true            if action == "anime_off"
  585.     # 強制戦闘終了の場合  
  586.     return BattleManager.process_abort  if action == "battle_end"
  587.     # 画面固定の場合  
  588.     return Graphics.freeze              if action == "graphics_freeze"
  589.     # ダメージアニメの場合  
  590.     return damage_anime                 if action == "damage_anime"
  591.     # 武器消去の場合  
  592.     return @weapon_visible = false      if action == "weapon_off"
  593.     # 武器消去解除の場合  
  594.     return @weapon_visible = true       if action == "weapon_on"
  595.     # 待機キャンセルの場合
  596.     return @non_motion = true           if action == "non_motion"
  597.     # 待機キャンセル解除の場合
  598.     return @non_motion = false          if action == "non_motion_cancel"
  599.     # 初期位置変更の場合
  600.     return change_base_position         if action == "change_base_position"
  601.     # 初期位置変更解除の場合
  602.     return set_base_position(false)     if action == "set_base_position"
  603.     # 強制アクションの場合  
  604.     return force_act                    if action == "force_action"
  605.     # 強制アクションの場合 (セカンドターゲット)
  606.     return force_act2                   if action == "force_action2"
  607.     # 個別開始の場合
  608.     return individual_start             if action == "individual_start"
  609.     # 個別終了の場合
  610.     return individual_end               if action == "individual_end"
  611.     # ループ開始の場合
  612.     return loop_start                   if action == "loop_start"
  613.     # ループ終了の場合
  614.     return loop_end                     if action == "loop_end"
  615.     # 自分のみ更新の場合
  616.     return only_action_on               if action == "only_action_on"
  617.     # 自分のみ更新解除の場合
  618.     return only_action_off              if action == "only_action_off"
  619.     # 次の行動者へ移行の場合
  620.     return next_battler                 if action == "next_battler"
  621.     # 画像変更フラグの場合
  622.     return set_change                   if action == "set_change"
  623.     # スクリプト操作の場合   
  624.     return eval(@action_data[0])
  625.   end
  626.   #--------------------------------------------------------------------------
  627.   # ● バトラー反転実行
  628.   #--------------------------------------------------------------------------
  629.   def mirroring
  630.     @mirror = !@mirror
  631.   end  
  632.   #--------------------------------------------------------------------------
  633.   # ● 反転初期化
  634.   #--------------------------------------------------------------------------
  635.   def mirroring_reset
  636.     @mirror = false
  637.     mirroring if !@battler.actor? && N03::ENEMY_MIRROR
  638.     mirroring if $sv_camera.mirror
  639.   end  
  640.   #--------------------------------------------------------------------------
  641.   # ● 残像実行
  642.   #--------------------------------------------------------------------------
  643.   def mirage_set
  644.     @mirage = @action_data.dup
  645.     @mirage_end = @mirage[3]
  646.     @mirage = [] if @mirage[1] == 0
  647.   end  
  648.   #--------------------------------------------------------------------------
  649.   # ● 回転実行
  650.   #--------------------------------------------------------------------------
  651.   def angling(data = @action_data)
  652.     @angle_data = data.dup
  653.     @oy = @ch / 2
  654.     @oy_adjust = @ch * 50
  655.     @angle_time = data[1]
  656.     start_angle = data[2] * N03.mirror_num(@mirror)
  657.     end_angle = data[3] * N03.mirror_num(@mirror)
  658.     # 時間が0以下なら即座に最終角度へ
  659.     @angle_time = 1 if @angle_time <= 0
  660.     # 回転時間から1フレームあたりの角度を出す
  661.     @angling = (end_angle - start_angle) / @angle_time
  662.     # 割り切れない余りを初期角度に
  663.     @angle = (end_angle - start_angle) % @angle_time + start_angle
  664.   end
  665.   #--------------------------------------------------------------------------
  666.   # ● 回転初期化
  667.   #--------------------------------------------------------------------------
  668.   def angle_reset
  669.     @oy = @ch
  670.     @angle = @angle_time = @oy_adjust = 0
  671.   end  
  672.   #--------------------------------------------------------------------------
  673.   # ● 拡大縮小実行
  674.   #--------------------------------------------------------------------------
  675.   def zooming(data = @action_data)
  676.     @zoom_data = data.dup
  677.     @zoom_time = data[1]
  678.     start_zoom_x = data[2][0]
  679.     start_zoom_y = data[2][1]
  680.     end_zoom_x = data[3][0]
  681.     end_zoom_y = data[3][1]
  682.     # 時間が0以下なら即座に最終サイズへ
  683.     @zoom_time = 1 if @zoom_time <= 0
  684.     # 拡大縮小時間から1フレームあたりの拡大縮小率を出す
  685.     @zooming_x = (end_zoom_x - start_zoom_x) / @zoom_time
  686.     @zooming_y = (end_zoom_y - start_zoom_y) / @zoom_time
  687.     # 開始サイズに
  688.     @zoom_x = start_zoom_x
  689.     @zoom_y = start_zoom_y
  690.   end  
  691.   #--------------------------------------------------------------------------
  692.   # ● 拡大縮小初期化
  693.   #--------------------------------------------------------------------------
  694.   def zoom_reset
  695.     @zoom_x = @zoom_y = 1
  696.     @zoom_time = 0
  697.   end  
  698.   #--------------------------------------------------------------------------
  699.   # ● バトラー透明度操作
  700.   #--------------------------------------------------------------------------
  701.   def set_opacity
  702.     data = @action_data.dup
  703.     @opacity = data[2]
  704.     opacity_move = (data[3] - data[2])/ data[1]
  705.     @opacity_data = [data[1], data[1], opacity_move, data[4], data[5], data[6]]
  706.     @wait = data[1] if data[7]
  707.     @wait *= 2 if data[6] && data[7]
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ● 透明度操作初期化
  711.   #--------------------------------------------------------------------------
  712.   def opacity_reset
  713.     @opacity = 255
  714.     @opacity = 0 if @battler.hidden?
  715.     @opacity_data = []
  716.   end
  717.   #--------------------------------------------------------------------------
  718.   # ● バトラーアニメ実行
  719.   #--------------------------------------------------------------------------
  720.   def battler_anime(anime_data = nil)
  721.     anime_data = @action_data.dup if anime_data == nil
  722.     @graphic_file_index = anime_data[1] if !graphic_fix
  723.     @pattern_h = anime_data[2]
  724.     @pattern_w = anime_data[3]
  725.     @pattern_h = 0 if @max_pattern_w == 1
  726.     @pattern_w = 0 if @max_pattern_h == 1
  727.     @pattern_type = anime_data[4]
  728.     @pattern_time = anime_data[5]
  729.     @pattern_rest_time = anime_data[5]
  730.     @pattern_count = 0
  731.     @pattern_kind = 1
  732.     @pattern_kind = -1 if @pattern_type < 0
  733.     @pattern_kind = 0 if @pattern_type == 0
  734.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  735.     @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  736.     @z_plus = anime_data[6]
  737.     @wait = set_anime_wait if anime_data[7]
  738.     @shadow_visible = anime_data[8]
  739.     weapon_anime(anime_data)
  740.   end
  741.   #--------------------------------------------------------------------------
  742.   # ● アニメウエイト計算
  743.   #--------------------------------------------------------------------------
  744.   def set_anime_wait
  745.     if @pattern_type > 0
  746.       pattern_time_a = @max_pattern_w - @pattern_w.abs
  747.     elsif @pattern_type < 0
  748.       pattern_time_a = @pattern_w.abs + 1
  749.     else
  750.       return @pattern_time if @pattern_type == 0
  751.     end
  752.     case @pattern_type
  753.     when 1,-1, 3,-3
  754.       return pattern_time_a * @pattern_time
  755.     when 2,-2, 4,-4
  756.       return pattern_time_a * @pattern_time + (@max_pattern_w - 2) * @pattern_time
  757.     end
  758.   end  
  759.   #--------------------------------------------------------------------------
  760.   # ● 移動実行
  761.   #--------------------------------------------------------------------------
  762.   def move
  763.     @move_targets = N03.get_targets(@action_data[1].abs, @battler)
  764.     return if @move_targets == []
  765.     @move_targets = [@battler] if @action_data[1].abs == 7
  766.     @move_x = @action_data[2] * 100 * N03.mirror_num(@mirror)
  767.     @move_y = @action_data[3] * 100
  768.     @move_h = @action_data[4] * 100 if @action_data[4] != nil
  769.     @move_h = nil if @action_data[4] == nil
  770.     battler_anime(N03::ACTION[@action_data[8]].dup) if N03::ACTION[@action_data[8]] != nil
  771.     @horming_move = true
  772.     @horming_move = false if @action_data[1] < 0 or @action_data[1].abs == 7
  773.     target_position_set
  774.     target_position = [@target_x, @target_y, @target_z]
  775.     distanse_move = @action_data[5] > 0
  776.     @move_time = N03.distanse_calculation(@action_data[5].abs, target_position, [@x, @y, @z], distanse_move)
  777.     @wait = @move_time
  778.     curve
  779.     jump
  780.     @move_time = 1 if @move_time == 0
  781.     @horming_move = false if !@move_targets or @move_targets.include?(@battler)
  782.     update_move if @move_time == 1
  783.   end  
  784.   #--------------------------------------------------------------------------
  785.   # ● カーブ実行
  786.   #--------------------------------------------------------------------------
  787.   def curve
  788.     @c = 0
  789.     return if @action_data[6] == 0
  790.     @curve = N03.parabola([@action_data[6], -@action_data[6]], @move_time, 100, 4)
  791.   end  
  792.   #--------------------------------------------------------------------------
  793.   # ● ジャンプ実行
  794.   #--------------------------------------------------------------------------
  795.   def jump
  796.     convert_jump
  797.     return if @action_data[7] == [0,0]
  798.     @jump = N03.parabola(@action_data[7].dup, @move_time, 100)
  799.   end  
  800.   #--------------------------------------------------------------------------
  801.   # ● J座標(ジャンプ高度)をH座標に変換
  802.   #--------------------------------------------------------------------------
  803.   def convert_jump
  804.     @h += @j
  805.     @j = 0
  806.     @jump = []
  807.   end  
  808.   #--------------------------------------------------------------------------
  809.   # ● データベース戦闘アニメ実行
  810.   #--------------------------------------------------------------------------
  811.   def battle_anime
  812.     data = @action_data.dup
  813.     targets = N03.get_targets(data[2], @battler)
  814.     return if targets == []
  815.     data[8] = !data[8] if @mirror
  816.     @set_damage           = data[5]
  817.     @damage_anime_data[0] = N03.get_attack_anime_id(data[1], @battler)
  818.     @damage_anime_data[1] = data[8]
  819.     @damage_anime_data[2] = data[7]
  820.     @damage_anime_data[3] = data[6]
  821.     @damage_anime_data[4] = data[9]
  822.     @wait = N03.get_anime_time(@damage_anime_data[0]) - 2 if data[4]
  823.     return if @set_damage
  824.     for target in targets do display_anime(targets, target, data) end
  825.   end
  826.   #--------------------------------------------------------------------------
  827.   # ● 武器アニメ開始
  828.   #--------------------------------------------------------------------------
  829.   def weapon_anime(anime_data)
  830.     @weapon_end = true
  831.     for i in 9...anime_data.size
  832.       set_effect_data(anime_data[i]) if anime_data[i] != ""
  833.     end
  834.   end
  835.   #--------------------------------------------------------------------------
  836.   # ● アニメ飛ばし開始
  837.   #--------------------------------------------------------------------------
  838.   def move_anime
  839.     @m_a_starter = []
  840.     @m_a_targets = []
  841.     starters = N03.get_targets(@action_data[2], @battler)
  842.     targets = N03.get_targets(@action_data[3], @battler)
  843.     return if starters == [] or targets == []
  844.     single_start = true if starters != nil && @action_data[2] < 0
  845.     single_start = true if @action_data[1][0] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][0], @battler)].position == 3
  846.     starters = [starters[0]] if single_start
  847.     single_end = true if targets != nil && @action_data[3] < 0
  848.     single_end = true if @action_data[1][1] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][1], @battler)].position == 3
  849.     targets = [targets[0]] if single_end
  850.     se_flag = true
  851.     for starter in starters
  852.       for target in targets
  853.         data = @action_data.dup
  854.         data[17] = se_flag
  855.         @effect_data.push(data)
  856.         @m_a_targets.push(target)
  857.         @m_a_starter.push(starter)
  858.         se_flag = false
  859.       end
  860.     end  
  861.   end
  862.   #--------------------------------------------------------------------------
  863.   # ● スプライトセット通信
  864.   #--------------------------------------------------------------------------
  865.   def set_effect_data(data = @action)
  866.     action_data = N03::ACTION[data]
  867.     return if action_data == nil
  868.     @effect_data.push(action_data.dup)
  869.   end
  870.   #--------------------------------------------------------------------------
  871.   # ● 戦闘シーン通信のデータを格納
  872.   #--------------------------------------------------------------------------
  873.   def set_play_data(data = @action_data)
  874.     @play_data = data.dup
  875.   end
  876.   #--------------------------------------------------------------------------
  877.   # ● 戦闘アニメの表示
  878.   #--------------------------------------------------------------------------
  879.   def display_anime(targets, target, data)
  880.     return if !N03.first_of_all_screen_anime(data[1], target, targets)
  881.     target.animation_id         = N03.get_attack_anime_id(data[1], @battler)
  882.     target.animation_mirror     = data[8]
  883.     target.sv.anime_horming     = data[3]
  884.     target.sv.anime_camera_zoom = data[6]
  885.     target.sv.anime_no_mirror   = data[7]
  886.     target.sv.anime_plus_z      = data[9]
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● 戦闘アニメ拡張データの初期化
  890.   #--------------------------------------------------------------------------
  891.   def reset_anime_data
  892.     @anime_no_mirror = false
  893.     @anime_horming = false
  894.     @anime_camera_zoom = false
  895.     @timing_targets = []
  896.     @anime_plus_z = true
  897.   end  
  898.   #--------------------------------------------------------------------------
  899.   # ● カメラワーク
  900.   #--------------------------------------------------------------------------
  901.   def camera
  902.     data = @action_data.dup
  903.     N03.camera(@battler, data)
  904.     @wait = data[4] if data[5]
  905.   end  
  906.   #--------------------------------------------------------------------------
  907.   # ● 画面のシェイク
  908.   #--------------------------------------------------------------------------
  909.   def shake
  910.     data = @action_data.dup
  911.     $sv_camera.shake(data[1], data[2], data[3])
  912.     @wait = data[3] if data[4]
  913.   end
  914.   #--------------------------------------------------------------------------
  915.   # ● 画面色調変更
  916.   #--------------------------------------------------------------------------
  917.   def color_effect
  918.     case @action_data[1]
  919.     when 0,1,2,3,4,5
  920.       targets = N03.get_targets(@action_data[1], @battler)
  921.     when 6
  922.       screen = true
  923.     when 7
  924.       targets = [@battler] + @target_battler
  925.     when 8
  926.       screen = true
  927.       targets = $game_troop.members + $game_party.battle_members - [@battler]
  928.     when 9
  929.       screen = true
  930.       targets = $game_troop.members + $game_party.battle_members - [@battler] - @target_battler
  931.     when 10
  932.       screen = true
  933.       targets = $game_troop.members + $game_party.battle_members
  934.     end
  935.     return if screen == nil && targets == []
  936.     for target in targets do target.sv.color_set = @action_data[2] end if targets
  937.     @wait = @action_data[2][4] if @action_data[3]
  938.     return if !screen
  939.     $sv_camera.color_set[1] = @action_data[2]
  940.     $sv_camera.color_set[2] = @action_data[2]
  941.   end  
  942.   #--------------------------------------------------------------------------
  943.   # ● トランジション
  944.   #--------------------------------------------------------------------------
  945.   def transition
  946.     $sv_camera.perform_transition(@action_data)
  947.   end  
  948.   #--------------------------------------------------------------------------
  949.   # ● ふきだしアニメ表示
  950.   #--------------------------------------------------------------------------
  951.   def balloon_anime
  952.     @balloon_data = @action_data.dup
  953.   end  
  954.   #--------------------------------------------------------------------------
  955.   # ● ピクチャ表示
  956.   #--------------------------------------------------------------------------
  957.   def picture_set
  958.     @picture = true
  959.     set_effect_data
  960.   end
  961.   #--------------------------------------------------------------------------
  962.   # ● ステート操作
  963.   #--------------------------------------------------------------------------
  964.   def state_set
  965.     targets = N03.get_targets(@action_data[1], @battler)
  966.     return if targets == []
  967.     case @action_data[2]
  968.     when 1 ; targets = [targets[rand(targets.size)]]
  969.     when 2 ; targets -= @battler if targets.include?(@battler)
  970.     end
  971.     for target in targets
  972.       for id in @action_data[4]
  973.         target.add_state(id) if @action_data[3] == "+"
  974.         target.remove_state(id) if @action_data[3] == "-"
  975.       end
  976.     end
  977.   end
  978.   #--------------------------------------------------------------------------
  979.   # ● FPS変更
  980.   #--------------------------------------------------------------------------
  981.   def fps
  982.     Graphics.frame_rate = @action_data[1]
  983.     start_action
  984.   end
  985.   #--------------------------------------------------------------------------
  986.   # ● バトラー画像変更の場合
  987.   #--------------------------------------------------------------------------
  988.   def graphics_change
  989.     @graphics_change = true
  990.     return @battler.graphics_change(@action_data[3]) if !@battler.actor?
  991.     @pre_change_data = [@battler.character_name, @battler.character_index, @battler.face_name, @battler.face_index] if @pre_change_data == nil && !@action_data[1]
  992.     if @action_data[4] == []
  993.       face_name = @battler.face_name
  994.       face_index = @battler.face_index
  995.     else
  996.       face_name = @action_data[4][1]
  997.       face_index = @action_data[4][0]
  998.     end
  999.     @battler.set_graphic(@action_data[3], @action_data[2], face_name, face_index)
  1000.   end
  1001.   #--------------------------------------------------------------------------
  1002.   # ● スキル派生
  1003.   #--------------------------------------------------------------------------
  1004.   def derivating_skill
  1005.     # 未修得スキルは派生不可なら
  1006.     return if !@action_data[1] && !@battler.skill_learn?($data_skills[@action_data[3]])
  1007.     # コスト不足は派生不可なら
  1008.     return if !@action_data[2] && !@battler.skill_cost_payable?($data_skills[@action_data[3]])
  1009.     # 派生
  1010.     @derivation_skill_id = @action_data[3]
  1011.     # 以降のアクションをキャンセル
  1012.     @full_action = []
  1013.   end
  1014.   #--------------------------------------------------------------------------
  1015.   # ● BGM/BGS/SE演奏
  1016.   #--------------------------------------------------------------------------
  1017.   def sound
  1018.     pitch = @action_data[2]
  1019.     vol   = @action_data[3]
  1020.     name  = @action_data[4]
  1021.     case @action_data[1]
  1022.     when "se"
  1023.       Audio.se_play("Audio/SE/" + name, vol, pitch)
  1024.     when "bgm"
  1025.       # 名前指定のない場合、現在のBGMを変えないように
  1026.       name = RPG::BGM.last.name if @action_data[4] == ""
  1027.       Audio.bgm_play("Audio/BGM/" + name, vol, pitch)
  1028.     when "bgs"
  1029.       name = RPG::BGS.last.name if @action_data[4] == ""
  1030.       Audio.bgs_play("Audio/BGS/" + name, vol, pitch)
  1031.     end
  1032.   end
  1033.   #--------------------------------------------------------------------------
  1034.   # ● ムービーの再生
  1035.   #--------------------------------------------------------------------------
  1036.   def movie
  1037.     Graphics.play_movie('Movies/' + @action_data[1])
  1038.   end
  1039.   #--------------------------------------------------------------------------
  1040.   # ● ゲームスイッチ操作
  1041.   #--------------------------------------------------------------------------
  1042.   def switches
  1043.     for id in @action_data[1]
  1044.       $game_switches[id] = true if id > 0
  1045.       $sv_camera.switches[id.abs] = true  if id < 0
  1046.     end
  1047.     for id in @action_data[2]
  1048.       $game_switches[id] = false if id > 0
  1049.       $sv_camera.switches[id.abs] = false  if id < 0
  1050.     end
  1051.     $sv_camera.program_check
  1052.   end
  1053.   #--------------------------------------------------------------------------
  1054.   # ● ゲーム変数操作
  1055.   #--------------------------------------------------------------------------
  1056.   def variable
  1057.     # オペランドチェック
  1058.     operand = @action_data[3]
  1059.     operand = $game_variables[@action_data[3].abs] if @action_data[3] < 0
  1060.     # 変数操作で分岐
  1061.     case @action_data[2]
  1062.     when 0 ; $game_variables[@action_data[1]] = operand  # 代入
  1063.     when 1 ; $game_variables[@action_data[1]] += operand # 加算
  1064.     when 2 ; $game_variables[@action_data[1]] -= operand # 減算
  1065.     when 3 ; $game_variables[@action_data[1]] *= operand # 乗算
  1066.     when 4 ; $game_variables[@action_data[1]] /= operand # 除算
  1067.     when 5 ; $game_variables[@action_data[1]] %= operand # 剰余
  1068.     end
  1069.   end  
  1070.   #--------------------------------------------------------------------------
  1071.   # ● 条件分岐 (ゲームスイッチ)
  1072.   #--------------------------------------------------------------------------
  1073.   def nece_1
  1074.     judgment = $game_switches[@action_data[1]] == @action_data[2] if @action_data[1] > 0
  1075.     judgment = $sv_camera.switches[@action_data[1].abs] == @action_data[2] if @action_data[1] < 0
  1076.     action_diverging(judgment, @action_data[3])
  1077.   end  
  1078.   #--------------------------------------------------------------------------
  1079.   # ● 条件分岐 (ゲーム変数)
  1080.   #--------------------------------------------------------------------------
  1081.   def nece_2
  1082.     variable = $game_variables[@action_data[1]]
  1083.     num = @action_data[2]
  1084.     num = $game_variables[@action_data[2].abs] if num < 0
  1085.     case @action_data[3]
  1086.     when 0 ; judgment = variable == num
  1087.     when 1 ; judgment = variable < num
  1088.     when 2 ; judgment = variable > num
  1089.     end  
  1090.     action_diverging(judgment, @action_data[4])
  1091.   end  
  1092.   #--------------------------------------------------------------------------
  1093.   # ● 条件分岐 (ステート)
  1094.   #--------------------------------------------------------------------------
  1095.   def nece_3
  1096.     targets = N03.get_targets(@action_data[1], @battler)
  1097.     return if targets == []
  1098.     member_num = @action_data[4]
  1099.     member_num = targets.size if @action_data[4] == 0 && targets.size > 1
  1100.     hit_count = 0
  1101.     miss_count = 0
  1102.     for target in targets
  1103.       hit_count += 1 if target.state?(@action_data[2])
  1104.       miss_count += 1 if !target.state?(@action_data[2])
  1105.     end
  1106.     case @action_data[3]
  1107.     when 0 ; judgment = hit_count >= member_num
  1108.     when 1 ; judgment = miss_count >= member_num
  1109.     end
  1110.     action_diverging(judgment, @action_data[5])
  1111.   end  
  1112.   #--------------------------------------------------------------------------
  1113.   # ● 条件分岐 (スキル)
  1114.   #--------------------------------------------------------------------------
  1115.   def nece_4
  1116.     targets = N03.get_targets(@action_data[1], @battler)
  1117.     return if targets == []
  1118.     member_num = @action_data[4]
  1119.     member_num = targets.size if @action_data[4] == 0 && targets.size > 1
  1120.     hit_count = 0
  1121.     miss_count = 0
  1122.     for target in targets
  1123.       hit_count += 1 if target.skill_learn?($data_skills[@action_data[2]]) && target.skill_conditions_met?($data_skills[@action_data[2]])
  1124.       miss_count += 1 if !target.skill_learn?($data_skills[@action_data[2]]) or !target.skill_conditions_met?($data_skills[@action_data[2]])
  1125.     end
  1126.     case @action_data[3]
  1127.     when 0 ; judgment = hit_count >= member_num
  1128.     when 1 ; judgment = miss_count >= member_num
  1129.     end
  1130.     action_diverging(judgment, @action_data[5])
  1131.   end  
  1132.   #--------------------------------------------------------------------------
  1133.   # ● 条件分岐 (パラメータ)
  1134.   #--------------------------------------------------------------------------
  1135.   def nece_5
  1136.     targets = N03.get_targets(@action_data[1], @battler)
  1137.     return if targets == []
  1138.     member_num = @action_data[5]
  1139.     member_num = targets.size if @action_data[5] == 0 && targets.size > 1
  1140.     hit_count = 0
  1141.     for target in targets
  1142.       hit_count += 1 if target.comparison_parameter([@action_data[2],@action_data[3],@action_data[4]])
  1143.     end
  1144.     judgment = hit_count >= member_num
  1145.     action_diverging(judgment, @action_data[6])
  1146.   end  
  1147.   #--------------------------------------------------------------------------
  1148.   # ● 条件分岐 (装備)
  1149.   #--------------------------------------------------------------------------
  1150.   def nece_6
  1151.     targets = N03.get_targets(@action_data[1], @battler)
  1152.     return if targets == []
  1153.     member_num = @action_data[5]
  1154.     member_num = targets.size if @action_data[5] == 0 && targets.size > 1
  1155.     hit_count = 0
  1156.     miss_count = 0
  1157.     for target in targets
  1158.       hit_count += 1 if target.comparison_equip([@action_data[2],@action_data[3]])
  1159.       miss_count += 1 if !target.comparison_equip([@action_data[2],@action_data[3]])
  1160.     end
  1161.     case @action_data[4]
  1162.     when 0 ; judgment = hit_count >= member_num
  1163.     when 1 ; judgment = miss_count >= member_num
  1164.     end
  1165.     action_diverging(judgment, @action_data[6])
  1166.   end  
  1167.   #--------------------------------------------------------------------------
  1168.   # ● 条件分岐 (スクリプト)
  1169.   #--------------------------------------------------------------------------
  1170.   def nece_7
  1171.     judgment = eval(@action_data[2])
  1172.     action_diverging(judgment, @action_data[1])
  1173.   end  
  1174.   #--------------------------------------------------------------------------
  1175.   # ● アクション分岐  
  1176.   #--------------------------------------------------------------------------
  1177.   def action_diverging(judgment, kind)
  1178.     result = 0
  1179.     if judgment
  1180.       result = 1 if kind == 1
  1181.       result = 2 if kind == 2
  1182.     else
  1183.       result = 1 if kind == 0
  1184.     end
  1185.     # フルアクション終了
  1186.     return @full_action = []  if result == 2
  1187.     # 次のアクションを除去
  1188.     @full_action.shift if result == 1
  1189.     set_action
  1190.     # 次のアクションを実行
  1191.     @action_data = N03::ACTION[@action]
  1192.     next_action
  1193.   end
  1194.   #--------------------------------------------------------------------------
  1195.   # ● セカンドターゲット操作
  1196.   #--------------------------------------------------------------------------
  1197.   def second_targets_set
  1198.     targets = N03.get_targets(@action_data[1], @battler)
  1199.     for target in targets
  1200.       targets.delete(target) if @action_data[2][1] == 1 && target.index != @action_data[2][0]
  1201.       targets.delete(target) if @action_data[2][1] == 2 && target.index == @action_data[2][0].abs
  1202.       targets.delete(target) if @action_data[3] > 0 && target.id != @action_data[3]
  1203.       targets.delete(target) if @action_data[3] < 0 && target.id == @action_data[3].abs
  1204.       targets.delete(target) if @action_data[4] > 0 && !target.state?(@action_data[4])
  1205.       targets.delete(target) if @action_data[4] < 0 && target.state?(@action_data[4].abs)
  1206.       targets.delete(target) if @action_data[5] > 0 && !target.skill_conditions_met?($data_skills[@action_data[5]])
  1207.       targets.delete(target) if @action_data[5] < 0 && target.skill_conditions_met?($data_skills[@action_data[5].abs])
  1208.       targets.delete(target) if !target.comparison_parameter(@action_data[6])
  1209.       targets.delete(target) if !@action_data[7][1].include?(0) && !target.comparison_equip(@action_data[7])
  1210.     end
  1211.     return @second_targets = [] if targets.size == 0
  1212.     case @action_data[8]
  1213.     when 1 ; targets = [targets[rand(targets.size)]]
  1214.     when 2 ; targets.delete(@battler)
  1215.     end
  1216.     return @second_targets = [] if targets.size == 0
  1217.     @second_targets = targets
  1218.     case @action_data[9]
  1219.     when 0 ; return
  1220.     when 1 ; set_play_data(["second_targets_set"])
  1221.     when 2 ; set_play_data(["targets_set"])
  1222.     end
  1223.     @wait += 1
  1224.   end
  1225.   #--------------------------------------------------------------------------
  1226.   # ● コモンイベント呼び出し
  1227.   #--------------------------------------------------------------------------
  1228.   def call_common_event
  1229.     $game_temp.reserve_common_event(@action_data[1])
  1230.     $sv_camera.event = true
  1231.     @event_fix = @action_data[2]
  1232.   end
  1233.   #--------------------------------------------------------------------------
  1234.   # ● ダメージアニメ
  1235.   #--------------------------------------------------------------------------
  1236.   def damage_anime(delay_time = 12)
  1237.     anime(N03.get_attack_anime_id(-3, @battler), wait = true)
  1238.     action_play
  1239.     @wait -= delay_time
  1240.     @full_action.unshift("eval('@damage_anime_data = []
  1241.     @set_damage = true')")
  1242.   end
  1243.   #--------------------------------------------------------------------------
  1244.   # ● 通常コラプス
  1245.   #--------------------------------------------------------------------------
  1246.   def normal_collapse
  1247.     @collapse = true
  1248.     return
  1249.   end
  1250.   #--------------------------------------------------------------------------
  1251.   # ● 初期位置変更
  1252.   #--------------------------------------------------------------------------
  1253.   def change_base_position
  1254.     @base_x = @x
  1255.     @base_y = @y
  1256.     @base_h = @h
  1257.   end  
  1258.   #--------------------------------------------------------------------------
  1259.   # ● 強制アクション実行
  1260.   #--------------------------------------------------------------------------
  1261.   def force_act
  1262.     target(@full_action.shift)
  1263.   end
  1264.   #--------------------------------------------------------------------------
  1265.   # ● 強制アクション実行 (セカンドターゲット)
  1266.   #--------------------------------------------------------------------------
  1267.   def force_act2
  1268.     target2(@full_action.shift)
  1269.   end
  1270.   #--------------------------------------------------------------------------
  1271.   # ● 個別処理開始
  1272.   #--------------------------------------------------------------------------
  1273.   def individual_start
  1274.     @individual_targets = @target_battler.dup
  1275.     @remain_targets = @target_battler.dup
  1276.     @target_battler = [@individual_targets[0]]
  1277.     # リピート部分のアクションを保持
  1278.     @individual_act = @full_action.dup
  1279.   end
  1280.   #--------------------------------------------------------------------------
  1281.   # ● 個別処理終了
  1282.   #--------------------------------------------------------------------------
  1283.   def individual_end
  1284.     @individual_targets.shift
  1285.     for target in @individual_targets
  1286.       @individual_targets.shift if target.dead?
  1287.     end
  1288.     # ターゲットが残っているなら行動リピート
  1289.     return @target_battler = @remain_targets if @individual_targets.size == 0
  1290.     @full_action = @individual_act.dup
  1291.     @target_battler = [@individual_targets[0]]
  1292.   end
  1293.   #--------------------------------------------------------------------------
  1294.   # ● ループ開始
  1295.   #--------------------------------------------------------------------------
  1296.   def loop_start
  1297.     # ループ部分のアクションを保持
  1298.     @loop_act = @full_action.dup
  1299.   end
  1300.   #--------------------------------------------------------------------------
  1301.   # ● ループ終了
  1302.   #--------------------------------------------------------------------------
  1303.   def loop_end
  1304.     # 行動リピート
  1305.     @full_action = @loop_act.dup if @loop_act != []
  1306.   end
  1307.   #--------------------------------------------------------------------------
  1308.   # ● 次の行動者へ移行
  1309.   #--------------------------------------------------------------------------
  1310.   def next_battler
  1311.     @action_end = true
  1312.     @active = false
  1313.   end
  1314.   #--------------------------------------------------------------------------
  1315.   # ● 画像変更フラグ
  1316.   #--------------------------------------------------------------------------
  1317.   def set_change
  1318.     @change_up = true
  1319.   end
  1320.   #--------------------------------------------------------------------------
  1321.   # ● 戦闘シーン通信
  1322.   #--------------------------------------------------------------------------
  1323.   def play_data
  1324.     data = @play_data
  1325.     @play_data = []
  1326.     return data
  1327.   end
  1328.   #--------------------------------------------------------------------------
  1329.   # ● ショートカットコマンド
  1330.   #--------------------------------------------------------------------------
  1331.   def anime(anime_id, wait = true)
  1332.     @action_data = ["anime",anime_id,1,false,wait,false,true,false]
  1333.   end
  1334.   def anime_me(anime_id, wait = true)
  1335.     @action_data = ["anime",anime_id,0,false,wait,false,true,false]
  1336.   end
  1337.   def se(file, pitch = 100)
  1338.     @action_data = ["sound",  "se", pitch, 100, file]
  1339.   end
  1340.   def target(act)
  1341.     for target in @target_battler do target.sv.force_action = act end
  1342.   end
  1343.   def target2(act)
  1344.     for target in @second_targets do target.sv.force_action = act end
  1345.   end
  1346.   def delay(time)
  1347.     @wait = @battler.index * time
  1348.   end
  1349.   #--------------------------------------------------------------------------
  1350.   # ● バトラーのIDを取得
  1351.   #--------------------------------------------------------------------------
  1352.   def id
  1353.     return @battler.id if @battler.actor?
  1354.     return [email]-@battler.id[/email]
  1355.   end
  1356.   #--------------------------------------------------------------------------
  1357.   # ● 被クリティカルフラグを取得
  1358.   #--------------------------------------------------------------------------
  1359.   def critical?
  1360.     return @battler.result.critical
  1361.   end
  1362.   #--------------------------------------------------------------------------
  1363.   # ● 被回復フラグを取得
  1364.   #--------------------------------------------------------------------------
  1365.   def recovery?
  1366.     recovery = false
  1367.     recovery = true if @battler.result.hp_damage < 0
  1368.     recovery = true if @battler.result.mp_damage < 0
  1369.     recovery = true if @battler.result.tp_damage < 0
  1370.     return recovery
  1371.   end
  1372.   #--------------------------------------------------------------------------
  1373.   # ● 被スキルIDを取得
  1374.   #--------------------------------------------------------------------------
  1375.   def damage_skill_id
  1376.     return @damage_skill_id
  1377.   end
  1378.   #--------------------------------------------------------------------------
  1379.   # ● 被アイテムIDを取得
  1380.   #--------------------------------------------------------------------------
  1381.   def damage_item_id
  1382.     return @damage_item_id
  1383.   end
  1384.   #--------------------------------------------------------------------------
  1385.   # ● 装備武器を取得
  1386.   #--------------------------------------------------------------------------
  1387.   def weapon_id
  1388.     return 0 if !@battler.weapons[0]
  1389.     return @battler.weapons[0].id
  1390.   end
  1391.   #--------------------------------------------------------------------------
  1392.   # ● 装備武器のタイプを取得
  1393.   #--------------------------------------------------------------------------
  1394.   def weapon_type
  1395.     return 0 if !@battler.weapons[0]
  1396.     return @battler.weapons[0].wtype_id
  1397.   end
  1398.   #--------------------------------------------------------------------------
  1399.   # ● 盾を装備しているか
  1400.   #--------------------------------------------------------------------------
  1401.   def shield?
  1402.     for armor in @battler.armors do return true if armor != nil && armor.etype_id == 1 end
  1403.     return false
  1404.   end
  1405.   #--------------------------------------------------------------------------
  1406.   # ● ダメージがあるか
  1407.   #--------------------------------------------------------------------------
  1408.   def damage_zero?
  1409.     return @battler.result.hp_damage == 0 && @battler.result.mp_damage == 0 && @battler.result.tp_damage == 0
  1410.   end
  1411.   #--------------------------------------------------------------------------
  1412.   # ● スキルIDを取得
  1413.   #--------------------------------------------------------------------------
  1414.   def skill_id
  1415.     return @counter_id if @counter_id != 0
  1416.     return 0 if @battler.current_action == nil or @battler.current_action.item == nil
  1417.     return 0 if @battler.current_action.item.is_a?(RPG::Item)
  1418.     return @battler.current_action.item.id
  1419.   end
  1420.   #--------------------------------------------------------------------------
  1421.   # ● スキルのタイプを取得
  1422.   #--------------------------------------------------------------------------
  1423.   def skill_type
  1424.     return 0 if skill_id == 0
  1425.     return $data_skills[skill_id].stype_id
  1426.   end
  1427.   #--------------------------------------------------------------------------
  1428.   # ● スキル名を取得
  1429.   #--------------------------------------------------------------------------
  1430.   def skill_name
  1431.     return "" if skill_id == 0
  1432.     return $data_skills[skill_id].name
  1433.   end
  1434.   #--------------------------------------------------------------------------
  1435.   # ● アイテムIDを取得
  1436.   #--------------------------------------------------------------------------
  1437.   def item_id
  1438.     return 0 if @battler.current_action == nil or @battler.current_action.item == nil
  1439.     return @battler.current_action.item.id
  1440.   end
  1441.   #--------------------------------------------------------------------------
  1442.   # ● 攻撃アクション
  1443.   #--------------------------------------------------------------------------
  1444.   def attack_action(item)
  1445.     return skill_action if item.is_a?(RPG::Skill)
  1446.     return item_action
  1447.   end
  1448.   #--------------------------------------------------------------------------
  1449.   # ● ダメージアクションベース
  1450.   #--------------------------------------------------------------------------
  1451.   def damage_action_base(item)
  1452.     @damage_skill_id = 0
  1453.     @damage_item_id = 0
  1454.     @damage_skill_id = item.id if item.is_a?(RPG::Skill)
  1455.     @damage_item_id = item.id if item.is_a?(RPG::Item)
  1456.   end  
  1457.   #--------------------------------------------------------------------------
  1458.   # ● ダメージアクション
  1459.   #--------------------------------------------------------------------------
  1460.   def damage_action(attacker, item)
  1461.     damage_action_base(item)
  1462.     act = damage(attacker)
  1463.     return if @active
  1464.     start_action(act) if act != nil
  1465.   end
  1466.   #--------------------------------------------------------------------------
  1467.   # ● 回避アクション
  1468.   #--------------------------------------------------------------------------
  1469.   def evasion_action(attacker, item)
  1470.     damage_action_base(item)
  1471.     act = evasion(attacker)
  1472.     return if @active
  1473.     start_action(act) if act != nil
  1474.   end
  1475.   #--------------------------------------------------------------------------
  1476.   # ● ミスアクション
  1477.   #--------------------------------------------------------------------------
  1478.   def miss_action(attacker, item)
  1479.     damage_action_base(item)
  1480.     act = miss(attacker)
  1481.     return if @active
  1482.     start_action(act) if act != nil
  1483.   end
  1484.   #--------------------------------------------------------------------------
  1485.   # ● 閃きスクリプト併用処理
  1486.   #--------------------------------------------------------------------------
  1487.   def flash_action
  1488.     return "閃き"
  1489.   end
  1490.  
  1491. end
  1492.  
  1493.  
  1494. #==============================================================================
  1495. # ■ module N03
  1496. #------------------------------------------------------------------------------
  1497. #  サイドビューバトルのモジュールです。
  1498. #==============================================================================
  1499. module N03
  1500.   #--------------------------------------------------------------------------
  1501.   # ● バトラーの敵グループを取得
  1502.   #--------------------------------------------------------------------------
  1503.   def self.get_enemy_unit(battler)
  1504.     return $game_troop if battler.actor?
  1505.     return $game_party
  1506.   end
  1507.   #--------------------------------------------------------------------------
  1508.   # ● バトラーの味方グループを取得
  1509.   #--------------------------------------------------------------------------
  1510.   def self.get_party_unit(battler)
  1511.     return $game_party if battler.actor?
  1512.     return $game_troop
  1513.   end
  1514.   #--------------------------------------------------------------------------
  1515.   # ● 戦闘アニメ時間の取得
  1516.   #--------------------------------------------------------------------------
  1517.   def self.get_anime_time(anime_id)
  1518.     return 0 if anime_id <= 0
  1519.     return $data_animations[anime_id].frame_max * 4
  1520.   end
  1521.   #--------------------------------------------------------------------------
  1522.   # ● 攻撃アニメの取得
  1523.   #--------------------------------------------------------------------------
  1524.   def self.get_attack_anime_id(kind, battler)
  1525.     return $data_skills[battler.sv.counter_id].animation_id if kind == -3 && battler.sv.counter_id != 0
  1526.     case kind
  1527.     when -1 ; anime_id = battler.atk_animation_id1
  1528.     when -2 ; anime_id = battler.atk_animation_id2
  1529.     when -3
  1530.       if battler.current_action != nil
  1531.         anime_id = battler.current_action.item.animation_id if battler.current_action.item != nil
  1532.       end
  1533.     else    ; anime_id = kind
  1534.     end
  1535.     case anime_id
  1536.     when -1 ; anime_id = battler.atk_animation_id1
  1537.     when -2 ; anime_id = battler.atk_animation_id2
  1538.     end
  1539.     return anime_id if anime_id
  1540.     return 0
  1541.   end  
  1542.   #--------------------------------------------------------------------------
  1543.   # ● 戦闘アニメデータをセット
  1544.   #--------------------------------------------------------------------------
  1545.   def self.set_damage_anime_data(targets, target, data)
  1546.     return if !first_of_all_screen_anime(data[0], target, targets)
  1547.     target.animation_id         = data[0]
  1548.     target.animation_mirror     = data[1]
  1549.     target.sv.anime_no_mirror   = data[2]
  1550.     target.sv.anime_camera_zoom = data[3]
  1551.     target.sv.anime_plus_z      = data[4]
  1552.   end   
  1553.   #--------------------------------------------------------------------------
  1554.   # ● ターゲットの取得
  1555.   #--------------------------------------------------------------------------
  1556.   def self.get_targets(kind, battler)
  1557.     case kind.abs
  1558.     when 0 ; return [battler].dup
  1559.     when 1 ; return battler.sv.target_battler.dup
  1560.     when 2 ; return get_enemy_unit(battler).members.dup
  1561.     when 3 ; return get_party_unit(battler).members.dup
  1562.     when 4 ; return $game_troop.members.dup + $game_party.battle_members.dup
  1563.     when 5 ; return battler.sv.second_targets.dup
  1564.     end
  1565.   end  
  1566.   #--------------------------------------------------------------------------
  1567.   # ● ターゲットの座標を取得
  1568.   #--------------------------------------------------------------------------
  1569.   def self.get_targets_position(targets, horming, m_a = nil)
  1570.     return [0,0,0] if targets == nil && !$sv_camera.mirror
  1571.     return [Graphics.width,0,0] if targets == nil && $sv_camera.mirror
  1572.     x = y = h = 0
  1573.     for i in 0...targets.size
  1574.       x += targets[i].sv.base_x if !horming
  1575.       y += targets[i].sv.base_y if !horming
  1576.       h += targets[i].sv.base_h if !horming
  1577.       x += targets[i].sv.x if horming
  1578.       y += targets[i].sv.y if horming
  1579.       h += targets[i].sv.h if horming
  1580.       y -= targets[i].sv.ch * 100 if m_a == 0
  1581.       y -= targets[i].sv.ch * 50 if m_a == 1
  1582.     end
  1583.     return [x / targets.size, y / targets.size, h / targets.size]
  1584.   end
  1585.   #--------------------------------------------------------------------------
  1586.   # ● 速度を時間に変換
  1587.   #--------------------------------------------------------------------------
  1588.   def self.distanse_calculation(time, target_position, self_position, distanse_move)
  1589.     return time if !distanse_move
  1590.     distanse_x = self_position[0] - target_position[0]
  1591.     distanse_x = target_position[0] - self_position[0] if target_position[0] > self_position[0]
  1592.     distanse_y = self_position[1] - target_position[1]
  1593.     distanse_y = target_position[1] - self_position[1] if target_position[1] > self_position[1]
  1594.     if self_position[2] != nil && target_position[2] != nil
  1595.       distanse_h = self_position[2] - target_position[2]
  1596.       distanse_h = target_position[2] - self_position[2] if target_position[2] > self_position[2]
  1597.     else
  1598.       distanse_h = 0
  1599.     end
  1600.     distanse = [distanse_x, distanse_y, distanse_h].max
  1601.     return distanse / (time * 100) + 1
  1602.   end
  1603.   #--------------------------------------------------------------------------
  1604.   # ● 放物線移動計算
  1605.   #--------------------------------------------------------------------------
  1606.   def self.parabola(data, time, size, type = 1)
  1607.     move_data = data
  1608.     move_data[0] *= size
  1609.     move_data[1] *= size
  1610.     move = []
  1611.     move_d = []
  1612.     for i in 0...time / 2
  1613.       move[i] = move_data[0]
  1614.       move_d[i] = move_data[1]
  1615.       move_data[0] = move_data[0] * type / (1 + type)
  1616.       move_data[1] = move_data[1] * type / (1 + type)
  1617.     end
  1618.     move = move + move_d.reverse!
  1619.     move.reverse!
  1620.     adjust = move.inject(0) {|result, item| result + item }
  1621.     move[move.size - 1] += adjust if data[0] == data[1] && adjust != 0
  1622.     move.unshift(0) if time % 2 != 0
  1623.     return move
  1624.   end
  1625.   #--------------------------------------------------------------------------
  1626.   # ● 反転値
  1627.   #--------------------------------------------------------------------------
  1628.   def self.mirror_num(mirror)
  1629.     return 1 if !mirror
  1630.     return -1
  1631.   end  
  1632.   #--------------------------------------------------------------------------
  1633.   # ● カメラワーク
  1634.   #--------------------------------------------------------------------------
  1635.   def self.camera(battler, data)
  1636.     battler = $game_party.battle_members[0] if !battler
  1637.     cx = data[2][0] * 100
  1638.     cy = data[2][1] * 100
  1639.     return $sv_camera.move(cx, cy, data[3], data[4], true) if data[1] == 6
  1640.     targets = self.get_targets(data[1], battler)
  1641.     return if targets == nil or targets == []
  1642.     position = self.get_targets_position(targets, true)
  1643.     $sv_camera.move(position[0], position[1] - position[2], data[3], data[4], false)
  1644.   end
  1645.   #--------------------------------------------------------------------------
  1646.   # ● コラプス禁止
  1647.   #--------------------------------------------------------------------------
  1648.   def self.immortaling
  1649.     # 全員に不死身付与
  1650.     for member in $game_party.battle_members + $game_troop.members
  1651.       # イベント操作等で不死身設定になっていたら解除を無効にするフラグを立てる
  1652.       member.sv.immortal = true if member.state?(N03::IMMORTAL_ID)
  1653.       member.add_state(N03::IMMORTAL_ID)
  1654.     end
  1655.     return true
  1656.   end  
  1657.   #--------------------------------------------------------------------------
  1658.   # ● コラプス許可
  1659.   #--------------------------------------------------------------------------
  1660.   def self.unimmortaling
  1661.     # 全員の不死身化解除(イベント等で不死身設定がされていれば除く)
  1662.     for member in $game_party.battle_members + $game_troop.members
  1663.       next if member.dead?
  1664.       # 不死身ステートが行動中に解除されていた場合、解除無効を解除
  1665.       member.sv.immortal = false if !member.state?(N03::IMMORTAL_ID) && member.sv.immortal
  1666.       next member.sv.immortal = false if member.sv.immortal
  1667.       member.remove_state(N03::IMMORTAL_ID)
  1668.       next if member.hp != 0
  1669.       member.add_state(1)
  1670.       member.perform_collapse_effect
  1671.       member.sv.action_terminate
  1672.     end
  1673.     return false
  1674.   end  
  1675.   #--------------------------------------------------------------------------
  1676.   # ● スキル派生
  1677.   #--------------------------------------------------------------------------
  1678.   def self.derived_skill(battler)
  1679.     battler.force_action(battler.sv.derivation_skill_id, -2)
  1680.     BattleManager.unshift_action_battlers(battler)
  1681.   end
  1682.   #--------------------------------------------------------------------------
  1683.   # ● ダメージの作成
  1684.   #--------------------------------------------------------------------------
  1685.   def self.set_damage(battler, hp_damage, mp_damage)
  1686.     battler.result.hp_damage = hp_damage
  1687.     battler.result.mp_damage = mp_damage
  1688.   end
  1689.   #--------------------------------------------------------------------------
  1690.   # ● ターゲット生死確認
  1691.   #--------------------------------------------------------------------------
  1692.   def self.targets_alive?(targets)
  1693.     return false if targets == []
  1694.     for target in targets do return true if !target.dead? end
  1695.     return false
  1696.   end
  1697.   #--------------------------------------------------------------------------
  1698.   # ● ターゲットをセカンドターゲットへ
  1699.   #--------------------------------------------------------------------------
  1700.   def self.s_targets(battler)
  1701.     battler.sv.target_battler = battler.sv.second_targets
  1702.     return battler.sv.second_targets
  1703.   end  
  1704.   #--------------------------------------------------------------------------
  1705.   # ● セカンドターゲットをターゲットへ
  1706.   #--------------------------------------------------------------------------
  1707.   def self.targets_set(battler)
  1708.     battler.sv.second_targets = battler.current_action.make_targets.compact
  1709.     battler.sv.target_battler = battler.sv.second_targets
  1710.   end  
  1711.   #--------------------------------------------------------------------------
  1712.   # ● 戦闘アニメ実行判定 (対象:画面時は最初のターゲットのみアニメ実行)
  1713.   #--------------------------------------------------------------------------
  1714.   def self.first_of_all_screen_anime(anime_id, target, targets)
  1715.     anime = $data_animations[anime_id]
  1716.     return false if !anime
  1717.     return true if anime.position != 3
  1718.     return false if anime.position == 3 && target != targets[0]
  1719.     targets.delete(target)
  1720.     target.sv.timing_targets = targets
  1721.     return true
  1722.   end
  1723.   #--------------------------------------------------------------------------
  1724.   # ● 戦闘不能付加攻撃か
  1725.   #--------------------------------------------------------------------------
  1726.   def self.dead_attack?(battler, item)
  1727.     for state in battler.atk_states
  1728.       return true if state == battler.death_state_id
  1729.     end
  1730.     for effect in item.effects
  1731.       return true if effect.code == 21 && effect.data_id == battler.death_state_id
  1732.     end
  1733.     return false
  1734.   end
  1735. end
  1736.  
  1737. #==============================================================================
  1738. # ■ Sprite_Weapon
  1739. #------------------------------------------------------------------------------
  1740. #  ウエポン表示用のスプライトです。
  1741. #==============================================================================
  1742. class Sprite_Weapon < Sprite_Base
  1743.   #--------------------------------------------------------------------------
  1744.   # ● 公開インスタンス変数 
  1745.   #--------------------------------------------------------------------------
  1746.   attr_reader   :index                       # ウエポン画像配列のインデックス
  1747.   attr_reader   :battler                     # 画像が参照しているバトラー
  1748.   attr_reader   :move_time                   # 画像が目標に到達するまでの時間
  1749.   attr_reader   :through                     # 貫通フラグ
  1750.   attr_reader   :action_end                  # 武器アクション終了フラグ
  1751.   attr_reader   :action_end_cancel                  # 武器アクション終了フラグ
  1752.   attr_reader   :hit_position                # 画像が目標に到達した時の座標
  1753.   attr_accessor :hit_anime_id                # 画像が目標に到達した時のアニメID
  1754.   #--------------------------------------------------------------------------
  1755.   # ● オブジェクト初期化
  1756.   #--------------------------------------------------------------------------
  1757.   def initialize(viewport, index, battler)
  1758.     super(viewport)
  1759.     @index = index
  1760.     @battler = battler
  1761.     @position_x = @position_y = 0
  1762.     @o = 0
  1763.     @real_x = @real_y = 0
  1764.     @mirror = @battler.sv.mirror
  1765.     reset
  1766.     set_action
  1767.   end
  1768.   #--------------------------------------------------------------------------
  1769.   # ● 初期化
  1770.   #--------------------------------------------------------------------------
  1771.   def reset
  1772.     @z_plus = 0
  1773.     @weapon_data = []
  1774.     @move_data = []
  1775.     @move_x = 0
  1776.     @move_y = 0
  1777.     @orbit = []
  1778.     @through = false
  1779.     @distanse_move = false
  1780.     @weapon_width = 0
  1781.     @weapon_height = 0
  1782.     @anime_time = 0
  1783.     @anime_position = 1
  1784.     @move_time = 0
  1785.     @hit_anime_id = 0
  1786.     @move_anime = true
  1787.     @action_end = false
  1788.     @action_end_cancel = false
  1789.     reset_position
  1790.   end  
  1791.   #--------------------------------------------------------------------------
  1792.   # ● アクションをセット
  1793.   #--------------------------------------------------------------------------
  1794.   def set_action
  1795.     return if @battler.sv.effect_data == []
  1796.     weapon_anime if @battler.sv.effect_data[0][0] == "wp"
  1797.     move_anime if @battler.sv.effect_data[0][0] == "m_a"
  1798.     @battler.sv.effect_data.shift
  1799.   end
  1800.   #--------------------------------------------------------------------------
  1801.   # ● 武器アニメ実行
  1802.   #--------------------------------------------------------------------------
  1803.   def weapon_anime
  1804.     @weapon_data = @battler.sv.effect_data[0].dup
  1805.     set_graphics
  1806.     set_ox
  1807.     set_weapon_move
  1808.   end
  1809.   #--------------------------------------------------------------------------
  1810.   # ● アニメ移動実行
  1811.   #--------------------------------------------------------------------------
  1812.   def move_anime
  1813.     @move_data = @battler.sv.effect_data[0].dup
  1814.     # ターゲットを取得
  1815.     @target_battler = [@battler.sv.m_a_targets.shift]
  1816.     @target_battler = N03.get_targets(@move_data[3], @battler) if @move_data[3] < 0
  1817.     set_move
  1818.     return if @move_data[16] == ""
  1819.     weapon_data = N03::ACTION[@move_data[16]]
  1820.     return if weapon_data == nil
  1821.     @weapon_data = weapon_data.dup
  1822.     set_graphics
  1823.     set_ox
  1824.     set_weapon_move
  1825.   end
  1826.   #--------------------------------------------------------------------------
  1827.   # ● 武器画像を取得
  1828.   #--------------------------------------------------------------------------  
  1829.   def set_graphics
  1830.     # 武器に依存しない画像設定がある場合
  1831.     if @weapon_data[13] != ""
  1832.       self.bitmap = Cache.character(@weapon_data[13]).dup
  1833.       @weapon_width = self.bitmap.width
  1834.       @weapon_height = self.bitmap.height
  1835.       return
  1836.     end
  1837.     # 武器を取得
  1838.     weapon = @battler.weapons[0]
  1839.     # 逆手装備を取得
  1840.     if @weapon_data[10]
  1841.       weapon = nil
  1842.       for armor in @battler.armors do break weapon = armor if armor.is_a?(RPG::Armor) && armor.etype_id == 1 end
  1843.       weapon = @battler.weapons[1] if !weapon
  1844.     end  
  1845.     # 武器がなければ処理をキャンセル
  1846.     return if weapon == nil
  1847.     # インデックスを取得
  1848.     file_index = @weapon_data[12]
  1849.     # アイコンを利用するなら
  1850.     if @weapon_data[1] == 0
  1851.       icon_index = weapon.icon_index
  1852.       self.bitmap = Cache.system("Iconset" + file_index).dup
  1853.       self.src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1854.       @weapon_width = @weapon_height = 24
  1855.     # 独自画像指定
  1856.     else
  1857.       file_name = @battler.sv.weapon_graphic(weapon.id, weapon.wtype_id) if weapon.is_a?(RPG::Weapon)
  1858.       file_name = @battler.sv.shield_graphic(weapon.id, weapon.atype_id) if weapon.is_a?(RPG::Armor)
  1859.       self.bitmap = Cache.character(file_name + file_index).dup
  1860.       @weapon_width = self.bitmap.width
  1861.       @weapon_height = self.bitmap.height
  1862.       return if @weapon_data[1] == 1
  1863.       # 2003仕様の武器アニメ
  1864.       @weapon_width /= @battler.sv.max_pattern[0]
  1865.     end
  1866.   end
  1867.   #--------------------------------------------------------------------------
  1868.   # ● 画像の原点を取得
  1869.   #--------------------------------------------------------------------------  
  1870.   def set_ox
  1871.     # 反転時は設定を逆に
  1872.     if @mirror
  1873.       case @weapon_data[6]
  1874.       when 1 ; @weapon_data[6] = 2 # 左上→右上に
  1875.       when 2 ; @weapon_data[6] = 1 # 右上→左上に
  1876.       when 3 ; @weapon_data[6] = 4 # 左下→右下に
  1877.       when 4 ; @weapon_data[6] = 3 # 右下→左下に
  1878.       end
  1879.     end
  1880.     # 原点を設定
  1881.     case @weapon_data[6]
  1882.     when 0 # 中心
  1883.       self.ox = @weapon_width / 2
  1884.       self.oy = @weapon_height / 2
  1885.     when 1 # 左上
  1886.       self.ox = 0
  1887.       self.oy = 0
  1888.     when 2 # 右上
  1889.       self.ox = @weapon_width
  1890.       self.oy = 0
  1891.     when 3 # 左下
  1892.       self.ox = 0
  1893.       self.oy = @weapon_height
  1894.     when 4 # 右下
  1895.       self.ox = @weapon_width
  1896.       self.oy = @weapon_height
  1897.     when 5 # バトラーと同じ
  1898.       self.ox = @weapon_width / 2
  1899.       self.oy = @weapon_height
  1900.     end
  1901.   end  
  1902.   #--------------------------------------------------------------------------
  1903.   # ● バトラーの座標を取得
  1904.   #--------------------------------------------------------------------------  
  1905.   def set_battler_position
  1906.     @position_x = @battler.sv.x + @weapon_data[3][0] * N03.mirror_num(@mirror) * 100
  1907.     @position_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust) + @weapon_data[3][1] * 100
  1908.     reset_position
  1909.   end
  1910.   #--------------------------------------------------------------------------
  1911.   # ● 座標を初期化
  1912.   #--------------------------------------------------------------------------  
  1913.   def reset_position
  1914.     @real_x = @position_x / 100
  1915.     @real_y = @position_y / 100
  1916.     @real_zoom_x = 1
  1917.     @real_zoom_y = 1
  1918.   end
  1919.   #--------------------------------------------------------------------------
  1920.   # ● 戦闘アニメを表示
  1921.   #--------------------------------------------------------------------------  
  1922.   def set_animation(anime_id)
  1923.     return if $data_animations[anime_id] == nil
  1924.     @anime_position = $data_animations[anime_id].position
  1925.     @horming = true
  1926.     @horming = false if @anime_position == 3
  1927.     @anime_camera_zoom = true
  1928.     @anime_no_mirror = false
  1929.     start_animation($data_animations[anime_id], @mirror)
  1930.     timings = $data_animations[anime_id].timings
  1931.   end
  1932.   #--------------------------------------------------------------------------
  1933.   # ● ヒット時の戦闘アニメ実行
  1934.   #--------------------------------------------------------------------------  
  1935.   def set_hit_animation(position_data, hit_anime_id, target)
  1936.     return if $data_animations[hit_anime_id] == nil
  1937.     @real_x = position_data[0]
  1938.     @real_y = position_data[1]
  1939.     @position_x = position_data[0] * 100
  1940.     @position_y = position_data[1] * 100
  1941.     self.z = position_data[2]
  1942.     @z_plus = 1000
  1943.     @action_end = false
  1944.     @horming = true
  1945.     set_animation(hit_anime_id)
  1946.     @anime_time = $data_animations[hit_anime_id].frame_max * 4
  1947.     @timing_targets = [target]
  1948.     @move_time = @hit_anime_id = 0
  1949.     @weapon_data = []
  1950.   end
  1951.   #--------------------------------------------------------------------------
  1952.   # ● タイミングバトラー追加
  1953.   #--------------------------------------------------------------------------  
  1954.   def timing_battler_set(target)
  1955.     @timing_targets.push(target)
  1956.   end
  1957.   #--------------------------------------------------------------------------
  1958.   # ● 武器の動きを取得
  1959.   #--------------------------------------------------------------------------  
  1960.   def set_weapon_move
  1961.     # 開始位置を取得
  1962.     set_battler_position if @move_time == 0
  1963.     @z_plus = 50 if @z_plus == 0 && @weapon_data[9]
  1964.     self.z = @battler.sv.z + @z_plus
  1965.     # 反転処理
  1966.     @mirror = !@mirror if @weapon_data[7]
  1967.     self.mirror = @mirror
  1968.     # 更新パターンをセット
  1969.     set_pattern
  1970.     @max_pattern = 2 if @max_pattern == 1
  1971.     # 動きを計算
  1972.     @weapon_move_data = []
  1973.     @weapon_angle_data = []
  1974.     @weapon_zoom_data = []
  1975.     num = N03.mirror_num(@mirror)
  1976.     for i in 0...@max_pattern
  1977.       move_data_x = @weapon_data[2][0] * num * 100 * i / (@max_pattern - 1)
  1978.       move_data_y = @weapon_data[2][1] * 100 * i / (@max_pattern - 1)
  1979.       move_angle = @weapon_data[4] * num + (@weapon_data[5] * num - @weapon_data[4] * num) * i / (@max_pattern - 1)
  1980.       move_zoom_x = 1 + (@weapon_data[8][0] - 1) * i / (@max_pattern - 1)
  1981.       move_zoom_y = 1 + (@weapon_data[8][1] - 1) * i / (@max_pattern - 1)
  1982.       @weapon_move_data.push([move_data_x, move_data_y])
  1983.       @weapon_angle_data.push(move_angle)
  1984.       @weapon_zoom_data.push([move_zoom_x, move_zoom_y])
  1985.     end
  1986.   end  
  1987.   #--------------------------------------------------------------------------
  1988.   # ● 更新パターン
  1989.   #--------------------------------------------------------------------------
  1990.   def set_pattern
  1991.     if @weapon_data[11] == -1
  1992.       return @max_pattern = @battler.sv.max_pattern[0] if @battler.sv.pattern_type != 0
  1993.       @count = @battler.sv.pattern_time
  1994.       @max_count = @battler.sv.pattern_time
  1995.       @max_pattern = @battler.sv.max_pattern[0]
  1996.       @repeat = false
  1997.     else
  1998.       @count = @weapon_data[11][0]
  1999.       @max_count = @weapon_data[11][0]
  2000.       @max_pattern = @weapon_data[11][1]
  2001.       @repeat = @weapon_data[11][2]
  2002.     end
  2003.     @pattern = 0
  2004.   end
  2005.   #--------------------------------------------------------------------------
  2006.   # ● 移動実行
  2007.   #--------------------------------------------------------------------------
  2008.   def set_move
  2009.     # 戦闘アニメを取得
  2010.     set_animation(@move_data[1][0]) if $data_animations[@move_data[1][0]] != nil && $data_animations[@move_data[1][0]].position != 3
  2011.     @anime_camera_zoom = @move_data[13]
  2012.     @loop = @move_data[14]
  2013.     @loop = false if @move_data[1][0] == 0
  2014.     @anime_no_mirror = @move_data[15]
  2015.     @se_flag = @move_data[17]
  2016.     # 開始位置を取得
  2017.     start_position
  2018.     @z_plus = 1000 if @move_data[9]
  2019.     # ターゲットバトラー画像にこのアニメのSEとタイミング設定を反映させる
  2020.     @timing_targets = @target_battler
  2021.     # 座標計算
  2022.     @move_x = @move_data[5][0] * 100 * N03.mirror_num(@mirror)
  2023.     @move_y = @move_data[5][1] * 100
  2024.     # 時間計算か速度計算か
  2025.     @distanse_move = true if @move_data[6] > 0
  2026.     @move_time = @move_data[6].abs
  2027.     # 時間0の場合、アニメが設定されていればアニメ表示時間に合わせる
  2028.     if @move_time == 0
  2029.       @move_time = $data_animations[@move_data[1][0]].frame_max * 4 if $data_animations[@move_data[1][0]]
  2030.       @move_time = 1 if !$data_animations[@move_data[1][0]]
  2031.       @distanse_move = false
  2032.     end
  2033.     # 貫通タイプの場合
  2034.     @through = true if @move_data[7] == 1
  2035.     @auto_through_flag = false
  2036.     @auto_through_flag = true if @move_data[7] == 0
  2037.     # ターゲット座標計算
  2038.     if @target_battler == nil
  2039.       @target_x = @move_x * 100
  2040.       @target_x = (Graphics.width - @move_x) * 100 if @mirror
  2041.       @target_y = @move_y * 100
  2042.     else
  2043.       move_data_set
  2044.     end
  2045.     # ターゲットに到達するまでの時間を計算
  2046.     @move_time = distanse_calculation(@move_time, @target_x, @target_y)
  2047.     # 円軌道計算
  2048.     orbit
  2049.     # バトラーのウエイト設定
  2050.     @battler.sv.wait = @move_time - 1 if @move_data[10][0]
  2051.     @move_horming = @move_data[12]
  2052.   end  
  2053.   #--------------------------------------------------------------------------
  2054.   # ● 速度を時間に変換
  2055.   #--------------------------------------------------------------------------
  2056.   def distanse_calculation(time, target_x, target_y)
  2057.     return time if !@distanse_move
  2058.     distanse_x = @position_x - @target_x
  2059.     distanse_x = @target_x - @position_x if @target_x > @position_x
  2060.     distanse_y = @position_y - @target_y
  2061.     distanse_y = @target_y - @position_y if @target_y > @position_y
  2062.     distanse = [distanse_x, distanse_y].max
  2063.     return distanse / (time * 100) + 1
  2064.   end
  2065.   #--------------------------------------------------------------------------
  2066.   # ● 移動目標の更新
  2067.   #--------------------------------------------------------------------------
  2068.   def move_data_set
  2069.     return if @target_battler == nil
  2070.     position = N03.get_targets_position(@target_battler, true, @anime_position)
  2071.     @target_x = position[0] + @move_x
  2072.     @target_y = position[1] - position[2] + @move_y
  2073.   end
  2074.   #--------------------------------------------------------------------------
  2075.   # ● 開始位置を計算
  2076.   #--------------------------------------------------------------------------
  2077.   def start_position
  2078.     starter = [@battler.sv.m_a_starter.shift]
  2079.     starter = N03.get_targets(@move_data[2], @battler) if @move_data[2] < 0
  2080.     position = [0, 0]
  2081.     position = N03.get_targets_position(starter, true, @anime_position) if starter != nil
  2082.     @position_x = position[0] + @move_data[4][0] * 100
  2083.     @position_y = position[1] + position[2] + @move_data[4][1] * 100
  2084.     @position_z = @position_y
  2085.   end  
  2086.   #--------------------------------------------------------------------------
  2087.   # ● 円軌道計算
  2088.   #--------------------------------------------------------------------------
  2089.   def orbit
  2090.     orbit_data = @move_data[8].dup
  2091.     orbit_data[0] *= 100
  2092.     orbit_data[1] *= 100
  2093.     orbit_d = []
  2094.     for i in 0...@move_time / 2
  2095.       @orbit[i] = orbit_data[0]
  2096.       orbit_data[0] /= 2
  2097.       orbit_d[i] = orbit_data[1]
  2098.       orbit_data[1] /= 2
  2099.     end
  2100.     @orbit = @orbit + orbit_d.reverse!
  2101.     @orbit.reverse!
  2102.   end  
  2103.   #--------------------------------------------------------------------------
  2104.   # ● フレーム更新
  2105.   #--------------------------------------------------------------------------
  2106.   def update
  2107.     update_hit_anime if @anime_time != 0
  2108.     update_move if @move_time != 0
  2109.     update_weapon_move if @weapon_data != []
  2110.     update_position
  2111.     update_color
  2112.     self.visible = @battler.sv.weapon_visible
  2113.     super
  2114.   end
  2115.   #--------------------------------------------------------------------------
  2116.   # ● ヒット時の戦闘アニメ
  2117.   #--------------------------------------------------------------------------
  2118.   def update_hit_anime
  2119.     @anime_time -= 1
  2120.     @action_end = true if @anime_time == 0
  2121.   end
  2122.   #--------------------------------------------------------------------------
  2123.   # ● 移動の更新
  2124.   #--------------------------------------------------------------------------
  2125.   def update_move
  2126.     move_data_set if @move_horming && !@hit_position
  2127.     through_set(@move_time, @target_x, @target_y) if @move_time == 1 && !@hit_position
  2128.     @o += @orbit[@move_time - 1] if @orbit[@move_time - 1] != nil
  2129.     @position_x = (@position_x * (@move_time - 1) + @target_x) / @move_time
  2130.     @position_y = (@position_y * (@move_time - 1) + @target_y) / @move_time + @o
  2131.     reset_position
  2132.     set_animation(@move_data[1][0]) if @loop && !animation?
  2133.     @move_time -= 1
  2134.     return if @move_time != 0
  2135.     @action_end = true if !@action_end_cancel
  2136.   end
  2137.   #--------------------------------------------------------------------------
  2138.   # ● 武器の動きを更新
  2139.   #--------------------------------------------------------------------------
  2140.   def update_weapon_move
  2141.     pattern = update_pattern
  2142.     set_battler_position if @move_time == 0 && !@action_end_cancel
  2143.     @real_x = @position_x / 100 + @weapon_move_data[pattern][0] / 100
  2144.     @real_y = @position_y / 100 + @weapon_move_data[pattern][1] / 100
  2145.     @real_zoom_x = @weapon_zoom_data[pattern][0]
  2146.     @real_zoom_y = @weapon_zoom_data[pattern][1]
  2147.     self.angle = @weapon_angle_data[pattern]
  2148.     self.src_rect.set(@weapon_width * pattern, 0, @weapon_width, @weapon_height) if @weapon_data[1] == 2
  2149.   end
  2150.   #--------------------------------------------------------------------------
  2151.   # ● パターンを更新
  2152.   #--------------------------------------------------------------------------
  2153.   def update_pattern
  2154.     return @battler.sv.pattern_w if @count == nil
  2155.     @count -= 1
  2156.     return @pattern if @count != 0
  2157.     @count = @max_count
  2158.     @pattern += 1
  2159.     if !@repeat && @pattern == @max_pattern
  2160.       @pattern = @max_pattern - 1
  2161.     elsif @pattern == @max_pattern
  2162.       @pattern = 0
  2163.     end
  2164.     return @pattern
  2165.   end
  2166.   #--------------------------------------------------------------------------
  2167.   # ● 座標を更新
  2168.   #--------------------------------------------------------------------------
  2169.   def update_position
  2170.     self.x = (@real_x - $sv_camera.x) * $sv_camera.convert / 1000
  2171.     self.y = (@real_y - $sv_camera.y) * $sv_camera.convert / 1000
  2172.     self.x += $sv_camera.sx / 100 unless @battler.sv.h != 0 && @weapon_data != []
  2173.     self.y += $sv_camera.sy / 100 unless @battler.sv.h != 0 && @weapon_data != []
  2174.     self.z = @battler.sv.z + @z_plus - 10
  2175.     self.zoom_x = @real_zoom_x * $sv_camera.zoom
  2176.     self.zoom_y = @real_zoom_y * $sv_camera.zoom
  2177.     self.opacity = @battler.sv.opacity if @battler.sv.opacity_data[4]
  2178.   end
  2179.   #--------------------------------------------------------------------------
  2180.   # ● 貫通の処理
  2181.   #--------------------------------------------------------------------------
  2182.   def through_set(time, target_x, target_y)
  2183.     @hit_anime_id = N03.get_attack_anime_id(@move_data[1][1], @battler)
  2184.     @battler.sv.wait = N03.get_anime_time(@hit_anime_id) if @move_data[10][1]
  2185.     moving_x = (target_x / 100 - @position_x / 100) / time
  2186.     moving_y = (target_y / 100 - @position_y / 100) / time
  2187.     goal_x = $sv_camera.max_left - 100 if moving_x < 0
  2188.     goal_x = Graphics.width + $sv_camera.max_right + 100 if moving_x > 0
  2189.     goal_y = $sv_camera.max_top - 100 if moving_y < 0
  2190.     goal_y = Graphics.height + $sv_camera.max_bottom + 100 if moving_y > 0
  2191.     if goal_x == nil &&  goal_y == nil
  2192.       time = 0
  2193.       reset_position
  2194.     else
  2195.       time = move_calculation(moving_x, moving_y, goal_x, goal_y)
  2196.     end
  2197.     target_x = @position_x + moving_x * time * 100
  2198.     target_y = @position_y + moving_y * time * 100
  2199.     @pre_data = [time, target_x, target_y]
  2200.     @battler.sv.m_a_data.push([@move_data[11], @target_battler, @index, @auto_through_flag, []])
  2201.     @action_end_cancel = true
  2202.     @hit_position = [@real_x, @real_y, self.z]
  2203.   end  
  2204.   #--------------------------------------------------------------------------
  2205.   # ● 到達時間試算
  2206.   #--------------------------------------------------------------------------
  2207.   def move_calculation(moving_x, moving_y, goal_x, goal_y)
  2208.     move_x = @position_x / 100
  2209.     move_y = @position_y / 100
  2210.     time = 0
  2211.     loop do
  2212.       move_x += moving_x
  2213.       move_y += moving_y
  2214.       time += 1
  2215.       return time if moving_x < 0 && move_x < goal_x
  2216.       return time if moving_x > 0 && move_x > goal_x
  2217.       return time if moving_y < 0 && move_y < goal_y
  2218.       return time if moving_y > 0 && move_y > goal_y
  2219.     end
  2220.   end   
  2221.   #--------------------------------------------------------------------------
  2222.   # ● ミス時に消える処理から貫通処理に変換
  2223.   #--------------------------------------------------------------------------
  2224.   def through_change
  2225.     @action_end_cancel = false
  2226.     @through = true
  2227.     @move_time = @pre_data[0]
  2228.     @target_x = @pre_data[1]
  2229.     @target_y = @pre_data[2]
  2230.     @pre_data = nil
  2231.   end  
  2232.   #--------------------------------------------------------------------------
  2233.   # ● SE とフラッシュのタイミング処理
  2234.   #--------------------------------------------------------------------------
  2235.   def animation_process_timing(timing)
  2236.     return if !@timing_targets
  2237.     se_flag = true
  2238.     se_flag = @se_flag if @se_flag != nil
  2239.     for target in @timing_targets
  2240.       target.sv.timing.push([se_flag, timing.dup])
  2241.       se_flag = false if @animation.position == 3
  2242.     end  
  2243.   end
  2244.   #--------------------------------------------------------------------------
  2245.   # ● 色調の更新
  2246.   #--------------------------------------------------------------------------
  2247.   def update_color
  2248.     return if @battler.sv.color == []
  2249.     self.color.set(@battler.sv.color[0], @battler.sv.color[1], @battler.sv.color[2], @battler.sv.color[3])
  2250.   end
  2251.   #--------------------------------------------------------------------------
  2252.   # ● 解放
  2253.   #--------------------------------------------------------------------------
  2254.   def dispose
  2255.     super
  2256.     self.bitmap.dispose if self.bitmap != nil
  2257.   end
  2258. end
  2259.  
  2260. #==============================================================================
  2261. # ■ Sprite_Battle_Picture
  2262. #------------------------------------------------------------------------------
  2263. #  ピクチャ表示用のスプライトです。
  2264. #==============================================================================
  2265. class Sprite_Battle_Picture < Sprite
  2266.   #--------------------------------------------------------------------------
  2267.   # ● 公開インスタンス変数 
  2268.   #--------------------------------------------------------------------------
  2269.   attr_accessor   :action_end           # 終了フラグ
  2270.   #--------------------------------------------------------------------------
  2271.   # ● オブジェクト初期化
  2272.   #--------------------------------------------------------------------------
  2273.   def initialize(viewport = nil)
  2274.     super(viewport)
  2275.     @action_end = false
  2276.     self.ox = 0
  2277.   end
  2278.   #--------------------------------------------------------------------------
  2279.   # ● セット
  2280.   #--------------------------------------------------------------------------
  2281.   def set(battler)
  2282.     @battler = battler
  2283.     @data = @battler.sv.effect_data.shift
  2284.     @time = @data[4]
  2285.     @mirror = $sv_camera.mirror
  2286.     @mirror = false if !@data[8]
  2287.     self.opacity = @data[6][0]
  2288.     @s_x = @data[2][0] if @data[2] != []
  2289.     @s_x = Graphics.width - @data[2][0]  if @data[2] != [] && @mirror
  2290.     @s_y = @data[2][1] if @data[2] != []
  2291.     @e_x = @data[3][0] if @data[3] != []
  2292.     @e_x = Graphics.width - @data[3][0] if @data[3] != [] && @mirror
  2293.     @e_y = @data[3][1] if @data[3] != []
  2294.     @s_x = self.x if @data[2] == []
  2295.     @s_y = self.y if @data[2] == []
  2296.     @e_x = self.x if @data[3] == []
  2297.     @e_y = self.y if @data[3] == []
  2298.     self.x = @s_x
  2299.     self.y = @s_y
  2300.     return @action_end = true if @time == 0
  2301.     @move_x = (@e_x * 1.0 - @s_x) / @time
  2302.     @move_y = (@e_y * 1.0 - @s_y) / @time
  2303.     self.z = @data[5]
  2304.     return set_plane(battler) if @data[7] != []
  2305.     self.bitmap = Cache.picture(@data[9]) if !bitmap or @data[9] != ""
  2306.     return @action_end = true if !bitmap
  2307.     self.mirror = @mirror
  2308.     self.ox = self.bitmap.width if @mirror
  2309.   end
  2310.   #--------------------------------------------------------------------------
  2311.   # ● プレーン移行
  2312.   #--------------------------------------------------------------------------
  2313.   def set_plane(battler)
  2314.     @viewport = Viewport.new(@data[2][0],@data[2][1],@data[7][0],@data[7][1]) if !@viewport
  2315.     viewport = @viewport
  2316.     @plane = Plane.new(viewport) if !@plane
  2317.     @plane.bitmap = Cache.picture(@data[9]) if !@plane.bitmap or @data[9] != ""
  2318.     return @action_end = true if !@plane.bitmap
  2319.     @plane.ox = @data[7][0]
  2320.     @plane.oy = @data[7][1]
  2321.     @plane.opacity = @data[6][0]
  2322.     @move_x = @remain_move[0] if @data[2] == @data[3]
  2323.     @move_y = @remain_move[1] if @data[2] == @data[3]
  2324.     @remain_move = [@move_x, @move_y]
  2325.   end
  2326.   #--------------------------------------------------------------------------
  2327.   # ● フレーム更新
  2328.   #--------------------------------------------------------------------------
  2329.   def update
  2330.     @action_end = true if !@battler.sv.picture
  2331.     return if @time == 0
  2332.     return if @action_end
  2333.     @time -= 1
  2334.     return plane_update if @plane
  2335.     super
  2336.     self.x += @move_x
  2337.     self.y += @move_y
  2338.     self.opacity += @data[6][1]
  2339.     return if @time != 1
  2340.     self.x = @e_x
  2341.     self.y = @e_y
  2342.     @time = 0
  2343.   end
  2344.   #--------------------------------------------------------------------------
  2345.   # ● フレーム更新
  2346.   #--------------------------------------------------------------------------
  2347.   def plane_update
  2348.     @plane.ox += @move_x
  2349.     @plane.oy += @move_y
  2350.     @plane.opacity += @data[6][1]
  2351.     @time = @data[4] if @time == 0
  2352.   end
  2353.   #--------------------------------------------------------------------------
  2354.   # ● 解放
  2355.   #--------------------------------------------------------------------------
  2356.   def dispose
  2357.     bitmap.dispose if bitmap
  2358.     @plane.dispose if @plane
  2359.     @viewport.dispose if @viewport
  2360.     super
  2361.   end
  2362. end
  2363.  
  2364. #==============================================================================
  2365. # ■ Sprite_Back_Picture
  2366. #------------------------------------------------------------------------------
  2367. #  周期ピクチャ用のスプライトです。
  2368. #==============================================================================
  2369. class Sprite_Back_Picture < Plane
  2370.   #--------------------------------------------------------------------------
  2371.   # ● 公開インスタンス変数 
  2372.   #--------------------------------------------------------------------------
  2373.   attr_accessor   :action_end           # 終了フラグ
  2374.   #--------------------------------------------------------------------------
  2375.   # ● オブジェクト初期化
  2376.   #--------------------------------------------------------------------------
  2377.   def initialize(viewport = nil, index)
  2378.     super(viewport)
  2379.     @index = index
  2380.     @real_x = 0
  2381.     @real_y = 0
  2382.     @real_opacity = 0
  2383.     @move_x = 0
  2384.     @move_y = 0
  2385.     @move_opacity = 0
  2386.     @time = 0
  2387.     @switche = 0
  2388.     @action_end = false
  2389.   end
  2390.   #--------------------------------------------------------------------------
  2391.   # ● セットアップ
  2392.   #--------------------------------------------------------------------------
  2393.   def setup(data)
  2394.     self.bitmap = Cache.picture(data[9])
  2395.     self.z = data[6]
  2396.     @switche = data[1]
  2397.     mirror = $sv_camera.mirror
  2398.     mirror = false if !data[8]
  2399.     @move_x = data[3][0]
  2400.     @move_x *= -1 if mirror
  2401.     @move_y = data[3][1]
  2402.     @time = data[4]
  2403.     @time = -1 if @time == 0
  2404.     @real_opacity = (data[5][0] + 1) * 100
  2405.     @move_opacity = data[5][1]
  2406.     @start_opacity = data[5][0]
  2407.     @shake_ok = data[7]
  2408.   end
  2409.   #--------------------------------------------------------------------------
  2410.   # ● フレーム更新
  2411.   #--------------------------------------------------------------------------
  2412.   def update
  2413.     update_picture if @time != 0
  2414.     self.ox = $sv_camera.x - @real_x
  2415.     self.oy = $sv_camera.y - @real_y
  2416.     if @shake_ok
  2417.       self.ox -= $sv_camera.sx / 100
  2418.       self.oy -= $sv_camera.sy / 100
  2419.     end
  2420.     self.ox *= $sv_camera.zoom
  2421.     self.oy *= $sv_camera.zoom
  2422.     self.zoom_x = @zoom_x * $sv_camera.zoom
  2423.     self.zoom_y = @zoom_y * $sv_camera.zoom
  2424.     self.opacity = @real_opacity / 100
  2425.     @move_opacity *= -1 if self.opacity == 255 or self.opacity <= @start_opacity
  2426.     @switche
  2427.     @action_end = true if @switche > 0 && !$game_switches[@switche]
  2428.     @action_end = true if @switche < 0 && !$sv_camera.switches[@switche.abs]
  2429.   end
  2430.   #--------------------------------------------------------------------------
  2431.   # ● ピクチャの更新
  2432.   #--------------------------------------------------------------------------
  2433.   def update_picture
  2434.     @real_x += @move_x / 100
  2435.     @real_y += @move_y / 100
  2436.     @real_x = 0 if @real_x >= self.bitmap.width or @real_x <= -self.bitmap.width
  2437.     @real_y = 0 if @real_y >= self.bitmap.height or @real_y <= -self.bitmap.height
  2438.     @zoom_x = 1
  2439.     @zoom_y = 1
  2440.     @real_opacity += @move_opacity
  2441.     @time -= 1
  2442.     @time = -1 if @time < -100
  2443.   end
  2444. end
  2445.  
  2446. #==============================================================================
  2447. # ■ Sprite_Back_Picture
  2448. #------------------------------------------------------------------------------
  2449. #  ダメージ表示のスプライトです。
  2450. #==============================================================================
  2451. class Sprite_Damage < Sprite
  2452.   #--------------------------------------------------------------------------
  2453.   # ● 公開インスタンス変数 
  2454.   #--------------------------------------------------------------------------
  2455.   attr_reader   :action_end                  # POP終了フラグ
  2456.   #--------------------------------------------------------------------------
  2457.   # ● オブジェクト初期化
  2458.   #--------------------------------------------------------------------------
  2459.   def initialize(viewport = nil, battler)
  2460.     super(viewport)
  2461.     @battler = battler
  2462.     @time = 0
  2463.     return @action_end = true if !@battler
  2464.     @direction = -1
  2465.     @direction *= -1 if @battler.actor?
  2466.     @direction *= -1 if $sv_camera.mirror
  2467.     set_state
  2468.     set_damage
  2469.     update
  2470.   end
  2471.   #--------------------------------------------------------------------------
  2472.   # ● ステート表示
  2473.   #--------------------------------------------------------------------------
  2474.   def set_state
  2475.     return if !N03::STATE_POP
  2476.     states = @battler.result.added_state_objects
  2477.     states.delete($data_states[@battler.death_state_id]) if @battler.result.hp_damage != 0
  2478.     return if states == []
  2479.     return if @battler.sv.add_state == @battler.result.added_state_objects
  2480.     @battler.sv.add_state = states.dup
  2481.     @st = []
  2482.     @st_base = []
  2483.     for i in 0...states.size
  2484.       @st[i] = Sprite.new
  2485.       bitmap_state(@st[i], states[i])
  2486.       @st_base[i] = []
  2487.       @st_base[i][0] = @direction * (-20 + 5 * i) + @battler.sv.x / 100
  2488.       @st_base[i][1] = -40 - @state_height * i + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100
  2489.       @st[i].z = 1000 + i
  2490.       @st[i].opacity = 0
  2491.     end
  2492.     @time = @pop_time = 80
  2493.   end   
  2494.   #--------------------------------------------------------------------------
  2495.   # ● ステート画像
  2496.   #--------------------------------------------------------------------------
  2497.   def bitmap_state(state, state_object)
  2498.     name = state_object.name
  2499.     state.bitmap = Cache.system("Iconset").dup
  2500.     state.src_rect.set(state_object.icon_index % 16 * 24, state_object.icon_index / 16 * 24, 24, 24)
  2501.     @state_height = 24
  2502.   end
  2503.   #--------------------------------------------------------------------------
  2504.   # ● ダメージ表示
  2505.   #--------------------------------------------------------------------------
  2506.   def hit_count
  2507.     for i in [email]0...@battler.sv.hit.size[/email]
  2508.       if @battler.sv.hit[i] == nil
  2509.         @hit = i
  2510.         return @battler.sv.hit[i] = @hit
  2511.       end
  2512.     end
  2513.     @hit = @battler.sv.hit.size
  2514.     @battler.sv.hit.push(@hit)
  2515.   end  
  2516.   #--------------------------------------------------------------------------
  2517.   # ● ダメージ表示
  2518.   #--------------------------------------------------------------------------
  2519.   def set_damage
  2520.     return @action_end = true if !N03::DAMAGE_POP
  2521.     damage = @battler.result.hp_damage if @battler.result.hp_damage != 0
  2522.     damage = @battler.result.hp_drain  if @battler.result.hp_drain  != 0
  2523.     damage = @battler.result.mp_damage if @battler.result.mp_damage != 0
  2524.     damage = @battler.result.mp_drain  if @battler.result.mp_drain  != 0
  2525.     damage = @battler.result.tp_damage if @battler.result.tp_damage != 0
  2526.     if !damage or damage == 0
  2527.       @action_end = true if @st == nil
  2528.       return # ステートだけPOPする設定を考慮して@action_endは返さない
  2529.     end
  2530.     hit_count
  2531.     #@hit = @battler.sv.hit
  2532.     #@battler.sv.hit += 1 if damage != 0
  2533.     file = N03::DAMAGE_PLUS if damage > 0
  2534.     file = N03::DAMAGE_MINUS if damage < 0
  2535.     add_file = N03::DAMAGE_MP if @battler.result.mp_damage != 0
  2536.     add_file = N03::DAMAGE_TP if @battler.result.tp_damage != 0
  2537.     adjust_x = N03::DAMAGE_ADJUST
  2538.     @num = []
  2539.     @num_base = []
  2540.     damage = damage.abs
  2541.     max_num = damage.to_s.size
  2542.     max_num += 1 if add_file != nil
  2543.     for i in 0...max_num
  2544.       @num[i] = Sprite.new
  2545.       if add_file != nil && i == max_num - 1
  2546.         @num[i].bitmap = Cache.system(add_file)
  2547.         cw = (damage % (10 * 10 ** i))/(10 ** i)
  2548.         sw = 0 if sw == nil
  2549.       else
  2550.         @num[i].bitmap = Cache.system(file)
  2551.         cw = (damage % (10 * 10 ** i))/(10 ** i)
  2552.         sw = @num[i].bitmap.width / 10
  2553.         @num[i].src_rect.set(cw * sw, 0, sw, @num[i].bitmap.height)
  2554.       end
  2555.       @num_base[i] = []
  2556.       @num_base[i][0] = (sw + adjust_x) * i * -1 + (@battler.sv.x / 100)
  2557.       @num_base[i][1] =  -(@num[i].bitmap.height / 3) - i * 2 - @hit * 2 + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100
  2558.       @num_base[i][0] -= @num[i].bitmap.width / 2 - adjust_x if add_file != nil && i == max_num - 1
  2559.       @num[i].z = 1000 + i + @hit * 10
  2560.     end
  2561.     @time = @pop_time = 80
  2562.   end
  2563.   #--------------------------------------------------------------------------
  2564.   # ● フレーム更新
  2565.   #--------------------------------------------------------------------------
  2566.   def update
  2567.     return if @time == 0
  2568.     for i in [email]0...@st.size[/email] do update_state_move(@st[i], i) end if @st != nil
  2569.     for i in [email]0...@num.size[/email] do update_num_move(@num[i], i) end if @num != nil
  2570.     @time -= 1
  2571.     @action_end = true if @time == 0
  2572.   end
  2573.   #--------------------------------------------------------------------------
  2574.   # ● ステート画像の更新
  2575.   #--------------------------------------------------------------------------
  2576.   def update_state_move(state, index)
  2577.     min = @pop_time - index * 2
  2578.     case @time
  2579.     when min-15..min
  2580.       @st_base[index][0] += @direction
  2581.       state.opacity += 25
  2582.     when min-80..min-50
  2583.       @st_base[index][0] += @direction
  2584.       state.opacity -= 25
  2585.     end
  2586.     state.x = (@st_base[index][0] - $sv_camera.x) * $sv_camera.zoom
  2587.     state.y = (@st_base[index][1] - $sv_camera.y) * $sv_camera.zoom
  2588.   end
  2589.   #--------------------------------------------------------------------------
  2590.   # ● 数値の更新
  2591.   #--------------------------------------------------------------------------
  2592.   def update_num_move(num, index)
  2593.     min = @pop_time - index * 2
  2594.     case @time
  2595.     when min-1..min
  2596.       @num_base[index][0] += @direction * @hit
  2597.       @num_base[index][1] -= 5 + @hit * 2
  2598.     when min-3..min-2
  2599.       @num_base[index][0] += @direction * @hit
  2600.       @num_base[index][1] -= 4 + @hit * 2
  2601.     when min-6..min-4
  2602.       @num_base[index][0] += @direction
  2603.       @num_base[index][1] -= 3 + @hit * 2
  2604.     when min-14..min-7
  2605.       @num_base[index][0] += @direction
  2606.       @num_base[index][1] += 2
  2607.     when min-17..min-15
  2608.       @num_base[index][1] -= 2 + @hit * 2
  2609.     when min-23..min-18
  2610.       @num_base[index][1] += 1
  2611.     when min-27..min-24
  2612.       @num_base[index][1] -= 1
  2613.     when min-30..min-28
  2614.       @num_base[index][1] += 1
  2615.     when min-33..min-31
  2616.       @num_base[index][1] -= 1
  2617.     when min-36..min-34
  2618.       @num_base[index][1] += 1
  2619.     end
  2620.     num.x = (@num_base[index][0] - $sv_camera.x) * $sv_camera.zoom
  2621.     num.y = (@num_base[index][1] - $sv_camera.y) * $sv_camera.zoom
  2622.     num.opacity = 256 - (12 - @time) * 32
  2623.     num.visible = false if @time == 0
  2624.   end
  2625.   #--------------------------------------------------------------------------
  2626.   # ● 解放
  2627.   #--------------------------------------------------------------------------
  2628.   def dispose
  2629.     @battler.sv.hit[@hit] = nil if @hit
  2630.     bitmap.dispose if bitmap
  2631.     for i in [email]0...@num.size[/email] do @num[i].dispose end if @num != nil
  2632.     for i in [email]0...@st.size[/email] do @st[i].dispose end if @st != nil
  2633.     super
  2634.   end
  2635. end
  2636.  
  2637. #==============================================================================
  2638. # ■ Window_Skill_name
  2639. #------------------------------------------------------------------------------
  2640. #  スキル名を表示するウィンドウです。
  2641. #==============================================================================
  2642. class Window_Skill_name < Window_Base
  2643.   #--------------------------------------------------------------------------
  2644.   # ● オブジェクト初期化
  2645.   #--------------------------------------------------------------------------
  2646.   def initialize(text)
  2647.     super(0, 0, Graphics.width, line_height + standard_padding * 2)
  2648.     draw_text(4, 0, Graphics.width - 64, line_height,text, 1)
  2649.   end
  2650. end
  2651.  
  2652. #==============================================================================
  2653. # ■ Spriteset_Sideview
  2654. #------------------------------------------------------------------------------
  2655. #  サイドビュー独自のスプライトをまとめたクラスです。
  2656. #==============================================================================
  2657. class Spriteset_Sideview
  2658.   #--------------------------------------------------------------------------
  2659.   # ● オブジェクト初期化
  2660.   #--------------------------------------------------------------------------
  2661.   def initialize(viewport)
  2662.     @viewport = viewport
  2663.     @weapons = []
  2664.     @pictures = []
  2665.     @back_pic = []
  2666.     @damage = []
  2667.     $sv_camera.setup
  2668.     N03.camera(nil, N03::BATTLE_CAMERA["回合开始前"].dup)
  2669.   end
  2670.   #--------------------------------------------------------------------------
  2671.   # ● フレーム更新
  2672.   #--------------------------------------------------------------------------
  2673.   def update
  2674.     update_battler_data
  2675.     update_damage
  2676.     update_pictures
  2677.     update_back_pic
  2678.     update_weapons
  2679.   end  
  2680.   #--------------------------------------------------------------------------
  2681.   # ● バトラーデータの更新
  2682.   #--------------------------------------------------------------------------
  2683.   def update_battler_data
  2684.     for battler in $game_party.battle_members + $game_troop.members
  2685.       weapon_end(battler) if battler.sv.weapon_end
  2686.       next if battler.sv.effect_data == []
  2687.       for effect_data in battler.sv.effect_data do set_effects(battler, effect_data) end
  2688.     end
  2689.   end
  2690.   #--------------------------------------------------------------------------
  2691.   # ● ダメージ画像の更新
  2692.   #--------------------------------------------------------------------------
  2693.   def update_damage
  2694.     for i in [email]0...@damage.size[/email]
  2695.       next if @damage[i] == nil
  2696.       @damage[i].update if @damage[i] != nil
  2697.       next if !@damage[i].action_end
  2698.       @damage[i].dispose
  2699.       @damage[i] = nil
  2700.     end
  2701.   end
  2702.   #--------------------------------------------------------------------------
  2703.   # ● ピクチャアクションの更新
  2704.   #--------------------------------------------------------------------------
  2705.   def update_pictures
  2706.     for i in [email]0...@pictures.size[/email]
  2707.       next if @pictures[i] == nil
  2708.       @pictures[i].update if @pictures[i] != nil
  2709.       next if !@pictures[i].action_end
  2710.       @pictures[i].dispose
  2711.       @pictures[i] = nil
  2712.     end
  2713.   end
  2714.   #--------------------------------------------------------------------------
  2715.   # ● 周期ピクチャの更新
  2716.   #--------------------------------------------------------------------------
  2717.   def update_back_pic
  2718.     set_back_pic if $sv_camera.program_picture != []
  2719.     for i in [email]0...@back_pic.size[/email]
  2720.       next if @back_pic[i] == nil
  2721.       @back_pic[i].update if @back_pic[i] != nil
  2722.       next if !@back_pic[i].action_end
  2723.       @back_pic[i].dispose
  2724.       @back_pic[i] = nil
  2725.     end
  2726.   end
  2727.   #--------------------------------------------------------------------------
  2728.   # ● 武器アクションの更新
  2729.   #--------------------------------------------------------------------------
  2730.   def update_weapons
  2731.     for i in [email]0...@weapons.size[/email]
  2732.       next if @weapons[i] == nil
  2733.       @weapons[i].update if @weapons[i] != nil
  2734.       next if !@weapons[i].action_end
  2735.       @weapons[i].dispose
  2736.       @weapons[i] = nil
  2737.     end
  2738.   end
  2739.   #--------------------------------------------------------------------------
  2740.   # ● ダメージ実行
  2741.   #--------------------------------------------------------------------------
  2742.   def set_damage_pop(target)
  2743.     for i in [email]0...@damage.size[/email]
  2744.       next if @damage[i] != nil
  2745.       return @damage[i] = Sprite_Damage.new(@viewport, target)
  2746.     end
  2747.     @damage.push(Sprite_Damage.new(@viewport, target))
  2748.   end
  2749.   #--------------------------------------------------------------------------
  2750.   # ● 周期ピクチャ実行
  2751.   #--------------------------------------------------------------------------
  2752.   def set_back_pic
  2753.     for data in $sv_camera.program_picture
  2754.       if @back_pic[data[2]] != nil
  2755.         @back_pic[data[2]].dispose
  2756.         @back_pic[data[2]] = nil
  2757.       end
  2758.       @back_pic[data[2]] = Sprite_Back_Picture.new(@viewport, data[2])
  2759.       @back_pic[data[2]].setup(data)
  2760.     end
  2761.     $sv_camera.program_picture = []
  2762.   end
  2763.   #--------------------------------------------------------------------------
  2764.   # ● エフェクト開始
  2765.   #--------------------------------------------------------------------------
  2766.   def set_effects(battler, effect_data)
  2767.     case effect_data[0]
  2768.     when "pic" ; set_pictures(battler, effect_data)
  2769.     when  "wp" ; set_weapons(battler,  true)
  2770.     when "m_a" ; set_weapons(battler, false)
  2771.     end
  2772.   end
  2773.   #--------------------------------------------------------------------------
  2774.   # ● ピクチャアクション実行
  2775.   #--------------------------------------------------------------------------
  2776.   def set_pictures(battler, effect_data)
  2777.     @pictures[effect_data[1]] = Sprite_Battle_Picture.new if @pictures[effect_data[1]] == nil
  2778.     @pictures[effect_data[1]].set(battler)
  2779.   end
  2780.   #--------------------------------------------------------------------------
  2781.   # ● 武器アクション実行
  2782.   #--------------------------------------------------------------------------
  2783.   def set_weapons(battler, weapon_flag, test = true)
  2784.     for i in [email]0...@weapons.size[/email]
  2785.       next if @weapons[i] != nil
  2786.       @weapons[i] = Sprite_Weapon.new(@viewport, i, battler)
  2787.       battler.sv.weapon_index.push(i) if weapon_flag
  2788.       return i
  2789.     end
  2790.     @weapons.push(Sprite_Weapon.new(@viewport, @weapons.size, battler))
  2791.     battler.sv.weapon_index.push(@weapons.size - 1) if weapon_flag
  2792.     return @weapons.size - 1
  2793.   end
  2794.   #--------------------------------------------------------------------------
  2795.   # ● バトラーの武器アクション終了
  2796.   #--------------------------------------------------------------------------
  2797.   def weapon_end(battler)
  2798.     battler.sv.weapon_end = false
  2799.     for index in battler.sv.weapon_index
  2800.       weapon_index = battler.sv.weapon_index.shift
  2801.       @weapons[weapon_index].dispose if @weapons[weapon_index] != nil
  2802.       @weapons[weapon_index] = nil
  2803.     end
  2804.     battler.sv.weapon_index.compact!
  2805.   end  
  2806.   #--------------------------------------------------------------------------
  2807.   # ● ヒット時の戦闘アニメ実行
  2808.   #--------------------------------------------------------------------------
  2809.   def set_hit_animation(battler, weapon_index, hit_targets, miss)
  2810.     weapon = @weapons[weapon_index]
  2811.     for target in hit_targets
  2812.       next @weapons[@hit_index].timing_battler_set(target) if @hit_index != nil
  2813.       @hit_index = set_weapons(battler, false, false)
  2814.       @weapons[@hit_index].set_hit_animation(weapon.hit_position, weapon.hit_anime_id, target)
  2815.     end
  2816.     @hit_index = nil
  2817.     if !weapon.through && !miss
  2818.       @weapons[weapon_index].dispose
  2819.       @weapons[weapon_index] = nil
  2820.     else
  2821.       @weapons[weapon_index].through_change
  2822.     end
  2823.   end
  2824.   #--------------------------------------------------------------------------
  2825.   # ● サイドビューデータの初期化
  2826.   #--------------------------------------------------------------------------
  2827.   def reset_sideview
  2828.     $sv_camera.reset
  2829.     for member in $game_troop.members + $game_party.battle_members do member.sv.reset end
  2830.   end  
  2831.   #--------------------------------------------------------------------------
  2832.   # ● 解放
  2833.   #--------------------------------------------------------------------------
  2834.   def dispose
  2835.     dispose_effects(@weapons)
  2836.     dispose_effects(@pictures)
  2837.     dispose_effects(@back_pic)
  2838.     dispose_effects(@damage)
  2839.     reset_sideview
  2840.   end
  2841.   #--------------------------------------------------------------------------
  2842.   # ● エフェクト画像の解放
  2843.   #--------------------------------------------------------------------------
  2844.   def dispose_effects(effects)
  2845.     for i in 0...effects.size
  2846.       effects[i].dispose if effects[i] != nil
  2847.       effects[i] = nil
  2848.     end
  2849.   end
  2850. end
  2851.  
  2852.  
  2853. #==============================================================================
  2854. # ■ Sprite_Battle_Back
  2855. #------------------------------------------------------------------------------
  2856. #  戦闘背景用のスプライトです。
  2857. #==============================================================================
  2858. class Sprite_Battle_Back < Plane
  2859.   #--------------------------------------------------------------------------
  2860.   # ● オブジェクト初期化
  2861.   #--------------------------------------------------------------------------
  2862.   def initialize(viewport = nil, index, battleback_name)
  2863.     super(viewport)
  2864.     @index = index
  2865.     if @index == 1
  2866.       data = N03::FLOOR1_DATA[battleback_name]
  2867.       data = N03::FLOOR1_DATA["全Battlebacks1"] if data == nil
  2868.     elsif @index == 2
  2869.       data = N03::FLOOR2_DATA[battleback_name]
  2870.       data = N03::FLOOR2_DATA["全Battlebacks2"] if data == nil
  2871.     end   
  2872.     data = data.dup
  2873.     @adjust_position = data[0]
  2874.     @zoom_x = data[1][0] / 100.0
  2875.     @zoom_y = data[1][1] / 100.0
  2876.     @shake_on = data[2]
  2877.     $game_switches[data[3]] = true if data[3] > 0
  2878.     $sv_camera.switches[data[3].abs] = true if data[3] < 0
  2879.     reset_scroll
  2880.     reset_back_data(battleback_name)
  2881.   end
  2882.   #--------------------------------------------------------------------------
  2883.   # ● 背景スクロールを初期化
  2884.   #--------------------------------------------------------------------------
  2885.   def reset_scroll
  2886.     @scroll_x = 0
  2887.     @scroll_y = 0
  2888.     @move_x = 0
  2889.     @move_y = 0
  2890.   end
  2891.   #--------------------------------------------------------------------------
  2892.   # ● 背景データを初期化
  2893.   #--------------------------------------------------------------------------
  2894.   def reset_back_data(battleback_name)
  2895.     @back_data = []
  2896.     @active_data = ["scroll",0, @move_x, @move_y, false, battleback_name,""]
  2897.     start_back_data(@active_data)
  2898.   end  
  2899.   #--------------------------------------------------------------------------
  2900.   # ● 背景画像のセッティング
  2901.   #--------------------------------------------------------------------------
  2902.   def set_graphics(new_bitmap)
  2903.     self.bitmap = new_bitmap
  2904.     @base_x = (self.bitmap.width * @zoom_x - Graphics.width) / 2 + @adjust_position[0]
  2905.     @base_y = (self.bitmap.height * @zoom_y - Graphics.height) / 2 + @adjust_position[1]
  2906.     # 限界座標を取得
  2907.     max_top =  0
  2908.     max_bottom = self.bitmap.height * @zoom_y - Graphics.height
  2909.     max_left = 0
  2910.     max_right = self.bitmap.width * @zoom_x - Graphics.width
  2911.     exist = true
  2912.     exist = false if self.bitmap.height == 32 && self.bitmap.width == 32
  2913.     $sv_camera.setting(@index, [max_top, max_bottom, max_left, max_right, @base_x, @base_y,exist])
  2914.   end
  2915.   #--------------------------------------------------------------------------
  2916.   # ● フレーム更新
  2917.   #--------------------------------------------------------------------------
  2918.   def update
  2919.     return if !bitmap
  2920.     update_back_data
  2921.     update_scroll unless @move_x == 0 && @move_y == 0
  2922.     update_color
  2923.     update_position
  2924.     update_back_adjust if @bt_back != nil
  2925.     create_back_adjust if @bt_back == nil && !@active_data[10] && @scroll_x == 0 && @scroll_y == 0
  2926.   end
  2927.   #--------------------------------------------------------------------------
  2928.   # ● 背景データを更新
  2929.   #--------------------------------------------------------------------------
  2930.   def update_back_data
  2931.     delete = true if @active_data[1] > 0 && !$game_switches[@active_data[1]]
  2932.     delete = true if @active_data[1] < 0 && !$sv_camera.switches[@active_data[1].abs]
  2933.     return if !delete
  2934.     for i in [email]0...@back_data.size[/email]
  2935.       @back_data[i] = nil if @back_data[i][1] > 0 && !$game_switches[@back_data[i][1]]
  2936.       @back_data[i] = nil if @back_data[i][1] < 0 && !$sv_camera.switches[@back_data[i][1].abs]
  2937.     end
  2938.     @back_data.compact!
  2939.     next_back_data
  2940.   end
  2941.   #--------------------------------------------------------------------------
  2942.   # ● 次の背景データをセット
  2943.   #--------------------------------------------------------------------------
  2944.   def next_back_data
  2945.     @back_data.delete(@active_data[11]) if @active_data[11] != nil
  2946.     @back_data.push(@active_data[11]) if @active_data[11] != nil
  2947.     @active_data = nil
  2948.     data = @back_data.pop
  2949.     @back_data = [@active_data] if @back_data.size == 0
  2950.     start_back_data(data)
  2951.   end  
  2952.   #--------------------------------------------------------------------------
  2953.   # ● 背景データを実行
  2954.   #--------------------------------------------------------------------------
  2955.   def start_back_data(data)
  2956.     return if back_data_remain(data)
  2957.     bt_back_dispose
  2958.     pre_active_data = @active_data
  2959.     @active_data[8] = [@back_name, @move_x, @move_y, @scroll_x, @scroll_y] if @active_data != nil
  2960.     @back_data.push(@active_data)     if @active_data != nil
  2961.     @active_data = data.dup
  2962.     @active_data[5] = @back_name      if @active_data[5] == ""
  2963.     @active_data[9] = set_back_adjust if @active_data[9] == nil
  2964.     back_data_scroll_on               if @active_data[8] == nil && @active_data[9][0] == false
  2965.     set_remain_back_data              if @active_data[8] != nil
  2966.     create_back(@active_data[5])      if @active_data[9][0] == false
  2967.     create_back_adjust                if @active_data[10]
  2968.     @active_data[11] = pre_active_data if pre_active_data && @active_data[7] == false
  2969.   end  
  2970.   #--------------------------------------------------------------------------
  2971.   # ● 背景データの保留
  2972.   #--------------------------------------------------------------------------
  2973.   def back_data_remain(data)
  2974.     remain = false
  2975.     remain = true if data[6] != "" && @active_data != nil && @active_data[9] != nil && @active_data[9][0] != false
  2976.     remain = true if @active_data != nil && @active_data[7] == false
  2977.     return remain if !remain
  2978.     @remain = true
  2979.     @back_data.push(data)
  2980.     return remain
  2981.   end  
  2982.   #--------------------------------------------------------------------------
  2983.   # ● 背景変更補正データをセット
  2984.   #--------------------------------------------------------------------------
  2985.   def set_back_adjust
  2986.     bt_adjust = []
  2987.     sign = -1
  2988.     if @active_data[6] == ""
  2989.       reset_scroll if @active_data[3][0] == 0 &&  @active_data[3][1] == 0
  2990.       bt_adjust = [false,false,0,0]
  2991.       return bt_adjust
  2992.     elsif @move_x != 0 or @active_data[3][0] != 0
  2993.       sign = 1 if @move_x < 0
  2994.       bt_adjust[0] = [self.bitmap.width * @zoom_x * sign, 0]
  2995.       bt_adjust[1] = [self.bitmap.width * @zoom_x * sign * 2, 0]
  2996.     elsif @move_y != 0 or @active_data[3][1] != 0
  2997.       sign = 1 if @move_y < 0
  2998.       bt_adjust[0] = [0, self.bitmap.height * @zoom_y * sign]
  2999.       bt_adjust[1] = [0, self.bitmap.height * @zoom_y * sign * 2]
  3000.     else
  3001.       reset_scroll if @active_data[3][0] == 0 &&  @active_data[3][1] == 0
  3002.       bt_adjust = [false,false,0,0]
  3003.       return bt_adjust
  3004.     end
  3005.     bt_adjust[2] = [bt_adjust[0][0], bt_adjust[0][1]]
  3006.     return bt_adjust
  3007.   end
  3008.   #--------------------------------------------------------------------------
  3009.   # ● 背景スクロールデータを実行
  3010.   #--------------------------------------------------------------------------
  3011.   def back_data_scroll_on
  3012.     mirror = $sv_camera.mirror
  3013.     mirror = false if !@active_data[4]
  3014.     @move_x = @active_data[3][0]
  3015.     @move_x *= -1 if mirror
  3016.     @move_y = @active_data[3][1]
  3017.   end
  3018.   #--------------------------------------------------------------------------
  3019.   # ● 保持している背景データを実行
  3020.   #--------------------------------------------------------------------------
  3021.   def set_remain_back_data
  3022.     return back_data_scroll_on if @move_x != 0 or @move_y != 0
  3023.     create_back(@active_data[8][0])
  3024.     @move_x    = @active_data[8][1]
  3025.     @move_y    = @active_data[8][2]
  3026.     @scroll_x  = @active_data[8][3]
  3027.     @scroll_y  = @active_data[8][4]
  3028.   end  
  3029.   #--------------------------------------------------------------------------
  3030.   # ● 背景画像の作成
  3031.   #--------------------------------------------------------------------------
  3032.   def create_back(back_name)
  3033.     return if back_name == @back_name or back_name == ""
  3034.     self.bitmap = Cache.battleback1(back_name) if @index == 1
  3035.     self.bitmap = Cache.battleback2(back_name) if @index == 2
  3036.     @back_name = back_name
  3037.   end  
  3038.   #--------------------------------------------------------------------------
  3039.   # ● 背景変更補正画像の作成
  3040.   #--------------------------------------------------------------------------
  3041.   def create_back_adjust
  3042.     return if @active_data[9][0] == false
  3043.     @active_data[10] = true
  3044.     mirror = $sv_camera.mirror
  3045.     mirror = false if !@active_data[4]
  3046.     @bt_back = []
  3047.     @bt_back[0] = Sprite.new(viewport)
  3048.     @bt_back[0].bitmap = Cache.battleback1(@active_data[6]) if @index == 1
  3049.     @bt_back[0].bitmap = Cache.battleback2(@active_data[6]) if @index == 2
  3050.     @bt_back[0].mirror = mirror
  3051.     @bt_back[1] = Sprite.new(viewport)
  3052.     @bt_back[1].bitmap = Cache.battleback1(@active_data[5]) if @index == 1
  3053.     @bt_back[1].bitmap = Cache.battleback2(@active_data[5]) if @index == 2
  3054.     @bt_back[1].mirror = mirror
  3055.   end
  3056.   #--------------------------------------------------------------------------
  3057.   # ● 背景スクロールの更新
  3058.   #--------------------------------------------------------------------------
  3059.   def update_scroll
  3060.     @scroll_x += @move_x
  3061.     @scroll_y += @move_y
  3062.     @scroll_x = 0 if @scroll_x / 100 >= self.bitmap.width * @zoom_x or @scroll_x / 100 <= -self.bitmap.width * @zoom_x
  3063.     @scroll_y = 0 if @scroll_y / 100 >= self.bitmap.height * @zoom_y or @scroll_y / 100 <= -self.bitmap.height * @zoom_y
  3064.   end
  3065.   #--------------------------------------------------------------------------
  3066.   # ● 色調変更の更新
  3067.   #--------------------------------------------------------------------------
  3068.   def update_color
  3069.     color_set if $sv_camera.color_set[@index] != nil
  3070.     return if @color_data == nil
  3071.     @color_data[4] -= 1
  3072.     if @color_data[4] == 0 && @color_data[5] != 0
  3073.       @color_data[4] = @color_data[5]
  3074.       @color_data[5] = 0
  3075.       @color_data[6] = [0,0,0,0]
  3076.     elsif @color_data[4] == 0
  3077.       @remain_color_data = @color_data
  3078.       return @color_data = nil
  3079.     end  
  3080.     for i in 0..3
  3081.       @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
  3082.     end  
  3083.     self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
  3084.   end
  3085.   #--------------------------------------------------------------------------
  3086.   # ● 座標の更新
  3087.   #--------------------------------------------------------------------------
  3088.   def update_position
  3089.     self.ox = $sv_camera.x + @base_x - @scroll_x / 100
  3090.     self.oy = $sv_camera.y + @base_y - @scroll_y / 100
  3091.     self.ox -= $sv_camera.sx / 100 if @shake_on
  3092.     self.oy -= $sv_camera.sy / 100 if @shake_on
  3093.     self.zoom_x = @zoom_x * $sv_camera.zoom
  3094.     self.zoom_y = @zoom_y * $sv_camera.zoom
  3095.     self.ox *= $sv_camera.zoom
  3096.     self.oy *= $sv_camera.zoom
  3097.     self.z = @index * 10
  3098.   end
  3099.   #--------------------------------------------------------------------------
  3100.   # ● 背景変更補正画像を更新
  3101.   #--------------------------------------------------------------------------
  3102.   def update_back_adjust
  3103.     @active_data[9][0][0] = 0 if @scroll_x == 0
  3104.     @active_data[9][0][1] = 0 if @scroll_y == 0
  3105.     @active_data[9][1][0] -= @active_data[9][2][0] if @scroll_x == 0
  3106.     @active_data[9][1][1] -= @active_data[9][2][1] if @scroll_y == 0
  3107.     for i in [email]0...@bt_back.size[/email]
  3108.       @bt_back[i].x = -self.ox + @active_data[9][i][0] * $sv_camera.zoom
  3109.       @bt_back[i].y = -self.oy + @active_data[9][i][1] * $sv_camera.zoom
  3110.       @bt_back[i].zoom_x = self.zoom_x
  3111.       @bt_back[i].zoom_y = self.zoom_y
  3112.       @bt_back[i].z = self.z + 1
  3113.       @bt_back[i].color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  3114.     end
  3115.     back_data_scroll_on if @active_data[9][0][0] == 0 && @active_data[9][0][1] == 0
  3116.     return unless @active_data[9][1][0] == 0 && @active_data[9][1][1] == 0
  3117.     bt_back_dispose
  3118.     create_back(@active_data[5])
  3119.     @active_data[9][0] = false
  3120.     next_back_data if @remain && @back_data.size != 1
  3121.     @remain = false
  3122.   end
  3123.   #--------------------------------------------------------------------------
  3124.   # ● 色調変更
  3125.   #--------------------------------------------------------------------------
  3126.   def color_set
  3127.     set = $sv_camera.color_set[@index]
  3128.     $sv_camera.color_set[@index] = nil
  3129.     set[4] = 1 if set[4] == 0
  3130.     @remain_color_data = [0,0,0,0] if @remain_color_data == nil
  3131.     @color_data = @remain_color_data
  3132.     @color_data[4] = set[4]
  3133.     @color_data[5] = set[5]
  3134.     @color_data[6] = set
  3135.   end
  3136.   #--------------------------------------------------------------------------
  3137.   # ● 背景変更補正画像の解放
  3138.   #--------------------------------------------------------------------------
  3139.   def bt_back_dispose
  3140.     for i in [email]0...@bt_back.size[/email] do @bt_back[i].dispose end if @bt_back != nil
  3141.     @bt_back = nil
  3142.   end  
  3143.   #--------------------------------------------------------------------------
  3144.   # ● 解放
  3145.   #--------------------------------------------------------------------------
  3146.   def dispose
  3147.     bitmap.dispose if bitmap
  3148.     bt_back_dispose
  3149.     super
  3150.   end
  3151. end  
  3152.  
  3153. #==============================================================================
  3154. # ■ Battle_Camera
  3155. #------------------------------------------------------------------------------
  3156. #  戦闘カメラやバトルプログラムを扱うクラスです。
  3157. #==============================================================================
  3158. class Battle_Camera
  3159.   #--------------------------------------------------------------------------
  3160.   # ● 公開インスタンス変数 
  3161.   #--------------------------------------------------------------------------
  3162.   attr_reader   :sx                 # シェイクX座標
  3163.   attr_reader   :sy                 # シェイクY座標
  3164.   attr_reader   :max_top            # 上限界座標
  3165.   attr_reader   :max_bottom         # 下限界座標
  3166.   attr_reader   :max_left           # 左限界座標
  3167.   attr_reader   :max_right          # 右限界座標
  3168.   attr_accessor :switches           # サイドビュー専用スイッチ
  3169.   attr_accessor :color_set          # 色調変更データ
  3170.   attr_accessor :wait               # 戦闘シーンの強制ウエイト
  3171.   attr_accessor :win_wait           # 戦闘勝利前のウエイト
  3172.   attr_accessor :mirror             # 画面反転フラグ
  3173.   attr_accessor :program_scroll     # バトルプログラム 背景の自動スクロール
  3174.   attr_accessor :program_picture    # バトルプログラム 周期ピクチャ
  3175.   attr_accessor :event              # コモンイベント呼び出し
  3176.   #--------------------------------------------------------------------------
  3177.   # ● オブジェクト初期化
  3178.   #--------------------------------------------------------------------------
  3179.   def initialize
  3180.     @switches = []
  3181.     @max_data = []
  3182.     @color_set = []
  3183.     @wait = 0
  3184.     @win_wait = false
  3185.     @mirror = false
  3186.     @event = false
  3187.     setup
  3188.   end
  3189.   #--------------------------------------------------------------------------
  3190.   # ● カメラX座標
  3191.   #--------------------------------------------------------------------------
  3192.   def x
  3193.     return @x / 100
  3194.   end
  3195.   #--------------------------------------------------------------------------
  3196.   # ● カメラY座標
  3197.   #--------------------------------------------------------------------------
  3198.   def y
  3199.     return @y / 100
  3200.   end
  3201.   #--------------------------------------------------------------------------
  3202.   # ● ズーム率
  3203.   #--------------------------------------------------------------------------
  3204.   def zoom
  3205.     return @zoom * 0.001
  3206.   end
  3207.   #--------------------------------------------------------------------------
  3208.   # ● ズーム率による座標変換
  3209.   #--------------------------------------------------------------------------
  3210.   def convert
  3211.     return @zoom
  3212.   end
  3213.   #--------------------------------------------------------------------------
  3214.   # ● カメラセットアップ
  3215.   #--------------------------------------------------------------------------
  3216.   def setup
  3217.     @x = 0
  3218.     @y = 0
  3219.     @sx = 0
  3220.     @sy = 0
  3221.     @zoom = 1000
  3222.     @time = 0
  3223.     @shake_time = 0
  3224.     program_setup
  3225.   end
  3226.   #--------------------------------------------------------------------------
  3227.   # ● カメラ初期化
  3228.   #--------------------------------------------------------------------------
  3229.   def reset
  3230.     @switches = []
  3231.     @max_data = []
  3232.     @color_set = []
  3233.     @wait = 0
  3234.     @win_wait = false
  3235.     @mirror = false
  3236.     program_setup(false)
  3237.   end  
  3238.   #--------------------------------------------------------------------------
  3239.   # ● バトルプログラムのセットアップ
  3240.   #--------------------------------------------------------------------------
  3241.   def program_setup(check = true)
  3242.     @played_program  = []
  3243.     @program_switch  = []
  3244.     @program_sound   = []
  3245.     @program_scroll  = []
  3246.     @program_se      = []
  3247.     @program_shake   = []
  3248.     @program_color   = []
  3249.     @program_picture = []
  3250.     @program_base = N03::BATTLE_PROGRAM.values.dup
  3251.     program_check if check
  3252.   end  
  3253.   #--------------------------------------------------------------------------
  3254.   # ● バトルプログラムのチェック
  3255.   #--------------------------------------------------------------------------
  3256.   def program_check
  3257.     for data in @program_base
  3258.       if program_start?(data) && !@played_program.include?(data)
  3259.         @played_program.push(data.dup)
  3260.         @program_scroll.push(data.dup)  if data[0] == "scroll"
  3261.         @program_picture.push(data.dup) if data[0] == "kpic"
  3262.         start_sound(data.dup)           if data[0] == "sound"
  3263.         start_program_switch(data.dup)  if data[0] == "switch"
  3264.         start_program_se(data.dup)      if data[0] == "keep_se"
  3265.         start_program_shake(data.dup)   if data[0] == "keep_sk"
  3266.         start_program_color(data.dup)   if data[0] == "keep_c"
  3267.       else
  3268.         @played_program.delete(data)  if !program_start?(data)
  3269.         @program_scroll.delete(data)  if data[0] == "scroll"
  3270.         @program_picture.delete(data) if data[0] == "kpic"
  3271.         @program_switch.delete(data)  if data[0] == "switch"
  3272.         @program_sound.delete(data)   if data[0] == "sound"
  3273.         @program_se.delete(data)      if data[0] == "keep_se"
  3274.         @program_shake.delete(data)   if data[0] == "keep_sk"
  3275.         @program_color.delete(data)   if data[0] == "keep_c"
  3276.       end
  3277.     end
  3278.   end
  3279.   #--------------------------------------------------------------------------
  3280.   # ● バトルプログラムの開始
  3281.   #--------------------------------------------------------------------------
  3282.   def program_start?(data)
  3283.     start = false
  3284.     start = true if $game_switches[data[1].abs] && data[1] > 0
  3285.     start = true if @switches[data[1].abs] && data[1] < 0
  3286.     return start
  3287.   end  
  3288.   #--------------------------------------------------------------------------
  3289.   # ● バトルプログラム スイッチ操作の開始
  3290.   #--------------------------------------------------------------------------
  3291.   def start_program_switch(data)
  3292.     data[4] = data[4] + rand(data[5] + 1)
  3293.     data[4] = 1 if data[4] <= 0
  3294.     @program_switch.push(data)
  3295.   end
  3296.   #--------------------------------------------------------------------------
  3297.   # ● スイッチ操作の更新
  3298.   #--------------------------------------------------------------------------
  3299.   def update_program_switch
  3300.     for data in @program_switch
  3301.       data[4] -= 1
  3302.       next @program_switch.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3303.       next @program_switch.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3304.       next if data[4] != 0
  3305.       for id in data[2]
  3306.         $game_switches[id] = true if id > 0
  3307.         @switches[id.abs] = true  if id < 0
  3308.       end
  3309.       for id in data[3]
  3310.         $game_switches[id] = false if id > 0
  3311.         @switches[id.abs] = false  if id < 0
  3312.       end
  3313.       @program_switch.delete(data)
  3314.       program_check
  3315.     end  
  3316.   end
  3317.   #--------------------------------------------------------------------------
  3318.   # ● バトルプログラム BGM/BGSの開始
  3319.   #--------------------------------------------------------------------------
  3320.   def start_sound(data)
  3321.     @program_sound.push(data)
  3322.     name = data[5]
  3323.     case data[2]
  3324.     when "se"
  3325.       Audio.se_play("Audio/SE/" + name, data[4], data[3])
  3326.     when "bgm"
  3327.       name = RPG::BGM.last.name if data[5] == ""
  3328.       Audio.bgm_play("Audio/BGM/" + name, data[4], data[3])
  3329.     when "bgs"
  3330.       name = RPG::BGS.last.name if data[5] == ""
  3331.       Audio.bgs_play("Audio/BGS/" + name, data[4], data[3])
  3332.     end
  3333.   end
  3334.   #--------------------------------------------------------------------------
  3335.   # ● バトルプログラム 周期SEの開始
  3336.   #--------------------------------------------------------------------------
  3337.   def start_program_se(data)
  3338.     data[3] = [data[2], data[3]]
  3339.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3340.     @program_se.push(data)
  3341.     Audio.se_play("Audio/SE/" + data[7], data[5], data[4]) if data[6]
  3342.   end
  3343.   #--------------------------------------------------------------------------
  3344.   # ● 周期SEの更新
  3345.   #--------------------------------------------------------------------------
  3346.   def update_program_se
  3347.     for data in @program_se
  3348.       data[2] -= 1
  3349.       next @program_se.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3350.       next @program_se.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3351.       next if data[2] != 0
  3352.       Audio.se_play("Audio/SE/" + data[7], data[5], data[4])
  3353.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3354.     end  
  3355.   end
  3356.   #--------------------------------------------------------------------------
  3357.   # ● バトルプログラム 周期シェイクの開始
  3358.   #--------------------------------------------------------------------------
  3359.   def start_program_shake(data)
  3360.     data[3] = [data[2], data[3]]
  3361.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3362.     @program_shake.push(data)
  3363.     shake(data[4], data[5], data[6]) if data[7]
  3364.   end
  3365.   #--------------------------------------------------------------------------
  3366.   # ● 周期シェイクの更新
  3367.   #--------------------------------------------------------------------------
  3368.   def update_program_shake
  3369.     for data in @program_shake
  3370.       data[2] -= 1
  3371.       next @program_shake.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3372.       next @program_shake.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3373.       next if data[2] != 0
  3374.       shake(data[4], data[5], data[6])
  3375.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3376.     end  
  3377.   end
  3378.   #--------------------------------------------------------------------------
  3379.   # ● バトルプログラム 周期色調変更の開始
  3380.   #--------------------------------------------------------------------------
  3381.   def start_program_color(data)
  3382.     data[3] = [data[2], data[3]]
  3383.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3384.     data[7] = true if data[4] == 0 or data[4] == 4
  3385.     case data[4]
  3386.     when 1   ;data[4] = $game_troop.members
  3387.     when 2   ;data[4] = $game_party.battle_members
  3388.     when 3,4 ;data[4] = $game_troop.members + $game_party.battle_members
  3389.     else ;data[4] = []
  3390.     end
  3391.     @program_color.push(data)
  3392.     return if !data[6]
  3393.     for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
  3394.     @color_set[1] = data[5] if data[7]
  3395.     @color_set[2] = data[5] if data[7]
  3396.   end
  3397.   #--------------------------------------------------------------------------
  3398.   # ● 周期色調変更の更新
  3399.   #--------------------------------------------------------------------------
  3400.   def update_program_color
  3401.     for data in @program_color
  3402.       data[2] -= 1
  3403.       next @program_color.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3404.       next @program_color.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3405.       next if data[2] != 0
  3406.       for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
  3407.       @color_set[1] = data[5] if data[7]
  3408.       @color_set[2] = data[5] if data[7]
  3409.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3410.     end
  3411.   end
  3412.   #--------------------------------------------------------------------------
  3413.   # ● トランジション実行
  3414.   #--------------------------------------------------------------------------
  3415.   def perform_transition(data)
  3416.     Graphics.transition(data[2], "Graphics/Pictures/" + data[3], data[1])
  3417.   end  
  3418.   #--------------------------------------------------------------------------
  3419.   # ● 背景からカメラの限界値を取得  data = [max_top, max_bottom, max_left, max_right]
  3420.   #--------------------------------------------------------------------------
  3421.   def setting(index, data)
  3422.     @max_data[index - 1] = data
  3423.     return if index != 2
  3424.     setup
  3425.     # カメラの中心座標
  3426.     @center_x     = (Graphics.width / 2 + N03::CAMERA_POSITION[0]) * 100
  3427.     @center_y     = (Graphics.height / 2 + N03::CAMERA_POSITION[1]) * 100
  3428.     # 上下左右の移動限界距離
  3429.     @max_top    = [@max_data[0][5], @max_data[1][5]].min * -1
  3430.     @max_bottom = [@max_data[0][1], @max_data[1][1]].min + @max_top
  3431.     @max_left   = [@max_data[0][4], @max_data[1][4]].min  * -1
  3432.     @max_right  = [@max_data[0][3], @max_data[1][3]].min + @max_left
  3433.     exist_data = @max_data[0] if !@max_data[1][6]
  3434.     exist_data = @max_data[1] if !@max_data[0][6]
  3435.     @max_top    = exist_data[5] * -1        if exist_data != nil
  3436.     @max_bottom = exist_data[1] + @max_top  if exist_data != nil
  3437.     @max_left   = exist_data[4] * -1        if exist_data != nil
  3438.     @max_right  = exist_data[3] + @max_left if exist_data != nil
  3439.     @max_top = @max_bottom = @max_left = @max_right = 0 if !@max_data[1][6] && !@max_data[0][6]
  3440.     @max_width    = @max_right - @max_left + Graphics.width
  3441.     @max_height   = @max_bottom - @max_top + Graphics.height
  3442.     # ズームアウト限界値
  3443.     max_zoom_x    = 100 * Graphics.width / @max_width
  3444.     max_zoom_y    = 100 * Graphics.height / @max_height
  3445.     @max_zoom_out = [max_zoom_x, max_zoom_y].max
  3446.   end
  3447.   #--------------------------------------------------------------------------
  3448.   # ● カメラ移動
  3449.   #--------------------------------------------------------------------------
  3450.   def move(target_x, target_y, zoom, time, screen = true)
  3451.     # 戦闘背景以上のサイズまでズームアウトしないよう調整
  3452.     @target_zoom = [zoom * 0.01, @max_zoom_out * 0.01].max
  3453.     target_x *= -1 if screen && @mirror
  3454.     # ズーム分の中心座標補正
  3455.     if screen && @target_zoom != 1
  3456.       target_x = target_x + @center_x
  3457.       target_y = target_y + @center_y
  3458.     end
  3459.     adjust_x = @center_x * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
  3460.     adjust_y = @center_y * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
  3461.     adjust_x = 0 if adjust_x.nan?
  3462.     adjust_y = 0 if adjust_y.nan?
  3463.     adjust_x = @center_x if !screen && adjust_x == 0
  3464.     adjust_y = @center_y if !screen && adjust_y == 0
  3465.     @target_x = target_x - adjust_x.to_i
  3466.     @target_y = target_y - adjust_y.to_i
  3467.     @target_zoom = (@target_zoom * 1000).to_i
  3468.     @zoom = @zoom.to_i
  3469.     limit_test
  3470.     # 時間0の場合は即実行
  3471.     return @time = time.abs if time != 0
  3472.     @time = 1
  3473.     update
  3474.   end
  3475.   #--------------------------------------------------------------------------
  3476.   # ● 限界座標の試算
  3477.   #--------------------------------------------------------------------------
  3478.   def limit_test
  3479.     new_width = @max_width * @target_zoom / 1000
  3480.     new_height = @max_height * @target_zoom / 1000
  3481.     new_max_right = @max_right - (@max_width - new_width)
  3482.     new_max_bottom = @max_bottom - (@max_height - new_height)
  3483.     # 画面の移動先が限界の場合、限界座標をセット
  3484.     if @target_x < @max_left * 100
  3485.       @target_x = @max_left * 100
  3486.     end
  3487.     if @target_x > new_max_right * 100
  3488.       @target_x = new_max_right * 100
  3489.     end
  3490.     if @target_y < @max_top * 100
  3491.       @target_y = @max_top * 100
  3492.     end
  3493.     if @target_y > new_max_bottom * 100
  3494.       @target_y = new_max_bottom * 100
  3495.     end
  3496.   end
  3497.   #--------------------------------------------------------------------------
  3498.   # ● 画面のシェイク
  3499.   #--------------------------------------------------------------------------
  3500.   def shake(power, speed, time)
  3501.     @shake_x = power[0] * 100
  3502.     @shake_y = power[1] * 100
  3503.     @power_time_base = @power_time = speed
  3504.     @shake_time = time
  3505.     update_shake
  3506.   end
  3507.   #--------------------------------------------------------------------------
  3508.   # ● シェイクの更新
  3509.   #--------------------------------------------------------------------------
  3510.   def update_shake
  3511.     @sx = (@sx * (@power_time - 1) + @shake_x) / @power_time
  3512.     @sy = (@sy * (@power_time - 1) + @shake_y) / @power_time
  3513.     @power_time -= 1
  3514.     @shake_time -= 1
  3515.     return @sx = @sy = 0 if @shake_time == 0
  3516.     return if @power_time != 0
  3517.     @power_time = @power_time_base
  3518.     @shake_x = @shake_x * -4 / 5
  3519.     @shake_y = @shake_y * -4 / 5
  3520.   end
  3521.   #--------------------------------------------------------------------------
  3522.   # ● フレーム更新
  3523.   #--------------------------------------------------------------------------
  3524.   def update
  3525.     update_shake if @shake_time != 0
  3526.     update_program
  3527.     return if @time == 0
  3528.     @x = (@x * (@time - 1) + @target_x) / @time
  3529.     @y = (@y * (@time - 1) + @target_y) / @time
  3530.     @zoom = (@zoom * (@time - 1) + @target_zoom) / @time
  3531.     @time -= 1
  3532.   end
  3533.   #--------------------------------------------------------------------------
  3534.   # ● フレーム更新
  3535.   #--------------------------------------------------------------------------
  3536.   def update_program
  3537.     update_program_switch if @program_switch != []
  3538.     update_program_se     if @program_se != []
  3539.     update_program_shake  if @program_shake != []
  3540.     update_program_color  if @program_color != []
  3541.   end
  3542. end
  3543.  
  3544. #==============================================================================
  3545. # ■ Scene_Battle
  3546. #------------------------------------------------------------------------------
  3547. #  バトル画面の処理を行うクラスです。
  3548. #==============================================================================
  3549. class Scene_Battle < Scene_Base
  3550.   #--------------------------------------------------------------------------
  3551.   # ● フレーム更新(基本)
  3552.   #--------------------------------------------------------------------------
  3553.   alias update_basic_scene_battle_n03 update_basic
  3554.   def update_basic
  3555.     update_basic_scene_battle_n03
  3556.     $sv_camera.update
  3557.     $sv_camera.wait = N03::TURN_END_WAIT + 1 if $sv_camera.win_wait
  3558.     camera_wait
  3559.   end
  3560.   #--------------------------------------------------------------------------
  3561.   # ● カメラウェイト
  3562.   #--------------------------------------------------------------------------
  3563.   def camera_wait
  3564.     process_event if $sv_camera.event
  3565.     $sv_camera.event = false if $sv_camera.event
  3566.     while $sv_camera.wait != 0
  3567.       Graphics.update
  3568.       Input.update
  3569.       update_all_windows
  3570.       $game_timer.update
  3571.       $game_troop.update
  3572.       $sv_camera.update
  3573.       @spriteset.update
  3574.       update_info_viewport
  3575.       update_message_open
  3576.       $sv_camera.wait -= 1 if $sv_camera.wait > 0
  3577.       $sv_camera.wait = 1 if $sv_camera.wait == 0 && @spriteset.effect?
  3578.       BattleManager.victory if $sv_camera.win_wait && $sv_camera.wait == 0
  3579.     end
  3580.   end
  3581.   #--------------------------------------------------------------------------
  3582.   # ● カメラウェイトのセット
  3583.   #--------------------------------------------------------------------------
  3584.   def set_camera_wait(time)
  3585.     $sv_camera.wait = time
  3586.     camera_wait
  3587.   end  
  3588.   #--------------------------------------------------------------------------
  3589.   # ● エフェクト実行が終わるまでウェイト ★再定義
  3590.   #--------------------------------------------------------------------------
  3591.   def wait_for_effect
  3592.   end
  3593.   #--------------------------------------------------------------------------
  3594.   # ● ターン開始
  3595.   #--------------------------------------------------------------------------
  3596.   alias turn_start_scene_battle_n03 turn_start
  3597.   def turn_start
  3598.     turn_start_scene_battle_n03
  3599.     N03.camera(nil, N03::BATTLE_CAMERA["回合开始后"].dup)
  3600.   end
  3601.   #--------------------------------------------------------------------------
  3602.   # ● ターン終了
  3603.   #--------------------------------------------------------------------------
  3604.   alias turn_end_scene_battle_n03 turn_end
  3605.   def turn_end
  3606.     turn_end_scene_battle_n03
  3607.     for member in $game_troop.members + $game_party.members
  3608.       N03.set_damage(member, member.sv.result_damage[0],member.sv.result_damage[1])
  3609.       member.sv.result_damage = [0,0]
  3610.       @spriteset.set_damage_pop(member) if member.result.hp_damage != 0 or member.result.mp_damage != 0
  3611.     end
  3612.     set_camera_wait(N03::TURN_END_WAIT)
  3613.     N03.camera(nil, N03::BATTLE_CAMERA["回合开始前"].dup) if $game_party.inputable?
  3614.     @log_window.clear
  3615.   end
  3616.   #--------------------------------------------------------------------------
  3617.   # ● スキル/アイテムの使用 ★再定義
  3618.   #--------------------------------------------------------------------------
  3619.   def use_item
  3620.     item = @subject.current_action.item
  3621.     display_item(item)
  3622.     @subject.use_item(item)
  3623.     refresh_status
  3624.     @targets = @subject.current_action.make_targets.compact
  3625.     @targets = [@subject] if @targets.size == 0
  3626.     set_substitute(item)
  3627.     for time in item.repeats.times do play_sideview(@targets, item) end
  3628.     end_reaction(item)
  3629.     display_end_item
  3630.   end
  3631.   #--------------------------------------------------------------------------
  3632.   # ● スキル/アイテム名の表示
  3633.   #--------------------------------------------------------------------------
  3634.   def display_item(item)
  3635.     return @log_window.display_use_item(@subject, item) if N03::BATTLE_LOG
  3636.     @log_window.off
  3637.     @skill_name_window = Window_Skill_name.new(item.name) unless N03::NO_DISPLAY_SKILL_ID.include?(item.id) && item.is_a?(RPG::Skill)
  3638.   end  
  3639.   #--------------------------------------------------------------------------
  3640.   # ● スキル/アイテム名の表示終了
  3641.   #--------------------------------------------------------------------------
  3642.   def display_end_item
  3643.     @skill_name_window.dispose if @skill_name_window != nil
  3644.     @skill_name_window = nil
  3645.     set_camera_wait(N03::ACTION_END_WAIT) if @subject.sv.derivation_skill_id == 0
  3646.     @log_window.clear if N03::BATTLE_LOG
  3647.   end  
  3648.   #--------------------------------------------------------------------------
  3649.   # ● 反撃/魔法反射/身代わり処理
  3650.   #--------------------------------------------------------------------------
  3651.   def end_reaction(item)
  3652.     end_substitute if @substitute != nil
  3653.     set_reflection(item) if @reflection_data != nil
  3654.     set_counter_attack if @counter_attacker != nil
  3655.   end  
  3656.   #--------------------------------------------------------------------------
  3657.   # ● 反撃の発動 ★再定義
  3658.   #--------------------------------------------------------------------------
  3659.   def invoke_counter_attack(target, item)
  3660.     return if @subject.sv.counter_id != 0
  3661.     @counter_attacker = [] if @counter_attacker == nil
  3662.     return apply_item_effects(apply_substitute(target, item), item) if !target.movable?
  3663.     @log_window.add_text(sprintf(Vocab::CounterAttack, target.name)) if N03::BATTLE_LOG
  3664.     target.sv.counter_id = target.sv.counter_skill_id
  3665.     @counter_attacker.push(target)
  3666.   end
  3667.   #--------------------------------------------------------------------------
  3668.   # ● 魔法反射の発動 ★再定義
  3669.   #--------------------------------------------------------------------------
  3670.   def invoke_magic_reflection(target, item)
  3671.     return if @subject.sv.reflection_id != 0
  3672.     @log_window.add_text(sprintf(Vocab::MagicReflection, target.name)) if N03::BATTLE_LOG
  3673.     target.sv.reflection_id = target.sv.reflection_anime_id
  3674.   end
  3675.   #--------------------------------------------------------------------------
  3676.   # ● 身代わりの適用 ★再定義
  3677.   #--------------------------------------------------------------------------
  3678.   def apply_substitute(target, item)
  3679.     return target if @substitute == nil
  3680.     return target if !check_substitute(target, item)
  3681.     return @substitute
  3682.   end
  3683.   #--------------------------------------------------------------------------
  3684.   # ● 身代わりセット
  3685.   #--------------------------------------------------------------------------
  3686.   def set_substitute(item)
  3687.     @substitute = N03.get_enemy_unit(@subject).substitute_battler
  3688.     return if @substitute == nil
  3689.     s_targets = []
  3690.     for i in [email]0...@targets.size[/email]
  3691.       next if @targets[i] == @substitute
  3692.       next if !check_substitute(@targets[i], item)
  3693.       @log_window.add_text(sprintf(Vocab::Substitute, @substitute.name, @targets[i].name))
  3694.       @targets[i].sv.start_action(@targets[i].sv.substitute_receiver_start_action)
  3695.       s_targets.push(@targets[i])
  3696.       @targets[i] = @substitute
  3697.     end
  3698.     return @substitute = nil if s_targets == []
  3699.     @substitute.sv.set_target(s_targets)
  3700.     @substitute.sv.start_action(@substitute.sv.substitute_start_action)
  3701.   end  
  3702.   #--------------------------------------------------------------------------
  3703.   # ● 身代わり終了
  3704.   #--------------------------------------------------------------------------
  3705.   def end_substitute
  3706.     for member in @substitute.sv.target_battler
  3707.       member.sv.start_action(member.sv.substitute_receiver_end_action)
  3708.     end  
  3709.     @substitute.sv.start_action(@substitute.sv.substitute_end_action)
  3710.     @substitute = nil
  3711.   end
  3712.   #--------------------------------------------------------------------------
  3713.   # ● 反撃
  3714.   #--------------------------------------------------------------------------
  3715.   def set_counter_attack
  3716.     pre_subject = @subject
  3717.     for attacker in @counter_attacker
  3718.       @subject = attacker
  3719.       item = $data_skills[attacker.sv.counter_skill_id]
  3720.       play_sideview([pre_subject], item)
  3721.     end
  3722.     # 同一カウンター者を考慮してカウンターIDの初期化はアクション後に実行
  3723.     for attacker in @counter_attacker do attacker.sv.counter_id = 0 end
  3724.     @subject = pre_subject
  3725.     @counter_attacker = nil
  3726.   end
  3727.   #--------------------------------------------------------------------------
  3728.   # ● 魔法反射
  3729.   #--------------------------------------------------------------------------
  3730.   def set_reflection(item)
  3731.     @log_window.back_to(1)
  3732.     for data in @reflection_data
  3733.       @subject.sv.damage_action(@subject, item)
  3734.       N03.set_damage_anime_data([@subject], @subject, data)
  3735.       apply_item_effects(@subject, item)
  3736.       @spriteset.set_damage_pop(@subject)
  3737.     end
  3738.     set_camera_wait(N03.get_anime_time(@reflection_data[0][0]))
  3739.     @reflection_data = nil
  3740.   end
  3741.   #--------------------------------------------------------------------------
  3742.   # ● サイドビューアクション実行
  3743.   #--------------------------------------------------------------------------
  3744.   def play_sideview(targets, item)
  3745.     @subject.sv.set_target(targets)
  3746.     return if @subject.sv.attack_action(item) == nil
  3747.     return if !@subject.movable?
  3748.     return if item.scope != 9 && item.scope != 10 && !N03.targets_alive?(targets)
  3749.     @subject.sv.start_action(@subject.sv.attack_action(item))
  3750.     @subject.sv.unshift_action(@subject.sv.flash_action) if @subject.flash_flg
  3751.     @subject.sv.active = true
  3752.     @subject.sv.command_action = false
  3753.     loop do
  3754.       update_basic
  3755.       data = @subject.sv.play_data
  3756.       @targets = N03.s_targets(@subject) if data[0] == "second_targets_set"
  3757.       N03.targets_set(@subject)          if data[0] == "targets_set"
  3758.       @immortal = N03.immortaling        if data[0] == "no_collapse" && !N03.dead_attack?(@subject, item)
  3759.       @immortal = N03.unimmortaling      if data[0] == "collapse"
  3760.       next set_move_anime(item)          if @subject.sv.m_a_data != []
  3761.       set_damage(item)                   if @subject.sv.set_damage
  3762.       break N03.derived_skill(@subject)  if @subject.sv.derivation_skill_id != 0
  3763.       break                              if @subject.sv.action_end or @subject.hidden?
  3764.     end
  3765.     @immortal = N03.unimmortaling        if @immortal
  3766.   end
  3767.   #--------------------------------------------------------------------------
  3768.   # ● ダメージの実行
  3769.   #--------------------------------------------------------------------------
  3770.   def set_damage(item)
  3771.     targets = @targets
  3772.     targets = [@subject.sv.individual_targets[0]] if @subject.sv.individual_targets.size != 0
  3773.     for target in targets do damage_anime(targets.dup, target, item) end
  3774.     @subject.sv.set_damage = false
  3775.     @subject.sv.damage_anime_data = []
  3776.   end
  3777.   #--------------------------------------------------------------------------
  3778.   # ● ダメージ戦闘アニメ処理
  3779.   #--------------------------------------------------------------------------
  3780.   def damage_anime(targets, target, item)
  3781.     @log_window.back_to(1) if @log_window.line_number == 5
  3782.     return if item.scope != 9 && item.scope != 10 && target.dead?
  3783.     @miss = false
  3784.     invoke_item(target,item)
  3785.     if target.result.missed
  3786.       target.sv.miss_action(@subject, item)
  3787.       return @miss = true
  3788.     elsif target.result.evaded or target.sv.counter_id != 0
  3789.       target.sv.evasion_action(@subject, item)
  3790.       return @miss = true
  3791.     elsif target.sv.reflection_id != 0
  3792.       N03.set_damage_anime_data(targets, target, [target.sv.reflection_id, false, false, true])
  3793.       target.sv.reflection_id = 0
  3794.       @reflection_data = [] if @reflection_data == nil
  3795.       return @reflection_data.push([N03.get_attack_anime_id(-3, @subject), false, false, true])
  3796.     end
  3797.     target.sv.damage_action(@subject, item)
  3798.     N03.set_damage(@subject, -target.result.hp_drain, -target.result.mp_drain) if target != @subject
  3799.     @spriteset.set_damage_pop(target)
  3800.     @spriteset.set_damage_pop(@subject) if target != @subject && @subject.result.hp_damage != 0 or @subject.result.mp_damage != 0
  3801.     N03.set_damage_anime_data(targets, target, @subject.sv.damage_anime_data) if @subject.sv.damage_anime_data != []
  3802.   end
  3803.   #--------------------------------------------------------------------------
  3804.   # ● 飛ばしアニメ処理
  3805.   #--------------------------------------------------------------------------
  3806.   def set_move_anime(item)
  3807.     for data in @subject.sv.m_a_data
  3808.       @subject.sv.damage_anime_data = data[4]
  3809.       hit_targets = []
  3810.       for target in data[1]
  3811.         damage_anime(data[1], target, item) if data[0]
  3812.         hit_targets.push(target) if !@miss
  3813.       end
  3814.       @miss = false if !data[3]
  3815.       @spriteset.set_hit_animation(@subject, data[2], hit_targets, @miss)
  3816.     end
  3817.     @subject.sv.set_damage = false
  3818.     @subject.sv.m_a_data = []
  3819.   end
  3820. end
  3821.  
  3822. #==============================================================================
  3823. # ■ DataManager
  3824. #------------------------------------------------------------------------------
  3825. #  データベースとゲームオブジェクトを管理するモジュールです。
  3826. #==============================================================================
  3827. module DataManager
  3828.   #--------------------------------------------------------------------------
  3829.   # ● 各種ゲームオブジェクトの作成 ★再定義
  3830.   #--------------------------------------------------------------------------
  3831.   def self.create_game_objects
  3832.     $game_temp          = Game_Temp.new
  3833.     $game_system        = Game_System.new
  3834.     $game_timer         = Game_Timer.new
  3835.     $game_message       = Game_Message.new
  3836.     $game_switches      = Game_Switches.new
  3837.     $game_variables     = Game_Variables.new
  3838.     $game_self_switches = Game_SelfSwitches.new
  3839.     $game_actors        = Game_Actors.new
  3840.     $game_party         = Game_Party.new
  3841.     $game_troop         = Game_Troop.new
  3842.     $game_map           = Game_Map.new
  3843.     $game_player        = Game_Player.new
  3844.     $sv_camera          = Battle_Camera.new
  3845.   end
  3846. end
  3847.  
  3848. #==============================================================================
  3849. # ■ BattleManager
  3850. #------------------------------------------------------------------------------
  3851. #  戦闘の進行を管理するモジュールです。
  3852. #==============================================================================
  3853. module BattleManager
  3854.   #--------------------------------------------------------------------------
  3855.   # ● エンカウント時の処理 ★再定義
  3856.   #--------------------------------------------------------------------------
  3857.   def self.on_encounter
  3858.     @preemptive = (rand < rate_preemptive)
  3859.     @surprise = (rand < rate_surprise && !@preemptive)
  3860.     $sv_camera.mirror = @surprise if N03::BACK_ATTACK
  3861.   end
  3862.   #--------------------------------------------------------------------------
  3863.   # ● 勝利の処理 ★再定義
  3864.   #--------------------------------------------------------------------------
  3865.   def self.process_victory
  3866.     $sv_camera.win_wait = true
  3867.   end  
  3868.   #--------------------------------------------------------------------------
  3869.   # ● 勝利
  3870.   #--------------------------------------------------------------------------
  3871.   def self.victory
  3872.     $sv_camera.win_wait = false
  3873.     N03.camera(nil, N03::BATTLE_CAMERA["战斗结束时"].dup)
  3874.     for member in $game_party.members do member.sv.start_action(member.sv.win) if member.movable? end
  3875.     play_battle_end_me
  3876.     replay_bgm_and_bgs
  3877.     $game_message.add(sprintf(Vocab::Victory, $game_party.name))
  3878.     display_exp
  3879.     gain_gold
  3880.     gain_drop_items
  3881.     gain_exp
  3882.     SceneManager.return
  3883.     battle_end(0)
  3884.     return true
  3885.   end
  3886.   #--------------------------------------------------------------------------
  3887.   # ● 逃走の処理 ★再定義
  3888.   #--------------------------------------------------------------------------
  3889.   def self.process_escape
  3890.     $game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
  3891.     success = @preemptive ? true : (rand < @escape_ratio)
  3892.     Sound.play_escape
  3893.     if success
  3894.       process_abort
  3895.       for member in $game_party.members do member.sv.start_action(member.sv.escape) if member.movable? end
  3896.     else
  3897.       @escape_ratio += 0.1
  3898.       $game_message.add('\.' + Vocab::EscapeFailure)
  3899.       $game_party.clear_actions
  3900.       for member in $game_party.members do member.sv.start_action(member.sv.escape_ng) if member.movable? end
  3901.     end
  3902.     wait_for_message
  3903.     return success
  3904.   end
  3905.   #--------------------------------------------------------------------------
  3906.   # ● 次のコマンド入力へ ★再定義
  3907.   #--------------------------------------------------------------------------
  3908.   def self.next_command
  3909.     begin
  3910.       if !actor || !actor.next_command
  3911.         $game_party.battle_members[@actor_index].sv.command_action = true
  3912.         @actor_index += 1
  3913.         if @actor_index >= $game_party.members.size
  3914.           for member in $game_party.battle_members.reverse
  3915.             break member.sv.start_action(member.sv.command_a) if member.inputable?
  3916.           end
  3917.           return false
  3918.         end
  3919.       end
  3920.     end until actor.inputable?
  3921.     actor.sv.start_action(actor.sv.command_b) if actor != nil && actor.inputable?
  3922.     if pre_actor
  3923.       pre_actor.sv.start_action(pre_actor.sv.command_a) if pre_actor != nil && pre_actor.inputable?
  3924.     end
  3925.     return true
  3926.   end
  3927.   #--------------------------------------------------------------------------
  3928.   # ● 前のコマンド入力へ ★再定義
  3929.   #--------------------------------------------------------------------------
  3930.   def self.prior_command
  3931.     begin
  3932.       if !actor || !actor.prior_command
  3933.         $game_party.battle_members[@actor_index].sv.command_action = false
  3934.         @actor_index -= 1
  3935.         if @actor_index < 0
  3936.           for member in $game_party.battle_members
  3937.             break member.sv.start_action(member.sv.command_a) if member.inputable?
  3938.           end
  3939.           return false
  3940.         end
  3941.       end
  3942.     end until actor.inputable?
  3943.     actor.make_actions if actor.inputable?
  3944.     actor.sv.start_action(actor.sv.command_b) if actor.inputable?
  3945.     after_actor.sv.start_action(after_actor.sv.command_a) if after_actor != nil && after_actor.inputable?
  3946.     return true
  3947.   end
  3948.   #--------------------------------------------------------------------------
  3949.   # ● コマンド入力前のアクターを取得
  3950.   #--------------------------------------------------------------------------
  3951.   def self.pre_actor
  3952.     return if @actor_index == 0
  3953.     $game_party.members[@actor_index - 1]
  3954.   end
  3955.   #--------------------------------------------------------------------------
  3956.   # ● コマンド入力後のアクターを取得
  3957.   #--------------------------------------------------------------------------
  3958.   def self.after_actor
  3959.     $game_party.members[@actor_index + 1]
  3960.   end
  3961.   #--------------------------------------------------------------------------
  3962.   # ● 戦闘行動者を前に追加
  3963.   #--------------------------------------------------------------------------
  3964.   def self.unshift_action_battlers(battler)
  3965.     @action_battlers.unshift(battler)
  3966.   end
  3967. end  
  3968.  
  3969. #==============================================================================
  3970. # ■ Game_Battler
  3971. #------------------------------------------------------------------------------
  3972. #  スプライトや行動に関するメソッドを追加したバトラーのクラスです。
  3973. #==============================================================================
  3974. class Game_Battler < Game_BattlerBase
  3975.   #--------------------------------------------------------------------------
  3976.   # ● 公開インスタンス変数
  3977.   #--------------------------------------------------------------------------
  3978.   attr_reader   :sv                     # サイドビューデータ
  3979.   attr_accessor :flash_flg              # 閃きフラグ
  3980.   #--------------------------------------------------------------------------
  3981.   # ● オブジェクト初期化
  3982.   #--------------------------------------------------------------------------
  3983.   alias initialize_game_battler_n03 initialize
  3984.   def initialize
  3985.     initialize_game_battler_n03
  3986.     @sv = SideView.new(self)
  3987.   end
  3988.   #--------------------------------------------------------------------------
  3989.   # ● 現在の戦闘行動を除去
  3990.   #--------------------------------------------------------------------------
  3991.   alias remove_current_action_game_battler_n03 remove_current_action
  3992.   def remove_current_action
  3993.     return @sv.derivation_skill_id = 0 if @sv.derivation_skill_id != 0
  3994.     remove_current_action_game_battler_n03
  3995.   end
  3996.   #--------------------------------------------------------------------------
  3997.   # ● ターン終了処理
  3998.   #--------------------------------------------------------------------------
  3999.   alias on_turn_end_game_battler_n03 on_turn_end
  4000.   def on_turn_end
  4001.     on_turn_end_game_battler_n03
  4002.     @sv.add_state = []
  4003.     @sv.result_damage = [@result.hp_damage, @result.mp_damage]
  4004.   end
  4005.   #--------------------------------------------------------------------------
  4006.   # ● パラメータ条件比較 data = [種別, 数値, 判別]
  4007.   #--------------------------------------------------------------------------
  4008.   def comparison_parameter(data)
  4009.     return true if data[0][0] == 0
  4010.     kind = data[0]
  4011.     num = data[1]
  4012.     select = data[2]
  4013.     case kind
  4014.     when  1 ; par = level
  4015.     when  2 ; par = mhp
  4016.     when  3 ; par = mmp
  4017.     when  4 ; par = hp
  4018.     when  5 ; par = mp
  4019.     when  6 ; par = tp
  4020.     when  7 ; par = atk
  4021.     when  8 ; par = self.def
  4022.     when  9 ; par = mat
  4023.     when 10 ; par = mdf
  4024.     when 11 ; par = agi
  4025.     when 12 ; par = luk
  4026.     end
  4027.     if num < 0
  4028.       case kind
  4029.       when  4 ; num = mhp * num / 100
  4030.       when  5 ; num = mmp * num / 100
  4031.       when  6 ; num = max_tp * num / 100
  4032.       end
  4033.       num = num.abs
  4034.     end  
  4035.     case select
  4036.     when  0 ; return par == num
  4037.     when  1 ; return par < num
  4038.     when  2 ; return par > num
  4039.     end
  4040.   end
  4041.   #--------------------------------------------------------------------------
  4042.   # ● 装備条件比較 data = [装備種別, タイプID]
  4043.   #--------------------------------------------------------------------------
  4044.   def comparison_equip(data)
  4045.     kind = data[0]
  4046.     items = weapons if kind == 0
  4047.     items = armors  if kind == 1
  4048.     for item in items
  4049.       for id in data[1]
  4050.         return true if id > 0 && item.is_a?(RPG::Weapon) && item == $data_weapons[id.abs]
  4051.         return true if id > 0 && item.is_a?(RPG::Armor) && item == $data_armors[id.abs]
  4052.         return true if id < 0 && item.is_a?(RPG::Weapon) && item.wtype_id == id.abs
  4053.         return true if id < 0 && item.is_a?(RPG::Armor) && item.stype_id == id.abs
  4054.       end
  4055.     end
  4056.     return false
  4057.   end
  4058.  
  4059. end  
  4060. #==============================================================================
  4061. # ■ Game_Actor
  4062. #------------------------------------------------------------------------------
  4063. #  アクターを扱うクラスです。
  4064. #==============================================================================
  4065. class Game_Actor < Game_Battler
  4066.   #--------------------------------------------------------------------------
  4067.   # ● 公開インスタンス変数
  4068.   #--------------------------------------------------------------------------
  4069.   attr_reader :actor_id                    # ID
  4070.   #--------------------------------------------------------------------------
  4071.   # ● ID
  4072.   #--------------------------------------------------------------------------
  4073.   def id
  4074.     return @actor_id
  4075.   end
  4076.   #--------------------------------------------------------------------------
  4077.   # ● スプライトを使うか? ★再定義
  4078.   #--------------------------------------------------------------------------
  4079.   def use_sprite?
  4080.     return true
  4081.   end
  4082.   #--------------------------------------------------------------------------
  4083.   # ● ダメージ効果の実行 ★再定義
  4084.   #--------------------------------------------------------------------------
  4085.   def perform_damage_effect
  4086.     return if !N03::ACTOR_DAMAGE
  4087.     $game_troop.screen.start_shake(5, 5, 10)
  4088.     @sprite_effect_type = :blink
  4089.     Sound.play_actor_damage
  4090.   end
  4091.  
  4092. end
  4093.  
  4094. #==============================================================================
  4095. # ■ Game_Enemy
  4096. #------------------------------------------------------------------------------
  4097. #  敵キャラを扱うクラスです。
  4098. #==============================================================================
  4099. class Game_Enemy < Game_Battler
  4100.   #--------------------------------------------------------------------------
  4101.   # ● 公開インスタンス変数
  4102.   #--------------------------------------------------------------------------
  4103.   attr_reader :enemy_id                    # ID
  4104.   #--------------------------------------------------------------------------
  4105.   # ● ID
  4106.   #--------------------------------------------------------------------------
  4107.   def id
  4108.     return @enemy_id
  4109.   end
  4110.   #--------------------------------------------------------------------------
  4111.   # ● レベル
  4112.   #--------------------------------------------------------------------------
  4113.   def level
  4114.     return @sv.level
  4115.   end
  4116.   #--------------------------------------------------------------------------
  4117.   # ● ダメージ効果の実行 ★再定義
  4118.   #--------------------------------------------------------------------------
  4119.   def perform_damage_effect
  4120.     return if !N03::ENEMY_DAMAGE
  4121.     @sprite_effect_type = :blink
  4122.     Sound.play_enemy_damage
  4123.   end
  4124.   #--------------------------------------------------------------------------
  4125.   # ● 武器
  4126.   #--------------------------------------------------------------------------
  4127.   def weapons
  4128.     weapon1 = $data_weapons[@sv.enemy_weapon1_id]
  4129.     weapon2 = $data_weapons[@sv.enemy_weapon2_id]
  4130.     return [weapon1, weapon2]
  4131.   end
  4132.   #--------------------------------------------------------------------------
  4133.   # ● 防具
  4134.   #--------------------------------------------------------------------------
  4135.   def armors
  4136.     return [$data_armors[@sv.enemy_shield_id]]
  4137.   end
  4138.   #--------------------------------------------------------------------------
  4139.   # ● 二刀流の判定
  4140.   #--------------------------------------------------------------------------
  4141.   def dual_wield?
  4142.     return $data_weapons[@sv.enemy_weapon2_id] != nil
  4143.   end
  4144.   #--------------------------------------------------------------------------
  4145.   # ● バトラー画像変更
  4146.   #--------------------------------------------------------------------------
  4147.   def graphics_change(battler_name)
  4148.     @battler_name = battler_name
  4149.   end
  4150.   #--------------------------------------------------------------------------
  4151.   # ● 通常攻撃 アニメーション ID の取得
  4152.   #--------------------------------------------------------------------------
  4153.   def atk_animation_id1
  4154.     return weapons[0].animation_id if weapons[0]
  4155.     return weapons[1] ? 0 : 1
  4156.   end
  4157.   #--------------------------------------------------------------------------
  4158.   # ● 通常攻撃 アニメーション ID の取得(二刀流:武器2)
  4159.   #--------------------------------------------------------------------------
  4160.   def atk_animation_id2
  4161.     return weapons[1] ? weapons[1].animation_id : 0
  4162.   end
  4163. end
  4164.  
  4165. #==============================================================================
  4166. # ■ Sprite_Base
  4167. #------------------------------------------------------------------------------
  4168. #  アニメーションの表示処理を追加したスプライトのクラスです。
  4169. #==============================================================================
  4170. class Sprite_Base < Sprite
  4171.   #--------------------------------------------------------------------------
  4172.   # ● アニメーションの座標更新 (ホーミングあり)
  4173.   #--------------------------------------------------------------------------
  4174.   def update_animation_position_horming
  4175.     return if @action_end_cancel
  4176.     ani_ox_set if @horming
  4177.     camera_zoom = $sv_camera.zoom
  4178.     camera_zoom = 1 if @move_anime
  4179.     kind = 1
  4180.     kind = -1 if @ani_mirror && !@anime_no_mirror
  4181.     cell_data = @animation.frames[@animation.frame_max - (@ani_duration + @ani_rate - 1) / @ani_rate].cell_data
  4182.     for i in 0..15
  4183.       @ani_sprites[i].x = (@ani_ox + cell_data[i, 1] * kind - $sv_camera.x) * camera_zoom if @ani_sprites[i] != nil && cell_data[i, 1] != nil
  4184.       @ani_sprites[i].y = (@ani_oy + cell_data[i, 2] - $sv_camera.y) * camera_zoom if @ani_sprites[i] != nil && cell_data[i, 2] != nil
  4185.     end
  4186.   end
  4187.   #--------------------------------------------------------------------------
  4188.   # ● アニメーション元の座標をセット
  4189.   #--------------------------------------------------------------------------
  4190.   def ani_ox_set
  4191.     if !SceneManager.scene_is?(Scene_Battle)
  4192.       @real_x = x
  4193.       @real_y = y
  4194.     end
  4195.     @ani_ox = @real_x - ox + width / 2
  4196.     @ani_oy = @real_y - oy + height / 2
  4197.     @ani_oy -= height / 2 if @animation.position == 0
  4198.     @ani_oy += height / 2 if @animation.position == 2
  4199.   end
  4200.   #--------------------------------------------------------------------------
  4201.   # ● アニメーションの更新
  4202.   #--------------------------------------------------------------------------
  4203.   alias update_animation_sprite_base_n03 update_animation
  4204.   def update_animation
  4205.     update_animation_position_horming if animation? && SceneManager.scene_is?(Scene_Battle) && @animation.position != 3
  4206.     update_animation_sprite_base_n03
  4207.   end
  4208.   #--------------------------------------------------------------------------
  4209.   # ● アニメーションの原点設定 ★再定義
  4210.   #--------------------------------------------------------------------------
  4211.   def set_animation_origin
  4212.     return ani_ox_set if @animation.position != 3
  4213.     if viewport == nil
  4214.       @ani_ox = Graphics.width / 2
  4215.       @ani_oy = Graphics.height / 2
  4216.     else
  4217.       @ani_ox = viewport.rect.width / 2
  4218.       @ani_oy = viewport.rect.height / 2
  4219.     end
  4220.   end
  4221.   #--------------------------------------------------------------------------
  4222.   # ● アニメーションスプライトの設定 ★再定義
  4223.   #--------------------------------------------------------------------------
  4224.   def animation_set_sprites(frame)
  4225.     camera_zoom = 1
  4226.     camera_zoom = $sv_camera.zoom if @anime_camera_zoom && @animation.position != 3 && SceneManager.scene_is?(Scene_Battle)
  4227.     camera_x = $sv_camera.x
  4228.     camera_y = $sv_camera.y
  4229.     camera_x = camera_y = 0 if @animation.position == 3 or !SceneManager.scene_is?(Scene_Battle)
  4230.     plus_z = 5
  4231.     plus_z = 1000 if @animation.position == 3
  4232.     plus_z = -17 if @plus_z != nil && @plus_z == false
  4233.     plus_z = -self.z + 10 if @plus_z != nil && @plus_z == false && @animation.position == 3
  4234.     cell_data = frame.cell_data
  4235.     @ani_sprites.each_with_index do |sprite, i|
  4236.       next unless sprite
  4237.       pattern = cell_data[i, 0]
  4238.       if !pattern || pattern < 0
  4239.         sprite.visible = false
  4240.         next
  4241.       end
  4242.       sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  4243.       sprite.visible = true
  4244.       sprite.src_rect.set(pattern % 5 * 192,
  4245.         pattern % 100 / 5 * 192, 192, 192)
  4246.       if @ani_mirror && !@anime_no_mirror
  4247.         sprite.x = (@ani_ox - cell_data[i, 1] - camera_x) * camera_zoom
  4248.         sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
  4249.         sprite.angle = (360 - cell_data[i, 4])
  4250.         sprite.mirror = (cell_data[i, 5] == 0)
  4251.       else
  4252.         sprite.x = (@ani_ox + cell_data[i, 1] - camera_x) * camera_zoom
  4253.         sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
  4254.         sprite.angle = cell_data[i, 4]
  4255.         sprite.mirror = (cell_data[i, 5] == 1)
  4256.       end
  4257.       sprite.z = self.z + plus_z + i
  4258.       sprite.ox = 96
  4259.       sprite.oy = 96
  4260.       sprite.zoom_x = cell_data[i, 3] * camera_zoom / 100.0
  4261.       sprite.zoom_y = cell_data[i, 3] * camera_zoom/ 100.0
  4262.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  4263.       sprite.blend_type = cell_data[i, 7]
  4264.     end
  4265.   end
  4266.   #--------------------------------------------------------------------------
  4267.   # ● 子スプライトフラグ
  4268.   #--------------------------------------------------------------------------
  4269.   def set(battler, horming, camera_zoom, no_mirror)
  4270.     @battler = battler
  4271.     @next = true
  4272.     self.bitmap = Bitmap.new(@battler.sv.cw, @battler.sv.ch)
  4273.     self.ox = bitmap.width / 2
  4274.     self.oy = bitmap.height
  4275.     @horming = horming
  4276.     @anime_camera_zoom = camera_zoom
  4277.     @anime_no_mirror = no_mirror
  4278.     @battler.sv.reset_anime_data
  4279.   end  
  4280.   #--------------------------------------------------------------------------
  4281.   # ● 子スプライト座標セット
  4282.   #--------------------------------------------------------------------------
  4283.   def set_position(z, zoom_x, zoom_y, real_x, real_y)
  4284.     self.z = z
  4285.     self.zoom_x = zoom_x
  4286.     self.zoom_y = zoom_y
  4287.     @real_x = real_x
  4288.     @real_y = real_y
  4289.   end
  4290.   #--------------------------------------------------------------------------
  4291.   # ● 他スプライトへのタイミング処理
  4292.   #--------------------------------------------------------------------------
  4293.   def other_process_timing(timing)
  4294.     se_flag = true
  4295.     se_flag = @se_flag if @se_flag != nil
  4296.     @battler.sv.timing.push([se_flag, timing.dup])
  4297.   end
  4298.   #--------------------------------------------------------------------------
  4299.   # ● 他バトラーへのタイミング処理
  4300.   #--------------------------------------------------------------------------
  4301.   def target_battler_process_timing(timing)
  4302.     for target in @timing_targets
  4303.       target.sv.timing.push([false, timing.dup])
  4304.     end  
  4305.   end
  4306.   #--------------------------------------------------------------------------
  4307.   # ● SE とフラッシュのタイミング処理
  4308.   #--------------------------------------------------------------------------
  4309.   alias animation_process_timing_sprite_base_n03 animation_process_timing
  4310.   def animation_process_timing(timing)
  4311.     target_battler_process_timing(timing) if @timing_targets && @timing_targets != []
  4312.     return other_process_timing(timing) if @next != nil
  4313.     animation_process_timing_sprite_base_n03(timing)
  4314.   end
  4315.   #--------------------------------------------------------------------------
  4316.   # ● アニメーションの解放
  4317.   #--------------------------------------------------------------------------
  4318.   alias dispose_animation_sprite_base_n03 dispose_animation
  4319.   def dispose_animation
  4320.     dispose_animation_sprite_base_n03
  4321.   end
  4322. end
  4323.  
  4324.  
  4325. #==============================================================================
  4326. # ■ Sprite_Battler
  4327. #------------------------------------------------------------------------------
  4328. #  バトラー表示用のスプライトです。
  4329. #==============================================================================
  4330. class Sprite_Battler < Sprite_Base
  4331.   #--------------------------------------------------------------------------
  4332.   # ● 公開インスタンス変数 
  4333.   #--------------------------------------------------------------------------
  4334.   attr_accessor   :removing             # パーティ離脱中
  4335.   #--------------------------------------------------------------------------
  4336.   # ● オブジェクト初期化
  4337.   #--------------------------------------------------------------------------
  4338.   alias initialize_sprite_battler_n03 initialize
  4339.   def initialize(viewport, battler = nil)
  4340.     initialize_sprite_battler_n03(viewport, battler)
  4341.     @real_x = @real_y = 0
  4342.     update_bitmap if @battler != nil
  4343.   end
  4344.   #--------------------------------------------------------------------------
  4345.   # ● アニメーションの開始 ★再定義
  4346.   #--------------------------------------------------------------------------
  4347.   def start_animation(animation, mirror = false)
  4348.     return next_animation(animation, mirror) if animation?
  4349.     @animation = animation
  4350.     if @animation
  4351.       @horming = @battler.sv.anime_horming
  4352.       @anime_camera_zoom = @battler.sv.anime_camera_zoom
  4353.       @anime_no_mirror = @battler.sv.anime_no_mirror
  4354.       @timing_targets = @battler.sv.timing_targets
  4355.       @plus_z = @battler.sv.anime_plus_z
  4356.       @battler.sv.reset_anime_data
  4357.       @ani_mirror = mirror
  4358.       set_animation_rate
  4359.       @ani_duration = @animation.frame_max * @ani_rate + 1
  4360.       load_animation_bitmap
  4361.       make_animation_sprites
  4362.       set_animation_origin
  4363.     end
  4364.   end
  4365.   #--------------------------------------------------------------------------
  4366.   # ● 次のアニメを開始
  4367.   #--------------------------------------------------------------------------
  4368.   def next_animation(animation, mirror)
  4369.     @next_anime = [] if @next_anime == nil
  4370.     @next_anime.push(Sprite_Base.new(viewport))
  4371.     @next_anime[@next_anime.size - 1].set(battler, @battler.sv.anime_horming, @battler.sv.anime_camera_zoom, @battler.sv.anime_no_mirror)
  4372.     @next_anime[@next_anime.size - 1].set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y)
  4373.     @next_anime[@next_anime.size - 1].start_animation(animation, mirror)
  4374.   end
  4375.   #--------------------------------------------------------------------------
  4376.   # ● 影グラフィック作成
  4377.   #--------------------------------------------------------------------------
  4378.   def create_shadow
  4379.     reset_shadow
  4380.     return if @battler.sv.shadow == false
  4381.     @shadow = Sprite.new(viewport) if @shadow == nil
  4382.     @shadow.bitmap = Cache.character(@battler.sv.shadow)
  4383.     @shadow.ox = @shadow.bitmap.width / 2
  4384.     @shadow.oy = @shadow.bitmap.height / 2
  4385.   end
  4386.   #--------------------------------------------------------------------------
  4387.   # ● 影グラフィック初期化
  4388.   #--------------------------------------------------------------------------
  4389.   def reset_shadow
  4390.     return if @shadow == nil
  4391.     @shadow.dispose
  4392.     @shadow = nil
  4393.   end  
  4394.   #--------------------------------------------------------------------------
  4395.   # ● 転送元ビットマップの更新 ★再定義
  4396.   #--------------------------------------------------------------------------
  4397.   def update_bitmap
  4398.     update_bitmap_enemy if !@battler.actor?
  4399.     update_bitmap_actor if @battler.actor?
  4400.     update_src_rect if @battler != nil
  4401.     update_color if @battler != nil
  4402.   end
  4403.   #--------------------------------------------------------------------------
  4404.   # ● 転送元ビットマップ:エネミー
  4405.   #--------------------------------------------------------------------------
  4406.   def update_bitmap_enemy
  4407.     if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue
  4408.       @battler_name = @battler.battler_name
  4409.       @battler_hue = @battler.battler_hue
  4410.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4411.       @graphic_mirror_flag = @battler.sv.graphic_mirror_flag
  4412.       self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue)
  4413.       @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  4414.       create_shadow
  4415.       init_visibility
  4416.       @battler_id = @battler.id
  4417.     end
  4418.   end  
  4419.   #--------------------------------------------------------------------------
  4420.   # ● 転送元ビットマップ:アクター
  4421.   #--------------------------------------------------------------------------
  4422.   def update_bitmap_actor
  4423.     if @battler.character_name != @battler_name or @battler.character_index != @battler_index
  4424.       @battler_name = @battler.character_name
  4425.       @battler_index = @battler.character_index
  4426.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4427.       @graphic_mirror_flag = @battler.sv.graphic_mirror_flag
  4428.       self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index)
  4429.       @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  4430.       create_shadow
  4431.       init_visibility
  4432.       @battler_id = @battler.id
  4433.     end
  4434.   end
  4435.   #--------------------------------------------------------------------------
  4436.   # ● 可視状態の初期化 ★再定義
  4437.   #--------------------------------------------------------------------------
  4438.   def init_visibility
  4439.     @battler_visible = @battler.alive?
  4440.     @battler_visible = true if @battler.sv.state(1) != "敌消失"
  4441.     @battler_visible = false if @battler.hidden?
  4442.     @battler.sv.opacity = 0 unless @battler_visible
  4443.     self.opacity = 0 unless @battler_visible
  4444.     self.opacity = 255 if @battler_visible
  4445.     @battler.sv.weapon_visible = @battler_visible
  4446.   end
  4447.   #--------------------------------------------------------------------------
  4448.   # ● 転送元矩形の更新
  4449.   #--------------------------------------------------------------------------
  4450.   def update_src_rect
  4451.     return if @battler.sv.collapse
  4452.     if @battler_graphic_file_index != @battler.sv.graphic_file_index
  4453.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4454.       self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index) if @battler.actor?
  4455.       self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue) if !@battler.actor?
  4456.       @battler.sv.set_graphics(self.bitmap.width, self.bitmap.height)
  4457.     end
  4458.     anime_off if @battler.sv.anime_off
  4459.     self.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
  4460.     self.opacity = @battler.sv.opacity if @battler_visible
  4461.     set_process_timing(@battler.sv.timing) if @battler && @battler.sv.timing != []
  4462.   end
  4463.   #--------------------------------------------------------------------------
  4464.   # ● 位置の更新 ★再定義
  4465.   #--------------------------------------------------------------------------
  4466.   def update_position
  4467.     @real_x = @battler.sv.x / 100
  4468.     @real_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust)/ 100
  4469.     self.x = @real_x - $sv_camera.x
  4470.     self.y = @real_y - $sv_camera.y
  4471.     self.z = @battler.sv.z - @battler.sv.c / 100
  4472.     if @battler.sv.h <= 0
  4473.       self.x += $sv_camera.sx / 100
  4474.       self.y += $sv_camera.sy / 100
  4475.     end  
  4476.     self.x *= $sv_camera.zoom
  4477.     self.y *= $sv_camera.zoom
  4478.   end
  4479.   #--------------------------------------------------------------------------
  4480.   # ● 原点の更新 ★再定義
  4481.   #--------------------------------------------------------------------------
  4482.   def update_origin
  4483.     return if !bitmap or @battler.sv.collapse
  4484.     self.ox = @battler.sv.ox
  4485.     self.oy = @battler.sv.oy
  4486.     self.angle = @battler.sv.angle
  4487.     self.zoom_x = @battler.sv.zoom_x * $sv_camera.zoom
  4488.     self.zoom_y = @battler.sv.zoom_y * $sv_camera.zoom
  4489.     self.mirror = @battler.sv.mirror if !@graphic_mirror_flag
  4490.     self.mirror = !@battler.sv.mirror if @graphic_mirror_flag
  4491.   end
  4492.   #--------------------------------------------------------------------------
  4493.   # ● 影グラフィックの更新
  4494.   #--------------------------------------------------------------------------
  4495.   def update_shadow
  4496.     @shadow.visible = @battler.sv.shadow_visible
  4497.     @shadow.opacity = @battler.sv.opacity if @battler.sv.opacity_data[3]
  4498.     @shadow.opacity = self.opacity if !@battler.sv.opacity_data[3]
  4499.     @shadow.x = @real_x - $sv_camera.x
  4500.     @shadow.y = (@battler.sv.y - @battler.sv.c)/ 100 - $sv_camera.y
  4501.     @shadow.z = @battler.sv.z - 10
  4502.     @shadow.zoom_x = $sv_camera.zoom
  4503.     @shadow.zoom_y = $sv_camera.zoom
  4504.     @shadow.x += $sv_camera.sx / 100
  4505.     @shadow.y += $sv_camera.sy / 100
  4506.     @shadow.x *= $sv_camera.zoom
  4507.     @shadow.y *= $sv_camera.zoom
  4508.     @shadow.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4509.   end
  4510.   #--------------------------------------------------------------------------
  4511.   # ● ふきだしの更新
  4512.   #--------------------------------------------------------------------------
  4513.   def update_balloon
  4514.     if @battler.sv.balloon_data == [] && @balloon
  4515.       @balloon_data = []
  4516.       @balloon.dispose
  4517.       return @balloon = nil
  4518.     elsif @battler.sv.balloon_data != [] && @battler.sv.balloon_data != @balloon_data
  4519.       @balloon_data = @battler.sv.balloon_data
  4520.       @balloon = Sprite.new(self.viewport)
  4521.       @balloon.bitmap = Cache.system("Balloon")
  4522.       @balloon.zoom_x = @balloon_data[3]
  4523.       @balloon.zoom_y = @balloon_data[3]
  4524.       @balloon.ox = 32 if @battler.sv.mirror
  4525.       @balloon.oy = 16
  4526.       @balloon_count = 0
  4527.     end
  4528.     return if !@balloon
  4529.     @balloon.opacity = self.opacity
  4530.     @balloon.x = self.x
  4531.     @balloon.y = self.y - @battler.sv.ch * $sv_camera.zoom
  4532.     @balloon.z = self.z + 20
  4533.     @balloon.src_rect.set(32 + @balloon_count / @balloon_data[2] * 32, @balloon_data[1] * 32, 32, 32) if @balloon_count % @balloon_data[2] == 0
  4534.     @balloon.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4535.     @balloon_count += 1
  4536.     @balloon_count = 0 if @balloon_count == @balloon_data[2] * 7
  4537.   end
  4538.   #--------------------------------------------------------------------------
  4539.   # ● 色調変更の更新
  4540.   #--------------------------------------------------------------------------
  4541.   def update_color
  4542.     color_set if @battler.sv.color_set != []
  4543.     return if @color_data == nil
  4544.     @color_data[4] -= 1
  4545.     if @color_data[4] == 0 && @color_data[5] != 0
  4546.       @color_data[4] = @color_data[5]
  4547.       @color_data[5] = 0
  4548.       @color_data[6] = [0,0,0,0]
  4549.     elsif @color_data[4] == 0
  4550.       @remain_color_data = @color_data
  4551.       @battler.sv.color = @color_data.dup
  4552.       return @color_data = nil
  4553.     end  
  4554.     for i in 0..3
  4555.       @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
  4556.     end  
  4557.     @battler.sv.color = @color_data.dup
  4558.     self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
  4559.   end
  4560.   #--------------------------------------------------------------------------
  4561.   # ● 残像の更新
  4562.   #--------------------------------------------------------------------------
  4563.   def update_mirage
  4564.     if @battler.sv.mirage == [] && @mirages
  4565.       @mirage_data = []
  4566.       for mirage in @mirages do mirage.dispose end
  4567.       return @mirages = nil
  4568.     elsif @battler.sv.mirage != [] && @battler.sv.mirage != @mirage_data
  4569.       @mirage_data = @battler.sv.mirage
  4570.       @mirages = []
  4571.       for i in 0...@mirage_data[1] do @mirages[i] = Sprite.new(self.viewport) end
  4572.       @mirage_count = 0
  4573.     end
  4574.     return if !@mirages
  4575.     @mirage_count += 1
  4576.     @mirage_count = 0 if @mirage_count == @mirage_data[2] * @mirages.size
  4577.     for i in [email]0...@mirages.size[/email]
  4578.       mirage_body(@mirages[i], @mirage_data[4]) if @mirage_count == 1 + i * @mirage_data[2]
  4579.     end
  4580.   end
  4581.   #--------------------------------------------------------------------------
  4582.   # ● 残像本体
  4583.   #--------------------------------------------------------------------------
  4584.   def mirage_body(body, opacity)
  4585.     body.bitmap = self.bitmap.dup
  4586.     body.x = self.x
  4587.     body.y = self.y
  4588.     body.ox = self.ox
  4589.     body.oy = self.oy
  4590.     body.z = self.z - 20
  4591.     body.mirror = self.mirror
  4592.     body.angle = self.angle
  4593.     body.opacity = opacity * self.opacity / 255
  4594.     body.zoom_x = self.zoom_x
  4595.     body.zoom_y = self.zoom_y   
  4596.     body.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
  4597.     body.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4598.   end   
  4599.   #--------------------------------------------------------------------------
  4600.   # ● 次のアニメを更新
  4601.   #--------------------------------------------------------------------------
  4602.   def update_next_anime
  4603.     return if !@next_anime
  4604.     for anime in @next_anime
  4605.       anime.update
  4606.       anime.set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y) if @horming
  4607.       anime.dispose if !anime.animation?
  4608.       @next_anime.delete(anime) if !anime.animation?
  4609.     end  
  4610.   end
  4611.   #--------------------------------------------------------------------------
  4612.   # ● フレーム更新
  4613.   #--------------------------------------------------------------------------
  4614.   alias update_sprite_battler_n03 update
  4615.   def update
  4616.     @battler.sv.update if @battler
  4617.     update_sprite_battler_n03
  4618.     update_next_anime
  4619.     update_shadow  if @battler && @shadow
  4620.     update_mirage  if @battler
  4621.     update_balloon if @battler
  4622.     update_remove if @battler && @removing && @battler.sv.change_up
  4623.   end
  4624.   #--------------------------------------------------------------------------
  4625.   # ● 戦闘アニメ消去
  4626.   #--------------------------------------------------------------------------
  4627.   def anime_off
  4628.     @battler.sv.anime_off = false
  4629.     dispose_animation
  4630.     for anime in @next_anime do anime.dispose_animation end if @next_anime
  4631.   end
  4632.   #--------------------------------------------------------------------------
  4633.   # ● バトラー入れ替え
  4634.   #--------------------------------------------------------------------------
  4635.   def remove
  4636.     @battler.sv.start_action(@battler.sv.remove_action)
  4637.     $sv_camera.wait = 40
  4638.     @battler.sv.add_action("eval('set_change')")
  4639.     @removing = true
  4640.   end
  4641.   #--------------------------------------------------------------------------
  4642.   # ● バトラー入れ替えの更新
  4643.   #--------------------------------------------------------------------------
  4644.   def update_remove
  4645.     @battler.sv.change_up = false
  4646.     @removing = false
  4647.     @battler = nil
  4648.   end  
  4649.   #--------------------------------------------------------------------------
  4650.   # ● バトラー加入
  4651.   #--------------------------------------------------------------------------
  4652.   def join(join_battler)
  4653.     $sv_camera.wait = 30
  4654.     @battler = join_battler
  4655.     @battler_name = @battler.character_name
  4656.     @battler_index = @battler.character_index
  4657.     @battler_graphic_file_index = @battler.sv.graphic_file_index
  4658.     self.bitmap = Cache.character(@battler_name)
  4659.     @battler.sv.setup(self.bitmap.width, self.bitmap.height, true)
  4660.     create_shadow
  4661.     init_visibility
  4662.   end
  4663.   #--------------------------------------------------------------------------
  4664.   # ● 通常の設定に戻す ★再定義
  4665.   #--------------------------------------------------------------------------
  4666.   def revert_to_normal
  4667.     self.blend_type = 0
  4668.     self.opacity = 255
  4669.   end
  4670.   #--------------------------------------------------------------------------
  4671.   # ● 崩壊エフェクトの更新
  4672.   #--------------------------------------------------------------------------
  4673.   alias update_collapse_sprite_battler_n03 update_collapse
  4674.   def update_collapse
  4675.     return if @battler.sv.state(1) != "敌消失"
  4676.     update_collapse_sprite_battler_n03
  4677.     @battler.sv.weapon_visible = false
  4678.   end
  4679.   #--------------------------------------------------------------------------
  4680.   # ● ボス崩壊エフェクトの更新 ★再定義
  4681.   #--------------------------------------------------------------------------
  4682.   def update_boss_collapse
  4683.     @effect_duration = @battler.sv.ch if @effect_duration >= @battler.sv.ch
  4684.     alpha = @effect_duration * 120 / @battler.sv.ch
  4685.     self.ox = @battler.sv.cw / 2 + @effect_duration % 2 * 4 - 2
  4686.     self.blend_type = 1
  4687.     self.color.set(255, 255, 255, 255 - alpha)
  4688.     self.opacity = alpha
  4689.     self.src_rect.y -= 1
  4690.     Sound.play_boss_collapse2 if @effect_duration % 20 == 19
  4691.   end
  4692.   #--------------------------------------------------------------------------
  4693.   # ● 別スプライトからのタイミング処理
  4694.   #--------------------------------------------------------------------------
  4695.   def set_process_timing(timing_data)
  4696.     for data in timing_data
  4697.       set_timing(data[0],data[1])
  4698.     end
  4699.     @battler.sv.timing = []
  4700.   end
  4701.   #--------------------------------------------------------------------------
  4702.   # ● タイミング処理
  4703.   #--------------------------------------------------------------------------
  4704.   def set_timing(se_flag, data)
  4705.     @ani_rate = 4
  4706.     data.se.play if se_flag
  4707.     case data.flash_scope
  4708.     when 1 ;self.flash(data.flash_color, data.flash_duration * @ani_rate)
  4709.     when 2 ;viewport.flash(data.flash_color, data.flash_duration * @ani_rate) if viewport
  4710.     when 3 ;self.flash(nil, data.flash_duration * @ani_rate)
  4711.     end
  4712.   end
  4713.   #--------------------------------------------------------------------------
  4714.   # ● 色調変更
  4715.   #--------------------------------------------------------------------------
  4716.   def color_set
  4717.     set = @battler.sv.color_set
  4718.     @battler.sv.color_set= []
  4719.     set[4] = 1 if set[4] == 0
  4720.     @remain_color_data = [0,0,0,0] if @remain_color_data == nil
  4721.     @color_data = @remain_color_data
  4722.     @color_data[4] = set[4]
  4723.     @color_data[5] = set[5]
  4724.     @color_data[6] = set
  4725.   end
  4726.   #--------------------------------------------------------------------------
  4727.   # ● 解放
  4728.   #--------------------------------------------------------------------------
  4729.   alias dispose_sprite_battler_n03 dispose
  4730.   def dispose
  4731.     dispose_sprite_battler_n03
  4732.     @shadow.dispose if @shadow != nil
  4733.     @balloon.dispose if @balloon != nil
  4734.     for mirage in @mirages do mirage.dispose end if @mirages != nil
  4735.     for anime in @next_anime do anime.dispose end if @next_anime
  4736.   end
  4737. end
  4738.  
  4739.  
  4740. #==============================================================================
  4741. # ■ Spriteset_Battle
  4742. #------------------------------------------------------------------------------
  4743. #  バトル画面のスプライトをまとめたクラスです。
  4744. #==============================================================================
  4745. class Spriteset_Battle
  4746.   #--------------------------------------------------------------------------
  4747.   # ● 戦闘背景(床)スプライトの作成 ★再定義
  4748.   #--------------------------------------------------------------------------
  4749.   def create_battleback1
  4750.     @back1_sprite = Sprite_Battle_Back.new(@viewport1, 1, battleback1_name)
  4751.     @back1_sprite.set_graphics(battleback1_bitmap) if battleback1_name != nil
  4752.     @back1_sprite.z = 0
  4753.   end
  4754.   #--------------------------------------------------------------------------
  4755.   # ● 戦闘背景(壁)スプライトの作成 ★再定義
  4756.   #--------------------------------------------------------------------------
  4757.   def create_battleback2
  4758.     @back2_sprite = Sprite_Battle_Back.new(@viewport1, 2, battleback2_name)
  4759.     @back2_sprite.set_graphics(battleback2_bitmap) if battleback2_name != nil
  4760.     @back2_sprite.z = 1
  4761.   end
  4762.   #--------------------------------------------------------------------------
  4763.   # ● アクタースプライトの作成 ★再定義
  4764.   #--------------------------------------------------------------------------
  4765.   def create_actors
  4766.     @actor_sprites = []
  4767.     for i in 0...$game_party.max_battle_members
  4768.       @actor_sprites[i] = Sprite_Battler.new(@viewport1, $game_party.members[i])
  4769.     end
  4770.     @effect_sprites = Spriteset_Sideview.new(@viewport1)
  4771.   end
  4772.   #--------------------------------------------------------------------------
  4773.   # ● アクタースプライトの更新 ★再定義
  4774.   #--------------------------------------------------------------------------
  4775.   def update_actors
  4776.     @actor_sprites.each_with_index do |sprite, i|
  4777.       sprite_join($game_party.members[i], sprite) if sprite.battler == nil && sprite.battler != $game_party.members[i]
  4778.       sprite.remove if sprite.battler != nil && !sprite.removing && sprite.battler != $game_party.members[i]
  4779.       sprite.update
  4780.     end
  4781.     @effect_sprites.update
  4782.     update_program
  4783.   end
  4784.   #--------------------------------------------------------------------------
  4785.   # ● メンバーを加える
  4786.   #--------------------------------------------------------------------------
  4787.   def sprite_join(member, sprite)
  4788.     for sp in @actor_sprites
  4789.       sp.update_remove if member == sp.battler && !sp.battler.sv.change_up
  4790.     end
  4791.     sprite.join(member)
  4792.   end
  4793.   #--------------------------------------------------------------------------
  4794.   # ● バトルプログラムの更新
  4795.   #--------------------------------------------------------------------------
  4796.   def update_program
  4797.     return if $sv_camera.program_scroll == []
  4798.     for data in  $sv_camera.program_scroll
  4799.       @back1_sprite.start_back_data(data) if data[2] == 1
  4800.       @back2_sprite.start_back_data(data) if data[2] == 2
  4801.     end
  4802.     $sv_camera.program_scroll = []
  4803.   end
  4804.   #--------------------------------------------------------------------------
  4805.   # ● ヒット時の戦闘アニメ実行
  4806.   #--------------------------------------------------------------------------
  4807.   def set_hit_animation(battler, weapon_index, hit_targets, miss)
  4808.     @effect_sprites.set_hit_animation(battler, weapon_index, hit_targets, miss)
  4809.   end
  4810.   #--------------------------------------------------------------------------
  4811.   # ● ダメージPOP
  4812.   #--------------------------------------------------------------------------
  4813.   def set_damage_pop(target)
  4814.     @effect_sprites.set_damage_pop(target)
  4815.   end
  4816.   #--------------------------------------------------------------------------
  4817.   # ● 解放
  4818.   #--------------------------------------------------------------------------
  4819.   alias dispose_spriteset_battle_n03 dispose
  4820.   def dispose
  4821.     dispose_spriteset_battle_n03
  4822.     @effect_sprites.dispose
  4823.   end
  4824.  
  4825.  
  4826.  
  4827. end
  4828.  
  4829.  
  4830. #==============================================================================
  4831. # ■ Window_BattleLog
  4832. #------------------------------------------------------------------------------
  4833. #  戦闘の進行を実況表示するウィンドウです。
  4834. #==============================================================================
  4835. class Window_BattleLog < Window_Selectable
  4836.   #--------------------------------------------------------------------------
  4837.   # ● ウェイト ★再定義
  4838.   #--------------------------------------------------------------------------
  4839.   def wait
  4840.   end
  4841.   #--------------------------------------------------------------------------
  4842.   # ● ウェイトとクリア ★再定義
  4843.   #--------------------------------------------------------------------------
  4844.   def wait_and_clear
  4845.     $sv_camera.wait = 10
  4846.   end
  4847.   #--------------------------------------------------------------------------
  4848.   # ● 行動結果の表示 ★再定義
  4849.   #--------------------------------------------------------------------------
  4850.   def display_action_results(target, item)
  4851.     if target.result.used
  4852.       last_line_number = line_number
  4853.       display_critical(target, item)
  4854.       display_damage(target, item)
  4855.       display_affected_status(target, item)
  4856.       display_failure(target, item)
  4857.     end
  4858.     off if !N03::BATTLE_LOG
  4859.   end
  4860.   #--------------------------------------------------------------------------
  4861.   # ● ウインドウ非表示
  4862.   #--------------------------------------------------------------------------
  4863.   def off
  4864.     @back_sprite.visible = self.visible = false
  4865.   end
  4866. end
  4867. #==============================================================================
  4868. # ■ Game_Interpreter
  4869. #------------------------------------------------------------------------------
  4870. #  イベントコマンドを実行するインタプリタです。
  4871. #==============================================================================
  4872. class Game_Interpreter
  4873.   #--------------------------------------------------------------------------
  4874.   # ● スイッチの操作
  4875.   #--------------------------------------------------------------------------
  4876.   alias command_121_game_interpreter_n03 command_121
  4877.   def command_121
  4878.     command_121_game_interpreter_n03
  4879.     $sv_camera.program_check
  4880.   end
  4881. end

Lv1.梦旅人

梦石
0
星屑
199
在线时间
248 小时
注册时间
2012-4-29
帖子
386
2
发表于 2014-1-20 00:49:10 | 只看该作者
我记得图书馆有一个  !  不会一样的把

点评

图书馆的只汉化了设置内容的注释  发表于 2014-12-12 22:45
这个是自己汉化的,应该不一样  发表于 2014-1-20 01:05
你的意思就是要打架咯?
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1697
在线时间
3038 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

3
发表于 2014-1-20 23:01:58 | 只看该作者
赞!终于有可以用的脚本了!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
32 小时
注册时间
2013-11-6
帖子
20
4
发表于 2014-1-23 09:19:33 | 只看该作者
范例中弓攻击会卡住

评分

参与人数 1星屑 +7 收起 理由
Mr丶木头 + 7 塞糖

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
91 小时
注册时间
2012-3-3
帖子
65
5
 楼主| 发表于 2014-1-23 22:26:23 | 只看该作者
破晓记录线 发表于 2014-1-23 09:19
范例中弓攻击会卡住

好的,已经修复了,谢谢你。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
492 小时
注册时间
2013-6-15
帖子
206
6
发表于 2014-1-24 12:59:33 | 只看该作者
这个是什么?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
91 小时
注册时间
2012-3-3
帖子
65
7
 楼主| 发表于 2014-1-24 22:24:42 | 只看该作者
渝川 发表于 2014-1-24 12:59
这个是什么?

你是用了我的测试技能吗0 0,   那个是我用来看看动作时干什么的技能, 删掉就好了没什么用
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 16:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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