查看: 3988|回复: 6

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

[复制链接]
梦石
0
星屑
50
在线时间
91 小时
注册时间
2012-3-3
回帖
56
发表于 2014-1-19 15:08:30 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 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, 下载次数: 274)

SideView动画设置部分
  1. =begin
  2. #==============================================================================

  3. 译者注:这是使用了hcm君提供的全动态SideView脚本作为翻译的模板。
  4.         [url=http://rpg.blue/thread-236237-1-1.html]http://rpg.blue/thread-236237-1-1.html[/url]
  5.         
  6.        其实mt君不懂日文呢,用了林格斯翻译家后麻麻再也不用担心我的翻译了!
  7.        好多不懂的地方也是实践后用自己的话表达出来的。翻译错误肯定是有的,
  8.        但是大概意思不会错。

  9.        那么关于所有SideView的动画设定都在此页了,使用前请详细阅读该脚本的设置页。
  10.        使用时请注意将该范例下Graphics文件夹下的图像素材拷贝到你的游戏中哦。
  11.        拷贝时可以不复制数据库内的113-116号动画,因为你需要开始自己设计动画了哦。

  12.        已知BUG:  在选择单体技能后,选择目标敌人时技能已经开始吟唱了??

  13.   ps.话说SideView的脚本自定义功能真的很强大呢

  14.     2014年1月17日由mt君译。
  15. #==============================================================================
  16. =end

  17. #==============================================================================
  18. # ■ SideView动画設定 v100
  19. #------------------------------------------------------------------------------
  20. #  横版战斗全部的动画设定
  21. #==============================================================================
  22. module N03
  23. #--------------------------------------------------------------------------
  24. # ● 全局设置
  25. #--------------------------------------------------------------------------

  26.   #位置统一修正
  27.   XADJ = -40
  28.   YADJ = -20
  29.   
  30.   # 角色初期位置(H:角色的高度(位于空中))
  31.   ACTOR_POSITION=[
  32.   #   X轴       Y轴     H轴
  33.   [ 415+XADJ, 165+YADJ,  0],  #1号位置
  34.   [ 415+XADJ, 195+YADJ,  0],  #2号位置
  35.   [ 475+XADJ, 215+YADJ,  0],  #3号位置
  36.   [ 475+XADJ, 195+YADJ,  0]   #4号位置
  37.   
  38.   ]
  39.   
  40.   # 战斗中行动结束后、到下个角色行动开始之间的等待时间。
  41.   ACTION_END_WAIT = 8
  42.   
  43.   # 回合结束时的等待时间
  44.   TURN_END_WAIT = 12
  45.   
  46.   # 被偷袭时背对敌人。允许true 不允许false
  47.   BACK_ATTACK = true
  48.   
  49.   # 是否允许我方受伤时采用默认的效果。
  50.   ACTOR_DAMAGE = false
  51.   
  52.   # 是否允许地方受伤时采用默认的效果。
  53.   ENEMY_DAMAGE = false
  54.   
  55.   # 敌人图像,动作,动画是否翻转显示。
  56.   ENEMY_MIRROR = true
  57.   
  58.   # 不死的状态ID
  59.   IMMORTAL_ID = 10
  60.   
  61.   # 战斗日志开关 打开true
  62.   BATTLE_LOG = true
  63.   
  64.   # 以下技能不使用特效。
  65.   NO_DISPLAY_SKILL_ID = [1,2,3,4,5,6,7]
  66.   
  67.   # 伤害数字显示开关 打开true
  68.   DAMAGE_POP = true
  69.   
  70.   # 状态付加显示开关 打开true
  71.   STATE_POP = true
  72.   
  73.   # 伤害数字图像文件名(放在System下)
  74.   DAMAGE_PLUS = "damage_num+"
  75.   # 恢复数字图像文件名(放在System下)
  76.   DAMAGE_MINUS = "damage_num-"
  77.   # MP伤害数字图像文件名(放在System下)
  78.   DAMAGE_MP = "damage_mp"
  79.   # TP伤害数字图像文件名(放在System下)
  80.   DAMAGE_TP = "damage_tp"
  81.   # 伤害数字文字间距调整
  82.   DAMAGE_ADJUST = -4
  83.   
  84.   # 战斗前镜头位置调整   [X轴, Y轴]
  85.   CAMERA_POSITION = [  0,   -40]
  86.   
  87. #--------------------------------------------------------------------------
  88. # ● 战斗背景环境  背景放大倍率和坐标的调整
  89. #--------------------------------------------------------------------------
  90.   # 地面文件名…设定地面(Battlebacks1)图像文件名。
  91.   #             "全Battlebacks1"指定统一的Battlebacks1设定
  92.   # 背景文件名…设定背景(Battlebacks2)图像文件名。
  93.   #               "全Battlebacks2"指定统一的Battlebacks2设定
  94.   # 坐标调整…[X轴, Y轴]
  95.   # 放大率……[横放大率, 纵放大率]
  96.   # 允许晃动……如果允许晃动画面true 否则false
  97.   # 开关ー…战斗开始时自动打开该开关。如果设置为负数则使用SideView专用开关。
  98.   #       在特定的场合下ON可以管理一套战斗方案和背景。
  99.   #       如果不想这么做 0
  100.   
  101.    FLOOR1_DATA = {
  102. #――地面文件名―――           坐标調整      放大率   允许晃动   开关
  103.   "Sea_ex01"              => [ [   0, 0], [  75,  75], false,    0],
  104.   "全Battlebacks1"        => [ [   0, 0], [ 100, 100],  true,    0],
  105.   
  106.   }
  107.    FLOOR2_DATA = {
  108.   #――背景文件名―――          坐标調整        放大率   允许晃动  开关
  109.   "Ship_ex"               => [ [   0, 120], [ 150, 150],  true,    0],
  110.   "全Battlebacks2"        => [ [   0, 120], [ 150, 150],  true,    0],
  111.   

  112. }  
  113.   
  114. #==============================================================================
  115. # ■ 动画
  116. #------------------------------------------------------------------------------
  117. #  这里设置战斗中基础动作。用来组合动画
  118. #==============================================================================
  119. # 这里是一个动画检索表
  120.   ACTION = {
  121.   
  122. #--------------------------------------------------------------------------
  123. # ● 动画设置
  124. #--------------------------------------------------------------------------
  125.   # 默认可以多个角色放置在一个图像文件中。
  126.   # 如果你想使用单个角色文件,请制作适合人物动作的图片放置其中。
  127.   # 一人用一个图像文件(在文件头部有个$号)情况下也没有问题
  128.   
  129.   # 文件名后缀…要使用的角色图像文件名后面加上后缀。
  130.   #              角色文件名+后缀作为图像完整的文件名
  131.   #              例)Actor1角色添加"_1"为Actor1_1
  132.   #              如果你只想使用一个角色文件请设置为空""
  133.   #              角色的图像文件放在Characters下,敌人的图像文件放在Battlers下
  134.   #
  135.   # 纵行…图像纵位置。一般是0-3代表第1~4行。不过没有数量上的限制
  136.   #       不要超过图像设定的行数
  137.   # 横行…图像横位置、动画开始的位置。左从0~3开始。
  138.   #       单元格的动画会从这个数字的位置到右边。
  139.   # 模式… 0:固定 1:单向 2:往復 3:单向循环 4:往復循环
  140.   # 速度…动画播放速度。数字越大越快
  141.   # Z轴…动画叠放次序。数字越大越靠前
  142.   # 循环…动画播放到最后会从头播放 允许true
  143.   # 影…是否允许显示一个图像阴影 如果允许true 否则false
  144.   # 武器…显示武器。如果不想留空""
  145.   #       武器动画允许叠加
  146.   
  147.   #―动作名(待机系)―     判别        后缀   纵行 横行 模式 速度   Z轴  循环   影   武器
  148.   "待机"            => ["motion",   "",      1,   0,   4,   12,   0, true, true, "待机武器" ],
  149.   "待机(固定)WT"    => ["motion",   "",      1,   0,   0,   12,   0, true, true, "" ],
  150.   "敌待机(固定)WT"  => ["motion",   "",      0,   0,   0,   12,   0, true, true, "" ],
  151.   "待机(固定)"      => ["motion",   "",      1,   2,   0,   12,   0,false, true, "" ],
  152.   "死亡"            => ["motion",   "_1",    1,   1,   0,   12,   0, true,false, "" ],
  153.   "魔法"            => ["motion",   "_1",    1,   0,   3,   12,   0, true,false, "" ],
  154.   "特技"            => ["motion",   "_1",    2,   0,   3,   12,   0, true,false, "" ],
  155.   "面向右边待机"    => ["motion",     "",    3,   0,   4,   12,   0, true, true, "待机武器M" ],
  156.   "胜利动作"        => ["motion",     "",    0,   0,   1,   6,    0, true, true, "" ],
  157.   
  158.   #―动作名(移动系)―    判别       后缀   纵行 横行 模式 速度  Z轴  循环   影    武器
  159.   "左移动画"        => ["motion",   "",    1,   0,   4,    6, 100, true, true, "待机武器" ],
  160.   "右移动画"        => ["motion",   "",    2,   0,   4,    6, 100, true, true, "待机武器M" ],
  161.    
  162.   #―动作名(攻击系)―    判别             纵行 横行 模式 速度  Z轴 循环   影    武器
  163.   "展示武器"        => ["motion",   "",    0,   0,   1,    2, 200,false, true, "纵摇摆"],
  164.   "展示盾牌"        => ["motion",   "",    0,   0,   1,    2, 200,false, true, "纵摇摆L"],
  165.   "展示盾牌和武器"  => ["motion",   "",    0,   0,   1,    2, 200,false, true, "纵摇摆","纵摇摆L"],
  166.   "盾防御"          => ["motion",   "",    1,   0,   1,    2, 200,false, true, "盾"],
  167.   "武器拳套"        => ["motion",   "",    1,   0,   1,    2, 200,false, true, "拳戳刺" ],
  168.   "用武器横戳"      => ["motion",   "",    1,   0,   1,    2, 200,false, true, "戳刺" ],
  169.   "举起武器"        => ["motion",   "",    1,   0,   1,    2, 200,false, true, "举起" ],
  170.   "展示弓"          => ["motion",   "",    1,   0,   1,    2, 200,false, true, "弓"],
  171.   
  172. #--------------------------------------------------------------------------
  173. # ● 角色移动  敌人将做反向的移动
  174. #--------------------------------------------------------------------------
  175.   # 目標…设置目标坐标的参照物。正数参照现在的位置,负数参照初期位置,如果你不想设置输入-7
  176.   #       [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标] [6=画面]
  177.   # X轴…对象的X坐标
  178.   # Y轴…对象的Y坐标
  179.   # H轴…对象的H坐标(距离地面的高度) nil为只有XY方向移动
  180.   # 速度…每帧移动的像素数。负数指定时间,得到帧的总数量。
  181.   # 曲线…移动时的曲线轨道、负数则弯曲向下。
  182.   # 跳跃…抛物线轨道。[从开始到顶点, 从顶点下落]
  183.   # 动画…移动时播放的动画名。

  184.   #――动作名(系统系)―― 判别 目標  X轴  Y轴  H轴 速度  曲线  跳跃    动画
  185.   "战斗前我方配置"  => ["move",-7, 180,   0,   0,  0,   0, [  0,  0], "待机"],
  186.   "退场"            => ["move",-7, 180,   0,   0,  7,   0, [  0,  0], "右移动画"],
  187.   "逃跑途中"        => ["move",-7,  80,   0,   0,  7,   0, [  0,  0], "右移动画"],
  188.   "输入命令移动"    => ["move",-7, -20,   0, nil,-10,   0, [  0,  0], "待机"],
  189.   "受到伤害时后退"  => ["move", 0,  20,   0, nil,-10,   0, [  0,  0], ""],
  190.   "受到暴击时后退"  => ["move", 0,  60,   0, nil,-10,   0, [  0,  0], ""],
  191.   
  192.   #――动作名(复位系)――  判别 目標 X轴  Y轴  H轴 速度  曲线   跳跃    动画
  193.   "坐标复位早"       => ["move",-7,   0,   0,   0,-10,   0, [  0,  0], "右移动画"],
  194.   "坐标复位"         => ["move",-7,   0,   0,   0,-20,   0, [  0,  0], "右移动画"],
  195.   "坐标复位曲线"     => ["move",-7,   0,   0,   0,-20,  -2, [  0,  0], "右移动画"],
  196.   "坐标复位面向左"   => ["move",-7,   0,   0,   0,-20,   0, [  0,  0], "待机"],
  197.   
  198.   #――动作名(自身系)――   判别  目標 X轴  Y轴  H轴 速度  曲线   跳跃    动画
  199.   "前移一步"           => ["move", 0, -20,   0,   0,-10,   0, [  0,  0], "左移动画"],
  200.   "后退一步"           => ["move", 0,  20,   0,   0,-10,   0, [  0,  0], "左移动画"],
  201.   "前跳一步"           => ["move", 0, -30,   0,   0,-10,   0, [ 20,-20], "左移动画"],
  202.   "后跳一步"           => ["move", 0,  30,   0,   0,-10,   0, [ 20,-20], "左移动画"],
  203.   "胜利动作"           => ["move", 0,  10,   0,   0,-25,   0, [ 30,-30], "待机(固定)"],
  204.   "胜利跳跃武器"       => ["move", 0,   0,   0,   0,-15,   0, [ 20,  0], "举起武器"],
  205.   "胜利跳跃着地"       => ["move",-7,   0,   0,   0,-10,   0, [  0,  0], "展示武器"],
  206.   "飞起"               => ["move", 0,   0,   0,  20, -2,   0, [  0,  0], ""],
  207.   "降落"               => ["move", 0,   0,   0, -20, -2,   0, [  0,  0], ""],
  208.   
  209.   #――动作名(目標系)――   判别  目標  X轴  Y轴  H轴 速度  曲线   跳跃    动画
  210.   "移动到目标面前"      => ["move", 1,  30,   0,   0,-20,   0, [  0,  0], "左移动画"],
  211.   "移动到目标后方"      => ["move", 1, -60,   0,   0,-20,   0, [  0,  0], "左移动画"],
  212.   "移动到目标身上"      => ["move", 1,   0,   0,   0,-10,   0, [  0,  0], "左移动画"],
  213.   "跳到目标头上"        => ["move",-1,   0,   0, 100,-20,   0, [ 40,-20], "举起武器"],
  214. "移动到敌人身上并展示武器"=> ["move",-1,   0,   0,   0,-10,   0, [  0,  0], "展示武器"],
  215.   
  216. #--------------------------------------------------------------------------
  217. # ● 武器动画
  218. #--------------------------------------------------------------------------
  219.   # 类型…[0…使用图标Icons]
  220.   #       [1…独自图像(图像名使用默认的武器设定名。位于Characters文件夹下)]
  221.   #       [2…动画元素(仿RM2003。像角色行走图一样的动画图像。图像名使用默认的武器设定名。位于Characters文件夹下)]
  222.   # 移动…图像移动距离。[X轴, Y轴]
  223.   # 調整…微整武器坐标。[X轴, Y轴]
  224.   # 始度…动作前开始角度。顺指针0~360度。負逆时针
  225.   # 終度…动作后角度
  226.   # 原点…图像原点。[0…中心] [1…左上] [2…右上] [3…左下] [4…右下] [5…与角色相同]
  227.   # 翻转…设置为true水平翻转表示图像
  228.   # 放大…[X轴放大率, Y轴放大率] 允许使用浮点数。
  229.   # Z轴…图像是否显示在手的前方,如果是true
  230.   # 逆手…是否显示右手武器的图像(盾牌或者二刀流)
  231.   # 更新…-1与角色动画同时更新。如果你想独立更新 [更新时间间隔, 更新格子数, 是否循环]
  232.   #         
  233.   # 后缀…虽然你已经设定了武器(副武器)的图像。
  234.   #          如果你设置了后缀,那么新的文件名将加上后缀。
  235.   #          例) "纵摇摆"加后缀"" => 图像文件名"IconSet"
  236.   #          例) "纵摇摆2"加后缀"_1" => 图像文件名"IconSet_1"
  237.   #          如果你使用图标文件,在System下,独立动画在Characters下
  238.   #         
  239.   # 图像…如果你想直接指定武器名在这里输入,会忽略头部的图标设定。
  240.   #      图像放在Characters文件夹下。
  241.   
  242.   #―动作名―    判别  类型   移动      調整   始度 終度 原点  翻转   放大    Z轴   逆手   更新   后缀  图像
  243.   "纵摇摆"    => ["wp", 0,[  6, 0],[ -4,-10], -45,  45,  4, false, [1,1], false, false,   -1,   "",    ""],
  244.   "待机武器"  => ["wp", 0,[  6,-4],[ -4, -8],   10, 10,  4, false, [1,1], false, false,   -1,   "",    ""],
  245.   "待机武器M" => ["wp", 0,[  6,-4],[ -8,-12],   30, 30,  4,  true, [1,1],  true, false,   -1,   "",    ""],
  246.   "盾"        => ["wp", 0,[  0, 0],[ 12,  0],   0,   0,  4, false, [1,1],  true,  true,   -1,   "",    ""],
  247.   "纵摇摆L"   => ["wp", 0,[  6, 0],[  0, -8],-135,  45,  4, false, [1,1],  true,  true,   -1,   "",    ""],
  248.   "拳戳刺"    => ["wp", 0,[-20, 0],[  5,  5], -45, -45,  4, false, [1,1], false, false,   -1,   "",    ""],
  249.   "戳刺"      => ["wp", 0,[-25, 0],[ 25,-10],  45,  45,  4, false, [1,1], false, false,   -1,   "",    ""],
  250.   "举起"      => ["wp", 0,[  6,-4],[ -4,-10],  90, -45,  4, false, [1,1], false, false,   -1,   "",    ""],
  251.   
  252.   #―2003仕様―   判别  タイプ   移动      調整   始度 終度 原点 翻转   放大    Z轴   逆手   更新  インデックス  图像
  253.   "弓"        => ["wp", 0,[  1, 0],[  -1,  0],   50,   45,  5, false, [1,1],  true, false,   -1,   "",    ""],
  254.   
  255.   # 飞行类武器    判别 タイプ    移动     調整   始度 終度 原点   翻转   放大    Z轴   二刀     更新      インデックス   图像
  256.   "箭支"      => ["wp", 0,[  0, 0],[  0,  0],   0,  45,  0, false, [1,1],  true, false,[2,6,false],   "",    "arrow01"],
  257.   "旋转"      => ["wp", 0,[  0, 0],[  0,  0],   0, 360,  0, false, [1,1],  true, false,[1,8, true],   "",    ""],
  258.   
  259. #--------------------------------------------------------------------------
  260. # ● 武器飞行动画 让子弹飞
  261. #--------------------------------------------------------------------------
  262.   # ID…数据库的动画ID。0动画不表示。[移动过程动画ID, 命中的动画ID]
  263.   # 始…动画移动开始位置。如果你输入负数,则在多个目标上只播放一个动画。
  264.   #     [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标] [6=画面]
  265.   # 后…动画移动结束位置。如果你输入负数,则在多个目标上只播放一个动画。
  266.   #     [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标] [6=画面]
  267.   # 始調整…移动开始坐标调整。[X轴, Y轴] 敌人进行负向计算
  268.   # 后調整…移动结束坐标调整。[X轴, Y轴]
  269.   # 速度…在X轴上每帧移动的像素数。如果你设置负数,打击速度将根据距离改变 ???
  270.   # 类型…移动后处理方法。[0=消失] [1=贯穿] [2=消失??]
  271.   # 軌道…移动軌道。[从开始到顶点, 从顶点到结束]
  272.   # Z轴…是否允许武器覆盖角色
  273.   # 等待…动画结束是否等待动作true [移动过程动画等待, 命中时动画等待]
  274.   # 伤害…运动到目标时计算伤害
  275.   # 归位…运动完是否归位(回旋镖)
  276.   # 镜头…是否允许镜头缩放
  277.   # 循环…是否允许循环
  278.   # 翻转不可…在任何情况下动画不翻转设置为true
  279.   # 武器…武器动作名。利用否则""
  280.   
  281.   #――动作名――       判别     ID   始 后   始調整   后調整  速度 类型  軌道    Z轴       循环       伤害   归位    镜头   循环 翻转不可   武器
  282.   "箭支发射WT"     => ["m_a",[ 0,-1], 0, 1, [ 0, 0], [ 0, 0], 20,  0, [ 0, 0], true, [ true, true],  true,  true,  true, false, false,  "箭支"],
  283.   "箭支发射"       => ["m_a",[ 0,-1], 0, 1, [ 0, 0], [ 0, 0], 20,  0, [ 0, 0], true, [false,false],  true,  true,  true, false, false,  "箭支"],
  284.   "水鉄砲发射"     => ["m_a",[69,69], 0, 1, [ 0, 0], [ 0, 0], 10,  0, [ 0, 0], true, [ true, true],  true,  true,  true,  true, false,  ""],
  285.   "武器投掷开始"   => ["m_a",[ 0,-1], 0, 1, [ 4,-6], [ 0, 0], 10,  2, [-3,-3], true, [ true,false],  true,  true,  true, false, false,  "旋转"],
  286.   "武器投掷戻し"   => ["m_a",[ 0, 0], 1, 0, [ 0, 0], [ 4,-6], 10,  0, [ 3, 3], true, [ true,false], false,  true,  true, false, false,  "旋转"],
  287.   
  288. #--------------------------------------------------------------------------
  289. # ● 战斗动画
  290. #--------------------------------------------------------------------------
  291.   # ID…数据库动画ID。-1主武器动画  -2副武器动画
  292.   #                 -3技能设置的动画
  293.   # 对象…[0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标]
  294.   
  295.   #―动作名(伤害系)―      判别    ID 对象  归位    循环   伤害   镜头 翻转不可   翻转  Z轴
  296.   "对象动画武器"      => ["anime",  -1,  1, false, false,  true,  true, false,  false,  true],
  297.   "对象动画武器WT"    => ["anime",  -1,  1, false,  true,  true,  true, false,  false,  true],
  298.   "对象动画武器LWT"   => ["anime",  -2,  1, false,  true,  true,  true, false,  false,  true],
  299.   "对象动画"          => ["anime",  -3,  1, false, false,  true,  true, false,  false,  true],
  300.   "对象动画WT"        => ["anime",  -3,  1, false,  true,  true,  true, false,  false,  true],
  301.   
  302.   #――动作名(自身系)――
  303.   "魔法咏唱中"          => ["anime", 113,  0,  true,  true, false,  true, false,  false,  true],
  304.   "特技待机中"          => ["anime", 114,  0,  true,  true, false,  true, false,  false,  true],
  305.   "魔法发动动画"      => ["anime", 115,  0, false,  true, false,  true, false,  false, false],
  306.   "特技发动动画"      => ["anime", 116,  0, false,  true, false,  true, false,  false, false],
  307.   
  308. #--------------------------------------------------------------------------
  309. # ● 镜头动画
  310. #--------------------------------------------------------------------------
  311.   # 对象…移动和缩放的对象
  312.   #      [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标] [6=画面]
  313.   # 調整坐标…镜头坐标的调整 [X轴(正方向画面→), Y轴(正方向画面↓)]
  314.   # 时间…镜头动作的时间
  315.   # 放大…镜头的放大率(%)。100原大小。
  316.   # 等待…是否等待镜头移动完成。如果是true。
  317.   
  318.   #――动作名――    判别    对象  調整坐标   放大率 时间  等待
  319.   "镜头复位"  => ["camera",   6, [   0,   0], 100,  40, false],
  320.   "放大"      => ["camera",   6, [   0, 100], 120,  40, false],
  321.   "缩小"      => ["camera",   6, [   0,   0],  80,  40, false],
  322.   
  323. #--------------------------------------------------------------------------
  324. # ● 画面晃动  空中(H坐标大于0)的角色不会晃动
  325. #--------------------------------------------------------------------------
  326.   # 方向…晃动的方向 [横,纵] 数值越大幅度越大
  327.   # 速度…摇晃的速度。
  328.   # 时间…摇晃的时间。摆动幅度会随着时间推移而减小
  329.   # 等待…是否等待镜头移动完成。如果是true。
  330.   
  331.   #――动作名――    判别      方向   速度  时间   等待
  332.   "晃动小"     => ["shake", [  0, 4],  2,    16, false],
  333.   "晃动中"     => ["shake", [  0, 6],  3,    30, false],
  334.   "晃动大"     => ["shake", [  0,12],  3,    40, false],
  335.   
  336. #--------------------------------------------------------------------------
  337. # ● 画面色调改变 改变背景和角色的色调
  338. #--------------------------------------------------------------------------
  339.   # 对象…色调改变对象
  340.   #       [0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标]
  341.   #       [6=背景] [7=自分+目标] [8=自分以外] [9=自分+目标以外] [10=所有]
  342.   # 色调…[ R, G, B, 强度, 时间, 返回]
  343.   #             返回…变更完成返回原来色调的时间。如果不则设置为0
  344.   # 等待…是否等待镜头移动完成。如果是true。
  345.   
  346.   # 改变名                        判别  对象     R,   G,   B, 强度  时间 返回  等待
  347.   "色调初始化"             => ["color",  10, [   0,   0,   0,   0,  30,   0], false],
  348.   "虚弱色调"               => ["color",   0, [ 255,  50,  50, 100,  40,  40], false],
  349.   "毒色调"                 => ["color",   0, [ 170,  50, 255, 170,  30,  30], false],
  350.   "泛用异常状态色调"       => ["color",    0, [ 255, 255,  50, 170,  40,  40], false],
  351.   "昏暗背景"               => ["color",   6, [   0,   0,   0, 255,  30,   0], false],
  352.   "自身和目标以外暗淡"     => ["color",   9, [   0,   0,   0, 255,  30,   0], false],
  353.    
  354. #--------------------------------------------------------------------------
  355. # ● 过渡 更变画面使用的过渡
  356. #--------------------------------------------------------------------------
  357.   # 执行"画面固定"操作运行之前请保持画面静止。
  358.   #
  359.   # 边界…边界的模糊值。越大越模糊。
  360.   # 时间…画面转变的时间。游戏画面在过渡时是静止的。
  361.   # 过渡文件名…。文件位于Pictures下。
  362.   
  363.   #―――动作名―――   判别  边界  时间  文件名
  364.   "圈圈过渡"         => ["ts",  40,   60,  "circle"],
  365.   
  366. #--------------------------------------------------------------------------
  367. # ● 幻影
  368. #--------------------------------------------------------------------------
  369.   # 数…幻影数。0用来关闭幻影。幻影越多程序负载越大
  370.   # 间隔…幻影间隔。单位帧。
  371.   # 处理…对幻影的处理。true为消失、false不消失
  372.   # 透明度…幻影透明度
  373.   
  374.   #――动作名――       判别     数  间隔  处理  透明度
  375.   "幻影ON"        => ["mirage",  4,   3,  true,  160],
  376.   "幻影OFF"       => ["mirage",  0,   0,  true,    0],
  377.   
  378. #--------------------------------------------------------------------------
  379. # ● 角色旋转 图像旋转
  380. #--------------------------------------------------------------------------
  381.   # 角色被旋转完成后角度会复位。
  382.   # 旋转中心是图像几何中心。武器动作不会播放。
  383.   #
  384.   # 时间…旋转时间。0会立即处理
  385.   # 始度…旋转开始时角度。0~360度。正逆时针,敌人计算相反
  386.   # 終度…旋转结束时角度。0~360度。
  387.   # 类型…旋转结束后处理。[0…旋转复位] [1…定在结束角度] [2…循环]

  388.   #――动作名――     判别    时间   始    終   类型
  389.   "右1旋转"      => ["angle",  12,    0, -360,   0],
  390.   "左1旋转"      => ["angle",  12,    0,  360,   0],
  391.   
  392. #--------------------------------------------------------------------------
  393. # ● 角色放大縮小 图像放大縮小
  394. #--------------------------------------------------------------------------

  395. # 角色被缩放完成后大小会复位。
  396.   # 武器动作不会播放。

  397.   # 时间…放大縮小时间。
  398.   # 开始大小…放大縮小开始时的大小。允许小数点。[X轴(横), Y轴(纵)]
  399.   # 结束大小…放大縮小结束时的大小。[X轴(横), Y轴(纵)]
  400.   # 类型…放大縮小结束后处理。[0…还原大小] [1…保持大小] [2…循环]

  401.   #――动作名――     判别   时间    开始大小     结束大小   类型
  402.   "横向缩放"      => ["zoom",  12,  [1.0, 1.0],  [0.5, 1.0],  0],
  403.   "纵向缩放"      => ["zoom",  12,  [1.0, 1.0],  [1.0, 0.5],  0],

  404. #--------------------------------------------------------------------------
  405. # ● 角色透明度操作 图像透明度改变
  406. #--------------------------------------------------------------------------
  407.   # 时间…透明度改变时间。
  408.   # 开始…改变开始时不透明度。0透明、255不透明
  409.   # 结束…改变结束时透明度
  410.   # 影…是否存在影子
  411.   # 武器…武器是否同时透明
  412.   # 循环…透明度更变完成后是否允许反向操作。
  413.   # 等待…是否等待透明度操作完成。
  414.   
  415.   #――动作名――         判别      时间  开始  结束    影    武器   循环  等待
  416.   "逃跑透明"         => ["opacity",   30,  255,   0,  true,  true, false, false],
  417.   "透明化"           => ["opacity",   60,  255,   0,  true,  true, false, false],
  418.   "透明化WT"         => ["opacity",   60,  255,   0,  true,  true, false,  true],
  419.   "透明化解除"       => ["opacity",   60,    0, 255,  true,  true, false, false],
  420.   "透明化解除WT"     => ["opacity",   60,    0, 255,  true,  true, false,  true],
  421.   
  422. #--------------------------------------------------------------------------
  423. # ● 气泡动画  源于事件中的气泡动画
  424. #--------------------------------------------------------------------------
  425.   # 类型…气泡类型(纵位置)
  426.   # 速度…更新速度。元素将从第二针开始播放
  427.   # 大小…气泡大小
  428.   
  429.   # 气泡名             判别      类型 速度  サイズ
  430.   "异常状态/泛用"   => ["balloon",   6,  10,  1],
  431.   "异常状态/虚弱"   => ["balloon",   5,  10,  1],
  432.   "异常状态/睡眠"   => ["balloon",   9,  10,  1],
  433.   
  434. #--------------------------------------------------------------------------
  435. # ● 图片显示
  436. #--------------------------------------------------------------------------
  437.   # 番号…使用图片的编号。用于管理图片。可以显示任意数量的图片
  438.   #       所有动画结束然后自动擦除(Bitmap解放)
  439.   # 开始坐标…移动开始位置。图片的左上为原点。[X轴, Y轴]
  440.   #           如果图片已经出现,留空[]将设置为默认的地方。
  441.   # 结束坐标…移动结束位置。如果你只是显示图片,把它设定为和开始坐标一样。
  442.   #           使用平面时设置开始坐标和结束坐标为空[]
  443.   # 时间…移动时间。0用于擦除图片。
  444.   # Z轴…图片的Z坐标。100以上则显示在角色上方
  445.   # 透明度…透明度設定。[初始透明度, 每1帧增加的透明度]
  446.   # 平面使用…平面类(图像被放置的像瓷砖)使用的矩形。[X轴,Y轴]
  447.   #            如果不使用平面请留空[]
  448.   # BA反転…被偷袭时是否逆向显示图片。
  449.   #         使用平面时也一样。
  450.   # 图片文件名…存放在pictures内的文件名。

  451.   #                      判别  番号  开始坐标      结束坐标   时间 Z轴   透明度    平面使用   BA翻转    文件名
  452.   "插入A1"          => ["pic",  0, [-300,   8], [ 100,   8],  30, 50, [  0, 10],        [],  true, "示例图片_01"],
  453.   "插入A2"          => ["pic",  0, [-300,   8], [ 100,   8],  30, 90, [  0, 10],        [],  true, "Actor4-2"],
  454.   "插入A3"          => ["pic",  0, [-300,   8], [ 100,   8],  30, 90, [  0, 10],        [],  true, "Actor5-2"],
  455.   "插入A4"          => ["pic",  0, [-300,   8], [ 100,   8],  30, 90, [  0, 10],        [],  true, "Actor5-3"],
  456.   "插入終"          => ["pic",  0,          [], [ 600,   8],  30, 90, [255,  0],        [],  true, ""],
  457.   "插入背景始"      => ["pic",  1, [   0,   8], [ 100,   8],  10, 80, [  0, 10], [544,288],  true, "cutin_back"],
  458.   "插入背景終"      => ["pic",  1,          [],          [],  10, 80, [255, -7], [544,288],  true, ""],
  459.   "白色淡入"        => ["pic",  0, [   0,   0], [   0,   0],  50,500, [  0,  6],        [], false, "white"],
  460.   "白色淡出"        => ["pic",  0, [   0,   0], [   0,   0],  50,500, [255, -6],        [], false, "white"],
  461.   
  462. #--------------------------------------------------------------------------
  463. # ● 状态操作
  464. #--------------------------------------------------------------------------
  465.   # 对象…[0=自分] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二目标]
  466.   # 括展…对上面设置的对象进行拓展 [0=不] [1=随机1体] [2=自身除外]
  467.   # 操作…状态附加"+" 解除"-"
  468.   # ID…操作状态ID
  469.   
  470.   # 状态付与名                判别  对象  拡張 操作   ID
  471.   "战斗不能付与"         => ["sta",   0,   0,  "+",   [1]],
  472.   
  473. #--------------------------------------------------------------------------
  474. # ● FPS(游戏整体的速率)改变
  475. #--------------------------------------------------------------------------
  476.   # 游戏速率…60为默认值 
  477.   
  478.   #――动作名――   判别   速率
  479.   "慢速"       => ["fps",  15],
  480.   "常速"       => ["fps",  60],
  481.   
  482. #--------------------------------------------------------------------------
  483. # ● 角色图像改变
  484. #--------------------------------------------------------------------------
  485.   # 维持…战斗结束后是否继续保持更变后的状态。(永久改变)
  486.   # 指数…设置变身后角色行走图的位置
  487.   #        [0][1][2][3]
  488.   #        [4][5][6][7]
  489.   #
  490.   # 文件名…行走图的文件名。位于Characters下
  491.   #         敌人位于Battlers下
  492.   # 脸部…如果要改变角色脸部头像 [头像位置,文件名]
  493.   #        如果不改变留空[]
  494.   
  495.   #―――动作名―――      判别     维持   指数       文件        脸部
  496.   "化妆成狼"         => ["change", false,    6,    "Animal", [0, "Actor4"]],

  497. #--------------------------------------------------------------------------
  498. # ● 技能派生
  499. #--------------------------------------------------------------------------
  500.   # 习得…没有学习的技能是否允许被派生发动。
  501.   # 发动条件…派生的技能是否需要发动条件。
  502.   # 技能ID…派生的技能ID
  503.   
  504.   #―――动作名―――    判别   习得  条件 技能ID
  505.   "多段攻击に派生"   => ["der",  true,  false,   130],

  506. #--------------------------------------------------------------------------
  507. # ● 音效系统  BGM・BGS・SE
  508. #--------------------------------------------------------------------------
  509.   # 类别…音效"se"  背景音乐"bgm"  背景音效"bgs"
  510.   # 速率…50~150。
  511.   # 音量…50~150。
  512.   # 文件名…""BGM、BGS留空""则不改变任何数据。
  513.   
  514.   #――动作名――       判别     类别  速率  音量  文件名
  515.   "Bow1"          => ["sound",  "se", 100,  80, "Bow1"],
  516.   
  517. #--------------------------------------------------------------------------
  518. # ● 电影播放  ogv文件
  519. #--------------------------------------------------------------------------
  520.   # 文件名…要播放的文件名。在Movies文件夹下
  521.   
  522.   #――动作名――           判别     文件名
  523.   "死亡标志播放" => ["movie", "sample1"],
  524.   
  525. #--------------------------------------------------------------------------
  526. # ● 开关操作
  527. #--------------------------------------------------------------------------
  528.   # 开关如果被设置为负数将会只在SideView中进行操作。
  529.   #
  530.   # ON编号…放置在数列中的开关ID将被统一打开。
  531.   # OFF编号
  532.   #
  533.   #――动作名――       判别     ON编号   OFF编号
  534.   "スイッチNo1/ON"  => ["switch",  [ 1],   []],
  535.   "进入太空背景改变"=> ["switch",  [-4],   []],
  536.   "太空背景解除"  => ["switch",    [],   [-4]],
  537.   "魔方陣ON"        => ["switch",  [-5],   []],
  538.   "魔方陣OFF"       => ["switch",    [],   [-5]],
  539.   
  540. #--------------------------------------------------------------------------
  541. # ● 变量操作
  542. #--------------------------------------------------------------------------
  543.   # 变量编号
  544.   # 操作…[0=代入] [1=加法] [2=减法] [3=乘法] [4=除法] [5=求余]
  545.   # 操作数…指定一个数字作为操作的目标。如果为负数,则该数字指向的变量为实际操作数。
  546.   #
  547.   # ――动作名――     判别      変数No  操作  操作数
  548.   "変数No1/+1"     => ["variable",   1,     1,     1],
  549.   
  550. #--------------------------------------------------------------------------
  551. # ● 条件分歧 (游戏开关) 设置条件、动画的分歧
  552. #--------------------------------------------------------------------------
  553.   # 开关编号…如果是负数则只操作SideView的开关。
  554.   # 操作…ON-true、OFF-false
  555.   # 分歧…满足条件时的处理。
  556.   #       [0=执行下列动作] [1=取消执行操作] [2=动作结束]
  557.   #
  558.   #―――动作名―――        判别  开关号  条件  分歧
  559.   "スイッチNo1=ONで実行" => ["n_1",   1,   true,   0],
  560.   
  561. #--------------------------------------------------------------------------
  562. # ● 条件分歧 (变量)
  563. #--------------------------------------------------------------------------
  564.   # ID…变量的ID
  565.   # 数值…需要对比的数字。如果是负数,将比较该数字变量存储的数字。
  566.   # 条件…对比条件…[0=等于] [1=小] [2=大]
  567.   # 分歧…当满足条件时。
  568.   #       [0=执行以下操作:] [1=取消以下操作:] [2=全部动作取消]
  569.   #
  570.   #―――动作名―――       判别  ID 数值  条件  分歧
  571.   "変数No1=1で実行"      => ["n_2",   1,    1,    0,    0],

  572. #--------------------------------------------------------------------------
  573. # ● 条件分歧 (状态)
  574. #--------------------------------------------------------------------------
  575.   # 对象…要参照的对象 [0=自身] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  576.   # 状态ID…无论在任何状态下??
  577.   # 条件…[0=获得状态] [1=未获得此状态]
  578.   # 人数…在人数上需要满足的条件,0指全体
  579.   # 分歧…满足条件时执行的操作。
  580.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  581.   #
  582.   #―――动作名―――         判别   对象   ID   条件  人数  分歧
  583.   "死亡确认"             => ["n_3",   1,    1,    0,     1,   1],

  584. #--------------------------------------------------------------------------
  585. # ● 条件分歧 (技能)
  586. #--------------------------------------------------------------------------
  587.   # 对象…要参照的对象 [0=自分] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  588.   # 技能ID
  589.   # 条件…[0=可用] [1=不可用]
  590.   # 人数…在人数上需要满足的条件,0指全体
  591.   # 分歧…满足条件时执行的操作。
  592.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  593.   #
  594.   #―――动作名―――       判别  对象 ID  条件  人数  分歧
  595.   "強撃使用可限定"       => ["n_4",  0,   80,    0,    1,   0],

  596. #--------------------------------------------------------------------------
  597. # ● 条件分歧 (参数)
  598. #--------------------------------------------------------------------------
  599.   # 对象…要参照的对象 [0=自分] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  600.   # 种类…要比较参数的种类:
  601.   #       [1=Lv] [2=最大HP] [3=最大MP] [4=HP] [5=MP] [6=TP] [7=攻击力]
  602.   #       [8=防御力] [9=魔法力] [10=魔法防御] [11=敏捷性] [12=運]
  603.   #
  604.   # 数值…需要对比的条件。负数将使用最大值的百分比。(只限于HP MP TP)
  605.   # 条件…比较数字的条件…[0=相同] [1=小于] [2=大于]
  606.   # 人数…在人数上需要满足的条件,0指全体
  607.   # 分歧…满足条件时执行的操作。
  608.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  609.   #
  610.   #―――动作名―――       判别  对象  种类  数值  条件  人数  分歧
  611.   "HP50%以上で実行"      => ["n_5",  0,    4,  -50,    2,    1,   0],

  612. #--------------------------------------------------------------------------
  613. # ● 条件分歧 (装备)
  614. #--------------------------------------------------------------------------
  615.   # 对象… [0=自分] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  616.   # 类型…装备种类。 [0=武器] [1=防具]
  617.   # 装备ID…上述类型物品的装备。要指定多个装备则放于数组中统一设置[]。
  618.   #         如果指定为负数,则指该装备类型。
  619.   # 条件…[0=已装备] [1=为装备]
  620.   # 人数…在人数上需要满足的条件,0指全体
  621.   # 分歧…满足条件时执行的操作。
  622.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  623.   #
  624.   #―――动作名―――       判别  对象  类型     ID   条件  人数  分歧
  625.   "手斧限定"             => ["n_6",  0,    0,    [1],    0,    1,   0],
  626.   "拳限定"               => ["n_6",  0,    0,   [-2],    0,    1,   0],
  627.   "拳除外"               => ["n_6",  0,    0,   [-2],    0,    1,   1],
  628.   "弓限定"               => ["n_6",  0,    0,   [-6],    0,    1,   0],
  629.   "弓除外"               => ["n_6",  0,    0,   [-6],    0,    1,   1],
  630.   "拳弓除外"             => ["n_6",  0,    0,[-2,-6],    0,    1,   1],
  631.   
  632. #--------------------------------------------------------------------------
  633. # ● 条件分歧 (脚本) 
  634. #--------------------------------------------------------------------------
  635.   # 分歧…满足条件时执行的操作。
  636.   #       [0=执行下列操作:] [1=不执行下列操作:] [2=全部动作结束]
  637.   # 脚本…返回类型为布尔值(true,false)
  638.   #
  639.   #―――动作名―――       判别   分歧  脚本
  640.   "50%的概率执行"    => ["n_7",   0,  "rand(100) < 50"],
  641.   "角色限定"         => ["n_7",   0,  "@battler.actor?"],
  642.   "角色ID1限定"      => ["n_7",   0,  "@battler.actor? && @battler.actor_id == 1"],
  643.   "角色ID2限定"      => ["n_7",   0,  "@battler.actor? && @battler.actor_id == 2"],
  644.   "角色ID6限定"      => ["n_7",   0,  "@battler.actor? && @battler.actor_id == 6"],
  645.   "角色ID7限定"      => ["n_7",   0,  "@battler.actor? && @battler.actor_id == 7"],
  646.   "敌人限定"         => ["n_7",   0,  "!@battler.actor?"],
  647.   "敌人中止"         => ["n_7",   2,  "!@battler.actor?"],
  648.   "二刀流限定"       => ["n_7",   0,  "@battler.dual_wield?"],
  649.   
  650. #--------------------------------------------------------------------------
  651. # ● 第二个目标操作
  652. #--------------------------------------------------------------------------
  653.   # 第二目标:独立于指定的普通目标以外的目标。
  654.   # 如果你不想做任何事情,通常把它定为相同的目标。
  655.   #
  656.   # 对象…[0=自分] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二目标]
  657.   #
  658.   # INDEX…将限定目标方的引索值 INDEX = [指数, 判别]
  659.   #        指数…目标方的数值
  660.   #        判别…数值的条件 [0=不指定] [1=该指数为目标] [2=该指数以外]
  661.   #
  662.   # ID…目标角色(敌人)ID限定。0不限定
  663.   #     如果指定为负数,则该目标除外。
  664.   #
  665.   # 状态…限定为拥有该状态的目标。0不限定
  666.   #       如果设置为负数,限定为没有该状态的目标。
  667.   #
  668.   # 技能…限定为能使用该技能的目标。0不限定
  669.   #      如果设置为负数,则限定为不能使用该技能的目标。
  670.   #
  671.   # 参数…限定参数的目标 参数 = [种类, 数值, 判别]
  672.   #         种类…[0=不限定] [1=Lv] [2=最大HP] [3=最大MP] [4=HP] [5=MP] [6=TP]
  673.   #               [7=攻击力] [8=防御力] [9=魔法力] [10=魔法防御] [11=敏捷性] [12=运气]
  674.   #         数值…比较的参数数值。负数将指定为百分比(HP・MP・TP限定)
  675.   #         判别…数值的条件 [0=相同] [1=小于] [2=大于]
  676.   #
  677.   # 装备…限定装备与否的目标。 装备 = [类型, ID]
  678.   #       类型…[0=武器] [1=防具]
  679.   #       ID…可以将装备ID放入数组中[]。0不限定
  680.   #           如果指定为负数,则指装备类型。
  681.   #
  682.   # 拓展…拓展上述目标以外的目标 [0=不] [1=随机1体]  [2=除了自己]
  683.   # 操作…[0=不操作] [1=将第二目标更变为主目标]  [2=初始化第二目标]
  684.   
  685.   #――动作名――        判别 对象  INDEX  ID 状态技能  参数     装备   拓展 操作
  686.   "我方全员(除自身)" => ["s_t", 3, [ 0, 0], 0,  0,   0, [ 0, 0, 0], [ 0,[0]],  2,   0],
  687.   "全体"            => ["s_t", 4, [ 0, 0], 0, -1,   0, [ 0, 0, 0], [ 0,[0]],  0,   1],
  688.   
  689. #--------------------------------------------------------------------------
  690. # ● 调用公共事件
  691. #--------------------------------------------------------------------------
  692.   # ID…公共事件ID
  693.   # 等待…是否等待公共事件运行完成
  694.   #
  695.   #―――动作名―――        判别    ID   等待
  696.   "1号公共事件"       => ["common",  1,  true],
  697.   
  698. #--------------------------------------------------------------------------
  699. # ● 脚本操作
  700. #--------------------------------------------------------------------------
  701.   # 运行该脚本。
  702.   #
  703.   #―――动作名―――  
  704.   "测试脚本"            => ["p = 1 "],
  705.   
  706. #--------------------------------------------------------------------------
  707. # ● 其他 不允许设置的项目
  708. #--------------------------------------------------------------------------
  709.   # 伤害动画…遵循之前的Pop伤害设置。
  710.   # 翻转…图像的水平翻转。再次翻转则还原。
  711.   # 武器消去…强制不显示武器图像。
  712.   # 武器消去解除…解除强制不显示武器图像。
  713.   # 敌消失…运行消失的效果。用它来显示敌人的战斗不能
  714.   # 消失禁止…目标的HP减为0时不允许消失。一般用在连击技能发动前。
  715.   # 消失禁止解除…解除消失禁止。连击技能发动结束时请调用它。
  716.   # 待机取消…不执行待机动画。如战斗中发生事件。
  717.   # 待机取消解除…解除待机取消。
  718.   # 初期位置改变…将现在的坐标变为初期位置
  719.   # 初期位置改变解除…初期位置改变原坐标
  720.   # 强制…强制目标进行下一个动作
  721.   # 强制2…强制目标进行下两个动作
  722.   # 下一个行动者…当前角色行动立即结束,切换到下个行动者
  723.   # 个人开始…多目标行为时个人的动作,他是开始标志。
  724.   # 个人结束…个人动作结束标志
  725.   # 循环开始…"循环开始"到"循环结束"之间的动画反复执行
  726.   # 循环结束…
  727.    
  728.   #―――动作名―――       判别
  729.   "伤害动画"          => ["damage_anime"],
  730.   "翻转"              => ["mirror"],
  731.   "武器消去"          => ["weapon_off"],
  732.   "武器消去解除"      => ["weapon_on"],
  733.   "敌消失"            => ["normal_collapse"],
  734.   "禁止消失"          => ["no_collapse"],
  735.   "允许消失"          => ["collapse"],
  736.   "待机取消"          => ["non_motion"],
  737.   "待机取消解除"      => ["non_motion_cancel"],
  738.   "初期位置改变"      => ["change_base_position"],
  739.   "初期位置改变解除"  => ["set_base_position"],
  740.   "强制"              => ["force_action"],
  741.   "强制2"             => ["force_action2"],
  742.   "下一个行动者"      => ["next_battler"],
  743.   "个人开始"          => ["individual_start"],
  744.   "个人结束"          => ["individual_end"],
  745.   "循环开始"          => ["loop_start"],
  746.   "循环结束"          => ["loop_end"],
  747.   
  748. #--------------------------------------------------------------------------
  749. # ● 等待时间
  750. #--------------------------------------------------------------------------
  751.   # (例) "20" …等待20帧
  752.   #
  753.   # (例) "-20" …在0~20间随机等待
  754.    
  755. #--------------------------------------------------------------------------
  756. # ● 快捷命令
  757. #--------------------------------------------------------------------------
  758.   # 这些快捷命令可以让你减少工作强度
  759.   # 所以对于经常使用的操作可以在这里设置。
  760.   #
  761.   # [战斗动画]
  762.   # (例) "anime(20)" …播放数据库20号动画(有等待)
  763.   # (例) "anime(20,false)" …播放数据库20号动画(无等待)
  764.   # (例) "anime_me(20)" …对自身播放数据库20号动画(有等待)
  765.   # (例) "anime_me(20,false)" …对自身播放数据库20号动画(有等待)
  766.   #
  767.   # [等待 延迟指数] 
  768.   # (例) "delay(12)"…指数1号等待0帧 2号等待12帧  3号等待24帧…
  769.   #
  770.   # [效果音(SE)]
  771.   # (例) "se('Bow1')" …播放'Bow1'SE文件
  772.   # (例) "se('Bow1',50)" …播放'Bow1'SE文件并且音量为50
  773.   #
  774.   # [强制执行动画(全部动作)]
  775.   # (例) "target('受到伤害时后退')" …目标强制执行"受到伤害时后退"
  776.   # (例) "target2('受伤')" …第二目标强制执行"受伤"
  777.    
  778.   }  
  779. #==============================================================================
  780. # ■ 动画表
  781. #==============================================================================
  782.   FULLACTION = {
  783.   
  784.   # ―――待机系―――
  785.   "通常待机"        => ["待机武器","待机"],
  786.   "通常待机固定"    => ["待机(固定)WT"],
  787.   "虚弱待机"        => ["异常状态/虚弱","虚弱色调","待机","待机"],
  788.   "防御待机"        => ["待机(固定)WT"],
  789.   "毒待机"          => ["异常状态/泛用","毒色调","待机","待机","敌人限定","80"],
  790.   "睡眠待机"        => ["异常状态/睡眠","敌人限定","40","敌人中止","死亡","死亡"],
  791.   "泛用异常状态待机" => ["异常状态/泛用","泛用异常状态色调","待机","待机","敌人限定","80"],
  792.   "等待"            => ["待机","60"],
  793.   "战斗不能"        => ["死亡"],
  794.   
  795.   # ――システム系――
  796.   "战斗开始我方"    => ["战斗前我方配置","delay(4)","坐标复位面向左"],
  797.   "我方退场"        => ["退场"],
  798.   "逃跑"            => ["镜头复位","delay(4)","退场"],
  799.   "敌逃跑"          => ["对象动画","逃跑透明","退场"],
  800.   "逃跑失败"        => ["镜头复位","delay(4)","逃跑途中","后退一步","坐标复位面向左"],
  801.   "输入命令"        => ["输入命令移动"],
  802.   "输入命令后"      => ["坐标复位早"],
  803.   "命令后防御"      => ["坐标复位早","循环开始","待机(固定)WT","循环结束"],
  804.   "命令后魔法"      => ["坐标复位早","待机(固定)","循环开始","魔法咏唱中","循环结束"],
  805.   "命令后特技"      => ["坐标复位早","待机(固定)","循环开始","特技待机中","循环结束"],
  806.   "防御"            => ["对象动画","待机(固定)WT"],
  807.   "回避"            => ["角色限定","右1旋转","后跳一步","10","坐标复位面向左"],
  808.   "盾躲避"          => ["se('Evasion2')","盾防御","60"],
  809.   "保护开始"        => ["移动到目标身上","初期位置改变"],
  810.   "保护结束"        => ["初期位置改变解除","坐标复位面向左"],
  811.   "被保护开始"      => ["后退一步","后退一步","待机(固定)WT"],
  812.   "被保护结束"      => ["坐标复位面向左"],
  813.   "胜利姿势摇摆"    => ["胜利动作","120"],#"胜利跳跃武器","胜利跳跃着地","120"],
  814.   "后空翻姿势"      => ["右1旋转","胜利动作","拳限定","武器拳套","拳除外","展示武器","120"],
  815.   
  816.   # ―リ动画系―
  817.   "受伤"            => ["受到伤害时后退","坐标复位面向左"],
  818.   "被暴击"          => ["受到暴击时后退","坐标复位面向左"],
  819.   "纵揺れ"          => ["飞起","降落","飞起","降落","飞起","降落"],
  820.   
  821.   # ―快捷动作系―
  822.   "斬り"            => ["展示武器","对象动画武器","10"],
  823.   "拳"              => ["武器拳套","对象动画武器","10"],
  824.   "弓"              => ["Bow1","弓","箭支发射","9"],
  825.   "攻击"            => ["拳限定","拳","弓限定","弓","拳弓除外","斬り"],
  826.   "准备开始攻击"    => ["移动到目标面前","禁止消失","个人开始","二刀流限定","二刀左"],
  827.   "攻击结束返回"    => ["死亡确认","对象动画武器WT","个人结束","允许消失","下一个行动者","坐标复位"],
  828.   "二刀左"          => ["展示盾牌","对象动画武器LWT"],
  829.   "特技发动"        => ["前移一步","举起武器","特技发动动画"],
  830.   "魔法发动"        => ["前移一步","举起武器","魔法发动动画"],
  831.   "插入"            => ["插入背景始","插入分歧","70","插入終","插入背景終","20"],
  832.   "插入分歧"        => ["角色ID1限定","插入A1","角色ID2限定","插入A2","角色ID6限定","插入A3","角色ID7限定","插入A4"],
  833.   "死亡标志动画"    => ["白色淡入","50","死亡标志播放","白色淡出","50"],
  834.   "进入太空背景"    => ["昏暗背景","se('Blind',70)","30","进入太空背景改变","色调初始化"],
  835.   "太空背景解除"    => ["昏暗背景","50","太空背景解除","色调初始化"],
  836.   "魔方陣表示"      => ["se('Blind',70)","画面固定","魔方陣ON","サークル"],
  837.   "魔方陣消去"      => ["40","画面固定","魔方陣OFF","サークル"],
  838.   
  839.   # ――通常攻击系――
  840.   "通常攻击"        => ["准备开始攻击","待机(固定)","攻击结束返回"],
  841.   "斩击攻击"        => ["准备开始攻击","展示武器","攻击结束返回"],
  842.   "拳攻击"          => ["准备开始攻击","武器拳套","攻击结束返回"],
  843.   "横戳攻击"        => ["准备开始攻击","用武器横戳","攻击结束返回"],
  844.   "弓攻击"          => ["前移一步","禁止消失","个人开始","Bow1","弓",
  845.                         "箭支发射WT","个人结束","允许消失","坐标复位"],
  846.   
  847.   # ――技能系―――
  848.   "泛用技能"        => ["特技发动","展示武器","伤害动画","坐标复位"],
  849.   "泛用魔法"        => ["魔法发动","展示武器","伤害动画","坐标复位"],
  850.   
  851.   "水鉄砲"          => ["特技发动","展示武器","水鉄砲发射","坐标复位"],
  852.   "武器投掷"        => ["特技发动","Bow1","展示武器","6","待机(固定)","武器投掷开始","武器投掷戻し","坐标复位"],
  853.   "插入攻击"        => ["特技发动","插入","准备开始攻击","展示武器","攻击结束返回"],
  854.   "播放攻击"        => ["特技发动","待机(固定)","死亡标志动画","准备开始攻击","展示武器","攻击结束返回"],
  855.   "变身狼"          => ["特技发动","化妆成狼","待机(固定)","40","坐标复位"],
  856.   "5回攻击"         => ["特技发动","禁止消失","弓除外","移动到目标面前","攻击","攻击","攻击","攻击","攻击","允许消失","坐标复位"],
  857.   "技能派生"        => ["武器投掷","多段攻击に派生"],
  858.   "背景改变攻击"    => ["魔法发动","展示武器","缩小","进入太空背景","伤害动画","镜头复位","太空背景解除","坐标复位"],
  859.   "ピクチャ攻撃"    => ["魔法发动","魔方陣表示","举起武器","anime(80,false)","60","摇晃大","对象动画","魔方陣消去","坐标复位"],
  860.   "暗転攻击"        => ["特技发动","自身和目标以外暗淡","se('Laser',150)",
  861.                         "幻影ON","移动到目标面前","anime(35,false)","移动到目标后方","对象动画",
  862.                         "展示武器","20","色调初始化","坐标复位","幻影OFF"],
  863.   "空中攻击"        => ["特技发动","Bow1","前跳一步","跳到目标头上",
  864.                         "待机(固定)","左1旋转","10","anime(117,false)","移动到敌人身上并展示武器",
  865.                         "对象动画","晃动中","强制","纵揺れ","20",
  866.                         "后跳一步","坐标复位"],
  867.   
  868.   # ――物品系―――
  869.   "物品使用"     => ["移动到目标面前","待机(固定)","对象动画WT","坐标复位面向左"],
  870.   
  871.   "测试动作"     => ["插入A1"#"200","200","200","200","200","200","200","200","200","300"
  872.   
  873.   
  874.   
  875.   
  876.   ],
  877.   
  878.   }

  879. #==============================================================================
  880. # ■ 战斗计划
  881. #------------------------------------------------------------------------------
  882. #  战斗场景的控制管理
  883. #  游戏控制开关・SideView专用开关
  884. #==============================================================================
  885.   BATTLE_PROGRAM = {
  886.   
  887. #--------------------------------------------------------------------------
  888. # ● 开关控制
  889. #--------------------------------------------------------------------------
  890.   # 开关…程序控制开关。如果是负数将制定SideView专用的开关。
  891.   #       如果是off,被执行的程序将强制终止。
  892.   #       SideView专用开关将在战斗结束时被重置(全OFF)。
  893.   #       如果你想控制事件战斗前SideView专用开关操作,在事件脚本中加入
  894.   #       $sv_camera.switches[1] = true
  895.   #       (打开1号开关)
  896.   #
  897.   # ON编号…批量打开开关操作。如果是负数将制定SideView专用的开关。
  898.   #        统一操作的开关数组。
  899.   #         例…[1,2,-5] 将游戏开关1,2号和SideView专用开关5号打开。
  900.   #
  901.   # OFF编号…批量关闭开关操作。如果是负数将制定SideView专用的开关。
  902.   #          如果你不想则留空[]。
  903.   #
  904.   # 时间…对开关操作进行的延时动作(单位帧)
  905.   #       例如设置为100,将从程序开始时的100帧后进行开关操作。
  906.   #       [参考值] 30秒…1800 1分…3600 5分…18000 10分…36000 1小时…216000
  907.   #
  908.   # 随机修正…最终时间将由上述时间值至加上该修正的时间值。单位帧。
  909.   #          例如时间设置为300修正设置为300,开关最终时间将在300-600中随机打开。
  910.    
  911.   #――程序名――          判别    开关   ON番号  OFF番号  时间  修正值
  912.   "背景要塞"         => ["switch",  -1,   [-2],      [],  1200,     0],
  913.   "背景大海"         => ["switch",  -2,   [-3],      [],  2400,     0],
  914.   
  915. #--------------------------------------------------------------------------
  916. # ● SE/BGM/BGS播放  
  917. #--------------------------------------------------------------------------
  918.   # 开关…控制开关。如果是负数将制定SideView专用的开关。
  919.   #
  920.   # 种类…音效"se"  背景音乐"bgm"  背景音效"bgs"
  921.   #
  922.   # 音调…50~150
  923.   # 音量…50~150
  924.   # 文件名…如果留空则不改变当前的音效。
  925.    
  926.   #―程序名――          判别   开关   种类   音调 音量 文件名
  927.   "潮汐"           => ["sound",  -1, "bgs",  100,  80, "Sea"],
  928.   
  929. #--------------------------------------------------------------------------
  930. # ● 背景控制  对背景自动控制
  931. #--------------------------------------------------------------------------
  932.   # 开关…控制开关
  933.   #
  934.   # 种类…对操作的背景种类选择。1地面、2远景图
  935.   #
  936.   # 滚动速度…背景的卷动速度。[X轴, Y轴]
  937.   #            单位为每100帧移动的像素数。
  938.   #            高速移动时,1000是一个标准值。
  939.   #
  940.   # BA翻转…被偷袭时是否反向滚动背景。
  941.   #
  942.   # 图像…需要更变背景图的情况下输入。如果不改变留空""
  943.   #       地面位于Battlebacks1下,背景(远景)位于Battlebacks2下
  944.   #       如果设置了,将会永久改变。
  945.   #
  946.   # 填充图像…背景滚动时,为了时背景更自然化所使用的填充图像。
  947.   #
  948.   # 中断…当背景运行时突然显示其他背景时的处理方法。
  949.   #       允许被打断设置为true
  950.   #       不允许被打断设置为false(其他背景挂起当前背景完成后显示被挂起的背景)
  951.    
  952.   #――程序名――         判别   开关 种类     速度     BA翻转      图像       填充图像    中断
  953.   "远景右移动"      => ["scroll", -1,  1, [  40,    0],  true,  "",                 "",  true],
  954.   "海背景3改变"     => ["scroll", -2,  1, [ 120,    0],  true,  "Sea_ex03", "Sea_ex02",  true],
  955.   "海背景4改变"     => ["scroll", -3,  1, [  40,    0],  true,  "Sea_ex01", "Sea_ex04",  true],
  956.   "宇宙改变1"       => ["scroll", -4,  1, [   0,    0],  true,  "DarkSpace",        "", false],
  957.   "宇宙改变2"       => ["scroll", -4,  2, [   0,    0],  true,  "DarkSpace",        "", false],
  958.   
  959. #--------------------------------------------------------------------------
  960. # ● 周期图片 周期性出现的图片。比如大风或者魔法阵
  961. #--------------------------------------------------------------------------
  962.   # 开关…周期图片控制开关
  963.   # No.…对图片操作的编号。
  964.   # 移动速度…每100帧移动的像素数。[X轴, Y轴] 如果设置为零则与背景同时滚动
  965.   # 间隔…图片出现周期间隔。单位1帧。0表示无限制循环
  966.   #
  967.   # 透明操作…图像的透明度操作。[初始透明度, 每100帧增加的透明度]
  968.   #           如果回到起始透明度255,会重复。
  969.   # Z轴…图像的Z坐标。100以上会被现实到窗口前面。
  970.   # 允许晃动…如果允许晃动则设置为true
  971.   # BA翻转…被偷袭时是否反向播放图片。
  972.   # 文件名…位于Pictures文件夹下。
  973.    
  974.   #――程序名――       判别   开关 No.    速度     间隔   透明操作   Z轴 允许晃动 BA翻转   文件名
  975.   "大风"           => ["kpic", -1,  0,[ 500,   0],   0, [ 255,   0], 90, false,  true, "back_wind"],
  976.   
  977. #--------------------------------------------------------------------------
  978. # ● 周期SE 周期响起se音效。如雷鸣。
  979. #--------------------------------------------------------------------------
  980.   # 开关…控制音效的开关。
  981.   # 周期…音效出现的周期。单位帧。
  982.   # 随机修正…周期会增加该随机值作为修正值。
  983.   #
  984.   # 音调。50~150。
  985.   # 音量…50~150。
  986.   # 开始执行…如果设置为true则打开开关时立即播放音效。
  987.   # 文件名…
  988.    
  989.   #――程序名――       判别    开关 周期  修正  音调 音量 开始执行  文件名
  990.   "海鸥"         => ["keep_se", -1,  400,  100, 150, 60,  false,  "Crow"],
  991.   "海鸥2"        => ["keep_se", -1,  300,  200, 140, 45,   true,  "Crow"],
  992.   
  993. #--------------------------------------------------------------------------
  994. # ● 周期晃动 如地震、船上场合。
  995. #--------------------------------------------------------------------------
  996.   # 开关…对晃动进行控制的开关。设置为ON则开始晃动。
  997.   # 周期…晃动的周期。单位帧。
  998.   # 随机修正…周期会增加该随机值作为修正值。
  999.   #
  1000.   # 方向…晃动的方向 [横,纵] 数字越大幅度越大。
  1001.   # 速度…摇晃的速度。越小越快。
  1002.   # 时间…摇晃持续时间。摇晃的幅度会随着时间推移而减轻。
  1003.   # 开始执行…如果打开则立即执行不需要等待周期。
  1004.    
  1005.   #―程序名――        判别   开关  周期  修正  方向   速度  时间 开始执行
  1006.   "船摇摆"      => ["keep_sk", -1,  130,   0,[  0, 4], 80,  120,  true],
  1007.   
  1008. #--------------------------------------------------------------------------
  1009. # ● 周期色调改变 
  1010. #--------------------------------------------------------------------------
  1011.   # 开关…控制色调改变的开关。
  1012.   # 周期…单位帧。
  1013.   # 随机修正…周期会增加该随机值作为修正值。
  1014.   #
  1015.   # 对象…色调改变对象 [0=背景] [1=敌全] [2=我方全] [3=敌我方全] [4=全部]
  1016.   # 色调…[ R, G, B, 强度, 改变时间, 回归]
  1017.   #             回归…改变完成后回归原色调需要的时间。设置为0则不回归。
  1018.   # 开始执行…如果打开则立即执行不需要等待周期。
  1019.   
  1020.   #――程序名――     判别   开关 周期  修正  对象  R,  G, B, 强度 时间 回归  开始执行
  1021.   "雷光"       => ["keep_c",  0,  300,  100,  4,[255,255,255,255,  8,   8],  true],
  1022.   "紧急"       => ["keep_c",  0,  150,    0,  4,[255,  0,  0,100, 40,  40],  true],
  1023.    
  1024. }
  1025. #==============================================================================
  1026. # ■ 镜头设置
  1027. #------------------------------------------------------------------------------
  1028. #  在这里设置镜头改变的时机以及参数。
  1029. #  请不要改变名称。
  1030. #==============================================================================
  1031.   BATTLE_CAMERA = {
  1032. #--------------------------------------------------------------------------
  1033. # ● 镜头  画面的缩放或者移动。
  1034. #--------------------------------------------------------------------------
  1035.   # 对象…操作的对象 [2=敌全] [3=我方全] [4=敌我方全] [6=画面]
  1036.   # 調整坐标…镜头最终坐标的微调 [X轴(正方向→), Y轴(正方向↓)]
  1037.   # 时间…镜头调整的用时。
  1038.   # 放大率…100为原大小。
  1039.   
  1040.   #――动作名――       判别    对象 調整坐标 放大率 时间
  1041.   "回合开始前"   => ["camera",   3, [ 0,   0], 100, 40],
  1042.   "回合开始后"   => ["camera",   6, [ 0,   0], 100, 40],
  1043.   "战斗结束时"   => ["camera",   3, [ 0,   0], 100, 50],
  1044.   
  1045. }  
  1046. end
复制代码


SideView图像设定部分
  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核心脚本部分
  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. # ■ module N03
  1494. #------------------------------------------------------------------------------
  1495. #  サイドビューバトルのモジュールです。
  1496. #==============================================================================
  1497. module N03
  1498.   #--------------------------------------------------------------------------
  1499.   # ● バトラーの敵グループを取得
  1500.   #--------------------------------------------------------------------------
  1501.   def self.get_enemy_unit(battler)
  1502.     return $game_troop if battler.actor?
  1503.     return $game_party
  1504.   end
  1505.   #--------------------------------------------------------------------------
  1506.   # ● バトラーの味方グループを取得
  1507.   #--------------------------------------------------------------------------
  1508.   def self.get_party_unit(battler)
  1509.     return $game_party if battler.actor?
  1510.     return $game_troop
  1511.   end
  1512.   #--------------------------------------------------------------------------
  1513.   # ● 戦闘アニメ時間の取得
  1514.   #--------------------------------------------------------------------------
  1515.   def self.get_anime_time(anime_id)
  1516.     return 0 if anime_id <= 0
  1517.     return $data_animations[anime_id].frame_max * 4
  1518.   end
  1519.   #--------------------------------------------------------------------------
  1520.   # ● 攻撃アニメの取得
  1521.   #--------------------------------------------------------------------------
  1522.   def self.get_attack_anime_id(kind, battler)
  1523.     return $data_skills[battler.sv.counter_id].animation_id if kind == -3 && battler.sv.counter_id != 0
  1524.     case kind
  1525.     when -1 ; anime_id = battler.atk_animation_id1
  1526.     when -2 ; anime_id = battler.atk_animation_id2
  1527.     when -3
  1528.       if battler.current_action != nil
  1529.         anime_id = battler.current_action.item.animation_id if battler.current_action.item != nil
  1530.       end
  1531.     else    ; anime_id = kind
  1532.     end
  1533.     case anime_id
  1534.     when -1 ; anime_id = battler.atk_animation_id1
  1535.     when -2 ; anime_id = battler.atk_animation_id2
  1536.     end
  1537.     return anime_id if anime_id
  1538.     return 0
  1539.   end  
  1540.   #--------------------------------------------------------------------------
  1541.   # ● 戦闘アニメデータをセット
  1542.   #--------------------------------------------------------------------------
  1543.   def self.set_damage_anime_data(targets, target, data)
  1544.     return if !first_of_all_screen_anime(data[0], target, targets)
  1545.     target.animation_id         = data[0]
  1546.     target.animation_mirror     = data[1]
  1547.     target.sv.anime_no_mirror   = data[2]
  1548.     target.sv.anime_camera_zoom = data[3]
  1549.     target.sv.anime_plus_z      = data[4]
  1550.   end   
  1551.   #--------------------------------------------------------------------------
  1552.   # ● ターゲットの取得
  1553.   #--------------------------------------------------------------------------
  1554.   def self.get_targets(kind, battler)
  1555.     case kind.abs
  1556.     when 0 ; return [battler].dup
  1557.     when 1 ; return battler.sv.target_battler.dup
  1558.     when 2 ; return get_enemy_unit(battler).members.dup
  1559.     when 3 ; return get_party_unit(battler).members.dup
  1560.     when 4 ; return $game_troop.members.dup + $game_party.battle_members.dup
  1561.     when 5 ; return battler.sv.second_targets.dup
  1562.     end
  1563.   end  
  1564.   #--------------------------------------------------------------------------
  1565.   # ● ターゲットの座標を取得
  1566.   #--------------------------------------------------------------------------
  1567.   def self.get_targets_position(targets, horming, m_a = nil)
  1568.     return [0,0,0] if targets == nil && !$sv_camera.mirror
  1569.     return [Graphics.width,0,0] if targets == nil && $sv_camera.mirror
  1570.     x = y = h = 0
  1571.     for i in 0...targets.size
  1572.       x += targets[i].sv.base_x if !horming
  1573.       y += targets[i].sv.base_y if !horming
  1574.       h += targets[i].sv.base_h if !horming
  1575.       x += targets[i].sv.x if horming
  1576.       y += targets[i].sv.y if horming
  1577.       h += targets[i].sv.h if horming
  1578.       y -= targets[i].sv.ch * 100 if m_a == 0
  1579.       y -= targets[i].sv.ch * 50 if m_a == 1
  1580.     end
  1581.     return [x / targets.size, y / targets.size, h / targets.size]
  1582.   end
  1583.   #--------------------------------------------------------------------------
  1584.   # ● 速度を時間に変換
  1585.   #--------------------------------------------------------------------------
  1586.   def self.distanse_calculation(time, target_position, self_position, distanse_move)
  1587.     return time if !distanse_move
  1588.     distanse_x = self_position[0] - target_position[0]
  1589.     distanse_x = target_position[0] - self_position[0] if target_position[0] > self_position[0]
  1590.     distanse_y = self_position[1] - target_position[1]
  1591.     distanse_y = target_position[1] - self_position[1] if target_position[1] > self_position[1]
  1592.     if self_position[2] != nil && target_position[2] != nil
  1593.       distanse_h = self_position[2] - target_position[2]
  1594.       distanse_h = target_position[2] - self_position[2] if target_position[2] > self_position[2]
  1595.     else
  1596.       distanse_h = 0
  1597.     end
  1598.     distanse = [distanse_x, distanse_y, distanse_h].max
  1599.     return distanse / (time * 100) + 1
  1600.   end
  1601.   #--------------------------------------------------------------------------
  1602.   # ● 放物線移動計算
  1603.   #--------------------------------------------------------------------------
  1604.   def self.parabola(data, time, size, type = 1)
  1605.     move_data = data
  1606.     move_data[0] *= size
  1607.     move_data[1] *= size
  1608.     move = []
  1609.     move_d = []
  1610.     for i in 0...time / 2
  1611.       move[i] = move_data[0]
  1612.       move_d[i] = move_data[1]
  1613.       move_data[0] = move_data[0] * type / (1 + type)
  1614.       move_data[1] = move_data[1] * type / (1 + type)
  1615.     end
  1616.     move = move + move_d.reverse!
  1617.     move.reverse!
  1618.     adjust = move.inject(0) {|result, item| result + item }
  1619.     move[move.size - 1] += adjust if data[0] == data[1] && adjust != 0
  1620.     move.unshift(0) if time % 2 != 0
  1621.     return move
  1622.   end
  1623.   #--------------------------------------------------------------------------
  1624.   # ● 反転値
  1625.   #--------------------------------------------------------------------------
  1626.   def self.mirror_num(mirror)
  1627.     return 1 if !mirror
  1628.     return -1
  1629.   end  
  1630.   #--------------------------------------------------------------------------
  1631.   # ● カメラワーク
  1632.   #--------------------------------------------------------------------------
  1633.   def self.camera(battler, data)
  1634.     battler = $game_party.battle_members[0] if !battler
  1635.     cx = data[2][0] * 100
  1636.     cy = data[2][1] * 100
  1637.     return $sv_camera.move(cx, cy, data[3], data[4], true) if data[1] == 6
  1638.     targets = self.get_targets(data[1], battler)
  1639.     return if targets == nil or targets == []
  1640.     position = self.get_targets_position(targets, true)
  1641.     $sv_camera.move(position[0], position[1] - position[2], data[3], data[4], false)
  1642.   end
  1643.   #--------------------------------------------------------------------------
  1644.   # ● コラプス禁止
  1645.   #--------------------------------------------------------------------------
  1646.   def self.immortaling
  1647.     # 全員に不死身付与
  1648.     for member in $game_party.battle_members + $game_troop.members
  1649.       # イベント操作等で不死身設定になっていたら解除を無効にするフラグを立てる
  1650.       member.sv.immortal = true if member.state?(N03::IMMORTAL_ID)
  1651.       member.add_state(N03::IMMORTAL_ID)
  1652.     end
  1653.     return true
  1654.   end  
  1655.   #--------------------------------------------------------------------------
  1656.   # ● コラプス許可
  1657.   #--------------------------------------------------------------------------
  1658.   def self.unimmortaling
  1659.     # 全員の不死身化解除(イベント等で不死身設定がされていれば除く)
  1660.     for member in $game_party.battle_members + $game_troop.members
  1661.       next if member.dead?
  1662.       # 不死身ステートが行動中に解除されていた場合、解除無効を解除
  1663.       member.sv.immortal = false if !member.state?(N03::IMMORTAL_ID) && member.sv.immortal
  1664.       next member.sv.immortal = false if member.sv.immortal
  1665.       member.remove_state(N03::IMMORTAL_ID)
  1666.       next if member.hp != 0
  1667.       member.add_state(1)
  1668.       member.perform_collapse_effect
  1669.       member.sv.action_terminate
  1670.     end
  1671.     return false
  1672.   end  
  1673.   #--------------------------------------------------------------------------
  1674.   # ● スキル派生
  1675.   #--------------------------------------------------------------------------
  1676.   def self.derived_skill(battler)
  1677.     battler.force_action(battler.sv.derivation_skill_id, -2)
  1678.     BattleManager.unshift_action_battlers(battler)
  1679.   end
  1680.   #--------------------------------------------------------------------------
  1681.   # ● ダメージの作成
  1682.   #--------------------------------------------------------------------------
  1683.   def self.set_damage(battler, hp_damage, mp_damage)
  1684.     battler.result.hp_damage = hp_damage
  1685.     battler.result.mp_damage = mp_damage
  1686.   end
  1687.   #--------------------------------------------------------------------------
  1688.   # ● ターゲット生死確認
  1689.   #--------------------------------------------------------------------------
  1690.   def self.targets_alive?(targets)
  1691.     return false if targets == []
  1692.     for target in targets do return true if !target.dead? end
  1693.     return false
  1694.   end
  1695.   #--------------------------------------------------------------------------
  1696.   # ● ターゲットをセカンドターゲットへ
  1697.   #--------------------------------------------------------------------------
  1698.   def self.s_targets(battler)
  1699.     battler.sv.target_battler = battler.sv.second_targets
  1700.     return battler.sv.second_targets
  1701.   end  
  1702.   #--------------------------------------------------------------------------
  1703.   # ● セカンドターゲットをターゲットへ
  1704.   #--------------------------------------------------------------------------
  1705.   def self.targets_set(battler)
  1706.     battler.sv.second_targets = battler.current_action.make_targets.compact
  1707.     battler.sv.target_battler = battler.sv.second_targets
  1708.   end  
  1709.   #--------------------------------------------------------------------------
  1710.   # ● 戦闘アニメ実行判定 (対象:画面時は最初のターゲットのみアニメ実行)
  1711.   #--------------------------------------------------------------------------
  1712.   def self.first_of_all_screen_anime(anime_id, target, targets)
  1713.     anime = $data_animations[anime_id]
  1714.     return false if !anime
  1715.     return true if anime.position != 3
  1716.     return false if anime.position == 3 && target != targets[0]
  1717.     targets.delete(target)
  1718.     target.sv.timing_targets = targets
  1719.     return true
  1720.   end
  1721.   #--------------------------------------------------------------------------
  1722.   # ● 戦闘不能付加攻撃か
  1723.   #--------------------------------------------------------------------------
  1724.   def self.dead_attack?(battler, item)
  1725.     for state in battler.atk_states
  1726.       return true if state == battler.death_state_id
  1727.     end
  1728.     for effect in item.effects
  1729.       return true if effect.code == 21 && effect.data_id == battler.death_state_id
  1730.     end
  1731.     return false
  1732.   end
  1733. end

  1734. #==============================================================================
  1735. # ■ Sprite_Weapon
  1736. #------------------------------------------------------------------------------
  1737. #  ウエポン表示用のスプライトです。
  1738. #==============================================================================
  1739. class Sprite_Weapon < Sprite_Base
  1740.   #--------------------------------------------------------------------------
  1741.   # ● 公開インスタンス変数 
  1742.   #--------------------------------------------------------------------------
  1743.   attr_reader   :index                       # ウエポン画像配列のインデックス
  1744.   attr_reader   :battler                     # 画像が参照しているバトラー
  1745.   attr_reader   :move_time                   # 画像が目標に到達するまでの時間
  1746.   attr_reader   :through                     # 貫通フラグ
  1747.   attr_reader   :action_end                  # 武器アクション終了フラグ
  1748.   attr_reader   :action_end_cancel                  # 武器アクション終了フラグ
  1749.   attr_reader   :hit_position                # 画像が目標に到達した時の座標
  1750.   attr_accessor :hit_anime_id                # 画像が目標に到達した時のアニメID
  1751.   #--------------------------------------------------------------------------
  1752.   # ● オブジェクト初期化
  1753.   #--------------------------------------------------------------------------
  1754.   def initialize(viewport, index, battler)
  1755.     super(viewport)
  1756.     @index = index
  1757.     @battler = battler
  1758.     @position_x = @position_y = 0
  1759.     @o = 0
  1760.     @real_x = @real_y = 0
  1761.     @mirror = @battler.sv.mirror
  1762.     reset
  1763.     set_action
  1764.   end
  1765.   #--------------------------------------------------------------------------
  1766.   # ● 初期化
  1767.   #--------------------------------------------------------------------------
  1768.   def reset
  1769.     @z_plus = 0
  1770.     @weapon_data = []
  1771.     @move_data = []
  1772.     @move_x = 0
  1773.     @move_y = 0
  1774.     @orbit = []
  1775.     @through = false
  1776.     @distanse_move = false
  1777.     @weapon_width = 0
  1778.     @weapon_height = 0
  1779.     @anime_time = 0
  1780.     @anime_position = 1
  1781.     @move_time = 0
  1782.     @hit_anime_id = 0
  1783.     @move_anime = true
  1784.     @action_end = false
  1785.     @action_end_cancel = false
  1786.     reset_position
  1787.   end  
  1788.   #--------------------------------------------------------------------------
  1789.   # ● アクションをセット
  1790.   #--------------------------------------------------------------------------
  1791.   def set_action
  1792.     return if @battler.sv.effect_data == []
  1793.     weapon_anime if @battler.sv.effect_data[0][0] == "wp"
  1794.     move_anime if @battler.sv.effect_data[0][0] == "m_a"
  1795.     @battler.sv.effect_data.shift
  1796.   end
  1797.   #--------------------------------------------------------------------------
  1798.   # ● 武器アニメ実行
  1799.   #--------------------------------------------------------------------------
  1800.   def weapon_anime
  1801.     @weapon_data = @battler.sv.effect_data[0].dup
  1802.     set_graphics
  1803.     set_ox
  1804.     set_weapon_move
  1805.   end
  1806.   #--------------------------------------------------------------------------
  1807.   # ● アニメ移動実行
  1808.   #--------------------------------------------------------------------------
  1809.   def move_anime
  1810.     @move_data = @battler.sv.effect_data[0].dup
  1811.     # ターゲットを取得
  1812.     @target_battler = [@battler.sv.m_a_targets.shift]
  1813.     @target_battler = N03.get_targets(@move_data[3], @battler) if @move_data[3] < 0
  1814.     set_move
  1815.     return if @move_data[16] == ""
  1816.     weapon_data = N03::ACTION[@move_data[16]]
  1817.     return if weapon_data == nil
  1818.     @weapon_data = weapon_data.dup
  1819.     set_graphics
  1820.     set_ox
  1821.     set_weapon_move
  1822.   end
  1823.   #--------------------------------------------------------------------------
  1824.   # ● 武器画像を取得
  1825.   #--------------------------------------------------------------------------  
  1826.   def set_graphics
  1827.     # 武器に依存しない画像設定がある場合
  1828.     if @weapon_data[13] != ""
  1829.       self.bitmap = Cache.character(@weapon_data[13]).dup
  1830.       @weapon_width = self.bitmap.width
  1831.       @weapon_height = self.bitmap.height
  1832.       return
  1833.     end
  1834.     # 武器を取得
  1835.     weapon = @battler.weapons[0]
  1836.     # 逆手装備を取得
  1837.     if @weapon_data[10]
  1838.       weapon = nil
  1839.       for armor in @battler.armors do break weapon = armor if armor.is_a?(RPG::Armor) && armor.etype_id == 1 end
  1840.       weapon = @battler.weapons[1] if !weapon
  1841.     end  
  1842.     # 武器がなければ処理をキャンセル
  1843.     return if weapon == nil
  1844.     # インデックスを取得
  1845.     file_index = @weapon_data[12]
  1846.     # アイコンを利用するなら
  1847.     if @weapon_data[1] == 0
  1848.       icon_index = weapon.icon_index
  1849.       self.bitmap = Cache.system("Iconset" + file_index).dup
  1850.       self.src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1851.       @weapon_width = @weapon_height = 24
  1852.     # 独自画像指定
  1853.     else
  1854.       file_name = @battler.sv.weapon_graphic(weapon.id, weapon.wtype_id) if weapon.is_a?(RPG::Weapon)
  1855.       file_name = @battler.sv.shield_graphic(weapon.id, weapon.atype_id) if weapon.is_a?(RPG::Armor)
  1856.       self.bitmap = Cache.character(file_name + file_index).dup
  1857.       @weapon_width = self.bitmap.width
  1858.       @weapon_height = self.bitmap.height
  1859.       return if @weapon_data[1] == 1
  1860.       # 2003仕様の武器アニメ
  1861.       @weapon_width /= @battler.sv.max_pattern[0]
  1862.     end
  1863.   end
  1864.   #--------------------------------------------------------------------------
  1865.   # ● 画像の原点を取得
  1866.   #--------------------------------------------------------------------------  
  1867.   def set_ox
  1868.     # 反転時は設定を逆に
  1869.     if @mirror
  1870.       case @weapon_data[6]
  1871.       when 1 ; @weapon_data[6] = 2 # 左上→右上に
  1872.       when 2 ; @weapon_data[6] = 1 # 右上→左上に
  1873.       when 3 ; @weapon_data[6] = 4 # 左下→右下に
  1874.       when 4 ; @weapon_data[6] = 3 # 右下→左下に
  1875.       end
  1876.     end
  1877.     # 原点を設定
  1878.     case @weapon_data[6]
  1879.     when 0 # 中心
  1880.       self.ox = @weapon_width / 2
  1881.       self.oy = @weapon_height / 2
  1882.     when 1 # 左上
  1883.       self.ox = 0
  1884.       self.oy = 0
  1885.     when 2 # 右上
  1886.       self.ox = @weapon_width
  1887.       self.oy = 0
  1888.     when 3 # 左下
  1889.       self.ox = 0
  1890.       self.oy = @weapon_height
  1891.     when 4 # 右下
  1892.       self.ox = @weapon_width
  1893.       self.oy = @weapon_height
  1894.     when 5 # バトラーと同じ
  1895.       self.ox = @weapon_width / 2
  1896.       self.oy = @weapon_height
  1897.     end
  1898.   end  
  1899.   #--------------------------------------------------------------------------
  1900.   # ● バトラーの座標を取得
  1901.   #--------------------------------------------------------------------------  
  1902.   def set_battler_position
  1903.     @position_x = @battler.sv.x + @weapon_data[3][0] * N03.mirror_num(@mirror) * 100
  1904.     @position_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust) + @weapon_data[3][1] * 100
  1905.     reset_position
  1906.   end
  1907.   #--------------------------------------------------------------------------
  1908.   # ● 座標を初期化
  1909.   #--------------------------------------------------------------------------  
  1910.   def reset_position
  1911.     @real_x = @position_x / 100
  1912.     @real_y = @position_y / 100
  1913.     @real_zoom_x = 1
  1914.     @real_zoom_y = 1
  1915.   end
  1916.   #--------------------------------------------------------------------------
  1917.   # ● 戦闘アニメを表示
  1918.   #--------------------------------------------------------------------------  
  1919.   def set_animation(anime_id)
  1920.     return if $data_animations[anime_id] == nil
  1921.     @anime_position = $data_animations[anime_id].position
  1922.     @horming = true
  1923.     @horming = false if @anime_position == 3
  1924.     @anime_camera_zoom = true
  1925.     @anime_no_mirror = false
  1926.     start_animation($data_animations[anime_id], @mirror)
  1927.     timings = $data_animations[anime_id].timings
  1928.   end
  1929.   #--------------------------------------------------------------------------
  1930.   # ● ヒット時の戦闘アニメ実行
  1931.   #--------------------------------------------------------------------------  
  1932.   def set_hit_animation(position_data, hit_anime_id, target)
  1933.     return if $data_animations[hit_anime_id] == nil
  1934.     @real_x = position_data[0]
  1935.     @real_y = position_data[1]
  1936.     @position_x = position_data[0] * 100
  1937.     @position_y = position_data[1] * 100
  1938.     self.z = position_data[2]
  1939.     @z_plus = 1000
  1940.     @action_end = false
  1941.     @horming = true
  1942.     set_animation(hit_anime_id)
  1943.     @anime_time = $data_animations[hit_anime_id].frame_max * 4
  1944.     @timing_targets = [target]
  1945.     @move_time = @hit_anime_id = 0
  1946.     @weapon_data = []
  1947.   end
  1948.   #--------------------------------------------------------------------------
  1949.   # ● タイミングバトラー追加
  1950.   #--------------------------------------------------------------------------  
  1951.   def timing_battler_set(target)
  1952.     @timing_targets.push(target)
  1953.   end
  1954.   #--------------------------------------------------------------------------
  1955.   # ● 武器の動きを取得
  1956.   #--------------------------------------------------------------------------  
  1957.   def set_weapon_move
  1958.     # 開始位置を取得
  1959.     set_battler_position if @move_time == 0
  1960.     @z_plus = 50 if @z_plus == 0 && @weapon_data[9]
  1961.     self.z = @battler.sv.z + @z_plus
  1962.     # 反転処理
  1963.     @mirror = !@mirror if @weapon_data[7]
  1964.     self.mirror = @mirror
  1965.     # 更新パターンをセット
  1966.     set_pattern
  1967.     @max_pattern = 2 if @max_pattern == 1
  1968.     # 動きを計算
  1969.     @weapon_move_data = []
  1970.     @weapon_angle_data = []
  1971.     @weapon_zoom_data = []
  1972.     num = N03.mirror_num(@mirror)
  1973.     for i in 0...@max_pattern
  1974.       move_data_x = @weapon_data[2][0] * num * 100 * i / (@max_pattern - 1)
  1975.       move_data_y = @weapon_data[2][1] * 100 * i / (@max_pattern - 1)
  1976.       move_angle = @weapon_data[4] * num + (@weapon_data[5] * num - @weapon_data[4] * num) * i / (@max_pattern - 1)
  1977.       move_zoom_x = 1 + (@weapon_data[8][0] - 1) * i / (@max_pattern - 1)
  1978.       move_zoom_y = 1 + (@weapon_data[8][1] - 1) * i / (@max_pattern - 1)
  1979.       @weapon_move_data.push([move_data_x, move_data_y])
  1980.       @weapon_angle_data.push(move_angle)
  1981.       @weapon_zoom_data.push([move_zoom_x, move_zoom_y])
  1982.     end
  1983.   end  
  1984.   #--------------------------------------------------------------------------
  1985.   # ● 更新パターン
  1986.   #--------------------------------------------------------------------------
  1987.   def set_pattern
  1988.     if @weapon_data[11] == -1
  1989.       return @max_pattern = @battler.sv.max_pattern[0] if @battler.sv.pattern_type != 0
  1990.       @count = @battler.sv.pattern_time
  1991.       @max_count = @battler.sv.pattern_time
  1992.       @max_pattern = @battler.sv.max_pattern[0]
  1993.       @repeat = false
  1994.     else
  1995.       @count = @weapon_data[11][0]
  1996.       @max_count = @weapon_data[11][0]
  1997.       @max_pattern = @weapon_data[11][1]
  1998.       @repeat = @weapon_data[11][2]
  1999.     end
  2000.     @pattern = 0
  2001.   end
  2002.   #--------------------------------------------------------------------------
  2003.   # ● 移動実行
  2004.   #--------------------------------------------------------------------------
  2005.   def set_move
  2006.     # 戦闘アニメを取得
  2007.     set_animation(@move_data[1][0]) if $data_animations[@move_data[1][0]] != nil && $data_animations[@move_data[1][0]].position != 3
  2008.     @anime_camera_zoom = @move_data[13]
  2009.     @loop = @move_data[14]
  2010.     @loop = false if @move_data[1][0] == 0
  2011.     @anime_no_mirror = @move_data[15]
  2012.     @se_flag = @move_data[17]
  2013.     # 開始位置を取得
  2014.     start_position
  2015.     @z_plus = 1000 if @move_data[9]
  2016.     # ターゲットバトラー画像にこのアニメのSEとタイミング設定を反映させる
  2017.     @timing_targets = @target_battler
  2018.     # 座標計算
  2019.     @move_x = @move_data[5][0] * 100 * N03.mirror_num(@mirror)
  2020.     @move_y = @move_data[5][1] * 100
  2021.     # 時間計算か速度計算か
  2022.     @distanse_move = true if @move_data[6] > 0
  2023.     @move_time = @move_data[6].abs
  2024.     # 時間0の場合、アニメが設定されていればアニメ表示時間に合わせる
  2025.     if @move_time == 0
  2026.       @move_time = $data_animations[@move_data[1][0]].frame_max * 4 if $data_animations[@move_data[1][0]]
  2027.       @move_time = 1 if !$data_animations[@move_data[1][0]]
  2028.       @distanse_move = false
  2029.     end
  2030.     # 貫通タイプの場合
  2031.     @through = true if @move_data[7] == 1
  2032.     @auto_through_flag = false
  2033.     @auto_through_flag = true if @move_data[7] == 0
  2034.     # ターゲット座標計算
  2035.     if @target_battler == nil
  2036.       @target_x = @move_x * 100
  2037.       @target_x = (Graphics.width - @move_x) * 100 if @mirror
  2038.       @target_y = @move_y * 100
  2039.     else
  2040.       move_data_set
  2041.     end
  2042.     # ターゲットに到達するまでの時間を計算
  2043.     @move_time = distanse_calculation(@move_time, @target_x, @target_y)
  2044.     # 円軌道計算
  2045.     orbit
  2046.     # バトラーのウエイト設定
  2047.     @battler.sv.wait = @move_time - 1 if @move_data[10][0]
  2048.     @move_horming = @move_data[12]
  2049.   end  
  2050.   #--------------------------------------------------------------------------
  2051.   # ● 速度を時間に変換
  2052.   #--------------------------------------------------------------------------
  2053.   def distanse_calculation(time, target_x, target_y)
  2054.     return time if !@distanse_move
  2055.     distanse_x = @position_x - @target_x
  2056.     distanse_x = @target_x - @position_x if @target_x > @position_x
  2057.     distanse_y = @position_y - @target_y
  2058.     distanse_y = @target_y - @position_y if @target_y > @position_y
  2059.     distanse = [distanse_x, distanse_y].max
  2060.     return distanse / (time * 100) + 1
  2061.   end
  2062.   #--------------------------------------------------------------------------
  2063.   # ● 移動目標の更新
  2064.   #--------------------------------------------------------------------------
  2065.   def move_data_set
  2066.     return if @target_battler == nil
  2067.     position = N03.get_targets_position(@target_battler, true, @anime_position)
  2068.     @target_x = position[0] + @move_x
  2069.     @target_y = position[1] - position[2] + @move_y
  2070.   end
  2071.   #--------------------------------------------------------------------------
  2072.   # ● 開始位置を計算
  2073.   #--------------------------------------------------------------------------
  2074.   def start_position
  2075.     starter = [@battler.sv.m_a_starter.shift]
  2076.     starter = N03.get_targets(@move_data[2], @battler) if @move_data[2] < 0
  2077.     position = [0, 0]
  2078.     position = N03.get_targets_position(starter, true, @anime_position) if starter != nil
  2079.     @position_x = position[0] + @move_data[4][0] * 100
  2080.     @position_y = position[1] + position[2] + @move_data[4][1] * 100
  2081.     @position_z = @position_y
  2082.   end  
  2083.   #--------------------------------------------------------------------------
  2084.   # ● 円軌道計算
  2085.   #--------------------------------------------------------------------------
  2086.   def orbit
  2087.     orbit_data = @move_data[8].dup
  2088.     orbit_data[0] *= 100
  2089.     orbit_data[1] *= 100
  2090.     orbit_d = []
  2091.     for i in 0...@move_time / 2
  2092.       @orbit[i] = orbit_data[0]
  2093.       orbit_data[0] /= 2
  2094.       orbit_d[i] = orbit_data[1]
  2095.       orbit_data[1] /= 2
  2096.     end
  2097.     @orbit = @orbit + orbit_d.reverse!
  2098.     @orbit.reverse!
  2099.   end  
  2100.   #--------------------------------------------------------------------------
  2101.   # ● フレーム更新
  2102.   #--------------------------------------------------------------------------
  2103.   def update
  2104.     update_hit_anime if @anime_time != 0
  2105.     update_move if @move_time != 0
  2106.     update_weapon_move if @weapon_data != []
  2107.     update_position
  2108.     update_color
  2109.     self.visible = @battler.sv.weapon_visible
  2110.     super
  2111.   end
  2112.   #--------------------------------------------------------------------------
  2113.   # ● ヒット時の戦闘アニメ
  2114.   #--------------------------------------------------------------------------
  2115.   def update_hit_anime
  2116.     @anime_time -= 1
  2117.     @action_end = true if @anime_time == 0
  2118.   end
  2119.   #--------------------------------------------------------------------------
  2120.   # ● 移動の更新
  2121.   #--------------------------------------------------------------------------
  2122.   def update_move
  2123.     move_data_set if @move_horming && !@hit_position
  2124.     through_set(@move_time, @target_x, @target_y) if @move_time == 1 && !@hit_position
  2125.     @o += @orbit[@move_time - 1] if @orbit[@move_time - 1] != nil
  2126.     @position_x = (@position_x * (@move_time - 1) + @target_x) / @move_time
  2127.     @position_y = (@position_y * (@move_time - 1) + @target_y) / @move_time + @o
  2128.     reset_position
  2129.     set_animation(@move_data[1][0]) if @loop && !animation?
  2130.     @move_time -= 1
  2131.     return if @move_time != 0
  2132.     @action_end = true if !@action_end_cancel
  2133.   end
  2134.   #--------------------------------------------------------------------------
  2135.   # ● 武器の動きを更新
  2136.   #--------------------------------------------------------------------------
  2137.   def update_weapon_move
  2138.     pattern = update_pattern
  2139.     set_battler_position if @move_time == 0 && !@action_end_cancel
  2140.     @real_x = @position_x / 100 + @weapon_move_data[pattern][0] / 100
  2141.     @real_y = @position_y / 100 + @weapon_move_data[pattern][1] / 100
  2142.     @real_zoom_x = @weapon_zoom_data[pattern][0]
  2143.     @real_zoom_y = @weapon_zoom_data[pattern][1]
  2144.     self.angle = @weapon_angle_data[pattern]
  2145.     self.src_rect.set(@weapon_width * pattern, 0, @weapon_width, @weapon_height) if @weapon_data[1] == 2
  2146.   end
  2147.   #--------------------------------------------------------------------------
  2148.   # ● パターンを更新
  2149.   #--------------------------------------------------------------------------
  2150.   def update_pattern
  2151.     return @battler.sv.pattern_w if @count == nil
  2152.     @count -= 1
  2153.     return @pattern if @count != 0
  2154.     @count = @max_count
  2155.     @pattern += 1
  2156.     if !@repeat && @pattern == @max_pattern
  2157.       @pattern = @max_pattern - 1
  2158.     elsif @pattern == @max_pattern
  2159.       @pattern = 0
  2160.     end
  2161.     return @pattern
  2162.   end
  2163.   #--------------------------------------------------------------------------
  2164.   # ● 座標を更新
  2165.   #--------------------------------------------------------------------------
  2166.   def update_position
  2167.     self.x = (@real_x - $sv_camera.x) * $sv_camera.convert / 1000
  2168.     self.y = (@real_y - $sv_camera.y) * $sv_camera.convert / 1000
  2169.     self.x += $sv_camera.sx / 100 unless @battler.sv.h != 0 && @weapon_data != []
  2170.     self.y += $sv_camera.sy / 100 unless @battler.sv.h != 0 && @weapon_data != []
  2171.     self.z = @battler.sv.z + @z_plus - 10
  2172.     self.zoom_x = @real_zoom_x * $sv_camera.zoom
  2173.     self.zoom_y = @real_zoom_y * $sv_camera.zoom
  2174.     self.opacity = @battler.sv.opacity if @battler.sv.opacity_data[4]
  2175.   end
  2176.   #--------------------------------------------------------------------------
  2177.   # ● 貫通の処理
  2178.   #--------------------------------------------------------------------------
  2179.   def through_set(time, target_x, target_y)
  2180.     @hit_anime_id = N03.get_attack_anime_id(@move_data[1][1], @battler)
  2181.     @battler.sv.wait = N03.get_anime_time(@hit_anime_id) if @move_data[10][1]
  2182.     moving_x = (target_x / 100 - @position_x / 100) / time
  2183.     moving_y = (target_y / 100 - @position_y / 100) / time
  2184.     goal_x = $sv_camera.max_left - 100 if moving_x < 0
  2185.     goal_x = Graphics.width + $sv_camera.max_right + 100 if moving_x > 0
  2186.     goal_y = $sv_camera.max_top - 100 if moving_y < 0
  2187.     goal_y = Graphics.height + $sv_camera.max_bottom + 100 if moving_y > 0
  2188.     if goal_x == nil &&  goal_y == nil
  2189.       time = 0
  2190.       reset_position
  2191.     else
  2192.       time = move_calculation(moving_x, moving_y, goal_x, goal_y)
  2193.     end
  2194.     target_x = @position_x + moving_x * time * 100
  2195.     target_y = @position_y + moving_y * time * 100
  2196.     @pre_data = [time, target_x, target_y]
  2197.     @battler.sv.m_a_data.push([@move_data[11], @target_battler, @index, @auto_through_flag, []])
  2198.     @action_end_cancel = true
  2199.     @hit_position = [@real_x, @real_y, self.z]
  2200.   end  
  2201.   #--------------------------------------------------------------------------
  2202.   # ● 到達時間試算
  2203.   #--------------------------------------------------------------------------
  2204.   def move_calculation(moving_x, moving_y, goal_x, goal_y)
  2205.     move_x = @position_x / 100
  2206.     move_y = @position_y / 100
  2207.     time = 0
  2208.     loop do
  2209.       move_x += moving_x
  2210.       move_y += moving_y
  2211.       time += 1
  2212.       return time if moving_x < 0 && move_x < goal_x
  2213.       return time if moving_x > 0 && move_x > goal_x
  2214.       return time if moving_y < 0 && move_y < goal_y
  2215.       return time if moving_y > 0 && move_y > goal_y
  2216.     end
  2217.   end   
  2218.   #--------------------------------------------------------------------------
  2219.   # ● ミス時に消える処理から貫通処理に変換
  2220.   #--------------------------------------------------------------------------
  2221.   def through_change
  2222.     @action_end_cancel = false
  2223.     @through = true
  2224.     @move_time = @pre_data[0]
  2225.     @target_x = @pre_data[1]
  2226.     @target_y = @pre_data[2]
  2227.     @pre_data = nil
  2228.   end  
  2229.   #--------------------------------------------------------------------------
  2230.   # ● SE とフラッシュのタイミング処理
  2231.   #--------------------------------------------------------------------------
  2232.   def animation_process_timing(timing)
  2233.     return if !@timing_targets
  2234.     se_flag = true
  2235.     se_flag = @se_flag if @se_flag != nil
  2236.     for target in @timing_targets
  2237.       target.sv.timing.push([se_flag, timing.dup])
  2238.       se_flag = false if @animation.position == 3
  2239.     end  
  2240.   end
  2241.   #--------------------------------------------------------------------------
  2242.   # ● 色調の更新
  2243.   #--------------------------------------------------------------------------
  2244.   def update_color
  2245.     return if @battler.sv.color == []
  2246.     self.color.set(@battler.sv.color[0], @battler.sv.color[1], @battler.sv.color[2], @battler.sv.color[3])
  2247.   end
  2248.   #--------------------------------------------------------------------------
  2249.   # ● 解放
  2250.   #--------------------------------------------------------------------------
  2251.   def dispose
  2252.     super
  2253.     self.bitmap.dispose if self.bitmap != nil
  2254.   end
  2255. end

  2256. #==============================================================================
  2257. # ■ Sprite_Battle_Picture
  2258. #------------------------------------------------------------------------------
  2259. #  ピクチャ表示用のスプライトです。
  2260. #==============================================================================
  2261. class Sprite_Battle_Picture < Sprite
  2262.   #--------------------------------------------------------------------------
  2263.   # ● 公開インスタンス変数 
  2264.   #--------------------------------------------------------------------------
  2265.   attr_accessor   :action_end           # 終了フラグ
  2266.   #--------------------------------------------------------------------------
  2267.   # ● オブジェクト初期化
  2268.   #--------------------------------------------------------------------------
  2269.   def initialize(viewport = nil)
  2270.     super(viewport)
  2271.     @action_end = false
  2272.     self.ox = 0
  2273.   end
  2274.   #--------------------------------------------------------------------------
  2275.   # ● セット
  2276.   #--------------------------------------------------------------------------
  2277.   def set(battler)
  2278.     @battler = battler
  2279.     @data = @battler.sv.effect_data.shift
  2280.     @time = @data[4]
  2281.     @mirror = $sv_camera.mirror
  2282.     @mirror = false if !@data[8]
  2283.     self.opacity = @data[6][0]
  2284.     @s_x = @data[2][0] if @data[2] != []
  2285.     @s_x = Graphics.width - @data[2][0]  if @data[2] != [] && @mirror
  2286.     @s_y = @data[2][1] if @data[2] != []
  2287.     @e_x = @data[3][0] if @data[3] != []
  2288.     @e_x = Graphics.width - @data[3][0] if @data[3] != [] && @mirror
  2289.     @e_y = @data[3][1] if @data[3] != []
  2290.     @s_x = self.x if @data[2] == []
  2291.     @s_y = self.y if @data[2] == []
  2292.     @e_x = self.x if @data[3] == []
  2293.     @e_y = self.y if @data[3] == []
  2294.     self.x = @s_x
  2295.     self.y = @s_y
  2296.     return @action_end = true if @time == 0
  2297.     @move_x = (@e_x * 1.0 - @s_x) / @time
  2298.     @move_y = (@e_y * 1.0 - @s_y) / @time
  2299.     self.z = @data[5]
  2300.     return set_plane(battler) if @data[7] != []
  2301.     self.bitmap = Cache.picture(@data[9]) if !bitmap or @data[9] != ""
  2302.     return @action_end = true if !bitmap
  2303.     self.mirror = @mirror
  2304.     self.ox = self.bitmap.width if @mirror
  2305.   end
  2306.   #--------------------------------------------------------------------------
  2307.   # ● プレーン移行
  2308.   #--------------------------------------------------------------------------
  2309.   def set_plane(battler)
  2310.     @viewport = Viewport.new(@data[2][0],@data[2][1],@data[7][0],@data[7][1]) if !@viewport
  2311.     viewport = @viewport
  2312.     @plane = Plane.new(viewport) if !@plane
  2313.     @plane.bitmap = Cache.picture(@data[9]) if !@plane.bitmap or @data[9] != ""
  2314.     return @action_end = true if !@plane.bitmap
  2315.     @plane.ox = @data[7][0]
  2316.     @plane.oy = @data[7][1]
  2317.     @plane.opacity = @data[6][0]
  2318.     @move_x = @remain_move[0] if @data[2] == @data[3]
  2319.     @move_y = @remain_move[1] if @data[2] == @data[3]
  2320.     @remain_move = [@move_x, @move_y]
  2321.   end
  2322.   #--------------------------------------------------------------------------
  2323.   # ● フレーム更新
  2324.   #--------------------------------------------------------------------------
  2325.   def update
  2326.     @action_end = true if !@battler.sv.picture
  2327.     return if @time == 0
  2328.     return if @action_end
  2329.     @time -= 1
  2330.     return plane_update if @plane
  2331.     super
  2332.     self.x += @move_x
  2333.     self.y += @move_y
  2334.     self.opacity += @data[6][1]
  2335.     return if @time != 1
  2336.     self.x = @e_x
  2337.     self.y = @e_y
  2338.     @time = 0
  2339.   end
  2340.   #--------------------------------------------------------------------------
  2341.   # ● フレーム更新
  2342.   #--------------------------------------------------------------------------
  2343.   def plane_update
  2344.     @plane.ox += @move_x
  2345.     @plane.oy += @move_y
  2346.     @plane.opacity += @data[6][1]
  2347.     @time = @data[4] if @time == 0
  2348.   end
  2349.   #--------------------------------------------------------------------------
  2350.   # ● 解放
  2351.   #--------------------------------------------------------------------------
  2352.   def dispose
  2353.     bitmap.dispose if bitmap
  2354.     @plane.dispose if @plane
  2355.     @viewport.dispose if @viewport
  2356.     super
  2357.   end
  2358. end

  2359. #==============================================================================
  2360. # ■ Sprite_Back_Picture
  2361. #------------------------------------------------------------------------------
  2362. #  周期ピクチャ用のスプライトです。
  2363. #==============================================================================
  2364. class Sprite_Back_Picture < Plane
  2365.   #--------------------------------------------------------------------------
  2366.   # ● 公開インスタンス変数 
  2367.   #--------------------------------------------------------------------------
  2368.   attr_accessor   :action_end           # 終了フラグ
  2369.   #--------------------------------------------------------------------------
  2370.   # ● オブジェクト初期化
  2371.   #--------------------------------------------------------------------------
  2372.   def initialize(viewport = nil, index)
  2373.     super(viewport)
  2374.     @index = index
  2375.     @real_x = 0
  2376.     @real_y = 0
  2377.     @real_opacity = 0
  2378.     @move_x = 0
  2379.     @move_y = 0
  2380.     @move_opacity = 0
  2381.     @time = 0
  2382.     @switche = 0
  2383.     @action_end = false
  2384.   end
  2385.   #--------------------------------------------------------------------------
  2386.   # ● セットアップ
  2387.   #--------------------------------------------------------------------------
  2388.   def setup(data)
  2389.     self.bitmap = Cache.picture(data[9])
  2390.     self.z = data[6]
  2391.     @switche = data[1]
  2392.     mirror = $sv_camera.mirror
  2393.     mirror = false if !data[8]
  2394.     @move_x = data[3][0]
  2395.     @move_x *= -1 if mirror
  2396.     @move_y = data[3][1]
  2397.     @time = data[4]
  2398.     @time = -1 if @time == 0
  2399.     @real_opacity = (data[5][0] + 1) * 100
  2400.     @move_opacity = data[5][1]
  2401.     @start_opacity = data[5][0]
  2402.     @shake_ok = data[7]
  2403.   end
  2404.   #--------------------------------------------------------------------------
  2405.   # ● フレーム更新
  2406.   #--------------------------------------------------------------------------
  2407.   def update
  2408.     update_picture if @time != 0
  2409.     self.ox = $sv_camera.x - @real_x
  2410.     self.oy = $sv_camera.y - @real_y
  2411.     if @shake_ok
  2412.       self.ox -= $sv_camera.sx / 100
  2413.       self.oy -= $sv_camera.sy / 100
  2414.     end
  2415.     self.ox *= $sv_camera.zoom
  2416.     self.oy *= $sv_camera.zoom
  2417.     self.zoom_x = @zoom_x * $sv_camera.zoom
  2418.     self.zoom_y = @zoom_y * $sv_camera.zoom
  2419.     self.opacity = @real_opacity / 100
  2420.     @move_opacity *= -1 if self.opacity == 255 or self.opacity <= @start_opacity
  2421.     @switche
  2422.     @action_end = true if @switche > 0 && !$game_switches[@switche]
  2423.     @action_end = true if @switche < 0 && !$sv_camera.switches[@switche.abs]
  2424.   end
  2425.   #--------------------------------------------------------------------------
  2426.   # ● ピクチャの更新
  2427.   #--------------------------------------------------------------------------
  2428.   def update_picture
  2429.     @real_x += @move_x / 100
  2430.     @real_y += @move_y / 100
  2431.     @real_x = 0 if @real_x >= self.bitmap.width or @real_x <= -self.bitmap.width
  2432.     @real_y = 0 if @real_y >= self.bitmap.height or @real_y <= -self.bitmap.height
  2433.     @zoom_x = 1
  2434.     @zoom_y = 1
  2435.     @real_opacity += @move_opacity
  2436.     @time -= 1
  2437.     @time = -1 if @time < -100
  2438.   end
  2439. end

  2440. #==============================================================================
  2441. # ■ Sprite_Back_Picture
  2442. #------------------------------------------------------------------------------
  2443. #  ダメージ表示のスプライトです。
  2444. #==============================================================================
  2445. class Sprite_Damage < Sprite
  2446.   #--------------------------------------------------------------------------
  2447.   # ● 公開インスタンス変数 
  2448.   #--------------------------------------------------------------------------
  2449.   attr_reader   :action_end                  # POP終了フラグ
  2450.   #--------------------------------------------------------------------------
  2451.   # ● オブジェクト初期化
  2452.   #--------------------------------------------------------------------------
  2453.   def initialize(viewport = nil, battler)
  2454.     super(viewport)
  2455.     @battler = battler
  2456.     @time = 0
  2457.     return @action_end = true if !@battler
  2458.     @direction = -1
  2459.     @direction *= -1 if @battler.actor?
  2460.     @direction *= -1 if $sv_camera.mirror
  2461.     set_state
  2462.     set_damage
  2463.     update
  2464.   end
  2465.   #--------------------------------------------------------------------------
  2466.   # ● ステート表示
  2467.   #--------------------------------------------------------------------------
  2468.   def set_state
  2469.     return if !N03::STATE_POP
  2470.     states = @battler.result.added_state_objects
  2471.     states.delete($data_states[@battler.death_state_id]) if @battler.result.hp_damage != 0
  2472.     return if states == []
  2473.     return if @battler.sv.add_state == @battler.result.added_state_objects
  2474.     @battler.sv.add_state = states.dup
  2475.     @st = []
  2476.     @st_base = []
  2477.     for i in 0...states.size
  2478.       @st[i] = Sprite.new
  2479.       bitmap_state(@st[i], states[i])
  2480.       @st_base[i] = []
  2481.       @st_base[i][0] = @direction * (-20 + 5 * i) + @battler.sv.x / 100
  2482.       @st_base[i][1] = -40 - @state_height * i + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100
  2483.       @st[i].z = 1000 + i
  2484.       @st[i].opacity = 0
  2485.     end
  2486.     @time = @pop_time = 80
  2487.   end   
  2488.   #--------------------------------------------------------------------------
  2489.   # ● ステート画像
  2490.   #--------------------------------------------------------------------------
  2491.   def bitmap_state(state, state_object)
  2492.     name = state_object.name
  2493.     state.bitmap = Cache.system("Iconset").dup
  2494.     state.src_rect.set(state_object.icon_index % 16 * 24, state_object.icon_index / 16 * 24, 24, 24)
  2495.     @state_height = 24
  2496.   end
  2497.   #--------------------------------------------------------------------------
  2498.   # ● ダメージ表示
  2499.   #--------------------------------------------------------------------------
  2500.   def hit_count
  2501.     for i in [email]0...@battler.sv.hit.size[/email]
  2502.       if @battler.sv.hit[i] == nil
  2503.         @hit = i
  2504.         return @battler.sv.hit[i] = @hit
  2505.       end
  2506.     end
  2507.     @hit = @battler.sv.hit.size
  2508.     @battler.sv.hit.push(@hit)
  2509.   end  
  2510.   #--------------------------------------------------------------------------
  2511.   # ● ダメージ表示
  2512.   #--------------------------------------------------------------------------
  2513.   def set_damage
  2514.     return @action_end = true if !N03::DAMAGE_POP
  2515.     damage = @battler.result.hp_damage if @battler.result.hp_damage != 0
  2516.     damage = @battler.result.hp_drain  if @battler.result.hp_drain  != 0
  2517.     damage = @battler.result.mp_damage if @battler.result.mp_damage != 0
  2518.     damage = @battler.result.mp_drain  if @battler.result.mp_drain  != 0
  2519.     damage = @battler.result.tp_damage if @battler.result.tp_damage != 0
  2520.     if !damage or damage == 0
  2521.       @action_end = true if @st == nil
  2522.       return # ステートだけPOPする設定を考慮して@action_endは返さない
  2523.     end
  2524.     hit_count
  2525.     #@hit = @battler.sv.hit
  2526.     #@battler.sv.hit += 1 if damage != 0
  2527.     file = N03::DAMAGE_PLUS if damage > 0
  2528.     file = N03::DAMAGE_MINUS if damage < 0
  2529.     add_file = N03::DAMAGE_MP if @battler.result.mp_damage != 0
  2530.     add_file = N03::DAMAGE_TP if @battler.result.tp_damage != 0
  2531.     adjust_x = N03::DAMAGE_ADJUST
  2532.     @num = []
  2533.     @num_base = []
  2534.     damage = damage.abs
  2535.     max_num = damage.to_s.size
  2536.     max_num += 1 if add_file != nil
  2537.     for i in 0...max_num
  2538.       @num[i] = Sprite.new
  2539.       if add_file != nil && i == max_num - 1
  2540.         @num[i].bitmap = Cache.system(add_file)
  2541.         cw = (damage % (10 * 10 ** i))/(10 ** i)
  2542.         sw = 0 if sw == nil
  2543.       else
  2544.         @num[i].bitmap = Cache.system(file)
  2545.         cw = (damage % (10 * 10 ** i))/(10 ** i)
  2546.         sw = @num[i].bitmap.width / 10
  2547.         @num[i].src_rect.set(cw * sw, 0, sw, @num[i].bitmap.height)
  2548.       end
  2549.       @num_base[i] = []
  2550.       @num_base[i][0] = (sw + adjust_x) * i * -1 + (@battler.sv.x / 100)
  2551.       @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
  2552.       @num_base[i][0] -= @num[i].bitmap.width / 2 - adjust_x if add_file != nil && i == max_num - 1
  2553.       @num[i].z = 1000 + i + @hit * 10
  2554.     end
  2555.     @time = @pop_time = 80
  2556.   end
  2557.   #--------------------------------------------------------------------------
  2558.   # ● フレーム更新
  2559.   #--------------------------------------------------------------------------
  2560.   def update
  2561.     return if @time == 0
  2562.     for i in [email]0...@st.size[/email] do update_state_move(@st[i], i) end if @st != nil
  2563.     for i in [email]0...@num.size[/email] do update_num_move(@num[i], i) end if @num != nil
  2564.     @time -= 1
  2565.     @action_end = true if @time == 0
  2566.   end
  2567.   #--------------------------------------------------------------------------
  2568.   # ● ステート画像の更新
  2569.   #--------------------------------------------------------------------------
  2570.   def update_state_move(state, index)
  2571.     min = @pop_time - index * 2
  2572.     case @time
  2573.     when min-15..min
  2574.       @st_base[index][0] += @direction
  2575.       state.opacity += 25
  2576.     when min-80..min-50
  2577.       @st_base[index][0] += @direction
  2578.       state.opacity -= 25
  2579.     end
  2580.     state.x = (@st_base[index][0] - $sv_camera.x) * $sv_camera.zoom
  2581.     state.y = (@st_base[index][1] - $sv_camera.y) * $sv_camera.zoom
  2582.   end
  2583.   #--------------------------------------------------------------------------
  2584.   # ● 数値の更新
  2585.   #--------------------------------------------------------------------------
  2586.   def update_num_move(num, index)
  2587.     min = @pop_time - index * 2
  2588.     case @time
  2589.     when min-1..min
  2590.       @num_base[index][0] += @direction * @hit
  2591.       @num_base[index][1] -= 5 + @hit * 2
  2592.     when min-3..min-2
  2593.       @num_base[index][0] += @direction * @hit
  2594.       @num_base[index][1] -= 4 + @hit * 2
  2595.     when min-6..min-4
  2596.       @num_base[index][0] += @direction
  2597.       @num_base[index][1] -= 3 + @hit * 2
  2598.     when min-14..min-7
  2599.       @num_base[index][0] += @direction
  2600.       @num_base[index][1] += 2
  2601.     when min-17..min-15
  2602.       @num_base[index][1] -= 2 + @hit * 2
  2603.     when min-23..min-18
  2604.       @num_base[index][1] += 1
  2605.     when min-27..min-24
  2606.       @num_base[index][1] -= 1
  2607.     when min-30..min-28
  2608.       @num_base[index][1] += 1
  2609.     when min-33..min-31
  2610.       @num_base[index][1] -= 1
  2611.     when min-36..min-34
  2612.       @num_base[index][1] += 1
  2613.     end
  2614.     num.x = (@num_base[index][0] - $sv_camera.x) * $sv_camera.zoom
  2615.     num.y = (@num_base[index][1] - $sv_camera.y) * $sv_camera.zoom
  2616.     num.opacity = 256 - (12 - @time) * 32
  2617.     num.visible = false if @time == 0
  2618.   end
  2619.   #--------------------------------------------------------------------------
  2620.   # ● 解放
  2621.   #--------------------------------------------------------------------------
  2622.   def dispose
  2623.     @battler.sv.hit[@hit] = nil if @hit
  2624.     bitmap.dispose if bitmap
  2625.     for i in [email]0...@num.size[/email] do @num[i].dispose end if @num != nil
  2626.     for i in [email]0...@st.size[/email] do @st[i].dispose end if @st != nil
  2627.     super
  2628.   end
  2629. end

  2630. #==============================================================================
  2631. # ■ Window_Skill_name
  2632. #------------------------------------------------------------------------------
  2633. #  スキル名を表示するウィンドウです。
  2634. #==============================================================================
  2635. class Window_Skill_name < Window_Base
  2636.   #--------------------------------------------------------------------------
  2637.   # ● オブジェクト初期化
  2638.   #--------------------------------------------------------------------------
  2639.   def initialize(text)
  2640.     super(0, 0, Graphics.width, line_height + standard_padding * 2)
  2641.     draw_text(4, 0, Graphics.width - 64, line_height,text, 1)
  2642.   end
  2643. end

  2644. #==============================================================================
  2645. # ■ Spriteset_Sideview
  2646. #------------------------------------------------------------------------------
  2647. #  サイドビュー独自のスプライトをまとめたクラスです。
  2648. #==============================================================================
  2649. class Spriteset_Sideview
  2650.   #--------------------------------------------------------------------------
  2651.   # ● オブジェクト初期化
  2652.   #--------------------------------------------------------------------------
  2653.   def initialize(viewport)
  2654.     @viewport = viewport
  2655.     @weapons = []
  2656.     @pictures = []
  2657.     @back_pic = []
  2658.     @damage = []
  2659.     $sv_camera.setup
  2660.     N03.camera(nil, N03::BATTLE_CAMERA["回合开始前"].dup)
  2661.   end
  2662.   #--------------------------------------------------------------------------
  2663.   # ● フレーム更新
  2664.   #--------------------------------------------------------------------------
  2665.   def update
  2666.     update_battler_data
  2667.     update_damage
  2668.     update_pictures
  2669.     update_back_pic
  2670.     update_weapons
  2671.   end  
  2672.   #--------------------------------------------------------------------------
  2673.   # ● バトラーデータの更新
  2674.   #--------------------------------------------------------------------------
  2675.   def update_battler_data
  2676.     for battler in $game_party.battle_members + $game_troop.members
  2677.       weapon_end(battler) if battler.sv.weapon_end
  2678.       next if battler.sv.effect_data == []
  2679.       for effect_data in battler.sv.effect_data do set_effects(battler, effect_data) end
  2680.     end
  2681.   end
  2682.   #--------------------------------------------------------------------------
  2683.   # ● ダメージ画像の更新
  2684.   #--------------------------------------------------------------------------
  2685.   def update_damage
  2686.     for i in [email]0...@damage.size[/email]
  2687.       next if @damage[i] == nil
  2688.       @damage[i].update if @damage[i] != nil
  2689.       next if !@damage[i].action_end
  2690.       @damage[i].dispose
  2691.       @damage[i] = nil
  2692.     end
  2693.   end
  2694.   #--------------------------------------------------------------------------
  2695.   # ● ピクチャアクションの更新
  2696.   #--------------------------------------------------------------------------
  2697.   def update_pictures
  2698.     for i in [email]0...@pictures.size[/email]
  2699.       next if @pictures[i] == nil
  2700.       @pictures[i].update if @pictures[i] != nil
  2701.       next if !@pictures[i].action_end
  2702.       @pictures[i].dispose
  2703.       @pictures[i] = nil
  2704.     end
  2705.   end
  2706.   #--------------------------------------------------------------------------
  2707.   # ● 周期ピクチャの更新
  2708.   #--------------------------------------------------------------------------
  2709.   def update_back_pic
  2710.     set_back_pic if $sv_camera.program_picture != []
  2711.     for i in [email]0...@back_pic.size[/email]
  2712.       next if @back_pic[i] == nil
  2713.       @back_pic[i].update if @back_pic[i] != nil
  2714.       next if !@back_pic[i].action_end
  2715.       @back_pic[i].dispose
  2716.       @back_pic[i] = nil
  2717.     end
  2718.   end
  2719.   #--------------------------------------------------------------------------
  2720.   # ● 武器アクションの更新
  2721.   #--------------------------------------------------------------------------
  2722.   def update_weapons
  2723.     for i in [email]0...@weapons.size[/email]
  2724.       next if @weapons[i] == nil
  2725.       @weapons[i].update if @weapons[i] != nil
  2726.       next if !@weapons[i].action_end
  2727.       @weapons[i].dispose
  2728.       @weapons[i] = nil
  2729.     end
  2730.   end
  2731.   #--------------------------------------------------------------------------
  2732.   # ● ダメージ実行
  2733.   #--------------------------------------------------------------------------
  2734.   def set_damage_pop(target)
  2735.     for i in [email]0...@damage.size[/email]
  2736.       next if @damage[i] != nil
  2737.       return @damage[i] = Sprite_Damage.new(@viewport, target)
  2738.     end
  2739.     @damage.push(Sprite_Damage.new(@viewport, target))
  2740.   end
  2741.   #--------------------------------------------------------------------------
  2742.   # ● 周期ピクチャ実行
  2743.   #--------------------------------------------------------------------------
  2744.   def set_back_pic
  2745.     for data in $sv_camera.program_picture
  2746.       if @back_pic[data[2]] != nil
  2747.         @back_pic[data[2]].dispose
  2748.         @back_pic[data[2]] = nil
  2749.       end
  2750.       @back_pic[data[2]] = Sprite_Back_Picture.new(@viewport, data[2])
  2751.       @back_pic[data[2]].setup(data)
  2752.     end
  2753.     $sv_camera.program_picture = []
  2754.   end
  2755.   #--------------------------------------------------------------------------
  2756.   # ● エフェクト開始
  2757.   #--------------------------------------------------------------------------
  2758.   def set_effects(battler, effect_data)
  2759.     case effect_data[0]
  2760.     when "pic" ; set_pictures(battler, effect_data)
  2761.     when  "wp" ; set_weapons(battler,  true)
  2762.     when "m_a" ; set_weapons(battler, false)
  2763.     end
  2764.   end
  2765.   #--------------------------------------------------------------------------
  2766.   # ● ピクチャアクション実行
  2767.   #--------------------------------------------------------------------------
  2768.   def set_pictures(battler, effect_data)
  2769.     @pictures[effect_data[1]] = Sprite_Battle_Picture.new if @pictures[effect_data[1]] == nil
  2770.     @pictures[effect_data[1]].set(battler)
  2771.   end
  2772.   #--------------------------------------------------------------------------
  2773.   # ● 武器アクション実行
  2774.   #--------------------------------------------------------------------------
  2775.   def set_weapons(battler, weapon_flag, test = true)
  2776.     for i in [email]0...@weapons.size[/email]
  2777.       next if @weapons[i] != nil
  2778.       @weapons[i] = Sprite_Weapon.new(@viewport, i, battler)
  2779.       battler.sv.weapon_index.push(i) if weapon_flag
  2780.       return i
  2781.     end
  2782.     @weapons.push(Sprite_Weapon.new(@viewport, @weapons.size, battler))
  2783.     battler.sv.weapon_index.push(@weapons.size - 1) if weapon_flag
  2784.     return @weapons.size - 1
  2785.   end
  2786.   #--------------------------------------------------------------------------
  2787.   # ● バトラーの武器アクション終了
  2788.   #--------------------------------------------------------------------------
  2789.   def weapon_end(battler)
  2790.     battler.sv.weapon_end = false
  2791.     for index in battler.sv.weapon_index
  2792.       weapon_index = battler.sv.weapon_index.shift
  2793.       @weapons[weapon_index].dispose if @weapons[weapon_index] != nil
  2794.       @weapons[weapon_index] = nil
  2795.     end
  2796.     battler.sv.weapon_index.compact!
  2797.   end  
  2798.   #--------------------------------------------------------------------------
  2799.   # ● ヒット時の戦闘アニメ実行
  2800.   #--------------------------------------------------------------------------
  2801.   def set_hit_animation(battler, weapon_index, hit_targets, miss)
  2802.     weapon = @weapons[weapon_index]
  2803.     for target in hit_targets
  2804.       next @weapons[@hit_index].timing_battler_set(target) if @hit_index != nil
  2805.       @hit_index = set_weapons(battler, false, false)
  2806.       @weapons[@hit_index].set_hit_animation(weapon.hit_position, weapon.hit_anime_id, target)
  2807.     end
  2808.     @hit_index = nil
  2809.     if !weapon.through && !miss
  2810.       @weapons[weapon_index].dispose
  2811.       @weapons[weapon_index] = nil
  2812.     else
  2813.       @weapons[weapon_index].through_change
  2814.     end
  2815.   end
  2816.   #--------------------------------------------------------------------------
  2817.   # ● サイドビューデータの初期化
  2818.   #--------------------------------------------------------------------------
  2819.   def reset_sideview
  2820.     $sv_camera.reset
  2821.     for member in $game_troop.members + $game_party.battle_members do member.sv.reset end
  2822.   end  
  2823.   #--------------------------------------------------------------------------
  2824.   # ● 解放
  2825.   #--------------------------------------------------------------------------
  2826.   def dispose
  2827.     dispose_effects(@weapons)
  2828.     dispose_effects(@pictures)
  2829.     dispose_effects(@back_pic)
  2830.     dispose_effects(@damage)
  2831.     reset_sideview
  2832.   end
  2833.   #--------------------------------------------------------------------------
  2834.   # ● エフェクト画像の解放
  2835.   #--------------------------------------------------------------------------
  2836.   def dispose_effects(effects)
  2837.     for i in 0...effects.size
  2838.       effects[i].dispose if effects[i] != nil
  2839.       effects[i] = nil
  2840.     end
  2841.   end
  2842. end


  2843. #==============================================================================
  2844. # ■ Sprite_Battle_Back
  2845. #------------------------------------------------------------------------------
  2846. #  戦闘背景用のスプライトです。
  2847. #==============================================================================
  2848. class Sprite_Battle_Back < Plane
  2849.   #--------------------------------------------------------------------------
  2850.   # ● オブジェクト初期化
  2851.   #--------------------------------------------------------------------------
  2852.   def initialize(viewport = nil, index, battleback_name)
  2853.     super(viewport)
  2854.     @index = index
  2855.     if @index == 1
  2856.       data = N03::FLOOR1_DATA[battleback_name]
  2857.       data = N03::FLOOR1_DATA["全Battlebacks1"] if data == nil
  2858.     elsif @index == 2
  2859.       data = N03::FLOOR2_DATA[battleback_name]
  2860.       data = N03::FLOOR2_DATA["全Battlebacks2"] if data == nil
  2861.     end   
  2862.     data = data.dup
  2863.     @adjust_position = data[0]
  2864.     @zoom_x = data[1][0] / 100.0
  2865.     @zoom_y = data[1][1] / 100.0
  2866.     @shake_on = data[2]
  2867.     $game_switches[data[3]] = true if data[3] > 0
  2868.     $sv_camera.switches[data[3].abs] = true if data[3] < 0
  2869.     reset_scroll
  2870.     reset_back_data(battleback_name)
  2871.   end
  2872.   #--------------------------------------------------------------------------
  2873.   # ● 背景スクロールを初期化
  2874.   #--------------------------------------------------------------------------
  2875.   def reset_scroll
  2876.     @scroll_x = 0
  2877.     @scroll_y = 0
  2878.     @move_x = 0
  2879.     @move_y = 0
  2880.   end
  2881.   #--------------------------------------------------------------------------
  2882.   # ● 背景データを初期化
  2883.   #--------------------------------------------------------------------------
  2884.   def reset_back_data(battleback_name)
  2885.     @back_data = []
  2886.     @active_data = ["scroll",0, @move_x, @move_y, false, battleback_name,""]
  2887.     start_back_data(@active_data)
  2888.   end  
  2889.   #--------------------------------------------------------------------------
  2890.   # ● 背景画像のセッティング
  2891.   #--------------------------------------------------------------------------
  2892.   def set_graphics(new_bitmap)
  2893.     self.bitmap = new_bitmap
  2894.     @base_x = (self.bitmap.width * @zoom_x - Graphics.width) / 2 + @adjust_position[0]
  2895.     @base_y = (self.bitmap.height * @zoom_y - Graphics.height) / 2 + @adjust_position[1]
  2896.     # 限界座標を取得
  2897.     max_top =  0
  2898.     max_bottom = self.bitmap.height * @zoom_y - Graphics.height
  2899.     max_left = 0
  2900.     max_right = self.bitmap.width * @zoom_x - Graphics.width
  2901.     exist = true
  2902.     exist = false if self.bitmap.height == 32 && self.bitmap.width == 32
  2903.     $sv_camera.setting(@index, [max_top, max_bottom, max_left, max_right, @base_x, @base_y,exist])
  2904.   end
  2905.   #--------------------------------------------------------------------------
  2906.   # ● フレーム更新
  2907.   #--------------------------------------------------------------------------
  2908.   def update
  2909.     return if !bitmap
  2910.     update_back_data
  2911.     update_scroll unless @move_x == 0 && @move_y == 0
  2912.     update_color
  2913.     update_position
  2914.     update_back_adjust if @bt_back != nil
  2915.     create_back_adjust if @bt_back == nil && !@active_data[10] && @scroll_x == 0 && @scroll_y == 0
  2916.   end
  2917.   #--------------------------------------------------------------------------
  2918.   # ● 背景データを更新
  2919.   #--------------------------------------------------------------------------
  2920.   def update_back_data
  2921.     delete = true if @active_data[1] > 0 && !$game_switches[@active_data[1]]
  2922.     delete = true if @active_data[1] < 0 && !$sv_camera.switches[@active_data[1].abs]
  2923.     return if !delete
  2924.     for i in [email]0...@back_data.size[/email]
  2925.       @back_data[i] = nil if @back_data[i][1] > 0 && !$game_switches[@back_data[i][1]]
  2926.       @back_data[i] = nil if @back_data[i][1] < 0 && !$sv_camera.switches[@back_data[i][1].abs]
  2927.     end
  2928.     @back_data.compact!
  2929.     next_back_data
  2930.   end
  2931.   #--------------------------------------------------------------------------
  2932.   # ● 次の背景データをセット
  2933.   #--------------------------------------------------------------------------
  2934.   def next_back_data
  2935.     @back_data.delete(@active_data[11]) if @active_data[11] != nil
  2936.     @back_data.push(@active_data[11]) if @active_data[11] != nil
  2937.     @active_data = nil
  2938.     data = @back_data.pop
  2939.     @back_data = [@active_data] if @back_data.size == 0
  2940.     start_back_data(data)
  2941.   end  
  2942.   #--------------------------------------------------------------------------
  2943.   # ● 背景データを実行
  2944.   #--------------------------------------------------------------------------
  2945.   def start_back_data(data)
  2946.     return if back_data_remain(data)
  2947.     bt_back_dispose
  2948.     pre_active_data = @active_data
  2949.     @active_data[8] = [@back_name, @move_x, @move_y, @scroll_x, @scroll_y] if @active_data != nil
  2950.     @back_data.push(@active_data)     if @active_data != nil
  2951.     @active_data = data.dup
  2952.     @active_data[5] = @back_name      if @active_data[5] == ""
  2953.     @active_data[9] = set_back_adjust if @active_data[9] == nil
  2954.     back_data_scroll_on               if @active_data[8] == nil && @active_data[9][0] == false
  2955.     set_remain_back_data              if @active_data[8] != nil
  2956.     create_back(@active_data[5])      if @active_data[9][0] == false
  2957.     create_back_adjust                if @active_data[10]
  2958.     @active_data[11] = pre_active_data if pre_active_data && @active_data[7] == false
  2959.   end  
  2960.   #--------------------------------------------------------------------------
  2961.   # ● 背景データの保留
  2962.   #--------------------------------------------------------------------------
  2963.   def back_data_remain(data)
  2964.     remain = false
  2965.     remain = true if data[6] != "" && @active_data != nil && @active_data[9] != nil && @active_data[9][0] != false
  2966.     remain = true if @active_data != nil && @active_data[7] == false
  2967.     return remain if !remain
  2968.     @remain = true
  2969.     @back_data.push(data)
  2970.     return remain
  2971.   end  
  2972.   #--------------------------------------------------------------------------
  2973.   # ● 背景変更補正データをセット
  2974.   #--------------------------------------------------------------------------
  2975.   def set_back_adjust
  2976.     bt_adjust = []
  2977.     sign = -1
  2978.     if @active_data[6] == ""
  2979.       reset_scroll if @active_data[3][0] == 0 &&  @active_data[3][1] == 0
  2980.       bt_adjust = [false,false,0,0]
  2981.       return bt_adjust
  2982.     elsif @move_x != 0 or @active_data[3][0] != 0
  2983.       sign = 1 if @move_x < 0
  2984.       bt_adjust[0] = [self.bitmap.width * @zoom_x * sign, 0]
  2985.       bt_adjust[1] = [self.bitmap.width * @zoom_x * sign * 2, 0]
  2986.     elsif @move_y != 0 or @active_data[3][1] != 0
  2987.       sign = 1 if @move_y < 0
  2988.       bt_adjust[0] = [0, self.bitmap.height * @zoom_y * sign]
  2989.       bt_adjust[1] = [0, self.bitmap.height * @zoom_y * sign * 2]
  2990.     else
  2991.       reset_scroll if @active_data[3][0] == 0 &&  @active_data[3][1] == 0
  2992.       bt_adjust = [false,false,0,0]
  2993.       return bt_adjust
  2994.     end
  2995.     bt_adjust[2] = [bt_adjust[0][0], bt_adjust[0][1]]
  2996.     return bt_adjust
  2997.   end
  2998.   #--------------------------------------------------------------------------
  2999.   # ● 背景スクロールデータを実行
  3000.   #--------------------------------------------------------------------------
  3001.   def back_data_scroll_on
  3002.     mirror = $sv_camera.mirror
  3003.     mirror = false if !@active_data[4]
  3004.     @move_x = @active_data[3][0]
  3005.     @move_x *= -1 if mirror
  3006.     @move_y = @active_data[3][1]
  3007.   end
  3008.   #--------------------------------------------------------------------------
  3009.   # ● 保持している背景データを実行
  3010.   #--------------------------------------------------------------------------
  3011.   def set_remain_back_data
  3012.     return back_data_scroll_on if @move_x != 0 or @move_y != 0
  3013.     create_back(@active_data[8][0])
  3014.     @move_x    = @active_data[8][1]
  3015.     @move_y    = @active_data[8][2]
  3016.     @scroll_x  = @active_data[8][3]
  3017.     @scroll_y  = @active_data[8][4]
  3018.   end  
  3019.   #--------------------------------------------------------------------------
  3020.   # ● 背景画像の作成
  3021.   #--------------------------------------------------------------------------
  3022.   def create_back(back_name)
  3023.     return if back_name == @back_name or back_name == ""
  3024.     self.bitmap = Cache.battleback1(back_name) if @index == 1
  3025.     self.bitmap = Cache.battleback2(back_name) if @index == 2
  3026.     @back_name = back_name
  3027.   end  
  3028.   #--------------------------------------------------------------------------
  3029.   # ● 背景変更補正画像の作成
  3030.   #--------------------------------------------------------------------------
  3031.   def create_back_adjust
  3032.     return if @active_data[9][0] == false
  3033.     @active_data[10] = true
  3034.     mirror = $sv_camera.mirror
  3035.     mirror = false if !@active_data[4]
  3036.     @bt_back = []
  3037.     @bt_back[0] = Sprite.new(viewport)
  3038.     @bt_back[0].bitmap = Cache.battleback1(@active_data[6]) if @index == 1
  3039.     @bt_back[0].bitmap = Cache.battleback2(@active_data[6]) if @index == 2
  3040.     @bt_back[0].mirror = mirror
  3041.     @bt_back[1] = Sprite.new(viewport)
  3042.     @bt_back[1].bitmap = Cache.battleback1(@active_data[5]) if @index == 1
  3043.     @bt_back[1].bitmap = Cache.battleback2(@active_data[5]) if @index == 2
  3044.     @bt_back[1].mirror = mirror
  3045.   end
  3046.   #--------------------------------------------------------------------------
  3047.   # ● 背景スクロールの更新
  3048.   #--------------------------------------------------------------------------
  3049.   def update_scroll
  3050.     @scroll_x += @move_x
  3051.     @scroll_y += @move_y
  3052.     @scroll_x = 0 if @scroll_x / 100 >= self.bitmap.width * @zoom_x or @scroll_x / 100 <= -self.bitmap.width * @zoom_x
  3053.     @scroll_y = 0 if @scroll_y / 100 >= self.bitmap.height * @zoom_y or @scroll_y / 100 <= -self.bitmap.height * @zoom_y
  3054.   end
  3055.   #--------------------------------------------------------------------------
  3056.   # ● 色調変更の更新
  3057.   #--------------------------------------------------------------------------
  3058.   def update_color
  3059.     color_set if $sv_camera.color_set[@index] != nil
  3060.     return if @color_data == nil
  3061.     @color_data[4] -= 1
  3062.     if @color_data[4] == 0 && @color_data[5] != 0
  3063.       @color_data[4] = @color_data[5]
  3064.       @color_data[5] = 0
  3065.       @color_data[6] = [0,0,0,0]
  3066.     elsif @color_data[4] == 0
  3067.       @remain_color_data = @color_data
  3068.       return @color_data = nil
  3069.     end  
  3070.     for i in 0..3
  3071.       @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
  3072.     end  
  3073.     self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
  3074.   end
  3075.   #--------------------------------------------------------------------------
  3076.   # ● 座標の更新
  3077.   #--------------------------------------------------------------------------
  3078.   def update_position
  3079.     self.ox = $sv_camera.x + @base_x - @scroll_x / 100
  3080.     self.oy = $sv_camera.y + @base_y - @scroll_y / 100
  3081.     self.ox -= $sv_camera.sx / 100 if @shake_on
  3082.     self.oy -= $sv_camera.sy / 100 if @shake_on
  3083.     self.zoom_x = @zoom_x * $sv_camera.zoom
  3084.     self.zoom_y = @zoom_y * $sv_camera.zoom
  3085.     self.ox *= $sv_camera.zoom
  3086.     self.oy *= $sv_camera.zoom
  3087.     self.z = @index * 10
  3088.   end
  3089.   #--------------------------------------------------------------------------
  3090.   # ● 背景変更補正画像を更新
  3091.   #--------------------------------------------------------------------------
  3092.   def update_back_adjust
  3093.     @active_data[9][0][0] = 0 if @scroll_x == 0
  3094.     @active_data[9][0][1] = 0 if @scroll_y == 0
  3095.     @active_data[9][1][0] -= @active_data[9][2][0] if @scroll_x == 0
  3096.     @active_data[9][1][1] -= @active_data[9][2][1] if @scroll_y == 0
  3097.     for i in [email]0...@bt_back.size[/email]
  3098.       @bt_back[i].x = -self.ox + @active_data[9][i][0] * $sv_camera.zoom
  3099.       @bt_back[i].y = -self.oy + @active_data[9][i][1] * $sv_camera.zoom
  3100.       @bt_back[i].zoom_x = self.zoom_x
  3101.       @bt_back[i].zoom_y = self.zoom_y
  3102.       @bt_back[i].z = self.z + 1
  3103.       @bt_back[i].color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  3104.     end
  3105.     back_data_scroll_on if @active_data[9][0][0] == 0 && @active_data[9][0][1] == 0
  3106.     return unless @active_data[9][1][0] == 0 && @active_data[9][1][1] == 0
  3107.     bt_back_dispose
  3108.     create_back(@active_data[5])
  3109.     @active_data[9][0] = false
  3110.     next_back_data if @remain && @back_data.size != 1
  3111.     @remain = false
  3112.   end
  3113.   #--------------------------------------------------------------------------
  3114.   # ● 色調変更
  3115.   #--------------------------------------------------------------------------
  3116.   def color_set
  3117.     set = $sv_camera.color_set[@index]
  3118.     $sv_camera.color_set[@index] = nil
  3119.     set[4] = 1 if set[4] == 0
  3120.     @remain_color_data = [0,0,0,0] if @remain_color_data == nil
  3121.     @color_data = @remain_color_data
  3122.     @color_data[4] = set[4]
  3123.     @color_data[5] = set[5]
  3124.     @color_data[6] = set
  3125.   end
  3126.   #--------------------------------------------------------------------------
  3127.   # ● 背景変更補正画像の解放
  3128.   #--------------------------------------------------------------------------
  3129.   def bt_back_dispose
  3130.     for i in [email]0...@bt_back.size[/email] do @bt_back[i].dispose end if @bt_back != nil
  3131.     @bt_back = nil
  3132.   end  
  3133.   #--------------------------------------------------------------------------
  3134.   # ● 解放
  3135.   #--------------------------------------------------------------------------
  3136.   def dispose
  3137.     bitmap.dispose if bitmap
  3138.     bt_back_dispose
  3139.     super
  3140.   end
  3141. end  
  3142.   
  3143. #==============================================================================
  3144. # ■ Battle_Camera
  3145. #------------------------------------------------------------------------------
  3146. #  戦闘カメラやバトルプログラムを扱うクラスです。
  3147. #==============================================================================
  3148. class Battle_Camera
  3149.   #--------------------------------------------------------------------------
  3150.   # ● 公開インスタンス変数 
  3151.   #--------------------------------------------------------------------------
  3152.   attr_reader   :sx                 # シェイクX座標
  3153.   attr_reader   :sy                 # シェイクY座標
  3154.   attr_reader   :max_top            # 上限界座標
  3155.   attr_reader   :max_bottom         # 下限界座標
  3156.   attr_reader   :max_left           # 左限界座標
  3157.   attr_reader   :max_right          # 右限界座標
  3158.   attr_accessor :switches           # サイドビュー専用スイッチ
  3159.   attr_accessor :color_set          # 色調変更データ
  3160.   attr_accessor :wait               # 戦闘シーンの強制ウエイト
  3161.   attr_accessor :win_wait           # 戦闘勝利前のウエイト
  3162.   attr_accessor :mirror             # 画面反転フラグ
  3163.   attr_accessor :program_scroll     # バトルプログラム 背景の自動スクロール
  3164.   attr_accessor :program_picture    # バトルプログラム 周期ピクチャ
  3165.   attr_accessor :event              # コモンイベント呼び出し
  3166.   #--------------------------------------------------------------------------
  3167.   # ● オブジェクト初期化
  3168.   #--------------------------------------------------------------------------
  3169.   def initialize
  3170.     @switches = []
  3171.     @max_data = []
  3172.     @color_set = []
  3173.     @wait = 0
  3174.     @win_wait = false
  3175.     @mirror = false
  3176.     @event = false
  3177.     setup
  3178.   end
  3179.   #--------------------------------------------------------------------------
  3180.   # ● カメラX座標
  3181.   #--------------------------------------------------------------------------
  3182.   def x
  3183.     return @x / 100
  3184.   end
  3185.   #--------------------------------------------------------------------------
  3186.   # ● カメラY座標
  3187.   #--------------------------------------------------------------------------
  3188.   def y
  3189.     return @y / 100
  3190.   end
  3191.   #--------------------------------------------------------------------------
  3192.   # ● ズーム率
  3193.   #--------------------------------------------------------------------------
  3194.   def zoom
  3195.     return @zoom * 0.001
  3196.   end
  3197.   #--------------------------------------------------------------------------
  3198.   # ● ズーム率による座標変換
  3199.   #--------------------------------------------------------------------------
  3200.   def convert
  3201.     return @zoom
  3202.   end
  3203.   #--------------------------------------------------------------------------
  3204.   # ● カメラセットアップ
  3205.   #--------------------------------------------------------------------------
  3206.   def setup
  3207.     @x = 0
  3208.     @y = 0
  3209.     @sx = 0
  3210.     @sy = 0
  3211.     @zoom = 1000
  3212.     @time = 0
  3213.     @shake_time = 0
  3214.     program_setup
  3215.   end
  3216.   #--------------------------------------------------------------------------
  3217.   # ● カメラ初期化
  3218.   #--------------------------------------------------------------------------
  3219.   def reset
  3220.     @switches = []
  3221.     @max_data = []
  3222.     @color_set = []
  3223.     @wait = 0
  3224.     @win_wait = false
  3225.     @mirror = false
  3226.     program_setup(false)
  3227.   end  
  3228.   #--------------------------------------------------------------------------
  3229.   # ● バトルプログラムのセットアップ
  3230.   #--------------------------------------------------------------------------
  3231.   def program_setup(check = true)
  3232.     @played_program  = []
  3233.     @program_switch  = []
  3234.     @program_sound   = []
  3235.     @program_scroll  = []
  3236.     @program_se      = []
  3237.     @program_shake   = []
  3238.     @program_color   = []
  3239.     @program_picture = []
  3240.     @program_base = N03::BATTLE_PROGRAM.values.dup
  3241.     program_check if check
  3242.   end  
  3243.   #--------------------------------------------------------------------------
  3244.   # ● バトルプログラムのチェック
  3245.   #--------------------------------------------------------------------------
  3246.   def program_check
  3247.     for data in @program_base
  3248.       if program_start?(data) && !@played_program.include?(data)
  3249.         @played_program.push(data.dup)
  3250.         @program_scroll.push(data.dup)  if data[0] == "scroll"
  3251.         @program_picture.push(data.dup) if data[0] == "kpic"
  3252.         start_sound(data.dup)           if data[0] == "sound"
  3253.         start_program_switch(data.dup)  if data[0] == "switch"
  3254.         start_program_se(data.dup)      if data[0] == "keep_se"
  3255.         start_program_shake(data.dup)   if data[0] == "keep_sk"
  3256.         start_program_color(data.dup)   if data[0] == "keep_c"
  3257.       else
  3258.         @played_program.delete(data)  if !program_start?(data)
  3259.         @program_scroll.delete(data)  if data[0] == "scroll"
  3260.         @program_picture.delete(data) if data[0] == "kpic"
  3261.         @program_switch.delete(data)  if data[0] == "switch"
  3262.         @program_sound.delete(data)   if data[0] == "sound"
  3263.         @program_se.delete(data)      if data[0] == "keep_se"
  3264.         @program_shake.delete(data)   if data[0] == "keep_sk"
  3265.         @program_color.delete(data)   if data[0] == "keep_c"
  3266.       end
  3267.     end
  3268.   end
  3269.   #--------------------------------------------------------------------------
  3270.   # ● バトルプログラムの開始
  3271.   #--------------------------------------------------------------------------
  3272.   def program_start?(data)
  3273.     start = false
  3274.     start = true if $game_switches[data[1].abs] && data[1] > 0
  3275.     start = true if @switches[data[1].abs] && data[1] < 0
  3276.     return start
  3277.   end  
  3278.   #--------------------------------------------------------------------------
  3279.   # ● バトルプログラム スイッチ操作の開始
  3280.   #--------------------------------------------------------------------------
  3281.   def start_program_switch(data)
  3282.     data[4] = data[4] + rand(data[5] + 1)
  3283.     data[4] = 1 if data[4] <= 0
  3284.     @program_switch.push(data)
  3285.   end
  3286.   #--------------------------------------------------------------------------
  3287.   # ● スイッチ操作の更新
  3288.   #--------------------------------------------------------------------------
  3289.   def update_program_switch
  3290.     for data in @program_switch
  3291.       data[4] -= 1
  3292.       next @program_switch.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3293.       next @program_switch.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3294.       next if data[4] != 0
  3295.       for id in data[2]
  3296.         $game_switches[id] = true if id > 0
  3297.         @switches[id.abs] = true  if id < 0
  3298.       end
  3299.       for id in data[3]
  3300.         $game_switches[id] = false if id > 0
  3301.         @switches[id.abs] = false  if id < 0
  3302.       end
  3303.       @program_switch.delete(data)
  3304.       program_check
  3305.     end  
  3306.   end
  3307.   #--------------------------------------------------------------------------
  3308.   # ● バトルプログラム BGM/BGSの開始
  3309.   #--------------------------------------------------------------------------
  3310.   def start_sound(data)
  3311.     @program_sound.push(data)
  3312.     name = data[5]
  3313.     case data[2]
  3314.     when "se"
  3315.       Audio.se_play("Audio/SE/" + name, data[4], data[3])
  3316.     when "bgm"
  3317.       name = RPG::BGM.last.name if data[5] == ""
  3318.       Audio.bgm_play("Audio/BGM/" + name, data[4], data[3])
  3319.     when "bgs"
  3320.       name = RPG::BGS.last.name if data[5] == ""
  3321.       Audio.bgs_play("Audio/BGS/" + name, data[4], data[3])
  3322.     end
  3323.   end
  3324.   #--------------------------------------------------------------------------
  3325.   # ● バトルプログラム 周期SEの開始
  3326.   #--------------------------------------------------------------------------
  3327.   def start_program_se(data)
  3328.     data[3] = [data[2], data[3]]
  3329.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3330.     @program_se.push(data)
  3331.     Audio.se_play("Audio/SE/" + data[7], data[5], data[4]) if data[6]
  3332.   end
  3333.   #--------------------------------------------------------------------------
  3334.   # ● 周期SEの更新
  3335.   #--------------------------------------------------------------------------
  3336.   def update_program_se
  3337.     for data in @program_se
  3338.       data[2] -= 1
  3339.       next @program_se.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3340.       next @program_se.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3341.       next if data[2] != 0
  3342.       Audio.se_play("Audio/SE/" + data[7], data[5], data[4])
  3343.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3344.     end  
  3345.   end
  3346.   #--------------------------------------------------------------------------
  3347.   # ● バトルプログラム 周期シェイクの開始
  3348.   #--------------------------------------------------------------------------
  3349.   def start_program_shake(data)
  3350.     data[3] = [data[2], data[3]]
  3351.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3352.     @program_shake.push(data)
  3353.     shake(data[4], data[5], data[6]) if data[7]
  3354.   end
  3355.   #--------------------------------------------------------------------------
  3356.   # ● 周期シェイクの更新
  3357.   #--------------------------------------------------------------------------
  3358.   def update_program_shake
  3359.     for data in @program_shake
  3360.       data[2] -= 1
  3361.       next @program_shake.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3362.       next @program_shake.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3363.       next if data[2] != 0
  3364.       shake(data[4], data[5], data[6])
  3365.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3366.     end  
  3367.   end
  3368.   #--------------------------------------------------------------------------
  3369.   # ● バトルプログラム 周期色調変更の開始
  3370.   #--------------------------------------------------------------------------
  3371.   def start_program_color(data)
  3372.     data[3] = [data[2], data[3]]
  3373.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3374.     data[7] = true if data[4] == 0 or data[4] == 4
  3375.     case data[4]
  3376.     when 1   ;data[4] = $game_troop.members
  3377.     when 2   ;data[4] = $game_party.battle_members
  3378.     when 3,4 ;data[4] = $game_troop.members + $game_party.battle_members
  3379.     else ;data[4] = []
  3380.     end
  3381.     @program_color.push(data)
  3382.     return if !data[6]
  3383.     for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
  3384.     @color_set[1] = data[5] if data[7]
  3385.     @color_set[2] = data[5] if data[7]
  3386.   end
  3387.   #--------------------------------------------------------------------------
  3388.   # ● 周期色調変更の更新
  3389.   #--------------------------------------------------------------------------
  3390.   def update_program_color
  3391.     for data in @program_color
  3392.       data[2] -= 1
  3393.       next @program_color.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3394.       next @program_color.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3395.       next if data[2] != 0
  3396.       for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
  3397.       @color_set[1] = data[5] if data[7]
  3398.       @color_set[2] = data[5] if data[7]
  3399.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3400.     end
  3401.   end
  3402.   #--------------------------------------------------------------------------
  3403.   # ● トランジション実行
  3404.   #--------------------------------------------------------------------------
  3405.   def perform_transition(data)
  3406.     Graphics.transition(data[2], "Graphics/Pictures/" + data[3], data[1])
  3407.   end  
  3408.   #--------------------------------------------------------------------------
  3409.   # ● 背景からカメラの限界値を取得  data = [max_top, max_bottom, max_left, max_right]
  3410.   #--------------------------------------------------------------------------
  3411.   def setting(index, data)
  3412.     @max_data[index - 1] = data
  3413.     return if index != 2
  3414.     setup
  3415.     # カメラの中心座標
  3416.     @center_x     = (Graphics.width / 2 + N03::CAMERA_POSITION[0]) * 100
  3417.     @center_y     = (Graphics.height / 2 + N03::CAMERA_POSITION[1]) * 100
  3418.     # 上下左右の移動限界距離
  3419.     @max_top    = [@max_data[0][5], @max_data[1][5]].min * -1
  3420.     @max_bottom = [@max_data[0][1], @max_data[1][1]].min + @max_top
  3421.     @max_left   = [@max_data[0][4], @max_data[1][4]].min  * -1
  3422.     @max_right  = [@max_data[0][3], @max_data[1][3]].min + @max_left
  3423.     exist_data = @max_data[0] if !@max_data[1][6]
  3424.     exist_data = @max_data[1] if !@max_data[0][6]
  3425.     @max_top    = exist_data[5] * -1        if exist_data != nil
  3426.     @max_bottom = exist_data[1] + @max_top  if exist_data != nil
  3427.     @max_left   = exist_data[4] * -1        if exist_data != nil
  3428.     @max_right  = exist_data[3] + @max_left if exist_data != nil
  3429.     @max_top = @max_bottom = @max_left = @max_right = 0 if !@max_data[1][6] && !@max_data[0][6]
  3430.     @max_width    = @max_right - @max_left + Graphics.width
  3431.     @max_height   = @max_bottom - @max_top + Graphics.height
  3432.     # ズームアウト限界値
  3433.     max_zoom_x    = 100 * Graphics.width / @max_width
  3434.     max_zoom_y    = 100 * Graphics.height / @max_height
  3435.     @max_zoom_out = [max_zoom_x, max_zoom_y].max
  3436.   end
  3437.   #--------------------------------------------------------------------------
  3438.   # ● カメラ移動
  3439.   #--------------------------------------------------------------------------
  3440.   def move(target_x, target_y, zoom, time, screen = true)
  3441.     # 戦闘背景以上のサイズまでズームアウトしないよう調整
  3442.     @target_zoom = [zoom * 0.01, @max_zoom_out * 0.01].max
  3443.     target_x *= -1 if screen && @mirror
  3444.     # ズーム分の中心座標補正
  3445.     if screen && @target_zoom != 1
  3446.       target_x = target_x + @center_x
  3447.       target_y = target_y + @center_y
  3448.     end
  3449.     adjust_x = @center_x * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
  3450.     adjust_y = @center_y * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
  3451.     adjust_x = 0 if adjust_x.nan?
  3452.     adjust_y = 0 if adjust_y.nan?
  3453.     adjust_x = @center_x if !screen && adjust_x == 0
  3454.     adjust_y = @center_y if !screen && adjust_y == 0
  3455.     @target_x = target_x - adjust_x.to_i
  3456.     @target_y = target_y - adjust_y.to_i
  3457.     @target_zoom = (@target_zoom * 1000).to_i
  3458.     @zoom = @zoom.to_i
  3459.     limit_test
  3460.     # 時間0の場合は即実行
  3461.     return @time = time.abs if time != 0
  3462.     @time = 1
  3463.     update
  3464.   end
  3465.   #--------------------------------------------------------------------------
  3466.   # ● 限界座標の試算
  3467.   #--------------------------------------------------------------------------
  3468.   def limit_test
  3469.     new_width = @max_width * @target_zoom / 1000
  3470.     new_height = @max_height * @target_zoom / 1000
  3471.     new_max_right = @max_right - (@max_width - new_width)
  3472.     new_max_bottom = @max_bottom - (@max_height - new_height)
  3473.     # 画面の移動先が限界の場合、限界座標をセット
  3474.     if @target_x < @max_left * 100
  3475.       @target_x = @max_left * 100
  3476.     end
  3477.     if @target_x > new_max_right * 100
  3478.       @target_x = new_max_right * 100
  3479.     end
  3480.     if @target_y < @max_top * 100
  3481.       @target_y = @max_top * 100
  3482.     end
  3483.     if @target_y > new_max_bottom * 100
  3484.       @target_y = new_max_bottom * 100
  3485.     end
  3486.   end
  3487.   #--------------------------------------------------------------------------
  3488.   # ● 画面のシェイク
  3489.   #--------------------------------------------------------------------------
  3490.   def shake(power, speed, time)
  3491.     @shake_x = power[0] * 100
  3492.     @shake_y = power[1] * 100
  3493.     @power_time_base = @power_time = speed
  3494.     @shake_time = time
  3495.     update_shake
  3496.   end
  3497.   #--------------------------------------------------------------------------
  3498.   # ● シェイクの更新
  3499.   #--------------------------------------------------------------------------
  3500.   def update_shake
  3501.     @sx = (@sx * (@power_time - 1) + @shake_x) / @power_time
  3502.     @sy = (@sy * (@power_time - 1) + @shake_y) / @power_time
  3503.     @power_time -= 1
  3504.     @shake_time -= 1
  3505.     return @sx = @sy = 0 if @shake_time == 0
  3506.     return if @power_time != 0
  3507.     @power_time = @power_time_base
  3508.     @shake_x = @shake_x * -4 / 5
  3509.     @shake_y = @shake_y * -4 / 5
  3510.   end
  3511.   #--------------------------------------------------------------------------
  3512.   # ● フレーム更新
  3513.   #--------------------------------------------------------------------------
  3514.   def update
  3515.     update_shake if @shake_time != 0
  3516.     update_program
  3517.     return if @time == 0
  3518.     @x = (@x * (@time - 1) + @target_x) / @time
  3519.     @y = (@y * (@time - 1) + @target_y) / @time
  3520.     @zoom = (@zoom * (@time - 1) + @target_zoom) / @time
  3521.     @time -= 1
  3522.   end
  3523.   #--------------------------------------------------------------------------
  3524.   # ● フレーム更新
  3525.   #--------------------------------------------------------------------------
  3526.   def update_program
  3527.     update_program_switch if @program_switch != []
  3528.     update_program_se     if @program_se != []
  3529.     update_program_shake  if @program_shake != []
  3530.     update_program_color  if @program_color != []
  3531.   end
  3532. end

  3533. #==============================================================================
  3534. # ■ Scene_Battle
  3535. #------------------------------------------------------------------------------
  3536. #  バトル画面の処理を行うクラスです。
  3537. #==============================================================================
  3538. class Scene_Battle < Scene_Base
  3539.   #--------------------------------------------------------------------------
  3540.   # ● フレーム更新(基本)
  3541.   #--------------------------------------------------------------------------
  3542.   alias update_basic_scene_battle_n03 update_basic
  3543.   def update_basic
  3544.     update_basic_scene_battle_n03
  3545.     $sv_camera.update
  3546.     $sv_camera.wait = N03::TURN_END_WAIT + 1 if $sv_camera.win_wait
  3547.     camera_wait
  3548.   end
  3549.   #--------------------------------------------------------------------------
  3550.   # ● カメラウェイト
  3551.   #--------------------------------------------------------------------------
  3552.   def camera_wait
  3553.     process_event if $sv_camera.event
  3554.     $sv_camera.event = false if $sv_camera.event
  3555.     while $sv_camera.wait != 0
  3556.       Graphics.update
  3557.       Input.update
  3558.       update_all_windows
  3559.       $game_timer.update
  3560.       $game_troop.update
  3561.       $sv_camera.update
  3562.       @spriteset.update
  3563.       update_info_viewport
  3564.       update_message_open
  3565.       $sv_camera.wait -= 1 if $sv_camera.wait > 0
  3566.       $sv_camera.wait = 1 if $sv_camera.wait == 0 && @spriteset.effect?
  3567.       BattleManager.victory if $sv_camera.win_wait && $sv_camera.wait == 0
  3568.     end
  3569.   end
  3570.   #--------------------------------------------------------------------------
  3571.   # ● カメラウェイトのセット
  3572.   #--------------------------------------------------------------------------
  3573.   def set_camera_wait(time)
  3574.     $sv_camera.wait = time
  3575.     camera_wait
  3576.   end  
  3577.   #--------------------------------------------------------------------------
  3578.   # ● エフェクト実行が終わるまでウェイト ★再定義
  3579.   #--------------------------------------------------------------------------
  3580.   def wait_for_effect
  3581.   end
  3582.   #--------------------------------------------------------------------------
  3583.   # ● ターン開始
  3584.   #--------------------------------------------------------------------------
  3585.   alias turn_start_scene_battle_n03 turn_start
  3586.   def turn_start
  3587.     turn_start_scene_battle_n03
  3588.     N03.camera(nil, N03::BATTLE_CAMERA["回合开始后"].dup)
  3589.   end
  3590.   #--------------------------------------------------------------------------
  3591.   # ● ターン終了
  3592.   #--------------------------------------------------------------------------
  3593.   alias turn_end_scene_battle_n03 turn_end
  3594.   def turn_end
  3595.     turn_end_scene_battle_n03
  3596.     for member in $game_troop.members + $game_party.members
  3597.       N03.set_damage(member, member.sv.result_damage[0],member.sv.result_damage[1])
  3598.       member.sv.result_damage = [0,0]
  3599.       @spriteset.set_damage_pop(member) if member.result.hp_damage != 0 or member.result.mp_damage != 0
  3600.     end
  3601.     set_camera_wait(N03::TURN_END_WAIT)
  3602.     N03.camera(nil, N03::BATTLE_CAMERA["回合开始前"].dup) if $game_party.inputable?
  3603.     @log_window.clear
  3604.   end
  3605.   #--------------------------------------------------------------------------
  3606.   # ● スキル/アイテムの使用 ★再定義
  3607.   #--------------------------------------------------------------------------
  3608.   def use_item
  3609.     item = @subject.current_action.item
  3610.     display_item(item)
  3611.     @subject.use_item(item)
  3612.     refresh_status
  3613.     @targets = @subject.current_action.make_targets.compact
  3614.     @targets = [@subject] if @targets.size == 0
  3615.     set_substitute(item)
  3616.     for time in item.repeats.times do play_sideview(@targets, item) end
  3617.     end_reaction(item)
  3618.     display_end_item
  3619.   end
  3620.   #--------------------------------------------------------------------------
  3621.   # ● スキル/アイテム名の表示
  3622.   #--------------------------------------------------------------------------
  3623.   def display_item(item)
  3624.     return @log_window.display_use_item(@subject, item) if N03::BATTLE_LOG
  3625.     @log_window.off
  3626.     @skill_name_window = Window_Skill_name.new(item.name) unless N03::NO_DISPLAY_SKILL_ID.include?(item.id) && item.is_a?(RPG::Skill)
  3627.   end  
  3628.   #--------------------------------------------------------------------------
  3629.   # ● スキル/アイテム名の表示終了
  3630.   #--------------------------------------------------------------------------
  3631.   def display_end_item
  3632.     @skill_name_window.dispose if @skill_name_window != nil
  3633.     @skill_name_window = nil
  3634.     set_camera_wait(N03::ACTION_END_WAIT) if @subject.sv.derivation_skill_id == 0
  3635.     @log_window.clear if N03::BATTLE_LOG
  3636.   end  
  3637.   #--------------------------------------------------------------------------
  3638.   # ● 反撃/魔法反射/身代わり処理
  3639.   #--------------------------------------------------------------------------
  3640.   def end_reaction(item)
  3641.     end_substitute if @substitute != nil
  3642.     set_reflection(item) if @reflection_data != nil
  3643.     set_counter_attack if @counter_attacker != nil
  3644.   end  
  3645.   #--------------------------------------------------------------------------
  3646.   # ● 反撃の発動 ★再定義
  3647.   #--------------------------------------------------------------------------
  3648.   def invoke_counter_attack(target, item)
  3649.     return if @subject.sv.counter_id != 0
  3650.     @counter_attacker = [] if @counter_attacker == nil
  3651.     return apply_item_effects(apply_substitute(target, item), item) if !target.movable?
  3652.     @log_window.add_text(sprintf(Vocab::CounterAttack, target.name)) if N03::BATTLE_LOG
  3653.     target.sv.counter_id = target.sv.counter_skill_id
  3654.     @counter_attacker.push(target)
  3655.   end
  3656.   #--------------------------------------------------------------------------
  3657.   # ● 魔法反射の発動 ★再定義
  3658.   #--------------------------------------------------------------------------
  3659.   def invoke_magic_reflection(target, item)
  3660.     return if @subject.sv.reflection_id != 0
  3661.     @log_window.add_text(sprintf(Vocab::MagicReflection, target.name)) if N03::BATTLE_LOG
  3662.     target.sv.reflection_id = target.sv.reflection_anime_id
  3663.   end
  3664.   #--------------------------------------------------------------------------
  3665.   # ● 身代わりの適用 ★再定義
  3666.   #--------------------------------------------------------------------------
  3667.   def apply_substitute(target, item)
  3668.     return target if @substitute == nil
  3669.     return target if !check_substitute(target, item)
  3670.     return @substitute
  3671.   end
  3672.   #--------------------------------------------------------------------------
  3673.   # ● 身代わりセット
  3674.   #--------------------------------------------------------------------------
  3675.   def set_substitute(item)
  3676.     @substitute = N03.get_enemy_unit(@subject).substitute_battler
  3677.     return if @substitute == nil
  3678.     s_targets = []
  3679.     for i in [email]0...@targets.size[/email]
  3680.       next if @targets[i] == @substitute
  3681.       next if !check_substitute(@targets[i], item)
  3682.       @log_window.add_text(sprintf(Vocab::Substitute, @substitute.name, @targets[i].name))
  3683.       @targets[i].sv.start_action(@targets[i].sv.substitute_receiver_start_action)
  3684.       s_targets.push(@targets[i])
  3685.       @targets[i] = @substitute
  3686.     end
  3687.     return @substitute = nil if s_targets == []
  3688.     @substitute.sv.set_target(s_targets)
  3689.     @substitute.sv.start_action(@substitute.sv.substitute_start_action)
  3690.   end  
  3691.   #--------------------------------------------------------------------------
  3692.   # ● 身代わり終了
  3693.   #--------------------------------------------------------------------------
  3694.   def end_substitute
  3695.     for member in @substitute.sv.target_battler
  3696.       member.sv.start_action(member.sv.substitute_receiver_end_action)
  3697.     end  
  3698.     @substitute.sv.start_action(@substitute.sv.substitute_end_action)
  3699.     @substitute = nil
  3700.   end
  3701.   #--------------------------------------------------------------------------
  3702.   # ● 反撃
  3703.   #--------------------------------------------------------------------------
  3704.   def set_counter_attack
  3705.     pre_subject = @subject
  3706.     for attacker in @counter_attacker
  3707.       @subject = attacker
  3708.       item = $data_skills[attacker.sv.counter_skill_id]
  3709.       play_sideview([pre_subject], item)
  3710.     end
  3711.     # 同一カウンター者を考慮してカウンターIDの初期化はアクション後に実行
  3712.     for attacker in @counter_attacker do attacker.sv.counter_id = 0 end
  3713.     @subject = pre_subject
  3714.     @counter_attacker = nil
  3715.   end
  3716.   #--------------------------------------------------------------------------
  3717.   # ● 魔法反射
  3718.   #--------------------------------------------------------------------------
  3719.   def set_reflection(item)
  3720.     @log_window.back_to(1)
  3721.     for data in @reflection_data
  3722.       @subject.sv.damage_action(@subject, item)
  3723.       N03.set_damage_anime_data([@subject], @subject, data)
  3724.       apply_item_effects(@subject, item)
  3725.       @spriteset.set_damage_pop(@subject)
  3726.     end
  3727.     set_camera_wait(N03.get_anime_time(@reflection_data[0][0]))
  3728.     @reflection_data = nil
  3729.   end
  3730.   #--------------------------------------------------------------------------
  3731.   # ● サイドビューアクション実行
  3732.   #--------------------------------------------------------------------------
  3733.   def play_sideview(targets, item)
  3734.     @subject.sv.set_target(targets)
  3735.     return if @subject.sv.attack_action(item) == nil
  3736.     return if !@subject.movable?
  3737.     return if item.scope != 9 && item.scope != 10 && !N03.targets_alive?(targets)
  3738.     @subject.sv.start_action(@subject.sv.attack_action(item))
  3739.     @subject.sv.unshift_action(@subject.sv.flash_action) if @subject.flash_flg
  3740.     @subject.sv.active = true
  3741.     @subject.sv.command_action = false
  3742.     loop do
  3743.       update_basic
  3744.       data = @subject.sv.play_data
  3745.       @targets = N03.s_targets(@subject) if data[0] == "second_targets_set"
  3746.       N03.targets_set(@subject)          if data[0] == "targets_set"
  3747.       @immortal = N03.immortaling        if data[0] == "no_collapse" && !N03.dead_attack?(@subject, item)
  3748.       @immortal = N03.unimmortaling      if data[0] == "collapse"
  3749.       next set_move_anime(item)          if @subject.sv.m_a_data != []
  3750.       set_damage(item)                   if @subject.sv.set_damage
  3751.       break N03.derived_skill(@subject)  if @subject.sv.derivation_skill_id != 0
  3752.       break                              if @subject.sv.action_end or @subject.hidden?
  3753.     end
  3754.     @immortal = N03.unimmortaling        if @immortal
  3755.   end
  3756.   #--------------------------------------------------------------------------
  3757.   # ● ダメージの実行
  3758.   #--------------------------------------------------------------------------
  3759.   def set_damage(item)
  3760.     targets = @targets
  3761.     targets = [@subject.sv.individual_targets[0]] if @subject.sv.individual_targets.size != 0
  3762.     for target in targets do damage_anime(targets.dup, target, item) end
  3763.     @subject.sv.set_damage = false
  3764.     @subject.sv.damage_anime_data = []
  3765.   end
  3766.   #--------------------------------------------------------------------------
  3767.   # ● ダメージ戦闘アニメ処理
  3768.   #--------------------------------------------------------------------------
  3769.   def damage_anime(targets, target, item)
  3770.     @log_window.back_to(1) if @log_window.line_number == 5
  3771.     return if item.scope != 9 && item.scope != 10 && target.dead?
  3772.     @miss = false
  3773.     invoke_item(target,item)
  3774.     if target.result.missed
  3775.       target.sv.miss_action(@subject, item)
  3776.       return @miss = true
  3777.     elsif target.result.evaded or target.sv.counter_id != 0
  3778.       target.sv.evasion_action(@subject, item)
  3779.       return @miss = true
  3780.     elsif target.sv.reflection_id != 0
  3781.       N03.set_damage_anime_data(targets, target, [target.sv.reflection_id, false, false, true])
  3782.       target.sv.reflection_id = 0
  3783.       @reflection_data = [] if @reflection_data == nil
  3784.       return @reflection_data.push([N03.get_attack_anime_id(-3, @subject), false, false, true])
  3785.     end
  3786.     target.sv.damage_action(@subject, item)
  3787.     N03.set_damage(@subject, -target.result.hp_drain, -target.result.mp_drain) if target != @subject
  3788.     @spriteset.set_damage_pop(target)
  3789.     @spriteset.set_damage_pop(@subject) if target != @subject && @subject.result.hp_damage != 0 or @subject.result.mp_damage != 0
  3790.     N03.set_damage_anime_data(targets, target, @subject.sv.damage_anime_data) if @subject.sv.damage_anime_data != []
  3791.   end
  3792.   #--------------------------------------------------------------------------
  3793.   # ● 飛ばしアニメ処理
  3794.   #--------------------------------------------------------------------------
  3795.   def set_move_anime(item)
  3796.     for data in @subject.sv.m_a_data
  3797.       @subject.sv.damage_anime_data = data[4]
  3798.       hit_targets = []
  3799.       for target in data[1]
  3800.         damage_anime(data[1], target, item) if data[0]
  3801.         hit_targets.push(target) if !@miss
  3802.       end
  3803.       @miss = false if !data[3]
  3804.       @spriteset.set_hit_animation(@subject, data[2], hit_targets, @miss)
  3805.     end
  3806.     @subject.sv.set_damage = false
  3807.     @subject.sv.m_a_data = []
  3808.   end
  3809. end

  3810. #==============================================================================
  3811. # ■ DataManager
  3812. #------------------------------------------------------------------------------
  3813. #  データベースとゲームオブジェクトを管理するモジュールです。
  3814. #==============================================================================
  3815. module DataManager
  3816.   #--------------------------------------------------------------------------
  3817.   # ● 各種ゲームオブジェクトの作成 ★再定義
  3818.   #--------------------------------------------------------------------------
  3819.   def self.create_game_objects
  3820.     $game_temp          = Game_Temp.new
  3821.     $game_system        = Game_System.new
  3822.     $game_timer         = Game_Timer.new
  3823.     $game_message       = Game_Message.new
  3824.     $game_switches      = Game_Switches.new
  3825.     $game_variables     = Game_Variables.new
  3826.     $game_self_switches = Game_SelfSwitches.new
  3827.     $game_actors        = Game_Actors.new
  3828.     $game_party         = Game_Party.new
  3829.     $game_troop         = Game_Troop.new
  3830.     $game_map           = Game_Map.new
  3831.     $game_player        = Game_Player.new
  3832.     $sv_camera          = Battle_Camera.new
  3833.   end
  3834. end

  3835. #==============================================================================
  3836. # ■ BattleManager
  3837. #------------------------------------------------------------------------------
  3838. #  戦闘の進行を管理するモジュールです。
  3839. #==============================================================================
  3840. module BattleManager
  3841.   #--------------------------------------------------------------------------
  3842.   # ● エンカウント時の処理 ★再定義
  3843.   #--------------------------------------------------------------------------
  3844.   def self.on_encounter
  3845.     @preemptive = (rand < rate_preemptive)
  3846.     @surprise = (rand < rate_surprise && !@preemptive)
  3847.     $sv_camera.mirror = @surprise if N03::BACK_ATTACK
  3848.   end
  3849.   #--------------------------------------------------------------------------
  3850.   # ● 勝利の処理 ★再定義
  3851.   #--------------------------------------------------------------------------
  3852.   def self.process_victory
  3853.     $sv_camera.win_wait = true
  3854.   end  
  3855.   #--------------------------------------------------------------------------
  3856.   # ● 勝利
  3857.   #--------------------------------------------------------------------------
  3858.   def self.victory
  3859.     $sv_camera.win_wait = false
  3860.     N03.camera(nil, N03::BATTLE_CAMERA["战斗结束时"].dup)
  3861.     for member in $game_party.members do member.sv.start_action(member.sv.win) if member.movable? end
  3862.     play_battle_end_me
  3863.     replay_bgm_and_bgs
  3864.     $game_message.add(sprintf(Vocab::Victory, $game_party.name))
  3865.     display_exp
  3866.     gain_gold
  3867.     gain_drop_items
  3868.     gain_exp
  3869.     SceneManager.return
  3870.     battle_end(0)
  3871.     return true
  3872.   end
  3873.   #--------------------------------------------------------------------------
  3874.   # ● 逃走の処理 ★再定義
  3875.   #--------------------------------------------------------------------------
  3876.   def self.process_escape
  3877.     $game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
  3878.     success = @preemptive ? true : (rand < @escape_ratio)
  3879.     Sound.play_escape
  3880.     if success
  3881.       process_abort
  3882.       for member in $game_party.members do member.sv.start_action(member.sv.escape) if member.movable? end
  3883.     else
  3884.       @escape_ratio += 0.1
  3885.       $game_message.add('\.' + Vocab::EscapeFailure)
  3886.       $game_party.clear_actions
  3887.       for member in $game_party.members do member.sv.start_action(member.sv.escape_ng) if member.movable? end
  3888.     end
  3889.     wait_for_message
  3890.     return success
  3891.   end
  3892.   #--------------------------------------------------------------------------
  3893.   # ● 次のコマンド入力へ ★再定義
  3894.   #--------------------------------------------------------------------------
  3895.   def self.next_command
  3896.     begin
  3897.       if !actor || !actor.next_command
  3898.         $game_party.battle_members[@actor_index].sv.command_action = true
  3899.         @actor_index += 1
  3900.         if @actor_index >= $game_party.members.size
  3901.           for member in $game_party.battle_members.reverse
  3902.             break member.sv.start_action(member.sv.command_a) if member.inputable?
  3903.           end
  3904.           return false
  3905.         end
  3906.       end
  3907.     end until actor.inputable?
  3908.     actor.sv.start_action(actor.sv.command_b) if actor != nil && actor.inputable?
  3909.     if pre_actor
  3910.       pre_actor.sv.start_action(pre_actor.sv.command_a) if pre_actor != nil && pre_actor.inputable?
  3911.     end
  3912.     return true
  3913.   end
  3914.   #--------------------------------------------------------------------------
  3915.   # ● 前のコマンド入力へ ★再定義
  3916.   #--------------------------------------------------------------------------
  3917.   def self.prior_command
  3918.     begin
  3919.       if !actor || !actor.prior_command
  3920.         $game_party.battle_members[@actor_index].sv.command_action = false
  3921.         @actor_index -= 1
  3922.         if @actor_index < 0
  3923.           for member in $game_party.battle_members
  3924.             break member.sv.start_action(member.sv.command_a) if member.inputable?
  3925.           end
  3926.           return false
  3927.         end
  3928.       end
  3929.     end until actor.inputable?
  3930.     actor.make_actions if actor.inputable?
  3931.     actor.sv.start_action(actor.sv.command_b) if actor.inputable?
  3932.     after_actor.sv.start_action(after_actor.sv.command_a) if after_actor != nil && after_actor.inputable?
  3933.     return true
  3934.   end
  3935.   #--------------------------------------------------------------------------
  3936.   # ● コマンド入力前のアクターを取得
  3937.   #--------------------------------------------------------------------------
  3938.   def self.pre_actor
  3939.     return if @actor_index == 0
  3940.     $game_party.members[@actor_index - 1]
  3941.   end
  3942.   #--------------------------------------------------------------------------
  3943.   # ● コマンド入力後のアクターを取得
  3944.   #--------------------------------------------------------------------------
  3945.   def self.after_actor
  3946.     $game_party.members[@actor_index + 1]
  3947.   end
  3948.   #--------------------------------------------------------------------------
  3949.   # ● 戦闘行動者を前に追加
  3950.   #--------------------------------------------------------------------------
  3951.   def self.unshift_action_battlers(battler)
  3952.     @action_battlers.unshift(battler)
  3953.   end
  3954. end  

  3955. #==============================================================================
  3956. # ■ Game_Battler
  3957. #------------------------------------------------------------------------------
  3958. #  スプライトや行動に関するメソッドを追加したバトラーのクラスです。
  3959. #==============================================================================
  3960. class Game_Battler < Game_BattlerBase
  3961.   #--------------------------------------------------------------------------
  3962.   # ● 公開インスタンス変数
  3963.   #--------------------------------------------------------------------------
  3964.   attr_reader   :sv                     # サイドビューデータ
  3965.   attr_accessor :flash_flg              # 閃きフラグ
  3966.   #--------------------------------------------------------------------------
  3967.   # ● オブジェクト初期化
  3968.   #--------------------------------------------------------------------------
  3969.   alias initialize_game_battler_n03 initialize
  3970.   def initialize
  3971.     initialize_game_battler_n03
  3972.     @sv = SideView.new(self)
  3973.   end
  3974.   #--------------------------------------------------------------------------
  3975.   # ● 現在の戦闘行動を除去
  3976.   #--------------------------------------------------------------------------
  3977.   alias remove_current_action_game_battler_n03 remove_current_action
  3978.   def remove_current_action
  3979.     return @sv.derivation_skill_id = 0 if @sv.derivation_skill_id != 0
  3980.     remove_current_action_game_battler_n03
  3981.   end
  3982.   #--------------------------------------------------------------------------
  3983.   # ● ターン終了処理
  3984.   #--------------------------------------------------------------------------
  3985.   alias on_turn_end_game_battler_n03 on_turn_end
  3986.   def on_turn_end
  3987.     on_turn_end_game_battler_n03
  3988.     @sv.add_state = []
  3989.     @sv.result_damage = [@result.hp_damage, @result.mp_damage]
  3990.   end
  3991.   #--------------------------------------------------------------------------
  3992.   # ● パラメータ条件比較 data = [種別, 数値, 判別]
  3993.   #--------------------------------------------------------------------------
  3994.   def comparison_parameter(data)
  3995.     return true if data[0][0] == 0
  3996.     kind = data[0]
  3997.     num = data[1]
  3998.     select = data[2]
  3999.     case kind
  4000.     when  1 ; par = level
  4001.     when  2 ; par = mhp
  4002.     when  3 ; par = mmp
  4003.     when  4 ; par = hp
  4004.     when  5 ; par = mp
  4005.     when  6 ; par = tp
  4006.     when  7 ; par = atk
  4007.     when  8 ; par = self.def
  4008.     when  9 ; par = mat
  4009.     when 10 ; par = mdf
  4010.     when 11 ; par = agi
  4011.     when 12 ; par = luk
  4012.     end
  4013.     if num < 0
  4014.       case kind
  4015.       when  4 ; num = mhp * num / 100
  4016.       when  5 ; num = mmp * num / 100
  4017.       when  6 ; num = max_tp * num / 100
  4018.       end
  4019.       num = num.abs
  4020.     end  
  4021.     case select
  4022.     when  0 ; return par == num
  4023.     when  1 ; return par < num
  4024.     when  2 ; return par > num
  4025.     end
  4026.   end
  4027.   #--------------------------------------------------------------------------
  4028.   # ● 装備条件比較 data = [装備種別, タイプID]
  4029.   #--------------------------------------------------------------------------
  4030.   def comparison_equip(data)
  4031.     kind = data[0]
  4032.     items = weapons if kind == 0
  4033.     items = armors  if kind == 1
  4034.     for item in items
  4035.       for id in data[1]
  4036.         return true if id > 0 && item.is_a?(RPG::Weapon) && item == $data_weapons[id.abs]
  4037.         return true if id > 0 && item.is_a?(RPG::Armor) && item == $data_armors[id.abs]
  4038.         return true if id < 0 && item.is_a?(RPG::Weapon) && item.wtype_id == id.abs
  4039.         return true if id < 0 && item.is_a?(RPG::Armor) && item.stype_id == id.abs
  4040.       end
  4041.     end
  4042.     return false
  4043.   end
  4044.   
  4045. end  
  4046. #==============================================================================
  4047. # ■ Game_Actor
  4048. #------------------------------------------------------------------------------
  4049. #  アクターを扱うクラスです。
  4050. #==============================================================================
  4051. class Game_Actor < Game_Battler
  4052.   #--------------------------------------------------------------------------
  4053.   # ● 公開インスタンス変数
  4054.   #--------------------------------------------------------------------------
  4055.   attr_reader :actor_id                    # ID
  4056.   #--------------------------------------------------------------------------
  4057.   # ● ID
  4058.   #--------------------------------------------------------------------------
  4059.   def id
  4060.     return @actor_id
  4061.   end
  4062.   #--------------------------------------------------------------------------
  4063.   # ● スプライトを使うか? ★再定義
  4064.   #--------------------------------------------------------------------------
  4065.   def use_sprite?
  4066.     return true
  4067.   end
  4068.   #--------------------------------------------------------------------------
  4069.   # ● ダメージ効果の実行 ★再定義
  4070.   #--------------------------------------------------------------------------
  4071.   def perform_damage_effect
  4072.     return if !N03::ACTOR_DAMAGE
  4073.     $game_troop.screen.start_shake(5, 5, 10)
  4074.     @sprite_effect_type = :blink
  4075.     Sound.play_actor_damage
  4076.   end
  4077.   
  4078. end

  4079. #==============================================================================
  4080. # ■ Game_Enemy
  4081. #------------------------------------------------------------------------------
  4082. #  敵キャラを扱うクラスです。
  4083. #==============================================================================
  4084. class Game_Enemy < Game_Battler
  4085.   #--------------------------------------------------------------------------
  4086.   # ● 公開インスタンス変数
  4087.   #--------------------------------------------------------------------------
  4088.   attr_reader :enemy_id                    # ID
  4089.   #--------------------------------------------------------------------------
  4090.   # ● ID
  4091.   #--------------------------------------------------------------------------
  4092.   def id
  4093.     return @enemy_id
  4094.   end
  4095.   #--------------------------------------------------------------------------
  4096.   # ● レベル
  4097.   #--------------------------------------------------------------------------
  4098.   def level
  4099.     return @sv.level
  4100.   end
  4101.   #--------------------------------------------------------------------------
  4102.   # ● ダメージ効果の実行 ★再定義
  4103.   #--------------------------------------------------------------------------
  4104.   def perform_damage_effect
  4105.     return if !N03::ENEMY_DAMAGE
  4106.     @sprite_effect_type = :blink
  4107.     Sound.play_enemy_damage
  4108.   end
  4109.   #--------------------------------------------------------------------------
  4110.   # ● 武器
  4111.   #--------------------------------------------------------------------------
  4112.   def weapons
  4113.     weapon1 = $data_weapons[@sv.enemy_weapon1_id]
  4114.     weapon2 = $data_weapons[@sv.enemy_weapon2_id]
  4115.     return [weapon1, weapon2]
  4116.   end
  4117.   #--------------------------------------------------------------------------
  4118.   # ● 防具
  4119.   #--------------------------------------------------------------------------
  4120.   def armors
  4121.     return [$data_armors[@sv.enemy_shield_id]]
  4122.   end
  4123.   #--------------------------------------------------------------------------
  4124.   # ● 二刀流の判定
  4125.   #--------------------------------------------------------------------------
  4126.   def dual_wield?
  4127.     return $data_weapons[@sv.enemy_weapon2_id] != nil
  4128.   end
  4129.   #--------------------------------------------------------------------------
  4130.   # ● バトラー画像変更
  4131.   #--------------------------------------------------------------------------
  4132.   def graphics_change(battler_name)
  4133.     @battler_name = battler_name
  4134.   end
  4135.   #--------------------------------------------------------------------------
  4136.   # ● 通常攻撃 アニメーション ID の取得
  4137.   #--------------------------------------------------------------------------
  4138.   def atk_animation_id1
  4139.     return weapons[0].animation_id if weapons[0]
  4140.     return weapons[1] ? 0 : 1
  4141.   end
  4142.   #--------------------------------------------------------------------------
  4143.   # ● 通常攻撃 アニメーション ID の取得(二刀流:武器2)
  4144.   #--------------------------------------------------------------------------
  4145.   def atk_animation_id2
  4146.     return weapons[1] ? weapons[1].animation_id : 0
  4147.   end
  4148. end

  4149. #==============================================================================
  4150. # ■ Sprite_Base
  4151. #------------------------------------------------------------------------------
  4152. #  アニメーションの表示処理を追加したスプライトのクラスです。
  4153. #==============================================================================
  4154. class Sprite_Base < Sprite
  4155.   #--------------------------------------------------------------------------
  4156.   # ● アニメーションの座標更新 (ホーミングあり)
  4157.   #--------------------------------------------------------------------------
  4158.   def update_animation_position_horming
  4159.     return if @action_end_cancel
  4160.     ani_ox_set if @horming
  4161.     camera_zoom = $sv_camera.zoom
  4162.     camera_zoom = 1 if @move_anime
  4163.     kind = 1
  4164.     kind = -1 if @ani_mirror && !@anime_no_mirror
  4165.     cell_data = @animation.frames[@animation.frame_max - (@ani_duration + @ani_rate - 1) / @ani_rate].cell_data
  4166.     for i in 0..15
  4167.       @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
  4168.       @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
  4169.     end
  4170.   end
  4171.   #--------------------------------------------------------------------------
  4172.   # ● アニメーション元の座標をセット
  4173.   #--------------------------------------------------------------------------
  4174.   def ani_ox_set
  4175.     if !SceneManager.scene_is?(Scene_Battle)
  4176.       @real_x = x
  4177.       @real_y = y
  4178.     end
  4179.     @ani_ox = @real_x - ox + width / 2
  4180.     @ani_oy = @real_y - oy + height / 2
  4181.     @ani_oy -= height / 2 if @animation.position == 0
  4182.     @ani_oy += height / 2 if @animation.position == 2
  4183.   end
  4184.   #--------------------------------------------------------------------------
  4185.   # ● アニメーションの更新
  4186.   #--------------------------------------------------------------------------
  4187.   alias update_animation_sprite_base_n03 update_animation
  4188.   def update_animation
  4189.     update_animation_position_horming if animation? && SceneManager.scene_is?(Scene_Battle) && @animation.position != 3
  4190.     update_animation_sprite_base_n03
  4191.   end
  4192.   #--------------------------------------------------------------------------
  4193.   # ● アニメーションの原点設定 ★再定義
  4194.   #--------------------------------------------------------------------------
  4195.   def set_animation_origin
  4196.     return ani_ox_set if @animation.position != 3
  4197.     if viewport == nil
  4198.       @ani_ox = Graphics.width / 2
  4199.       @ani_oy = Graphics.height / 2
  4200.     else
  4201.       @ani_ox = viewport.rect.width / 2
  4202.       @ani_oy = viewport.rect.height / 2
  4203.     end
  4204.   end
  4205.   #--------------------------------------------------------------------------
  4206.   # ● アニメーションスプライトの設定 ★再定義
  4207.   #--------------------------------------------------------------------------
  4208.   def animation_set_sprites(frame)
  4209.     camera_zoom = 1
  4210.     camera_zoom = $sv_camera.zoom if @anime_camera_zoom && @animation.position != 3 && SceneManager.scene_is?(Scene_Battle)
  4211.     camera_x = $sv_camera.x
  4212.     camera_y = $sv_camera.y
  4213.     camera_x = camera_y = 0 if @animation.position == 3 or !SceneManager.scene_is?(Scene_Battle)
  4214.     plus_z = 5
  4215.     plus_z = 1000 if @animation.position == 3
  4216.     plus_z = -17 if @plus_z != nil && @plus_z == false
  4217.     plus_z = -self.z + 10 if @plus_z != nil && @plus_z == false && @animation.position == 3
  4218.     cell_data = frame.cell_data
  4219.     @ani_sprites.each_with_index do |sprite, i|
  4220.       next unless sprite
  4221.       pattern = cell_data[i, 0]
  4222.       if !pattern || pattern < 0
  4223.         sprite.visible = false
  4224.         next
  4225.       end
  4226.       sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  4227.       sprite.visible = true
  4228.       sprite.src_rect.set(pattern % 5 * 192,
  4229.         pattern % 100 / 5 * 192, 192, 192)
  4230.       if @ani_mirror && !@anime_no_mirror
  4231.         sprite.x = (@ani_ox - cell_data[i, 1] - camera_x) * camera_zoom
  4232.         sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
  4233.         sprite.angle = (360 - cell_data[i, 4])
  4234.         sprite.mirror = (cell_data[i, 5] == 0)
  4235.       else
  4236.         sprite.x = (@ani_ox + cell_data[i, 1] - camera_x) * camera_zoom
  4237.         sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
  4238.         sprite.angle = cell_data[i, 4]
  4239.         sprite.mirror = (cell_data[i, 5] == 1)
  4240.       end
  4241.       sprite.z = self.z + plus_z + i
  4242.       sprite.ox = 96
  4243.       sprite.oy = 96
  4244.       sprite.zoom_x = cell_data[i, 3] * camera_zoom / 100.0
  4245.       sprite.zoom_y = cell_data[i, 3] * camera_zoom/ 100.0
  4246.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  4247.       sprite.blend_type = cell_data[i, 7]
  4248.     end
  4249.   end
  4250.   #--------------------------------------------------------------------------
  4251.   # ● 子スプライトフラグ
  4252.   #--------------------------------------------------------------------------
  4253.   def set(battler, horming, camera_zoom, no_mirror)
  4254.     @battler = battler
  4255.     @next = true
  4256.     self.bitmap = Bitmap.new(@battler.sv.cw, @battler.sv.ch)
  4257.     self.ox = bitmap.width / 2
  4258.     self.oy = bitmap.height
  4259.     @horming = horming
  4260.     @anime_camera_zoom = camera_zoom
  4261.     @anime_no_mirror = no_mirror
  4262.     @battler.sv.reset_anime_data
  4263.   end  
  4264.   #--------------------------------------------------------------------------
  4265.   # ● 子スプライト座標セット
  4266.   #--------------------------------------------------------------------------
  4267.   def set_position(z, zoom_x, zoom_y, real_x, real_y)
  4268.     self.z = z
  4269.     self.zoom_x = zoom_x
  4270.     self.zoom_y = zoom_y
  4271.     @real_x = real_x
  4272.     @real_y = real_y
  4273.   end
  4274.   #--------------------------------------------------------------------------
  4275.   # ● 他スプライトへのタイミング処理
  4276.   #--------------------------------------------------------------------------
  4277.   def other_process_timing(timing)
  4278.     se_flag = true
  4279.     se_flag = @se_flag if @se_flag != nil
  4280.     @battler.sv.timing.push([se_flag, timing.dup])
  4281.   end
  4282.   #--------------------------------------------------------------------------
  4283.   # ● 他バトラーへのタイミング処理
  4284.   #--------------------------------------------------------------------------
  4285.   def target_battler_process_timing(timing)
  4286.     for target in @timing_targets
  4287.       target.sv.timing.push([false, timing.dup])
  4288.     end  
  4289.   end
  4290.   #--------------------------------------------------------------------------
  4291.   # ● SE とフラッシュのタイミング処理
  4292.   #--------------------------------------------------------------------------
  4293.   alias animation_process_timing_sprite_base_n03 animation_process_timing
  4294.   def animation_process_timing(timing)
  4295.     target_battler_process_timing(timing) if @timing_targets && @timing_targets != []
  4296.     return other_process_timing(timing) if @next != nil
  4297.     animation_process_timing_sprite_base_n03(timing)
  4298.   end
  4299.   #--------------------------------------------------------------------------
  4300.   # ● アニメーションの解放
  4301.   #--------------------------------------------------------------------------
  4302.   alias dispose_animation_sprite_base_n03 dispose_animation
  4303.   def dispose_animation
  4304.     dispose_animation_sprite_base_n03
  4305.   end
  4306. end


  4307. #==============================================================================
  4308. # ■ Sprite_Battler
  4309. #------------------------------------------------------------------------------
  4310. #  バトラー表示用のスプライトです。
  4311. #==============================================================================
  4312. class Sprite_Battler < Sprite_Base
  4313.   #--------------------------------------------------------------------------
  4314.   # ● 公開インスタンス変数 
  4315.   #--------------------------------------------------------------------------
  4316.   attr_accessor   :removing             # パーティ離脱中
  4317.   #--------------------------------------------------------------------------
  4318.   # ● オブジェクト初期化
  4319.   #--------------------------------------------------------------------------
  4320.   alias initialize_sprite_battler_n03 initialize
  4321.   def initialize(viewport, battler = nil)
  4322.     initialize_sprite_battler_n03(viewport, battler)
  4323.     @real_x = @real_y = 0
  4324.     update_bitmap if @battler != nil
  4325.   end
  4326.   #--------------------------------------------------------------------------
  4327.   # ● アニメーションの開始 ★再定義
  4328.   #--------------------------------------------------------------------------
  4329.   def start_animation(animation, mirror = false)
  4330.     return next_animation(animation, mirror) if animation?
  4331.     @animation = animation
  4332.     if @animation
  4333.       @horming = @battler.sv.anime_horming
  4334.       @anime_camera_zoom = @battler.sv.anime_camera_zoom
  4335.       @anime_no_mirror = @battler.sv.anime_no_mirror
  4336.       @timing_targets = @battler.sv.timing_targets
  4337.       @plus_z = @battler.sv.anime_plus_z
  4338.       @battler.sv.reset_anime_data
  4339.       @ani_mirror = mirror
  4340.       set_animation_rate
  4341.       @ani_duration = @animation.frame_max * @ani_rate + 1
  4342.       load_animation_bitmap
  4343.       make_animation_sprites
  4344.       set_animation_origin
  4345.     end
  4346.   end
  4347.   #--------------------------------------------------------------------------
  4348.   # ● 次のアニメを開始
  4349.   #--------------------------------------------------------------------------
  4350.   def next_animation(animation, mirror)
  4351.     @next_anime = [] if @next_anime == nil
  4352.     @next_anime.push(Sprite_Base.new(viewport))
  4353.     @next_anime[@next_anime.size - 1].set(battler, @battler.sv.anime_horming, @battler.sv.anime_camera_zoom, @battler.sv.anime_no_mirror)
  4354.     @next_anime[@next_anime.size - 1].set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y)
  4355.     @next_anime[@next_anime.size - 1].start_animation(animation, mirror)
  4356.   end
  4357.   #--------------------------------------------------------------------------
  4358.   # ● 影グラフィック作成
  4359.   #--------------------------------------------------------------------------
  4360.   def create_shadow
  4361.     reset_shadow
  4362.     return if @battler.sv.shadow == false
  4363.     @shadow = Sprite.new(viewport) if @shadow == nil
  4364.     @shadow.bitmap = Cache.character(@battler.sv.shadow)
  4365.     @shadow.ox = @shadow.bitmap.width / 2
  4366.     @shadow.oy = @shadow.bitmap.height / 2
  4367.   end
  4368.   #--------------------------------------------------------------------------
  4369.   # ● 影グラフィック初期化
  4370.   #--------------------------------------------------------------------------
  4371.   def reset_shadow
  4372.     return if @shadow == nil
  4373.     @shadow.dispose
  4374.     @shadow = nil
  4375.   end  
  4376.   #--------------------------------------------------------------------------
  4377.   # ● 転送元ビットマップの更新 ★再定義
  4378.   #--------------------------------------------------------------------------
  4379.   def update_bitmap
  4380.     update_bitmap_enemy if !@battler.actor?
  4381.     update_bitmap_actor if @battler.actor?
  4382.     update_src_rect if @battler != nil
  4383.     update_color if @battler != nil
  4384.   end
  4385.   #--------------------------------------------------------------------------
  4386.   # ● 転送元ビットマップ:エネミー
  4387.   #--------------------------------------------------------------------------
  4388.   def update_bitmap_enemy
  4389.     if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue
  4390.       @battler_name = @battler.battler_name
  4391.       @battler_hue = @battler.battler_hue
  4392.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4393.       @graphic_mirror_flag = @battler.sv.graphic_mirror_flag
  4394.       self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue)
  4395.       @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  4396.       create_shadow
  4397.       init_visibility
  4398.       @battler_id = @battler.id
  4399.     end
  4400.   end  
  4401.   #--------------------------------------------------------------------------
  4402.   # ● 転送元ビットマップ:アクター
  4403.   #--------------------------------------------------------------------------
  4404.   def update_bitmap_actor
  4405.     if @battler.character_name != @battler_name or @battler.character_index != @battler_index
  4406.       @battler_name = @battler.character_name
  4407.       @battler_index = @battler.character_index
  4408.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4409.       @graphic_mirror_flag = @battler.sv.graphic_mirror_flag
  4410.       self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index)
  4411.       @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  4412.       create_shadow
  4413.       init_visibility
  4414.       @battler_id = @battler.id
  4415.     end
  4416.   end
  4417.   #--------------------------------------------------------------------------
  4418.   # ● 可視状態の初期化 ★再定義
  4419.   #--------------------------------------------------------------------------
  4420.   def init_visibility
  4421.     @battler_visible = @battler.alive?
  4422.     @battler_visible = true if @battler.sv.state(1) != "敌消失"
  4423.     @battler_visible = false if @battler.hidden?
  4424.     @battler.sv.opacity = 0 unless @battler_visible
  4425.     self.opacity = 0 unless @battler_visible
  4426.     self.opacity = 255 if @battler_visible
  4427.     @battler.sv.weapon_visible = @battler_visible
  4428.   end
  4429.   #--------------------------------------------------------------------------
  4430.   # ● 転送元矩形の更新
  4431.   #--------------------------------------------------------------------------
  4432.   def update_src_rect
  4433.     return if @battler.sv.collapse
  4434.     if @battler_graphic_file_index != @battler.sv.graphic_file_index
  4435.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4436.       self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index) if @battler.actor?
  4437.       self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue) if !@battler.actor?
  4438.       @battler.sv.set_graphics(self.bitmap.width, self.bitmap.height)
  4439.     end
  4440.     anime_off if @battler.sv.anime_off
  4441.     self.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
  4442.     self.opacity = @battler.sv.opacity if @battler_visible
  4443.     set_process_timing(@battler.sv.timing) if @battler && @battler.sv.timing != []
  4444.   end
  4445.   #--------------------------------------------------------------------------
  4446.   # ● 位置の更新 ★再定義
  4447.   #--------------------------------------------------------------------------
  4448.   def update_position
  4449.     @real_x = @battler.sv.x / 100
  4450.     @real_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust)/ 100
  4451.     self.x = @real_x - $sv_camera.x
  4452.     self.y = @real_y - $sv_camera.y
  4453.     self.z = @battler.sv.z - @battler.sv.c / 100
  4454.     if @battler.sv.h <= 0
  4455.       self.x += $sv_camera.sx / 100
  4456.       self.y += $sv_camera.sy / 100
  4457.     end  
  4458.     self.x *= $sv_camera.zoom
  4459.     self.y *= $sv_camera.zoom
  4460.   end
  4461.   #--------------------------------------------------------------------------
  4462.   # ● 原点の更新 ★再定義
  4463.   #--------------------------------------------------------------------------
  4464.   def update_origin
  4465.     return if !bitmap or @battler.sv.collapse
  4466.     self.ox = @battler.sv.ox
  4467.     self.oy = @battler.sv.oy
  4468.     self.angle = @battler.sv.angle
  4469.     self.zoom_x = @battler.sv.zoom_x * $sv_camera.zoom
  4470.     self.zoom_y = @battler.sv.zoom_y * $sv_camera.zoom
  4471.     self.mirror = @battler.sv.mirror if !@graphic_mirror_flag
  4472.     self.mirror = !@battler.sv.mirror if @graphic_mirror_flag
  4473.   end
  4474.   #--------------------------------------------------------------------------
  4475.   # ● 影グラフィックの更新
  4476.   #--------------------------------------------------------------------------
  4477.   def update_shadow
  4478.     @shadow.visible = @battler.sv.shadow_visible
  4479.     @shadow.opacity = @battler.sv.opacity if @battler.sv.opacity_data[3]
  4480.     @shadow.opacity = self.opacity if !@battler.sv.opacity_data[3]
  4481.     @shadow.x = @real_x - $sv_camera.x
  4482.     @shadow.y = (@battler.sv.y - @battler.sv.c)/ 100 - $sv_camera.y
  4483.     @shadow.z = @battler.sv.z - 10
  4484.     @shadow.zoom_x = $sv_camera.zoom
  4485.     @shadow.zoom_y = $sv_camera.zoom
  4486.     @shadow.x += $sv_camera.sx / 100
  4487.     @shadow.y += $sv_camera.sy / 100
  4488.     @shadow.x *= $sv_camera.zoom
  4489.     @shadow.y *= $sv_camera.zoom
  4490.     @shadow.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4491.   end
  4492.   #--------------------------------------------------------------------------
  4493.   # ● ふきだしの更新
  4494.   #--------------------------------------------------------------------------
  4495.   def update_balloon
  4496.     if @battler.sv.balloon_data == [] && @balloon
  4497.       @balloon_data = []
  4498.       @balloon.dispose
  4499.       return @balloon = nil
  4500.     elsif @battler.sv.balloon_data != [] && @battler.sv.balloon_data != @balloon_data
  4501.       @balloon_data = @battler.sv.balloon_data
  4502.       @balloon = Sprite.new(self.viewport)
  4503.       @balloon.bitmap = Cache.system("Balloon")
  4504.       @balloon.zoom_x = @balloon_data[3]
  4505.       @balloon.zoom_y = @balloon_data[3]
  4506.       @balloon.ox = 32 if @battler.sv.mirror
  4507.       @balloon.oy = 16
  4508.       @balloon_count = 0
  4509.     end
  4510.     return if !@balloon
  4511.     @balloon.opacity = self.opacity
  4512.     @balloon.x = self.x
  4513.     @balloon.y = self.y - @battler.sv.ch * $sv_camera.zoom
  4514.     @balloon.z = self.z + 20
  4515.     @balloon.src_rect.set(32 + @balloon_count / @balloon_data[2] * 32, @balloon_data[1] * 32, 32, 32) if @balloon_count % @balloon_data[2] == 0
  4516.     @balloon.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4517.     @balloon_count += 1
  4518.     @balloon_count = 0 if @balloon_count == @balloon_data[2] * 7
  4519.   end
  4520.   #--------------------------------------------------------------------------
  4521.   # ● 色調変更の更新
  4522.   #--------------------------------------------------------------------------
  4523.   def update_color
  4524.     color_set if @battler.sv.color_set != []
  4525.     return if @color_data == nil
  4526.     @color_data[4] -= 1
  4527.     if @color_data[4] == 0 && @color_data[5] != 0
  4528.       @color_data[4] = @color_data[5]
  4529.       @color_data[5] = 0
  4530.       @color_data[6] = [0,0,0,0]
  4531.     elsif @color_data[4] == 0
  4532.       @remain_color_data = @color_data
  4533.       @battler.sv.color = @color_data.dup
  4534.       return @color_data = nil
  4535.     end  
  4536.     for i in 0..3
  4537.       @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
  4538.     end  
  4539.     @battler.sv.color = @color_data.dup
  4540.     self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
  4541.   end
  4542.   #--------------------------------------------------------------------------
  4543.   # ● 残像の更新
  4544.   #--------------------------------------------------------------------------
  4545.   def update_mirage
  4546.     if @battler.sv.mirage == [] && @mirages
  4547.       @mirage_data = []
  4548.       for mirage in @mirages do mirage.dispose end
  4549.       return @mirages = nil
  4550.     elsif @battler.sv.mirage != [] && @battler.sv.mirage != @mirage_data
  4551.       @mirage_data = @battler.sv.mirage
  4552.       @mirages = []
  4553.       for i in 0...@mirage_data[1] do @mirages[i] = Sprite.new(self.viewport) end
  4554.       @mirage_count = 0
  4555.     end
  4556.     return if !@mirages
  4557.     @mirage_count += 1
  4558.     @mirage_count = 0 if @mirage_count == @mirage_data[2] * @mirages.size
  4559.     for i in [email]0...@mirages.size[/email]
  4560.       mirage_body(@mirages[i], @mirage_data[4]) if @mirage_count == 1 + i * @mirage_data[2]
  4561.     end
  4562.   end
  4563.   #--------------------------------------------------------------------------
  4564.   # ● 残像本体
  4565.   #--------------------------------------------------------------------------
  4566.   def mirage_body(body, opacity)
  4567.     body.bitmap = self.bitmap.dup
  4568.     body.x = self.x
  4569.     body.y = self.y
  4570.     body.ox = self.ox
  4571.     body.oy = self.oy
  4572.     body.z = self.z - 20
  4573.     body.mirror = self.mirror
  4574.     body.angle = self.angle
  4575.     body.opacity = opacity * self.opacity / 255
  4576.     body.zoom_x = self.zoom_x
  4577.     body.zoom_y = self.zoom_y   
  4578.     body.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
  4579.     body.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4580.   end   
  4581.   #--------------------------------------------------------------------------
  4582.   # ● 次のアニメを更新
  4583.   #--------------------------------------------------------------------------
  4584.   def update_next_anime
  4585.     return if !@next_anime
  4586.     for anime in @next_anime
  4587.       anime.update
  4588.       anime.set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y) if @horming
  4589.       anime.dispose if !anime.animation?
  4590.       @next_anime.delete(anime) if !anime.animation?
  4591.     end  
  4592.   end
  4593.   #--------------------------------------------------------------------------
  4594.   # ● フレーム更新
  4595.   #--------------------------------------------------------------------------
  4596.   alias update_sprite_battler_n03 update
  4597.   def update
  4598.     @battler.sv.update if @battler
  4599.     update_sprite_battler_n03
  4600.     update_next_anime
  4601.     update_shadow  if @battler && @shadow
  4602.     update_mirage  if @battler
  4603.     update_balloon if @battler
  4604.     update_remove if @battler && @removing && @battler.sv.change_up
  4605.   end
  4606.   #--------------------------------------------------------------------------
  4607.   # ● 戦闘アニメ消去
  4608.   #--------------------------------------------------------------------------
  4609.   def anime_off
  4610.     @battler.sv.anime_off = false
  4611.     dispose_animation
  4612.     for anime in @next_anime do anime.dispose_animation end if @next_anime
  4613.   end
  4614.   #--------------------------------------------------------------------------
  4615.   # ● バトラー入れ替え
  4616.   #--------------------------------------------------------------------------
  4617.   def remove
  4618.     @battler.sv.start_action(@battler.sv.remove_action)
  4619.     $sv_camera.wait = 40
  4620.     @battler.sv.add_action("eval('set_change')")
  4621.     @removing = true
  4622.   end
  4623.   #--------------------------------------------------------------------------
  4624.   # ● バトラー入れ替えの更新
  4625.   #--------------------------------------------------------------------------
  4626.   def update_remove
  4627.     @battler.sv.change_up = false
  4628.     @removing = false
  4629.     @battler = nil
  4630.   end  
  4631.   #--------------------------------------------------------------------------
  4632.   # ● バトラー加入
  4633.   #--------------------------------------------------------------------------
  4634.   def join(join_battler)
  4635.     $sv_camera.wait = 30
  4636.     @battler = join_battler
  4637.     @battler_name = @battler.character_name
  4638.     @battler_index = @battler.character_index
  4639.     @battler_graphic_file_index = @battler.sv.graphic_file_index
  4640.     self.bitmap = Cache.character(@battler_name)
  4641.     @battler.sv.setup(self.bitmap.width, self.bitmap.height, true)
  4642.     create_shadow
  4643.     init_visibility
  4644.   end
  4645.   #--------------------------------------------------------------------------
  4646.   # ● 通常の設定に戻す ★再定義
  4647.   #--------------------------------------------------------------------------
  4648.   def revert_to_normal
  4649.     self.blend_type = 0
  4650.     self.opacity = 255
  4651.   end
  4652.   #--------------------------------------------------------------------------
  4653.   # ● 崩壊エフェクトの更新
  4654.   #--------------------------------------------------------------------------
  4655.   alias update_collapse_sprite_battler_n03 update_collapse
  4656.   def update_collapse
  4657.     return if @battler.sv.state(1) != "敌消失"
  4658.     update_collapse_sprite_battler_n03
  4659.     @battler.sv.weapon_visible = false
  4660.   end
  4661.   #--------------------------------------------------------------------------
  4662.   # ● ボス崩壊エフェクトの更新 ★再定義
  4663.   #--------------------------------------------------------------------------
  4664.   def update_boss_collapse
  4665.     @effect_duration = @battler.sv.ch if @effect_duration >= @battler.sv.ch
  4666.     alpha = @effect_duration * 120 / @battler.sv.ch
  4667.     self.ox = @battler.sv.cw / 2 + @effect_duration % 2 * 4 - 2
  4668.     self.blend_type = 1
  4669.     self.color.set(255, 255, 255, 255 - alpha)
  4670.     self.opacity = alpha
  4671.     self.src_rect.y -= 1
  4672.     Sound.play_boss_collapse2 if @effect_duration % 20 == 19
  4673.   end
  4674.   #--------------------------------------------------------------------------
  4675.   # ● 別スプライトからのタイミング処理
  4676.   #--------------------------------------------------------------------------
  4677.   def set_process_timing(timing_data)
  4678.     for data in timing_data
  4679.       set_timing(data[0],data[1])
  4680.     end
  4681.     @battler.sv.timing = []
  4682.   end
  4683.   #--------------------------------------------------------------------------
  4684.   # ● タイミング処理
  4685.   #--------------------------------------------------------------------------
  4686.   def set_timing(se_flag, data)
  4687.     @ani_rate = 4
  4688.     data.se.play if se_flag
  4689.     case data.flash_scope
  4690.     when 1 ;self.flash(data.flash_color, data.flash_duration * @ani_rate)
  4691.     when 2 ;viewport.flash(data.flash_color, data.flash_duration * @ani_rate) if viewport
  4692.     when 3 ;self.flash(nil, data.flash_duration * @ani_rate)
  4693.     end
  4694.   end
  4695.   #--------------------------------------------------------------------------
  4696.   # ● 色調変更
  4697.   #--------------------------------------------------------------------------
  4698.   def color_set
  4699.     set = @battler.sv.color_set
  4700.     @battler.sv.color_set= []
  4701.     set[4] = 1 if set[4] == 0
  4702.     @remain_color_data = [0,0,0,0] if @remain_color_data == nil
  4703.     @color_data = @remain_color_data
  4704.     @color_data[4] = set[4]
  4705.     @color_data[5] = set[5]
  4706.     @color_data[6] = set
  4707.   end
  4708.   #--------------------------------------------------------------------------
  4709.   # ● 解放
  4710.   #--------------------------------------------------------------------------
  4711.   alias dispose_sprite_battler_n03 dispose
  4712.   def dispose
  4713.     dispose_sprite_battler_n03
  4714.     @shadow.dispose if @shadow != nil
  4715.     @balloon.dispose if @balloon != nil
  4716.     for mirage in @mirages do mirage.dispose end if @mirages != nil
  4717.     for anime in @next_anime do anime.dispose end if @next_anime
  4718.   end
  4719. end


  4720. #==============================================================================
  4721. # ■ Spriteset_Battle
  4722. #------------------------------------------------------------------------------
  4723. #  バトル画面のスプライトをまとめたクラスです。
  4724. #==============================================================================
  4725. class Spriteset_Battle
  4726.   #--------------------------------------------------------------------------
  4727.   # ● 戦闘背景(床)スプライトの作成 ★再定義
  4728.   #--------------------------------------------------------------------------
  4729.   def create_battleback1
  4730.     @back1_sprite = Sprite_Battle_Back.new(@viewport1, 1, battleback1_name)
  4731.     @back1_sprite.set_graphics(battleback1_bitmap) if battleback1_name != nil
  4732.     @back1_sprite.z = 0
  4733.   end
  4734.   #--------------------------------------------------------------------------
  4735.   # ● 戦闘背景(壁)スプライトの作成 ★再定義
  4736.   #--------------------------------------------------------------------------
  4737.   def create_battleback2
  4738.     @back2_sprite = Sprite_Battle_Back.new(@viewport1, 2, battleback2_name)
  4739.     @back2_sprite.set_graphics(battleback2_bitmap) if battleback2_name != nil
  4740.     @back2_sprite.z = 1
  4741.   end
  4742.   #--------------------------------------------------------------------------
  4743.   # ● アクタースプライトの作成 ★再定義
  4744.   #--------------------------------------------------------------------------
  4745.   def create_actors
  4746.     @actor_sprites = []
  4747.     for i in 0...$game_party.max_battle_members
  4748.       @actor_sprites[i] = Sprite_Battler.new(@viewport1, $game_party.members[i])
  4749.     end
  4750.     @effect_sprites = Spriteset_Sideview.new(@viewport1)
  4751.   end
  4752.   #--------------------------------------------------------------------------
  4753.   # ● アクタースプライトの更新 ★再定義
  4754.   #--------------------------------------------------------------------------
  4755.   def update_actors
  4756.     @actor_sprites.each_with_index do |sprite, i|
  4757.       sprite_join($game_party.members[i], sprite) if sprite.battler == nil && sprite.battler != $game_party.members[i]
  4758.       sprite.remove if sprite.battler != nil && !sprite.removing && sprite.battler != $game_party.members[i]
  4759.       sprite.update
  4760.     end
  4761.     @effect_sprites.update
  4762.     update_program
  4763.   end
  4764.   #--------------------------------------------------------------------------
  4765.   # ● メンバーを加える
  4766.   #--------------------------------------------------------------------------
  4767.   def sprite_join(member, sprite)
  4768.     for sp in @actor_sprites
  4769.       sp.update_remove if member == sp.battler && !sp.battler.sv.change_up
  4770.     end
  4771.     sprite.join(member)
  4772.   end
  4773.   #--------------------------------------------------------------------------
  4774.   # ● バトルプログラムの更新
  4775.   #--------------------------------------------------------------------------
  4776.   def update_program
  4777.     return if $sv_camera.program_scroll == []
  4778.     for data in  $sv_camera.program_scroll
  4779.       @back1_sprite.start_back_data(data) if data[2] == 1
  4780.       @back2_sprite.start_back_data(data) if data[2] == 2
  4781.     end
  4782.     $sv_camera.program_scroll = []
  4783.   end
  4784.   #--------------------------------------------------------------------------
  4785.   # ● ヒット時の戦闘アニメ実行
  4786.   #--------------------------------------------------------------------------
  4787.   def set_hit_animation(battler, weapon_index, hit_targets, miss)
  4788.     @effect_sprites.set_hit_animation(battler, weapon_index, hit_targets, miss)
  4789.   end
  4790.   #--------------------------------------------------------------------------
  4791.   # ● ダメージPOP
  4792.   #--------------------------------------------------------------------------
  4793.   def set_damage_pop(target)
  4794.     @effect_sprites.set_damage_pop(target)
  4795.   end
  4796.   #--------------------------------------------------------------------------
  4797.   # ● 解放
  4798.   #--------------------------------------------------------------------------
  4799.   alias dispose_spriteset_battle_n03 dispose
  4800.   def dispose
  4801.     dispose_spriteset_battle_n03
  4802.     @effect_sprites.dispose
  4803.   end
  4804.   
  4805.   
  4806.   
  4807. end


  4808. #==============================================================================
  4809. # ■ Window_BattleLog
  4810. #------------------------------------------------------------------------------
  4811. #  戦闘の進行を実況表示するウィンドウです。
  4812. #==============================================================================
  4813. class Window_BattleLog < Window_Selectable
  4814.   #--------------------------------------------------------------------------
  4815.   # ● ウェイト ★再定義
  4816.   #--------------------------------------------------------------------------
  4817.   def wait
  4818.   end
  4819.   #--------------------------------------------------------------------------
  4820.   # ● ウェイトとクリア ★再定義
  4821.   #--------------------------------------------------------------------------
  4822.   def wait_and_clear
  4823.     $sv_camera.wait = 10
  4824.   end
  4825.   #--------------------------------------------------------------------------
  4826.   # ● 行動結果の表示 ★再定義
  4827.   #--------------------------------------------------------------------------
  4828.   def display_action_results(target, item)
  4829.     if target.result.used
  4830.       last_line_number = line_number
  4831.       display_critical(target, item)
  4832.       display_damage(target, item)
  4833.       display_affected_status(target, item)
  4834.       display_failure(target, item)
  4835.     end
  4836.     off if !N03::BATTLE_LOG
  4837.   end
  4838.   #--------------------------------------------------------------------------
  4839.   # ● ウインドウ非表示
  4840.   #--------------------------------------------------------------------------
  4841.   def off
  4842.     @back_sprite.visible = self.visible = false
  4843.   end
  4844. end
  4845. #==============================================================================
  4846. # ■ Game_Interpreter
  4847. #------------------------------------------------------------------------------
  4848. #  イベントコマンドを実行するインタプリタです。
  4849. #==============================================================================
  4850. class Game_Interpreter
  4851.   #--------------------------------------------------------------------------
  4852.   # ● スイッチの操作
  4853.   #--------------------------------------------------------------------------
  4854.   alias command_121_game_interpreter_n03 command_121
  4855.   def command_121
  4856.     command_121_game_interpreter_n03
  4857.     $sv_camera.program_check
  4858.   end
  4859. end
复制代码

梦石
0
星屑
199
在线时间
248 小时
注册时间
2012-4-29
回帖
313
发表于 2014-1-20 00:49:10 | 显示全部楼层
我记得图书馆有一个  !  不会一样的把

点评

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

使用道具 举报

精灵族の天使<

梦石
0
星屑
1712
在线时间
3039 小时
注册时间
2007-3-16
回帖
33092

开拓者贵宾

发表于 2014-1-20 23:01:58 | 显示全部楼层
赞!终于有可以用的脚本了!
回复

使用道具 举报

梦石
0
星屑
50
在线时间
32 小时
注册时间
2013-11-6
回帖
19
发表于 2014-1-23 09:19:33 | 显示全部楼层
范例中弓攻击会卡住

评分

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

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
91 小时
注册时间
2012-3-3
回帖
56
 楼主| 发表于 2014-1-23 22:26:23 | 显示全部楼层
破晓记录线 发表于 2014-1-23 09:19
范例中弓攻击会卡住

好的,已经修复了,谢谢你。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
492 小时
注册时间
2013-6-15
回帖
164
发表于 2014-1-24 12:59:33 | 显示全部楼层
这个是什么? BB4PR4%[K]M~6XV$(2{8CYU.jpg
回复

使用道具 举报

梦石
0
星屑
50
在线时间
91 小时
注册时间
2012-3-3
回帖
56
 楼主| 发表于 2014-1-24 22:24:42 | 显示全部楼层
渝川 发表于 2014-1-24 12:59
这个是什么?

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

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部