赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 21777 |
最后登录 | 2017-9-2 |
在线时间 | 292 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 292 小时
- 注册时间
- 2009-10-30
- 帖子
- 24
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我使用 橫版戰鬥 與 Tsukihime的召喚腳本
召喚腳本其中一項功能 人物出場參與戰鬥幾回合
回合結束後 撤離
但 撤離動作一直無法正常運作
比如 1 與 2號人物 為不同時間召喚
但在1號 人物作出撤退動畫時 ,2號人物會一併作出 撤退 ,然後在加入的動畫
我在橫版基礎中有
設置 不同的位置
ACTOR_POSITION = [[415,160, 0],[435,185, 0],[455,210, 0],[475,235, 0] ,[490,255, 0]]
#召喚獸位置
SUMMON_POSITION = [[375,170, 0],[395,195, 0],[415,220, 0],[435,245, 0] ,[450,265, 0]]
#動物之位置
ANIMAL_POSITION = [[465,140, 0],[485,165, 0],[505,190, 0],[525,215, 0] ,[540,245, 0]]
另外我在橫版 update_bitmap_actor 方法裡
有加入
@battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id) if [email protected]_a?(Game_Summon)
否則在撤離動作時 會發生 人物亂跑
請問 如何可以讓這功能正常
橫版基礎 #============================================================================== # ■ SideView动作设定 Ver100 #------------------------------------------------------------------------------ # 创建侧视图战斗一般的设置和行动。 # 汉化by: 圣痕 #============================================================================== module N03 #-------------------------------------------------------------------------- # ● 全体队员设置 #-------------------------------------------------------------------------- # 主人公初期位置 第一人 第二人 第三人 第四人 # X轴 Y轴 H轴 X轴 Y轴 H轴 X轴 Y轴 H轴 X轴 Y轴 H轴 ACTOR_POSITION = [[415,160, 0],[435,185, 0],[455,210, 0],[475,235, 0] ,[490,255, 0]] #召喚獸位置 SUMMON_POSITION = [[375,170, 0],[395,195, 0],[415,220, 0],[435,245, 0] ,[450,265, 0]] #動物之位置 ANIMAL_POSITION = [[465,140, 0],[485,165, 0],[505,190, 0],[525,215, 0] ,[540,245, 0]] # 战斗中行动结束后,到下个角色行动开始的等待时间。 ACTION_END_WAIT = 8 # 战斗中行动结束后(等待时间・单位帧(1/60)秒) TURN_END_WAIT = 12 # 背后攻击(偷袭时的画面反转)使用的话是true不使用的是false BACK_ATTACK = true # 我方角色受到伤害时、如果采用默认的效果就是true ACTOR_DAMAGE = false # 敌方角色受到伤害时、如果采用默认的效果就是true ENEMY_DAMAGE = false # 敌人角色的X坐标、旋转计算、战斗自动反转就是true ENEMY_MIRROR = true # 战斗不能禁止使用处理、数据库的无敌状态ID IMMORTAL_ID = 10 # 战斗记录(战斗进行实况显示的窗口)如果显示就是true # 如果OFF的场合、显示技能名窗口出现在屏幕上方 BATTLE_LOG = true # 技能名在改窗口ON时、不显示的技能ID排列放进去 NO_DISPLAY_SKILL_ID = [1,2,3,4,5,6,7] # 如果显示伤害数字POP就是true DAMAGE_POP = true # 如果显示附加状态POP就是true STATE_POP = true # 伤害数字图片的文件名(横向等距的从零到九依次排列的图片(Graphics/System)) DAMAGE_PLUS = "damage_num+" # 回复数字图片的文件名(Graphics/System) DAMAGE_MINUS = "damage_num-" # MP数字图片的文件名(Graphics/System) DAMAGE_MP = "damage_mp" # TP数字图片的文件名(Graphics/System) DAMAGE_TP = "damage_tp" # 显示伤害数字的文字间隔进行调整。 DAMAGE_ADJUST = -4 # 战斗相机的焦点(转到焦点)调整 [X轴, Y轴] CAMERA_POSITION = [ 0, -40] #-------------------------------------------------------------------------- # ● 战斗背景设定 背景的坐标调整及扩大率设定 #-------------------------------------------------------------------------- # 地背景文件名…设定地背景图像的文件名(Battlebacks1)。 # "全Battlebacks1"在指定的Battlebacks1图像,设定的项目。 # 壁背景文件名…设定壁背景图像的文件名(Battlebacks1)。 # "全Battlebacks2"在指定的Battlebacks2图像,设定的项目。 # 坐标调整…[X轴, Y轴] # 扩大率……[横扩大率, 纵扩大率] # 允许摇动……攻击动作摇动、如果允许摇动就true、不允许就false # 开关触发…游戏数字为 ON 自动在战斗开始时。侧视图开关是对温室气体 # 如果您希望将受控制的战斗程序和背景集,请使用 # 如果为 0 则不操作 FLOOR1_DATA = { # 床背景文件名 坐标调整 扩大率 允许摇动 开关触发 "Sea_ex01" => [ [ 0, 120], [ 150, 150], false, -1], "全Battlebacks1" => [ [ 0, 120], [ 150, 150], true, 0], } FLOOR2_DATA = { # 壁背景文件名 坐标调整 扩大率 允许摇动 开关触发 "Ship_ex" => [ [ 0, 120], [ 150, 150], true, 0], "全Battlebacks2" => [ [ 0, 120], [ 150, 150], true, 0], } #============================================================================== # ■ 战斗角色行动 #------------------------------------------------------------------------------ # 角色战斗中单独行动。可以组合完整的行动 #============================================================================== # 完整的行动和行动名称在这里。 ACTION = { #-------------------------------------------------------------------------- # ● 角色动画的设定 #-------------------------------------------------------------------------- # 默认的一个角色芯片的图像文件中包含多个的角色已经配置好 # 使用角色芯片(Charachip)的场合、添加一个角色图像的图像被配置使其符合。 # 一个角色中的一个字符的图像的运用(文件的开头名字写入"$"才名字)没有问题的场合 # # 指数…使用角色图像文件的附在后面的Index(指数)名称。 # 侧视图的角色的场合参考文件字符和文件名。 # 指数达到时、角色文件名+指数文件的图像、参考该文件 # 例)实行Actor1的角色指数"_1"的动画的场合时、参考该文件名"Actor1_1" # 使用角色芯片的场合的指数的动画 # 角色放在Characters文件夹中、敌人图像放在Battlers文件夹中 # 纵元件…图像文件的单元格的垂直对齐方式。其次从顶部的 0-3。任何数量的级别元 # 件编号角色设置中的设置 # 横元件…在图像文件单元格的水平对齐方式、开始播放元件。随后由 0-3 和从左侧。 # 杆发挥此下一级别元件的从左到右。任何数量的级别元件 # 这个横元件的动画从左到右播放。元件数量不限 # 模式… 0:元件固定 1:单程 2:往返 3:单程循环 4:往返循环 # 速度…动画的更新速度。数值越低更新速度越快。 # Z轴…另外,如果您在顶部显示。通常出现在屏幕的底部。 # 等待…动画模式到最后如果也被播放的行动就true # 影…表示阴影效果的话是true、不表示为false # 武器…武器表示的情况填入武器动作名。不表示的情况为""。 # 可能同时追加任意数量的武器动作、将追加在阵列后面 #目标动画名(待机系)― 判別 指数 纵件 横件 模式 速度 Z轴 等待 影 武器 "待机" => ["motion", "", 1, 0, 4, 12, 0, true, true, "" ], "待机固定WT" => ["motion", "", 1, 1, 0, 12, 0, true, true, "" ], "待机固定" => ["motion", "", 1, 1, 0, 12, 0,false, true, "" ], "倒下" => ["motion", "_1", 0, 0, 0, 12, 0, true,false, "" ], "向右" => ["motion", "", 2, 0, 4, 12, 0, true, true, "" ], #目标动画名(移动系)― 判別 文件No 纵件 横件 模式 速度 Z轴 等待 影 武器 "左向移动" => ["motion", "", 1, 0, 4, 6, 10, true, true, "" ], "右向移动" => ["motion", "", 2, 0, 4, 6, 10, true, true, "" ], #目标动画名(姿态系)― 判別 文件No 纵件 横件 模式 速度 Z轴 等待 影 武器 "举起武器" => ["motion", "", 1, 0, 1, 2, 200,false, true, "举起" ], #目标动画名(攻击系)― 判別 文件No 纵件 横件 模式 速度 Z轴 等待 影 武器 "武器挥动R" => ["motion", "", 1, 0, 1, 2, 200,false, true, "纵挥动"], "武器挥动L" => ["motion", "", 1, 0, 1, 2, 200,false, true, "纵挥动L"], "武器挥动LR" => ["motion", "", 1, 0, 1, 2, 200,false, true, "纵挥动","纵挥动L"], "盾防御" => ["motion", "", 1, 0, 1, 2, 200,false, true, "盾"], "武器拳抛掷" => ["motion", "", 1, 0, 1, 2, 200,false, true, "拳抛掷"], "武器抛掷" => ["motion", "", 1, 0, 1, 2, 200,false, true, "抛掷" ], "弓射击" => ["motion", "", 1, 0, 1, 2, 200,false, true, "弓"], #-------------------------------------------------------------------------- # ● 角色移动 X轴移动是敌人的自动反向计算 #-------------------------------------------------------------------------- # 目标…要移动引用的目标坐标。编号引用的是当前的位置,积极的消极的初始位置;(是所以负不能设置到 7) # [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敵我方全] [5=第二个目标] [6=画面] # X轴…从对象所看X坐标。绝对值就算是最低时也会比时间高 # Y轴…从对象所看Y坐标。绝对值就算是最低时也会比时间高 # H軸…从对象所看H坐标。(离地面的高度) 当H轴是nil无视xy的移动 # 速度…移动1帧的像素数。指定的时间长度将是一个负数、移动完毕后这将是一个帧的总数的百分比 # 曲线…移动时的轨道正上、负面向下曲线。 # 跳跃…跳跃抛物线轨道。[开始跳跃到顶点的轨道, 顶点到着地的轨道] # 动画…这里的移动所使用的角色动画名。 # 目标行动名(系统系) 判別 目标 X轴 Y轴 H轴 速度 曲线 跳跃 动画 "战斗前的我方配置" => ["move",-7, 180, 10, 0, 0, 0, [ 0, 0], "左向移动"], "退场" => ["move",-7, 180, 0, 0, 7, 0, [ 0, 0], "右向移动"], "逃走途中" => ["move",-7, 80, 0, 0, 7, 0, [ 0, 0], "右向移动"], "指令输入移动" => ["move",-7, -20, 0, nil,-10, 0, [ 0, 0], "左向移动"], "伤害后弯向后" => ["move", 0, 20, 0, nil,-10, 0, [ 0, 0], ""], "大伤害" => ["move", 0, 60, 0, nil,-10, 0, [ 0, 0], ""], # 目标行动名(复位系) 判別 目标 X轴 Y轴 H轴 速度 曲线 跳跃 动画 "初期目标复位" => ["move",-7, 0, 10, 0,-10, 0, [ 0, 0], "右向移动"], "坐标重置" => ["move",-7, 0, 10, 0,-20, 0, [ 0, 0], "右向移动"], "坐标曲线重置" => ["move",-7, 0, 0, 0,-20, -2, [ 0, 0], "右向移动"], "坐标左向复位" => ["move",-7, 0, 0, 0,-20, 0, [ 0, 0], "左向移动"], # 目标行动名(自身系) 判別 目标 X轴 Y轴 H轴 速度 曲线 跳跃 动画 "一歩前移动" => ["move", 0, -20, 0, 0,-10, 0, [ 0, 0], "左向移动"], "一歩后移动" => ["move", 0, 20, 0, 0,-10, 0, [ 0, 0], "左向移动"], "一歩前跳跃" => ["move", 0, -30, 0, 0,-10, 0, [ 20,-20], "左向移动"], "一歩后跳跃" => ["move", 0, 30, 0, 0,-10, 0, [ 20,-20], "左向移动"], "胜利跳转" => ["move", 0, 10, 0, 0,-25, 0, [ 30,-30], "待机固定"], "胜利武器跳转" => ["move", 0, 0, 0, 0,-15, 0, [ 20, 0], "举起武器"], "胜利跳转着地" => ["move",-7, 0, 0, 0,-10, 0, [ 0, 0], "武器挥动R"], "纵摇动01" => ["move", 0, 0, 0, 20, -2, 0, [ 0, 0], ""], "纵摇动02" => ["move", 0, 0, 0, -20, -2, 0, [ 0, 0], ""], # 目标行动名(目标系) 判別 目标 X轴 Y轴 H轴 速度 曲线 跳跃 动画 "敌前移动" => ["move", 1, 30, 0, 0,-20, 0, [ 0, 0], "左向移动"], "敌后移动" => ["move", 1, -60, 0, 0,-20, 0, [ 0, 0], "左向移动"], "初期敌移动" => ["move", 1, 0, 0, 0,-10, 0, [ 0, 0], "左向移动"], "跳前拍击" => ["move",-1, 0, 0, 100,-20, 0, [ 40,-20], "举起武器"], "拍击" => ["move",-1, 0, 0, 0,-10, 0, [ 0, 0], "武器挥动R"], #-------------------------------------------------------------------------- # ● 武器动作 让武器图像动起来的方法 #-------------------------------------------------------------------------- # 类型…[0…使用图标] # [1…独自图像(图像名角色设定的武器项目中进行。参考Characters文件夹)] # [2…动画元件(※2003规范。同样数量的元件和角色的动画。图像名角色设定的武器项目中进行。 # 参考Characters文件夹)] # 移动…移动图像的距离。[X轴, Y轴] # 调整…要微调整图像初始的坐标。[X轴, Y轴] # 始度…武器在动作前的最初角度。半圆的0~360度。复数情况为反半圆。 # 終度…动作后的角度 # 原点…武器旋转时的原点。[0…中心] [1…左上] [2…右上] [3…左下] [4…右下] [5…和角色同样(一半宽以下的图像)] # 反转…当为true时,动作前武器的图像将会显示为反转的。 # 扩大…[X轴扩大率, Y轴扩大率] 小数点也接受 # [X轴放大率、武器横向放大率。1是同等、2是2倍、0.5是1/2。] # [Y轴放大率、武器纵向放大率。1是同等、2是2倍、0.5是1/2。] # Z轴…如果让此动作显示时武器在人物前方写作true。 # 二刀…限定于二刀流为true、将以二刀流来显示左边武器动作的武器画像。 # 如果不是二刀流的情况会自动跳过角色动画。 # 更新…-1个角色动画更新和同步。独立配置的场合[更新时间间隔, 更新模式数, 循环的状况] # 指数…武器图像的武器装备(盾)被设定为图像文件将参考、 # 指数放在这里、图像文件名+指数名的图像将参考 # 一个以上的武器复数的有规律的使用图像的场合 # 例) "縦振り"的指数"" => 图像文件名"IconSet"将参考 # 例) "縦振り2"的指数"_1" => 画像文件名"IconSet_1"将参考 # 使用该图标的场合将参考System文件夹、独自图像动画和元件放在Characters文件夹中 # 图像…武器、盾牌设定的图片文件和指数、直接指定的武器图像 # 这里给的图像文件名。图像放到Characters文件夹中将参考 # 目标动作名 判別 类型 移动 调整 始度 终度 原点 反转 扩大 Z轴 二刀 更新 指数 画像 "纵挥动" => ["wp", 0,[ 6, 0],[ -4,-10], -45, 45, 4, false, [1,1], false, false, -1, "", ""], "盾" => ["wp", 0,[ 0, 0],[ 12, 0], 0, 0, 4, false, [1,1], true, true, -1, "", ""], "纵挥动L" => ["wp", 0,[ 6, 0],[ 0, -8],-135, 45, 4, false, [1,1], true, true, -1, "", ""], "拳抛掷" => ["wp", 0,[-20, 0],[ 5, 5], -45, -45, 4, false, [1,1], false, false, -1, "", ""], "抛掷" => ["wp", 0,[-25, 0],[ 25,-10], 45, 45, 4, false, [1,1], false, false, -1, "", ""], "举起" => ["wp", 0,[ 6,-4],[ -4,-10], 90, -45, 4, false, [1,1], false, false, -1, "", ""], # 2003规范 判別 类型 移动 调整 始度 终度 原点 反转 扩大 Z轴 二刀 更新 指数 画像 "弓" => ["wp", 2,[ 0, 0],[ 0, 0], 0, 0, 5, false, [1,1], true, false, -1, "", ""], # 使用飞行武器 判別 类型 移动 调整 始度 终度 原点 反转 扩大 Z轴 二刀 更新 指数 画像 "箭头" => ["wp", 0,[ 0, 0],[ 0, 0], 0, 45, 0, false, [1,1], true, false,[2,6,false], "", "arrow01"], "旋转" => ["wp", 0,[ 0, 0],[ 0, 0], 0, 360, 0, false, [1,1], true, false,[1,8, true], "", ""], #-------------------------------------------------------------------------- # ● 武器・动画飞出 让战斗动画飞出去。飞行道具、远距离攻击用 #-------------------------------------------------------------------------- # ID…数据库里设定的动画ID。[动画移动ID,被击中时的动画ID] 0是不显示动画。-1是显示武器的动画。 # 始…动画飞出时的开始位置。当减少时、实行一个以上目标的复数的动画 # [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标] [6=画面] # 后…动画发出后的结束位置。当减少时、实行一个以上目标的复数的动画 # [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标] [6=画面] # 始调整…移动开始坐标的微调整。[X轴, Y轴] 敌人的X轴自动反计算的 # 后调整…移动结束坐标的微调整。[X轴, Y轴] 敌人的X轴自动反计算的 # 速度…X轴移动1帧的像素数目。负增长将成为处理时间、距离速度会有所变化。 # 类型…移动后的处理。[0=消失(失误时自动改变为贯穿] [1=直线贯穿] [2=消失(失误时消失)] # 轨道…动画飞出去时候的轨道。[从开始到顶点的轨道, 从顶点到结束的轨道] # 填入数值的话是走抛物线。正数为向下的抛物线、负数为向上。 # Z轴…动画或者武器在角色面前显示的话是true # 等待…动作行动直到下一个不想迁移就true [移动到动画的等待, 打击时动画的等待] # 伤害…达到目标时、如果计算伤害就true # 复位…如果移动目标归位时就true。如果不归位就false # 相机…如果相机的根据变焦缩放动画就true # 循环…当播放的动画已经完成移动时、如果最初循环往复的就true # 反转不可…任何的场合、如果不能反转动画就true # 武器…填入下面贴附的武器、技能动作名。如果不是用为"" # 目标行动名 判別 ID 始 后 始调整 后调整 速度 类型 轨道 Z轴 等待 伤害 复位 相机 循环 反转不可 武器 "箭头射击WT" => ["m_a",[ 0,-1], 0, 1, [ 0, 0], [ 0, 0], 10, 2, [-3,-3], true, [ true, true], true, true, true, false, false, "箭头"], "箭头射击" => ["m_a",[ 0,-1], 0, 1, [ 0, 0], [ 0, 0], 10, 2, [-3,-3], true, [false,false], true, true, true, false, false, "箭头"], "水铁炮射击" => ["m_a",[69,69], 0, 1, [ 0, 0], [ 0, 0], 10, 0, [ 0, 0], true, [ true, true], true, true, true, true, false, ""], "武器开始抛出" => ["m_a",[ 0,-1], 0, 1, [ 4,-6], [ 0, 0], 10, 2, [-3,-3], true, [ true,false], true, true, true, false, false, "旋转"], "武器抛出返回" => ["m_a",[ 0, 0], 1, 0, [ 0, 0], [ 4,-6], 10, 0, [ 3, 3], true, [ true,false], false, true, true, false, false, "旋转"], #-------------------------------------------------------------------------- # ● 战斗动画 数据库的战斗动画 显示动画在战斗 #-------------------------------------------------------------------------- # ID…动画ID。-1时武器设定为动画 -2时另一端二刀流的动画 # -3时技能也变成武器上所带的动画。 # 对象…[0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标] # 复位…对象的坐标移动、如果在追踪动画就是true # 等待…如果显示动画等到结束就是true # 伤害…如果要计算伤害就是true # 相机…如果相机的根据变焦缩放动画就true # 反转不可…任何的场合、如果不能反转动画就true # 反转…true时动画的图像将被反转。 # Z轴…如果想显示在前面的动画字符就true # 目标行动名(伤害系) 判別 ID 对象 复位 等待 伤害 相机 反转不可 反转 Z轴 "对象动画武器" => ["anime", -1, 1, false, false, true, true, false, false, true], "对象动画武器WT" => ["anime", -1, 1, false, true, true, true, false, false, true], "对象动画武器LWT" => ["anime", -2, 1, false, true, true, true, false, false, true], "对象动画" => ["anime", -3, 1, false, false, true, true, false, false, true], "对象动画WT" => ["anime", -3, 1, false, true, true, true, false, false, true], # 目标行动名(自身系) 判別 ID 对象 复位 重量 伤害 相机 反转不可 反转 Z轴 "魔法吟唱中" => ["anime", 113, 0, true, true, false, true, false, false, true], "特技待机中" => ["anime", 114, 0, true, true, false, true, false, false, true], "魔法启动动画" => ["anime", 115, 0, false, true, false, true, false, false, false], "特技启动动画" => ["anime", 116, 0, false, true, false, true, false, false, false], "斩击/必杀技1" => ["anime", 11, 1, false, true, false, true, false, false, false], "对象动画等待" => ["anime", -1, 1, false, true, false, true, false, false, false], #-------------------------------------------------------------------------- # ● 摄影的工作 画面的缩放和滚动 #-------------------------------------------------------------------------- # 对象…移动和缩放的对象 # [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标] [6=画面] # 调整坐标…微调整相机坐标的最后地点 [X轴(正画面→), Y轴(正画面↓)] # 时间…摄影的工作所花费的时间 # 等待…摄影结束为止等待话就true。不要等待的话就false # 放大…相机的放大率(%)。放大没有100。 # 目标动作名 判別 对象 调整坐标 放大 时间 等待 "重置相机" => ["camera", 6, [ 0, 0], 100, 40, false], "放大" => ["camera", 6, [ 0, 100], 120, 40, false], "缩小" => ["camera", 6, [ 0, 0], 80, 40, false], #-------------------------------------------------------------------------- # ● 画面的摇动 画面摇晃。空中坐标(H坐标是0以上)的角色不要摇动 #-------------------------------------------------------------------------- # 方向…摇动的方向 [横,纵] 数字越大摇晃范围将扩大。 # 速度…摇动的速度。规模较小的摇动就快。 # 時間…摇动的持续时间。振动宽度随着时间一起弱 # 等待…摇动结束为止等待话就true。不要等待的话就false # 目标动作名 判別 方向 速度 时间 等待 "摇动小" => ["shake", [ 0, 4], 2, 16, false], "摇动中" => ["shake", [ 0, 6], 3, 30, false], "摇动大" => ["shake", [ 0,12], 3, 40, false], #-------------------------------------------------------------------------- # ● 画面色调变更 角色背景的色调变更 #-------------------------------------------------------------------------- # 对象…变更色调的对象 # [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标] # [6=背景] [7=自身+目标] [8=自身以外] [9=自分+目标以外] [10=所有] # 色调水平…[ R, G, B分别是红、绿、蓝。最初(色调强度), 变更时间, ※返回] # ※返回…变更结束返回颜色的时间。不返回就0 # 等待…色调变更更结束为止等待话就true。不要等待的话就false # 色调变更名 判別 对象 R, G, B, 最初 时间 返回 等待 "色调初始化" => ["color", 10, [ 0, 0, 0, 0, 30, 0], false], "消减色调" => ["color", 0, [ 255, 50, 50, 100, 40, 40], false], "毒色调" => ["color", 0, [ 170, 50, 255, 170, 30, 30], false], "通用状态异常色调" => ["color", 0, [ 255, 255, 50, 170, 40, 40], false], "昏暗的背景" => ["color", 6, [ 0, 0, 0, 255, 30, 0], false], "自身和目标以外昏暗" => ["color", 9, [ 0, 0, 0, 255, 30, 0], false], #-------------------------------------------------------------------------- # ● 过渡 实行固定画面后过渡 #-------------------------------------------------------------------------- # 实行动作前"画面固定"将实行、请固定在画面上。 # 边界…边界的模糊。数值越大变得模糊。 # 时间…过渡花费的时间。在过渡期间的游戏画面是固定的 # 过渡文件名…过渡图像。图像放到Pictures文件夹中 # 目标动作名 判別 边界 时间 过渡文件名 "圈" => ["ts", 40, 60, "circle"], #-------------------------------------------------------------------------- # ● 残像 角色动作留下的残影 #-------------------------------------------------------------------------- # 数…残像数。0是显示残像关闭。非常大的负载增加时 # 间隔…残像显示的时间间隔。数值越小就越狭窄。单位帧(1/60秒) # 处理…残像后的处理。true表示直到战斗结束消失,false表示一直没有消失 # 透明度…残像的透明度 255-不透明,0-透明 # 目标动作名 判別 数 间隔 处理 透明度 "残像ON" => ["mirage", 4, 3, true, 160], "残像OFF" => ["mirage", 0, 0, true, 0], #-------------------------------------------------------------------------- # ● 角色旋转。画像旋转。与反转不同、武器动作不能被反映 #-------------------------------------------------------------------------- # 旋转着角色的动作结束后、旋转角度被复位 # 旋转中的图像传输原点成为中心。反转不同、不能反映武器动作 # 时间…旋转过程所需时间。0表示立即反映 # 始度…旋转开始时的角度。指定于0~360度之间。正数为正半圆、负数为反半圆。 # 终度…旋转完毕时的角度。指定于0~360度之间。跟上边所记相同,但敌人的设定是与其相反的。 # 类型…旋转结束后的处理。[0…旋转复位] [1…结束角度左端] [2…循环] # 目标动作名 判別 时间 始度 终度 类型 "右1旋转" => ["angle", 12, 0, -360, 0], "左1旋转" => ["angle", 12, 0, 360, 0], #-------------------------------------------------------------------------- # ● 角色放大缩小 武器动作不能被反映 #-------------------------------------------------------------------------- # 扩大缩小角色的全部动作已经完成、扩大缩小被复位。 # 反转不同、不反映武器动作 # 时间…扩大缩小过程所需时间。 # 开始大小…扩大缩小开始时的大小。小数点也接受。[X轴(横), Y轴(纵)] # 结束大小…扩大缩小结束时的大小。小数点也接受。[X轴(横), Y轴(纵)] # 类型…扩大缩小结束后的处理。[0…大小重设] [1…结束后大小保持] [2…循环] # 目标动作名 判別 时间 开始大小 结束大小 类型 "横收缩" => ["zoom", 12, [1.0, 1.0], [0.5, 1.0], 0], "纵收缩" => ["zoom", 12, [1.0, 1.0], [1.0, 0.5], 0], #-------------------------------------------------------------------------- # ● 角色透明度操作 画像的透明度变更 #-------------------------------------------------------------------------- # 透明度操作角色的全部动作已经完成、透明度操作被复位。 # 时间…透明度变更过程所需时间。 # 开始…开始时变更的透明度。0-透明 255-不透明 # 结束…结束时变更的透明度 # 影…表示阴影效果的话是true、不表示为false # 武器…武器也同样透明度操作就true # 循环…透明度变更结束后、如果自动操作逆转就true # 等待…操作结束后迁移无需等到下一个动作表示true # 目标行动名 判別 时间 开始 结束 影 武器 循环 等待 "逃走透明" => ["opacity", 30, 255, 0, true, true, false, false], "透明化" => ["opacity", 60, 255, 0, true, true, false, false], "透明化WT" => ["opacity", 60, 255, 0, true, true, false, true], "透明化解除" => ["opacity", 60, 0, 255, true, true, false, false], "透明化解除WT" => ["opacity", 60, 0, 255, true, true, false, true], #-------------------------------------------------------------------------- # ● 状态动画 显示事件使用的状态ICON #-------------------------------------------------------------------------- # 种类…状态的种类(纵位置)在0~9之间。 # 速度…更新速度。2种元件从第一帧将播放 # 大小…气球的大小 # 气球名 判別 种类 速度 大小 "状态异常/通用" => ["balloon", 6, 10, 0.6], "状态异常/消减" => ["balloon", 5, 10, 0.6], "状态异常/睡眠" => ["balloon", 9, 10, 0.6], #-------------------------------------------------------------------------- # ● 图片的表示 一名角色对应显示一枚图片 #-------------------------------------------------------------------------- # 号码…要使用图片的号码。它是用于管理图片的号码。不管多少都显示。 # 完整动作结束后自动自动删除(Bitmap释放) # 开始坐标…移动的开始位置。图片的左上角处的原点。[X轴, Y轴] # 已经有图像的场合、当开始坐标是在其位置[] # 结束坐标…移动的结束位置。开始位置显示成为相同数值 # 平面使用的场合、开始和结束将保持的移动速度[] # 时间…移动时间。0是删除的图片 # Z轴…图片Z坐标。100以上如果它被显示在窗口的前面 # 透明度…透明度设定。[开始时的透明度, 每1帧透明度的制度] # 平面使用…平面类(图像瓷砖状排列着图像)使用矩形的场合。[X轴,Y轴] # 不想使用平面的场合就[] # BA反转…偷袭时图像反转X坐标移动如果反向就true # 平面使用时的图像不逆转就true、X坐标移动的是相反的 # 图片文件名…图片文件夹内的文件名。 # 目标行动名 判別 号码 开始坐标 结束坐标 时间 Z轴 透明度 平面使用 BA反转 图片文件名 "切入A1" => ["pic", 0, [-300, 8], [ 100, 8], 30, 90, [ 0, 10], [], true, "Actor4-1"], "切入A2" => ["pic", 0, [-300, 8], [ 100, 8], 30, 90, [ 0, 10], [], true, "Actor4-2"], "切入A3" => ["pic", 0, [-300, 8], [ 100, 8], 30, 90, [ 0, 10], [], true, "Actor5-2"], "切入A4" => ["pic", 0, [-300, 8], [ 100, 8], 30, 90, [ 0, 10], [], true, "Actor5-3"], "切入结束" => ["pic", 0, [], [ 600, 8], 30, 90, [255, 0], [], true, ""], "切入背景开始" => ["pic", 1, [ 0, 8], [ 100, 8], 10, 80, [ 0, 10], [544,288], true, "cutin_back"], "切入背景结束" => ["pic", 1, [], [], 10, 80, [255, -7], [544,288], true, ""], "白色淡入" => ["pic", 0, [ 0, 0], [ 0, 0], 50,500, [ 0, 6], [], false, "white"], "白色淡出" => ["pic", 0, [ 0, 0], [ 0, 0], 50,500, [255, -6], [], false, "white"], #-------------------------------------------------------------------------- # ● 状态操作 #-------------------------------------------------------------------------- # 対象…[0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标] # 扩张…扩张对象的设定 [0=没有扩张] [1=随机1体] [2=自身以外] # 操作…如果赋予状态就"+",如果解除状态就"-" # 状态ID…操作切换状态的ID一起排列放进去 # 状态赋予名 判別 对象 扩张 操作 状态ID "赋予战斗不能" => ["sta", 0, 0, "+", [1]], #-------------------------------------------------------------------------- # ● FPS(游戏整体的速度变更) 检查行动的细节 #-------------------------------------------------------------------------- # 游戏速度…60是默认的数值、比这个值低的时候就会放慢。 # 目标行动名 判別 游戏速度 "慢播放" => ["fps", 15], "通常播放" => ["fps", 60], #-------------------------------------------------------------------------- # ● 角色画像变更 角色画像引用的文件变更 #-------------------------------------------------------------------------- # 维持…角色的场合。战斗后图像变更维持表示true # 指数…角色的场合。行走图的图像,数字排列方式如下: # [0][1][2][3] # [4][5][6][7] # # 文件名…变更图像文件名。角色放在Characters文件夹、 # 敌人放在Battlers文件夹。 # 脸图…主角的場合、战斗后的变更角色脸图[脸图指数, 文件名] # 如果不变更则是[] # 目标行动名 判別 维持 指数 文件名 脸图 "灰太狼变身" => ["change", false, 6, "Animal", [0, "Actor4"]], #-------------------------------------------------------------------------- # ● 技能连发 行动中断后、导出不同的技能 #-------------------------------------------------------------------------- # 习得…如果连发的技能没有被习得也可以实行的话是true # 成本条件…技能连发的成本不足而可能就true # 技能ID…连发技能的ID # 目标行动名 判別 习得 成本条件 技能ID "多段攻击连发" => ["der", true, false, 130], #-------------------------------------------------------------------------- # ● 声音的演奏 BGM・BGS・SE按响了 #-------------------------------------------------------------------------- # 种别…効果音为"se" BGM为"bgm" BGS为"bgs" # 速度…速度。50~150之间指定的最多 不管哪个都要默认为100。 # 音量…音量。50~150之间指定的指定 不管哪个都要默认为100。 # 文件名…播放的文件名。""时不改变任何BGM和BGS的设定。 # 目标行动名 判別 种别 速度 音量 文件名 "Bow1" => ["sound", "se", 100, 80, "Bow1"], #-------------------------------------------------------------------------- # ● 电影的播放 ogv电影文件播放 #-------------------------------------------------------------------------- # 文件名…播放电影文件名。电影放在Movies文件夹 # 目标行动名 判別 文件名 "死亡标记电影" => ["movie", "sample1"], #-------------------------------------------------------------------------- # ● 游戏开关的设置(侧面图专用开关)的操作 #-------------------------------------------------------------------------- # ID正值游戏开关、侧视图中专用开关的操作 # ON号码…ON开关ID整理排列放进去 # OFF号码号…OFF开关ID整理排列放进去 # # 开关设置名 判別 ON号码 OFF号码 "开关No1/ON" => ["switch", [ 1], []], "背景宇宙变更" => ["switch", [-4], []], "背景宇宙解除" => ["switch", [], [-4]], "魔法阵ON" => ["switch", [-5], []], "魔法阵OFF" => ["switch", [], [-5]], #-------------------------------------------------------------------------- # ● 游戏变量的操作 #-------------------------------------------------------------------------- # 变量No…设置哪个变量 # 操作…[0=代入] [1=加法] [2=减法] [3=乘法] [4=除法] [5=剩余] # 设置数值…指定成为演算对象的数值。负增长、至于这个具体数字 # 绝对值的变量No这些值存储在计算的对象 # # 变量设置名 判別 变量No 操作 设置数值 "变量No1/+1" => ["variable", 1, 1, 1], #-------------------------------------------------------------------------- # ● 条件分岐 (游戏开关) 条件设定、满足条件以后将停止所有行动 #-------------------------------------------------------------------------- # 开关No…设置哪个开关。侧视图专用开关操作 # 条件…如果ON就true、如果OFF就false # 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理 # [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束] # # 目标行动名 判別 开关No 条件 分岐 "实行开关No1=ON" => ["n_1", 1, true, 0], #-------------------------------------------------------------------------- # ● 条件分岐 (游戏变量) #-------------------------------------------------------------------------- # 变量No…设置哪个变量 # 数值…条件的数字。它在减的绝对值的变量被内定为参考。 # 条件…引用变量条件的数字…[0=等于] [1=小于] [2=大于] # 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理 # [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束] # # 目标行动名 判別 变量No 数値 条件 分岐 "实行变量No1=1" => ["n_2", 1, 1, 0, 0], #-------------------------------------------------------------------------- # ● 条件分岐 (状态) #-------------------------------------------------------------------------- # 对象…条件参考角色对象 [0=自己] [1=目标] [2=敌全体] [3=我方全体] [4=敌我全体] [5=第二个目标] # 状态ID…设置哪个状态 # 条件…[0=赋予状态] [1=解除状态] # 人数…上面条件的必要人数。条件对象队伍的場合、0队伍全员的数量 # 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理 # [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束] # # 目标行动名 判別 对象 状态ID 条件 人数 分岐 "死亡确认" => ["n_3", 1, 1, 0, 1, 1], #-------------------------------------------------------------------------- # ● 条件分岐 (技能) #-------------------------------------------------------------------------- # 对象…条件参考角色对象 [0=自己] [1=目标] [2=敌全体] [3=我方全体] [4=敌我全体] [5=第二个目标] # 技能ID…设置哪个技能 # 条件…[0=可以使用] [1=不能使用] # 人数…上面条件的必要人数。条件对象队伍的場合、0队伍全员的数量 # 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理 # [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束] # # 目标行动名 判別 对象 技能ID 条件 人数 分岐 "强击使用可限定" => ["n_4", 0, 80, 0, 1, 0], #-------------------------------------------------------------------------- # ● 条件分岐 (参数) #-------------------------------------------------------------------------- # 对象…条件参考角色对象 [0=自己] [1=目标] [2=敌全体] [3=我方全体] [4=敌我全体] [5=第二个目标] # 种別…设置参数条件 # [1=Lv] [2=最大HP] [3=最大MP] [4=HP] [5=MP] [6=TP] [7=攻击力] # [8=防御力] [9=魔法力] [10=魔法防御] [11=敏捷性] [12=幸运] # 数值…条件的数字。从最大值减去的百分比%(HP・MP・TP限定) # 条件…引用变量条件的数字…[0=等于] [1=小于] [2=大于] # 人数…上面条件的必要人数。条件对象队伍的場合、0队伍全员的数量 # 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理 # [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束] # # 目标行动名 判別 对象 种别 数值 条件 人数 分岐 "实行HP50%以上" => ["n_5", 0, 4, -50, 2, 1, 0], #-------------------------------------------------------------------------- # ● 条件分岐 (装备) #-------------------------------------------------------------------------- # 对象…条件参考角色对象 [0=自己] [1=目标] [2=敌全体] [3=我方全体] [4=敌我全体] [5=第二个目标] # 种别…条件装备的种类 [0=武器] [1=防具] # 装备ID…在改类型的项目ID。一次性排列在[]里。 # 在下降武器(防具)类型参考 # 条件…[0=有装备] [1=没有装备] # 人数…上面条件的必要人数。条件对象队伍的場合、0队伍全员的数量 # 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理 # [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束] # # 目标行动名 判別 对象 种别 ID 条件 人数 分岐 "手斧限定" => ["n_6", 0, 0, [1], 0, 1, 0], "拳限定" => ["n_6", 0, 0, [-2], 0, 1, 0], "拳禁止" => ["n_6", 0, 0, [-2], 0, 1, 1], "弓限定" => ["n_6", 0, 0, [-6], 0, 1, 0], "弓禁止" => ["n_6", 0, 0, [-6], 0, 1, 1], "拳弓禁止" => ["n_6", 0, 0,[-2,-6], 0, 1, 1], #-------------------------------------------------------------------------- # ● 条件分岐 (脚本) #-------------------------------------------------------------------------- # 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理 # [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束] # 脚本…true或false返回给脚本 # # 目标行动名 判別 分岐 脚本 "实行50%的确率" => ["n_7", 0, "rand(100) < 50"], "角色限定" => ["n_7", 0, "@battler.actor?"], "角色ID1限定" => ["n_7", 0, "@battler.actor? && @battler.actor_id == 1"], "角色ID2限定" => ["n_7", 0, "@battler.actor? && @battler.actor_id == 2"], "角色ID6限定" => ["n_7", 0, "@battler.actor? && @battler.actor_id == 6"], "角色ID7限定" => ["n_7", 0, "@battler.actor? && @battler.actor_id == 7"], "二刀流限定" => ["n_7", 0, "@battler.dual_wield?"], #-------------------------------------------------------------------------- # ● 第二个目标操作 #-------------------------------------------------------------------------- # 第二个目标时、通常单独的目标的独立的目标信息 # 不想进行任何操作的场合、通常目标相同的对象所配置。 # 对象…[0=自身] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二个目标] # INDEX…对象队伍的指数(排列顺序)在选择。 INDEX = [指数, 判別] # 指数…指数数値 # 判別…数值条件 [0=没有缩小] [1=对象指数] [2=该指数排除] # ID…对象角色(敌人)ID进入选择ID的数字。0是选择不要 # 负增长的绝对值的ID会消除的条件 # 状态…对象当前增加状态ID进入选择状态ID的数字。0是选择不要 # 负增长的增加没有条件。 # 技能…对象可以使用的技能ID进入选择技能ID的数字。0是选择不要 # 负增长不可能使用的条件。 # 参数…对象的参数条件选择 参数 = [种别, 数值, 判別] # 种别…[0=没有缩小] [1=Lv] [2=最大HP] [3=最大MP] [4=HP] [5=MP] [6=TP] # [7=攻击力] [8=防御力] [9=魔法力] [10=魔法防御] [11=敏捷性] [12=幸运] # 数值…种别决定一个数值。从最大值减去的百分比%(HP・MP・TP限定) # 判別…数值的条件 [0=同样] [1=小于] [2=多于] # 装备…对象装备品的条件选择。角色限定装备 = [种类, ID] # 种类…[0=武器] [1=防具] # ID…装备种别的条件项目ID一次性排列到[]里。0是选择不要 # 在下降为(防具)类型的。 # 扩张…扩张对象的设定 [0=没有扩张] [1=随机1体] [2=自身以外] # 操作…[0=不操作] [1=通常目标和第二个目标变更] [2=第二个目标・通常目标初始化] # 目标行动名 判別 对象 INDEX ID 状态 技能 参数 装备 扩张 操作 "自身以外我方全员"=> ["s_t", 3, [ 0, 0], 0, 0, 0, [ 0, 0, 0], [ 0,[0]], 2, 0], "所有领域" => ["s_t", 4, [ 0, 0], 0, -1, 0, [ 0, 0, 0], [ 0,[0]], 0, 1], #-------------------------------------------------------------------------- # ● 公共事件的呼叫 #-------------------------------------------------------------------------- # ID…公共事件ID # ウエイト…运行中的事件,停止就true # # 公共事件设置名 判別 ID ウエイト "公共事件No1" => ["common", 1, true], #-------------------------------------------------------------------------- # ● 脚本的操作 #-------------------------------------------------------------------------- # 使动作被添加到建议的脚本中。样品p=1可以添加任何自己想要设置的脚本。 # 功能中、不能处理文字列。 # # 脚本设置名 "脚本测试" => ["p = 1 "], #-------------------------------------------------------------------------- # ● 其它 没有设定项目的完整动作放进这 #-------------------------------------------------------------------------- # 战斗角色消除…显示战斗动画消除(飞行动画被消除) # 强制战斗结束…战斗强制结束 # 画面固定…让游戏画面固定。放进过渡前 # 伤害动画…技能动画播放、就在结束之前伤害POP # 反转…武器图像动画反转。反转结束时的完全版或动作再次反转它 # 武器消除…显示武器图像消除 # 武器消除解除…消除要显示的武器图像 # 敌人战斗不能…实行战斗不能效果。主要敌人使用的战斗不能 # 战斗不能禁止…对象的HP是0的场合的禁止战斗不能。连续攻击开始时等 # 战斗不能禁止解除…禁止解除战斗不能。连续攻击的结束。工作结束时允许战斗不能。 # 待机取消…待机动作将不执行。战斗动作中演出等 # 待机消除解除…待机取消解除、进行等待动作 # 初期位置变更…原本的坐标(初期位置)目前的坐标变更 # 初期位置变更解除…初期位置变更改变其正常恢复原状。 # 强制…下次的行动强制目标(反应) # 强制2…下次的行动强制第二个目标(反应) # 下个行动者…战斗结束认定、之后的角色都采取行动。 # 个别开始…复数目标单独攻击处理的场合、重复行动开始的标记 # 个别结束…复数目标单独攻击处理的场合、重复行动结束的标记 # 循环开始…"循环开始"和"循环结束"的之间的动作一直重复 # 循环结束…"循环开始"和"循环结束"的之间的动作一直重复 # 目标动作名 判別 "战斗角色消除" => ["anime_off"], "强制战斗结束" => ["battle_end"], "画面固定" => ["graphics_freeze"], "伤害动画" => ["damage_anime"], "反转" => ["mirror"], "武器消除" => ["weapon_off"], "武器消除解除" => ["weapon_on"], "敌人战斗不能" => ["normal_collapse"], "战斗不能禁止" => ["no_collapse"], "战斗不能禁止解除" => ["collapse"], "待机取消" => ["non_motion"], "待机取消解除" => ["non_motion_cancel"], "初期位置变更" => ["change_base_position"], "初期位置变更解除" => ["set_base_position"], "强制" => ["force_action"], "强制2" => ["force_action2"], "下个行动者" => ["next_battler"], "个别开始" => ["individual_start"], "个别结束" => ["individual_end"], "循环开始" => ["loop_start"], "循环结束" => ["loop_end"], #-------------------------------------------------------------------------- # ● 等待 下一个动作而不需要等待的时间 #-------------------------------------------------------------------------- # 在动作数值的场合、时间和等待 # (例) "20" …下一个动作不需要等待20帧 # # 负增长数值将成为随机等待、这个数值的0~绝对值之间 # 随机等待时间的决定。 # (例) "-20" …随机等待0-20帧 #-------------------------------------------------------------------------- # ● 快捷命令 #-------------------------------------------------------------------------- # 动作名通常设定全部动作排列放到行动制作里 # 动作设定没有记载了指令、可以减少一些工作 # 经常使用让你在过去的快捷方式使用和登记动作没有增加。 # # [战斗动画] # (例) "anime(20)" …实行数据库20号的动画目标(有等待) # (例) "anime(20,false)" …实行数据库20号的动画目标(无需等待) # (例) "anime_me(20)" …实行数据库20号的动画自身(有等待) # (例) "anime_me(20,false)" …实行数据库20号的动画自身(无需等待) # # [等待 延迟指数] ※独立队伍等待延迟 # (例) "delay(12)"…指数1号的等待是0帧 2号的等待是12帧 3号的等待是24帧 # # [効果音(SE)] # (例) "se('Bow1')" …文件名Bow1的SE按响了 # (例) "se('Bow1',50)" …文件名Bow1的SE音调50按响了 # # [目标动作(全部动作)强制] # (例) "target('伤害弯向后')" …目标伤害强制操作 # (例) "target2('被伤害')" …第二个目标被伤害的强制全部动作 } #============================================================================== # ■ 完整动作 #------------------------------------------------------------------------------ # 将上边的行动动作组合起来、这里是实际做出的动作。 # 这里的完整动作名将是下面主人公或者敌方所指定用的。 # 条件分岐的下一个完整动作、为方便使用放在这。 #============================================================================== FULLACTION = { # ―――待机系――― "通常待机" => ["待机"], "通常待机固定" => ["待机固定WT"], "消减待机" => ["状态异常/消减","消减色调","待机","待机"], "防御待机" => ["待机固定WT"], "毒待机" => ["状态异常/通用","毒色调","待机","待机","敌人限定","80"], "睡眠待机" => ["状态异常/睡眠","敌人限定","40","敌人停止","倒下","倒下"], "通用状态异常待机"=> ["状态异常/通用","通用状态异常色调","待机","待机","敌人限定","80"], "观望" => ["待机","60"], "战斗不能" => ["倒下"], # ――系统系―― "战斗开始我方" => ["战斗前的我方配置","delay(4)","坐标左向复位"], "我方退场" => ["退场"], "逃走" => ["对象动画","重置相机","delay(4)","退场"], "敌人逃走" => ["对象动画","逃走透明","退场"], "逃走失败" => ["重置相机","delay(4)","逃走途中","一歩后移动","坐标左向复位"], "指令输入" => ["战斗角色消除","指令输入移动"], "指令输入结束" => ["初期目标复位"], "指令后防御" => ["待机固定WT"], "指令后魔法" => ["待机固定","魔法吟唱中"], "指令后特技" => ["待机固定","特技待机中"], "防御" => ["对象动画","待机固定WT"], "回避" => ["角色限定","右1旋转","一歩后跳跃","10","坐标左向复位"], "盾护罩" => ["se('Evasion2')","盾防御","60"], "代替开始" => ["初期敌移动","初期位置变更"], "代替结束" => ["初期位置变更解除","坐标左向复位"], "被代替开始" => ["一歩后移动","一歩后移动","待机固定WT"], "被身代替结束" => ["坐标左向复位"], "胜利姿态挥动" => ["战斗角色消除","胜利武器跳转","胜利跳转着地","120"], "胜利摆的姿态" => ["战斗角色消除","右1旋转","胜利跳转","拳限定","武器拳抛掷","拳禁止", "武器挥动R","120"], "闪光" => ["anime_me(119)","20"], # ―反应系― "被伤害" => ["伤害后弯向后","坐标左向复位"], "被大伤害" => ["摇动中","大伤害","坐标左向复位"], "纵摇动" => ["纵摇动01","纵摇动02","纵摇动01","纵摇动02","纵摇动01","纵摇动02"], # ―捷径系(从其他全面的行动被称为零件)― "斩杀" => ["武器挥动R","对象动画武器","10"], "拳" => ["武器拳抛掷","对象动画武器","10"], "弓" => ["Bow1","弓射击","箭头射击","9"], "攻击" => ["拳限定","拳","弓限定","弓","拳弓禁止","斩杀"], "通常攻击开始" => ["敌前移动","战斗不能禁止","个别开始","二刀流限定","左二刀"], "通常攻击结束" => ["死亡确认","对象动画武器WT","个别结束","战斗不能禁止解除","下个行动者", "坐标曲线重置"], "左二刀" => ["武器挥动L","对象动画武器LWT"], "特技启动" => ["一歩前移动","举起武器","特技启动动画"], "魔法启动" => ["一歩前移动","举起武器","魔法启动动画"], "切入" => ["切入背景开始","切入分岐","70","切入结束","切入背景结束", "20"], "切入分岐" => ["角色ID1限定","切入A1","角色ID2限定","切入A2", "角色ID6限定","切入A3","角色ID7限定","切入A4"], "死亡标记动画" => ["白色淡入","50","死亡标记电影","白色淡出","50"], "背景宇宙" => ["缩小","se('Blind',70)","昏暗的背景","自身以外我方全员", "强制2","透明化","透明化","40","背景宇宙变更","色调初始化"], "背景宇宙的解除" => ["重置相机","昏暗的背景","target2('透明化解除WT')","透明化解除", "40","背景宇宙解除","色调初始化"], "魔法阵显示" => ["se('Blind',70)","画面固定","魔法阵ON","圈"], "魔法阵消除" => ["40","画面固定","魔法阵OFF","圈"], # ――通常攻击系―― "通常攻击" => ["通常攻击开始","待机固定","通常攻击结束"], "斩杀攻击" => ["通常攻击开始","死亡确认","武器挥动R","通常攻击结束"], "拳攻击" => ["通常攻击开始","武器拳抛掷","通常攻击结束"], "抛掷攻击" => ["通常攻击开始","武器抛掷","通常攻击结束"], "弓攻击" => ["一歩前移动","战斗不能禁止","个别开始","Bow1","弓射击", "箭头射击WT","个别结束","战斗不能禁止解除","坐标重置"], # ――技能系――― "通用技能" => ["特技启动","武器挥动R","伤害动画","坐标重置"], "通用魔法" => ["魔法启动","武器挥动R","伤害动画","坐标重置"], "水铁炮" => ["特技启动","武器挥动R","水铁炮射击","坐标重置"], "武器抛出" => ["特技启动","Bow1","武器挥动R","6","待机固定","武器开始抛出", "武器抛出返回","坐标重置"], "切入攻击" => ["特技启动","切入","攻击","坐标重置"], "电影攻击" => ["特技启动","待机固定","死亡标记动画","通常攻击开始","武器挥动R", "通常攻击结束"], "变身" => ["特技启动","anime(110,false)","灰太狼变身","待机固定","120","坐标重置"], "5回攻击" => ["特技启动","战斗不能禁止","弓禁止","敌前移动","攻击","攻击","攻击", "攻击","攻击","战斗不能禁止解除","坐标重置"], "技能连发" => ["武器抛出","多段攻击连发","斩杀攻击"], "背景变更攻击" => ["魔法启动","武器挥动R","背景宇宙","伤害动画","背景宇宙的解除","坐标重置"], "图像攻击" => ["魔法启动","魔法阵显示","武器挥动R","anime(80,false)","60", "摇动大","对象动画","魔法阵消除","坐标重置"], "昏暗攻击" => ["特技启动","自身和目标以外昏暗","se('Laser',150)", "残像ON","敌前移动","anime(35,false)","敌后移动","对象动画", "武器挥动R","20","色调初始化","坐标重置","残像OFF"], "空中攻击" => ["特技启动","Bow1","一歩前跳跃","跳前拍击", "待机固定","左1旋转","10","anime(117,false)","拍击", "对象动画","摇动中","强制","纵摇动","20", "一歩后跳跃","坐标重置"], # ――项目系――― "物品使用" => ["敌前移动","待机固定","对象动画WT","坐标左向复位"], } #============================================================================== # ■ 战斗程序 #------------------------------------------------------------------------------ # 战斗场景的演出时间管理 # 控制游戏开关・侧面图专用按钮来进行 #============================================================================== BATTLE_PROGRAM = { #-------------------------------------------------------------------------- # ● 开关的控制 开关的时间操作、演出编程 #-------------------------------------------------------------------------- # 开关…实行游戏开关号码的程序。号码将只打开侧视图 # 当开关OFF、正在实行的程序将被中止 # 战斗结束时侧视图专用开关将被初始化(全部OFF) # 在事件战斗前侧视图专用开关操作的场合。请把 # 在事件脚本写上$sv_camera.switches[1] = true # [1]操作的开关号码、如果ON就true 如果OFF就false) # ON号码…假设游戏开关号码为OFF时。号码将只打开侧视图 # 号码一次性排列到里面。 # 例…[1,2,-5]游戏开关1号2号侧视图专用开关5号是ON # OFF号码…假设游戏开关号码为OFF时。号码将只打开侧视图 # 不能操作的场合的号码一次性排列到[]里 # 时间…以上的开关来实行该操作的时间。单位帧(1/60秒)) # 例100的场合、开关操作从程序开始后进行100帧 # [参考数值] 30秒…1800 1分…3600 5分…18000 10分…36000 1時間…216000 # 随机宽度…随机宽度的时间被添加。单位帧(1/60秒) # 例时间是300、时间是300-600帧,最终它的随机宽度为300 # 程序名 判別 开关 ON号码 OFF号码 时间 随机宽度 "背景堡垒" => ["switch", -1, [-2], [], 1200, 0], "背景入海" => ["switch", -2, [-3], [], 2400, 0], #-------------------------------------------------------------------------- # ● SE/BGM/BGS的演奏 #-------------------------------------------------------------------------- # 开关…实行游戏开关号码的信号。负面仅查看开关。 # 种別…SE的操作为"se" BGM的操作为"bgm" BGS的操作为"bgs" # 速度…速度。50~150之间指定的最多 不管哪个都要默认为100。 # 音量…音量。50~150之间指定的指定 不管哪个都要默认为100。 # 文件名…播放的文件名。""时不改变任何BGM和BGS的设定。 # 程序名 判別 开关 种别 速度 音量 文件名 "海声" => ["sound", -1, "bgs", 100, 80, "Sea"], #-------------------------------------------------------------------------- # ● 背景的控制 画像变更自动进行滚动 #-------------------------------------------------------------------------- # 开关…实行开关号码的信号 # No.…操作背景的号码。1地背景、2墙壁背景(远景) # 滚动速度…背景的移动速度。[X轴, Y轴] # 单位每100帧前往像素数。 # 当在高速移动的场合、1000是一个标准的单位数值 # BA反转…偷袭时背景的X坐标滚动如果反转就true 图像不反转 # 图像…背景图像变更的場合、放进文件的文件名。不变更的场合"" # 地背景Battlebacks1文件夹里、壁背景参考该Battlebacks2文件夹 # 设定想变更的背景、变更前的继承 # 联合图像…背景滚动时、背景变更自然显示的联合图像文件名 # 滚动途中进行背景变更的场合、滚动结束后进行变更。 # 性质上、不对应与斜滚动 # 打断…出现这种行为时的背景能够控制的情况下 # 如果允许打断就true(在显示图像,延续滚动的情况下的打断背景) # 如果不允许打断就false(另一个背景控制处于正在等待处理的背景消失进行了变更时) # 程序名 判別 开关 No. 滚动速度 BA反转 图像 联合图像 打断 "远景右移动" => ["scroll", -1, 1, [ 40, 0], true, "", "", true], "海背景3变更" => ["scroll", -2, 1, [ 120, 0], true, "Sea_ex03", "Sea_ex02", true], "海背景4变更" => ["scroll", -3, 1, [ 40, 0], true, "Sea_ex01", "Sea_ex04", true], "背景宇宙变更1" => ["scroll", -4, 1, [ 0, 0], true, "DarkSpace", "", false], "背景宇宙变更2" => ["scroll", -4, 2, [ 0, 0], true, "DarkSpace", "", false], #-------------------------------------------------------------------------- # ● 期间的图片 期间的瓷砖状的一幅画操作。风或巨大魔方阵等 #-------------------------------------------------------------------------- # 开关…实行开关号码的信号 # No.…操作的图像数。可以显示许多图片 # 移动速度…每100帧图片移动的速度。[X轴, Y轴] 0与滚动背景同步 # 期间…改程序进行的时间。单位帧(1/60秒)。时间0表示无限制的循环 # 透明操作…图片的透明度操作。[开始透明度, 每秒100帧添加到的透明度] # 透明度255成为开始透明度到备份。 # Z轴…图片的Z坐标。100以上如果它被显示在窗口的前面 # 允许摇动…攻击动作摇动、如果允许摇动就true # BA反转…偷袭时背景的X坐标滚动如果反转就true 图像不反转 # 文件名…图像的文件名。图像放到Pictures文件夹中 # 程序名 判別 开关 No. 移动速度 期间 透明操作 Z轴 允许摇动 BA反转 文件名 "风" => ["kpic", -1, 0, [ 500, 0], 0, [ 255, 0], 90, false, true, "back_wind"], "魔法阵" => ["kpic", -5, 1, [ 0, 0], 0, [ 255, 0], 90, true, true, "magic_square01"], #-------------------------------------------------------------------------- # ● 期间SE 期间的效果音响起了。如雷轰潮骚 #-------------------------------------------------------------------------- # 开关…实行开关号码的信号 开始进行就是ON # 期间…効果音响起的期间。单位帧(1/60秒)。在此间隔中效果音定期听到 # 随机宽度…随机宽度的期间被添加。单位帧(1/60秒) # 速度…速度。50~150之间指定的最多 不管哪个都要默认为100。 # 音量…音量。50~150之间指定的指定 不管哪个都要默认为100。 # 开始实行…实行程序之后无需等待的期间内响起就true # 文件名…播放效果音文件名。 # 程序名 判別 开关 期间 随机宽度 速度 音量 开始实行 文件名 "鸥" => ["keep_se", -1, 400, 100, 150, 60, false, "Crow"], "鸥2" => ["keep_se", -1, 300, 200, 140, 45, true, "Crow"], #-------------------------------------------------------------------------- # ● 期间移动 期间的画面摇动 #-------------------------------------------------------------------------- # 开关…实行开关号码的信号。开始进行就是ON # 期间…画面摇动期间。单位帧(1/60秒) # 随机宽度…随机宽度的期间被添加。单位帧(1/60秒) # 方向…摇动的方向 [横,纵] 数字越大摇晃范围将扩大。 # 速度…摇动的速度。规模较小的摇动就快。 # 時間…摇动的持续时间。振动宽度随着时间一起弱 # 开始实行…实行程序之后无需等待的期间内摇动就true # 程序名 判別 开关 期间 随机宽度 方向 速度 时间 开始实行 "船的摇动" => ["keep_sk", -1, 130, 0, [ 0, 4], 80, 120, true], #-------------------------------------------------------------------------- # ● 期间色调变更 期间的画面的色调变更 #-------------------------------------------------------------------------- # 开关…实行开关号码的信号。开始进行就是ON # 期间…色调变更期间。单位帧(1/60秒) # 随机宽度…随机宽度的期间被添加。单位帧(1/60秒) # 对象…色调变更的对象 [0=背景] [1=敌全] [2=我方全] [3=敌我方全] [4=所有] # 色调水平…[ R, G, B分别是红、绿、蓝。最初(色调强度), 变更时间, ※返回] # ※返回…变更结束返回颜色的时间。不返回就0 # 开始实行…实行程序之后无需等待的期间内色调变更就true # 程序名 判別 开关 期间 随机宽度 对象 R, G, B, 最初 时间 返回 开始实行 "雷光" => ["keep_c", 0, 300, 100, 4, [ 255, 255, 255, 255, 8, 8], true], "紧急情况" => ["keep_c", 0, 150, 0, 4, [ 255, 0, 0, 100, 40, 40], true], } #============================================================================== # ■ 相机设定 #------------------------------------------------------------------------------ # 除了行动和战斗场面的每个要点,进行摄影的工作 # 动作名由于相机移动、请不要变更名称 #============================================================================== BATTLE_CAMERA = { #-------------------------------------------------------------------------- # ● 摄影的工作 画面进行的缩放和滚动 #-------------------------------------------------------------------------- # 对象…移动和缩放的对象 [2=敌全] [3=我方全] [4=敌我方全] [6=画面] # 调整坐标…微调整相机坐标的最后地点 [X轴(正画面→), Y轴(正画面↓)] # 时间…摄影的工作所花费的时间 # 放大…相机的放大率(%)。放大没有100。 # 目标动作名 判別 对象 调整坐标 放大 时间 "顺序开始前" => ["camera", 6, [ 40, 0], 95, 40], "顺序开始后" => ["camera", 6, [ 0, 0], 100, 40], "战斗结束时" => ["camera", 6, [ 100, 0], 100, 50], } end
橫版基礎
#==============================================================================
# ■ SideView动作设定 Ver100
#------------------------------------------------------------------------------
# 创建侧视图战斗一般的设置和行动。
# 汉化by: 圣痕
#==============================================================================
module N03
#--------------------------------------------------------------------------
# ● 全体队员设置
#--------------------------------------------------------------------------
# 主人公初期位置 第一人 第二人 第三人 第四人
# X轴 Y轴 H轴 X轴 Y轴 H轴 X轴 Y轴 H轴 X轴 Y轴 H轴
ACTOR_POSITION = [[415,160, 0],[435,185, 0],[455,210, 0],[475,235, 0] ,[490,255, 0]]
#召喚獸位置
SUMMON_POSITION = [[375,170, 0],[395,195, 0],[415,220, 0],[435,245, 0] ,[450,265, 0]]
#動物之位置
ANIMAL_POSITION = [[465,140, 0],[485,165, 0],[505,190, 0],[525,215, 0] ,[540,245, 0]]
# 战斗中行动结束后,到下个角色行动开始的等待时间。
ACTION_END_WAIT = 8
# 战斗中行动结束后(等待时间・单位帧(1/60)秒)
TURN_END_WAIT = 12
# 背后攻击(偷袭时的画面反转)使用的话是true不使用的是false
BACK_ATTACK = true
# 我方角色受到伤害时、如果采用默认的效果就是true
ACTOR_DAMAGE = false
# 敌方角色受到伤害时、如果采用默认的效果就是true
ENEMY_DAMAGE = false
# 敌人角色的X坐标、旋转计算、战斗自动反转就是true
ENEMY_MIRROR = true
# 战斗不能禁止使用处理、数据库的无敌状态ID
IMMORTAL_ID = 10
# 战斗记录(战斗进行实况显示的窗口)如果显示就是true
# 如果OFF的场合、显示技能名窗口出现在屏幕上方
BATTLE_LOG = true
# 技能名在改窗口ON时、不显示的技能ID排列放进去
NO_DISPLAY_SKILL_ID = [1,2,3,4,5,6,7]
# 如果显示伤害数字POP就是true
DAMAGE_POP = true
# 如果显示附加状态POP就是true
STATE_POP = true
# 伤害数字图片的文件名(横向等距的从零到九依次排列的图片(Graphics/System))
DAMAGE_PLUS = "damage_num+"
# 回复数字图片的文件名(Graphics/System)
DAMAGE_MINUS = "damage_num-"
# MP数字图片的文件名(Graphics/System)
DAMAGE_MP = "damage_mp"
# TP数字图片的文件名(Graphics/System)
DAMAGE_TP = "damage_tp"
# 显示伤害数字的文字间隔进行调整。
DAMAGE_ADJUST = -4
# 战斗相机的焦点(转到焦点)调整 [X轴, Y轴]
CAMERA_POSITION = [ 0, -40]
#--------------------------------------------------------------------------
# ● 战斗背景设定 背景的坐标调整及扩大率设定
#--------------------------------------------------------------------------
# 地背景文件名…设定地背景图像的文件名(Battlebacks1)。
# "全Battlebacks1"在指定的Battlebacks1图像,设定的项目。
# 壁背景文件名…设定壁背景图像的文件名(Battlebacks1)。
# "全Battlebacks2"在指定的Battlebacks2图像,设定的项目。
# 坐标调整…[X轴, Y轴]
# 扩大率……[横扩大率, 纵扩大率]
# 允许摇动……攻击动作摇动、如果允许摇动就true、不允许就false
# 开关触发…游戏数字为 ON 自动在战斗开始时。侧视图开关是对温室气体
# 如果您希望将受控制的战斗程序和背景集,请使用
# 如果为 0 则不操作
FLOOR1_DATA = {
# 床背景文件名 坐标调整 扩大率 允许摇动 开关触发
"Sea_ex01" => [ [ 0, 120], [ 150, 150], false, -1],
"全Battlebacks1" => [ [ 0, 120], [ 150, 150], true, 0],
}
FLOOR2_DATA = {
# 壁背景文件名 坐标调整 扩大率 允许摇动 开关触发
"Ship_ex" => [ [ 0, 120], [ 150, 150], true, 0],
"全Battlebacks2" => [ [ 0, 120], [ 150, 150], true, 0],
}
#==============================================================================
# ■ 战斗角色行动
#------------------------------------------------------------------------------
# 角色战斗中单独行动。可以组合完整的行动
#==============================================================================
# 完整的行动和行动名称在这里。
ACTION = {
#--------------------------------------------------------------------------
# ● 角色动画的设定
#--------------------------------------------------------------------------
# 默认的一个角色芯片的图像文件中包含多个的角色已经配置好
# 使用角色芯片(Charachip)的场合、添加一个角色图像的图像被配置使其符合。
# 一个角色中的一个字符的图像的运用(文件的开头名字写入"$"才名字)没有问题的场合
#
# 指数…使用角色图像文件的附在后面的Index(指数)名称。
# 侧视图的角色的场合参考文件字符和文件名。
# 指数达到时、角色文件名+指数文件的图像、参考该文件
# 例)实行Actor1的角色指数"_1"的动画的场合时、参考该文件名"Actor1_1"
# 使用角色芯片的场合的指数的动画
# 角色放在Characters文件夹中、敌人图像放在Battlers文件夹中
# 纵元件…图像文件的单元格的垂直对齐方式。其次从顶部的 0-3。任何数量的级别元
# 件编号角色设置中的设置
# 横元件…在图像文件单元格的水平对齐方式、开始播放元件。随后由 0-3 和从左侧。
# 杆发挥此下一级别元件的从左到右。任何数量的级别元件
# 这个横元件的动画从左到右播放。元件数量不限
# 模式… 0:元件固定 1:单程 2:往返 3:单程循环 4:往返循环
# 速度…动画的更新速度。数值越低更新速度越快。
# Z轴…另外,如果您在顶部显示。通常出现在屏幕的底部。
# 等待…动画模式到最后如果也被播放的行动就true
# 影…表示阴影效果的话是true、不表示为false
# 武器…武器表示的情况填入武器动作名。不表示的情况为""。
# 可能同时追加任意数量的武器动作、将追加在阵列后面
#目标动画名(待机系)― 判別 指数 纵件 横件 模式 速度 Z轴 等待 影 武器
"待机" => ["motion", "", 1, 0, 4, 12, 0, true, true, "" ],
"待机固定WT" => ["motion", "", 1, 1, 0, 12, 0, true, true, "" ],
"待机固定" => ["motion", "", 1, 1, 0, 12, 0,false, true, "" ],
"倒下" => ["motion", "_1", 0, 0, 0, 12, 0, true,false, "" ],
"向右" => ["motion", "", 2, 0, 4, 12, 0, true, true, "" ],
#目标动画名(移动系)― 判別 文件No 纵件 横件 模式 速度 Z轴 等待 影 武器
"左向移动" => ["motion", "", 1, 0, 4, 6, 10, true, true, "" ],
"右向移动" => ["motion", "", 2, 0, 4, 6, 10, true, true, "" ],
#目标动画名(姿态系)― 判別 文件No 纵件 横件 模式 速度 Z轴 等待 影 武器
"举起武器" => ["motion", "", 1, 0, 1, 2, 200,false, true, "举起" ],
#目标动画名(攻击系)― 判別 文件No 纵件 横件 模式 速度 Z轴 等待 影 武器
"武器挥动R" => ["motion", "", 1, 0, 1, 2, 200,false, true, "纵挥动"],
"武器挥动L" => ["motion", "", 1, 0, 1, 2, 200,false, true, "纵挥动L"],
"武器挥动LR" => ["motion", "", 1, 0, 1, 2, 200,false, true, "纵挥动","纵挥动L"],
"盾防御" => ["motion", "", 1, 0, 1, 2, 200,false, true, "盾"],
"武器拳抛掷" => ["motion", "", 1, 0, 1, 2, 200,false, true, "拳抛掷"],
"武器抛掷" => ["motion", "", 1, 0, 1, 2, 200,false, true, "抛掷" ],
"弓射击" => ["motion", "", 1, 0, 1, 2, 200,false, true, "弓"],
#--------------------------------------------------------------------------
# ● 角色移动 X轴移动是敌人的自动反向计算
#--------------------------------------------------------------------------
# 目标…要移动引用的目标坐标。编号引用的是当前的位置,积极的消极的初始位置;(是所以负不能设置到 7)
# [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敵我方全] [5=第二个目标] [6=画面]
# X轴…从对象所看X坐标。绝对值就算是最低时也会比时间高
# Y轴…从对象所看Y坐标。绝对值就算是最低时也会比时间高
# H軸…从对象所看H坐标。(离地面的高度) 当H轴是nil无视xy的移动
# 速度…移动1帧的像素数。指定的时间长度将是一个负数、移动完毕后这将是一个帧的总数的百分比
# 曲线…移动时的轨道正上、负面向下曲线。
# 跳跃…跳跃抛物线轨道。[开始跳跃到顶点的轨道, 顶点到着地的轨道]
# 动画…这里的移动所使用的角色动画名。
# 目标行动名(系统系) 判別 目标 X轴 Y轴 H轴 速度 曲线 跳跃 动画
"战斗前的我方配置" => ["move",-7, 180, 10, 0, 0, 0, [ 0, 0], "左向移动"],
"退场" => ["move",-7, 180, 0, 0, 7, 0, [ 0, 0], "右向移动"],
"逃走途中" => ["move",-7, 80, 0, 0, 7, 0, [ 0, 0], "右向移动"],
"指令输入移动" => ["move",-7, -20, 0, nil,-10, 0, [ 0, 0], "左向移动"],
"伤害后弯向后" => ["move", 0, 20, 0, nil,-10, 0, [ 0, 0], ""],
"大伤害" => ["move", 0, 60, 0, nil,-10, 0, [ 0, 0], ""],
# 目标行动名(复位系) 判別 目标 X轴 Y轴 H轴 速度 曲线 跳跃 动画
"初期目标复位" => ["move",-7, 0, 10, 0,-10, 0, [ 0, 0], "右向移动"],
"坐标重置" => ["move",-7, 0, 10, 0,-20, 0, [ 0, 0], "右向移动"],
"坐标曲线重置" => ["move",-7, 0, 0, 0,-20, -2, [ 0, 0], "右向移动"],
"坐标左向复位" => ["move",-7, 0, 0, 0,-20, 0, [ 0, 0], "左向移动"],
# 目标行动名(自身系) 判別 目标 X轴 Y轴 H轴 速度 曲线 跳跃 动画
"一歩前移动" => ["move", 0, -20, 0, 0,-10, 0, [ 0, 0], "左向移动"],
"一歩后移动" => ["move", 0, 20, 0, 0,-10, 0, [ 0, 0], "左向移动"],
"一歩前跳跃" => ["move", 0, -30, 0, 0,-10, 0, [ 20,-20], "左向移动"],
"一歩后跳跃" => ["move", 0, 30, 0, 0,-10, 0, [ 20,-20], "左向移动"],
"胜利跳转" => ["move", 0, 10, 0, 0,-25, 0, [ 30,-30], "待机固定"],
"胜利武器跳转" => ["move", 0, 0, 0, 0,-15, 0, [ 20, 0], "举起武器"],
"胜利跳转着地" => ["move",-7, 0, 0, 0,-10, 0, [ 0, 0], "武器挥动R"],
"纵摇动01" => ["move", 0, 0, 0, 20, -2, 0, [ 0, 0], ""],
"纵摇动02" => ["move", 0, 0, 0, -20, -2, 0, [ 0, 0], ""],
# 目标行动名(目标系) 判別 目标 X轴 Y轴 H轴 速度 曲线 跳跃 动画
"敌前移动" => ["move", 1, 30, 0, 0,-20, 0, [ 0, 0], "左向移动"],
"敌后移动" => ["move", 1, -60, 0, 0,-20, 0, [ 0, 0], "左向移动"],
"初期敌移动" => ["move", 1, 0, 0, 0,-10, 0, [ 0, 0], "左向移动"],
"跳前拍击" => ["move",-1, 0, 0, 100,-20, 0, [ 40,-20], "举起武器"],
"拍击" => ["move",-1, 0, 0, 0,-10, 0, [ 0, 0], "武器挥动R"],
#--------------------------------------------------------------------------
# ● 武器动作 让武器图像动起来的方法
#--------------------------------------------------------------------------
# 类型…[0…使用图标]
# [1…独自图像(图像名角色设定的武器项目中进行。参考Characters文件夹)]
# [2…动画元件(※2003规范。同样数量的元件和角色的动画。图像名角色设定的武器项目中进行。
# 参考Characters文件夹)]
# 移动…移动图像的距离。[X轴, Y轴]
# 调整…要微调整图像初始的坐标。[X轴, Y轴]
# 始度…武器在动作前的最初角度。半圆的0~360度。复数情况为反半圆。
# 終度…动作后的角度
# 原点…武器旋转时的原点。[0…中心] [1…左上] [2…右上] [3…左下] [4…右下] [5…和角色同样(一半宽以下的图像)]
# 反转…当为true时,动作前武器的图像将会显示为反转的。
# 扩大…[X轴扩大率, Y轴扩大率] 小数点也接受
# [X轴放大率、武器横向放大率。1是同等、2是2倍、0.5是1/2。]
# [Y轴放大率、武器纵向放大率。1是同等、2是2倍、0.5是1/2。]
# Z轴…如果让此动作显示时武器在人物前方写作true。
# 二刀…限定于二刀流为true、将以二刀流来显示左边武器动作的武器画像。
# 如果不是二刀流的情况会自动跳过角色动画。
# 更新…-1个角色动画更新和同步。独立配置的场合[更新时间间隔, 更新模式数, 循环的状况]
# 指数…武器图像的武器装备(盾)被设定为图像文件将参考、
# 指数放在这里、图像文件名+指数名的图像将参考
# 一个以上的武器复数的有规律的使用图像的场合
# 例) "縦振り"的指数"" => 图像文件名"IconSet"将参考
# 例) "縦振り2"的指数"_1" => 画像文件名"IconSet_1"将参考
# 使用该图标的场合将参考System文件夹、独自图像动画和元件放在Characters文件夹中
# 图像…武器、盾牌设定的图片文件和指数、直接指定的武器图像
# 这里给的图像文件名。图像放到Characters文件夹中将参考
# 目标动作名 判別 类型 移动 调整 始度 终度 原点 反转 扩大 Z轴 二刀 更新 指数 画像
"纵挥动" => ["wp", 0,[ 6, 0],[ -4,-10], -45, 45, 4, false, [1,1], false, false, -1, "", ""],
"盾" => ["wp", 0,[ 0, 0],[ 12, 0], 0, 0, 4, false, [1,1], true, true, -1, "", ""],
"纵挥动L" => ["wp", 0,[ 6, 0],[ 0, -8],-135, 45, 4, false, [1,1], true, true, -1, "", ""],
"拳抛掷" => ["wp", 0,[-20, 0],[ 5, 5], -45, -45, 4, false, [1,1], false, false, -1, "", ""],
"抛掷" => ["wp", 0,[-25, 0],[ 25,-10], 45, 45, 4, false, [1,1], false, false, -1, "", ""],
"举起" => ["wp", 0,[ 6,-4],[ -4,-10], 90, -45, 4, false, [1,1], false, false, -1, "", ""],
# 2003规范 判別 类型 移动 调整 始度 终度 原点 反转 扩大 Z轴 二刀 更新 指数 画像
"弓" => ["wp", 2,[ 0, 0],[ 0, 0], 0, 0, 5, false, [1,1], true, false, -1, "", ""],
# 使用飞行武器 判別 类型 移动 调整 始度 终度 原点 反转 扩大 Z轴 二刀 更新 指数 画像
"箭头" => ["wp", 0,[ 0, 0],[ 0, 0], 0, 45, 0, false, [1,1], true, false,[2,6,false], "", "arrow01"],
"旋转" => ["wp", 0,[ 0, 0],[ 0, 0], 0, 360, 0, false, [1,1], true, false,[1,8, true], "", ""],
#--------------------------------------------------------------------------
# ● 武器・动画飞出 让战斗动画飞出去。飞行道具、远距离攻击用
#--------------------------------------------------------------------------
# ID…数据库里设定的动画ID。[动画移动ID,被击中时的动画ID] 0是不显示动画。-1是显示武器的动画。
# 始…动画飞出时的开始位置。当减少时、实行一个以上目标的复数的动画
# [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标] [6=画面]
# 后…动画发出后的结束位置。当减少时、实行一个以上目标的复数的动画
# [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标] [6=画面]
# 始调整…移动开始坐标的微调整。[X轴, Y轴] 敌人的X轴自动反计算的
# 后调整…移动结束坐标的微调整。[X轴, Y轴] 敌人的X轴自动反计算的
# 速度…X轴移动1帧的像素数目。负增长将成为处理时间、距离速度会有所变化。
# 类型…移动后的处理。[0=消失(失误时自动改变为贯穿] [1=直线贯穿] [2=消失(失误时消失)]
# 轨道…动画飞出去时候的轨道。[从开始到顶点的轨道, 从顶点到结束的轨道]
# 填入数值的话是走抛物线。正数为向下的抛物线、负数为向上。
# Z轴…动画或者武器在角色面前显示的话是true
# 等待…动作行动直到下一个不想迁移就true [移动到动画的等待, 打击时动画的等待]
# 伤害…达到目标时、如果计算伤害就true
# 复位…如果移动目标归位时就true。如果不归位就false
# 相机…如果相机的根据变焦缩放动画就true
# 循环…当播放的动画已经完成移动时、如果最初循环往复的就true
# 反转不可…任何的场合、如果不能反转动画就true
# 武器…填入下面贴附的武器、技能动作名。如果不是用为""
# 目标行动名 判別 ID 始 后 始调整 后调整 速度 类型 轨道 Z轴 等待 伤害 复位 相机 循环 反转不可 武器
"箭头射击WT" => ["m_a",[ 0,-1], 0, 1, [ 0, 0], [ 0, 0], 10, 2, [-3,-3], true, [ true, true], true, true, true, false, false, "箭头"],
"箭头射击" => ["m_a",[ 0,-1], 0, 1, [ 0, 0], [ 0, 0], 10, 2, [-3,-3], true, [false,false], true, true, true, false, false, "箭头"],
"水铁炮射击" => ["m_a",[69,69], 0, 1, [ 0, 0], [ 0, 0], 10, 0, [ 0, 0], true, [ true, true], true, true, true, true, false, ""],
"武器开始抛出" => ["m_a",[ 0,-1], 0, 1, [ 4,-6], [ 0, 0], 10, 2, [-3,-3], true, [ true,false], true, true, true, false, false, "旋转"],
"武器抛出返回" => ["m_a",[ 0, 0], 1, 0, [ 0, 0], [ 4,-6], 10, 0, [ 3, 3], true, [ true,false], false, true, true, false, false, "旋转"],
#--------------------------------------------------------------------------
# ● 战斗动画 数据库的战斗动画 显示动画在战斗
#--------------------------------------------------------------------------
# ID…动画ID。-1时武器设定为动画 -2时另一端二刀流的动画
# -3时技能也变成武器上所带的动画。
# 对象…[0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标]
# 复位…对象的坐标移动、如果在追踪动画就是true
# 等待…如果显示动画等到结束就是true
# 伤害…如果要计算伤害就是true
# 相机…如果相机的根据变焦缩放动画就true
# 反转不可…任何的场合、如果不能反转动画就true
# 反转…true时动画的图像将被反转。
# Z轴…如果想显示在前面的动画字符就true
# 目标行动名(伤害系) 判別 ID 对象 复位 等待 伤害 相机 反转不可 反转 Z轴
"对象动画武器" => ["anime", -1, 1, false, false, true, true, false, false, true],
"对象动画武器WT" => ["anime", -1, 1, false, true, true, true, false, false, true],
"对象动画武器LWT" => ["anime", -2, 1, false, true, true, true, false, false, true],
"对象动画" => ["anime", -3, 1, false, false, true, true, false, false, true],
"对象动画WT" => ["anime", -3, 1, false, true, true, true, false, false, true],
# 目标行动名(自身系) 判別 ID 对象 复位 重量 伤害 相机 反转不可 反转 Z轴
"魔法吟唱中" => ["anime", 113, 0, true, true, false, true, false, false, true],
"特技待机中" => ["anime", 114, 0, true, true, false, true, false, false, true],
"魔法启动动画" => ["anime", 115, 0, false, true, false, true, false, false, false],
"特技启动动画" => ["anime", 116, 0, false, true, false, true, false, false, false],
"斩击/必杀技1" => ["anime", 11, 1, false, true, false, true, false, false, false],
"对象动画等待" => ["anime", -1, 1, false, true, false, true, false, false, false],
#--------------------------------------------------------------------------
# ● 摄影的工作 画面的缩放和滚动
#--------------------------------------------------------------------------
# 对象…移动和缩放的对象
# [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标] [6=画面]
# 调整坐标…微调整相机坐标的最后地点 [X轴(正画面→), Y轴(正画面↓)]
# 时间…摄影的工作所花费的时间
# 等待…摄影结束为止等待话就true。不要等待的话就false
# 放大…相机的放大率(%)。放大没有100。
# 目标动作名 判別 对象 调整坐标 放大 时间 等待
"重置相机" => ["camera", 6, [ 0, 0], 100, 40, false],
"放大" => ["camera", 6, [ 0, 100], 120, 40, false],
"缩小" => ["camera", 6, [ 0, 0], 80, 40, false],
#--------------------------------------------------------------------------
# ● 画面的摇动 画面摇晃。空中坐标(H坐标是0以上)的角色不要摇动
#--------------------------------------------------------------------------
# 方向…摇动的方向 [横,纵] 数字越大摇晃范围将扩大。
# 速度…摇动的速度。规模较小的摇动就快。
# 時間…摇动的持续时间。振动宽度随着时间一起弱
# 等待…摇动结束为止等待话就true。不要等待的话就false
# 目标动作名 判別 方向 速度 时间 等待
"摇动小" => ["shake", [ 0, 4], 2, 16, false],
"摇动中" => ["shake", [ 0, 6], 3, 30, false],
"摇动大" => ["shake", [ 0,12], 3, 40, false],
#--------------------------------------------------------------------------
# ● 画面色调变更 角色背景的色调变更
#--------------------------------------------------------------------------
# 对象…变更色调的对象
# [0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标]
# [6=背景] [7=自身+目标] [8=自身以外] [9=自分+目标以外] [10=所有]
# 色调水平…[ R, G, B分别是红、绿、蓝。最初(色调强度), 变更时间, ※返回]
# ※返回…变更结束返回颜色的时间。不返回就0
# 等待…色调变更更结束为止等待话就true。不要等待的话就false
# 色调变更名 判別 对象 R, G, B, 最初 时间 返回 等待
"色调初始化" => ["color", 10, [ 0, 0, 0, 0, 30, 0], false],
"消减色调" => ["color", 0, [ 255, 50, 50, 100, 40, 40], false],
"毒色调" => ["color", 0, [ 170, 50, 255, 170, 30, 30], false],
"通用状态异常色调" => ["color", 0, [ 255, 255, 50, 170, 40, 40], false],
"昏暗的背景" => ["color", 6, [ 0, 0, 0, 255, 30, 0], false],
"自身和目标以外昏暗" => ["color", 9, [ 0, 0, 0, 255, 30, 0], false],
#--------------------------------------------------------------------------
# ● 过渡 实行固定画面后过渡
#--------------------------------------------------------------------------
# 实行动作前"画面固定"将实行、请固定在画面上。
# 边界…边界的模糊。数值越大变得模糊。
# 时间…过渡花费的时间。在过渡期间的游戏画面是固定的
# 过渡文件名…过渡图像。图像放到Pictures文件夹中
# 目标动作名 判別 边界 时间 过渡文件名
"圈" => ["ts", 40, 60, "circle"],
#--------------------------------------------------------------------------
# ● 残像 角色动作留下的残影
#--------------------------------------------------------------------------
# 数…残像数。0是显示残像关闭。非常大的负载增加时
# 间隔…残像显示的时间间隔。数值越小就越狭窄。单位帧(1/60秒)
# 处理…残像后的处理。true表示直到战斗结束消失,false表示一直没有消失
# 透明度…残像的透明度 255-不透明,0-透明
# 目标动作名 判別 数 间隔 处理 透明度
"残像ON" => ["mirage", 4, 3, true, 160],
"残像OFF" => ["mirage", 0, 0, true, 0],
#--------------------------------------------------------------------------
# ● 角色旋转。画像旋转。与反转不同、武器动作不能被反映
#--------------------------------------------------------------------------
# 旋转着角色的动作结束后、旋转角度被复位
# 旋转中的图像传输原点成为中心。反转不同、不能反映武器动作
# 时间…旋转过程所需时间。0表示立即反映
# 始度…旋转开始时的角度。指定于0~360度之间。正数为正半圆、负数为反半圆。
# 终度…旋转完毕时的角度。指定于0~360度之间。跟上边所记相同,但敌人的设定是与其相反的。
# 类型…旋转结束后的处理。[0…旋转复位] [1…结束角度左端] [2…循环]
# 目标动作名 判別 时间 始度 终度 类型
"右1旋转" => ["angle", 12, 0, -360, 0],
"左1旋转" => ["angle", 12, 0, 360, 0],
#--------------------------------------------------------------------------
# ● 角色放大缩小 武器动作不能被反映
#--------------------------------------------------------------------------
# 扩大缩小角色的全部动作已经完成、扩大缩小被复位。
# 反转不同、不反映武器动作
# 时间…扩大缩小过程所需时间。
# 开始大小…扩大缩小开始时的大小。小数点也接受。[X轴(横), Y轴(纵)]
# 结束大小…扩大缩小结束时的大小。小数点也接受。[X轴(横), Y轴(纵)]
# 类型…扩大缩小结束后的处理。[0…大小重设] [1…结束后大小保持] [2…循环]
# 目标动作名 判別 时间 开始大小 结束大小 类型
"横收缩" => ["zoom", 12, [1.0, 1.0], [0.5, 1.0], 0],
"纵收缩" => ["zoom", 12, [1.0, 1.0], [1.0, 0.5], 0],
#--------------------------------------------------------------------------
# ● 角色透明度操作 画像的透明度变更
#--------------------------------------------------------------------------
# 透明度操作角色的全部动作已经完成、透明度操作被复位。
# 时间…透明度变更过程所需时间。
# 开始…开始时变更的透明度。0-透明 255-不透明
# 结束…结束时变更的透明度
# 影…表示阴影效果的话是true、不表示为false
# 武器…武器也同样透明度操作就true
# 循环…透明度变更结束后、如果自动操作逆转就true
# 等待…操作结束后迁移无需等到下一个动作表示true
# 目标行动名 判別 时间 开始 结束 影 武器 循环 等待
"逃走透明" => ["opacity", 30, 255, 0, true, true, false, false],
"透明化" => ["opacity", 60, 255, 0, true, true, false, false],
"透明化WT" => ["opacity", 60, 255, 0, true, true, false, true],
"透明化解除" => ["opacity", 60, 0, 255, true, true, false, false],
"透明化解除WT" => ["opacity", 60, 0, 255, true, true, false, true],
#--------------------------------------------------------------------------
# ● 状态动画 显示事件使用的状态ICON
#--------------------------------------------------------------------------
# 种类…状态的种类(纵位置)在0~9之间。
# 速度…更新速度。2种元件从第一帧将播放
# 大小…气球的大小
# 气球名 判別 种类 速度 大小
"状态异常/通用" => ["balloon", 6, 10, 0.6],
"状态异常/消减" => ["balloon", 5, 10, 0.6],
"状态异常/睡眠" => ["balloon", 9, 10, 0.6],
#--------------------------------------------------------------------------
# ● 图片的表示 一名角色对应显示一枚图片
#--------------------------------------------------------------------------
# 号码…要使用图片的号码。它是用于管理图片的号码。不管多少都显示。
# 完整动作结束后自动自动删除(Bitmap释放)
# 开始坐标…移动的开始位置。图片的左上角处的原点。[X轴, Y轴]
# 已经有图像的场合、当开始坐标是在其位置[]
# 结束坐标…移动的结束位置。开始位置显示成为相同数值
# 平面使用的场合、开始和结束将保持的移动速度[]
# 时间…移动时间。0是删除的图片
# Z轴…图片Z坐标。100以上如果它被显示在窗口的前面
# 透明度…透明度设定。[开始时的透明度, 每1帧透明度的制度]
# 平面使用…平面类(图像瓷砖状排列着图像)使用矩形的场合。[X轴,Y轴]
# 不想使用平面的场合就[]
# BA反转…偷袭时图像反转X坐标移动如果反向就true
# 平面使用时的图像不逆转就true、X坐标移动的是相反的
# 图片文件名…图片文件夹内的文件名。
# 目标行动名 判別 号码 开始坐标 结束坐标 时间 Z轴 透明度 平面使用 BA反转 图片文件名
"切入A1" => ["pic", 0, [-300, 8], [ 100, 8], 30, 90, [ 0, 10], [], true, "Actor4-1"],
"切入A2" => ["pic", 0, [-300, 8], [ 100, 8], 30, 90, [ 0, 10], [], true, "Actor4-2"],
"切入A3" => ["pic", 0, [-300, 8], [ 100, 8], 30, 90, [ 0, 10], [], true, "Actor5-2"],
"切入A4" => ["pic", 0, [-300, 8], [ 100, 8], 30, 90, [ 0, 10], [], true, "Actor5-3"],
"切入结束" => ["pic", 0, [], [ 600, 8], 30, 90, [255, 0], [], true, ""],
"切入背景开始" => ["pic", 1, [ 0, 8], [ 100, 8], 10, 80, [ 0, 10], [544,288], true, "cutin_back"],
"切入背景结束" => ["pic", 1, [], [], 10, 80, [255, -7], [544,288], true, ""],
"白色淡入" => ["pic", 0, [ 0, 0], [ 0, 0], 50,500, [ 0, 6], [], false, "white"],
"白色淡出" => ["pic", 0, [ 0, 0], [ 0, 0], 50,500, [255, -6], [], false, "white"],
#--------------------------------------------------------------------------
# ● 状态操作
#--------------------------------------------------------------------------
# 対象…[0=自身] [1=目标] [2=敌全] [3=我方全] [4=敌我方全] [5=第二个目标]
# 扩张…扩张对象的设定 [0=没有扩张] [1=随机1体] [2=自身以外]
# 操作…如果赋予状态就"+",如果解除状态就"-"
# 状态ID…操作切换状态的ID一起排列放进去
# 状态赋予名 判別 对象 扩张 操作 状态ID
"赋予战斗不能" => ["sta", 0, 0, "+", [1]],
#--------------------------------------------------------------------------
# ● FPS(游戏整体的速度变更) 检查行动的细节
#--------------------------------------------------------------------------
# 游戏速度…60是默认的数值、比这个值低的时候就会放慢。
# 目标行动名 判別 游戏速度
"慢播放" => ["fps", 15],
"通常播放" => ["fps", 60],
#--------------------------------------------------------------------------
# ● 角色画像变更 角色画像引用的文件变更
#--------------------------------------------------------------------------
# 维持…角色的场合。战斗后图像变更维持表示true
# 指数…角色的场合。行走图的图像,数字排列方式如下:
# [0][1][2][3]
# [4][5][6][7]
#
# 文件名…变更图像文件名。角色放在Characters文件夹、
# 敌人放在Battlers文件夹。
# 脸图…主角的場合、战斗后的变更角色脸图[脸图指数, 文件名]
# 如果不变更则是[]
# 目标行动名 判別 维持 指数 文件名 脸图
"灰太狼变身" => ["change", false, 6, "Animal", [0, "Actor4"]],
#--------------------------------------------------------------------------
# ● 技能连发 行动中断后、导出不同的技能
#--------------------------------------------------------------------------
# 习得…如果连发的技能没有被习得也可以实行的话是true
# 成本条件…技能连发的成本不足而可能就true
# 技能ID…连发技能的ID
# 目标行动名 判別 习得 成本条件 技能ID
"多段攻击连发" => ["der", true, false, 130],
#--------------------------------------------------------------------------
# ● 声音的演奏 BGM・BGS・SE按响了
#--------------------------------------------------------------------------
# 种别…効果音为"se" BGM为"bgm" BGS为"bgs"
# 速度…速度。50~150之间指定的最多 不管哪个都要默认为100。
# 音量…音量。50~150之间指定的指定 不管哪个都要默认为100。
# 文件名…播放的文件名。""时不改变任何BGM和BGS的设定。
# 目标行动名 判別 种别 速度 音量 文件名
"Bow1" => ["sound", "se", 100, 80, "Bow1"],
#--------------------------------------------------------------------------
# ● 电影的播放 ogv电影文件播放
#--------------------------------------------------------------------------
# 文件名…播放电影文件名。电影放在Movies文件夹
# 目标行动名 判別 文件名
"死亡标记电影" => ["movie", "sample1"],
#--------------------------------------------------------------------------
# ● 游戏开关的设置(侧面图专用开关)的操作
#--------------------------------------------------------------------------
# ID正值游戏开关、侧视图中专用开关的操作
# ON号码…ON开关ID整理排列放进去
# OFF号码号…OFF开关ID整理排列放进去
#
# 开关设置名 判別 ON号码 OFF号码
"开关No1/ON" => ["switch", [ 1], []],
"背景宇宙变更" => ["switch", [-4], []],
"背景宇宙解除" => ["switch", [], [-4]],
"魔法阵ON" => ["switch", [-5], []],
"魔法阵OFF" => ["switch", [], [-5]],
#--------------------------------------------------------------------------
# ● 游戏变量的操作
#--------------------------------------------------------------------------
# 变量No…设置哪个变量
# 操作…[0=代入] [1=加法] [2=减法] [3=乘法] [4=除法] [5=剩余]
# 设置数值…指定成为演算对象的数值。负增长、至于这个具体数字
# 绝对值的变量No这些值存储在计算的对象
#
# 变量设置名 判別 变量No 操作 设置数值
"变量No1/+1" => ["variable", 1, 1, 1],
#--------------------------------------------------------------------------
# ● 条件分岐 (游戏开关) 条件设定、满足条件以后将停止所有行动
#--------------------------------------------------------------------------
# 开关No…设置哪个开关。侧视图专用开关操作
# 条件…如果ON就true、如果OFF就false
# 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理
# [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束]
#
# 目标行动名 判別 开关No 条件 分岐
"实行开关No1=ON" => ["n_1", 1, true, 0],
#--------------------------------------------------------------------------
# ● 条件分岐 (游戏变量)
#--------------------------------------------------------------------------
# 变量No…设置哪个变量
# 数值…条件的数字。它在减的绝对值的变量被内定为参考。
# 条件…引用变量条件的数字…[0=等于] [1=小于] [2=大于]
# 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理
# [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束]
#
# 目标行动名 判別 变量No 数値 条件 分岐
"实行变量No1=1" => ["n_2", 1, 1, 0, 0],
#--------------------------------------------------------------------------
# ● 条件分岐 (状态)
#--------------------------------------------------------------------------
# 对象…条件参考角色对象 [0=自己] [1=目标] [2=敌全体] [3=我方全体] [4=敌我全体] [5=第二个目标]
# 状态ID…设置哪个状态
# 条件…[0=赋予状态] [1=解除状态]
# 人数…上面条件的必要人数。条件对象队伍的場合、0队伍全员的数量
# 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理
# [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束]
#
# 目标行动名 判別 对象 状态ID 条件 人数 分岐
"死亡确认" => ["n_3", 1, 1, 0, 1, 1],
#--------------------------------------------------------------------------
# ● 条件分岐 (技能)
#--------------------------------------------------------------------------
# 对象…条件参考角色对象 [0=自己] [1=目标] [2=敌全体] [3=我方全体] [4=敌我全体] [5=第二个目标]
# 技能ID…设置哪个技能
# 条件…[0=可以使用] [1=不能使用]
# 人数…上面条件的必要人数。条件对象队伍的場合、0队伍全员的数量
# 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理
# [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束]
#
# 目标行动名 判別 对象 技能ID 条件 人数 分岐
"强击使用可限定" => ["n_4", 0, 80, 0, 1, 0],
#--------------------------------------------------------------------------
# ● 条件分岐 (参数)
#--------------------------------------------------------------------------
# 对象…条件参考角色对象 [0=自己] [1=目标] [2=敌全体] [3=我方全体] [4=敌我全体] [5=第二个目标]
# 种別…设置参数条件
# [1=Lv] [2=最大HP] [3=最大MP] [4=HP] [5=MP] [6=TP] [7=攻击力]
# [8=防御力] [9=魔法力] [10=魔法防御] [11=敏捷性] [12=幸运]
# 数值…条件的数字。从最大值减去的百分比%(HP・MP・TP限定)
# 条件…引用变量条件的数字…[0=等于] [1=小于] [2=大于]
# 人数…上面条件的必要人数。条件对象队伍的場合、0队伍全员的数量
# 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理
# [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束]
#
# 目标行动名 判別 对象 种别 数值 条件 人数 分岐
"实行HP50%以上" => ["n_5", 0, 4, -50, 2, 1, 0],
#--------------------------------------------------------------------------
# ● 条件分岐 (装备)
#--------------------------------------------------------------------------
# 对象…条件参考角色对象 [0=自己] [1=目标] [2=敌全体] [3=我方全体] [4=敌我全体] [5=第二个目标]
# 种别…条件装备的种类 [0=武器] [1=防具]
# 装备ID…在改类型的项目ID。一次性排列在[]里。
# 在下降武器(防具)类型参考
# 条件…[0=有装备] [1=没有装备]
# 人数…上面条件的必要人数。条件对象队伍的場合、0队伍全员的数量
# 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理
# [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束]
#
# 目标行动名 判別 对象 种别 ID 条件 人数 分岐
"手斧限定" => ["n_6", 0, 0, [1], 0, 1, 0],
"拳限定" => ["n_6", 0, 0, [-2], 0, 1, 0],
"拳禁止" => ["n_6", 0, 0, [-2], 0, 1, 1],
"弓限定" => ["n_6", 0, 0, [-6], 0, 1, 0],
"弓禁止" => ["n_6", 0, 0, [-6], 0, 1, 1],
"拳弓禁止" => ["n_6", 0, 0,[-2,-6], 0, 1, 1],
#--------------------------------------------------------------------------
# ● 条件分岐 (脚本)
#--------------------------------------------------------------------------
# 分岐…当条件满足的分支处理。如果不符合却恰恰相反被处理
# [0=请执行以下操作] [1=取消以下操作] [2=全部动作结束]
# 脚本…true或false返回给脚本
#
# 目标行动名 判別 分岐 脚本
"实行50%的确率" => ["n_7", 0, "rand(100) < 50"],
"角色限定" => ["n_7", 0, "@battler.actor?"],
"角色ID1限定" => ["n_7", 0, "@battler.actor? && @battler.actor_id == 1"],
"角色ID2限定" => ["n_7", 0, "@battler.actor? && @battler.actor_id == 2"],
"角色ID6限定" => ["n_7", 0, "@battler.actor? && @battler.actor_id == 6"],
"角色ID7限定" => ["n_7", 0, "@battler.actor? && @battler.actor_id == 7"],
"二刀流限定" => ["n_7", 0, "@battler.dual_wield?"],
#--------------------------------------------------------------------------
# ● 第二个目标操作
#--------------------------------------------------------------------------
# 第二个目标时、通常单独的目标的独立的目标信息
# 不想进行任何操作的场合、通常目标相同的对象所配置。
# 对象…[0=自身] [1=目标] [2=敌全体] [3=我方全体] [4=敌我方全体] [5=第二个目标]
# INDEX…对象队伍的指数(排列顺序)在选择。 INDEX = [指数, 判別]
# 指数…指数数値
# 判別…数值条件 [0=没有缩小] [1=对象指数] [2=该指数排除]
# ID…对象角色(敌人)ID进入选择ID的数字。0是选择不要
# 负增长的绝对值的ID会消除的条件
# 状态…对象当前增加状态ID进入选择状态ID的数字。0是选择不要
# 负增长的增加没有条件。
# 技能…对象可以使用的技能ID进入选择技能ID的数字。0是选择不要
# 负增长不可能使用的条件。
# 参数…对象的参数条件选择 参数 = [种别, 数值, 判別]
# 种别…[0=没有缩小] [1=Lv] [2=最大HP] [3=最大MP] [4=HP] [5=MP] [6=TP]
# [7=攻击力] [8=防御力] [9=魔法力] [10=魔法防御] [11=敏捷性] [12=幸运]
# 数值…种别决定一个数值。从最大值减去的百分比%(HP・MP・TP限定)
# 判別…数值的条件 [0=同样] [1=小于] [2=多于]
# 装备…对象装备品的条件选择。角色限定装备 = [种类, ID]
# 种类…[0=武器] [1=防具]
# ID…装备种别的条件项目ID一次性排列到[]里。0是选择不要
# 在下降为(防具)类型的。
# 扩张…扩张对象的设定 [0=没有扩张] [1=随机1体] [2=自身以外]
# 操作…[0=不操作] [1=通常目标和第二个目标变更] [2=第二个目标・通常目标初始化]
# 目标行动名 判別 对象 INDEX ID 状态 技能 参数 装备 扩张 操作
"自身以外我方全员"=> ["s_t", 3, [ 0, 0], 0, 0, 0, [ 0, 0, 0], [ 0,[0]], 2, 0],
"所有领域" => ["s_t", 4, [ 0, 0], 0, -1, 0, [ 0, 0, 0], [ 0,[0]], 0, 1],
#--------------------------------------------------------------------------
# ● 公共事件的呼叫
#--------------------------------------------------------------------------
# ID…公共事件ID
# ウエイト…运行中的事件,停止就true
#
# 公共事件设置名 判別 ID ウエイト
"公共事件No1" => ["common", 1, true],
#--------------------------------------------------------------------------
# ● 脚本的操作
#--------------------------------------------------------------------------
# 使动作被添加到建议的脚本中。样品p=1可以添加任何自己想要设置的脚本。
# 功能中、不能处理文字列。
#
# 脚本设置名
"脚本测试" => ["p = 1 "],
#--------------------------------------------------------------------------
# ● 其它 没有设定项目的完整动作放进这
#--------------------------------------------------------------------------
# 战斗角色消除…显示战斗动画消除(飞行动画被消除)
# 强制战斗结束…战斗强制结束
# 画面固定…让游戏画面固定。放进过渡前
# 伤害动画…技能动画播放、就在结束之前伤害POP
# 反转…武器图像动画反转。反转结束时的完全版或动作再次反转它
# 武器消除…显示武器图像消除
# 武器消除解除…消除要显示的武器图像
# 敌人战斗不能…实行战斗不能效果。主要敌人使用的战斗不能
# 战斗不能禁止…对象的HP是0的场合的禁止战斗不能。连续攻击开始时等
# 战斗不能禁止解除…禁止解除战斗不能。连续攻击的结束。工作结束时允许战斗不能。
# 待机取消…待机动作将不执行。战斗动作中演出等
# 待机消除解除…待机取消解除、进行等待动作
# 初期位置变更…原本的坐标(初期位置)目前的坐标变更
# 初期位置变更解除…初期位置变更改变其正常恢复原状。
# 强制…下次的行动强制目标(反应)
# 强制2…下次的行动强制第二个目标(反应)
# 下个行动者…战斗结束认定、之后的角色都采取行动。
# 个别开始…复数目标单独攻击处理的场合、重复行动开始的标记
# 个别结束…复数目标单独攻击处理的场合、重复行动结束的标记
# 循环开始…"循环开始"和"循环结束"的之间的动作一直重复
# 循环结束…"循环开始"和"循环结束"的之间的动作一直重复
# 目标动作名 判別
"战斗角色消除" => ["anime_off"],
"强制战斗结束" => ["battle_end"],
"画面固定" => ["graphics_freeze"],
"伤害动画" => ["damage_anime"],
"反转" => ["mirror"],
"武器消除" => ["weapon_off"],
"武器消除解除" => ["weapon_on"],
"敌人战斗不能" => ["normal_collapse"],
"战斗不能禁止" => ["no_collapse"],
"战斗不能禁止解除" => ["collapse"],
"待机取消" => ["non_motion"],
"待机取消解除" => ["non_motion_cancel"],
"初期位置变更" => ["change_base_position"],
"初期位置变更解除" => ["set_base_position"],
"强制" => ["force_action"],
"强制2" => ["force_action2"],
"下个行动者" => ["next_battler"],
"个别开始" => ["individual_start"],
"个别结束" => ["individual_end"],
"循环开始" => ["loop_start"],
"循环结束" => ["loop_end"],
#--------------------------------------------------------------------------
# ● 等待 下一个动作而不需要等待的时间
#--------------------------------------------------------------------------
# 在动作数值的场合、时间和等待
# (例) "20" …下一个动作不需要等待20帧
#
# 负增长数值将成为随机等待、这个数值的0~绝对值之间
# 随机等待时间的决定。
# (例) "-20" …随机等待0-20帧
#--------------------------------------------------------------------------
# ● 快捷命令
#--------------------------------------------------------------------------
# 动作名通常设定全部动作排列放到行动制作里
# 动作设定没有记载了指令、可以减少一些工作
# 经常使用让你在过去的快捷方式使用和登记动作没有增加。
#
# [战斗动画]
# (例) "anime(20)" …实行数据库20号的动画目标(有等待)
# (例) "anime(20,false)" …实行数据库20号的动画目标(无需等待)
# (例) "anime_me(20)" …实行数据库20号的动画自身(有等待)
# (例) "anime_me(20,false)" …实行数据库20号的动画自身(无需等待)
#
# [等待 延迟指数] ※独立队伍等待延迟
# (例) "delay(12)"…指数1号的等待是0帧 2号的等待是12帧 3号的等待是24帧
#
# [効果音(SE)]
# (例) "se('Bow1')" …文件名Bow1的SE按响了
# (例) "se('Bow1',50)" …文件名Bow1的SE音调50按响了
#
# [目标动作(全部动作)强制]
# (例) "target('伤害弯向后')" …目标伤害强制操作
# (例) "target2('被伤害')" …第二个目标被伤害的强制全部动作
}
#==============================================================================
# ■ 完整动作
#------------------------------------------------------------------------------
# 将上边的行动动作组合起来、这里是实际做出的动作。
# 这里的完整动作名将是下面主人公或者敌方所指定用的。
# 条件分岐的下一个完整动作、为方便使用放在这。
#==============================================================================
FULLACTION = {
# ―――待机系―――
"通常待机" => ["待机"],
"通常待机固定" => ["待机固定WT"],
"消减待机" => ["状态异常/消减","消减色调","待机","待机"],
"防御待机" => ["待机固定WT"],
"毒待机" => ["状态异常/通用","毒色调","待机","待机","敌人限定","80"],
"睡眠待机" => ["状态异常/睡眠","敌人限定","40","敌人停止","倒下","倒下"],
"通用状态异常待机"=> ["状态异常/通用","通用状态异常色调","待机","待机","敌人限定","80"],
"观望" => ["待机","60"],
"战斗不能" => ["倒下"],
# ――系统系――
"战斗开始我方" => ["战斗前的我方配置","delay(4)","坐标左向复位"],
"我方退场" => ["退场"],
"逃走" => ["对象动画","重置相机","delay(4)","退场"],
"敌人逃走" => ["对象动画","逃走透明","退场"],
"逃走失败" => ["重置相机","delay(4)","逃走途中","一歩后移动","坐标左向复位"],
"指令输入" => ["战斗角色消除","指令输入移动"],
"指令输入结束" => ["初期目标复位"],
"指令后防御" => ["待机固定WT"],
"指令后魔法" => ["待机固定","魔法吟唱中"],
"指令后特技" => ["待机固定","特技待机中"],
"防御" => ["对象动画","待机固定WT"],
"回避" => ["角色限定","右1旋转","一歩后跳跃","10","坐标左向复位"],
"盾护罩" => ["se('Evasion2')","盾防御","60"],
"代替开始" => ["初期敌移动","初期位置变更"],
"代替结束" => ["初期位置变更解除","坐标左向复位"],
"被代替开始" => ["一歩后移动","一歩后移动","待机固定WT"],
"被身代替结束" => ["坐标左向复位"],
"胜利姿态挥动" => ["战斗角色消除","胜利武器跳转","胜利跳转着地","120"],
"胜利摆的姿态" => ["战斗角色消除","右1旋转","胜利跳转","拳限定","武器拳抛掷","拳禁止",
"武器挥动R","120"],
"闪光" => ["anime_me(119)","20"],
# ―反应系―
"被伤害" => ["伤害后弯向后","坐标左向复位"],
"被大伤害" => ["摇动中","大伤害","坐标左向复位"],
"纵摇动" => ["纵摇动01","纵摇动02","纵摇动01","纵摇动02","纵摇动01","纵摇动02"],
# ―捷径系(从其他全面的行动被称为零件)―
"斩杀" => ["武器挥动R","对象动画武器","10"],
"拳" => ["武器拳抛掷","对象动画武器","10"],
"弓" => ["Bow1","弓射击","箭头射击","9"],
"攻击" => ["拳限定","拳","弓限定","弓","拳弓禁止","斩杀"],
"通常攻击开始" => ["敌前移动","战斗不能禁止","个别开始","二刀流限定","左二刀"],
"通常攻击结束" => ["死亡确认","对象动画武器WT","个别结束","战斗不能禁止解除","下个行动者",
"坐标曲线重置"],
"左二刀" => ["武器挥动L","对象动画武器LWT"],
"特技启动" => ["一歩前移动","举起武器","特技启动动画"],
"魔法启动" => ["一歩前移动","举起武器","魔法启动动画"],
"切入" => ["切入背景开始","切入分岐","70","切入结束","切入背景结束",
"20"],
"切入分岐" => ["角色ID1限定","切入A1","角色ID2限定","切入A2",
"角色ID6限定","切入A3","角色ID7限定","切入A4"],
"死亡标记动画" => ["白色淡入","50","死亡标记电影","白色淡出","50"],
"背景宇宙" => ["缩小","se('Blind',70)","昏暗的背景","自身以外我方全员",
"强制2","透明化","透明化","40","背景宇宙变更","色调初始化"],
"背景宇宙的解除" => ["重置相机","昏暗的背景","target2('透明化解除WT')","透明化解除",
"40","背景宇宙解除","色调初始化"],
"魔法阵显示" => ["se('Blind',70)","画面固定","魔法阵ON","圈"],
"魔法阵消除" => ["40","画面固定","魔法阵OFF","圈"],
# ――通常攻击系――
"通常攻击" => ["通常攻击开始","待机固定","通常攻击结束"],
"斩杀攻击" => ["通常攻击开始","死亡确认","武器挥动R","通常攻击结束"],
"拳攻击" => ["通常攻击开始","武器拳抛掷","通常攻击结束"],
"抛掷攻击" => ["通常攻击开始","武器抛掷","通常攻击结束"],
"弓攻击" => ["一歩前移动","战斗不能禁止","个别开始","Bow1","弓射击",
"箭头射击WT","个别结束","战斗不能禁止解除","坐标重置"],
# ――技能系―――
"通用技能" => ["特技启动","武器挥动R","伤害动画","坐标重置"],
"通用魔法" => ["魔法启动","武器挥动R","伤害动画","坐标重置"],
"水铁炮" => ["特技启动","武器挥动R","水铁炮射击","坐标重置"],
"武器抛出" => ["特技启动","Bow1","武器挥动R","6","待机固定","武器开始抛出",
"武器抛出返回","坐标重置"],
"切入攻击" => ["特技启动","切入","攻击","坐标重置"],
"电影攻击" => ["特技启动","待机固定","死亡标记动画","通常攻击开始","武器挥动R",
"通常攻击结束"],
"变身" => ["特技启动","anime(110,false)","灰太狼变身","待机固定","120","坐标重置"],
"5回攻击" => ["特技启动","战斗不能禁止","弓禁止","敌前移动","攻击","攻击","攻击",
"攻击","攻击","战斗不能禁止解除","坐标重置"],
"技能连发" => ["武器抛出","多段攻击连发","斩杀攻击"],
"背景变更攻击" => ["魔法启动","武器挥动R","背景宇宙","伤害动画","背景宇宙的解除","坐标重置"],
"图像攻击" => ["魔法启动","魔法阵显示","武器挥动R","anime(80,false)","60",
"摇动大","对象动画","魔法阵消除","坐标重置"],
"昏暗攻击" => ["特技启动","自身和目标以外昏暗","se('Laser',150)",
"残像ON","敌前移动","anime(35,false)","敌后移动","对象动画",
"武器挥动R","20","色调初始化","坐标重置","残像OFF"],
"空中攻击" => ["特技启动","Bow1","一歩前跳跃","跳前拍击",
"待机固定","左1旋转","10","anime(117,false)","拍击",
"对象动画","摇动中","强制","纵摇动","20",
"一歩后跳跃","坐标重置"],
# ――项目系―――
"物品使用" => ["敌前移动","待机固定","对象动画WT","坐标左向复位"],
}
#==============================================================================
# ■ 战斗程序
#------------------------------------------------------------------------------
# 战斗场景的演出时间管理
# 控制游戏开关・侧面图专用按钮来进行
#==============================================================================
BATTLE_PROGRAM = {
#--------------------------------------------------------------------------
# ● 开关的控制 开关的时间操作、演出编程
#--------------------------------------------------------------------------
# 开关…实行游戏开关号码的程序。号码将只打开侧视图
# 当开关OFF、正在实行的程序将被中止
# 战斗结束时侧视图专用开关将被初始化(全部OFF)
# 在事件战斗前侧视图专用开关操作的场合。请把
# 在事件脚本写上$sv_camera.switches[1] = true
# [1]操作的开关号码、如果ON就true 如果OFF就false)
# ON号码…假设游戏开关号码为OFF时。号码将只打开侧视图
# 号码一次性排列到里面。
# 例…[1,2,-5]游戏开关1号2号侧视图专用开关5号是ON
# OFF号码…假设游戏开关号码为OFF时。号码将只打开侧视图
# 不能操作的场合的号码一次性排列到[]里
# 时间…以上的开关来实行该操作的时间。单位帧(1/60秒))
# 例100的场合、开关操作从程序开始后进行100帧
# [参考数值] 30秒…1800 1分…3600 5分…18000 10分…36000 1時間…216000
# 随机宽度…随机宽度的时间被添加。单位帧(1/60秒)
# 例时间是300、时间是300-600帧,最终它的随机宽度为300
# 程序名 判別 开关 ON号码 OFF号码 时间 随机宽度
"背景堡垒" => ["switch", -1, [-2], [], 1200, 0],
"背景入海" => ["switch", -2, [-3], [], 2400, 0],
#--------------------------------------------------------------------------
# ● SE/BGM/BGS的演奏
#--------------------------------------------------------------------------
# 开关…实行游戏开关号码的信号。负面仅查看开关。
# 种別…SE的操作为"se" BGM的操作为"bgm" BGS的操作为"bgs"
# 速度…速度。50~150之间指定的最多 不管哪个都要默认为100。
# 音量…音量。50~150之间指定的指定 不管哪个都要默认为100。
# 文件名…播放的文件名。""时不改变任何BGM和BGS的设定。
# 程序名 判別 开关 种别 速度 音量 文件名
"海声" => ["sound", -1, "bgs", 100, 80, "Sea"],
#--------------------------------------------------------------------------
# ● 背景的控制 画像变更自动进行滚动
#--------------------------------------------------------------------------
# 开关…实行开关号码的信号
# No.…操作背景的号码。1地背景、2墙壁背景(远景)
# 滚动速度…背景的移动速度。[X轴, Y轴]
# 单位每100帧前往像素数。
# 当在高速移动的场合、1000是一个标准的单位数值
# BA反转…偷袭时背景的X坐标滚动如果反转就true 图像不反转
# 图像…背景图像变更的場合、放进文件的文件名。不变更的场合""
# 地背景Battlebacks1文件夹里、壁背景参考该Battlebacks2文件夹
# 设定想变更的背景、变更前的继承
# 联合图像…背景滚动时、背景变更自然显示的联合图像文件名
# 滚动途中进行背景变更的场合、滚动结束后进行变更。
# 性质上、不对应与斜滚动
# 打断…出现这种行为时的背景能够控制的情况下
# 如果允许打断就true(在显示图像,延续滚动的情况下的打断背景)
# 如果不允许打断就false(另一个背景控制处于正在等待处理的背景消失进行了变更时)
# 程序名 判別 开关 No. 滚动速度 BA反转 图像 联合图像 打断
"远景右移动" => ["scroll", -1, 1, [ 40, 0], true, "", "", true],
"海背景3变更" => ["scroll", -2, 1, [ 120, 0], true, "Sea_ex03", "Sea_ex02", true],
"海背景4变更" => ["scroll", -3, 1, [ 40, 0], true, "Sea_ex01", "Sea_ex04", true],
"背景宇宙变更1" => ["scroll", -4, 1, [ 0, 0], true, "DarkSpace", "", false],
"背景宇宙变更2" => ["scroll", -4, 2, [ 0, 0], true, "DarkSpace", "", false],
#--------------------------------------------------------------------------
# ● 期间的图片 期间的瓷砖状的一幅画操作。风或巨大魔方阵等
#--------------------------------------------------------------------------
# 开关…实行开关号码的信号
# No.…操作的图像数。可以显示许多图片
# 移动速度…每100帧图片移动的速度。[X轴, Y轴] 0与滚动背景同步
# 期间…改程序进行的时间。单位帧(1/60秒)。时间0表示无限制的循环
# 透明操作…图片的透明度操作。[开始透明度, 每秒100帧添加到的透明度]
# 透明度255成为开始透明度到备份。
# Z轴…图片的Z坐标。100以上如果它被显示在窗口的前面
# 允许摇动…攻击动作摇动、如果允许摇动就true
# BA反转…偷袭时背景的X坐标滚动如果反转就true 图像不反转
# 文件名…图像的文件名。图像放到Pictures文件夹中
# 程序名 判別 开关 No. 移动速度 期间 透明操作 Z轴 允许摇动 BA反转 文件名
"风" => ["kpic", -1, 0, [ 500, 0], 0, [ 255, 0], 90, false, true, "back_wind"],
"魔法阵" => ["kpic", -5, 1, [ 0, 0], 0, [ 255, 0], 90, true, true, "magic_square01"],
#--------------------------------------------------------------------------
# ● 期间SE 期间的效果音响起了。如雷轰潮骚
#--------------------------------------------------------------------------
# 开关…实行开关号码的信号 开始进行就是ON
# 期间…効果音响起的期间。单位帧(1/60秒)。在此间隔中效果音定期听到
# 随机宽度…随机宽度的期间被添加。单位帧(1/60秒)
# 速度…速度。50~150之间指定的最多 不管哪个都要默认为100。
# 音量…音量。50~150之间指定的指定 不管哪个都要默认为100。
# 开始实行…实行程序之后无需等待的期间内响起就true
# 文件名…播放效果音文件名。
# 程序名 判別 开关 期间 随机宽度 速度 音量 开始实行 文件名
"鸥" => ["keep_se", -1, 400, 100, 150, 60, false, "Crow"],
"鸥2" => ["keep_se", -1, 300, 200, 140, 45, true, "Crow"],
#--------------------------------------------------------------------------
# ● 期间移动 期间的画面摇动
#--------------------------------------------------------------------------
# 开关…实行开关号码的信号。开始进行就是ON
# 期间…画面摇动期间。单位帧(1/60秒)
# 随机宽度…随机宽度的期间被添加。单位帧(1/60秒)
# 方向…摇动的方向 [横,纵] 数字越大摇晃范围将扩大。
# 速度…摇动的速度。规模较小的摇动就快。
# 時間…摇动的持续时间。振动宽度随着时间一起弱
# 开始实行…实行程序之后无需等待的期间内摇动就true
# 程序名 判別 开关 期间 随机宽度 方向 速度 时间 开始实行
"船的摇动" => ["keep_sk", -1, 130, 0, [ 0, 4], 80, 120, true],
#--------------------------------------------------------------------------
# ● 期间色调变更 期间的画面的色调变更
#--------------------------------------------------------------------------
# 开关…实行开关号码的信号。开始进行就是ON
# 期间…色调变更期间。单位帧(1/60秒)
# 随机宽度…随机宽度的期间被添加。单位帧(1/60秒)
# 对象…色调变更的对象 [0=背景] [1=敌全] [2=我方全] [3=敌我方全] [4=所有]
# 色调水平…[ R, G, B分别是红、绿、蓝。最初(色调强度), 变更时间, ※返回]
# ※返回…变更结束返回颜色的时间。不返回就0
# 开始实行…实行程序之后无需等待的期间内色调变更就true
# 程序名 判別 开关 期间 随机宽度 对象 R, G, B, 最初 时间 返回 开始实行
"雷光" => ["keep_c", 0, 300, 100, 4, [ 255, 255, 255, 255, 8, 8], true],
"紧急情况" => ["keep_c", 0, 150, 0, 4, [ 255, 0, 0, 100, 40, 40], true],
}
#==============================================================================
# ■ 相机设定
#------------------------------------------------------------------------------
# 除了行动和战斗场面的每个要点,进行摄影的工作
# 动作名由于相机移动、请不要变更名称
#==============================================================================
BATTLE_CAMERA = {
#--------------------------------------------------------------------------
# ● 摄影的工作 画面进行的缩放和滚动
#--------------------------------------------------------------------------
# 对象…移动和缩放的对象 [2=敌全] [3=我方全] [4=敌我方全] [6=画面]
# 调整坐标…微调整相机坐标的最后地点 [X轴(正画面→), Y轴(正画面↓)]
# 时间…摄影的工作所花费的时间
# 放大…相机的放大率(%)。放大没有100。
# 目标动作名 判別 对象 调整坐标 放大 时间
"顺序开始前" => ["camera", 6, [ 40, 0], 95, 40],
"顺序开始后" => ["camera", 6, [ 0, 0], 100, 40],
"战斗结束时" => ["camera", 6, [ 100, 0], 100, 50],
}
end
橫版 #============================================================================== # ■ Sideview Ver100 #------------------------------------------------------------------------------ # 管理角色侧视图战斗设定。 # 汉化by: 圣痕 #============================================================================== class SideView #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_accessor :x # 画面X坐标 attr_accessor :y # 画面Y坐标 attr_accessor :z # 画面Z坐标 attr_accessor :h # 高度坐标 attr_accessor :j # 跳跃坐标 attr_accessor :c # 曲线坐标 attr_accessor :ox # 横原点 attr_accessor :oy # 纵原点 attr_accessor :oy_adjust # 縦原点修正 attr_accessor :angle # 旋转角度 attr_accessor :zoom_x # 横扩大率 attr_accessor :zoom_y # 纵扩大率 attr_accessor :pattern_w # 细胞横位置(矩形内) attr_accessor :pattern_h # 细胞縦位置(矩形内) attr_accessor :sx # 细胞横位置(画像全体) attr_accessor :sy # 细胞縦位置(画像全体) attr_accessor :pattern_type # 单元更新类型 attr_accessor :pattern_time # 单元更新间隔 attr_accessor :graphic_name # 角色画像文件名 attr_accessor :graphic_file_index # 角色画像文件名指数 attr_accessor :graphic_index # 角色画像指数 attr_accessor :cw # 矩形横组件 attr_accessor :ch # 矩形纵组件 attr_accessor :shadow_visible # 阴影表示 attr_accessor :weapon_visible # 武器表示 attr_accessor :wait # 下一个动作等待时间 attr_accessor :weapon_index # 显示图像的武器排列指数 attr_accessor :weapon_end # 武器动画结束标记 attr_accessor :force_action # 強制动作 attr_accessor :target_battler # 目标角色情報 attr_accessor :second_targets # 第二个目标角色情報 attr_accessor :m_a_targets # 飞行动画目标情報 attr_accessor :individual_targets # 个别处理目标角色情报 attr_accessor :effect_data # 效果数据 attr_accessor :anime_id # 动画ID配列 attr_accessor :anime_move_id # 飞行动画ID配列 attr_accessor :mirror # 反转标志 attr_accessor :opacity # 透明度 attr_accessor :opacity_data # 透明度操作情报 attr_accessor :set_damage # 战斗场景的损伤处理 attr_accessor :m_a_data # 飞行动画情报 attr_accessor :m_a_starter # 飞行动画开始目标情报 attr_accessor :action_end # 行动后结束 attr_accessor :damage_anime_data # 战斗损伤动画的数据 attr_accessor :anime_no_mirror # 战斗动画禁止反转 attr_accessor :anime_horming # 战斗动画归位标志 attr_accessor :anime_camera_zoom # 战斗动画扩大缩小的相机 attr_accessor :anime_plus_z # 战斗动画Z坐标修正 attr_accessor :derivation_skill_id # 技能连发ID attr_accessor :immortal # 无敌标志 attr_accessor :mirage # 残像数据 attr_accessor :balloon_data # 气球数据 attr_accessor :timing # 从角色不同的时序数据 attr_accessor :timing_targets # 时间数据传递另个角色 attr_accessor :color_set # 色调变更数据 attr_accessor :color # 色调数据 attr_accessor :change_up # 画像变更数据 attr_accessor :hit # 更加次数 attr_accessor :add_state # 增加状态的显示防止标记 attr_accessor :counter_id # 计数器时的技能ID attr_accessor :reflection_id # 魔法反射式的动画ID attr_accessor :result_damage # 回合结束时的HP数据变更 attr_accessor :active # 行动权 attr_accessor :anime_off # 战斗动画删除 attr_accessor :command_action # 行动指令标志 attr_accessor :base_x # 初期位置 X坐标 attr_accessor :base_y # 初期位置 Y坐标 attr_accessor :base_h # 初期位置 高度坐标 attr_accessor :max_pattern_w # 单元的横分割数 attr_accessor :max_pattern_h # 单元的纵分割数 attr_reader :collapse # 角色战斗不能 attr_reader :picture # 图片显示标记 #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- def initialize(battler) [url=home.php?mod=space&uid=133701]@battler[/url] = battler reset end #-------------------------------------------------------------------------- # ● 初始化 #-------------------------------------------------------------------------- def reset @x = 0 @y = 0 @z = 0 @h = 0 @j = 0 @c = 0 [url=home.php?mod=space&uid=271873]@jump[/url] = [] @curve = [] @ox = 0 @oy = 0 @oy_adjust = 0 @z_plus = 0 @move_time = 0 [url=home.php?mod=space&uid=124954]@Angle[/url] = 0 @angle_time = 0 @zoom_x = 1 @zoom_y = 1 @zoom_time = 0 @pattern_w = 0 @pattern_h = 0 @sx = 0 @sy = 0 @pattern_type = 0 @pattern_time = 0 @pattern_rest_time = 0 @graphic_name = "" @graphic_file_index = "" @graphic_index = 0 @cw = 0 @ch = 0 @shadow_visible = false @weapon_visible = true [url=home.php?mod=space&uid=36110]@Wait[/url] = 0 @weapon_index = [] @weapon_end = true @full_action = [] @action = [] @force_action = "" @target_battler = [] @second_targets = [] @individual_targets = [] @m_a_targets = [] @effect_data = [] @anime_id = [] @anime_move_id = [] [url=home.php?mod=space&uid=316553]@opacity[/url] = 255 @opacity_data = [] @set_damage = false @m_a_data = [] @m_a_starter = [] @action_end = false @damage_anime_data = [] @anime_no_mirror = false @anime_horming = false @anime_camera_zoom = false @anime_plus_z = true @derivation_skill_id = 0 @immortal = false @mirage = [] @play_data = [] @balloon_data = [] @picture = false @timing = [] @timing_targets = [] @color_set = [] [url=home.php?mod=space&uid=10453]@color[/url] = [] @change_up = false @non_motion = false @graphics_change = false @hit = [] @add_state = [] @collapse = false @counter_id = 0 @reflection_id = 0 @result_damage = [0,0] @active = false @anime_off = false @command_action = false @base_x = 0 @base_y = 0 @base_z = 0 @base_h = 0 @max_pattern_w = 0 @max_pattern_h = 0 @pattern_kind = 0 @pattern_count = 0 @move_time = 0 [url=home.php?mod=space&uid=111303]@mirror[/url] = false @battler.set_graphic(@pre_change_data[0], @pre_change_data[1], @pre_change_data[2], @pre_change_data[3]) if @pre_change_data != nil @pre_change_data = nil end #-------------------------------------------------------------------------- # ● 格局 #-------------------------------------------------------------------------- def setup(bitmap_width, bitmap_height, first_action_flag) reset if first_action_flag set_data set_base_position if !@graphics_change set_graphics(bitmap_width, bitmap_height) set_target setup_graphics_change if @graphics_change first_battler_anime_set if first_action_flag end #-------------------------------------------------------------------------- # ● 取得角色数据 #-------------------------------------------------------------------------- def set_data return if @battler == nil if @battler.actor? @graphic_name = @battler.character_name @graphic_index = @battler.character_index else @graphic_name = @battler.battler_name @graphic_index = 0 end @max_pattern_w = max_pattern[0] @max_pattern_h = max_pattern[1] end #-------------------------------------------------------------------------- # ● 基础坐标设置 data=[X轴, Y轴, H轴] moment_set…即时配置 #-------------------------------------------------------------------------- def set_base_position(moment_set = true) mirroring_reset if @battler.actor? && !@battler.is_a?(Game_Summon) data = N03::ACTOR_POSITION[@battler.index].dup @base_x = data[0] * 100 if !@mirror @base_x = (Graphics.width - data[0]) * 100 if @mirror else data = [@battler.screen_x, @battler.screen_y, 0].dup @base_x = data[0] * 100 if !$sv_camera.mirror @base_x = (Graphics.width - data[0]) * 100 if $sv_camera.mirror end if @battler.is_a?(Game_Summon) #如果是召喚獸 則設定召喚獸座標 if @battler.actor_id < 16 #如果不是動物 data = N03::SUMMON_POSITION[$fu_wan_actor.index].dup #位置為召喚者前方#SUMMON_POSITION陣列 else p "動物" data = N03::ANIMAL_POSITION[$fu_wan_actor.index].dup end @base_x = data[0] * 100 if !@mirror @base_x = (Graphics.width - data[0]) * 100 if @mirror end @base_y = data[1] * 100 @base_h = data[2] * 100 @base_z = @y return if !moment_set @x = @base_x @y = @base_y @z = @base_z end #-------------------------------------------------------------------------- # ● 取得图像数据 #-------------------------------------------------------------------------- def set_graphics(bitmap_width, bitmap_height) sign = @graphic_name[/^[\!\$]./] if sign && sign.include?('$') @cw = bitmap_width / @max_pattern_w @ch = bitmap_height / @max_pattern_h elsif @max_pattern_w == 1 && @max_pattern_h == 1 @cw = bitmap_width @ch = bitmap_height else @cw = bitmap_width / (@max_pattern_w * 4) @ch = bitmap_height / (@max_pattern_h * 2) end @ox = @cw / 2 @oy = @ch @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch end #-------------------------------------------------------------------------- # ● 设定目标 #-------------------------------------------------------------------------- def set_target(target = nil) @target_battler = target @target_battler = [@battler] if target == nil @second_targets = @target_battler end #-------------------------------------------------------------------------- # ● 设置图像的变更 #-------------------------------------------------------------------------- def setup_graphics_change @graphics_change = false @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch end #-------------------------------------------------------------------------- # ● 取得战斗开始时的待机动画图像数据 #-------------------------------------------------------------------------- def first_battler_anime_set loop do update break if @action_data == nil break if @action_data[0] == "motion" break if @action_data[0] == "move" && @action_data[8] != "" break if @full_action == [] end start_action(first_action) if @battler.movable? end #-------------------------------------------------------------------------- # ● 开始动作 #-------------------------------------------------------------------------- def start_action(kind = nil) return if @event_fix && $game_troop.interpreter.running? # 等待中的场合取消 return @wait -= 1 if @wait > 0 && kind == nil action_setup(false) if kind != nil set_action(kind) @action = kind if @action == nil # 动作顺序行动结束处理转变 action_terminate if @action == nil # 决定下一个动作 @action_data = N03::ACTION[@action] next_action end #-------------------------------------------------------------------------- # ● 初始化行动参数 #-------------------------------------------------------------------------- def action_setup(reset = true) @event_fix = false @set_damage = false @action_end = false @balloon_data = [] @loop_act = [] angle_reset if reset zoom_reset if reset opacity_reset if reset @curve = [] @c = 0 convert_jump end #-------------------------------------------------------------------------- # ● 行动结束的处理 #-------------------------------------------------------------------------- def action_terminate @mirage = [] if @mirage_end mirroring_reset @picture = false @individual_targets = [] action_setup if @active action_setup(false) if !@active # 待机开始行动迁移 stand_by_action if !@non_motion # 战斗行动激活结束权利 next_battler end #-------------------------------------------------------------------------- # ● 新动作内容的決定 #-------------------------------------------------------------------------- def set_action(kind = nil) full_act = N03::FULLACTION[kind] @full_action = full_act.dup if full_act != nil @action = @full_action.shift # 参考全部动作如果全部动作统合 full_act2 = N03::FULLACTION[@action] @full_action = full_act2.dup + @full_action if full_act2 != nil end #-------------------------------------------------------------------------- # ● 采取下个行动 #-------------------------------------------------------------------------- def next_action @wait = 0 # 捷径确认 eval(@action) if @action != nil && @action_data == nil && N03::FULLACTION[@action] == nil # 体能设定 @wait = @action.to_i if @wait == 0 && @action_data == nil @wait = rand(@wait.abs + 1) if @wait < 0 # 开始动作 action_play end #-------------------------------------------------------------------------- # ● 待机开始动作迁移 #-------------------------------------------------------------------------- def stand_by_action # 通常待机 stand_by_act = normal # HP的1/4紧要关头行动 stand_by_act = pinch if @battler.hp <= @battler.mhp / 4 # 状态检查 stand_by_act = state(@battler.states[0].id) if @battler.states[0] != nil && state(@battler.states[0].id) != nil # 指令检查 stand_by_act = command if @command_action && command != nil set_action(stand_by_act) @action = stand_by_act if @action == nil end #-------------------------------------------------------------------------- # ● 开始强制动作 #-------------------------------------------------------------------------- def start_force_action return if @active start_action(@force_action) @force_action = "" end #-------------------------------------------------------------------------- # ● 追加动作 #-------------------------------------------------------------------------- def add_action(kind) @full_action.push(kind) end #-------------------------------------------------------------------------- # ● 插入动作 #-------------------------------------------------------------------------- def unshift_action(kind) @full_action.unshift(kind) end #-------------------------------------------------------------------------- # ● 更新帧数 #-------------------------------------------------------------------------- def update # 开始动作 start_action # 开始强制动作 start_force_action if @force_action != "" # 更新动画模式 update_pattern # 更新移动 update_move # 更新旋转 update_angle if @angle_time != 0 # 更新扩大缩小 update_zoom if @zoom_time != 0 # 更新透明度 update_opacity if @opacity_data != [] end #-------------------------------------------------------------------------- # ● 更新动画模式 #-------------------------------------------------------------------------- def update_pattern return @pattern_rest_time -= 1 if @pattern_rest_time != 0 return if @max_pattern_w == 1 && @max_pattern_h == 1 @pattern_rest_time = @pattern_time # 开始播放・取得结束单元位置 if @pattern_kind > 0 # 通常播放中 @pattern_start = 0 @pattern_end = @max_pattern_w - 1 elsif @pattern_kind < 0 # 逆转播放中 @pattern_start = @max_pattern_w - 1 @pattern_end = 0 end # 结束单程的播放 @pattern_count += 1 if @pattern_w == @pattern_end && @pattern_kind != 0 # 循环处理 case @pattern_type.abs when 1,3 # 单程 @pattern_kind = 0 if @pattern_count != 0 && @pattern_type == 1 @pattern_kind = 0 if @pattern_count != 0 && @pattern_type == -1 @pattern_kind = 1 if @pattern_count != 0 && @pattern_type == 3 @pattern_kind = -1 if @pattern_count != 0 && @pattern_type == -3 @pattern_w = @pattern_start - @pattern_kind if @pattern_count != 0 && @pattern_type.abs == 3 @pattern_count = 0 when 2,4 # 往返 @pattern_kind = -1 if @pattern_count == 1 && @pattern_type == 2 @pattern_kind = 1 if @pattern_count == 1 && @pattern_type == -2 @pattern_kind = 0 if @pattern_count == 2 && @pattern_type == 2 @pattern_kind = 0 if @pattern_count == 2 && @pattern_type == -2 @pattern_kind = -1 if @pattern_count == 1 && @pattern_type == 4 @pattern_kind = 1 if @pattern_count == 1 && @pattern_type == -4 @pattern_kind = 1 if @pattern_count == 2 && @pattern_type == 4 @pattern_kind = -1 if @pattern_count == 2 && @pattern_type == -4 @pattern_count = 0 if @pattern_count == 2 end # 更新单元 @pattern_w += 1 * @pattern_kind @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw end #-------------------------------------------------------------------------- # ● 更新移动 #-------------------------------------------------------------------------- def update_move @z = @y / 100 + @z_plus return if @move_time == 0 target_position_set if @horming_move @x = (@x * (@move_time - 1) + @target_x) / @move_time @y = (@y * (@move_time - 1) + @target_y) / @move_time @h = (@h * (@move_time - 1) + @target_h) / @move_time if @move_h != nil @c += @curve[@move_time - 1] if @curve[@move_time - 1] != nil @j += @jump[@move_time - 1] if @jump[@move_time - 1] != nil @move_time -= 1 convert_jump if @move_time == 0 end #-------------------------------------------------------------------------- # ● 更新移动目标 #-------------------------------------------------------------------------- def target_position_set target_position = N03.get_targets_position(@move_targets, @horming_move) @target_x = target_position[0] + @move_x @target_y = target_position[1] + @move_y @target_h = target_position[2] + @move_h if @move_h != nil end #-------------------------------------------------------------------------- # ● 更新旋转 #-------------------------------------------------------------------------- def update_angle @angle += @angling @angle_time -= 1 return if @angle_time != 0 return angle_reset if @angle_data[4] == 0 angling(@angle_data) if @angle_data[4] == 2 end #-------------------------------------------------------------------------- # ● 更新扩大缩小 #-------------------------------------------------------------------------- def update_zoom @zoom_x += @zooming_x @zoom_y += @zooming_y @zoom_time -= 1 return if @zoom_time != 0 return zoom_reset if @zoom_data[4] == 0 zooming(@zoom_data) if @zoom_data[4] == 2 end #-------------------------------------------------------------------------- # ● 更新透明度 #-------------------------------------------------------------------------- def update_opacity @opacity += @opacity_data[2] @opacity_data[0] -= 1 return if @opacity_data[0] != 0 return if !@opacity_data[5] @opacity_data[2] *= -1 @opacity_data[0] = @opacity_data[1] end #-------------------------------------------------------------------------- # ● 实行动作 #-------------------------------------------------------------------------- def action_play return if @action_data == nil action = @action_data[0] # 战斗角色反转的场合 return mirroring if action == "mirror" # 残像的场合 return mirage_set if action == "mirage" # 回转的场合 return angling if action == "angle" # 扩大缩小的场合 return zooming if action == "zoom" # 透明度操作的场合 return set_opacity if action == "opacity" # 战斗角色动画的場合 return battler_anime if action == "motion" # 移动的場合 return move if action == "move" # 武器动画的場合 return weapon_anime([@action_data]) if action == "wp" # 跳过动画的場合 return move_anime if action == "m_a" # 战斗场景通讯的场合(战斗不能) return set_play_data if action == "collapse" or action == "no_collapse" # 显示战斗数据库的动画的場合 return battle_anime if action == "anime" # 摄影的場合 return camera if action == "camera" # 画面摇动的場合 return shake if action == "shake" # 画面色调变更的場合 return color_effect if action == "color" # 过渡的場合 return transition if action == "ts" # 气球动画显示的場合 return balloon_anime if action == "balloon" # 图片显示的場合 return picture_set if action == "pic" # 状态操作的場合 return state_set if action == "sta" # FPS变更的場合 return fps if action == "fps" # 战斗角色图像变更的場合 return graphics_change if action == "change" # 技能衍生的場合 return derivating_skill if action == "der" # BGM/BGS/SE演奏的場合 return sound if action == "sound" # 电影再生的場合 return movie if action == "movie" # 游戏开关操作的場合 return switches if action == "switch" # 变量开关操作的場合 return variable if action == "variable" # 条件分岐(游戏开关)的場合 return nece_1 if action == "n_1" # 条件分岐(游戏变量)的場合 return nece_2 if action == "n_2" # 条件分岐(状态)的場合 return nece_3 if action == "n_3" # 条件分岐(技能)的場合 return nece_4 if action == "n_4" # 条件分岐(参数)的場合 return nece_5 if action == "n_5" # 条件分岐(装备)的場合 return nece_6 if action == "n_6" # 条件分岐(脚本)的場合 return nece_7 if action == "n_7" # 第二目标操作的場合 return second_targets_set if action == "s_t" # 呼叫公共事件的場合 return call_common_event if action == "common" # 战斗动画关闭的場合 return @anime_off = true if action == "anime_off" # 强制战斗结束的場合 return BattleManager.process_abort if action == "battle_end" # 画面固定的場合 return Graphics.freeze if action == "graphics_freeze" # 损坏动画的場合 return damage_anime if action == "damage_anime" # 武器不可见的場合 return @weapon_visible = false if action == "weapon_off" # 武器可见的場合 return @weapon_visible = true if action == "weapon_on" # 等待取消的場合 return @non_motion = true if action == "non_motion" # 等待取消解除的場合 return @non_motion = false if action == "non_motion_cancel" # 初期位置变更的場合 return change_base_position if action == "change_base_position" # 初期位置变更解除的場合 return set_base_position(false) if action == "set_base_position" # 强制行动的場合 return force_act if action == "force_action" # 强制行动的場合 (第二目标) return force_act2 if action == "force_action2" # 个人开始的場合 return individual_start if action == "individual_start" # 个人结束的場合 return individual_end if action == "individual_end" # 循环开始的場合 return loop_start if action == "loop_start" # 循环结束的場合 return loop_end if action == "loop_end" # 只有行动的場合 return only_action_on if action == "only_action_on" # 只有行动解除的場合 return only_action_off if action == "only_action_off" # 下个战斗角色的場合 return next_battler if action == "next_battler" # 画面变更标记的場合 return set_change if action == "set_change" # 脚本操作的場合 return eval(@action_data[0]) end #-------------------------------------------------------------------------- # ● 实行角色反转 #-------------------------------------------------------------------------- def mirroring @mirror = !@mirror end #-------------------------------------------------------------------------- # ● 初始化反转 #-------------------------------------------------------------------------- def mirroring_reset @mirror = false mirroring if !@battler.actor? && N03::ENEMY_MIRROR mirroring if $sv_camera.mirror end #-------------------------------------------------------------------------- # ● 实行残像 #-------------------------------------------------------------------------- def mirage_set @mirage = @action_data.dup @mirage_end = @mirage[3] @mirage = [] if @mirage[1] == 0 end #-------------------------------------------------------------------------- # ● 实行旋转 #-------------------------------------------------------------------------- def angling(data = @action_data) @angle_data = data.dup @oy = @ch / 2 @oy_adjust = @ch * 50 @angle_time = data[1] start_angle = data[2] * N03.mirror_num(@mirror) end_angle = data[3] * N03.mirror_num(@mirror) # 时间要是0以下时立即到最后角度 @angle_time = 1 if @angle_time <= 0 # 从旋转时间计算一格相当于的角度 @angling = (end_angle - start_angle) / @angle_time # 不能整除的剩余到初期角度 @angle = (end_angle - start_angle) % @angle_time + start_angle end #-------------------------------------------------------------------------- # ● 初始化旋转 #-------------------------------------------------------------------------- def angle_reset @oy = @ch @angle = @angle_time = @oy_adjust = 0 end #-------------------------------------------------------------------------- # ● 实行扩大缩小 #-------------------------------------------------------------------------- def zooming(data = @action_data) @zoom_data = data.dup @zoom_time = data[1] start_zoom_x = data[2][0] start_zoom_y = data[2][1] end_zoom_x = data[3][0] end_zoom_y = data[3][1] # 时间是0以下时跳过 @zoom_time = 1 if @zoom_time <= 0 # 从放大时间中计算一格相当于的放大率 @zooming_x = (end_zoom_x - start_zoom_x) / @zoom_time @zooming_y = (end_zoom_y - start_zoom_y) / @zoom_time # 开始的大小 @zoom_x = start_zoom_x @zoom_y = start_zoom_y end #-------------------------------------------------------------------------- # ● 实行扩大缩小 #-------------------------------------------------------------------------- def zoom_reset @zoom_x = @zoom_y = 1 @zoom_time = 0 end #-------------------------------------------------------------------------- # ● 角色透明度操作 #-------------------------------------------------------------------------- def set_opacity data = @action_data.dup @opacity = data[2] opacity_move = (data[3] - data[2])/ data[1] @opacity_data = [data[1], data[1], opacity_move, data[4], data[5], data[6]] @wait = data[1] if data[7] @wait *= 2 if data[6] && data[7] end #-------------------------------------------------------------------------- # ● 初始化透明度操作 #-------------------------------------------------------------------------- def opacity_reset @opacity = 255 @opacity = 0 if @battler.hidden? @opacity_data = [] end #-------------------------------------------------------------------------- # ● 实行角色动画 #-------------------------------------------------------------------------- def battler_anime(anime_data = nil) anime_data = @action_data.dup if anime_data == nil @graphic_file_index = anime_data[1] if !graphic_fix @pattern_h = anime_data[2] @pattern_w = anime_data[3] @pattern_h = 0 if @max_pattern_w == 1 @pattern_w = 0 if @max_pattern_h == 1 @pattern_type = anime_data[4] @pattern_time = anime_data[5] @pattern_rest_time = anime_data[5] @pattern_count = 0 @pattern_kind = 1 @pattern_kind = -1 if @pattern_type < 0 @pattern_kind = 0 if @pattern_type == 0 @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch @z_plus = anime_data[6] @wait = set_anime_wait if anime_data[7] @shadow_visible = anime_data[8] weapon_anime(anime_data) end #-------------------------------------------------------------------------- # ● 计算等待动画 #-------------------------------------------------------------------------- def set_anime_wait if @pattern_type > 0 pattern_time_a = @max_pattern_w - @pattern_w.abs elsif @pattern_type < 0 pattern_time_a = @pattern_w.abs + 1 else return @pattern_time if @pattern_type == 0 end case @pattern_type when 1,-1, 3,-3 return pattern_time_a * @pattern_time when 2,-2, 4,-4 return pattern_time_a * @pattern_time + (@max_pattern_w - 2) * @pattern_time end end #-------------------------------------------------------------------------- # ● 实行移动 #-------------------------------------------------------------------------- def move @move_targets = N03.get_targets(@action_data[1].abs, @battler) return if @move_targets == [] @move_targets = [@battler] if @action_data[1].abs == 7 @move_x = @action_data[2] * 100 * N03.mirror_num(@mirror) @move_y = @action_data[3] * 100 @move_h = @action_data[4] * 100 if @action_data[4] != nil @move_h = nil if @action_data[4] == nil battler_anime(N03::ACTION[@action_data[8]].dup) if N03::ACTION[@action_data[8]] != nil @horming_move = true @horming_move = false if @action_data[1] < 0 or @action_data[1].abs == 7 target_position_set target_position = [@target_x, @target_y, @target_z] distanse_move = @action_data[5] > 0 @move_time = N03.distanse_calculation(@action_data[5].abs, target_position, [@x, @y, @z], distanse_move) @wait = @move_time curve jump @move_time = 1 if @move_time == 0 @horming_move = false if !@move_targets or @move_targets.include?(@battler) update_move if @move_time == 1 end #-------------------------------------------------------------------------- # ● 实行曲线 #-------------------------------------------------------------------------- def curve @c = 0 return if @action_data[6] == 0 @curve = N03.parabola([@action_data[6], -@action_data[6]], @move_time, 100, 4) end #-------------------------------------------------------------------------- # ● 实行跳跃 #-------------------------------------------------------------------------- def jump convert_jump return if @action_data[7] == [0,0] @jump = N03.parabola(@action_data[7].dup, @move_time, 100) end #-------------------------------------------------------------------------- # ● J坐标(跳跃高度)H坐标变换 #-------------------------------------------------------------------------- def convert_jump @h += @j @j = 0 @jump = [] end #-------------------------------------------------------------------------- # ● 实行数据库战斗动画 #-------------------------------------------------------------------------- def battle_anime data = @action_data.dup targets = N03.get_targets(data[2], @battler) return if targets == [] data[8] = !data[8] if @mirror @set_damage = data[5] @damage_anime_data[0] = N03.get_attack_anime_id(data[1], @battler) @damage_anime_data[1] = data[8] @damage_anime_data[2] = data[7] @damage_anime_data[3] = data[6] @damage_anime_data[4] = data[9] @wait = N03.get_anime_time(@damage_anime_data[0]) - 2 if data[4] return if @set_damage for target in targets do display_anime(targets, target, data) end end #-------------------------------------------------------------------------- # ● 开始武器动画 #-------------------------------------------------------------------------- def weapon_anime(anime_data) @weapon_end = true for i in 9...anime_data.size set_effect_data(anime_data[i]) if anime_data[i] != "" end end #-------------------------------------------------------------------------- # ● 开始飞行动画 #-------------------------------------------------------------------------- def move_anime @m_a_starter = [] @m_a_targets = [] starters = N03.get_targets(@action_data[2], @battler) targets = N03.get_targets(@action_data[3], @battler) return if starters == [] or targets == [] single_start = true if starters != nil && @action_data[2] < 0 single_start = true if @action_data[1][0] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][0], @battler)].position == 3 starters = [starters[0]] if single_start single_end = true if targets != nil && @action_data[3] < 0 single_end = true if @action_data[1][1] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][1], @battler)].position == 3 targets = [targets[0]] if single_end se_flag = true for starter in starters for target in targets data = @action_data.dup data[17] = se_flag @effect_data.push(data) @m_a_targets.push(target) @m_a_starter.push(starter) se_flag = false end end end #-------------------------------------------------------------------------- # ● 效果通讯设置 #-------------------------------------------------------------------------- def set_effect_data(data = @action) action_data = N03::ACTION[data] return if action_data == nil @effect_data.push(action_data.dup) end #-------------------------------------------------------------------------- # ● 战斗场景通讯的数据储存 #-------------------------------------------------------------------------- def set_play_data(data = @action_data) @play_data = data.dup end #-------------------------------------------------------------------------- # ● 战斗动画显示 #-------------------------------------------------------------------------- def display_anime(targets, target, data) return if !N03.first_of_all_screen_anime(data[1], target, targets) target.animation_id = N03.get_attack_anime_id(data[1], @battler) target.animation_mirror = data[8] target.sv.anime_horming = data[3] target.sv.anime_camera_zoom = data[6] target.sv.anime_no_mirror = data[7] target.sv.anime_plus_z = data[9] end #-------------------------------------------------------------------------- # ● 初始化战斗动画扩张数据 #-------------------------------------------------------------------------- def reset_anime_data @anime_no_mirror = false @anime_horming = false @anime_camera_zoom = false @timing_targets = [] @anime_plus_z = true end #-------------------------------------------------------------------------- # ● 摄影机 #-------------------------------------------------------------------------- def camera data = @action_data.dup N03.camera(@battler, data) @wait = data[4] if data[5] end #-------------------------------------------------------------------------- # ● 画面的摇动 #-------------------------------------------------------------------------- def shake data = @action_data.dup $sv_camera.shake(data[1], data[2], data[3]) @wait = data[3] if data[4] end #-------------------------------------------------------------------------- # ● 画面色调变更 #-------------------------------------------------------------------------- def color_effect case @action_data[1] when 0,1,2,3,4,5 targets = N03.get_targets(@action_data[1], @battler) when 6 screen = true when 7 targets = [@battler] + @target_battler when 8 screen = true targets = $game_troop.members + $game_party.battle_members - [@battler] when 9 screen = true targets = $game_troop.members + $game_party.battle_members - [@battler] - @target_battler when 10 screen = true targets = $game_troop.members + $game_party.battle_members end return if screen == nil && targets == [] for target in targets do target.sv.color_set = @action_data[2] end if targets @wait = @action_data[2][4] if @action_data[3] return if !screen $sv_camera.color_set[1] = @action_data[2] $sv_camera.color_set[2] = @action_data[2] end #-------------------------------------------------------------------------- # ● 过渡 #-------------------------------------------------------------------------- def transition $sv_camera.perform_transition(@action_data) end #-------------------------------------------------------------------------- # ● 气球动画显示 #-------------------------------------------------------------------------- def balloon_anime @balloon_data = @action_data.dup end #-------------------------------------------------------------------------- # ● 图片显示 #-------------------------------------------------------------------------- def picture_set @picture = true set_effect_data end #-------------------------------------------------------------------------- # ● 状态操作 #-------------------------------------------------------------------------- def state_set targets = N03.get_targets(@action_data[1], @battler) return if targets == [] case @action_data[2] when 1 ; targets = [targets[rand(targets.size)]] when 2 ; targets -= @battler if targets.include?(@battler) end for target in targets for id in @action_data[4] target.add_state(id) if @action_data[3] == "+" target.remove_state(id) if @action_data[3] == "-" end end end #-------------------------------------------------------------------------- # ● FPS变更 #-------------------------------------------------------------------------- def fps Graphics.frame_rate = @action_data[1] start_action end #-------------------------------------------------------------------------- # ● 角色画像变更的場合 #-------------------------------------------------------------------------- def graphics_change @graphics_change = true return @battler.graphics_change(@action_data[3]) if !@battler.actor? @pre_change_data = [@battler.character_name, @battler.character_index, @battler.face_name, @battler.face_index] if @pre_change_data == nil && !@action_data[1] if @action_data[4] == [] face_name = @battler.face_name face_index = @battler.face_index else face_name = @action_data[4][1] face_index = @action_data[4][0] end @battler.set_graphic(@action_data[3], @action_data[2], face_name, face_index) end #-------------------------------------------------------------------------- # ● 技能连发 #-------------------------------------------------------------------------- def derivating_skill # 如果让没学的的技能不能连发时 return if !@action_data[1] && !@battler.skill_learn?($data_skills[@action_data[3]]) # 如果技能不能连发成本不够时 return if !@action_data[2] && !@battler.skill_cost_payable?($data_skills[@action_data[3]]) # 连发 @derivation_skill_id = @action_data[3] # 取消之后的动作 @full_action = [] end #-------------------------------------------------------------------------- # ● BGM/BGS/SE演奏 #-------------------------------------------------------------------------- def sound pitch = @action_data[2] vol = @action_data[3] name = @action_data[4] case @action_data[1] when "se" Audio.se_play("Audio/SE/" + name, vol, pitch) when "bgm" # 没有指定名字时、不改变现在的BGM name = RPG::BGM.last.name if @action_data[4] == "" Audio.bgm_play("Audio/BGM/" + name, vol, pitch) when "bgs" name = RPG::BGS.last.name if @action_data[4] == "" Audio.bgs_play("Audio/BGS/" + name, vol, pitch) end end #-------------------------------------------------------------------------- # ● 电影播放 #-------------------------------------------------------------------------- def movie Graphics.play_movie('Movies/' + @action_data[1]) end #-------------------------------------------------------------------------- # ● 游戏开关的操作 #-------------------------------------------------------------------------- def switches for id in @action_data[1] $game_switches[id] = true if id > 0 $sv_camera.switches[id.abs] = true if id < 0 end for id in @action_data[2] $game_switches[id] = false if id > 0 $sv_camera.switches[id.abs] = false if id < 0 end $sv_camera.program_check end #-------------------------------------------------------------------------- # ● 游戏变量操作 #-------------------------------------------------------------------------- def variable # 检查操作 operand = @action_data[3] operand = $game_variables[@action_data[3].abs] if @action_data[3] < 0 # 变数操作的分歧 case @action_data[2] when 0 ; $game_variables[@action_data[1]] = operand # 代入 when 1 ; $game_variables[@action_data[1]] += operand # 加法 when 2 ; $game_variables[@action_data[1]] -= operand # 减法 when 3 ; $game_variables[@action_data[1]] *= operand # 乘法 when 4 ; $game_variables[@action_data[1]] /= operand # 除法 when 5 ; $game_variables[@action_data[1]] %= operand # 剩余 end end #-------------------------------------------------------------------------- # ● 条件分岐 (游戏开关) #-------------------------------------------------------------------------- def nece_1 judgment = $game_switches[@action_data[1]] == @action_data[2] if @action_data[1] > 0 judgment = $sv_camera.switches[@action_data[1].abs] == @action_data[2] if @action_data[1] < 0 action_diverging(judgment, @action_data[3]) end #-------------------------------------------------------------------------- # ● 条件分岐 (游戏变量) #-------------------------------------------------------------------------- def nece_2 variable = $game_variables[@action_data[1]] num = @action_data[2] num = $game_variables[@action_data[2].abs] if num < 0 case @action_data[3] when 0 ; judgment = variable == num when 1 ; judgment = variable < num when 2 ; judgment = variable > num end action_diverging(judgment, @action_data[4]) end #-------------------------------------------------------------------------- # ● 条件分岐 (状态) #-------------------------------------------------------------------------- def nece_3 targets = N03.get_targets(@action_data[1], @battler) return if targets == [] member_num = @action_data[4] member_num = targets.size if @action_data[4] == 0 && targets.size > 1 hit_count = 0 miss_count = 0 for target in targets hit_count += 1 if target.state?(@action_data[2]) miss_count += 1 if !target.state?(@action_data[2]) end case @action_data[3] when 0 ; judgment = hit_count >= member_num when 1 ; judgment = miss_count >= member_num end action_diverging(judgment, @action_data[5]) end #-------------------------------------------------------------------------- # ● 条件分岐 (技能) #-------------------------------------------------------------------------- def nece_4 targets = N03.get_targets(@action_data[1], @battler) return if targets == [] member_num = @action_data[4] member_num = targets.size if @action_data[4] == 0 && targets.size > 1 hit_count = 0 miss_count = 0 for target in targets hit_count += 1 if target.skill_learn?($data_skills[@action_data[2]]) && target.skill_conditions_met?($data_skills[@action_data[2]]) miss_count += 1 if !target.skill_learn?($data_skills[@action_data[2]]) or !target.skill_conditions_met?($data_skills[@action_data[2]]) end case @action_data[3] when 0 ; judgment = hit_count >= member_num when 1 ; judgment = miss_count >= member_num end action_diverging(judgment, @action_data[5]) end #-------------------------------------------------------------------------- # ● 条件分岐 (参数) #-------------------------------------------------------------------------- def nece_5 targets = N03.get_targets(@action_data[1], @battler) return if targets == [] member_num = @action_data[5] member_num = targets.size if @action_data[5] == 0 && targets.size > 1 hit_count = 0 for target in targets hit_count += 1 if target.comparison_parameter([@action_data[2],@action_data[3],@action_data[4]]) end judgment = hit_count >= member_num action_diverging(judgment, @action_data[6]) end #-------------------------------------------------------------------------- # ● 条件分岐 (装备) #-------------------------------------------------------------------------- def nece_6 targets = N03.get_targets(@action_data[1], @battler) return if targets == [] member_num = @action_data[5] member_num = targets.size if @action_data[5] == 0 && targets.size > 1 hit_count = 0 miss_count = 0 for target in targets hit_count += 1 if target.comparison_equip([@action_data[2],@action_data[3]]) miss_count += 1 if !target.comparison_equip([@action_data[2],@action_data[3]]) end case @action_data[4] when 0 ; judgment = hit_count >= member_num when 1 ; judgment = miss_count >= member_num end action_diverging(judgment, @action_data[6]) end #-------------------------------------------------------------------------- # ● 条件分岐 (脚本) #-------------------------------------------------------------------------- def nece_7 judgment = eval(@action_data[2]) action_diverging(judgment, @action_data[1]) end #-------------------------------------------------------------------------- # ● 动作的分岐 #-------------------------------------------------------------------------- def action_diverging(judgment, kind) result = 0 if judgment result = 1 if kind == 1 result = 2 if kind == 2 else result = 1 if kind == 0 end # 全部动作结束 return @full_action = [] if result == 2 # 清楚下一个动作 @full_action.shift if result == 1 set_action # 实行下一个动作 @action_data = N03::ACTION[@action] next_action end #-------------------------------------------------------------------------- # ● 第二个目标的操作 #-------------------------------------------------------------------------- def second_targets_set targets = N03.get_targets(@action_data[1], @battler) for target in targets targets.delete(target) if @action_data[2][1] == 1 && target.index != @action_data[2][0] targets.delete(target) if @action_data[2][1] == 2 && target.index == @action_data[2][0].abs targets.delete(target) if @action_data[3] > 0 && target.id != @action_data[3] targets.delete(target) if @action_data[3] < 0 && target.id == @action_data[3].abs targets.delete(target) if @action_data[4] > 0 && !target.state?(@action_data[4]) targets.delete(target) if @action_data[4] < 0 && target.state?(@action_data[4].abs) targets.delete(target) if @action_data[5] > 0 && !target.skill_conditions_met?($data_skills[@action_data[5]]) targets.delete(target) if @action_data[5] < 0 && target.skill_conditions_met?($data_skills[@action_data[5].abs]) targets.delete(target) if !target.comparison_parameter(@action_data[6]) targets.delete(target) if !@action_data[7][1].include?(0) && !target.comparison_equip(@action_data[7]) end return @second_targets = [] if targets.size == 0 case @action_data[8] when 1 ; targets = [targets[rand(targets.size)]] when 2 ; targets.delete(@battler) end return @second_targets = [] if targets.size == 0 @second_targets = targets case @action_data[9] when 0 ; return when 1 ; set_play_data(["second_targets_set"]) when 2 ; set_play_data(["targets_set"]) end @wait += 1 end #-------------------------------------------------------------------------- # ● 公共事件的呼叫 #-------------------------------------------------------------------------- def call_common_event $game_temp.reserve_common_event(@action_data[1]) $sv_camera.event = true @event_fix = @action_data[2] end #-------------------------------------------------------------------------- # ● 伤害动画 #-------------------------------------------------------------------------- def damage_anime(delay_time = 12) anime(N03.get_attack_anime_id(-3, @battler), wait = true) action_play @wait -= delay_time @full_action.unshift("eval('@damage_anime_data = [] @set_damage = true')") end #-------------------------------------------------------------------------- # ● 通常战斗不能 #-------------------------------------------------------------------------- def normal_collapse @collapse = true return end #-------------------------------------------------------------------------- # ● 初期位置变更 #-------------------------------------------------------------------------- def change_base_position @base_x = @x @base_y = @y @base_h = @h end #-------------------------------------------------------------------------- # ● 实行强制动作 #-------------------------------------------------------------------------- def force_act target(@full_action.shift) end #-------------------------------------------------------------------------- # ● 实行强制动作 (第二个目标) #-------------------------------------------------------------------------- def force_act2 target2(@full_action.shift) end #-------------------------------------------------------------------------- # ● 开始个别处理 #-------------------------------------------------------------------------- def individual_start @individual_targets = @target_battler.dup @remain_targets = @target_battler.dup @target_battler = [@individual_targets[0]] # 重复部分的动作并保持 @individual_act = @full_action.dup end #-------------------------------------------------------------------------- # ● 结束个别处理 #-------------------------------------------------------------------------- def individual_end @individual_targets.shift for target in @individual_targets @individual_targets.shift if target.dead? end # 目标没有残留时行动完毕 return @target_battler = @remain_targets if @individual_targets.size == 0 @full_action = @individual_act.dup @target_battler = [@individual_targets[0]] end #-------------------------------------------------------------------------- # ● 循环開始 #-------------------------------------------------------------------------- def loop_start # 重复部分的动作并保持 @loop_act = @full_action.dup end #-------------------------------------------------------------------------- # ● 循环结束 #-------------------------------------------------------------------------- def loop_end # 动作重复 @full_action = @loop_act.dup if @loop_act != [] end #-------------------------------------------------------------------------- # ● 下个动作角色 #-------------------------------------------------------------------------- def next_battler @action_end = true @active = false end #-------------------------------------------------------------------------- # ● 图像变更标记 #-------------------------------------------------------------------------- def set_change @change_up = true end #-------------------------------------------------------------------------- # ● 战斗场景通讯 #-------------------------------------------------------------------------- def play_data data = @play_data @play_data = [] return data end #-------------------------------------------------------------------------- # ● 捷径指令 #-------------------------------------------------------------------------- def anime(anime_id, wait = true) @action_data = ["anime",anime_id,1,false,wait,false,true,false] end def anime_me(anime_id, wait = true) @action_data = ["anime",anime_id,0,false,wait,false,true,false] end def se(file, pitch = 100) @action_data = ["sound", "se", pitch, 100, file] end def target(act) for target in @target_battler do target.sv.force_action = act end end def target2(act) for target in @second_targets do target.sv.force_action = act end end def delay(time) @wait = @battler.index * time end #-------------------------------------------------------------------------- # ● 取得角色ID #-------------------------------------------------------------------------- def id return @battler.id if @battler.actor? return [email]-@battler.id[/email] end #-------------------------------------------------------------------------- # ● 取得被致命一击 #-------------------------------------------------------------------------- def critical? return @battler.result.critical end #-------------------------------------------------------------------------- # ● 取得被回复标记 #-------------------------------------------------------------------------- def recovery? recovery = false recovery = true if @battler.result.hp_damage < 0 recovery = true if @battler.result.mp_damage < 0 recovery = true if @battler.result.tp_damage < 0 return recovery end #-------------------------------------------------------------------------- # ● 取得被损伤技能ID #-------------------------------------------------------------------------- def damage_skill_id return @damage_skill_id end #-------------------------------------------------------------------------- # ● 取得被损伤物品ID #-------------------------------------------------------------------------- def damage_item_id return @damage_item_id end #-------------------------------------------------------------------------- # ● 取得装备武器ID #-------------------------------------------------------------------------- def weapon_id return 0 if !@battler.weapons[0] return @battler.weapons[0].id end #-------------------------------------------------------------------------- # ● 取得装备武器的类型 #-------------------------------------------------------------------------- def weapon_type return 0 if !@battler.weapons[0] return @battler.weapons[0].wtype_id end #-------------------------------------------------------------------------- # ● 是否装备盾 #-------------------------------------------------------------------------- def shield? for armor in @battler.armors do return true if armor != nil && armor.etype_id == 1 end return false end #-------------------------------------------------------------------------- # ● 是否有伤害 #-------------------------------------------------------------------------- def damage_zero? return @battler.result.hp_damage == 0 && @battler.result.mp_damage == 0 && @battler.result.tp_damage == 0 end #-------------------------------------------------------------------------- # ● 取得技能ID #-------------------------------------------------------------------------- def skill_id return @counter_id if @counter_id != 0 return 0 if @battler.current_action == nil or @battler.current_action.item == nil return 0 if @battler.current_action.item.is_a?(RPG::Item) return @battler.current_action.item.id end #-------------------------------------------------------------------------- # ● 取得技能的种类 #-------------------------------------------------------------------------- def skill_type return 0 if skill_id == 0 return $data_skills[skill_id].stype_id end #-------------------------------------------------------------------------- # ● 取得技能名字 #-------------------------------------------------------------------------- def skill_name return "" if skill_id == 0 return $data_skills[skill_id].name end #-------------------------------------------------------------------------- # ● 取得物品ID #-------------------------------------------------------------------------- def item_id return 0 if @battler.current_action == nil or @battler.current_action.item == nil return @battler.current_action.item.id end #-------------------------------------------------------------------------- # ● 攻击动作 #-------------------------------------------------------------------------- def attack_action(item) return skill_action if item.is_a?(RPG::Skill) return item_action end #-------------------------------------------------------------------------- # ● 基础动作伤害 #-------------------------------------------------------------------------- def damage_action_base(item) @damage_skill_id = 0 @damage_item_id = 0 @damage_skill_id = item.id if item.is_a?(RPG::Skill) @damage_item_id = item.id if item.is_a?(RPG::Item) end #-------------------------------------------------------------------------- # ● 动作伤害 #-------------------------------------------------------------------------- def damage_action(attacker, item) damage_action_base(item) act = damage(attacker) return if @active start_action(act) if act != nil end #-------------------------------------------------------------------------- # ● 回避动作 #-------------------------------------------------------------------------- def evasion_action(attacker, item) damage_action_base(item) act = evasion(attacker) return if @active start_action(act) if act != nil end #-------------------------------------------------------------------------- # ● 失误动作 #-------------------------------------------------------------------------- def miss_action(attacker, item) damage_action_base(item) act = miss(attacker) return if @active start_action(act) if act != nil end #-------------------------------------------------------------------------- # ● Flash动作同时处理 #-------------------------------------------------------------------------- def flash_action return "闪光" end end #============================================================================== # ■ module N03 #------------------------------------------------------------------------------ # 这是一个侧视战斗的模块。 #============================================================================== module N03 #-------------------------------------------------------------------------- # ● 取得敌人角色队伍 #-------------------------------------------------------------------------- def self.get_enemy_unit(battler) return $game_troop if battler.actor? return $game_party end #-------------------------------------------------------------------------- # ● 取得我方角色队伍 #-------------------------------------------------------------------------- def self.get_party_unit(battler) return $game_party if battler.actor? return $game_troop end #-------------------------------------------------------------------------- # ● 取得战斗动画时间 #-------------------------------------------------------------------------- def self.get_anime_time(anime_id) return 0 if anime_id <= 0 return $data_animations[anime_id].frame_max * 4 end #-------------------------------------------------------------------------- # ● 取得攻击动画 #-------------------------------------------------------------------------- def self.get_attack_anime_id(kind, battler) return $data_skills[battler.sv.counter_id].animation_id if kind == -3 && battler.sv.counter_id != 0 case kind when -1 ; anime_id = battler.atk_animation_id1 when -2 ; anime_id = battler.atk_animation_id2 when -3 if battler.current_action != nil anime_id = battler.current_action.item.animation_id if battler.current_action.item != nil end else ; anime_id = kind end case anime_id when -1 ; anime_id = battler.atk_animation_id1 when -2 ; anime_id = battler.atk_animation_id2 end return anime_id if anime_id return 0 end #-------------------------------------------------------------------------- # ● 战斗动画数据 #-------------------------------------------------------------------------- def self.set_damage_anime_data(targets, target, data) return if !first_of_all_screen_anime(data[0], target, targets) target.animation_id = data[0] target.animation_mirror = data[1] target.sv.anime_no_mirror = data[2] target.sv.anime_camera_zoom = data[3] target.sv.anime_plus_z = data[4] end #-------------------------------------------------------------------------- # ● 取得目标 #-------------------------------------------------------------------------- def self.get_targets(kind, battler) case kind.abs when 0 ; return [battler].dup when 1 ; return battler.sv.target_battler.dup when 2 ; return get_enemy_unit(battler).members.dup when 3 ; return get_party_unit(battler).members.dup when 4 ; return $game_troop.members.dup + $game_party.battle_members.dup when 5 ; return battler.sv.second_targets.dup end end #-------------------------------------------------------------------------- # ● 目标的坐标取得 #-------------------------------------------------------------------------- def self.get_targets_position(targets, horming, m_a = nil) return [0,0,0] if targets == nil && !$sv_camera.mirror return [Graphics.width,0,0] if targets == nil && $sv_camera.mirror x = y = h = 0 for i in 0...targets.size x += targets[i].sv.base_x if !horming y += targets[i].sv.base_y if !horming h += targets[i].sv.base_h if !horming x += targets[i].sv.x if horming y += targets[i].sv.y if horming h += targets[i].sv.h if horming y -= targets[i].sv.ch * 100 if m_a == 0 y -= targets[i].sv.ch * 50 if m_a == 1 end return [x / targets.size, y / targets.size, h / targets.size] end #-------------------------------------------------------------------------- # ● 速度转换时间 #-------------------------------------------------------------------------- def self.distanse_calculation(time, target_position, self_position, distanse_move) return time if !distanse_move distanse_x = self_position[0] - target_position[0] distanse_x = target_position[0] - self_position[0] if target_position[0] > self_position[0] distanse_y = self_position[1] - target_position[1] distanse_y = target_position[1] - self_position[1] if target_position[1] > self_position[1] if self_position[2] != nil && target_position[2] != nil distanse_h = self_position[2] - target_position[2] distanse_h = target_position[2] - self_position[2] if target_position[2] > self_position[2] else distanse_h = 0 end distanse = [distanse_x, distanse_y, distanse_h].max return distanse / (time * 100) + 1 end #-------------------------------------------------------------------------- # ● 计算抛物线移动 #-------------------------------------------------------------------------- def self.parabola(data, time, size, type = 1) move_data = data move_data[0] *= size move_data[1] *= size move = [] move_d = [] for i in 0...time / 2 move[i] = move_data[0] move_d[i] = move_data[1] move_data[0] = move_data[0] * type / (1 + type) move_data[1] = move_data[1] * type / (1 + type) end move = move + move_d.reverse! move.reverse! adjust = move.inject(0) {|result, item| result + item } move[move.size - 1] += adjust if data[0] == data[1] && adjust != 0 move.unshift(0) if time % 2 != 0 return move end #-------------------------------------------------------------------------- # ● 反转数值 #-------------------------------------------------------------------------- def self.mirror_num(mirror) return 1 if !mirror return -1 end #-------------------------------------------------------------------------- # ● 摄影机 #-------------------------------------------------------------------------- def self.camera(battler, data) battler = $game_party.battle_members[0] if !battler cx = data[2][0] * 100 cy = data[2][1] * 100 return $sv_camera.move(cx, cy, data[3], data[4], true) if data[1] == 6 targets = self.get_targets(data[1], battler) return if targets == nil or targets == [] position = self.get_targets_position(targets, true) $sv_camera.move(position[0], position[1] - position[2], data[3], data[4], false) end #-------------------------------------------------------------------------- # ● 禁止战斗不能 #-------------------------------------------------------------------------- def self.immortaling # 赋予全体不死状态 for member in $game_party.battle_members + $game_troop.members # 事件操作等无敌设定就会解除flag的无效 member.sv.immortal = true if member.state?(N03::IMMORTAL_ID) member.add_state(N03::IMMORTAL_ID) end return true end #-------------------------------------------------------------------------- # ● 允许战斗不能 #-------------------------------------------------------------------------- def self.unimmortaling # 解除全体不死状态(如果事件等无敌设定以外) for member in $game_party.battle_members + $game_troop.members next if member.dead? # 不死身状态行动中被解除的场合、从状态中解除无效 member.sv.immortal = false if !member.state?(N03::IMMORTAL_ID) && member.sv.immortal next member.sv.immortal = false if member.sv.immortal member.remove_state(N03::IMMORTAL_ID) next if member.hp != 0 member.add_state(1) member.perform_collapse_effect member.sv.action_terminate end return false end #-------------------------------------------------------------------------- # ● 技能连发 #-------------------------------------------------------------------------- def self.derived_skill(battler) battler.force_action(battler.sv.derivation_skill_id, -2) BattleManager.unshift_action_battlers(battler) end #-------------------------------------------------------------------------- # ● 创建伤害 #-------------------------------------------------------------------------- def self.set_damage(battler, hp_damage, mp_damage) battler.result.hp_damage = hp_damage battler.result.mp_damage = mp_damage end #-------------------------------------------------------------------------- # ● 确认目标生死 #-------------------------------------------------------------------------- def self.targets_alive?(targets) return false if targets == [] for target in targets do return true if !target.dead? end return false end #-------------------------------------------------------------------------- # ● 定位到第二个目标 #-------------------------------------------------------------------------- def self.s_targets(battler) battler.sv.target_battler = battler.sv.second_targets return battler.sv.second_targets end #-------------------------------------------------------------------------- # ● 定位目标到第二个目标 #-------------------------------------------------------------------------- def self.targets_set(battler) battler.sv.second_targets = battler.current_action.make_targets.compact battler.sv.target_battler = battler.sv.second_targets end #-------------------------------------------------------------------------- # ● 实行战斗动画判定 (对象:实行第一个目标时的画面的动画) #-------------------------------------------------------------------------- def self.first_of_all_screen_anime(anime_id, target, targets) anime = $data_animations[anime_id] return false if !anime return true if anime.position != 3 return false if anime.position == 3 && target != targets[0] targets.delete(target) target.sv.timing_targets = targets return true end #-------------------------------------------------------------------------- # ● 战斗不能是否附加攻击 #-------------------------------------------------------------------------- def self.dead_attack?(battler, item) for state in battler.atk_states return true if state == battler.death_state_id end for effect in item.effects return true if effect.code == 21 && effect.data_id == battler.death_state_id end return false end end #============================================================================== # ■ Sprite_Weapon #------------------------------------------------------------------------------ # 这是一个显示武器的脚本。 #============================================================================== class Sprite_Weapon < Sprite_Base #-------------------------------------------------------------------------- # ● 公开实例变量 #-------------------------------------------------------------------------- attr_reader :index # 武器图像排列的index attr_reader :battler # 角色图像 attr_reader :move_time # 图像达到目标的为止的这段时间 attr_reader :through # 贯穿标记 attr_reader :action_end # 武器动作结束的标记 attr_reader :action_end_cancel # 武器动作结束,取消的标记 attr_reader :hit_position # 图像达到目标时的坐标 attr_accessor :hit_anime_id # 图像达到目标时的动画ID #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- def initialize(viewport, index, battler) super(viewport) @index = index @battler = battler @position_x = @position_y = 0 @o = 0 @real_x = @real_y = 0 @mirror = @battler.sv.mirror reset set_action end #-------------------------------------------------------------------------- # ● 初始化 #-------------------------------------------------------------------------- def reset @z_plus = 0 @weapon_data = [] @move_data = [] @move_x = 0 @move_y = 0 @orbit = [] @through = false @distanse_move = false @weapon_width = 0 @weapon_height = 0 @anime_time = 0 @anime_position = 1 @move_time = 0 @hit_anime_id = 0 @move_anime = true @action_end = false @action_end_cancel = false reset_position end #-------------------------------------------------------------------------- # ● 动作设置 #-------------------------------------------------------------------------- def set_action return if @battler.sv.effect_data == [] weapon_anime if @battler.sv.effect_data[0][0] == "wp" move_anime if @battler.sv.effect_data[0][0] == "m_a" @battler.sv.effect_data.shift end #-------------------------------------------------------------------------- # ● 实行武器动画 #-------------------------------------------------------------------------- def weapon_anime @weapon_data = @battler.sv.effect_data[0].dup set_graphics set_ox set_weapon_move end #-------------------------------------------------------------------------- # ● 实行动画移动 #-------------------------------------------------------------------------- def move_anime @move_data = @battler.sv.effect_data[0].dup # 取得目标 @target_battler = [@battler.sv.m_a_targets.shift] @target_battler = N03.get_targets(@move_data[3], @battler) if @move_data[3] < 0 set_move return if @move_data[16] == "" weapon_data = N03::ACTION[@move_data[16]] return if weapon_data == nil @weapon_data = weapon_data.dup set_graphics set_ox set_weapon_move end #-------------------------------------------------------------------------- # ● 取得武器图像 #-------------------------------------------------------------------------- def set_graphics # 武器不依赖图像设定的情况下 if @weapon_data[13] != "" self.bitmap = Cache.character(@weapon_data[13]).dup @weapon_width = self.bitmap.width @weapon_height = self.bitmap.height return end # 取得武器 weapon = @battler.weapons[0] # 取得二刀流武器 if @weapon_data[10] weapon = nil for armor in @battler.armors do break weapon = armor if armor.is_a?(RPG::Armor) && armor.etype_id == 1 end weapon = @battler.weapons[1] if !weapon end # 如果没有武器将取消处理 return if weapon == nil # 指数取得 file_index = @weapon_data[12] # 如果使用图标 if @weapon_data[1] == 0 icon_index = weapon.icon_index self.bitmap = Cache.system("Iconset" + file_index).dup self.src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24) @weapon_width = @weapon_height = 24 # 独自图像指定 else file_name = @battler.sv.weapon_graphic(weapon.id, weapon.wtype_id) if weapon.is_a?(RPG::Weapon) file_name = @battler.sv.shield_graphic(weapon.id, weapon.atype_id) if weapon.is_a?(RPG::Armor) self.bitmap = Cache.character(file_name + file_index).dup @weapon_width = self.bitmap.width @weapon_height = self.bitmap.height return if @weapon_data[1] == 1 # 2003规范的武器动画 @weapon_width /= @battler.sv.max_pattern[0] end end #-------------------------------------------------------------------------- # ● 取得图像的原点 #-------------------------------------------------------------------------- def set_ox # 反转时设置为相反 if @mirror case @weapon_data[6] when 1 ; @weapon_data[6] = 2 # 左上→右上角 when 2 ; @weapon_data[6] = 1 # 右上→左上角 when 3 ; @weapon_data[6] = 4 # 左下→右下角 when 4 ; @weapon_data[6] = 3 # 右下→左下角 end end # 原点的設定 case @weapon_data[6] when 0 # 中心 self.ox = @weapon_width / 2 self.oy = @weapon_height / 2 when 1 # 左上 self.ox = 0 self.oy = 0 when 2 # 右上 self.ox = @weapon_width self.oy = 0 when 3 # 左下 self.ox = 0 self.oy = @weapon_height when 4 # 右下 self.ox = @weapon_width self.oy = @weapon_height when 5 # 同角色位置 self.ox = @weapon_width / 2 self.oy = @weapon_height end end #-------------------------------------------------------------------------- # ● 取得角色的坐标 #-------------------------------------------------------------------------- def set_battler_position @position_x = @battler.sv.x + @weapon_data[3][0] * N03.mirror_num(@mirror) * 100 @position_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust) + @weapon_data[3][1] * 100 reset_position end #-------------------------------------------------------------------------- # ● 初始化坐标 #-------------------------------------------------------------------------- def reset_position @real_x = @position_x / 100 @real_y = @position_y / 100 @real_zoom_x = 1 @real_zoom_y = 1 end #-------------------------------------------------------------------------- # ● 战斗动画显示 #-------------------------------------------------------------------------- def set_animation(anime_id) return if $data_animations[anime_id] == nil @anime_position = $data_animations[anime_id].position @horming = true @horming = false if @anime_position == 3 @anime_camera_zoom = true @anime_no_mirror = false start_animation($data_animations[anime_id], @mirror) timings = $data_animations[anime_id].timings end #-------------------------------------------------------------------------- # ● 实行打击时的战斗动画 #-------------------------------------------------------------------------- def set_hit_animation(position_data, hit_anime_id, target) return if $data_animations[hit_anime_id] == nil @real_x = position_data[0] @real_y = position_data[1] @position_x = position_data[0] * 100 @position_y = position_data[1] * 100 self.z = position_data[2] @z_plus = 1000 @action_end = false @horming = true set_animation(hit_anime_id) @anime_time = $data_animations[hit_anime_id].frame_max * 4 @timing_targets = [target] @move_time = @hit_anime_id = 0 @weapon_data = [] end #-------------------------------------------------------------------------- # ● 角色时间追加 #-------------------------------------------------------------------------- def timing_battler_set(target) @timing_targets.push(target) end #-------------------------------------------------------------------------- # ● 取得武器的移动 #-------------------------------------------------------------------------- def set_weapon_move # 取得开始位置 set_battler_position if @move_time == 0 @z_plus = 50 if @z_plus == 0 && @weapon_data[9] self.z = @battler.sv.z + @z_plus # 反转处理 @mirror = !@mirror if @weapon_data[7] self.mirror = @mirror # 更新模式设置 set_pattern @max_pattern = 2 if @max_pattern == 1 # 计算武器移动 @weapon_move_data = [] @weapon_angle_data = [] @weapon_zoom_data = [] num = N03.mirror_num(@mirror) for i in 0...@max_pattern move_data_x = @weapon_data[2][0] * num * 100 * i / (@max_pattern - 1) move_data_y = @weapon_data[2][1] * 100 * i / (@max_pattern - 1) move_angle = @weapon_data[4] * num + (@weapon_data[5] * num - @weapon_data[4] * num) * i / (@max_pattern - 1) move_zoom_x = 1 + (@weapon_data[8][0] - 1) * i / (@max_pattern - 1) move_zoom_y = 1 + (@weapon_data[8][1] - 1) * i / (@max_pattern - 1) @weapon_move_data.push([move_data_x, move_data_y]) @weapon_angle_data.push(move_angle) @weapon_zoom_data.push([move_zoom_x, move_zoom_y]) end end #-------------------------------------------------------------------------- # ● 更新模式 #-------------------------------------------------------------------------- def set_pattern if @weapon_data[11] == -1 return @max_pattern = @battler.sv.max_pattern[0] if @battler.sv.pattern_type != 0 @count = @battler.sv.pattern_time @max_count = @battler.sv.pattern_time @max_pattern = @battler.sv.max_pattern[0] @repeat = false else @count = @weapon_data[11][0] @max_count = @weapon_data[11][0] @max_pattern = @weapon_data[11][1] @repeat = @weapon_data[11][2] end @pattern = 0 end #-------------------------------------------------------------------------- # ● 实行移动 #-------------------------------------------------------------------------- def set_move # 取得战斗动画 set_animation(@move_data[1][0]) if $data_animations[@move_data[1][0]] != nil && $data_animations[@move_data[1][0]].position != 3 @anime_camera_zoom = @move_data[13] @loop = @move_data[14] @loop = false if @move_data[1][0] == 0 @anime_no_mirror = @move_data[15] @se_flag = @move_data[17] # 取得开始位置 start_position @z_plus = 1000 if @move_data[9] # 目标角色图像的动画的反映SE和时机设定 @timing_targets = @target_battler # 计算坐标 @move_x = @move_data[5][0] * 100 * N03.mirror_num(@mirror) @move_y = @move_data[5][1] * 100 # 计算时间或速度 @distanse_move = true if @move_data[6] > 0 @move_time = @move_data[6].abs # 时间为0的时、如果被描写成动画显示时间 if @move_time == 0 @move_time = $data_animations[@move_data[1][0]].frame_max * 4 if $data_animations[@move_data[1][0]] @move_time = 1 if !$data_animations[@move_data[1][0]] @distanse_move = false end # 贯穿类型的场合 @through = true if @move_data[7] == 1 @auto_through_flag = false @auto_through_flag = true if @move_data[7] == 0 # 计算目标坐标 if @target_battler == nil @target_x = @move_x * 100 @target_x = (Graphics.width - @move_x) * 100 if @mirror @target_y = @move_y * 100 else move_data_set end # 计算目标达到的时间 @move_time = distanse_calculation(@move_time, @target_x, @target_y) # 计算圆形轨道 orbit # 角色的体能设定 @battler.sv.wait = @move_time - 1 if @move_data[10][0] @move_horming = @move_data[12] end #-------------------------------------------------------------------------- # ● 速度转换时间 #-------------------------------------------------------------------------- def distanse_calculation(time, target_x, target_y) return time if !@distanse_move distanse_x = @position_x - @target_x distanse_x = @target_x - @position_x if @target_x > @position_x distanse_y = @position_y - @target_y distanse_y = @target_y - @position_y if @target_y > @position_y distanse = [distanse_x, distanse_y].max return distanse / (time * 100) + 1 end #-------------------------------------------------------------------------- # ● 更新移动目标 #-------------------------------------------------------------------------- def move_data_set return if @target_battler == nil position = N03.get_targets_position(@target_battler, true, @anime_position) @target_x = position[0] + @move_x @target_y = position[1] - position[2] + @move_y end #-------------------------------------------------------------------------- # ● 计算开始位置 #-------------------------------------------------------------------------- def start_position starter = [@battler.sv.m_a_starter.shift] starter = N03.get_targets(@move_data[2], @battler) if @move_data[2] < 0 position = [0, 0] position = N03.get_targets_position(starter, true, @anime_position) if starter != nil @position_x = position[0] + @move_data[4][0] * 100 @position_y = position[1] + position[2] + @move_data[4][1] * 100 @position_z = @position_y end #-------------------------------------------------------------------------- # ● 计算原型轨道 #-------------------------------------------------------------------------- def orbit orbit_data = @move_data[8].dup orbit_data[0] *= 100 orbit_data[1] *= 100 orbit_d = [] for i in 0...@move_time / 2 @orbit[i] = orbit_data[0] orbit_data[0] /= 2 orbit_d[i] = orbit_data[1] orbit_data[1] /= 2 end @orbit = @orbit + orbit_d.reverse! @orbit.reverse! end #-------------------------------------------------------------------------- # ● 更新框架 #-------------------------------------------------------------------------- def update update_hit_anime if @anime_time != 0 update_move if @move_time != 0 update_weapon_move if @weapon_data != [] update_position update_color self.visible = @battler.sv.weapon_visible super end #-------------------------------------------------------------------------- # ● 打击时的战斗动画 #-------------------------------------------------------------------------- def update_hit_anime @anime_time -= 1 @action_end = true if @anime_time == 0 end #-------------------------------------------------------------------------- # ● 更新移动 #-------------------------------------------------------------------------- def update_move move_data_set if @move_horming && !@hit_position through_set(@move_time, @target_x, @target_y) if @move_time == 1 && !@hit_position @o += @orbit[@move_time - 1] if @orbit[@move_time - 1] != nil @position_x = (@position_x * (@move_time - 1) + @target_x) / @move_time @position_y = (@position_y * (@move_time - 1) + @target_y) / @move_time + @o reset_position set_animation(@move_data[1][0]) if @loop && !animation? @move_time -= 1 return if @move_time != 0 @action_end = true if !@action_end_cancel end #-------------------------------------------------------------------------- # ● 更新武器的移动 #-------------------------------------------------------------------------- def update_weapon_move pattern = update_pattern set_battler_position if @move_time == 0 && !@action_end_cancel @real_x = @position_x / 100 + @weapon_move_data[pattern][0] / 100 @real_y = @position_y / 100 + @weapon_move_data[pattern][1] / 100 @real_zoom_x = @weapon_zoom_data[pattern][0] @real_zoom_y = @weapon_zoom_data[pattern][1] self.angle = @weapon_angle_data[pattern] self.src_rect.set(@weapon_width * pattern, 0, @weapon_width, @weapon_height) if @weapon_data[1] == 2 end #-------------------------------------------------------------------------- # ● 更新模式 #-------------------------------------------------------------------------- def update_pattern return @battler.sv.pattern_w if @count == nil @count -= 1 return @pattern if @count != 0 @count = @max_count @pattern += 1 if !@repeat && @pattern == @max_pattern @pattern = @max_pattern - 1 elsif @pattern == @max_pattern @pattern = 0 end return @pattern end #-------------------------------------------------------------------------- # ● 更新坐标 #-------------------------------------------------------------------------- def update_position self.x = (@real_x - $sv_camera.x) * $sv_camera.convert / 1000 self.y = (@real_y - $sv_camera.y) * $sv_camera.convert / 1000 self.x += $sv_camera.sx / 100 unless @battler.sv.h != 0 && @weapon_data != [] self.y += $sv_camera.sy / 100 unless @battler.sv.h != 0 && @weapon_data != [] self.z = @battler.sv.z + @z_plus - 10 self.zoom_x = @real_zoom_x * $sv_camera.zoom self.zoom_y = @real_zoom_y * $sv_camera.zoom self.opacity = @battler.sv.opacity if @battler.sv.opacity_data[4] end #-------------------------------------------------------------------------- # ● 贯穿的处理 #-------------------------------------------------------------------------- def through_set(time, target_x, target_y) @hit_anime_id = N03.get_attack_anime_id(@move_data[1][1], @battler) @battler.sv.wait = N03.get_anime_time(@hit_anime_id) if @move_data[10][1] moving_x = (target_x / 100 - @position_x / 100) / time moving_y = (target_y / 100 - @position_y / 100) / time goal_x = $sv_camera.max_left - 100 if moving_x < 0 goal_x = Graphics.width + $sv_camera.max_right + 100 if moving_x > 0 goal_y = $sv_camera.max_top - 100 if moving_y < 0 goal_y = Graphics.height + $sv_camera.max_bottom + 100 if moving_y > 0 if goal_x == nil && goal_y == nil time = 0 reset_position else time = move_calculation(moving_x, moving_y, goal_x, goal_y) end target_x = @position_x + moving_x * time * 100 target_y = @position_y + moving_y * time * 100 @pre_data = [time, target_x, target_y] @battler.sv.m_a_data.push([@move_data[11], @target_battler, @index, @auto_through_flag, []]) @action_end_cancel = true @hit_position = [@real_x, @real_y, self.z] end #-------------------------------------------------------------------------- # ● 达到时间预算 #-------------------------------------------------------------------------- def move_calculation(moving_x, moving_y, goal_x, goal_y) move_x = @position_x / 100 move_y = @position_y / 100 time = 0 loop do move_x += moving_x move_y += moving_y time += 1 return time if moving_x < 0 && move_x < goal_x return time if moving_x > 0 && move_x > goal_x return time if moving_y < 0 && move_y < goal_y return time if moving_y > 0 && move_y > goal_y end end #-------------------------------------------------------------------------- # ● 错误时从处理消失转换成贯穿处理 #-------------------------------------------------------------------------- def through_change @action_end_cancel = false @through = true @move_time = @pre_data[0] @target_x = @pre_data[1] @target_y = @pre_data[2] @pre_data = nil end #-------------------------------------------------------------------------- # ● SE 闪光灯和处理的时间 #-------------------------------------------------------------------------- def animation_process_timing(timing) return if !@timing_targets se_flag = true se_flag = @se_flag if @se_flag != nil for target in @timing_targets target.sv.timing.push([se_flag, timing.dup]) se_flag = false if @animation.position == 3 end end #-------------------------------------------------------------------------- # ● 更新色调 #-------------------------------------------------------------------------- def update_color return if @battler.sv.color == [] self.color.set(@battler.sv.color[0], @battler.sv.color[1], @battler.sv.color[2], @battler.sv.color[3]) end #-------------------------------------------------------------------------- # ● 释放 #-------------------------------------------------------------------------- def dispose super self.bitmap.dispose if self.bitmap != nil end end #============================================================================== # ■ Sprite_Battle_Picture #------------------------------------------------------------------------------ # 这是一个画面的图象显示。 #============================================================================== class Sprite_Battle_Picture < Sprite #-------------------------------------------------------------------------- # ● 公开实例变量 #-------------------------------------------------------------------------- attr_accessor :action_end # 结束标记 #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- def initialize(viewport = nil) super(viewport) @action_end = false self.ox = 0 end #-------------------------------------------------------------------------- # ● 集合 #-------------------------------------------------------------------------- def set(battler) @battler = battler @data = @battler.sv.effect_data.shift @time = @data[4] @mirror = $sv_camera.mirror @mirror = false if !@data[8] self.opacity = @data[6][0] @s_x = @data[2][0] if @data[2] != [] @s_x = Graphics.width - @data[2][0] if @data[2] != [] && @mirror @s_y = @data[2][1] if @data[2] != [] @e_x = @data[3][0] if @data[3] != [] @e_x = Graphics.width - @data[3][0] if @data[3] != [] && @mirror @e_y = @data[3][1] if @data[3] != [] @s_x = self.x if @data[2] == [] @s_y = self.y if @data[2] == [] @e_x = self.x if @data[3] == [] @e_y = self.y if @data[3] == [] self.x = @s_x self.y = @s_y return @action_end = true if @time == 0 @move_x = (@e_x * 1.0 - @s_x) / @time @move_y = (@e_y * 1.0 - @s_y) / @time self.z = @data[5] return set_plane(battler) if @data[7] != [] self.bitmap = Cache.picture(@data[9]) if !bitmap or @data[9] != "" return @action_end = true if !bitmap self.mirror = @mirror self.ox = self.bitmap.width if @mirror end #-------------------------------------------------------------------------- # ● 过渡平面 #-------------------------------------------------------------------------- def set_plane(battler) @viewport = Viewport.new(@data[2][0],@data[2][1],@data[7][0],@data[7][1]) if !@viewport viewport = @viewport @plane = Plane.new(viewport) if !@plane @plane.bitmap = Cache.picture(@data[9]) if !@plane.bitmap or @data[9] != "" return @action_end = true if !@plane.bitmap @plane.ox = @data[7][0] @plane.oy = @data[7][1] @plane.opacity = @data[6][0] @move_x = @remain_move[0] if @data[2] == @data[3] @move_y = @remain_move[1] if @data[2] == @data[3] @remain_move = [@move_x, @move_y] end #-------------------------------------------------------------------------- # ● 更新帧数 #-------------------------------------------------------------------------- def update @action_end = true if !@battler.sv.picture return if @time == 0 return if @action_end @time -= 1 return plane_update if @plane super self.x += @move_x self.y += @move_y self.opacity += @data[6][1] return if @time != 1 self.x = @e_x self.y = @e_y @time = 0 end #-------------------------------------------------------------------------- # ● 更新平面 #-------------------------------------------------------------------------- def plane_update @plane.ox += @move_x @plane.oy += @move_y @plane.opacity += @data[6][1] @time = @data[4] if @time == 0 end #-------------------------------------------------------------------------- # ● 释放 #-------------------------------------------------------------------------- def dispose bitmap.dispose if bitmap @plane.dispose if @plane @viewport.dispose if @viewport super end end #============================================================================== # ■ Sprite_Back_Picture #------------------------------------------------------------------------------ # 这是一个精灵的一段画面。 #============================================================================== class Sprite_Back_Picture < Plane #-------------------------------------------------------------------------- # ● 公开实例变量 #-------------------------------------------------------------------------- attr_accessor :action_end # 结束标记 #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- def initialize(viewport = nil, index) super(viewport) @index = index @real_x = 0 @real_y = 0 @real_opacity = 0 @move_x = 0 @move_y = 0 @move_opacity = 0 @time = 0 @switche = 0 @action_end = false end #-------------------------------------------------------------------------- # ● 格局 #-------------------------------------------------------------------------- def setup(data) self.bitmap = Cache.picture(data[9]) self.z = data[6] @switche = data[1] mirror = $sv_camera.mirror mirror = false if !data[8] @move_x = data[3][0] @move_x *= -1 if mirror @move_y = data[3][1] @time = data[4] @time = -1 if @time == 0 @real_opacity = (data[5][0] + 1) * 100 @move_opacity = data[5][1] @start_opacity = data[5][0] @shake_ok = data[7] end #-------------------------------------------------------------------------- # ● 更新帧数 #-------------------------------------------------------------------------- def update update_picture if @time != 0 self.ox = $sv_camera.x - @real_x self.oy = $sv_camera.y - @real_y if @shake_ok self.ox -= $sv_camera.sx / 100 self.oy -= $sv_camera.sy / 100 end self.ox *= $sv_camera.zoom self.oy *= $sv_camera.zoom self.zoom_x = @zoom_x * $sv_camera.zoom self.zoom_y = @zoom_y * $sv_camera.zoom self.opacity = @real_opacity / 100 @move_opacity *= -1 if self.opacity == 255 or self.opacity <= @start_opacity @switche @action_end = true if @switche > 0 && !$game_switches[@switche] @action_end = true if @switche < 0 && !$sv_camera.switches[@switche.abs] end #-------------------------------------------------------------------------- # ● 更新图片 #-------------------------------------------------------------------------- def update_picture @real_x += @move_x / 100 @real_y += @move_y / 100 @real_x = 0 if @real_x >= self.bitmap.width or @real_x <= -self.bitmap.width @real_y = 0 if @real_y >= self.bitmap.height or @real_y <= -self.bitmap.height @zoom_x = 1 @zoom_y = 1 @real_opacity += @move_opacity @time -= 1 @time = -1 if @time < -100 end end #============================================================================== # ■ Sprite_Back_Picture #------------------------------------------------------------------------------ # 这是一个精灵的伤害显示。 #============================================================================== class Sprite_Damage < Sprite #-------------------------------------------------------------------------- # ● 公开实例变量 #-------------------------------------------------------------------------- attr_reader :action_end # POP结束标记 #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- def initialize(viewport = nil, battler) super(viewport) @battler = battler @time = 0 return @action_end = true if !@battler @direction = -1 @direction *= -1 if @battler.actor? @direction *= -1 if $sv_camera.mirror set_state set_damage update end #-------------------------------------------------------------------------- # ● 显示状态 #-------------------------------------------------------------------------- def set_state return if !N03::STATE_POP states = @battler.result.added_state_objects states.delete($data_states[@battler.death_state_id]) if @battler.result.hp_damage != 0 return if states == [] return if @battler.sv.add_state == @battler.result.added_state_objects @battler.sv.add_state = states.dup @st = [] @st_base = [] for i in 0...states.size @st[i] = Sprite.new bitmap_state(@st[i], states[i]) @st_base[i] = [] @st_base[i][0] = @direction * (-20 + 5 * i) + @battler.sv.x / 100 @st_base[i][1] = -40 - @state_height * i + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100 @st[i].z = 1000 + i @st[i].opacity = 0 end @time = @pop_time = 80 end #-------------------------------------------------------------------------- # ● 状态图像 #-------------------------------------------------------------------------- def bitmap_state(state, state_object) name = state_object.name state.bitmap = Cache.system("Iconset").dup state.src_rect.set(state_object.icon_index % 16 * 24, state_object.icon_index / 16 * 24, 24, 24) @state_height = 24 end #-------------------------------------------------------------------------- # ● 显示打击伤害 #-------------------------------------------------------------------------- def hit_count for i in [email]0...@battler.sv.hit.size[/email] if @battler.sv.hit[i] == nil @hit = i return @battler.sv.hit[i] = @hit end end @hit = @battler.sv.hit.size @battler.sv.hit.push(@hit) end #-------------------------------------------------------------------------- # ● 显示伤害 #-------------------------------------------------------------------------- def set_damage return @action_end = true if !N03::DAMAGE_POP damage = @battler.result.hp_damage if @battler.result.hp_damage != 0 damage = @battler.result.hp_drain if @battler.result.hp_drain != 0 damage = @battler.result.mp_damage if @battler.result.mp_damage != 0 damage = @battler.result.mp_drain if @battler.result.mp_drain != 0 damage = @battler.result.tp_damage if @battler.result.tp_damage != 0 if !damage or damage == 0 @action_end = true if @st == nil return # 状态POP考虑设置@action_end不返回 end hit_count # @hit = @battler.sv.hit # @battler.sv.hit += 1 if damage != 0 file = N03::DAMAGE_PLUS if damage > 0 file = N03::DAMAGE_MINUS if damage < 0 add_file = N03::DAMAGE_MP if @battler.result.mp_damage != 0 add_file = N03::DAMAGE_TP if @battler.result.tp_damage != 0 adjust_x = N03::DAMAGE_ADJUST @num = [] @num_base = [] damage = damage.abs max_num = damage.to_s.size max_num += 1 if add_file != nil for i in 0...max_num @num[i] = Sprite.new if add_file != nil && i == max_num - 1 @num[i].bitmap = Cache.system(add_file) cw = (damage % (10 * 10 ** i))/(10 ** i) sw = 0 if sw == nil else @num[i].bitmap = Cache.system(file) cw = (damage % (10 * 10 ** i))/(10 ** i) sw = @num[i].bitmap.width / 10 @num[i].src_rect.set(cw * sw, 0, sw, @num[i].bitmap.height) end @num_base[i] = [] @num_base[i][0] = (sw + adjust_x) * i * -1 + (@battler.sv.x / 100) @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 @num_base[i][0] -= @num[i].bitmap.width / 2 - adjust_x if add_file != nil && i == max_num - 1 @num[i].z = 1000 + i + @hit * 10 end @time = @pop_time = 80 end #-------------------------------------------------------------------------- # ● 更新帧数 #-------------------------------------------------------------------------- def update return if @time == 0 for i in [email]0...@st.size[/email] do update_state_move(@st[i], i) end if @st != nil for i in [email]0...@num.size[/email] do update_num_move(@num[i], i) end if @num != nil @time -= 1 @action_end = true if @time == 0 end #-------------------------------------------------------------------------- # ● 更新状态图像 #-------------------------------------------------------------------------- def update_state_move(state, index) min = @pop_time - index * 2 case @time when min-15..min @st_base[index][0] += @direction state.opacity += 25 when min-80..min-50 @st_base[index][0] += @direction state.opacity -= 25 end state.x = (@st_base[index][0] - $sv_camera.x) * $sv_camera.zoom state.y = (@st_base[index][1] - $sv_camera.y) * $sv_camera.zoom end #-------------------------------------------------------------------------- # ● 更新数值 #-------------------------------------------------------------------------- def update_num_move(num, index) min = @pop_time - index * 2 case @time when min-1..min @num_base[index][0] += @direction * @hit @num_base[index][1] -= 5 + @hit * 2 when min-3..min-2 @num_base[index][0] += @direction * @hit @num_base[index][1] -= 4 + @hit * 2 when min-6..min-4 @num_base[index][0] += @direction @num_base[index][1] -= 3 + @hit * 2 when min-14..min-7 @num_base[index][0] += @direction @num_base[index][1] += 2 when min-17..min-15 @num_base[index][1] -= 2 + @hit * 2 when min-23..min-18 @num_base[index][1] += 1 when min-27..min-24 @num_base[index][1] -= 1 when min-30..min-28 @num_base[index][1] += 1 when min-33..min-31 @num_base[index][1] -= 1 when min-36..min-34 @num_base[index][1] += 1 end num.x = (@num_base[index][0] - $sv_camera.x) * $sv_camera.zoom num.y = (@num_base[index][1] - $sv_camera.y) * $sv_camera.zoom num.opacity = 256 - (12 - @time) * 32 num.visible = false if @time == 0 end #-------------------------------------------------------------------------- # ● 释放 #-------------------------------------------------------------------------- def dispose @battler.sv.hit[@hit] = nil if @hit bitmap.dispose if bitmap for i in [email]0...@num.size[/email] do @num[i].dispose end if @num != nil for i in [email]0...@st.size[/email] do @st[i].dispose end if @st != nil super end end #============================================================================== # ■ Window_Skill_name #------------------------------------------------------------------------------ # 这是一个显示技能名字的窗口。 #============================================================================== class Window_Skill_name < Window_Base #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- def initialize(text) super(0, 0, Graphics.width, line_height + standard_padding * 2) draw_text(4, 0, Graphics.width - 64, line_height,text, 1) end end #============================================================================== # ■ Spriteset_Sideview #------------------------------------------------------------------------------ # 处理战斗画面的精灵的类。本类在横版战斗类的內定使用。 #============================================================================== class Spriteset_Sideview #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- def initialize(viewport) @viewport = viewport @weapons = [] @pictures = [] @back_pic = [] @damage = [] $sv_camera.setup N03.camera(nil, N03::BATTLE_CAMERA["顺序开始前"].dup) end #-------------------------------------------------------------------------- # ● 更新帧数 #-------------------------------------------------------------------------- def update update_battler_data update_damage update_pictures update_back_pic update_weapons end #-------------------------------------------------------------------------- # ● 更新角色数据 #-------------------------------------------------------------------------- def update_battler_data for battler in $game_party.battle_members + $game_troop.members weapon_end(battler) if battler.sv.weapon_end next if battler.sv.effect_data == [] for effect_data in battler.sv.effect_data do set_effects(battler, effect_data) end end end #-------------------------------------------------------------------------- # ● 更新伤害图像 #-------------------------------------------------------------------------- def update_damage for i in [email]0...@damage.size[/email] next if @damage[i] == nil @damage[i].update if @damage[i] != nil next if !@damage[i].action_end @damage[i].dispose @damage[i] = nil end end #-------------------------------------------------------------------------- # ● 更新图片动作 #-------------------------------------------------------------------------- def update_pictures for i in [email]0...@pictures.size[/email] next if @pictures[i] == nil @pictures[i].update if @pictures[i] != nil next if !@pictures[i].action_end @pictures[i].dispose @pictures[i] = nil end end #-------------------------------------------------------------------------- # ● 更新期间图片 #-------------------------------------------------------------------------- def update_back_pic set_back_pic if $sv_camera.program_picture != [] for i in [email]0...@back_pic.size[/email] next if @back_pic[i] == nil @back_pic[i].update if @back_pic[i] != nil next if !@back_pic[i].action_end @back_pic[i].dispose @back_pic[i] = nil end end #-------------------------------------------------------------------------- # ● 更新武器动作 #-------------------------------------------------------------------------- def update_weapons for i in [email]0...@weapons.size[/email] next if @weapons[i] == nil @weapons[i].update if @weapons[i] != nil next if !@weapons[i].action_end @weapons[i].dispose @weapons[i] = nil end end #-------------------------------------------------------------------------- # ● 实行伤害 #-------------------------------------------------------------------------- def set_damage_pop(target) for i in [email]0...@damage.size[/email] next if @damage[i] != nil return @damage[i] = Sprite_Damage.new(@viewport, target) end @damage.push(Sprite_Damage.new(@viewport, target)) end #-------------------------------------------------------------------------- # ● 实行期间图片 #-------------------------------------------------------------------------- def set_back_pic for data in $sv_camera.program_picture if @back_pic[data[2]] != nil @back_pic[data[2]].dispose @back_pic[data[2]] = nil end @back_pic[data[2]] = Sprite_Back_Picture.new(@viewport, data[2]) @back_pic[data[2]].setup(data) end $sv_camera.program_picture = [] end #-------------------------------------------------------------------------- # ● 开始效果 #-------------------------------------------------------------------------- def set_effects(battler, effect_data) case effect_data[0] when "pic" ; set_pictures(battler, effect_data) when "wp" ; set_weapons(battler, true) when "m_a" ; set_weapons(battler, false) end end #-------------------------------------------------------------------------- # ● 实行图片动作 #-------------------------------------------------------------------------- def set_pictures(battler, effect_data) @pictures[effect_data[1]] = Sprite_Battle_Picture.new if @pictures[effect_data[1]] == nil @pictures[effect_data[1]].set(battler) end #-------------------------------------------------------------------------- # ● 实行武器动作 #-------------------------------------------------------------------------- def set_weapons(battler, weapon_flag, test = true) for i in [email]0...@weapons.size[/email] next if @weapons[i] != nil @weapons[i] = Sprite_Weapon.new(@viewport, i, battler) battler.sv.weapon_index.push(i) if weapon_flag return i end @weapons.push(Sprite_Weapon.new(@viewport, @weapons.size, battler)) battler.sv.weapon_index.push(@weapons.size - 1) if weapon_flag return @weapons.size - 1 end #-------------------------------------------------------------------------- # ● 角色的武器动作结束 #-------------------------------------------------------------------------- def weapon_end(battler) battler.sv.weapon_end = false for index in battler.sv.weapon_index weapon_index = battler.sv.weapon_index.shift @weapons[weapon_index].dispose if @weapons[weapon_index] != nil @weapons[weapon_index] = nil end battler.sv.weapon_index.compact! end #-------------------------------------------------------------------------- # ● 实行打击時的战斗动画 #-------------------------------------------------------------------------- def set_hit_animation(battler, weapon_index, hit_targets, miss) weapon = @weapons[weapon_index] for target in hit_targets next @weapons[@hit_index].timing_battler_set(target) if @hit_index != nil @hit_index = set_weapons(battler, false, false) @weapons[@hit_index].set_hit_animation(weapon.hit_position, weapon.hit_anime_id, target) end @hit_index = nil if !weapon.through && !miss @weapons[weapon_index].dispose @weapons[weapon_index] = nil else @weapons[weapon_index].through_change end end #-------------------------------------------------------------------------- # ● 初始化侧视图数据 #-------------------------------------------------------------------------- def reset_sideview $sv_camera.reset for member in $game_troop.members + $game_party.battle_members do member.sv.reset end end #-------------------------------------------------------------------------- # ● 释放 #-------------------------------------------------------------------------- def dispose dispose_effects(@weapons) dispose_effects(@pictures) dispose_effects(@back_pic) dispose_effects(@damage) reset_sideview end #-------------------------------------------------------------------------- # ● 释放图像效果 #-------------------------------------------------------------------------- def dispose_effects(effects) for i in 0...effects.size effects[i].dispose if effects[i] != nil effects[i] = nil end end end #============================================================================== # ■ Sprite_Battle_Back #------------------------------------------------------------------------------ # 战斗背景用的精灵。 #============================================================================== class Sprite_Battle_Back < Plane #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- def initialize(viewport = nil, index, battleback_name) super(viewport) @index = index if @index == 1 data = N03::FLOOR1_DATA[battleback_name] data = N03::FLOOR1_DATA["全Battlebacks1"] if data == nil elsif @index == 2 data = N03::FLOOR2_DATA[battleback_name] data = N03::FLOOR2_DATA["全Battlebacks2"] if data == nil end data = data.dup @adjust_position = data[0] @zoom_x = data[1][0] / 100.0 @zoom_y = data[1][1] / 100.0 @shake_on = data[2] $game_switches[data[3]] = true if data[3] > 0 $sv_camera.switches[data[3].abs] = true if data[3] < 0 reset_scroll reset_back_data(battleback_name) end #-------------------------------------------------------------------------- # ● 初始化背景滚动 #-------------------------------------------------------------------------- def reset_scroll @scroll_x = 0 @scroll_y = 0 @move_x = 0 @move_y = 0 end #-------------------------------------------------------------------------- # ● 初始化背景数据 #-------------------------------------------------------------------------- def reset_back_data(battleback_name) @back_data = [] @active_data = ["scroll",0, @move_x, @move_y, false, battleback_name,""] start_back_data(@active_data) end #-------------------------------------------------------------------------- # ● 背景图像的设置 #-------------------------------------------------------------------------- def set_graphics(new_bitmap) self.bitmap = new_bitmap @base_x = (self.bitmap.width * @zoom_x - Graphics.width) / 2 + @adjust_position[0] @base_y = (self.bitmap.height * @zoom_y - Graphics.height) / 2 + @adjust_position[1] # 限制坐标取得 max_top = 0 max_bottom = self.bitmap.height * @zoom_y - Graphics.height max_left = 0 max_right = self.bitmap.width * @zoom_x - Graphics.width exist = true exist = false if self.bitmap.height == 32 && self.bitmap.width == 32 $sv_camera.setting(@index, [max_top, max_bottom, max_left, max_right, @base_x, @base_y,exist]) end #-------------------------------------------------------------------------- # ● 更新帧数 #-------------------------------------------------------------------------- def update return if !bitmap update_back_data update_scroll unless @move_x == 0 && @move_y == 0 update_color update_position update_back_adjust if @bt_back != nil create_back_adjust if @bt_back == nil && !@active_data[10] && @scroll_x == 0 && @scroll_y == 0 end #-------------------------------------------------------------------------- # ● 更新背景数据 #-------------------------------------------------------------------------- def update_back_data delete = true if @active_data[1] > 0 && !$game_switches[@active_data[1]] delete = true if @active_data[1] < 0 && !$sv_camera.switches[@active_data[1].abs] return if !delete for i in [email]0...@back_data.size[/email] @back_data[i] = nil if @back_data[i][1] > 0 && !$game_switches[@back_data[i][1]] @back_data[i] = nil if @back_data[i][1] < 0 && !$sv_camera.switches[@back_data[i][1].abs] end @back_data.compact! next_back_data end #-------------------------------------------------------------------------- # ● 下一个背景资料设置 #-------------------------------------------------------------------------- def next_back_data @back_data.delete(@active_data[11]) if @active_data[11] != nil @back_data.push(@active_data[11]) if @active_data[11] != nil @active_data = nil data = @back_data.pop @back_data = [@active_data] if @back_data.size == 0 start_back_data(data) end #-------------------------------------------------------------------------- # ● 实行背景数据 #-------------------------------------------------------------------------- def start_back_data(data) return if back_data_remain(data) bt_back_dispose pre_active_data = @active_data @active_data[8] = [@back_name, @move_x, @move_y, @scroll_x, @scroll_y] if @active_data != nil @back_data.push(@active_data) if @active_data != nil @active_data = data.dup @active_data[5] = @back_name if @active_data[5] == "" @active_data[9] = set_back_adjust if @active_data[9] == nil back_data_scroll_on if @active_data[8] == nil && @active_data[9][0] == false set_remain_back_data if @active_data[8] != nil create_back(@active_data[5]) if @active_data[9][0] == false create_back_adjust if @active_data[10] @active_data[11] = pre_active_data if pre_active_data && @active_data[7] == false end #-------------------------------------------------------------------------- # ● 背景数据的保持 #-------------------------------------------------------------------------- def back_data_remain(data) remain = false remain = true if data[6] != "" && @active_data != nil && @active_data[9] != nil && @active_data[9][0] != false remain = true if @active_data != nil && @active_data[7] == false return remain if !remain @remain = true @back_data.push(data) return remain end #-------------------------------------------------------------------------- # ● 背景变更修正数据 #-------------------------------------------------------------------------- def set_back_adjust bt_adjust = [] sign = -1 if @active_data[6] == "" reset_scroll if @active_data[3][0] == 0 && @active_data[3][1] == 0 bt_adjust = [false,false,0,0] return bt_adjust elsif @move_x != 0 or @active_data[3][0] != 0 sign = 1 if @move_x < 0 bt_adjust[0] = [self.bitmap.width * @zoom_x * sign, 0] bt_adjust[1] = [self.bitmap.width * @zoom_x * sign * 2, 0] elsif @move_y != 0 or @active_data[3][1] != 0 sign = 1 if @move_y < 0 bt_adjust[0] = [0, self.bitmap.height * @zoom_y * sign] bt_adjust[1] = [0, self.bitmap.height * @zoom_y * sign * 2] else reset_scroll if @active_data[3][0] == 0 && @active_data[3][1] == 0 bt_adjust = [false,false,0,0] return bt_adjust end bt_adjust[2] = [bt_adjust[0][0], bt_adjust[0][1]] return bt_adjust end #-------------------------------------------------------------------------- # ● 实行背景滚动数据 #-------------------------------------------------------------------------- def back_data_scroll_on mirror = $sv_camera.mirror mirror = false if !@active_data[4] @move_x = @active_data[3][0] @move_x *= -1 if mirror @move_y = @active_data[3][1] end #-------------------------------------------------------------------------- # ● 实行保持背景数据 #-------------------------------------------------------------------------- def set_remain_back_data return back_data_scroll_on if @move_x != 0 or @move_y != 0 create_back(@active_data[8][0]) @move_x = @active_data[8][1] @move_y = @active_data[8][2] @scroll_x = @active_data[8][3] @scroll_y = @active_data[8][4] end #-------------------------------------------------------------------------- # ● 创建背景图像 #-------------------------------------------------------------------------- def create_back(back_name) return if back_name == @back_name or back_name == "" self.bitmap = Cache.battleback1(back_name) if @index == 1 self.bitmap = Cache.battleback2(back_name) if @index == 2 @back_name = back_name end #-------------------------------------------------------------------------- # ● 创建背景变更修正图像 #-------------------------------------------------------------------------- def create_back_adjust return if @active_data[9][0] == false @active_data[10] = true mirror = $sv_camera.mirror mirror = false if !@active_data[4] @bt_back = [] @bt_back[0] = Sprite.new(viewport) @bt_back[0].bitmap = Cache.battleback1(@active_data[6]) if @index == 1 @bt_back[0].bitmap = Cache.battleback2(@active_data[6]) if @index == 2 @bt_back[0].mirror = mirror @bt_back[1] = Sprite.new(viewport) @bt_back[1].bitmap = Cache.battleback1(@active_data[5]) if @index == 1 @bt_back[1].bitmap = Cache.battleback2(@active_data[5]) if @index == 2 @bt_back[1].mirror = mirror end #-------------------------------------------------------------------------- # ● 更新背景滚动 #-------------------------------------------------------------------------- def update_scroll @scroll_x += @move_x @scroll_y += @move_y @scroll_x = 0 if @scroll_x / 100 >= self.bitmap.width * @zoom_x or @scroll_x / 100 <= -self.bitmap.width * @zoom_x @scroll_y = 0 if @scroll_y / 100 >= self.bitmap.height * @zoom_y or @scroll_y / 100 <= -self.bitmap.height * @zoom_y end #-------------------------------------------------------------------------- # ● 更新色调变更 #-------------------------------------------------------------------------- def update_color color_set if $sv_camera.color_set[@index] != nil return if @color_data == nil @color_data[4] -= 1 if @color_data[4] == 0 && @color_data[5] != 0 @color_data[4] = @color_data[5] @color_data[5] = 0 @color_data[6] = [0,0,0,0] elsif @color_data[4] == 0 @remain_color_data = @color_data return @color_data = nil end for i in 0..3 @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4] end self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) end #-------------------------------------------------------------------------- # ● 更新坐标 #-------------------------------------------------------------------------- def update_position self.ox = $sv_camera.x + @base_x - @scroll_x / 100 self.oy = $sv_camera.y + @base_y - @scroll_y / 100 self.ox -= $sv_camera.sx / 100 if @shake_on self.oy -= $sv_camera.sy / 100 if @shake_on self.zoom_x = @zoom_x * $sv_camera.zoom self.zoom_y = @zoom_y * $sv_camera.zoom self.ox *= $sv_camera.zoom self.oy *= $sv_camera.zoom self.z = @index * 10 end #-------------------------------------------------------------------------- # ● 更新背景变更修正图像 #-------------------------------------------------------------------------- def update_back_adjust @active_data[9][0][0] = 0 if @scroll_x == 0 @active_data[9][0][1] = 0 if @scroll_y == 0 @active_data[9][1][0] -= @active_data[9][2][0] if @scroll_x == 0 @active_data[9][1][1] -= @active_data[9][2][1] if @scroll_y == 0 for i in [email]0...@bt_back.size[/email] @bt_back[i].x = -self.ox + @active_data[9][i][0] * $sv_camera.zoom @bt_back[i].y = -self.oy + @active_data[9][i][1] * $sv_camera.zoom @bt_back[i].zoom_x = self.zoom_x @bt_back[i].zoom_y = self.zoom_y @bt_back[i].z = self.z + 1 @bt_back[i].color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil end back_data_scroll_on if @active_data[9][0][0] == 0 && @active_data[9][0][1] == 0 return unless @active_data[9][1][0] == 0 && @active_data[9][1][1] == 0 bt_back_dispose create_back(@active_data[5]) @active_data[9][0] = false next_back_data if @remain && @back_data.size != 1 @remain = false end #-------------------------------------------------------------------------- # ● 色调变更 #-------------------------------------------------------------------------- def color_set set = $sv_camera.color_set[@index] $sv_camera.color_set[@index] = nil set[4] = 1 if set[4] == 0 @remain_color_data = [0,0,0,0] if @remain_color_data == nil @color_data = @remain_color_data @color_data[4] = set[4] @color_data[5] = set[5] @color_data[6] = set end #-------------------------------------------------------------------------- # ● 背景变更修正的释放 #-------------------------------------------------------------------------- def bt_back_dispose for i in [email]0...@bt_back.size[/email] do @bt_back[i].dispose end if @bt_back != nil @bt_back = nil end #-------------------------------------------------------------------------- # ● 释放 #-------------------------------------------------------------------------- def dispose bitmap.dispose if bitmap bt_back_dispose super end end #============================================================================== # ■ Battle_Camera #------------------------------------------------------------------------------ # 这是一个类来处理相机和战斗的计划。 #============================================================================== class Battle_Camera #-------------------------------------------------------------------------- # ● 公开实例的变量 #-------------------------------------------------------------------------- attr_reader :sx # 摇动X坐标 attr_reader :sy # 摇动Y坐标 attr_reader :max_top # 上限界坐标 attr_reader :max_bottom # 下限界坐标 attr_reader :max_left # 左限界坐标 attr_reader :max_right # 右限界坐标 attr_accessor :switches # 侧视图专用开关 attr_accessor :color_set # 色调变更数据 attr_accessor :wait # 战斗场景的强制体能 attr_accessor :win_wait # 战斗胜利前的体能 attr_accessor :mirror # 画面反转标记 attr_accessor :program_scroll # 战斗程序 背景的自动滚动 attr_accessor :program_picture # 战斗程序 期间图片 attr_accessor :event # 公共事件呼叫 #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- def initialize @switches = [] @max_data = [] @color_set = [] @wait = 0 @win_wait = false @mirror = false @event = false setup end #-------------------------------------------------------------------------- # ● 相机X坐标 #-------------------------------------------------------------------------- def x return @x / 100 end #-------------------------------------------------------------------------- # ● 相机Y坐标 #-------------------------------------------------------------------------- def y return @y / 100 end #-------------------------------------------------------------------------- # ● 变焦率 #-------------------------------------------------------------------------- def zoom return @zoom * 0.001 end #-------------------------------------------------------------------------- # ● 变焦虑的坐标变换 #-------------------------------------------------------------------------- def convert return @zoom end #-------------------------------------------------------------------------- # ● 相机设置 #-------------------------------------------------------------------------- def setup @x = 0 @y = 0 @sx = 0 @sy = 0 @zoom = 1000 @time = 0 @shake_time = 0 program_setup end #-------------------------------------------------------------------------- # ● 初始化相机 #-------------------------------------------------------------------------- def reset @switches = [] @max_data = [] @color_set = [] @wait = 0 @win_wait = false @mirror = false program_setup(false) end #-------------------------------------------------------------------------- # ● 战斗安装程序 #-------------------------------------------------------------------------- def program_setup(check = true) @played_program = [] @program_switch = [] @program_sound = [] @program_scroll = [] @program_se = [] @program_shake = [] @program_color = [] @program_picture = [] @program_base = N03::BATTLE_PROGRAM.values.dup program_check if check end #-------------------------------------------------------------------------- # ● 战斗的检测程序 #-------------------------------------------------------------------------- def program_check for data in @program_base if program_start?(data) && !@played_program.include?(data) @played_program.push(data.dup) @program_scroll.push(data.dup) if data[0] == "scroll" @program_picture.push(data.dup) if data[0] == "kpic" start_sound(data.dup) if data[0] == "sound" start_program_switch(data.dup) if data[0] == "switch" start_program_se(data.dup) if data[0] == "keep_se" start_program_shake(data.dup) if data[0] == "keep_sk" start_program_color(data.dup) if data[0] == "keep_c" else @played_program.delete(data) if !program_start?(data) @program_scroll.delete(data) if data[0] == "scroll" @program_picture.delete(data) if data[0] == "kpic" @program_switch.delete(data) if data[0] == "switch" @program_sound.delete(data) if data[0] == "sound" @program_se.delete(data) if data[0] == "keep_se" @program_shake.delete(data) if data[0] == "keep_sk" @program_color.delete(data) if data[0] == "keep_c" end end end #-------------------------------------------------------------------------- # ● 战斗程序开始 #-------------------------------------------------------------------------- def program_start?(data) start = false start = true if $game_switches[data[1].abs] && data[1] > 0 start = true if @switches[data[1].abs] && data[1] < 0 return start end #-------------------------------------------------------------------------- # ● 战斗程序 开关操作开始 #-------------------------------------------------------------------------- def start_program_switch(data) data[4] = data[4] + rand(data[5] + 1) data[4] = 1 if data[4] <= 0 @program_switch.push(data) end #-------------------------------------------------------------------------- # ● 更新开关操作 #-------------------------------------------------------------------------- def update_program_switch for data in @program_switch data[4] -= 1 next @program_switch.delete(data) if data[1] > 0 && !$game_switches[data[1]] next @program_switch.delete(data) if data[1] < 0 && !@switches[data[1].abs] next if data[4] != 0 for id in data[2] $game_switches[id] = true if id > 0 @switches[id.abs] = true if id < 0 end for id in data[3] $game_switches[id] = false if id > 0 @switches[id.abs] = false if id < 0 end @program_switch.delete(data) program_check end end #-------------------------------------------------------------------------- # ● 战斗程序 BGM/BGS的开始 #-------------------------------------------------------------------------- def start_sound(data) @program_sound.push(data) name = data[5] case data[2] when "se" Audio.se_play("Audio/SE/" + name, data[4], data[3]) when "bgm" name = RPG::BGM.last.name if data[5] == "" Audio.bgm_play("Audio/BGM/" + name, data[4], data[3]) when "bgs" name = RPG::BGS.last.name if data[5] == "" Audio.bgs_play("Audio/BGS/" + name, data[4], data[3]) end end #-------------------------------------------------------------------------- # ● 战斗程序 期间SE的开始 #-------------------------------------------------------------------------- def start_program_se(data) data[3] = [data[2], data[3]] data[2] = data[3][0] + rand(data[3][1] + 1) @program_se.push(data) Audio.se_play("Audio/SE/" + data[7], data[5], data[4]) if data[6] end #-------------------------------------------------------------------------- # ● 更新期间SE #-------------------------------------------------------------------------- def update_program_se for data in @program_se data[2] -= 1 next @program_se.delete(data) if data[1] > 0 && !$game_switches[data[1]] next @program_se.delete(data) if data[1] < 0 && !@switches[data[1].abs] next if data[2] != 0 Audio.se_play("Audio/SE/" + data[7], data[5], data[4]) data[2] = data[3][0] + rand(data[3][1] + 1) end end #-------------------------------------------------------------------------- # ● 战斗程序 开始期间摇动 #-------------------------------------------------------------------------- def start_program_shake(data) data[3] = [data[2], data[3]] data[2] = data[3][0] + rand(data[3][1] + 1) @program_shake.push(data) shake(data[4], data[5], data[6]) if data[7] end #-------------------------------------------------------------------------- # ● 更新期间摇动 #-------------------------------------------------------------------------- def update_program_shake for data in @program_shake data[2] -= 1 next @program_shake.delete(data) if data[1] > 0 && !$game_switches[data[1]] next @program_shake.delete(data) if data[1] < 0 && !@switches[data[1].abs] next if data[2] != 0 shake(data[4], data[5], data[6]) data[2] = data[3][0] + rand(data[3][1] + 1) end end #-------------------------------------------------------------------------- # ● 战斗程序 开始期间色调变更 #-------------------------------------------------------------------------- def start_program_color(data) data[3] = [data[2], data[3]] data[2] = data[3][0] + rand(data[3][1] + 1) data[7] = true if data[4] == 0 or data[4] == 4 case data[4] when 1 ;data[4] = $game_troop.members when 2 ;data[4] = $game_party.battle_members when 3,4 ;data[4] = $game_troop.members + $game_party.battle_members else ;data[4] = [] end @program_color.push(data) return if !data[6] for target in data[4] do target.sv.color_set = data[5] end if data[4] != [] @color_set[1] = data[5] if data[7] @color_set[2] = data[5] if data[7] end #-------------------------------------------------------------------------- # ● 更新期间色调变更 #-------------------------------------------------------------------------- def update_program_color for data in @program_color data[2] -= 1 next @program_color.delete(data) if data[1] > 0 && !$game_switches[data[1]] next @program_color.delete(data) if data[1] < 0 && !@switches[data[1].abs] next if data[2] != 0 for target in data[4] do target.sv.color_set = data[5] end if data[4] != [] @color_set[1] = data[5] if data[7] @color_set[2] = data[5] if data[7] data[2] = data[3][0] + rand(data[3][1] + 1) end end #-------------------------------------------------------------------------- # ● 实行过渡 #-------------------------------------------------------------------------- def perform_transition(data) Graphics.transition(data[2], "Graphics/Pictures/" + data[3], data[1]) end #-------------------------------------------------------------------------- # ● 取得背景相机的限制值 data=[max_top, max_bottom, max_left, max_right] #-------------------------------------------------------------------------- def setting(index, data) @max_data[index - 1] = data return if index != 2 setup # 相机的中心坐标 @center_x = (Graphics.width / 2 + N03::CAMERA_POSITION[0]) * 100 @center_y = (Graphics.height / 2 + N03::CAMERA_POSITION[1]) * 100 # 上下左右的移动限制距离 @max_top = [@max_data[0][5], @max_data[1][5]].min * -1 @max_bottom = [@max_data[0][1], @max_data[1][1]].min + @max_top @max_left = [@max_data[0][4], @max_data[1][4]].min * -1 @max_right = [@max_data[0][3], @max_data[1][3]].min + @max_left exist_data = @max_data[0] if !@max_data[1][6] exist_data = @max_data[1] if !@max_data[0][6] @max_top = exist_data[5] * -1 if exist_data != nil @max_bottom = exist_data[1] + @max_top if exist_data != nil @max_left = exist_data[4] * -1 if exist_data != nil @max_right = exist_data[3] + @max_left if exist_data != nil @max_top = @max_bottom = @max_left = @max_right = 0 if !@max_data[1][6] && !@max_data[0][6] @max_width = @max_right - @max_left + Graphics.width @max_height = @max_bottom - @max_top + Graphics.height # 扩大缩小限制值 max_zoom_x = 100 * Graphics.width / @max_width max_zoom_y = 100 * Graphics.height / @max_height @max_zoom_out = [max_zoom_x, max_zoom_y].max end #-------------------------------------------------------------------------- # ● 相机移动 #-------------------------------------------------------------------------- def move(target_x, target_y, zoom, time, screen = true) # 调整战斗背景以上尺寸的变焦来减少 @target_zoom = [zoom * 0.01, @max_zoom_out * 0.01].max target_x *= -1 if screen && @mirror # 变焦分钟的中心坐标修正 if screen && @target_zoom != 1 target_x = target_x + @center_x target_y = target_y + @center_y end adjust_x = @center_x * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom) adjust_y = @center_y * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom) adjust_x = 0 if adjust_x.nan? adjust_y = 0 if adjust_y.nan? adjust_x = @center_x if !screen && adjust_x == 0 adjust_y = @center_y if !screen && adjust_y == 0 @target_x = target_x - adjust_x.to_i @target_y = target_y - adjust_y.to_i @target_zoom = (@target_zoom * 1000).to_i @zoom = @zoom.to_i limit_test # 马上实行当时间是0的场合 return @time = time.abs if time != 0 @time = 1 update end #-------------------------------------------------------------------------- # ● 计算限制的坐标 #-------------------------------------------------------------------------- def limit_test new_width = @max_width * @target_zoom / 1000 new_height = @max_height * @target_zoom / 1000 new_max_right = @max_right - (@max_width - new_width) new_max_bottom = @max_bottom - (@max_height - new_height) # 画面移动目标限制的场合、限制坐标设置 if @target_x < @max_left * 100 @target_x = @max_left * 100 end if @target_x > new_max_right * 100 @target_x = new_max_right * 100 end if @target_y < @max_top * 100 @target_y = @max_top * 100 end if @target_y > new_max_bottom * 100 @target_y = new_max_bottom * 100 end end #-------------------------------------------------------------------------- # ● 画面的摇动 #-------------------------------------------------------------------------- def shake(power, speed, time) @shake_x = power[0] * 100 @shake_y = power[1] * 100 @power_time_base = @power_time = speed @shake_time = time update_shake end #-------------------------------------------------------------------------- # ● 更新摇动 #-------------------------------------------------------------------------- def update_shake @sx = (@sx * (@power_time - 1) + @shake_x) / @power_time @sy = (@sy * (@power_time - 1) + @shake_y) / @power_time @power_time -= 1 @shake_time -= 1 return @sx = @sy = 0 if @shake_time == 0 return if @power_time != 0 @power_time = @power_time_base @shake_x = @shake_x * -4 / 5 @shake_y = @shake_y * -4 / 5 end #-------------------------------------------------------------------------- # ● 更新帧数 #-------------------------------------------------------------------------- def update update_shake if @shake_time != 0 update_program return if @time == 0 @x = (@x * (@time - 1) + @target_x) / @time @y = (@y * (@time - 1) + @target_y) / @time @zoom = (@zoom * (@time - 1) + @target_zoom) / @time @time -= 1 end #-------------------------------------------------------------------------- # ● 更新程序 #-------------------------------------------------------------------------- def update_program update_program_switch if @program_switch != [] update_program_se if @program_se != [] update_program_shake if @program_shake != [] update_program_color if @program_color != [] end end #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ # 它是一类用于执行该过程的战斗画面。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 更新帧数(基本) #-------------------------------------------------------------------------- alias update_basic_scene_battle_n03 update_basic def update_basic update_basic_scene_battle_n03 $sv_camera.update $sv_camera.wait = N03::TURN_END_WAIT + 1 if $sv_camera.win_wait camera_wait end #-------------------------------------------------------------------------- # ● 相机体能 #-------------------------------------------------------------------------- def camera_wait process_event if $sv_camera.event $sv_camera.event = false if $sv_camera.event while $sv_camera.wait != 0 Graphics.update Input.update update_all_windows $game_timer.update $game_troop.update $sv_camera.update @spriteset.update update_info_viewport update_message_open $sv_camera.wait -= 1 if $sv_camera.wait > 0 $sv_camera.wait = 1 if $sv_camera.wait == 0 && @spriteset.effect? BattleManager.victory if $sv_camera.win_wait && $sv_camera.wait == 0 end end #-------------------------------------------------------------------------- # ● 相机体能集 #-------------------------------------------------------------------------- def set_camera_wait(time) $sv_camera.wait = time camera_wait end #-------------------------------------------------------------------------- # ● 实行等待直到效果结束 ★再定义 #-------------------------------------------------------------------------- def wait_for_effect end #-------------------------------------------------------------------------- # ● 开始回合 #-------------------------------------------------------------------------- alias turn_start_scene_battle_n03 turn_start def turn_start turn_start_scene_battle_n03 N03.camera(nil, N03::BATTLE_CAMERA["顺序开始后"].dup) end #-------------------------------------------------------------------------- # ● 回合结束 #-------------------------------------------------------------------------- alias turn_end_scene_battle_n03 turn_end def turn_end p " #橫版● 回合结束" turn_end_scene_battle_n03 for member in $game_troop.members + $game_party.members N03.set_damage(member, member.sv.result_damage[0],member.sv.result_damage[1]) member.sv.result_damage = [0,0] @spriteset.set_damage_pop(member) if member.result.hp_damage != 0 or member.result.mp_damage != 0 end set_camera_wait(N03::TURN_END_WAIT) N03.camera(nil, N03::BATTLE_CAMERA["顺序开始前"].dup) if $game_party.inputable? @log_window.clear end #-------------------------------------------------------------------------- # ● 技能/使用物品 ★再定义 #-------------------------------------------------------------------------- def use_item item = @subject.current_action.item display_item(item) @subject.use_item(item) refresh_status @targets = @subject.current_action.make_targets.compact @targets = [@subject] if @targets.size == 0 set_substitute(item) for time in item.repeats.times do play_sideview(@targets, item) end end_reaction(item) display_end_item @subject.stamina_loss # atb之語法 出現錯誤砍掉 end #-------------------------------------------------------------------------- # ● 技能/显示物品名 #-------------------------------------------------------------------------- def display_item(item) return @log_window.display_use_item(@subject, item) if N03::BATTLE_LOG @log_window.off @skill_name_window = Window_Skill_name.new(item.name) unless N03::NO_DISPLAY_SKILL_ID.include?(item.id) && item.is_a?(RPG::Skill) end #-------------------------------------------------------------------------- # ● 技能/显示物品名结束 #-------------------------------------------------------------------------- def display_end_item @skill_name_window.dispose if @skill_name_window != nil @skill_name_window = nil set_camera_wait(N03::ACTION_END_WAIT) if @subject.sv.derivation_skill_id == 0 @log_window.clear if N03::BATTLE_LOG end #-------------------------------------------------------------------------- # ● 反击/魔法反射/代替处理 #-------------------------------------------------------------------------- def end_reaction(item) end_substitute if @substitute != nil set_reflection(item) if @reflection_data != nil set_counter_attack if @counter_attacker != nil end #-------------------------------------------------------------------------- # ● 发动反击 ★再定义 #-------------------------------------------------------------------------- def invoke_counter_attack(target, item) return if @subject.sv.counter_id != 0 @counter_attacker = [] if @counter_attacker == nil return apply_item_effects(apply_substitute(target, item), item) if !target.movable? @log_window.add_text(sprintf(Vocab::CounterAttack, target.name)) if N03::BATTLE_LOG target.sv.counter_id = target.sv.counter_skill_id @counter_attacker.push(target) end #-------------------------------------------------------------------------- # ● 发动魔法反射 ★再定义 #-------------------------------------------------------------------------- def invoke_magic_reflection(target, item) return if @subject.sv.reflection_id != 0 @log_window.add_text(sprintf(Vocab::MagicReflection, target.name)) if N03::BATTLE_LOG target.sv.reflection_id = target.sv.reflection_anime_id end #-------------------------------------------------------------------------- # ● 代替应用 ★再定义 #-------------------------------------------------------------------------- def apply_substitute(target, item) return target if @substitute == nil return target if !check_substitute(target, item) return @substitute end #-------------------------------------------------------------------------- # ● 代替设置 #-------------------------------------------------------------------------- def set_substitute(item) @substitute = N03.get_enemy_unit(@subject).substitute_battler return if @substitute == nil s_targets = [] for i in [email]0...@targets.size[/email] next if @targets[i] == @substitute next if !check_substitute(@targets[i], item) @log_window.add_text(sprintf(Vocab::Substitute, @substitute.name, @targets[i].name)) @targets[i].sv.start_action(@targets[i].sv.substitute_receiver_start_action) s_targets.push(@targets[i]) @targets[i] = @substitute end return @substitute = nil if s_targets == [] @substitute.sv.set_target(s_targets) @substitute.sv.start_action(@substitute.sv.substitute_start_action) end #-------------------------------------------------------------------------- # ● 结束代替 #-------------------------------------------------------------------------- def end_substitute for member in @substitute.sv.target_battler member.sv.start_action(member.sv.substitute_receiver_end_action) end @substitute.sv.start_action(@substitute.sv.substitute_end_action) @substitute = nil end #-------------------------------------------------------------------------- # ● 反击 #-------------------------------------------------------------------------- def set_counter_attack pre_subject = @subject for attacker in @counter_attacker @subject = attacker item = $data_skills[attacker.sv.counter_skill_id] play_sideview([pre_subject], item) end # 实行同一个计数器者を考虑到计数器ID的初始化动作后 for attacker in @counter_attacker do attacker.sv.counter_id = 0 end @subject = pre_subject @counter_attacker = nil end #-------------------------------------------------------------------------- # ● 魔法反射 #-------------------------------------------------------------------------- def set_reflection(item) @log_window.back_to(1) for data in @reflection_data @subject.sv.damage_action(@subject, item) N03.set_damage_anime_data([@subject], @subject, data) apply_item_effects(@subject, item) @spriteset.set_damage_pop(@subject) end set_camera_wait(N03.get_anime_time(@reflection_data[0][0])) @reflection_data = nil end #-------------------------------------------------------------------------- # ● 实行侧视图动作 #-------------------------------------------------------------------------- def play_sideview(targets, item) @subject.sv.set_target(targets) return if @subject.sv.attack_action(item) == nil return if !@subject.movable? return if item.scope != 9 && item.scope != 10 && !N03.targets_alive?(targets) @subject.sv.start_action(@subject.sv.attack_action(item)) @subject.sv.unshift_action(@subject.sv.flash_action) if @subject.flash_flg @subject.sv.active = true @subject.sv.command_action = false loop do update_basic data = @subject.sv.play_data @targets = N03.s_targets(@subject) if data[0] == "second_targets_set" N03.targets_set(@subject) if data[0] == "targets_set" @immortal = N03.immortaling if data[0] == "no_collapse" && !N03.dead_attack?(@subject, item) @immortal = N03.unimmortaling if data[0] == "collapse" next set_move_anime(item) if @subject.sv.m_a_data != [] set_damage(item) if @subject.sv.set_damage break N03.derived_skill(@subject) if @subject.sv.derivation_skill_id != 0 break if @subject.sv.action_end or @subject.hidden? end @immortal = N03.unimmortaling if @immortal end #-------------------------------------------------------------------------- # ● 实行伤害 #-------------------------------------------------------------------------- def set_damage(item) targets = @targets targets = [@subject.sv.individual_targets[0]] if @subject.sv.individual_targets.size != 0 for target in targets do damage_anime(targets.dup, target, item) end @subject.sv.set_damage = false @subject.sv.damage_anime_data = [] end #-------------------------------------------------------------------------- # ● 战斗动画伤害处理 #-------------------------------------------------------------------------- def damage_anime(targets, target, item) @log_window.back_to(1) if @log_window.line_number == 5 return if item.scope != 9 && item.scope != 10 && target.dead? @miss = false invoke_item(target,item) if target.result.missed target.sv.miss_action(@subject, item) return @miss = true elsif target.result.evaded or target.sv.counter_id != 0 target.sv.evasion_action(@subject, item) return @miss = true elsif target.sv.reflection_id != 0 N03.set_damage_anime_data(targets, target, [target.sv.reflection_id, false, false, true]) target.sv.reflection_id = 0 @reflection_data = [] if @reflection_data == nil return @reflection_data.push([N03.get_attack_anime_id(-3, @subject), false, false, true]) end target.sv.damage_action(@subject, item) N03.set_damage(@subject, -target.result.hp_drain, -target.result.mp_drain) if target != @subject @spriteset.set_damage_pop(target) @spriteset.set_damage_pop(@subject) if target != @subject && @subject.result.hp_damage != 0 or @subject.result.mp_damage != 0 N03.set_damage_anime_data(targets, target, @subject.sv.damage_anime_data) if @subject.sv.damage_anime_data != [] end #-------------------------------------------------------------------------- # ● 飞行动画处理 #-------------------------------------------------------------------------- def set_move_anime(item) for data in @subject.sv.m_a_data @subject.sv.damage_anime_data = data[4] hit_targets = [] for target in data[1] damage_anime(data[1], target, item) if data[0] hit_targets.push(target) if !@miss end @miss = false if !data[3] @spriteset.set_hit_animation(@subject, data[2], hit_targets, @miss) end @subject.sv.set_damage = false @subject.sv.m_a_data = [] end end #============================================================================== # ■ DataManager #------------------------------------------------------------------------------ # 这是一个模块管理游戏和数据库对象。 #============================================================================== module DataManager #-------------------------------------------------------------------------- # ● 创建各种游戏物件 ★再定义 #-------------------------------------------------------------------------- def self.create_game_objects $game_temp = Game_Temp.new $game_system = Game_System.new $game_timer = Game_Timer.new $game_message = Game_Message.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new $sv_camera = Battle_Camera.new end end #============================================================================== # ■ BattleManager #------------------------------------------------------------------------------ # 这是一个模块管理战斗进行。 #============================================================================== module BattleManager #-------------------------------------------------------------------------- # ● 遇敌时时处理 ★再定义 #-------------------------------------------------------------------------- def self.on_encounter @preemptive = (rand < rate_preemptive) @surprise = (rand < rate_surprise && !@preemptive) $sv_camera.mirror = @surprise if N03::BACK_ATTACK end #-------------------------------------------------------------------------- # ● 胜利的处理 ★再定义 #-------------------------------------------------------------------------- def self.process_victory $sv_camera.win_wait = true end #-------------------------------------------------------------------------- # ● 胜利 #-------------------------------------------------------------------------- def self.victory $sv_camera.win_wait = false N03.camera(nil, N03::BATTLE_CAMERA["战斗结束时"].dup) for member in $game_party.members do member.sv.start_action(member.sv.win) if member.movable? end play_battle_end_me replay_bgm_and_bgs $game_message.add(sprintf(Vocab::Victory, $game_party.name)) display_exp gain_gold gain_drop_items gain_exp SceneManager.return battle_end(0) return true end #-------------------------------------------------------------------------- # ● 逃走的处理 ★再定义 #-------------------------------------------------------------------------- def self.process_escape $game_message.add(sprintf(Vocab::EscapeStart, $game_party.name)) success = @preemptive ? true : (rand < @escape_ratio) Sound.play_escape if success process_abort for member in $game_party.members do member.sv.start_action(member.sv.escape) if member.movable? end else @escape_ratio += 0.1 $game_message.add('\.' + Vocab::EscapeFailure) $game_party.clear_actions for member in $game_party.members do member.sv.start_action(member.sv.escape_ng) if member.movable? end end wait_for_message return success end #-------------------------------------------------------------------------- # ● 输入下个命令 ★再定义 #-------------------------------------------------------------------------- def self.next_command begin if !actor || !actor.next_command $game_party.battle_members[@actor_index].sv.command_action = true @actor_index += 1 if @actor_index >= $game_party.members.size for member in $game_party.battle_members.reverse break member.sv.start_action(member.sv.command_a) if member.inputable? end return false end end end until actor.inputable? actor.sv.start_action(actor.sv.command_b) if actor != nil && actor.inputable? if pre_actor pre_actor.sv.start_action(pre_actor.sv.command_a) if pre_actor != nil && pre_actor.inputable? end return true end #-------------------------------------------------------------------------- # ● 输入上个命令 ★再定义 #-------------------------------------------------------------------------- def self.prior_command begin if !actor || !actor.prior_command $game_party.battle_members[@actor_index].sv.command_action = false @actor_index -= 1 if @actor_index < 0 for member in $game_party.battle_members break member.sv.start_action(member.sv.command_a) if member.inputable? end return false end end end until actor.inputable? actor.make_actions if actor.inputable? actor.sv.start_action(actor.sv.command_b) if actor.inputable? after_actor.sv.start_action(after_actor.sv.command_a) if after_actor != nil && after_actor.inputable? return true end #-------------------------------------------------------------------------- # ● 取得上个角色输入的命令 #-------------------------------------------------------------------------- def self.pre_actor return if @actor_index == 0 $game_party.members[@actor_index - 1] end #-------------------------------------------------------------------------- # ● 取得输入命令后的角色 #-------------------------------------------------------------------------- def self.after_actor $game_party.members[@actor_index + 1] end #-------------------------------------------------------------------------- # ● 战斗行动作角色前追加 #-------------------------------------------------------------------------- def self.unshift_action_battlers(battler) @action_battlers.unshift(battler) end end #============================================================================== # ■ Game_Battler #------------------------------------------------------------------------------ # 处理战斗者的类、它是一个类追加角色的方法。 #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # ● 公开实例变量 #-------------------------------------------------------------------------- attr_reader :sv # 侧视图数据 attr_accessor :flash_flg # 闪光标志 #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- alias initialize_game_battler_n03 initialize def initialize initialize_game_battler_n03 @sv = SideView.new(self) end #-------------------------------------------------------------------------- # ● 删除当前的战斗动作 #-------------------------------------------------------------------------- alias remove_current_action_game_battler_n03 remove_current_action def remove_current_action return @sv.derivation_skill_id = 0 if @sv.derivation_skill_id != 0 remove_current_action_game_battler_n03 end #-------------------------------------------------------------------------- # ● 回合结束处理 #-------------------------------------------------------------------------- alias on_turn_end_game_battler_n03 on_turn_end def on_turn_end on_turn_end_game_battler_n03 @sv.add_state = [] @sv.result_damage = [@result.hp_damage, @result.mp_damage] end #-------------------------------------------------------------------------- # ● 比较参数条件 data=[种别, 数值, 判别] #-------------------------------------------------------------------------- def comparison_parameter(data) return true if data[0][0] == 0 kind = data[0] num = data[1] select = data[2] case kind when 1 ; par = level when 2 ; par = mhp when 3 ; par = mmp when 4 ; par = hp when 5 ; par = mp when 6 ; par = tp when 7 ; par = atk when 8 ; par = self.def when 9 ; par = mat when 10 ; par = mdf when 11 ; par = agi when 12 ; par = luk end if num < 0 case kind when 4 ; num = mhp * num / 100 when 5 ; num = mmp * num / 100 when 6 ; num = max_tp * num / 100 end num = num.abs end case select when 0 ; return par == num when 1 ; return par < num when 2 ; return par > num end end #-------------------------------------------------------------------------- # ● 比较装备条件 data=[装备种别, 类型ID] #-------------------------------------------------------------------------- def comparison_equip(data) kind = data[0] items = weapons if kind == 0 items = armors if kind == 1 for item in items for id in data[1] return true if id > 0 && item.is_a?(RPG::Weapon) && item == $data_weapons[id.abs] return true if id > 0 && item.is_a?(RPG::Armor) && item == $data_armors[id.abs] return true if id < 0 && item.is_a?(RPG::Weapon) && item.wtype_id == id.abs return true if id < 0 && item.is_a?(RPG::Armor) && item.stype_id == id.abs end end return false end end #============================================================================== # ■ Game_Actor #------------------------------------------------------------------------------ # 这是一个类来处理与主角。 #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 公开实例变量 #-------------------------------------------------------------------------- attr_reader :actor_id # 主角ID #-------------------------------------------------------------------------- # ● ID #-------------------------------------------------------------------------- def id return @actor_id end #-------------------------------------------------------------------------- # ● 是否使用精灵 ★再定义 #-------------------------------------------------------------------------- def use_sprite? return true end #-------------------------------------------------------------------------- # ● 实行伤害效果 ★再定义 #-------------------------------------------------------------------------- def perform_damage_effect return if !N03::ACTOR_DAMAGE $game_troop.screen.start_shake(5, 5, 10) @sprite_effect_type = :blink Sound.play_actor_damage end end #============================================================================== # ■ Game_Enemy #------------------------------------------------------------------------------ # 它是一个类来处理敌人的角色。 #============================================================================== class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # ● 公开实例变量 #-------------------------------------------------------------------------- attr_reader :enemy_id # 敌人ID #-------------------------------------------------------------------------- # ● ID #-------------------------------------------------------------------------- def id return @enemy_id end #-------------------------------------------------------------------------- # ● 等级 #-------------------------------------------------------------------------- def level return @sv.level end #-------------------------------------------------------------------------- # ● 实行伤害效果 ★再定义 #-------------------------------------------------------------------------- def perform_damage_effect return if !N03::ENEMY_DAMAGE @sprite_effect_type = :blink Sound.play_enemy_damage end #-------------------------------------------------------------------------- # ● 武器 #-------------------------------------------------------------------------- def weapons weapon1 = $data_weapons[@sv.enemy_weapon1_id] weapon2 = $data_weapons[@sv.enemy_weapon2_id] return [weapon1, weapon2] end #-------------------------------------------------------------------------- # ● 防具 #-------------------------------------------------------------------------- def armors return [$data_armors[@sv.enemy_shield_id]] end #-------------------------------------------------------------------------- # ● 二刀流的判定 #-------------------------------------------------------------------------- def dual_wield? return $data_weapons[@sv.enemy_weapon2_id] != nil end #-------------------------------------------------------------------------- # ● 角色图像变更 #-------------------------------------------------------------------------- def graphics_change(battler_name) @battler_name = battler_name end #-------------------------------------------------------------------------- # ● 取得通常攻击的动画ID #-------------------------------------------------------------------------- def atk_animation_id1 return weapons[0].animation_id if weapons[0] return weapons[1] ? 0 : 1 end #-------------------------------------------------------------------------- # ● 取得通常攻击的动画ID (二刀流:武器2) #-------------------------------------------------------------------------- def atk_animation_id2 return weapons[1] ? weapons[1].animation_id : 0 end end #============================================================================== # ■ Sprite_Base #------------------------------------------------------------------------------ # 这是显示你添加处理精灵之类的。 #============================================================================== class Sprite_Base < Sprite #-------------------------------------------------------------------------- # ● 更新动画的坐标 (有归位) #-------------------------------------------------------------------------- def update_animation_position_horming return if @action_end_cancel ani_ox_set if @horming camera_zoom = $sv_camera.zoom camera_zoom = 1 if @move_anime kind = 1 kind = -1 if @ani_mirror && !@anime_no_mirror cell_data = @animation.frames[@animation.frame_max - (@ani_duration + @ani_rate - 1) / @ani_rate].cell_data for i in 0..15 @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 @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 end end #-------------------------------------------------------------------------- # ● 动画原始的坐标设置 #-------------------------------------------------------------------------- def ani_ox_set if !SceneManager.scene_is?(Scene_Battle) @real_x = x @real_y = y end @ani_ox = @real_x - ox + width / 2 @ani_oy = @real_y - oy + height / 2 @ani_oy -= height / 2 if @animation.position == 0 @ani_oy += height / 2 if @animation.position == 2 end #-------------------------------------------------------------------------- # ● 更新动画 #-------------------------------------------------------------------------- alias update_animation_sprite_base_n03 update_animation def update_animation update_animation_position_horming if animation? && SceneManager.scene_is?(Scene_Battle) && @animation.position != 3 update_animation_sprite_base_n03 end #-------------------------------------------------------------------------- # ● 动画的原点设定 ★再定义 #-------------------------------------------------------------------------- def set_animation_origin return ani_ox_set if @animation.position != 3 if viewport == nil @ani_ox = Graphics.width / 2 @ani_oy = Graphics.height / 2 else @ani_ox = viewport.rect.width / 2 @ani_oy = viewport.rect.height / 2 end end #-------------------------------------------------------------------------- # ● 动画精灵的设定 ★再定义 #-------------------------------------------------------------------------- def animation_set_sprites(frame) camera_zoom = 1 camera_zoom = $sv_camera.zoom if @anime_camera_zoom && @animation.position != 3 && SceneManager.scene_is?(Scene_Battle) camera_x = $sv_camera.x camera_y = $sv_camera.y camera_x = camera_y = 0 if @animation.position == 3 or !SceneManager.scene_is?(Scene_Battle) plus_z = 5 plus_z = 1000 if @animation.position == 3 plus_z = -17 if @plus_z != nil && @plus_z == false plus_z = -self.z + 10 if @plus_z != nil && @plus_z == false && @animation.position == 3 cell_data = frame.cell_data @ani_sprites.each_with_index do |sprite, i| next unless sprite pattern = cell_data[i, 0] if !pattern || pattern < 0 sprite.visible = false next end sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2 sprite.visible = true sprite.src_rect.set(pattern % 5 * 192, pattern % 100 / 5 * 192, 192, 192) if @ani_mirror && !@anime_no_mirror sprite.x = (@ani_ox - cell_data[i, 1] - camera_x) * camera_zoom sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom sprite.angle = (360 - cell_data[i, 4]) sprite.mirror = (cell_data[i, 5] == 0) else sprite.x = (@ani_ox + cell_data[i, 1] - camera_x) * camera_zoom sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom sprite.angle = cell_data[i, 4] sprite.mirror = (cell_data[i, 5] == 1) end sprite.z = self.z + plus_z + i sprite.ox = 96 sprite.oy = 96 sprite.zoom_x = cell_data[i, 3] * camera_zoom / 100.0 sprite.zoom_y = cell_data[i, 3] * camera_zoom/ 100.0 sprite.opacity = cell_data[i, 6] * self.opacity / 255.0 sprite.blend_type = cell_data[i, 7] end end #-------------------------------------------------------------------------- # ● 精灵标志 #-------------------------------------------------------------------------- def set(battler, horming, camera_zoom, no_mirror) @battler = battler @next = true self.bitmap = Bitmap.new(@battler.sv.cw, @battler.sv.ch) self.ox = bitmap.width / 2 self.oy = bitmap.height @horming = horming @anime_camera_zoom = camera_zoom @anime_no_mirror = no_mirror @battler.sv.reset_anime_data end #-------------------------------------------------------------------------- # ● 精灵坐标集 #-------------------------------------------------------------------------- def set_position(z, zoom_x, zoom_y, real_x, real_y) self.z = z self.zoom_x = zoom_x self.zoom_y = zoom_y @real_x = real_x @real_y = real_y end #-------------------------------------------------------------------------- # ● 其他精灵的定时处理 #-------------------------------------------------------------------------- def other_process_timing(timing) se_flag = true se_flag = @se_flag if @se_flag != nil @battler.sv.timing.push([se_flag, timing.dup]) end #-------------------------------------------------------------------------- # ● 其他角色的定时处理 #-------------------------------------------------------------------------- def target_battler_process_timing(timing) for target in @timing_targets target.sv.timing.push([false, timing.dup]) end end #-------------------------------------------------------------------------- # ● SE 闪光的定时处理 #-------------------------------------------------------------------------- alias animation_process_timing_sprite_base_n03 animation_process_timing def animation_process_timing(timing) target_battler_process_timing(timing) if @timing_targets && @timing_targets != [] return other_process_timing(timing) if @next != nil animation_process_timing_sprite_base_n03(timing) end #-------------------------------------------------------------------------- # ● 释放动画 #-------------------------------------------------------------------------- alias dispose_animation_sprite_base_n03 dispose_animation def dispose_animation dispose_animation_sprite_base_n03 end end #============================================================================== # ■ Sprite_Battler #------------------------------------------------------------------------------ # 这是显示精灵角色的。 #============================================================================== class Sprite_Battler < Sprite_Base #-------------------------------------------------------------------------- # ● 公开实例变量 #-------------------------------------------------------------------------- attr_accessor :removing # 队伍脱离 #-------------------------------------------------------------------------- # ● 初始化物件 #-------------------------------------------------------------------------- alias initialize_sprite_battler_n03 initialize def initialize(viewport, battler = nil) initialize_sprite_battler_n03(viewport, battler) @real_x = @real_y = 0 update_bitmap if @battler != nil end #-------------------------------------------------------------------------- # ● 开始动画 ★再定义 #-------------------------------------------------------------------------- def start_animation(animation, mirror = false) return next_animation(animation, mirror) if animation? @animation = animation if @animation @horming = @battler.sv.anime_horming @anime_camera_zoom = @battler.sv.anime_camera_zoom @anime_no_mirror = @battler.sv.anime_no_mirror @timing_targets = @battler.sv.timing_targets @plus_z = @battler.sv.anime_plus_z @battler.sv.reset_anime_data @ani_mirror = mirror set_animation_rate @ani_duration = @animation.frame_max * @ani_rate + 1 load_animation_bitmap make_animation_sprites set_animation_origin end end #-------------------------------------------------------------------------- # ● 开始下一个动画 #-------------------------------------------------------------------------- def next_animation(animation, mirror) @next_anime = [] if @next_anime == nil @next_anime.push(Sprite_Base.new(viewport)) @next_anime[@next_anime.size - 1].set(battler, @battler.sv.anime_horming, @battler.sv.anime_camera_zoom, @battler.sv.anime_no_mirror) @next_anime[@next_anime.size - 1].set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y) @next_anime[@next_anime.size - 1].start_animation(animation, mirror) end #-------------------------------------------------------------------------- # ● 创建影图行 #-------------------------------------------------------------------------- def create_shadow reset_shadow return if @battler.sv.shadow == false @shadow = Sprite.new(viewport) if @shadow == nil @shadow.bitmap = Cache.character(@battler.sv.shadow) @shadow.ox = @shadow.bitmap.width / 2 @shadow.oy = @shadow.bitmap.height / 2 end #-------------------------------------------------------------------------- # ● 初始化影图形 #-------------------------------------------------------------------------- def reset_shadow return if @shadow == nil @shadow.dispose @shadow = nil end #-------------------------------------------------------------------------- # ● 更新传输位图 ★再定义 #-------------------------------------------------------------------------- def update_bitmap update_bitmap_enemy if !@battler.actor? update_bitmap_actor if @battler.actor? update_src_rect if @battler != nil update_color if @battler != nil end #-------------------------------------------------------------------------- # ● 传输位图:敌人 #-------------------------------------------------------------------------- def update_bitmap_enemy if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue @battler_name = @battler.battler_name @battler_hue = @battler.battler_hue @battler_graphic_file_index = @battler.sv.graphic_file_index @graphic_mirror_flag = @battler.sv.graphic_mirror_flag self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue) @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id) create_shadow init_visibility @battler_id = @battler.id end end #-------------------------------------------------------------------------- # ● 传输位图:主角 #-------------------------------------------------------------------------- def update_bitmap_actor if @battler.character_name != @battler_name or @battler.character_index != @battler_index @battler_name = @battler.character_name @battler_index = @battler.character_index @battler_graphic_file_index = @battler.sv.graphic_file_index @graphic_mirror_flag = @battler.sv.graphic_mirror_flag self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index) @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id) if !@battler.is_a?(Game_Summon) create_shadow init_visibility @battler_id = @battler.id end end #-------------------------------------------------------------------------- # ● 初始化可见状态 ★再定义 #-------------------------------------------------------------------------- def init_visibility @battler_visible = @battler.alive? @battler_visible = true if @battler.sv.state(1) != "敌人战斗不能" @battler_visible = false if @battler.hidden? @battler.sv.opacity = 0 unless @battler_visible self.opacity = 0 unless @battler_visible self.opacity = 255 if @battler_visible @battler.sv.weapon_visible = @battler_visible end #-------------------------------------------------------------------------- # ● 更新传输矩形 #-------------------------------------------------------------------------- def update_src_rect return if @battler.sv.collapse if @battler_graphic_file_index != @battler.sv.graphic_file_index @battler_graphic_file_index = @battler.sv.graphic_file_index self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index) if @battler.actor? self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue) if !@battler.actor? @battler.sv.set_graphics(self.bitmap.width, self.bitmap.height) end anime_off if @battler.sv.anime_off self.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch) self.opacity = @battler.sv.opacity if @battler_visible set_process_timing(@battler.sv.timing) if @battler && @battler.sv.timing != [] end #-------------------------------------------------------------------------- # ● 更新位置 ★再定义 #-------------------------------------------------------------------------- def update_position @real_x = @battler.sv.x / 100 @real_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust)/ 100 if battler.is_a?(Game_Summon) #如果是召喚成員 則x軸減40 @real_x = @real_x -40#($fu_wan_actor.sv.x / 100) - 40 # # @real_y = ($fu_wan_actor.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust)/ 100 end self.x = @real_x - $sv_camera.x self.y = @real_y - $sv_camera.y self.z = @battler.sv.z - @battler.sv.c / 100 if @battler.sv.h <= 0 self.x += $sv_camera.sx / 100 self.y += $sv_camera.sy / 100 end self.x *= $sv_camera.zoom self.y *= $sv_camera.zoom end #-------------------------------------------------------------------------- # ● 更新原点 ★再定义 #-------------------------------------------------------------------------- def update_origin return if !bitmap or @battler.sv.collapse self.ox = @battler.sv.ox self.oy = @battler.sv.oy self.angle = @battler.sv.angle self.zoom_x = @battler.sv.zoom_x * $sv_camera.zoom self.zoom_y = @battler.sv.zoom_y * $sv_camera.zoom self.mirror = @battler.sv.mirror if !@graphic_mirror_flag self.mirror = !@battler.sv.mirror if @graphic_mirror_flag end #-------------------------------------------------------------------------- # ● 更新影图像 #-------------------------------------------------------------------------- def update_shadow @shadow.visible = @battler.sv.shadow_visible @shadow.opacity = @battler.sv.opacity if @battler.sv.opacity_data[3] @shadow.opacity = self.opacity if !@battler.sv.opacity_data[3] @shadow.x = @real_x - $sv_camera.x @shadow.y = (@battler.sv.y - @battler.sv.c)/ 100 - $sv_camera.y @shadow.z = @battler.sv.z - 10 @shadow.zoom_x = $sv_camera.zoom @shadow.zoom_y = $sv_camera.zoom @shadow.x += $sv_camera.sx / 100 @shadow.y += $sv_camera.sy / 100 @shadow.x *= $sv_camera.zoom @shadow.y *= $sv_camera.zoom @shadow.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil end #-------------------------------------------------------------------------- # ● 更新气球 #-------------------------------------------------------------------------- def update_balloon if @battler.sv.balloon_data == [] && @balloon @balloon_data = [] @balloon.dispose return @balloon = nil elsif @battler.sv.balloon_data != [] && @battler.sv.balloon_data != @balloon_data @balloon_data = @battler.sv.balloon_data @balloon = Sprite.new(self.viewport) @balloon.bitmap = Cache.system("Balloon") @balloon.zoom_x = @balloon_data[3] @balloon.zoom_y = @balloon_data[3] @balloon.ox = 32 if @battler.sv.mirror @balloon.oy = 16 @balloon_count = 0 end return if !@balloon @balloon.opacity = self.opacity @balloon.x = self.x @balloon.y = self.y - @battler.sv.ch * $sv_camera.zoom @balloon.z = self.z + 20 @balloon.src_rect.set(32 + @balloon_count / @balloon_data[2] * 32, @balloon_data[1] * 32, 32, 32) if @balloon_count % @balloon_data[2] == 0 @balloon.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil @balloon_count += 1 @balloon_count = 0 if @balloon_count == @balloon_data[2] * 7 end #-------------------------------------------------------------------------- # ● 更新色调变更 #-------------------------------------------------------------------------- def update_color color_set if @battler.sv.color_set != [] return if @color_data == nil @color_data[4] -= 1 if @color_data[4] == 0 && @color_data[5] != 0 @color_data[4] = @color_data[5] @color_data[5] = 0 @color_data[6] = [0,0,0,0] elsif @color_data[4] == 0 @remain_color_data = @color_data @battler.sv.color = @color_data.dup return @color_data = nil end for i in 0..3 @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4] end @battler.sv.color = @color_data.dup self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) end #-------------------------------------------------------------------------- # ● 更新残像 #-------------------------------------------------------------------------- def update_mirage if @battler.sv.mirage == [] && @mirages @mirage_data = [] for mirage in @mirages do mirage.dispose end return @mirages = nil elsif @battler.sv.mirage != [] && @battler.sv.mirage != @mirage_data @mirage_data = @battler.sv.mirage @mirages = [] for i in 0...@mirage_data[1] do @mirages[i] = Sprite.new(self.viewport) end @mirage_count = 0 end return if !@mirages @mirage_count += 1 @mirage_count = 0 if @mirage_count == @mirage_data[2] * @mirages.size for i in [email]0...@mirages.size[/email] mirage_body(@mirages[i], @mirage_data[4]) if @mirage_count == 1 + i * @mirage_data[2] end end #-------------------------------------------------------------------------- # ● 残像本体 #-------------------------------------------------------------------------- def mirage_body(body, opacity) body.bitmap = self.bitmap.dup body.x = self.x body.y = self.y body.ox = self.ox body.oy = self.oy body.z = self.z - 20 body.mirror = self.mirror body.angle = self.angle body.opacity = opacity * self.opacity / 255 body.zoom_x = self.zoom_x body.zoom_y = self.zoom_y body.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch) body.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil end #-------------------------------------------------------------------------- # ● 更新下一个动画 #-------------------------------------------------------------------------- def update_next_anime return if !@next_anime for anime in @next_anime anime.update anime.set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y) if @horming anime.dispose if !anime.animation? @next_anime.delete(anime) if !anime.animation? end end #-------------------------------------------------------------------------- # ● 更新帧数 #-------------------------------------------------------------------------- alias update_sprite_battler_n03 update def update @battler.sv.update if @battler update_sprite_battler_n03 update_next_anime update_shadow if @battler && @shadow update_mirage if @battler update_balloon if @battler update_remove if @battler && @removing && @battler.sv.change_up end #-------------------------------------------------------------------------- # ● 战斗动画消除 #-------------------------------------------------------------------------- def anime_off @battler.sv.anime_off = false dispose_animation for anime in @next_anime do anime.dispose_animation end if @next_anime end #-------------------------------------------------------------------------- # ● 角色替换 #-------------------------------------------------------------------------- def remove @battler.sv.start_action(@battler.sv.remove_action) $sv_camera.wait = 40 @battler.sv.add_action("eval('set_change')") @removing = true end #-------------------------------------------------------------------------- # ● 更新角色替换 #-------------------------------------------------------------------------- def update_remove @battler.sv.change_up = false @removing = false @battler = nil end #-------------------------------------------------------------------------- # ● 加入角色 #-------------------------------------------------------------------------- def join(join_battler) $sv_camera.wait = 30 @battler = join_battler @battler_name = @battler.character_name @battler_index = @battler.character_index @battler_graphic_file_index = @battler.sv.graphic_file_index self.bitmap = Cache.character(@battler_name) @battler.sv.setup(self.bitmap.width, self.bitmap.height, true) create_shadow init_visibility end #-------------------------------------------------------------------------- # ● 通常的设定返回 ★再定义 #-------------------------------------------------------------------------- def revert_to_normal self.blend_type = 0 self.opacity = 255 end #-------------------------------------------------------------------------- # ● 更新战斗不能效果 #-------------------------------------------------------------------------- alias update_collapse_sprite_battler_n03 update_collapse def update_collapse return if @battler.sv.state(1) != "敌人战斗不能" update_collapse_sprite_battler_n03 @battler.sv.weapon_visible = false end #-------------------------------------------------------------------------- # ● 更新Boss战斗不能效果 ★再定义 #-------------------------------------------------------------------------- def update_boss_collapse @effect_duration = @battler.sv.ch if @effect_duration >= @battler.sv.ch alpha = @effect_duration * 120 / @battler.sv.ch self.ox = @battler.sv.cw / 2 + @effect_duration % 2 * 4 - 2 self.blend_type = 1 self.color.set(255, 255, 255, 255 - alpha) self.opacity = alpha self.src_rect.y -= 1 Sound.play_boss_collapse2 if @effect_duration % 20 == 19 end #-------------------------------------------------------------------------- # ● 另个精灵的定时处理 #-------------------------------------------------------------------------- def set_process_timing(timing_data) for data in timing_data set_timing(data[0],data[1]) end @battler.sv.timing = [] end #-------------------------------------------------------------------------- # ● 定时的处理 #-------------------------------------------------------------------------- def set_timing(se_flag, data) @ani_rate = 4 data.se.play if se_flag case data.flash_scope when 1 ;self.flash(data.flash_color, data.flash_duration * @ani_rate) when 2 ;viewport.flash(data.flash_color, data.flash_duration * @ani_rate) if viewport when 3 ;self.flash(nil, data.flash_duration * @ani_rate) end end #-------------------------------------------------------------------------- # ● 色调变更 #-------------------------------------------------------------------------- def color_set set = @battler.sv.color_set @battler.sv.color_set= [] set[4] = 1 if set[4] == 0 @remain_color_data = [0,0,0,0] if @remain_color_data == nil @color_data = @remain_color_data @color_data[4] = set[4] @color_data[5] = set[5] @color_data[6] = set end #-------------------------------------------------------------------------- # ● 释放 #-------------------------------------------------------------------------- alias dispose_sprite_battler_n03 dispose def dispose dispose_sprite_battler_n03 @shadow.dispose if @shadow != nil @balloon.dispose if @balloon != nil for mirage in @mirages do mirage.dispose end if @mirages != nil for anime in @next_anime do anime.dispose end if @next_anime end end #============================================================================== # ■ Spriteset_Battle #------------------------------------------------------------------------------ # 这是一个类结合了精灵的战斗画面。 #============================================================================== class Spriteset_Battle #-------------------------------------------------------------------------- # ● 战斗背景(地)创建精灵 ★再定义 #-------------------------------------------------------------------------- def create_battleback1 @back1_sprite = Sprite_Battle_Back.new(@viewport1, 1, battleback1_name) @back1_sprite.set_graphics(battleback1_bitmap) if battleback1_name != nil @back1_sprite.z = 0 end #-------------------------------------------------------------------------- # ● 战斗背景(壁)创建精灵 ★再定义 #-------------------------------------------------------------------------- def create_battleback2 @back2_sprite = Sprite_Battle_Back.new(@viewport1, 2, battleback2_name) @back2_sprite.set_graphics(battleback2_bitmap) if battleback2_name != nil @back2_sprite.z = 1 end #-------------------------------------------------------------------------- # ● 创建角色精灵 ★再定义 #-------------------------------------------------------------------------- def create_actors @actor_sprites = [] for i in 0...$game_party.max_battle_members # max_battle_members參戰角色的最大數 @actor_sprites[i] = Sprite_Battler.new(@viewport1, $game_party.members[i]) end @effect_sprites = Spriteset_Sideview.new(@viewport1) #处理战斗画面的精灵的类 end #-------------------------------------------------------------------------- # ● 更新角色精灵 ★再定义 #-------------------------------------------------------------------------- def update_actors @actor_sprites.each_with_index do |sprite, i| sprite_join($game_party.members[i], sprite) if sprite.battler == nil && sprite.battler != $game_party.members[i] sprite.remove if sprite.battler != nil && !sprite.removing && sprite.battler != $game_party.members[i] sprite.update end @effect_sprites.update update_program end #-------------------------------------------------------------------------- # ● 加入精灵成员 #-------------------------------------------------------------------------- def sprite_join(member, sprite) for sp in @actor_sprites sp.update_remove if member == sp.battler && !sp.battler.sv.change_up end sprite.join(member) end #-------------------------------------------------------------------------- # ● 更新战斗程序 #-------------------------------------------------------------------------- def update_program return if $sv_camera.program_scroll == [] for data in $sv_camera.program_scroll @back1_sprite.start_back_data(data) if data[2] == 1 @back2_sprite.start_back_data(data) if data[2] == 2 end $sv_camera.program_scroll = [] end #-------------------------------------------------------------------------- # ● 实行打击时的战斗动画 #-------------------------------------------------------------------------- def set_hit_animation(battler, weapon_index, hit_targets, miss) @effect_sprites.set_hit_animation(battler, weapon_index, hit_targets, miss) end #-------------------------------------------------------------------------- # ● 伤害POP #-------------------------------------------------------------------------- def set_damage_pop(target) @effect_sprites.set_damage_pop(target) end #-------------------------------------------------------------------------- # ● 释放 #-------------------------------------------------------------------------- alias dispose_spriteset_battle_n03 dispose def dispose dispose_spriteset_battle_n03 @effect_sprites.dispose end end #============================================================================== # ■ Window_BattleLog #------------------------------------------------------------------------------ # 进行战斗的实况显示窗口。 #============================================================================== class Window_BattleLog < Window_Selectable #-------------------------------------------------------------------------- # ● 等待 ★再定义 #-------------------------------------------------------------------------- def wait end #-------------------------------------------------------------------------- # ● 等待和清除 ★再定义 #-------------------------------------------------------------------------- def wait_and_clear $sv_camera.wait = 10 end #-------------------------------------------------------------------------- # ● 显示动作结果 ★再定义 #-------------------------------------------------------------------------- def display_action_results(target, item) if target.result.used last_line_number = line_number display_critical(target, item) display_damage(target, item) display_affected_status(target, item) display_failure(target, item) end off if !N03::BATTLE_LOG end #-------------------------------------------------------------------------- # ● 隐藏窗口 #-------------------------------------------------------------------------- def off @back_sprite.visible = self.visible = false end end #============================================================================== # ■ Game_Interpreter #------------------------------------------------------------------------------ # 这是一个事件命令的解释器。 #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ● 开关的操作 #-------------------------------------------------------------------------- alias command_121_game_interpreter_n03 command_121 def command_121 command_121_game_interpreter_n03 $sv_camera.program_check end end
橫版
#==============================================================================
# ■ Sideview Ver100
#------------------------------------------------------------------------------
# 管理角色侧视图战斗设定。
# 汉化by: 圣痕
#==============================================================================
class SideView
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :x # 画面X坐标
attr_accessor :y # 画面Y坐标
attr_accessor :z # 画面Z坐标
attr_accessor :h # 高度坐标
attr_accessor :j # 跳跃坐标
attr_accessor :c # 曲线坐标
attr_accessor :ox # 横原点
attr_accessor :oy # 纵原点
attr_accessor :oy_adjust # 縦原点修正
attr_accessor :angle # 旋转角度
attr_accessor :zoom_x # 横扩大率
attr_accessor :zoom_y # 纵扩大率
attr_accessor :pattern_w # 细胞横位置(矩形内)
attr_accessor :pattern_h # 细胞縦位置(矩形内)
attr_accessor :sx # 细胞横位置(画像全体)
attr_accessor :sy # 细胞縦位置(画像全体)
attr_accessor :pattern_type # 单元更新类型
attr_accessor :pattern_time # 单元更新间隔
attr_accessor :graphic_name # 角色画像文件名
attr_accessor :graphic_file_index # 角色画像文件名指数
attr_accessor :graphic_index # 角色画像指数
attr_accessor :cw # 矩形横组件
attr_accessor :ch # 矩形纵组件
attr_accessor :shadow_visible # 阴影表示
attr_accessor :weapon_visible # 武器表示
attr_accessor :wait # 下一个动作等待时间
attr_accessor :weapon_index # 显示图像的武器排列指数
attr_accessor :weapon_end # 武器动画结束标记
attr_accessor :force_action # 強制动作
attr_accessor :target_battler # 目标角色情報
attr_accessor :second_targets # 第二个目标角色情報
attr_accessor :m_a_targets # 飞行动画目标情報
attr_accessor :individual_targets # 个别处理目标角色情报
attr_accessor :effect_data # 效果数据
attr_accessor :anime_id # 动画ID配列
attr_accessor :anime_move_id # 飞行动画ID配列
attr_accessor :mirror # 反转标志
attr_accessor :opacity # 透明度
attr_accessor :opacity_data # 透明度操作情报
attr_accessor :set_damage # 战斗场景的损伤处理
attr_accessor :m_a_data # 飞行动画情报
attr_accessor :m_a_starter # 飞行动画开始目标情报
attr_accessor :action_end # 行动后结束
attr_accessor :damage_anime_data # 战斗损伤动画的数据
attr_accessor :anime_no_mirror # 战斗动画禁止反转
attr_accessor :anime_horming # 战斗动画归位标志
attr_accessor :anime_camera_zoom # 战斗动画扩大缩小的相机
attr_accessor :anime_plus_z # 战斗动画Z坐标修正
attr_accessor :derivation_skill_id # 技能连发ID
attr_accessor :immortal # 无敌标志
attr_accessor :mirage # 残像数据
attr_accessor :balloon_data # 气球数据
attr_accessor :timing # 从角色不同的时序数据
attr_accessor :timing_targets # 时间数据传递另个角色
attr_accessor :color_set # 色调变更数据
attr_accessor :color # 色调数据
attr_accessor :change_up # 画像变更数据
attr_accessor :hit # 更加次数
attr_accessor :add_state # 增加状态的显示防止标记
attr_accessor :counter_id # 计数器时的技能ID
attr_accessor :reflection_id # 魔法反射式的动画ID
attr_accessor :result_damage # 回合结束时的HP数据变更
attr_accessor :active # 行动权
attr_accessor :anime_off # 战斗动画删除
attr_accessor :command_action # 行动指令标志
attr_accessor :base_x # 初期位置 X坐标
attr_accessor :base_y # 初期位置 Y坐标
attr_accessor :base_h # 初期位置 高度坐标
attr_accessor :max_pattern_w # 单元的横分割数
attr_accessor :max_pattern_h # 单元的纵分割数
attr_reader :collapse # 角色战斗不能
attr_reader :picture # 图片显示标记
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize(battler)
[url=home.php?mod=space&uid=133701]@battler[/url] = battler
reset
end
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
def reset
@x = 0
@y = 0
@z = 0
@h = 0
@j = 0
@c = 0
[url=home.php?mod=space&uid=271873]@jump[/url] = []
@curve = []
@ox = 0
@oy = 0
@oy_adjust = 0
@z_plus = 0
@move_time = 0
[url=home.php?mod=space&uid=124954]@Angle[/url] = 0
@angle_time = 0
@zoom_x = 1
@zoom_y = 1
@zoom_time = 0
@pattern_w = 0
@pattern_h = 0
@sx = 0
@sy = 0
@pattern_type = 0
@pattern_time = 0
@pattern_rest_time = 0
@graphic_name = ""
@graphic_file_index = ""
@graphic_index = 0
@cw = 0
@ch = 0
@shadow_visible = false
@weapon_visible = true
[url=home.php?mod=space&uid=36110]@Wait[/url] = 0
@weapon_index = []
@weapon_end = true
@full_action = []
@action = []
@force_action = ""
@target_battler = []
@second_targets = []
@individual_targets = []
@m_a_targets = []
@effect_data = []
@anime_id = []
@anime_move_id = []
[url=home.php?mod=space&uid=316553]@opacity[/url] = 255
@opacity_data = []
@set_damage = false
@m_a_data = []
@m_a_starter = []
@action_end = false
@damage_anime_data = []
@anime_no_mirror = false
@anime_horming = false
@anime_camera_zoom = false
@anime_plus_z = true
@derivation_skill_id = 0
@immortal = false
@mirage = []
@play_data = []
@balloon_data = []
@picture = false
@timing = []
@timing_targets = []
@color_set = []
[url=home.php?mod=space&uid=10453]@color[/url] = []
@change_up = false
@non_motion = false
@graphics_change = false
@hit = []
@add_state = []
@collapse = false
@counter_id = 0
@reflection_id = 0
@result_damage = [0,0]
@active = false
@anime_off = false
@command_action = false
@base_x = 0
@base_y = 0
@base_z = 0
@base_h = 0
@max_pattern_w = 0
@max_pattern_h = 0
@pattern_kind = 0
@pattern_count = 0
@move_time = 0
[url=home.php?mod=space&uid=111303]@mirror[/url] = false
@battler.set_graphic(@pre_change_data[0], @pre_change_data[1], @pre_change_data[2], @pre_change_data[3]) if @pre_change_data != nil
@pre_change_data = nil
end
#--------------------------------------------------------------------------
# ● 格局
#--------------------------------------------------------------------------
def setup(bitmap_width, bitmap_height, first_action_flag)
reset if first_action_flag
set_data
set_base_position if !@graphics_change
set_graphics(bitmap_width, bitmap_height)
set_target
setup_graphics_change if @graphics_change
first_battler_anime_set if first_action_flag
end
#--------------------------------------------------------------------------
# ● 取得角色数据
#--------------------------------------------------------------------------
def set_data
return if @battler == nil
if @battler.actor?
@graphic_name = @battler.character_name
@graphic_index = @battler.character_index
else
@graphic_name = @battler.battler_name
@graphic_index = 0
end
@max_pattern_w = max_pattern[0]
@max_pattern_h = max_pattern[1]
end
#--------------------------------------------------------------------------
# ● 基础坐标设置 data=[X轴, Y轴, H轴] moment_set…即时配置
#--------------------------------------------------------------------------
def set_base_position(moment_set = true)
mirroring_reset
if @battler.actor? && !@battler.is_a?(Game_Summon)
data = N03::ACTOR_POSITION[@battler.index].dup
@base_x = data[0] * 100 if !@mirror
@base_x = (Graphics.width - data[0]) * 100 if @mirror
else
data = [@battler.screen_x, @battler.screen_y, 0].dup
@base_x = data[0] * 100 if !$sv_camera.mirror
@base_x = (Graphics.width - data[0]) * 100 if $sv_camera.mirror
end
if @battler.is_a?(Game_Summon) #如果是召喚獸 則設定召喚獸座標
if @battler.actor_id < 16 #如果不是動物
data = N03::SUMMON_POSITION[$fu_wan_actor.index].dup #位置為召喚者前方#SUMMON_POSITION陣列
else
p "動物"
data = N03::ANIMAL_POSITION[$fu_wan_actor.index].dup
end
@base_x = data[0] * 100 if !@mirror
@base_x = (Graphics.width - data[0]) * 100 if @mirror
end
@base_y = data[1] * 100
@base_h = data[2] * 100
@base_z = @y
return if !moment_set
@x = @base_x
@y = @base_y
@z = @base_z
end
#--------------------------------------------------------------------------
# ● 取得图像数据
#--------------------------------------------------------------------------
def set_graphics(bitmap_width, bitmap_height)
sign = @graphic_name[/^[\!\$]./]
if sign && sign.include?('$')
@cw = bitmap_width / @max_pattern_w
@ch = bitmap_height / @max_pattern_h
elsif @max_pattern_w == 1 && @max_pattern_h == 1
@cw = bitmap_width
@ch = bitmap_height
else
@cw = bitmap_width / (@max_pattern_w * 4)
@ch = bitmap_height / (@max_pattern_h * 2)
end
@ox = @cw / 2
@oy = @ch
@sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
@sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
end
#--------------------------------------------------------------------------
# ● 设定目标
#--------------------------------------------------------------------------
def set_target(target = nil)
@target_battler = target
@target_battler = [@battler] if target == nil
@second_targets = @target_battler
end
#--------------------------------------------------------------------------
# ● 设置图像的变更
#--------------------------------------------------------------------------
def setup_graphics_change
@graphics_change = false
@sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
@sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
end
#--------------------------------------------------------------------------
# ● 取得战斗开始时的待机动画图像数据
#--------------------------------------------------------------------------
def first_battler_anime_set
loop do
update
break if @action_data == nil
break if @action_data[0] == "motion"
break if @action_data[0] == "move" && @action_data[8] != ""
break if @full_action == []
end
start_action(first_action) if @battler.movable?
end
#--------------------------------------------------------------------------
# ● 开始动作
#--------------------------------------------------------------------------
def start_action(kind = nil)
return if @event_fix && $game_troop.interpreter.running?
# 等待中的场合取消
return @wait -= 1 if @wait > 0 && kind == nil
action_setup(false) if kind != nil
set_action(kind)
@action = kind if @action == nil
# 动作顺序行动结束处理转变
action_terminate if @action == nil
# 决定下一个动作
@action_data = N03::ACTION[@action]
next_action
end
#--------------------------------------------------------------------------
# ● 初始化行动参数
#--------------------------------------------------------------------------
def action_setup(reset = true)
@event_fix = false
@set_damage = false
@action_end = false
@balloon_data = []
@loop_act = []
angle_reset if reset
zoom_reset if reset
opacity_reset if reset
@curve = []
@c = 0
convert_jump
end
#--------------------------------------------------------------------------
# ● 行动结束的处理
#--------------------------------------------------------------------------
def action_terminate
@mirage = [] if @mirage_end
mirroring_reset
@picture = false
@individual_targets = []
action_setup if @active
action_setup(false) if !@active
# 待机开始行动迁移
stand_by_action if !@non_motion
# 战斗行动激活结束权利
next_battler
end
#--------------------------------------------------------------------------
# ● 新动作内容的決定
#--------------------------------------------------------------------------
def set_action(kind = nil)
full_act = N03::FULLACTION[kind]
@full_action = full_act.dup if full_act != nil
@action = @full_action.shift
# 参考全部动作如果全部动作统合
full_act2 = N03::FULLACTION[@action]
@full_action = full_act2.dup + @full_action if full_act2 != nil
end
#--------------------------------------------------------------------------
# ● 采取下个行动
#--------------------------------------------------------------------------
def next_action
@wait = 0
# 捷径确认
eval(@action) if @action != nil && @action_data == nil && N03::FULLACTION[@action] == nil
# 体能设定
@wait = @action.to_i if @wait == 0 && @action_data == nil
@wait = rand(@wait.abs + 1) if @wait < 0
# 开始动作
action_play
end
#--------------------------------------------------------------------------
# ● 待机开始动作迁移
#--------------------------------------------------------------------------
def stand_by_action
# 通常待机
stand_by_act = normal
# HP的1/4紧要关头行动
stand_by_act = pinch if @battler.hp <= @battler.mhp / 4
# 状态检查
stand_by_act = state(@battler.states[0].id) if @battler.states[0] != nil && state(@battler.states[0].id) != nil
# 指令检查
stand_by_act = command if @command_action && command != nil
set_action(stand_by_act)
@action = stand_by_act if @action == nil
end
#--------------------------------------------------------------------------
# ● 开始强制动作
#--------------------------------------------------------------------------
def start_force_action
return if @active
start_action(@force_action)
@force_action = ""
end
#--------------------------------------------------------------------------
# ● 追加动作
#--------------------------------------------------------------------------
def add_action(kind)
@full_action.push(kind)
end
#--------------------------------------------------------------------------
# ● 插入动作
#--------------------------------------------------------------------------
def unshift_action(kind)
@full_action.unshift(kind)
end
#--------------------------------------------------------------------------
# ● 更新帧数
#--------------------------------------------------------------------------
def update
# 开始动作
start_action
# 开始强制动作
start_force_action if @force_action != ""
# 更新动画模式
update_pattern
# 更新移动
update_move
# 更新旋转
update_angle if @angle_time != 0
# 更新扩大缩小
update_zoom if @zoom_time != 0
# 更新透明度
update_opacity if @opacity_data != []
end
#--------------------------------------------------------------------------
# ● 更新动画模式
#--------------------------------------------------------------------------
def update_pattern
return @pattern_rest_time -= 1 if @pattern_rest_time != 0
return if @max_pattern_w == 1 && @max_pattern_h == 1
@pattern_rest_time = @pattern_time
# 开始播放・取得结束单元位置
if @pattern_kind > 0 # 通常播放中
@pattern_start = 0
@pattern_end = @max_pattern_w - 1
elsif @pattern_kind < 0 # 逆转播放中
@pattern_start = @max_pattern_w - 1
@pattern_end = 0
end
# 结束单程的播放
@pattern_count += 1 if @pattern_w == @pattern_end && @pattern_kind != 0
# 循环处理
case @pattern_type.abs
when 1,3 # 单程
@pattern_kind = 0 if @pattern_count != 0 && @pattern_type == 1
@pattern_kind = 0 if @pattern_count != 0 && @pattern_type == -1
@pattern_kind = 1 if @pattern_count != 0 && @pattern_type == 3
@pattern_kind = -1 if @pattern_count != 0 && @pattern_type == -3
@pattern_w = @pattern_start - @pattern_kind if @pattern_count != 0 && @pattern_type.abs == 3
@pattern_count = 0
when 2,4 # 往返
@pattern_kind = -1 if @pattern_count == 1 && @pattern_type == 2
@pattern_kind = 1 if @pattern_count == 1 && @pattern_type == -2
@pattern_kind = 0 if @pattern_count == 2 && @pattern_type == 2
@pattern_kind = 0 if @pattern_count == 2 && @pattern_type == -2
@pattern_kind = -1 if @pattern_count == 1 && @pattern_type == 4
@pattern_kind = 1 if @pattern_count == 1 && @pattern_type == -4
@pattern_kind = 1 if @pattern_count == 2 && @pattern_type == 4
@pattern_kind = -1 if @pattern_count == 2 && @pattern_type == -4
@pattern_count = 0 if @pattern_count == 2
end
# 更新单元
@pattern_w += 1 * @pattern_kind
@sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
end
#--------------------------------------------------------------------------
# ● 更新移动
#--------------------------------------------------------------------------
def update_move
@z = @y / 100 + @z_plus
return if @move_time == 0
target_position_set if @horming_move
@x = (@x * (@move_time - 1) + @target_x) / @move_time
@y = (@y * (@move_time - 1) + @target_y) / @move_time
@h = (@h * (@move_time - 1) + @target_h) / @move_time if @move_h != nil
@c += @curve[@move_time - 1] if @curve[@move_time - 1] != nil
@j += @jump[@move_time - 1] if @jump[@move_time - 1] != nil
@move_time -= 1
convert_jump if @move_time == 0
end
#--------------------------------------------------------------------------
# ● 更新移动目标
#--------------------------------------------------------------------------
def target_position_set
target_position = N03.get_targets_position(@move_targets, @horming_move)
@target_x = target_position[0] + @move_x
@target_y = target_position[1] + @move_y
@target_h = target_position[2] + @move_h if @move_h != nil
end
#--------------------------------------------------------------------------
# ● 更新旋转
#--------------------------------------------------------------------------
def update_angle
@angle += @angling
@angle_time -= 1
return if @angle_time != 0
return angle_reset if @angle_data[4] == 0
angling(@angle_data) if @angle_data[4] == 2
end
#--------------------------------------------------------------------------
# ● 更新扩大缩小
#--------------------------------------------------------------------------
def update_zoom
@zoom_x += @zooming_x
@zoom_y += @zooming_y
@zoom_time -= 1
return if @zoom_time != 0
return zoom_reset if @zoom_data[4] == 0
zooming(@zoom_data) if @zoom_data[4] == 2
end
#--------------------------------------------------------------------------
# ● 更新透明度
#--------------------------------------------------------------------------
def update_opacity
@opacity += @opacity_data[2]
@opacity_data[0] -= 1
return if @opacity_data[0] != 0
return if !@opacity_data[5]
@opacity_data[2] *= -1
@opacity_data[0] = @opacity_data[1]
end
#--------------------------------------------------------------------------
# ● 实行动作
#--------------------------------------------------------------------------
def action_play
return if @action_data == nil
action = @action_data[0]
# 战斗角色反转的场合
return mirroring if action == "mirror"
# 残像的场合
return mirage_set if action == "mirage"
# 回转的场合
return angling if action == "angle"
# 扩大缩小的场合
return zooming if action == "zoom"
# 透明度操作的场合
return set_opacity if action == "opacity"
# 战斗角色动画的場合
return battler_anime if action == "motion"
# 移动的場合
return move if action == "move"
# 武器动画的場合
return weapon_anime([@action_data]) if action == "wp"
# 跳过动画的場合
return move_anime if action == "m_a"
# 战斗场景通讯的场合(战斗不能)
return set_play_data if action == "collapse" or action == "no_collapse"
# 显示战斗数据库的动画的場合
return battle_anime if action == "anime"
# 摄影的場合
return camera if action == "camera"
# 画面摇动的場合
return shake if action == "shake"
# 画面色调变更的場合
return color_effect if action == "color"
# 过渡的場合
return transition if action == "ts"
# 气球动画显示的場合
return balloon_anime if action == "balloon"
# 图片显示的場合
return picture_set if action == "pic"
# 状态操作的場合
return state_set if action == "sta"
# FPS变更的場合
return fps if action == "fps"
# 战斗角色图像变更的場合
return graphics_change if action == "change"
# 技能衍生的場合
return derivating_skill if action == "der"
# BGM/BGS/SE演奏的場合
return sound if action == "sound"
# 电影再生的場合
return movie if action == "movie"
# 游戏开关操作的場合
return switches if action == "switch"
# 变量开关操作的場合
return variable if action == "variable"
# 条件分岐(游戏开关)的場合
return nece_1 if action == "n_1"
# 条件分岐(游戏变量)的場合
return nece_2 if action == "n_2"
# 条件分岐(状态)的場合
return nece_3 if action == "n_3"
# 条件分岐(技能)的場合
return nece_4 if action == "n_4"
# 条件分岐(参数)的場合
return nece_5 if action == "n_5"
# 条件分岐(装备)的場合
return nece_6 if action == "n_6"
# 条件分岐(脚本)的場合
return nece_7 if action == "n_7"
# 第二目标操作的場合
return second_targets_set if action == "s_t"
# 呼叫公共事件的場合
return call_common_event if action == "common"
# 战斗动画关闭的場合
return @anime_off = true if action == "anime_off"
# 强制战斗结束的場合
return BattleManager.process_abort if action == "battle_end"
# 画面固定的場合
return Graphics.freeze if action == "graphics_freeze"
# 损坏动画的場合
return damage_anime if action == "damage_anime"
# 武器不可见的場合
return @weapon_visible = false if action == "weapon_off"
# 武器可见的場合
return @weapon_visible = true if action == "weapon_on"
# 等待取消的場合
return @non_motion = true if action == "non_motion"
# 等待取消解除的場合
return @non_motion = false if action == "non_motion_cancel"
# 初期位置变更的場合
return change_base_position if action == "change_base_position"
# 初期位置变更解除的場合
return set_base_position(false) if action == "set_base_position"
# 强制行动的場合
return force_act if action == "force_action"
# 强制行动的場合 (第二目标)
return force_act2 if action == "force_action2"
# 个人开始的場合
return individual_start if action == "individual_start"
# 个人结束的場合
return individual_end if action == "individual_end"
# 循环开始的場合
return loop_start if action == "loop_start"
# 循环结束的場合
return loop_end if action == "loop_end"
# 只有行动的場合
return only_action_on if action == "only_action_on"
# 只有行动解除的場合
return only_action_off if action == "only_action_off"
# 下个战斗角色的場合
return next_battler if action == "next_battler"
# 画面变更标记的場合
return set_change if action == "set_change"
# 脚本操作的場合
return eval(@action_data[0])
end
#--------------------------------------------------------------------------
# ● 实行角色反转
#--------------------------------------------------------------------------
def mirroring
@mirror = !@mirror
end
#--------------------------------------------------------------------------
# ● 初始化反转
#--------------------------------------------------------------------------
def mirroring_reset
@mirror = false
mirroring if !@battler.actor? && N03::ENEMY_MIRROR
mirroring if $sv_camera.mirror
end
#--------------------------------------------------------------------------
# ● 实行残像
#--------------------------------------------------------------------------
def mirage_set
@mirage = @action_data.dup
@mirage_end = @mirage[3]
@mirage = [] if @mirage[1] == 0
end
#--------------------------------------------------------------------------
# ● 实行旋转
#--------------------------------------------------------------------------
def angling(data = @action_data)
@angle_data = data.dup
@oy = @ch / 2
@oy_adjust = @ch * 50
@angle_time = data[1]
start_angle = data[2] * N03.mirror_num(@mirror)
end_angle = data[3] * N03.mirror_num(@mirror)
# 时间要是0以下时立即到最后角度
@angle_time = 1 if @angle_time <= 0
# 从旋转时间计算一格相当于的角度
@angling = (end_angle - start_angle) / @angle_time
# 不能整除的剩余到初期角度
@angle = (end_angle - start_angle) % @angle_time + start_angle
end
#--------------------------------------------------------------------------
# ● 初始化旋转
#--------------------------------------------------------------------------
def angle_reset
@oy = @ch
@angle = @angle_time = @oy_adjust = 0
end
#--------------------------------------------------------------------------
# ● 实行扩大缩小
#--------------------------------------------------------------------------
def zooming(data = @action_data)
@zoom_data = data.dup
@zoom_time = data[1]
start_zoom_x = data[2][0]
start_zoom_y = data[2][1]
end_zoom_x = data[3][0]
end_zoom_y = data[3][1]
# 时间是0以下时跳过
@zoom_time = 1 if @zoom_time <= 0
# 从放大时间中计算一格相当于的放大率
@zooming_x = (end_zoom_x - start_zoom_x) / @zoom_time
@zooming_y = (end_zoom_y - start_zoom_y) / @zoom_time
# 开始的大小
@zoom_x = start_zoom_x
@zoom_y = start_zoom_y
end
#--------------------------------------------------------------------------
# ● 实行扩大缩小
#--------------------------------------------------------------------------
def zoom_reset
@zoom_x = @zoom_y = 1
@zoom_time = 0
end
#--------------------------------------------------------------------------
# ● 角色透明度操作
#--------------------------------------------------------------------------
def set_opacity
data = @action_data.dup
@opacity = data[2]
opacity_move = (data[3] - data[2])/ data[1]
@opacity_data = [data[1], data[1], opacity_move, data[4], data[5], data[6]]
@wait = data[1] if data[7]
@wait *= 2 if data[6] && data[7]
end
#--------------------------------------------------------------------------
# ● 初始化透明度操作
#--------------------------------------------------------------------------
def opacity_reset
@opacity = 255
@opacity = 0 if @battler.hidden?
@opacity_data = []
end
#--------------------------------------------------------------------------
# ● 实行角色动画
#--------------------------------------------------------------------------
def battler_anime(anime_data = nil)
anime_data = @action_data.dup if anime_data == nil
@graphic_file_index = anime_data[1] if !graphic_fix
@pattern_h = anime_data[2]
@pattern_w = anime_data[3]
@pattern_h = 0 if @max_pattern_w == 1
@pattern_w = 0 if @max_pattern_h == 1
@pattern_type = anime_data[4]
@pattern_time = anime_data[5]
@pattern_rest_time = anime_data[5]
@pattern_count = 0
@pattern_kind = 1
@pattern_kind = -1 if @pattern_type < 0
@pattern_kind = 0 if @pattern_type == 0
@sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
@sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
@z_plus = anime_data[6]
@wait = set_anime_wait if anime_data[7]
@shadow_visible = anime_data[8]
weapon_anime(anime_data)
end
#--------------------------------------------------------------------------
# ● 计算等待动画
#--------------------------------------------------------------------------
def set_anime_wait
if @pattern_type > 0
pattern_time_a = @max_pattern_w - @pattern_w.abs
elsif @pattern_type < 0
pattern_time_a = @pattern_w.abs + 1
else
return @pattern_time if @pattern_type == 0
end
case @pattern_type
when 1,-1, 3,-3
return pattern_time_a * @pattern_time
when 2,-2, 4,-4
return pattern_time_a * @pattern_time + (@max_pattern_w - 2) * @pattern_time
end
end
#--------------------------------------------------------------------------
# ● 实行移动
#--------------------------------------------------------------------------
def move
@move_targets = N03.get_targets(@action_data[1].abs, @battler)
return if @move_targets == []
@move_targets = [@battler] if @action_data[1].abs == 7
@move_x = @action_data[2] * 100 * N03.mirror_num(@mirror)
@move_y = @action_data[3] * 100
@move_h = @action_data[4] * 100 if @action_data[4] != nil
@move_h = nil if @action_data[4] == nil
battler_anime(N03::ACTION[@action_data[8]].dup) if N03::ACTION[@action_data[8]] != nil
@horming_move = true
@horming_move = false if @action_data[1] < 0 or @action_data[1].abs == 7
target_position_set
target_position = [@target_x, @target_y, @target_z]
distanse_move = @action_data[5] > 0
@move_time = N03.distanse_calculation(@action_data[5].abs, target_position, [@x, @y, @z], distanse_move)
@wait = @move_time
curve
jump
@move_time = 1 if @move_time == 0
@horming_move = false if !@move_targets or @move_targets.include?(@battler)
update_move if @move_time == 1
end
#--------------------------------------------------------------------------
# ● 实行曲线
#--------------------------------------------------------------------------
def curve
@c = 0
return if @action_data[6] == 0
@curve = N03.parabola([@action_data[6], -@action_data[6]], @move_time, 100, 4)
end
#--------------------------------------------------------------------------
# ● 实行跳跃
#--------------------------------------------------------------------------
def jump
convert_jump
return if @action_data[7] == [0,0]
@jump = N03.parabola(@action_data[7].dup, @move_time, 100)
end
#--------------------------------------------------------------------------
# ● J坐标(跳跃高度)H坐标变换
#--------------------------------------------------------------------------
def convert_jump
@h += @j
@j = 0
@jump = []
end
#--------------------------------------------------------------------------
# ● 实行数据库战斗动画
#--------------------------------------------------------------------------
def battle_anime
data = @action_data.dup
targets = N03.get_targets(data[2], @battler)
return if targets == []
data[8] = !data[8] if @mirror
@set_damage = data[5]
@damage_anime_data[0] = N03.get_attack_anime_id(data[1], @battler)
@damage_anime_data[1] = data[8]
@damage_anime_data[2] = data[7]
@damage_anime_data[3] = data[6]
@damage_anime_data[4] = data[9]
@wait = N03.get_anime_time(@damage_anime_data[0]) - 2 if data[4]
return if @set_damage
for target in targets do display_anime(targets, target, data) end
end
#--------------------------------------------------------------------------
# ● 开始武器动画
#--------------------------------------------------------------------------
def weapon_anime(anime_data)
@weapon_end = true
for i in 9...anime_data.size
set_effect_data(anime_data[i]) if anime_data[i] != ""
end
end
#--------------------------------------------------------------------------
# ● 开始飞行动画
#--------------------------------------------------------------------------
def move_anime
@m_a_starter = []
@m_a_targets = []
starters = N03.get_targets(@action_data[2], @battler)
targets = N03.get_targets(@action_data[3], @battler)
return if starters == [] or targets == []
single_start = true if starters != nil && @action_data[2] < 0
single_start = true if @action_data[1][0] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][0], @battler)].position == 3
starters = [starters[0]] if single_start
single_end = true if targets != nil && @action_data[3] < 0
single_end = true if @action_data[1][1] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][1], @battler)].position == 3
targets = [targets[0]] if single_end
se_flag = true
for starter in starters
for target in targets
data = @action_data.dup
data[17] = se_flag
@effect_data.push(data)
@m_a_targets.push(target)
@m_a_starter.push(starter)
se_flag = false
end
end
end
#--------------------------------------------------------------------------
# ● 效果通讯设置
#--------------------------------------------------------------------------
def set_effect_data(data = @action)
action_data = N03::ACTION[data]
return if action_data == nil
@effect_data.push(action_data.dup)
end
#--------------------------------------------------------------------------
# ● 战斗场景通讯的数据储存
#--------------------------------------------------------------------------
def set_play_data(data = @action_data)
@play_data = data.dup
end
#--------------------------------------------------------------------------
# ● 战斗动画显示
#--------------------------------------------------------------------------
def display_anime(targets, target, data)
return if !N03.first_of_all_screen_anime(data[1], target, targets)
target.animation_id = N03.get_attack_anime_id(data[1], @battler)
target.animation_mirror = data[8]
target.sv.anime_horming = data[3]
target.sv.anime_camera_zoom = data[6]
target.sv.anime_no_mirror = data[7]
target.sv.anime_plus_z = data[9]
end
#--------------------------------------------------------------------------
# ● 初始化战斗动画扩张数据
#--------------------------------------------------------------------------
def reset_anime_data
@anime_no_mirror = false
@anime_horming = false
@anime_camera_zoom = false
@timing_targets = []
@anime_plus_z = true
end
#--------------------------------------------------------------------------
# ● 摄影机
#--------------------------------------------------------------------------
def camera
data = @action_data.dup
N03.camera(@battler, data)
@wait = data[4] if data[5]
end
#--------------------------------------------------------------------------
# ● 画面的摇动
#--------------------------------------------------------------------------
def shake
data = @action_data.dup
$sv_camera.shake(data[1], data[2], data[3])
@wait = data[3] if data[4]
end
#--------------------------------------------------------------------------
# ● 画面色调变更
#--------------------------------------------------------------------------
def color_effect
case @action_data[1]
when 0,1,2,3,4,5
targets = N03.get_targets(@action_data[1], @battler)
when 6
screen = true
when 7
targets = [@battler] + @target_battler
when 8
screen = true
targets = $game_troop.members + $game_party.battle_members - [@battler]
when 9
screen = true
targets = $game_troop.members + $game_party.battle_members - [@battler] - @target_battler
when 10
screen = true
targets = $game_troop.members + $game_party.battle_members
end
return if screen == nil && targets == []
for target in targets do target.sv.color_set = @action_data[2] end if targets
@wait = @action_data[2][4] if @action_data[3]
return if !screen
$sv_camera.color_set[1] = @action_data[2]
$sv_camera.color_set[2] = @action_data[2]
end
#--------------------------------------------------------------------------
# ● 过渡
#--------------------------------------------------------------------------
def transition
$sv_camera.perform_transition(@action_data)
end
#--------------------------------------------------------------------------
# ● 气球动画显示
#--------------------------------------------------------------------------
def balloon_anime
@balloon_data = @action_data.dup
end
#--------------------------------------------------------------------------
# ● 图片显示
#--------------------------------------------------------------------------
def picture_set
@picture = true
set_effect_data
end
#--------------------------------------------------------------------------
# ● 状态操作
#--------------------------------------------------------------------------
def state_set
targets = N03.get_targets(@action_data[1], @battler)
return if targets == []
case @action_data[2]
when 1 ; targets = [targets[rand(targets.size)]]
when 2 ; targets -= @battler if targets.include?(@battler)
end
for target in targets
for id in @action_data[4]
target.add_state(id) if @action_data[3] == "+"
target.remove_state(id) if @action_data[3] == "-"
end
end
end
#--------------------------------------------------------------------------
# ● FPS变更
#--------------------------------------------------------------------------
def fps
Graphics.frame_rate = @action_data[1]
start_action
end
#--------------------------------------------------------------------------
# ● 角色画像变更的場合
#--------------------------------------------------------------------------
def graphics_change
@graphics_change = true
return @battler.graphics_change(@action_data[3]) if !@battler.actor?
@pre_change_data = [@battler.character_name, @battler.character_index, @battler.face_name, @battler.face_index] if @pre_change_data == nil && !@action_data[1]
if @action_data[4] == []
face_name = @battler.face_name
face_index = @battler.face_index
else
face_name = @action_data[4][1]
face_index = @action_data[4][0]
end
@battler.set_graphic(@action_data[3], @action_data[2], face_name, face_index)
end
#--------------------------------------------------------------------------
# ● 技能连发
#--------------------------------------------------------------------------
def derivating_skill
# 如果让没学的的技能不能连发时
return if !@action_data[1] && !@battler.skill_learn?($data_skills[@action_data[3]])
# 如果技能不能连发成本不够时
return if !@action_data[2] && !@battler.skill_cost_payable?($data_skills[@action_data[3]])
# 连发
@derivation_skill_id = @action_data[3]
# 取消之后的动作
@full_action = []
end
#--------------------------------------------------------------------------
# ● BGM/BGS/SE演奏
#--------------------------------------------------------------------------
def sound
pitch = @action_data[2]
vol = @action_data[3]
name = @action_data[4]
case @action_data[1]
when "se"
Audio.se_play("Audio/SE/" + name, vol, pitch)
when "bgm"
# 没有指定名字时、不改变现在的BGM
name = RPG::BGM.last.name if @action_data[4] == ""
Audio.bgm_play("Audio/BGM/" + name, vol, pitch)
when "bgs"
name = RPG::BGS.last.name if @action_data[4] == ""
Audio.bgs_play("Audio/BGS/" + name, vol, pitch)
end
end
#--------------------------------------------------------------------------
# ● 电影播放
#--------------------------------------------------------------------------
def movie
Graphics.play_movie('Movies/' + @action_data[1])
end
#--------------------------------------------------------------------------
# ● 游戏开关的操作
#--------------------------------------------------------------------------
def switches
for id in @action_data[1]
$game_switches[id] = true if id > 0
$sv_camera.switches[id.abs] = true if id < 0
end
for id in @action_data[2]
$game_switches[id] = false if id > 0
$sv_camera.switches[id.abs] = false if id < 0
end
$sv_camera.program_check
end
#--------------------------------------------------------------------------
# ● 游戏变量操作
#--------------------------------------------------------------------------
def variable
# 检查操作
operand = @action_data[3]
operand = $game_variables[@action_data[3].abs] if @action_data[3] < 0
# 变数操作的分歧
case @action_data[2]
when 0 ; $game_variables[@action_data[1]] = operand # 代入
when 1 ; $game_variables[@action_data[1]] += operand # 加法
when 2 ; $game_variables[@action_data[1]] -= operand # 减法
when 3 ; $game_variables[@action_data[1]] *= operand # 乘法
when 4 ; $game_variables[@action_data[1]] /= operand # 除法
when 5 ; $game_variables[@action_data[1]] %= operand # 剩余
end
end
#--------------------------------------------------------------------------
# ● 条件分岐 (游戏开关)
#--------------------------------------------------------------------------
def nece_1
judgment = $game_switches[@action_data[1]] == @action_data[2] if @action_data[1] > 0
judgment = $sv_camera.switches[@action_data[1].abs] == @action_data[2] if @action_data[1] < 0
action_diverging(judgment, @action_data[3])
end
#--------------------------------------------------------------------------
# ● 条件分岐 (游戏变量)
#--------------------------------------------------------------------------
def nece_2
variable = $game_variables[@action_data[1]]
num = @action_data[2]
num = $game_variables[@action_data[2].abs] if num < 0
case @action_data[3]
when 0 ; judgment = variable == num
when 1 ; judgment = variable < num
when 2 ; judgment = variable > num
end
action_diverging(judgment, @action_data[4])
end
#--------------------------------------------------------------------------
# ● 条件分岐 (状态)
#--------------------------------------------------------------------------
def nece_3
targets = N03.get_targets(@action_data[1], @battler)
return if targets == []
member_num = @action_data[4]
member_num = targets.size if @action_data[4] == 0 && targets.size > 1
hit_count = 0
miss_count = 0
for target in targets
hit_count += 1 if target.state?(@action_data[2])
miss_count += 1 if !target.state?(@action_data[2])
end
case @action_data[3]
when 0 ; judgment = hit_count >= member_num
when 1 ; judgment = miss_count >= member_num
end
action_diverging(judgment, @action_data[5])
end
#--------------------------------------------------------------------------
# ● 条件分岐 (技能)
#--------------------------------------------------------------------------
def nece_4
targets = N03.get_targets(@action_data[1], @battler)
return if targets == []
member_num = @action_data[4]
member_num = targets.size if @action_data[4] == 0 && targets.size > 1
hit_count = 0
miss_count = 0
for target in targets
hit_count += 1 if target.skill_learn?($data_skills[@action_data[2]]) && target.skill_conditions_met?($data_skills[@action_data[2]])
miss_count += 1 if !target.skill_learn?($data_skills[@action_data[2]]) or !target.skill_conditions_met?($data_skills[@action_data[2]])
end
case @action_data[3]
when 0 ; judgment = hit_count >= member_num
when 1 ; judgment = miss_count >= member_num
end
action_diverging(judgment, @action_data[5])
end
#--------------------------------------------------------------------------
# ● 条件分岐 (参数)
#--------------------------------------------------------------------------
def nece_5
targets = N03.get_targets(@action_data[1], @battler)
return if targets == []
member_num = @action_data[5]
member_num = targets.size if @action_data[5] == 0 && targets.size > 1
hit_count = 0
for target in targets
hit_count += 1 if target.comparison_parameter([@action_data[2],@action_data[3],@action_data[4]])
end
judgment = hit_count >= member_num
action_diverging(judgment, @action_data[6])
end
#--------------------------------------------------------------------------
# ● 条件分岐 (装备)
#--------------------------------------------------------------------------
def nece_6
targets = N03.get_targets(@action_data[1], @battler)
return if targets == []
member_num = @action_data[5]
member_num = targets.size if @action_data[5] == 0 && targets.size > 1
hit_count = 0
miss_count = 0
for target in targets
hit_count += 1 if target.comparison_equip([@action_data[2],@action_data[3]])
miss_count += 1 if !target.comparison_equip([@action_data[2],@action_data[3]])
end
case @action_data[4]
when 0 ; judgment = hit_count >= member_num
when 1 ; judgment = miss_count >= member_num
end
action_diverging(judgment, @action_data[6])
end
#--------------------------------------------------------------------------
# ● 条件分岐 (脚本)
#--------------------------------------------------------------------------
def nece_7
judgment = eval(@action_data[2])
action_diverging(judgment, @action_data[1])
end
#--------------------------------------------------------------------------
# ● 动作的分岐
#--------------------------------------------------------------------------
def action_diverging(judgment, kind)
result = 0
if judgment
result = 1 if kind == 1
result = 2 if kind == 2
else
result = 1 if kind == 0
end
# 全部动作结束
return @full_action = [] if result == 2
# 清楚下一个动作
@full_action.shift if result == 1
set_action
# 实行下一个动作
@action_data = N03::ACTION[@action]
next_action
end
#--------------------------------------------------------------------------
# ● 第二个目标的操作
#--------------------------------------------------------------------------
def second_targets_set
targets = N03.get_targets(@action_data[1], @battler)
for target in targets
targets.delete(target) if @action_data[2][1] == 1 && target.index != @action_data[2][0]
targets.delete(target) if @action_data[2][1] == 2 && target.index == @action_data[2][0].abs
targets.delete(target) if @action_data[3] > 0 && target.id != @action_data[3]
targets.delete(target) if @action_data[3] < 0 && target.id == @action_data[3].abs
targets.delete(target) if @action_data[4] > 0 && !target.state?(@action_data[4])
targets.delete(target) if @action_data[4] < 0 && target.state?(@action_data[4].abs)
targets.delete(target) if @action_data[5] > 0 && !target.skill_conditions_met?($data_skills[@action_data[5]])
targets.delete(target) if @action_data[5] < 0 && target.skill_conditions_met?($data_skills[@action_data[5].abs])
targets.delete(target) if !target.comparison_parameter(@action_data[6])
targets.delete(target) if !@action_data[7][1].include?(0) && !target.comparison_equip(@action_data[7])
end
return @second_targets = [] if targets.size == 0
case @action_data[8]
when 1 ; targets = [targets[rand(targets.size)]]
when 2 ; targets.delete(@battler)
end
return @second_targets = [] if targets.size == 0
@second_targets = targets
case @action_data[9]
when 0 ; return
when 1 ; set_play_data(["second_targets_set"])
when 2 ; set_play_data(["targets_set"])
end
@wait += 1
end
#--------------------------------------------------------------------------
# ● 公共事件的呼叫
#--------------------------------------------------------------------------
def call_common_event
$game_temp.reserve_common_event(@action_data[1])
$sv_camera.event = true
@event_fix = @action_data[2]
end
#--------------------------------------------------------------------------
# ● 伤害动画
#--------------------------------------------------------------------------
def damage_anime(delay_time = 12)
anime(N03.get_attack_anime_id(-3, @battler), wait = true)
action_play
@wait -= delay_time
@full_action.unshift("eval('@damage_anime_data = []
@set_damage = true')")
end
#--------------------------------------------------------------------------
# ● 通常战斗不能
#--------------------------------------------------------------------------
def normal_collapse
@collapse = true
return
end
#--------------------------------------------------------------------------
# ● 初期位置变更
#--------------------------------------------------------------------------
def change_base_position
@base_x = @x
@base_y = @y
@base_h = @h
end
#--------------------------------------------------------------------------
# ● 实行强制动作
#--------------------------------------------------------------------------
def force_act
target(@full_action.shift)
end
#--------------------------------------------------------------------------
# ● 实行强制动作 (第二个目标)
#--------------------------------------------------------------------------
def force_act2
target2(@full_action.shift)
end
#--------------------------------------------------------------------------
# ● 开始个别处理
#--------------------------------------------------------------------------
def individual_start
@individual_targets = @target_battler.dup
@remain_targets = @target_battler.dup
@target_battler = [@individual_targets[0]]
# 重复部分的动作并保持
@individual_act = @full_action.dup
end
#--------------------------------------------------------------------------
# ● 结束个别处理
#--------------------------------------------------------------------------
def individual_end
@individual_targets.shift
for target in @individual_targets
@individual_targets.shift if target.dead?
end
# 目标没有残留时行动完毕
return @target_battler = @remain_targets if @individual_targets.size == 0
@full_action = @individual_act.dup
@target_battler = [@individual_targets[0]]
end
#--------------------------------------------------------------------------
# ● 循环開始
#--------------------------------------------------------------------------
def loop_start
# 重复部分的动作并保持
@loop_act = @full_action.dup
end
#--------------------------------------------------------------------------
# ● 循环结束
#--------------------------------------------------------------------------
def loop_end
# 动作重复
@full_action = @loop_act.dup if @loop_act != []
end
#--------------------------------------------------------------------------
# ● 下个动作角色
#--------------------------------------------------------------------------
def next_battler
@action_end = true
@active = false
end
#--------------------------------------------------------------------------
# ● 图像变更标记
#--------------------------------------------------------------------------
def set_change
@change_up = true
end
#--------------------------------------------------------------------------
# ● 战斗场景通讯
#--------------------------------------------------------------------------
def play_data
data = @play_data
@play_data = []
return data
end
#--------------------------------------------------------------------------
# ● 捷径指令
#--------------------------------------------------------------------------
def anime(anime_id, wait = true)
@action_data = ["anime",anime_id,1,false,wait,false,true,false]
end
def anime_me(anime_id, wait = true)
@action_data = ["anime",anime_id,0,false,wait,false,true,false]
end
def se(file, pitch = 100)
@action_data = ["sound", "se", pitch, 100, file]
end
def target(act)
for target in @target_battler do target.sv.force_action = act end
end
def target2(act)
for target in @second_targets do target.sv.force_action = act end
end
def delay(time)
@wait = @battler.index * time
end
#--------------------------------------------------------------------------
# ● 取得角色ID
#--------------------------------------------------------------------------
def id
return @battler.id if @battler.actor?
return [email]-@battler.id[/email]
end
#--------------------------------------------------------------------------
# ● 取得被致命一击
#--------------------------------------------------------------------------
def critical?
return @battler.result.critical
end
#--------------------------------------------------------------------------
# ● 取得被回复标记
#--------------------------------------------------------------------------
def recovery?
recovery = false
recovery = true if @battler.result.hp_damage < 0
recovery = true if @battler.result.mp_damage < 0
recovery = true if @battler.result.tp_damage < 0
return recovery
end
#--------------------------------------------------------------------------
# ● 取得被损伤技能ID
#--------------------------------------------------------------------------
def damage_skill_id
return @damage_skill_id
end
#--------------------------------------------------------------------------
# ● 取得被损伤物品ID
#--------------------------------------------------------------------------
def damage_item_id
return @damage_item_id
end
#--------------------------------------------------------------------------
# ● 取得装备武器ID
#--------------------------------------------------------------------------
def weapon_id
return 0 if !@battler.weapons[0]
return @battler.weapons[0].id
end
#--------------------------------------------------------------------------
# ● 取得装备武器的类型
#--------------------------------------------------------------------------
def weapon_type
return 0 if !@battler.weapons[0]
return @battler.weapons[0].wtype_id
end
#--------------------------------------------------------------------------
# ● 是否装备盾
#--------------------------------------------------------------------------
def shield?
for armor in @battler.armors do return true if armor != nil && armor.etype_id == 1 end
return false
end
#--------------------------------------------------------------------------
# ● 是否有伤害
#--------------------------------------------------------------------------
def damage_zero?
return @battler.result.hp_damage == 0 && @battler.result.mp_damage == 0 && @battler.result.tp_damage == 0
end
#--------------------------------------------------------------------------
# ● 取得技能ID
#--------------------------------------------------------------------------
def skill_id
return @counter_id if @counter_id != 0
return 0 if @battler.current_action == nil or @battler.current_action.item == nil
return 0 if @battler.current_action.item.is_a?(RPG::Item)
return @battler.current_action.item.id
end
#--------------------------------------------------------------------------
# ● 取得技能的种类
#--------------------------------------------------------------------------
def skill_type
return 0 if skill_id == 0
return $data_skills[skill_id].stype_id
end
#--------------------------------------------------------------------------
# ● 取得技能名字
#--------------------------------------------------------------------------
def skill_name
return "" if skill_id == 0
return $data_skills[skill_id].name
end
#--------------------------------------------------------------------------
# ● 取得物品ID
#--------------------------------------------------------------------------
def item_id
return 0 if @battler.current_action == nil or @battler.current_action.item == nil
return @battler.current_action.item.id
end
#--------------------------------------------------------------------------
# ● 攻击动作
#--------------------------------------------------------------------------
def attack_action(item)
return skill_action if item.is_a?(RPG::Skill)
return item_action
end
#--------------------------------------------------------------------------
# ● 基础动作伤害
#--------------------------------------------------------------------------
def damage_action_base(item)
@damage_skill_id = 0
@damage_item_id = 0
@damage_skill_id = item.id if item.is_a?(RPG::Skill)
@damage_item_id = item.id if item.is_a?(RPG::Item)
end
#--------------------------------------------------------------------------
# ● 动作伤害
#--------------------------------------------------------------------------
def damage_action(attacker, item)
damage_action_base(item)
act = damage(attacker)
return if @active
start_action(act) if act != nil
end
#--------------------------------------------------------------------------
# ● 回避动作
#--------------------------------------------------------------------------
def evasion_action(attacker, item)
damage_action_base(item)
act = evasion(attacker)
return if @active
start_action(act) if act != nil
end
#--------------------------------------------------------------------------
# ● 失误动作
#--------------------------------------------------------------------------
def miss_action(attacker, item)
damage_action_base(item)
act = miss(attacker)
return if @active
start_action(act) if act != nil
end
#--------------------------------------------------------------------------
# ● Flash动作同时处理
#--------------------------------------------------------------------------
def flash_action
return "闪光"
end
end
#==============================================================================
# ■ module N03
#------------------------------------------------------------------------------
# 这是一个侧视战斗的模块。
#==============================================================================
module N03
#--------------------------------------------------------------------------
# ● 取得敌人角色队伍
#--------------------------------------------------------------------------
def self.get_enemy_unit(battler)
return $game_troop if battler.actor?
return $game_party
end
#--------------------------------------------------------------------------
# ● 取得我方角色队伍
#--------------------------------------------------------------------------
def self.get_party_unit(battler)
return $game_party if battler.actor?
return $game_troop
end
#--------------------------------------------------------------------------
# ● 取得战斗动画时间
#--------------------------------------------------------------------------
def self.get_anime_time(anime_id)
return 0 if anime_id <= 0
return $data_animations[anime_id].frame_max * 4
end
#--------------------------------------------------------------------------
# ● 取得攻击动画
#--------------------------------------------------------------------------
def self.get_attack_anime_id(kind, battler)
return $data_skills[battler.sv.counter_id].animation_id if kind == -3 && battler.sv.counter_id != 0
case kind
when -1 ; anime_id = battler.atk_animation_id1
when -2 ; anime_id = battler.atk_animation_id2
when -3
if battler.current_action != nil
anime_id = battler.current_action.item.animation_id if battler.current_action.item != nil
end
else ; anime_id = kind
end
case anime_id
when -1 ; anime_id = battler.atk_animation_id1
when -2 ; anime_id = battler.atk_animation_id2
end
return anime_id if anime_id
return 0
end
#--------------------------------------------------------------------------
# ● 战斗动画数据
#--------------------------------------------------------------------------
def self.set_damage_anime_data(targets, target, data)
return if !first_of_all_screen_anime(data[0], target, targets)
target.animation_id = data[0]
target.animation_mirror = data[1]
target.sv.anime_no_mirror = data[2]
target.sv.anime_camera_zoom = data[3]
target.sv.anime_plus_z = data[4]
end
#--------------------------------------------------------------------------
# ● 取得目标
#--------------------------------------------------------------------------
def self.get_targets(kind, battler)
case kind.abs
when 0 ; return [battler].dup
when 1 ; return battler.sv.target_battler.dup
when 2 ; return get_enemy_unit(battler).members.dup
when 3 ; return get_party_unit(battler).members.dup
when 4 ; return $game_troop.members.dup + $game_party.battle_members.dup
when 5 ; return battler.sv.second_targets.dup
end
end
#--------------------------------------------------------------------------
# ● 目标的坐标取得
#--------------------------------------------------------------------------
def self.get_targets_position(targets, horming, m_a = nil)
return [0,0,0] if targets == nil && !$sv_camera.mirror
return [Graphics.width,0,0] if targets == nil && $sv_camera.mirror
x = y = h = 0
for i in 0...targets.size
x += targets[i].sv.base_x if !horming
y += targets[i].sv.base_y if !horming
h += targets[i].sv.base_h if !horming
x += targets[i].sv.x if horming
y += targets[i].sv.y if horming
h += targets[i].sv.h if horming
y -= targets[i].sv.ch * 100 if m_a == 0
y -= targets[i].sv.ch * 50 if m_a == 1
end
return [x / targets.size, y / targets.size, h / targets.size]
end
#--------------------------------------------------------------------------
# ● 速度转换时间
#--------------------------------------------------------------------------
def self.distanse_calculation(time, target_position, self_position, distanse_move)
return time if !distanse_move
distanse_x = self_position[0] - target_position[0]
distanse_x = target_position[0] - self_position[0] if target_position[0] > self_position[0]
distanse_y = self_position[1] - target_position[1]
distanse_y = target_position[1] - self_position[1] if target_position[1] > self_position[1]
if self_position[2] != nil && target_position[2] != nil
distanse_h = self_position[2] - target_position[2]
distanse_h = target_position[2] - self_position[2] if target_position[2] > self_position[2]
else
distanse_h = 0
end
distanse = [distanse_x, distanse_y, distanse_h].max
return distanse / (time * 100) + 1
end
#--------------------------------------------------------------------------
# ● 计算抛物线移动
#--------------------------------------------------------------------------
def self.parabola(data, time, size, type = 1)
move_data = data
move_data[0] *= size
move_data[1] *= size
move = []
move_d = []
for i in 0...time / 2
move[i] = move_data[0]
move_d[i] = move_data[1]
move_data[0] = move_data[0] * type / (1 + type)
move_data[1] = move_data[1] * type / (1 + type)
end
move = move + move_d.reverse!
move.reverse!
adjust = move.inject(0) {|result, item| result + item }
move[move.size - 1] += adjust if data[0] == data[1] && adjust != 0
move.unshift(0) if time % 2 != 0
return move
end
#--------------------------------------------------------------------------
# ● 反转数值
#--------------------------------------------------------------------------
def self.mirror_num(mirror)
return 1 if !mirror
return -1
end
#--------------------------------------------------------------------------
# ● 摄影机
#--------------------------------------------------------------------------
def self.camera(battler, data)
battler = $game_party.battle_members[0] if !battler
cx = data[2][0] * 100
cy = data[2][1] * 100
return $sv_camera.move(cx, cy, data[3], data[4], true) if data[1] == 6
targets = self.get_targets(data[1], battler)
return if targets == nil or targets == []
position = self.get_targets_position(targets, true)
$sv_camera.move(position[0], position[1] - position[2], data[3], data[4], false)
end
#--------------------------------------------------------------------------
# ● 禁止战斗不能
#--------------------------------------------------------------------------
def self.immortaling
# 赋予全体不死状态
for member in $game_party.battle_members + $game_troop.members
# 事件操作等无敌设定就会解除flag的无效
member.sv.immortal = true if member.state?(N03::IMMORTAL_ID)
member.add_state(N03::IMMORTAL_ID)
end
return true
end
#--------------------------------------------------------------------------
# ● 允许战斗不能
#--------------------------------------------------------------------------
def self.unimmortaling
# 解除全体不死状态(如果事件等无敌设定以外)
for member in $game_party.battle_members + $game_troop.members
next if member.dead?
# 不死身状态行动中被解除的场合、从状态中解除无效
member.sv.immortal = false if !member.state?(N03::IMMORTAL_ID) && member.sv.immortal
next member.sv.immortal = false if member.sv.immortal
member.remove_state(N03::IMMORTAL_ID)
next if member.hp != 0
member.add_state(1)
member.perform_collapse_effect
member.sv.action_terminate
end
return false
end
#--------------------------------------------------------------------------
# ● 技能连发
#--------------------------------------------------------------------------
def self.derived_skill(battler)
battler.force_action(battler.sv.derivation_skill_id, -2)
BattleManager.unshift_action_battlers(battler)
end
#--------------------------------------------------------------------------
# ● 创建伤害
#--------------------------------------------------------------------------
def self.set_damage(battler, hp_damage, mp_damage)
battler.result.hp_damage = hp_damage
battler.result.mp_damage = mp_damage
end
#--------------------------------------------------------------------------
# ● 确认目标生死
#--------------------------------------------------------------------------
def self.targets_alive?(targets)
return false if targets == []
for target in targets do return true if !target.dead? end
return false
end
#--------------------------------------------------------------------------
# ● 定位到第二个目标
#--------------------------------------------------------------------------
def self.s_targets(battler)
battler.sv.target_battler = battler.sv.second_targets
return battler.sv.second_targets
end
#--------------------------------------------------------------------------
# ● 定位目标到第二个目标
#--------------------------------------------------------------------------
def self.targets_set(battler)
battler.sv.second_targets = battler.current_action.make_targets.compact
battler.sv.target_battler = battler.sv.second_targets
end
#--------------------------------------------------------------------------
# ● 实行战斗动画判定 (对象:实行第一个目标时的画面的动画)
#--------------------------------------------------------------------------
def self.first_of_all_screen_anime(anime_id, target, targets)
anime = $data_animations[anime_id]
return false if !anime
return true if anime.position != 3
return false if anime.position == 3 && target != targets[0]
targets.delete(target)
target.sv.timing_targets = targets
return true
end
#--------------------------------------------------------------------------
# ● 战斗不能是否附加攻击
#--------------------------------------------------------------------------
def self.dead_attack?(battler, item)
for state in battler.atk_states
return true if state == battler.death_state_id
end
for effect in item.effects
return true if effect.code == 21 && effect.data_id == battler.death_state_id
end
return false
end
end
#==============================================================================
# ■ Sprite_Weapon
#------------------------------------------------------------------------------
# 这是一个显示武器的脚本。
#==============================================================================
class Sprite_Weapon < Sprite_Base
#--------------------------------------------------------------------------
# ● 公开实例变量
#--------------------------------------------------------------------------
attr_reader :index # 武器图像排列的index
attr_reader :battler # 角色图像
attr_reader :move_time # 图像达到目标的为止的这段时间
attr_reader :through # 贯穿标记
attr_reader :action_end # 武器动作结束的标记
attr_reader :action_end_cancel # 武器动作结束,取消的标记
attr_reader :hit_position # 图像达到目标时的坐标
attr_accessor :hit_anime_id # 图像达到目标时的动画ID
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize(viewport, index, battler)
super(viewport)
@index = index
@battler = battler
@position_x = @position_y = 0
@o = 0
@real_x = @real_y = 0
@mirror = @battler.sv.mirror
reset
set_action
end
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
def reset
@z_plus = 0
@weapon_data = []
@move_data = []
@move_x = 0
@move_y = 0
@orbit = []
@through = false
@distanse_move = false
@weapon_width = 0
@weapon_height = 0
@anime_time = 0
@anime_position = 1
@move_time = 0
@hit_anime_id = 0
@move_anime = true
@action_end = false
@action_end_cancel = false
reset_position
end
#--------------------------------------------------------------------------
# ● 动作设置
#--------------------------------------------------------------------------
def set_action
return if @battler.sv.effect_data == []
weapon_anime if @battler.sv.effect_data[0][0] == "wp"
move_anime if @battler.sv.effect_data[0][0] == "m_a"
@battler.sv.effect_data.shift
end
#--------------------------------------------------------------------------
# ● 实行武器动画
#--------------------------------------------------------------------------
def weapon_anime
@weapon_data = @battler.sv.effect_data[0].dup
set_graphics
set_ox
set_weapon_move
end
#--------------------------------------------------------------------------
# ● 实行动画移动
#--------------------------------------------------------------------------
def move_anime
@move_data = @battler.sv.effect_data[0].dup
# 取得目标
@target_battler = [@battler.sv.m_a_targets.shift]
@target_battler = N03.get_targets(@move_data[3], @battler) if @move_data[3] < 0
set_move
return if @move_data[16] == ""
weapon_data = N03::ACTION[@move_data[16]]
return if weapon_data == nil
@weapon_data = weapon_data.dup
set_graphics
set_ox
set_weapon_move
end
#--------------------------------------------------------------------------
# ● 取得武器图像
#--------------------------------------------------------------------------
def set_graphics
# 武器不依赖图像设定的情况下
if @weapon_data[13] != ""
self.bitmap = Cache.character(@weapon_data[13]).dup
@weapon_width = self.bitmap.width
@weapon_height = self.bitmap.height
return
end
# 取得武器
weapon = @battler.weapons[0]
# 取得二刀流武器
if @weapon_data[10]
weapon = nil
for armor in @battler.armors do break weapon = armor if armor.is_a?(RPG::Armor) && armor.etype_id == 1 end
weapon = @battler.weapons[1] if !weapon
end
# 如果没有武器将取消处理
return if weapon == nil
# 指数取得
file_index = @weapon_data[12]
# 如果使用图标
if @weapon_data[1] == 0
icon_index = weapon.icon_index
self.bitmap = Cache.system("Iconset" + file_index).dup
self.src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
@weapon_width = @weapon_height = 24
# 独自图像指定
else
file_name = @battler.sv.weapon_graphic(weapon.id, weapon.wtype_id) if weapon.is_a?(RPG::Weapon)
file_name = @battler.sv.shield_graphic(weapon.id, weapon.atype_id) if weapon.is_a?(RPG::Armor)
self.bitmap = Cache.character(file_name + file_index).dup
@weapon_width = self.bitmap.width
@weapon_height = self.bitmap.height
return if @weapon_data[1] == 1
# 2003规范的武器动画
@weapon_width /= @battler.sv.max_pattern[0]
end
end
#--------------------------------------------------------------------------
# ● 取得图像的原点
#--------------------------------------------------------------------------
def set_ox
# 反转时设置为相反
if @mirror
case @weapon_data[6]
when 1 ; @weapon_data[6] = 2 # 左上→右上角
when 2 ; @weapon_data[6] = 1 # 右上→左上角
when 3 ; @weapon_data[6] = 4 # 左下→右下角
when 4 ; @weapon_data[6] = 3 # 右下→左下角
end
end
# 原点的設定
case @weapon_data[6]
when 0 # 中心
self.ox = @weapon_width / 2
self.oy = @weapon_height / 2
when 1 # 左上
self.ox = 0
self.oy = 0
when 2 # 右上
self.ox = @weapon_width
self.oy = 0
when 3 # 左下
self.ox = 0
self.oy = @weapon_height
when 4 # 右下
self.ox = @weapon_width
self.oy = @weapon_height
when 5 # 同角色位置
self.ox = @weapon_width / 2
self.oy = @weapon_height
end
end
#--------------------------------------------------------------------------
# ● 取得角色的坐标
#--------------------------------------------------------------------------
def set_battler_position
@position_x = @battler.sv.x + @weapon_data[3][0] * N03.mirror_num(@mirror) * 100
@position_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust) + @weapon_data[3][1] * 100
reset_position
end
#--------------------------------------------------------------------------
# ● 初始化坐标
#--------------------------------------------------------------------------
def reset_position
@real_x = @position_x / 100
@real_y = @position_y / 100
@real_zoom_x = 1
@real_zoom_y = 1
end
#--------------------------------------------------------------------------
# ● 战斗动画显示
#--------------------------------------------------------------------------
def set_animation(anime_id)
return if $data_animations[anime_id] == nil
@anime_position = $data_animations[anime_id].position
@horming = true
@horming = false if @anime_position == 3
@anime_camera_zoom = true
@anime_no_mirror = false
start_animation($data_animations[anime_id], @mirror)
timings = $data_animations[anime_id].timings
end
#--------------------------------------------------------------------------
# ● 实行打击时的战斗动画
#--------------------------------------------------------------------------
def set_hit_animation(position_data, hit_anime_id, target)
return if $data_animations[hit_anime_id] == nil
@real_x = position_data[0]
@real_y = position_data[1]
@position_x = position_data[0] * 100
@position_y = position_data[1] * 100
self.z = position_data[2]
@z_plus = 1000
@action_end = false
@horming = true
set_animation(hit_anime_id)
@anime_time = $data_animations[hit_anime_id].frame_max * 4
@timing_targets = [target]
@move_time = @hit_anime_id = 0
@weapon_data = []
end
#--------------------------------------------------------------------------
# ● 角色时间追加
#--------------------------------------------------------------------------
def timing_battler_set(target)
@timing_targets.push(target)
end
#--------------------------------------------------------------------------
# ● 取得武器的移动
#--------------------------------------------------------------------------
def set_weapon_move
# 取得开始位置
set_battler_position if @move_time == 0
@z_plus = 50 if @z_plus == 0 && @weapon_data[9]
self.z = @battler.sv.z + @z_plus
# 反转处理
@mirror = !@mirror if @weapon_data[7]
self.mirror = @mirror
# 更新模式设置
set_pattern
@max_pattern = 2 if @max_pattern == 1
# 计算武器移动
@weapon_move_data = []
@weapon_angle_data = []
@weapon_zoom_data = []
num = N03.mirror_num(@mirror)
for i in 0...@max_pattern
move_data_x = @weapon_data[2][0] * num * 100 * i / (@max_pattern - 1)
move_data_y = @weapon_data[2][1] * 100 * i / (@max_pattern - 1)
move_angle = @weapon_data[4] * num + (@weapon_data[5] * num - @weapon_data[4] * num) * i / (@max_pattern - 1)
move_zoom_x = 1 + (@weapon_data[8][0] - 1) * i / (@max_pattern - 1)
move_zoom_y = 1 + (@weapon_data[8][1] - 1) * i / (@max_pattern - 1)
@weapon_move_data.push([move_data_x, move_data_y])
@weapon_angle_data.push(move_angle)
@weapon_zoom_data.push([move_zoom_x, move_zoom_y])
end
end
#--------------------------------------------------------------------------
# ● 更新模式
#--------------------------------------------------------------------------
def set_pattern
if @weapon_data[11] == -1
return @max_pattern = @battler.sv.max_pattern[0] if @battler.sv.pattern_type != 0
@count = @battler.sv.pattern_time
@max_count = @battler.sv.pattern_time
@max_pattern = @battler.sv.max_pattern[0]
@repeat = false
else
@count = @weapon_data[11][0]
@max_count = @weapon_data[11][0]
@max_pattern = @weapon_data[11][1]
@repeat = @weapon_data[11][2]
end
@pattern = 0
end
#--------------------------------------------------------------------------
# ● 实行移动
#--------------------------------------------------------------------------
def set_move
# 取得战斗动画
set_animation(@move_data[1][0]) if $data_animations[@move_data[1][0]] != nil && $data_animations[@move_data[1][0]].position != 3
@anime_camera_zoom = @move_data[13]
@loop = @move_data[14]
@loop = false if @move_data[1][0] == 0
@anime_no_mirror = @move_data[15]
@se_flag = @move_data[17]
# 取得开始位置
start_position
@z_plus = 1000 if @move_data[9]
# 目标角色图像的动画的反映SE和时机设定
@timing_targets = @target_battler
# 计算坐标
@move_x = @move_data[5][0] * 100 * N03.mirror_num(@mirror)
@move_y = @move_data[5][1] * 100
# 计算时间或速度
@distanse_move = true if @move_data[6] > 0
@move_time = @move_data[6].abs
# 时间为0的时、如果被描写成动画显示时间
if @move_time == 0
@move_time = $data_animations[@move_data[1][0]].frame_max * 4 if $data_animations[@move_data[1][0]]
@move_time = 1 if !$data_animations[@move_data[1][0]]
@distanse_move = false
end
# 贯穿类型的场合
@through = true if @move_data[7] == 1
@auto_through_flag = false
@auto_through_flag = true if @move_data[7] == 0
# 计算目标坐标
if @target_battler == nil
@target_x = @move_x * 100
@target_x = (Graphics.width - @move_x) * 100 if @mirror
@target_y = @move_y * 100
else
move_data_set
end
# 计算目标达到的时间
@move_time = distanse_calculation(@move_time, @target_x, @target_y)
# 计算圆形轨道
orbit
# 角色的体能设定
@battler.sv.wait = @move_time - 1 if @move_data[10][0]
@move_horming = @move_data[12]
end
#--------------------------------------------------------------------------
# ● 速度转换时间
#--------------------------------------------------------------------------
def distanse_calculation(time, target_x, target_y)
return time if !@distanse_move
distanse_x = @position_x - @target_x
distanse_x = @target_x - @position_x if @target_x > @position_x
distanse_y = @position_y - @target_y
distanse_y = @target_y - @position_y if @target_y > @position_y
distanse = [distanse_x, distanse_y].max
return distanse / (time * 100) + 1
end
#--------------------------------------------------------------------------
# ● 更新移动目标
#--------------------------------------------------------------------------
def move_data_set
return if @target_battler == nil
position = N03.get_targets_position(@target_battler, true, @anime_position)
@target_x = position[0] + @move_x
@target_y = position[1] - position[2] + @move_y
end
#--------------------------------------------------------------------------
# ● 计算开始位置
#--------------------------------------------------------------------------
def start_position
starter = [@battler.sv.m_a_starter.shift]
starter = N03.get_targets(@move_data[2], @battler) if @move_data[2] < 0
position = [0, 0]
position = N03.get_targets_position(starter, true, @anime_position) if starter != nil
@position_x = position[0] + @move_data[4][0] * 100
@position_y = position[1] + position[2] + @move_data[4][1] * 100
@position_z = @position_y
end
#--------------------------------------------------------------------------
# ● 计算原型轨道
#--------------------------------------------------------------------------
def orbit
orbit_data = @move_data[8].dup
orbit_data[0] *= 100
orbit_data[1] *= 100
orbit_d = []
for i in 0...@move_time / 2
@orbit[i] = orbit_data[0]
orbit_data[0] /= 2
orbit_d[i] = orbit_data[1]
orbit_data[1] /= 2
end
@orbit = @orbit + orbit_d.reverse!
@orbit.reverse!
end
#--------------------------------------------------------------------------
# ● 更新框架
#--------------------------------------------------------------------------
def update
update_hit_anime if @anime_time != 0
update_move if @move_time != 0
update_weapon_move if @weapon_data != []
update_position
update_color
self.visible = @battler.sv.weapon_visible
super
end
#--------------------------------------------------------------------------
# ● 打击时的战斗动画
#--------------------------------------------------------------------------
def update_hit_anime
@anime_time -= 1
@action_end = true if @anime_time == 0
end
#--------------------------------------------------------------------------
# ● 更新移动
#--------------------------------------------------------------------------
def update_move
move_data_set if @move_horming && !@hit_position
through_set(@move_time, @target_x, @target_y) if @move_time == 1 && !@hit_position
@o += @orbit[@move_time - 1] if @orbit[@move_time - 1] != nil
@position_x = (@position_x * (@move_time - 1) + @target_x) / @move_time
@position_y = (@position_y * (@move_time - 1) + @target_y) / @move_time + @o
reset_position
set_animation(@move_data[1][0]) if @loop && !animation?
@move_time -= 1
return if @move_time != 0
@action_end = true if !@action_end_cancel
end
#--------------------------------------------------------------------------
# ● 更新武器的移动
#--------------------------------------------------------------------------
def update_weapon_move
pattern = update_pattern
set_battler_position if @move_time == 0 && !@action_end_cancel
@real_x = @position_x / 100 + @weapon_move_data[pattern][0] / 100
@real_y = @position_y / 100 + @weapon_move_data[pattern][1] / 100
@real_zoom_x = @weapon_zoom_data[pattern][0]
@real_zoom_y = @weapon_zoom_data[pattern][1]
self.angle = @weapon_angle_data[pattern]
self.src_rect.set(@weapon_width * pattern, 0, @weapon_width, @weapon_height) if @weapon_data[1] == 2
end
#--------------------------------------------------------------------------
# ● 更新模式
#--------------------------------------------------------------------------
def update_pattern
return @battler.sv.pattern_w if @count == nil
@count -= 1
return @pattern if @count != 0
@count = @max_count
@pattern += 1
if !@repeat && @pattern == @max_pattern
@pattern = @max_pattern - 1
elsif @pattern == @max_pattern
@pattern = 0
end
return @pattern
end
#--------------------------------------------------------------------------
# ● 更新坐标
#--------------------------------------------------------------------------
def update_position
self.x = (@real_x - $sv_camera.x) * $sv_camera.convert / 1000
self.y = (@real_y - $sv_camera.y) * $sv_camera.convert / 1000
self.x += $sv_camera.sx / 100 unless @battler.sv.h != 0 && @weapon_data != []
self.y += $sv_camera.sy / 100 unless @battler.sv.h != 0 && @weapon_data != []
self.z = @battler.sv.z + @z_plus - 10
self.zoom_x = @real_zoom_x * $sv_camera.zoom
self.zoom_y = @real_zoom_y * $sv_camera.zoom
self.opacity = @battler.sv.opacity if @battler.sv.opacity_data[4]
end
#--------------------------------------------------------------------------
# ● 贯穿的处理
#--------------------------------------------------------------------------
def through_set(time, target_x, target_y)
@hit_anime_id = N03.get_attack_anime_id(@move_data[1][1], @battler)
@battler.sv.wait = N03.get_anime_time(@hit_anime_id) if @move_data[10][1]
moving_x = (target_x / 100 - @position_x / 100) / time
moving_y = (target_y / 100 - @position_y / 100) / time
goal_x = $sv_camera.max_left - 100 if moving_x < 0
goal_x = Graphics.width + $sv_camera.max_right + 100 if moving_x > 0
goal_y = $sv_camera.max_top - 100 if moving_y < 0
goal_y = Graphics.height + $sv_camera.max_bottom + 100 if moving_y > 0
if goal_x == nil && goal_y == nil
time = 0
reset_position
else
time = move_calculation(moving_x, moving_y, goal_x, goal_y)
end
target_x = @position_x + moving_x * time * 100
target_y = @position_y + moving_y * time * 100
@pre_data = [time, target_x, target_y]
@battler.sv.m_a_data.push([@move_data[11], @target_battler, @index, @auto_through_flag, []])
@action_end_cancel = true
@hit_position = [@real_x, @real_y, self.z]
end
#--------------------------------------------------------------------------
# ● 达到时间预算
#--------------------------------------------------------------------------
def move_calculation(moving_x, moving_y, goal_x, goal_y)
move_x = @position_x / 100
move_y = @position_y / 100
time = 0
loop do
move_x += moving_x
move_y += moving_y
time += 1
return time if moving_x < 0 && move_x < goal_x
return time if moving_x > 0 && move_x > goal_x
return time if moving_y < 0 && move_y < goal_y
return time if moving_y > 0 && move_y > goal_y
end
end
#--------------------------------------------------------------------------
# ● 错误时从处理消失转换成贯穿处理
#--------------------------------------------------------------------------
def through_change
@action_end_cancel = false
@through = true
@move_time = @pre_data[0]
@target_x = @pre_data[1]
@target_y = @pre_data[2]
@pre_data = nil
end
#--------------------------------------------------------------------------
# ● SE 闪光灯和处理的时间
#--------------------------------------------------------------------------
def animation_process_timing(timing)
return if !@timing_targets
se_flag = true
se_flag = @se_flag if @se_flag != nil
for target in @timing_targets
target.sv.timing.push([se_flag, timing.dup])
se_flag = false if @animation.position == 3
end
end
#--------------------------------------------------------------------------
# ● 更新色调
#--------------------------------------------------------------------------
def update_color
return if @battler.sv.color == []
self.color.set(@battler.sv.color[0], @battler.sv.color[1], @battler.sv.color[2], @battler.sv.color[3])
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
self.bitmap.dispose if self.bitmap != nil
end
end
#==============================================================================
# ■ Sprite_Battle_Picture
#------------------------------------------------------------------------------
# 这是一个画面的图象显示。
#==============================================================================
class Sprite_Battle_Picture < Sprite
#--------------------------------------------------------------------------
# ● 公开实例变量
#--------------------------------------------------------------------------
attr_accessor :action_end # 结束标记
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
@action_end = false
self.ox = 0
end
#--------------------------------------------------------------------------
# ● 集合
#--------------------------------------------------------------------------
def set(battler)
@battler = battler
@data = @battler.sv.effect_data.shift
@time = @data[4]
@mirror = $sv_camera.mirror
@mirror = false if !@data[8]
self.opacity = @data[6][0]
@s_x = @data[2][0] if @data[2] != []
@s_x = Graphics.width - @data[2][0] if @data[2] != [] && @mirror
@s_y = @data[2][1] if @data[2] != []
@e_x = @data[3][0] if @data[3] != []
@e_x = Graphics.width - @data[3][0] if @data[3] != [] && @mirror
@e_y = @data[3][1] if @data[3] != []
@s_x = self.x if @data[2] == []
@s_y = self.y if @data[2] == []
@e_x = self.x if @data[3] == []
@e_y = self.y if @data[3] == []
self.x = @s_x
self.y = @s_y
return @action_end = true if @time == 0
@move_x = (@e_x * 1.0 - @s_x) / @time
@move_y = (@e_y * 1.0 - @s_y) / @time
self.z = @data[5]
return set_plane(battler) if @data[7] != []
self.bitmap = Cache.picture(@data[9]) if !bitmap or @data[9] != ""
return @action_end = true if !bitmap
self.mirror = @mirror
self.ox = self.bitmap.width if @mirror
end
#--------------------------------------------------------------------------
# ● 过渡平面
#--------------------------------------------------------------------------
def set_plane(battler)
@viewport = Viewport.new(@data[2][0],@data[2][1],@data[7][0],@data[7][1]) if !@viewport
viewport = @viewport
@plane = Plane.new(viewport) if !@plane
@plane.bitmap = Cache.picture(@data[9]) if !@plane.bitmap or @data[9] != ""
return @action_end = true if !@plane.bitmap
@plane.ox = @data[7][0]
@plane.oy = @data[7][1]
@plane.opacity = @data[6][0]
@move_x = @remain_move[0] if @data[2] == @data[3]
@move_y = @remain_move[1] if @data[2] == @data[3]
@remain_move = [@move_x, @move_y]
end
#--------------------------------------------------------------------------
# ● 更新帧数
#--------------------------------------------------------------------------
def update
@action_end = true if !@battler.sv.picture
return if @time == 0
return if @action_end
@time -= 1
return plane_update if @plane
super
self.x += @move_x
self.y += @move_y
self.opacity += @data[6][1]
return if @time != 1
self.x = @e_x
self.y = @e_y
@time = 0
end
#--------------------------------------------------------------------------
# ● 更新平面
#--------------------------------------------------------------------------
def plane_update
@plane.ox += @move_x
@plane.oy += @move_y
@plane.opacity += @data[6][1]
@time = @data[4] if @time == 0
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
bitmap.dispose if bitmap
@plane.dispose if @plane
@viewport.dispose if @viewport
super
end
end
#==============================================================================
# ■ Sprite_Back_Picture
#------------------------------------------------------------------------------
# 这是一个精灵的一段画面。
#==============================================================================
class Sprite_Back_Picture < Plane
#--------------------------------------------------------------------------
# ● 公开实例变量
#--------------------------------------------------------------------------
attr_accessor :action_end # 结束标记
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize(viewport = nil, index)
super(viewport)
@index = index
@real_x = 0
@real_y = 0
@real_opacity = 0
@move_x = 0
@move_y = 0
@move_opacity = 0
@time = 0
@switche = 0
@action_end = false
end
#--------------------------------------------------------------------------
# ● 格局
#--------------------------------------------------------------------------
def setup(data)
self.bitmap = Cache.picture(data[9])
self.z = data[6]
@switche = data[1]
mirror = $sv_camera.mirror
mirror = false if !data[8]
@move_x = data[3][0]
@move_x *= -1 if mirror
@move_y = data[3][1]
@time = data[4]
@time = -1 if @time == 0
@real_opacity = (data[5][0] + 1) * 100
@move_opacity = data[5][1]
@start_opacity = data[5][0]
@shake_ok = data[7]
end
#--------------------------------------------------------------------------
# ● 更新帧数
#--------------------------------------------------------------------------
def update
update_picture if @time != 0
self.ox = $sv_camera.x - @real_x
self.oy = $sv_camera.y - @real_y
if @shake_ok
self.ox -= $sv_camera.sx / 100
self.oy -= $sv_camera.sy / 100
end
self.ox *= $sv_camera.zoom
self.oy *= $sv_camera.zoom
self.zoom_x = @zoom_x * $sv_camera.zoom
self.zoom_y = @zoom_y * $sv_camera.zoom
self.opacity = @real_opacity / 100
@move_opacity *= -1 if self.opacity == 255 or self.opacity <= @start_opacity
@switche
@action_end = true if @switche > 0 && !$game_switches[@switche]
@action_end = true if @switche < 0 && !$sv_camera.switches[@switche.abs]
end
#--------------------------------------------------------------------------
# ● 更新图片
#--------------------------------------------------------------------------
def update_picture
@real_x += @move_x / 100
@real_y += @move_y / 100
@real_x = 0 if @real_x >= self.bitmap.width or @real_x <= -self.bitmap.width
@real_y = 0 if @real_y >= self.bitmap.height or @real_y <= -self.bitmap.height
@zoom_x = 1
@zoom_y = 1
@real_opacity += @move_opacity
@time -= 1
@time = -1 if @time < -100
end
end
#==============================================================================
# ■ Sprite_Back_Picture
#------------------------------------------------------------------------------
# 这是一个精灵的伤害显示。
#==============================================================================
class Sprite_Damage < Sprite
#--------------------------------------------------------------------------
# ● 公开实例变量
#--------------------------------------------------------------------------
attr_reader :action_end # POP结束标记
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize(viewport = nil, battler)
super(viewport)
@battler = battler
@time = 0
return @action_end = true if !@battler
@direction = -1
@direction *= -1 if @battler.actor?
@direction *= -1 if $sv_camera.mirror
set_state
set_damage
update
end
#--------------------------------------------------------------------------
# ● 显示状态
#--------------------------------------------------------------------------
def set_state
return if !N03::STATE_POP
states = @battler.result.added_state_objects
states.delete($data_states[@battler.death_state_id]) if @battler.result.hp_damage != 0
return if states == []
return if @battler.sv.add_state == @battler.result.added_state_objects
@battler.sv.add_state = states.dup
@st = []
@st_base = []
for i in 0...states.size
@st[i] = Sprite.new
bitmap_state(@st[i], states[i])
@st_base[i] = []
@st_base[i][0] = @direction * (-20 + 5 * i) + @battler.sv.x / 100
@st_base[i][1] = -40 - @state_height * i + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100
@st[i].z = 1000 + i
@st[i].opacity = 0
end
@time = @pop_time = 80
end
#--------------------------------------------------------------------------
# ● 状态图像
#--------------------------------------------------------------------------
def bitmap_state(state, state_object)
name = state_object.name
state.bitmap = Cache.system("Iconset").dup
state.src_rect.set(state_object.icon_index % 16 * 24, state_object.icon_index / 16 * 24, 24, 24)
@state_height = 24
end
#--------------------------------------------------------------------------
# ● 显示打击伤害
#--------------------------------------------------------------------------
def hit_count
for i in [email]0...@battler.sv.hit.size[/email]
if @battler.sv.hit[i] == nil
@hit = i
return @battler.sv.hit[i] = @hit
end
end
@hit = @battler.sv.hit.size
@battler.sv.hit.push(@hit)
end
#--------------------------------------------------------------------------
# ● 显示伤害
#--------------------------------------------------------------------------
def set_damage
return @action_end = true if !N03::DAMAGE_POP
damage = @battler.result.hp_damage if @battler.result.hp_damage != 0
damage = @battler.result.hp_drain if @battler.result.hp_drain != 0
damage = @battler.result.mp_damage if @battler.result.mp_damage != 0
damage = @battler.result.mp_drain if @battler.result.mp_drain != 0
damage = @battler.result.tp_damage if @battler.result.tp_damage != 0
if !damage or damage == 0
@action_end = true if @st == nil
return # 状态POP考虑设置@action_end不返回
end
hit_count
# @hit = @battler.sv.hit
# @battler.sv.hit += 1 if damage != 0
file = N03::DAMAGE_PLUS if damage > 0
file = N03::DAMAGE_MINUS if damage < 0
add_file = N03::DAMAGE_MP if @battler.result.mp_damage != 0
add_file = N03::DAMAGE_TP if @battler.result.tp_damage != 0
adjust_x = N03::DAMAGE_ADJUST
@num = []
@num_base = []
damage = damage.abs
max_num = damage.to_s.size
max_num += 1 if add_file != nil
for i in 0...max_num
@num[i] = Sprite.new
if add_file != nil && i == max_num - 1
@num[i].bitmap = Cache.system(add_file)
cw = (damage % (10 * 10 ** i))/(10 ** i)
sw = 0 if sw == nil
else
@num[i].bitmap = Cache.system(file)
cw = (damage % (10 * 10 ** i))/(10 ** i)
sw = @num[i].bitmap.width / 10
@num[i].src_rect.set(cw * sw, 0, sw, @num[i].bitmap.height)
end
@num_base[i] = []
@num_base[i][0] = (sw + adjust_x) * i * -1 + (@battler.sv.x / 100)
@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
@num_base[i][0] -= @num[i].bitmap.width / 2 - adjust_x if add_file != nil && i == max_num - 1
@num[i].z = 1000 + i + @hit * 10
end
@time = @pop_time = 80
end
#--------------------------------------------------------------------------
# ● 更新帧数
#--------------------------------------------------------------------------
def update
return if @time == 0
for i in [email]0...@st.size[/email] do update_state_move(@st[i], i) end if @st != nil
for i in [email]0...@num.size[/email] do update_num_move(@num[i], i) end if @num != nil
@time -= 1
@action_end = true if @time == 0
end
#--------------------------------------------------------------------------
# ● 更新状态图像
#--------------------------------------------------------------------------
def update_state_move(state, index)
min = @pop_time - index * 2
case @time
when min-15..min
@st_base[index][0] += @direction
state.opacity += 25
when min-80..min-50
@st_base[index][0] += @direction
state.opacity -= 25
end
state.x = (@st_base[index][0] - $sv_camera.x) * $sv_camera.zoom
state.y = (@st_base[index][1] - $sv_camera.y) * $sv_camera.zoom
end
#--------------------------------------------------------------------------
# ● 更新数值
#--------------------------------------------------------------------------
def update_num_move(num, index)
min = @pop_time - index * 2
case @time
when min-1..min
@num_base[index][0] += @direction * @hit
@num_base[index][1] -= 5 + @hit * 2
when min-3..min-2
@num_base[index][0] += @direction * @hit
@num_base[index][1] -= 4 + @hit * 2
when min-6..min-4
@num_base[index][0] += @direction
@num_base[index][1] -= 3 + @hit * 2
when min-14..min-7
@num_base[index][0] += @direction
@num_base[index][1] += 2
when min-17..min-15
@num_base[index][1] -= 2 + @hit * 2
when min-23..min-18
@num_base[index][1] += 1
when min-27..min-24
@num_base[index][1] -= 1
when min-30..min-28
@num_base[index][1] += 1
when min-33..min-31
@num_base[index][1] -= 1
when min-36..min-34
@num_base[index][1] += 1
end
num.x = (@num_base[index][0] - $sv_camera.x) * $sv_camera.zoom
num.y = (@num_base[index][1] - $sv_camera.y) * $sv_camera.zoom
num.opacity = 256 - (12 - @time) * 32
num.visible = false if @time == 0
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
@battler.sv.hit[@hit] = nil if @hit
bitmap.dispose if bitmap
for i in [email]0...@num.size[/email] do @num[i].dispose end if @num != nil
for i in [email]0...@st.size[/email] do @st[i].dispose end if @st != nil
super
end
end
#==============================================================================
# ■ Window_Skill_name
#------------------------------------------------------------------------------
# 这是一个显示技能名字的窗口。
#==============================================================================
class Window_Skill_name < Window_Base
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize(text)
super(0, 0, Graphics.width, line_height + standard_padding * 2)
draw_text(4, 0, Graphics.width - 64, line_height,text, 1)
end
end
#==============================================================================
# ■ Spriteset_Sideview
#------------------------------------------------------------------------------
# 处理战斗画面的精灵的类。本类在横版战斗类的內定使用。
#==============================================================================
class Spriteset_Sideview
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize(viewport)
@viewport = viewport
@weapons = []
@pictures = []
@back_pic = []
@damage = []
$sv_camera.setup
N03.camera(nil, N03::BATTLE_CAMERA["顺序开始前"].dup)
end
#--------------------------------------------------------------------------
# ● 更新帧数
#--------------------------------------------------------------------------
def update
update_battler_data
update_damage
update_pictures
update_back_pic
update_weapons
end
#--------------------------------------------------------------------------
# ● 更新角色数据
#--------------------------------------------------------------------------
def update_battler_data
for battler in $game_party.battle_members + $game_troop.members
weapon_end(battler) if battler.sv.weapon_end
next if battler.sv.effect_data == []
for effect_data in battler.sv.effect_data do set_effects(battler, effect_data) end
end
end
#--------------------------------------------------------------------------
# ● 更新伤害图像
#--------------------------------------------------------------------------
def update_damage
for i in [email]0...@damage.size[/email]
next if @damage[i] == nil
@damage[i].update if @damage[i] != nil
next if !@damage[i].action_end
@damage[i].dispose
@damage[i] = nil
end
end
#--------------------------------------------------------------------------
# ● 更新图片动作
#--------------------------------------------------------------------------
def update_pictures
for i in [email]0...@pictures.size[/email]
next if @pictures[i] == nil
@pictures[i].update if @pictures[i] != nil
next if !@pictures[i].action_end
@pictures[i].dispose
@pictures[i] = nil
end
end
#--------------------------------------------------------------------------
# ● 更新期间图片
#--------------------------------------------------------------------------
def update_back_pic
set_back_pic if $sv_camera.program_picture != []
for i in [email]0...@back_pic.size[/email]
next if @back_pic[i] == nil
@back_pic[i].update if @back_pic[i] != nil
next if !@back_pic[i].action_end
@back_pic[i].dispose
@back_pic[i] = nil
end
end
#--------------------------------------------------------------------------
# ● 更新武器动作
#--------------------------------------------------------------------------
def update_weapons
for i in [email]0...@weapons.size[/email]
next if @weapons[i] == nil
@weapons[i].update if @weapons[i] != nil
next if !@weapons[i].action_end
@weapons[i].dispose
@weapons[i] = nil
end
end
#--------------------------------------------------------------------------
# ● 实行伤害
#--------------------------------------------------------------------------
def set_damage_pop(target)
for i in [email]0...@damage.size[/email]
next if @damage[i] != nil
return @damage[i] = Sprite_Damage.new(@viewport, target)
end
@damage.push(Sprite_Damage.new(@viewport, target))
end
#--------------------------------------------------------------------------
# ● 实行期间图片
#--------------------------------------------------------------------------
def set_back_pic
for data in $sv_camera.program_picture
if @back_pic[data[2]] != nil
@back_pic[data[2]].dispose
@back_pic[data[2]] = nil
end
@back_pic[data[2]] = Sprite_Back_Picture.new(@viewport, data[2])
@back_pic[data[2]].setup(data)
end
$sv_camera.program_picture = []
end
#--------------------------------------------------------------------------
# ● 开始效果
#--------------------------------------------------------------------------
def set_effects(battler, effect_data)
case effect_data[0]
when "pic" ; set_pictures(battler, effect_data)
when "wp" ; set_weapons(battler, true)
when "m_a" ; set_weapons(battler, false)
end
end
#--------------------------------------------------------------------------
# ● 实行图片动作
#--------------------------------------------------------------------------
def set_pictures(battler, effect_data)
@pictures[effect_data[1]] = Sprite_Battle_Picture.new if @pictures[effect_data[1]] == nil
@pictures[effect_data[1]].set(battler)
end
#--------------------------------------------------------------------------
# ● 实行武器动作
#--------------------------------------------------------------------------
def set_weapons(battler, weapon_flag, test = true)
for i in [email]0...@weapons.size[/email]
next if @weapons[i] != nil
@weapons[i] = Sprite_Weapon.new(@viewport, i, battler)
battler.sv.weapon_index.push(i) if weapon_flag
return i
end
@weapons.push(Sprite_Weapon.new(@viewport, @weapons.size, battler))
battler.sv.weapon_index.push(@weapons.size - 1) if weapon_flag
return @weapons.size - 1
end
#--------------------------------------------------------------------------
# ● 角色的武器动作结束
#--------------------------------------------------------------------------
def weapon_end(battler)
battler.sv.weapon_end = false
for index in battler.sv.weapon_index
weapon_index = battler.sv.weapon_index.shift
@weapons[weapon_index].dispose if @weapons[weapon_index] != nil
@weapons[weapon_index] = nil
end
battler.sv.weapon_index.compact!
end
#--------------------------------------------------------------------------
# ● 实行打击時的战斗动画
#--------------------------------------------------------------------------
def set_hit_animation(battler, weapon_index, hit_targets, miss)
weapon = @weapons[weapon_index]
for target in hit_targets
next @weapons[@hit_index].timing_battler_set(target) if @hit_index != nil
@hit_index = set_weapons(battler, false, false)
@weapons[@hit_index].set_hit_animation(weapon.hit_position, weapon.hit_anime_id, target)
end
@hit_index = nil
if !weapon.through && !miss
@weapons[weapon_index].dispose
@weapons[weapon_index] = nil
else
@weapons[weapon_index].through_change
end
end
#--------------------------------------------------------------------------
# ● 初始化侧视图数据
#--------------------------------------------------------------------------
def reset_sideview
$sv_camera.reset
for member in $game_troop.members + $game_party.battle_members do member.sv.reset end
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
dispose_effects(@weapons)
dispose_effects(@pictures)
dispose_effects(@back_pic)
dispose_effects(@damage)
reset_sideview
end
#--------------------------------------------------------------------------
# ● 释放图像效果
#--------------------------------------------------------------------------
def dispose_effects(effects)
for i in 0...effects.size
effects[i].dispose if effects[i] != nil
effects[i] = nil
end
end
end
#==============================================================================
# ■ Sprite_Battle_Back
#------------------------------------------------------------------------------
# 战斗背景用的精灵。
#==============================================================================
class Sprite_Battle_Back < Plane
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize(viewport = nil, index, battleback_name)
super(viewport)
@index = index
if @index == 1
data = N03::FLOOR1_DATA[battleback_name]
data = N03::FLOOR1_DATA["全Battlebacks1"] if data == nil
elsif @index == 2
data = N03::FLOOR2_DATA[battleback_name]
data = N03::FLOOR2_DATA["全Battlebacks2"] if data == nil
end
data = data.dup
@adjust_position = data[0]
@zoom_x = data[1][0] / 100.0
@zoom_y = data[1][1] / 100.0
@shake_on = data[2]
$game_switches[data[3]] = true if data[3] > 0
$sv_camera.switches[data[3].abs] = true if data[3] < 0
reset_scroll
reset_back_data(battleback_name)
end
#--------------------------------------------------------------------------
# ● 初始化背景滚动
#--------------------------------------------------------------------------
def reset_scroll
@scroll_x = 0
@scroll_y = 0
@move_x = 0
@move_y = 0
end
#--------------------------------------------------------------------------
# ● 初始化背景数据
#--------------------------------------------------------------------------
def reset_back_data(battleback_name)
@back_data = []
@active_data = ["scroll",0, @move_x, @move_y, false, battleback_name,""]
start_back_data(@active_data)
end
#--------------------------------------------------------------------------
# ● 背景图像的设置
#--------------------------------------------------------------------------
def set_graphics(new_bitmap)
self.bitmap = new_bitmap
@base_x = (self.bitmap.width * @zoom_x - Graphics.width) / 2 + @adjust_position[0]
@base_y = (self.bitmap.height * @zoom_y - Graphics.height) / 2 + @adjust_position[1]
# 限制坐标取得
max_top = 0
max_bottom = self.bitmap.height * @zoom_y - Graphics.height
max_left = 0
max_right = self.bitmap.width * @zoom_x - Graphics.width
exist = true
exist = false if self.bitmap.height == 32 && self.bitmap.width == 32
$sv_camera.setting(@index, [max_top, max_bottom, max_left, max_right, @base_x, @base_y,exist])
end
#--------------------------------------------------------------------------
# ● 更新帧数
#--------------------------------------------------------------------------
def update
return if !bitmap
update_back_data
update_scroll unless @move_x == 0 && @move_y == 0
update_color
update_position
update_back_adjust if @bt_back != nil
create_back_adjust if @bt_back == nil && !@active_data[10] && @scroll_x == 0 && @scroll_y == 0
end
#--------------------------------------------------------------------------
# ● 更新背景数据
#--------------------------------------------------------------------------
def update_back_data
delete = true if @active_data[1] > 0 && !$game_switches[@active_data[1]]
delete = true if @active_data[1] < 0 && !$sv_camera.switches[@active_data[1].abs]
return if !delete
for i in [email]0...@back_data.size[/email]
@back_data[i] = nil if @back_data[i][1] > 0 && !$game_switches[@back_data[i][1]]
@back_data[i] = nil if @back_data[i][1] < 0 && !$sv_camera.switches[@back_data[i][1].abs]
end
@back_data.compact!
next_back_data
end
#--------------------------------------------------------------------------
# ● 下一个背景资料设置
#--------------------------------------------------------------------------
def next_back_data
@back_data.delete(@active_data[11]) if @active_data[11] != nil
@back_data.push(@active_data[11]) if @active_data[11] != nil
@active_data = nil
data = @back_data.pop
@back_data = [@active_data] if @back_data.size == 0
start_back_data(data)
end
#--------------------------------------------------------------------------
# ● 实行背景数据
#--------------------------------------------------------------------------
def start_back_data(data)
return if back_data_remain(data)
bt_back_dispose
pre_active_data = @active_data
@active_data[8] = [@back_name, @move_x, @move_y, @scroll_x, @scroll_y] if @active_data != nil
@back_data.push(@active_data) if @active_data != nil
@active_data = data.dup
@active_data[5] = @back_name if @active_data[5] == ""
@active_data[9] = set_back_adjust if @active_data[9] == nil
back_data_scroll_on if @active_data[8] == nil && @active_data[9][0] == false
set_remain_back_data if @active_data[8] != nil
create_back(@active_data[5]) if @active_data[9][0] == false
create_back_adjust if @active_data[10]
@active_data[11] = pre_active_data if pre_active_data && @active_data[7] == false
end
#--------------------------------------------------------------------------
# ● 背景数据的保持
#--------------------------------------------------------------------------
def back_data_remain(data)
remain = false
remain = true if data[6] != "" && @active_data != nil && @active_data[9] != nil && @active_data[9][0] != false
remain = true if @active_data != nil && @active_data[7] == false
return remain if !remain
@remain = true
@back_data.push(data)
return remain
end
#--------------------------------------------------------------------------
# ● 背景变更修正数据
#--------------------------------------------------------------------------
def set_back_adjust
bt_adjust = []
sign = -1
if @active_data[6] == ""
reset_scroll if @active_data[3][0] == 0 && @active_data[3][1] == 0
bt_adjust = [false,false,0,0]
return bt_adjust
elsif @move_x != 0 or @active_data[3][0] != 0
sign = 1 if @move_x < 0
bt_adjust[0] = [self.bitmap.width * @zoom_x * sign, 0]
bt_adjust[1] = [self.bitmap.width * @zoom_x * sign * 2, 0]
elsif @move_y != 0 or @active_data[3][1] != 0
sign = 1 if @move_y < 0
bt_adjust[0] = [0, self.bitmap.height * @zoom_y * sign]
bt_adjust[1] = [0, self.bitmap.height * @zoom_y * sign * 2]
else
reset_scroll if @active_data[3][0] == 0 && @active_data[3][1] == 0
bt_adjust = [false,false,0,0]
return bt_adjust
end
bt_adjust[2] = [bt_adjust[0][0], bt_adjust[0][1]]
return bt_adjust
end
#--------------------------------------------------------------------------
# ● 实行背景滚动数据
#--------------------------------------------------------------------------
def back_data_scroll_on
mirror = $sv_camera.mirror
mirror = false if !@active_data[4]
@move_x = @active_data[3][0]
@move_x *= -1 if mirror
@move_y = @active_data[3][1]
end
#--------------------------------------------------------------------------
# ● 实行保持背景数据
#--------------------------------------------------------------------------
def set_remain_back_data
return back_data_scroll_on if @move_x != 0 or @move_y != 0
create_back(@active_data[8][0])
@move_x = @active_data[8][1]
@move_y = @active_data[8][2]
@scroll_x = @active_data[8][3]
@scroll_y = @active_data[8][4]
end
#--------------------------------------------------------------------------
# ● 创建背景图像
#--------------------------------------------------------------------------
def create_back(back_name)
return if back_name == @back_name or back_name == ""
self.bitmap = Cache.battleback1(back_name) if @index == 1
self.bitmap = Cache.battleback2(back_name) if @index == 2
@back_name = back_name
end
#--------------------------------------------------------------------------
# ● 创建背景变更修正图像
#--------------------------------------------------------------------------
def create_back_adjust
return if @active_data[9][0] == false
@active_data[10] = true
mirror = $sv_camera.mirror
mirror = false if !@active_data[4]
@bt_back = []
@bt_back[0] = Sprite.new(viewport)
@bt_back[0].bitmap = Cache.battleback1(@active_data[6]) if @index == 1
@bt_back[0].bitmap = Cache.battleback2(@active_data[6]) if @index == 2
@bt_back[0].mirror = mirror
@bt_back[1] = Sprite.new(viewport)
@bt_back[1].bitmap = Cache.battleback1(@active_data[5]) if @index == 1
@bt_back[1].bitmap = Cache.battleback2(@active_data[5]) if @index == 2
@bt_back[1].mirror = mirror
end
#--------------------------------------------------------------------------
# ● 更新背景滚动
#--------------------------------------------------------------------------
def update_scroll
@scroll_x += @move_x
@scroll_y += @move_y
@scroll_x = 0 if @scroll_x / 100 >= self.bitmap.width * @zoom_x or @scroll_x / 100 <= -self.bitmap.width * @zoom_x
@scroll_y = 0 if @scroll_y / 100 >= self.bitmap.height * @zoom_y or @scroll_y / 100 <= -self.bitmap.height * @zoom_y
end
#--------------------------------------------------------------------------
# ● 更新色调变更
#--------------------------------------------------------------------------
def update_color
color_set if $sv_camera.color_set[@index] != nil
return if @color_data == nil
@color_data[4] -= 1
if @color_data[4] == 0 && @color_data[5] != 0
@color_data[4] = @color_data[5]
@color_data[5] = 0
@color_data[6] = [0,0,0,0]
elsif @color_data[4] == 0
@remain_color_data = @color_data
return @color_data = nil
end
for i in 0..3
@color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
end
self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
end
#--------------------------------------------------------------------------
# ● 更新坐标
#--------------------------------------------------------------------------
def update_position
self.ox = $sv_camera.x + @base_x - @scroll_x / 100
self.oy = $sv_camera.y + @base_y - @scroll_y / 100
self.ox -= $sv_camera.sx / 100 if @shake_on
self.oy -= $sv_camera.sy / 100 if @shake_on
self.zoom_x = @zoom_x * $sv_camera.zoom
self.zoom_y = @zoom_y * $sv_camera.zoom
self.ox *= $sv_camera.zoom
self.oy *= $sv_camera.zoom
self.z = @index * 10
end
#--------------------------------------------------------------------------
# ● 更新背景变更修正图像
#--------------------------------------------------------------------------
def update_back_adjust
@active_data[9][0][0] = 0 if @scroll_x == 0
@active_data[9][0][1] = 0 if @scroll_y == 0
@active_data[9][1][0] -= @active_data[9][2][0] if @scroll_x == 0
@active_data[9][1][1] -= @active_data[9][2][1] if @scroll_y == 0
for i in [email]0...@bt_back.size[/email]
@bt_back[i].x = -self.ox + @active_data[9][i][0] * $sv_camera.zoom
@bt_back[i].y = -self.oy + @active_data[9][i][1] * $sv_camera.zoom
@bt_back[i].zoom_x = self.zoom_x
@bt_back[i].zoom_y = self.zoom_y
@bt_back[i].z = self.z + 1
@bt_back[i].color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
end
back_data_scroll_on if @active_data[9][0][0] == 0 && @active_data[9][0][1] == 0
return unless @active_data[9][1][0] == 0 && @active_data[9][1][1] == 0
bt_back_dispose
create_back(@active_data[5])
@active_data[9][0] = false
next_back_data if @remain && @back_data.size != 1
@remain = false
end
#--------------------------------------------------------------------------
# ● 色调变更
#--------------------------------------------------------------------------
def color_set
set = $sv_camera.color_set[@index]
$sv_camera.color_set[@index] = nil
set[4] = 1 if set[4] == 0
@remain_color_data = [0,0,0,0] if @remain_color_data == nil
@color_data = @remain_color_data
@color_data[4] = set[4]
@color_data[5] = set[5]
@color_data[6] = set
end
#--------------------------------------------------------------------------
# ● 背景变更修正的释放
#--------------------------------------------------------------------------
def bt_back_dispose
for i in [email]0...@bt_back.size[/email] do @bt_back[i].dispose end if @bt_back != nil
@bt_back = nil
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
bitmap.dispose if bitmap
bt_back_dispose
super
end
end
#==============================================================================
# ■ Battle_Camera
#------------------------------------------------------------------------------
# 这是一个类来处理相机和战斗的计划。
#==============================================================================
class Battle_Camera
#--------------------------------------------------------------------------
# ● 公开实例的变量
#--------------------------------------------------------------------------
attr_reader :sx # 摇动X坐标
attr_reader :sy # 摇动Y坐标
attr_reader :max_top # 上限界坐标
attr_reader :max_bottom # 下限界坐标
attr_reader :max_left # 左限界坐标
attr_reader :max_right # 右限界坐标
attr_accessor :switches # 侧视图专用开关
attr_accessor :color_set # 色调变更数据
attr_accessor :wait # 战斗场景的强制体能
attr_accessor :win_wait # 战斗胜利前的体能
attr_accessor :mirror # 画面反转标记
attr_accessor :program_scroll # 战斗程序 背景的自动滚动
attr_accessor :program_picture # 战斗程序 期间图片
attr_accessor :event # 公共事件呼叫
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize
@switches = []
@max_data = []
@color_set = []
@wait = 0
@win_wait = false
@mirror = false
@event = false
setup
end
#--------------------------------------------------------------------------
# ● 相机X坐标
#--------------------------------------------------------------------------
def x
return @x / 100
end
#--------------------------------------------------------------------------
# ● 相机Y坐标
#--------------------------------------------------------------------------
def y
return @y / 100
end
#--------------------------------------------------------------------------
# ● 变焦率
#--------------------------------------------------------------------------
def zoom
return @zoom * 0.001
end
#--------------------------------------------------------------------------
# ● 变焦虑的坐标变换
#--------------------------------------------------------------------------
def convert
return @zoom
end
#--------------------------------------------------------------------------
# ● 相机设置
#--------------------------------------------------------------------------
def setup
@x = 0
@y = 0
@sx = 0
@sy = 0
@zoom = 1000
@time = 0
@shake_time = 0
program_setup
end
#--------------------------------------------------------------------------
# ● 初始化相机
#--------------------------------------------------------------------------
def reset
@switches = []
@max_data = []
@color_set = []
@wait = 0
@win_wait = false
@mirror = false
program_setup(false)
end
#--------------------------------------------------------------------------
# ● 战斗安装程序
#--------------------------------------------------------------------------
def program_setup(check = true)
@played_program = []
@program_switch = []
@program_sound = []
@program_scroll = []
@program_se = []
@program_shake = []
@program_color = []
@program_picture = []
@program_base = N03::BATTLE_PROGRAM.values.dup
program_check if check
end
#--------------------------------------------------------------------------
# ● 战斗的检测程序
#--------------------------------------------------------------------------
def program_check
for data in @program_base
if program_start?(data) && !@played_program.include?(data)
@played_program.push(data.dup)
@program_scroll.push(data.dup) if data[0] == "scroll"
@program_picture.push(data.dup) if data[0] == "kpic"
start_sound(data.dup) if data[0] == "sound"
start_program_switch(data.dup) if data[0] == "switch"
start_program_se(data.dup) if data[0] == "keep_se"
start_program_shake(data.dup) if data[0] == "keep_sk"
start_program_color(data.dup) if data[0] == "keep_c"
else
@played_program.delete(data) if !program_start?(data)
@program_scroll.delete(data) if data[0] == "scroll"
@program_picture.delete(data) if data[0] == "kpic"
@program_switch.delete(data) if data[0] == "switch"
@program_sound.delete(data) if data[0] == "sound"
@program_se.delete(data) if data[0] == "keep_se"
@program_shake.delete(data) if data[0] == "keep_sk"
@program_color.delete(data) if data[0] == "keep_c"
end
end
end
#--------------------------------------------------------------------------
# ● 战斗程序开始
#--------------------------------------------------------------------------
def program_start?(data)
start = false
start = true if $game_switches[data[1].abs] && data[1] > 0
start = true if @switches[data[1].abs] && data[1] < 0
return start
end
#--------------------------------------------------------------------------
# ● 战斗程序 开关操作开始
#--------------------------------------------------------------------------
def start_program_switch(data)
data[4] = data[4] + rand(data[5] + 1)
data[4] = 1 if data[4] <= 0
@program_switch.push(data)
end
#--------------------------------------------------------------------------
# ● 更新开关操作
#--------------------------------------------------------------------------
def update_program_switch
for data in @program_switch
data[4] -= 1
next @program_switch.delete(data) if data[1] > 0 && !$game_switches[data[1]]
next @program_switch.delete(data) if data[1] < 0 && !@switches[data[1].abs]
next if data[4] != 0
for id in data[2]
$game_switches[id] = true if id > 0
@switches[id.abs] = true if id < 0
end
for id in data[3]
$game_switches[id] = false if id > 0
@switches[id.abs] = false if id < 0
end
@program_switch.delete(data)
program_check
end
end
#--------------------------------------------------------------------------
# ● 战斗程序 BGM/BGS的开始
#--------------------------------------------------------------------------
def start_sound(data)
@program_sound.push(data)
name = data[5]
case data[2]
when "se"
Audio.se_play("Audio/SE/" + name, data[4], data[3])
when "bgm"
name = RPG::BGM.last.name if data[5] == ""
Audio.bgm_play("Audio/BGM/" + name, data[4], data[3])
when "bgs"
name = RPG::BGS.last.name if data[5] == ""
Audio.bgs_play("Audio/BGS/" + name, data[4], data[3])
end
end
#--------------------------------------------------------------------------
# ● 战斗程序 期间SE的开始
#--------------------------------------------------------------------------
def start_program_se(data)
data[3] = [data[2], data[3]]
data[2] = data[3][0] + rand(data[3][1] + 1)
@program_se.push(data)
Audio.se_play("Audio/SE/" + data[7], data[5], data[4]) if data[6]
end
#--------------------------------------------------------------------------
# ● 更新期间SE
#--------------------------------------------------------------------------
def update_program_se
for data in @program_se
data[2] -= 1
next @program_se.delete(data) if data[1] > 0 && !$game_switches[data[1]]
next @program_se.delete(data) if data[1] < 0 && !@switches[data[1].abs]
next if data[2] != 0
Audio.se_play("Audio/SE/" + data[7], data[5], data[4])
data[2] = data[3][0] + rand(data[3][1] + 1)
end
end
#--------------------------------------------------------------------------
# ● 战斗程序 开始期间摇动
#--------------------------------------------------------------------------
def start_program_shake(data)
data[3] = [data[2], data[3]]
data[2] = data[3][0] + rand(data[3][1] + 1)
@program_shake.push(data)
shake(data[4], data[5], data[6]) if data[7]
end
#--------------------------------------------------------------------------
# ● 更新期间摇动
#--------------------------------------------------------------------------
def update_program_shake
for data in @program_shake
data[2] -= 1
next @program_shake.delete(data) if data[1] > 0 && !$game_switches[data[1]]
next @program_shake.delete(data) if data[1] < 0 && !@switches[data[1].abs]
next if data[2] != 0
shake(data[4], data[5], data[6])
data[2] = data[3][0] + rand(data[3][1] + 1)
end
end
#--------------------------------------------------------------------------
# ● 战斗程序 开始期间色调变更
#--------------------------------------------------------------------------
def start_program_color(data)
data[3] = [data[2], data[3]]
data[2] = data[3][0] + rand(data[3][1] + 1)
data[7] = true if data[4] == 0 or data[4] == 4
case data[4]
when 1 ;data[4] = $game_troop.members
when 2 ;data[4] = $game_party.battle_members
when 3,4 ;data[4] = $game_troop.members + $game_party.battle_members
else ;data[4] = []
end
@program_color.push(data)
return if !data[6]
for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
@color_set[1] = data[5] if data[7]
@color_set[2] = data[5] if data[7]
end
#--------------------------------------------------------------------------
# ● 更新期间色调变更
#--------------------------------------------------------------------------
def update_program_color
for data in @program_color
data[2] -= 1
next @program_color.delete(data) if data[1] > 0 && !$game_switches[data[1]]
next @program_color.delete(data) if data[1] < 0 && !@switches[data[1].abs]
next if data[2] != 0
for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
@color_set[1] = data[5] if data[7]
@color_set[2] = data[5] if data[7]
data[2] = data[3][0] + rand(data[3][1] + 1)
end
end
#--------------------------------------------------------------------------
# ● 实行过渡
#--------------------------------------------------------------------------
def perform_transition(data)
Graphics.transition(data[2], "Graphics/Pictures/" + data[3], data[1])
end
#--------------------------------------------------------------------------
# ● 取得背景相机的限制值 data=[max_top, max_bottom, max_left, max_right]
#--------------------------------------------------------------------------
def setting(index, data)
@max_data[index - 1] = data
return if index != 2
setup
# 相机的中心坐标
@center_x = (Graphics.width / 2 + N03::CAMERA_POSITION[0]) * 100
@center_y = (Graphics.height / 2 + N03::CAMERA_POSITION[1]) * 100
# 上下左右的移动限制距离
@max_top = [@max_data[0][5], @max_data[1][5]].min * -1
@max_bottom = [@max_data[0][1], @max_data[1][1]].min + @max_top
@max_left = [@max_data[0][4], @max_data[1][4]].min * -1
@max_right = [@max_data[0][3], @max_data[1][3]].min + @max_left
exist_data = @max_data[0] if !@max_data[1][6]
exist_data = @max_data[1] if !@max_data[0][6]
@max_top = exist_data[5] * -1 if exist_data != nil
@max_bottom = exist_data[1] + @max_top if exist_data != nil
@max_left = exist_data[4] * -1 if exist_data != nil
@max_right = exist_data[3] + @max_left if exist_data != nil
@max_top = @max_bottom = @max_left = @max_right = 0 if !@max_data[1][6] && !@max_data[0][6]
@max_width = @max_right - @max_left + Graphics.width
@max_height = @max_bottom - @max_top + Graphics.height
# 扩大缩小限制值
max_zoom_x = 100 * Graphics.width / @max_width
max_zoom_y = 100 * Graphics.height / @max_height
@max_zoom_out = [max_zoom_x, max_zoom_y].max
end
#--------------------------------------------------------------------------
# ● 相机移动
#--------------------------------------------------------------------------
def move(target_x, target_y, zoom, time, screen = true)
# 调整战斗背景以上尺寸的变焦来减少
@target_zoom = [zoom * 0.01, @max_zoom_out * 0.01].max
target_x *= -1 if screen && @mirror
# 变焦分钟的中心坐标修正
if screen && @target_zoom != 1
target_x = target_x + @center_x
target_y = target_y + @center_y
end
adjust_x = @center_x * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
adjust_y = @center_y * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
adjust_x = 0 if adjust_x.nan?
adjust_y = 0 if adjust_y.nan?
adjust_x = @center_x if !screen && adjust_x == 0
adjust_y = @center_y if !screen && adjust_y == 0
@target_x = target_x - adjust_x.to_i
@target_y = target_y - adjust_y.to_i
@target_zoom = (@target_zoom * 1000).to_i
@zoom = @zoom.to_i
limit_test
# 马上实行当时间是0的场合
return @time = time.abs if time != 0
@time = 1
update
end
#--------------------------------------------------------------------------
# ● 计算限制的坐标
#--------------------------------------------------------------------------
def limit_test
new_width = @max_width * @target_zoom / 1000
new_height = @max_height * @target_zoom / 1000
new_max_right = @max_right - (@max_width - new_width)
new_max_bottom = @max_bottom - (@max_height - new_height)
# 画面移动目标限制的场合、限制坐标设置
if @target_x < @max_left * 100
@target_x = @max_left * 100
end
if @target_x > new_max_right * 100
@target_x = new_max_right * 100
end
if @target_y < @max_top * 100
@target_y = @max_top * 100
end
if @target_y > new_max_bottom * 100
@target_y = new_max_bottom * 100
end
end
#--------------------------------------------------------------------------
# ● 画面的摇动
#--------------------------------------------------------------------------
def shake(power, speed, time)
@shake_x = power[0] * 100
@shake_y = power[1] * 100
@power_time_base = @power_time = speed
@shake_time = time
update_shake
end
#--------------------------------------------------------------------------
# ● 更新摇动
#--------------------------------------------------------------------------
def update_shake
@sx = (@sx * (@power_time - 1) + @shake_x) / @power_time
@sy = (@sy * (@power_time - 1) + @shake_y) / @power_time
@power_time -= 1
@shake_time -= 1
return @sx = @sy = 0 if @shake_time == 0
return if @power_time != 0
@power_time = @power_time_base
@shake_x = @shake_x * -4 / 5
@shake_y = @shake_y * -4 / 5
end
#--------------------------------------------------------------------------
# ● 更新帧数
#--------------------------------------------------------------------------
def update
update_shake if @shake_time != 0
update_program
return if @time == 0
@x = (@x * (@time - 1) + @target_x) / @time
@y = (@y * (@time - 1) + @target_y) / @time
@zoom = (@zoom * (@time - 1) + @target_zoom) / @time
@time -= 1
end
#--------------------------------------------------------------------------
# ● 更新程序
#--------------------------------------------------------------------------
def update_program
update_program_switch if @program_switch != []
update_program_se if @program_se != []
update_program_shake if @program_shake != []
update_program_color if @program_color != []
end
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 它是一类用于执行该过程的战斗画面。
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 更新帧数(基本)
#--------------------------------------------------------------------------
alias update_basic_scene_battle_n03 update_basic
def update_basic
update_basic_scene_battle_n03
$sv_camera.update
$sv_camera.wait = N03::TURN_END_WAIT + 1 if $sv_camera.win_wait
camera_wait
end
#--------------------------------------------------------------------------
# ● 相机体能
#--------------------------------------------------------------------------
def camera_wait
process_event if $sv_camera.event
$sv_camera.event = false if $sv_camera.event
while $sv_camera.wait != 0
Graphics.update
Input.update
update_all_windows
$game_timer.update
$game_troop.update
$sv_camera.update
@spriteset.update
update_info_viewport
update_message_open
$sv_camera.wait -= 1 if $sv_camera.wait > 0
$sv_camera.wait = 1 if $sv_camera.wait == 0 && @spriteset.effect?
BattleManager.victory if $sv_camera.win_wait && $sv_camera.wait == 0
end
end
#--------------------------------------------------------------------------
# ● 相机体能集
#--------------------------------------------------------------------------
def set_camera_wait(time)
$sv_camera.wait = time
camera_wait
end
#--------------------------------------------------------------------------
# ● 实行等待直到效果结束 ★再定义
#--------------------------------------------------------------------------
def wait_for_effect
end
#--------------------------------------------------------------------------
# ● 开始回合
#--------------------------------------------------------------------------
alias turn_start_scene_battle_n03 turn_start
def turn_start
turn_start_scene_battle_n03
N03.camera(nil, N03::BATTLE_CAMERA["顺序开始后"].dup)
end
#--------------------------------------------------------------------------
# ● 回合结束
#--------------------------------------------------------------------------
alias turn_end_scene_battle_n03 turn_end
def turn_end
p " #橫版● 回合结束"
turn_end_scene_battle_n03
for member in $game_troop.members + $game_party.members
N03.set_damage(member, member.sv.result_damage[0],member.sv.result_damage[1])
member.sv.result_damage = [0,0]
@spriteset.set_damage_pop(member) if member.result.hp_damage != 0 or member.result.mp_damage != 0
end
set_camera_wait(N03::TURN_END_WAIT)
N03.camera(nil, N03::BATTLE_CAMERA["顺序开始前"].dup) if $game_party.inputable?
@log_window.clear
end
#--------------------------------------------------------------------------
# ● 技能/使用物品 ★再定义
#--------------------------------------------------------------------------
def use_item
item = @subject.current_action.item
display_item(item)
@subject.use_item(item)
refresh_status
@targets = @subject.current_action.make_targets.compact
@targets = [@subject] if @targets.size == 0
set_substitute(item)
for time in item.repeats.times do play_sideview(@targets, item) end
end_reaction(item)
display_end_item
@subject.stamina_loss # atb之語法 出現錯誤砍掉
end
#--------------------------------------------------------------------------
# ● 技能/显示物品名
#--------------------------------------------------------------------------
def display_item(item)
return @log_window.display_use_item(@subject, item) if N03::BATTLE_LOG
@log_window.off
@skill_name_window = Window_Skill_name.new(item.name) unless N03::NO_DISPLAY_SKILL_ID.include?(item.id) && item.is_a?(RPG::Skill)
end
#--------------------------------------------------------------------------
# ● 技能/显示物品名结束
#--------------------------------------------------------------------------
def display_end_item
@skill_name_window.dispose if @skill_name_window != nil
@skill_name_window = nil
set_camera_wait(N03::ACTION_END_WAIT) if @subject.sv.derivation_skill_id == 0
@log_window.clear if N03::BATTLE_LOG
end
#--------------------------------------------------------------------------
# ● 反击/魔法反射/代替处理
#--------------------------------------------------------------------------
def end_reaction(item)
end_substitute if @substitute != nil
set_reflection(item) if @reflection_data != nil
set_counter_attack if @counter_attacker != nil
end
#--------------------------------------------------------------------------
# ● 发动反击 ★再定义
#--------------------------------------------------------------------------
def invoke_counter_attack(target, item)
return if @subject.sv.counter_id != 0
@counter_attacker = [] if @counter_attacker == nil
return apply_item_effects(apply_substitute(target, item), item) if !target.movable?
@log_window.add_text(sprintf(Vocab::CounterAttack, target.name)) if N03::BATTLE_LOG
target.sv.counter_id = target.sv.counter_skill_id
@counter_attacker.push(target)
end
#--------------------------------------------------------------------------
# ● 发动魔法反射 ★再定义
#--------------------------------------------------------------------------
def invoke_magic_reflection(target, item)
return if @subject.sv.reflection_id != 0
@log_window.add_text(sprintf(Vocab::MagicReflection, target.name)) if N03::BATTLE_LOG
target.sv.reflection_id = target.sv.reflection_anime_id
end
#--------------------------------------------------------------------------
# ● 代替应用 ★再定义
#--------------------------------------------------------------------------
def apply_substitute(target, item)
return target if @substitute == nil
return target if !check_substitute(target, item)
return @substitute
end
#--------------------------------------------------------------------------
# ● 代替设置
#--------------------------------------------------------------------------
def set_substitute(item)
@substitute = N03.get_enemy_unit(@subject).substitute_battler
return if @substitute == nil
s_targets = []
for i in [email]0...@targets.size[/email]
next if @targets[i] == @substitute
next if !check_substitute(@targets[i], item)
@log_window.add_text(sprintf(Vocab::Substitute, @substitute.name, @targets[i].name))
@targets[i].sv.start_action(@targets[i].sv.substitute_receiver_start_action)
s_targets.push(@targets[i])
@targets[i] = @substitute
end
return @substitute = nil if s_targets == []
@substitute.sv.set_target(s_targets)
@substitute.sv.start_action(@substitute.sv.substitute_start_action)
end
#--------------------------------------------------------------------------
# ● 结束代替
#--------------------------------------------------------------------------
def end_substitute
for member in @substitute.sv.target_battler
member.sv.start_action(member.sv.substitute_receiver_end_action)
end
@substitute.sv.start_action(@substitute.sv.substitute_end_action)
@substitute = nil
end
#--------------------------------------------------------------------------
# ● 反击
#--------------------------------------------------------------------------
def set_counter_attack
pre_subject = @subject
for attacker in @counter_attacker
@subject = attacker
item = $data_skills[attacker.sv.counter_skill_id]
play_sideview([pre_subject], item)
end
# 实行同一个计数器者を考虑到计数器ID的初始化动作后
for attacker in @counter_attacker do attacker.sv.counter_id = 0 end
@subject = pre_subject
@counter_attacker = nil
end
#--------------------------------------------------------------------------
# ● 魔法反射
#--------------------------------------------------------------------------
def set_reflection(item)
@log_window.back_to(1)
for data in @reflection_data
@subject.sv.damage_action(@subject, item)
N03.set_damage_anime_data([@subject], @subject, data)
apply_item_effects(@subject, item)
@spriteset.set_damage_pop(@subject)
end
set_camera_wait(N03.get_anime_time(@reflection_data[0][0]))
@reflection_data = nil
end
#--------------------------------------------------------------------------
# ● 实行侧视图动作
#--------------------------------------------------------------------------
def play_sideview(targets, item)
@subject.sv.set_target(targets)
return if @subject.sv.attack_action(item) == nil
return if !@subject.movable?
return if item.scope != 9 && item.scope != 10 && !N03.targets_alive?(targets)
@subject.sv.start_action(@subject.sv.attack_action(item))
@subject.sv.unshift_action(@subject.sv.flash_action) if @subject.flash_flg
@subject.sv.active = true
@subject.sv.command_action = false
loop do
update_basic
data = @subject.sv.play_data
@targets = N03.s_targets(@subject) if data[0] == "second_targets_set"
N03.targets_set(@subject) if data[0] == "targets_set"
@immortal = N03.immortaling if data[0] == "no_collapse" && !N03.dead_attack?(@subject, item)
@immortal = N03.unimmortaling if data[0] == "collapse"
next set_move_anime(item) if @subject.sv.m_a_data != []
set_damage(item) if @subject.sv.set_damage
break N03.derived_skill(@subject) if @subject.sv.derivation_skill_id != 0
break if @subject.sv.action_end or @subject.hidden?
end
@immortal = N03.unimmortaling if @immortal
end
#--------------------------------------------------------------------------
# ● 实行伤害
#--------------------------------------------------------------------------
def set_damage(item)
targets = @targets
targets = [@subject.sv.individual_targets[0]] if @subject.sv.individual_targets.size != 0
for target in targets do damage_anime(targets.dup, target, item) end
@subject.sv.set_damage = false
@subject.sv.damage_anime_data = []
end
#--------------------------------------------------------------------------
# ● 战斗动画伤害处理
#--------------------------------------------------------------------------
def damage_anime(targets, target, item)
@log_window.back_to(1) if @log_window.line_number == 5
return if item.scope != 9 && item.scope != 10 && target.dead?
@miss = false
invoke_item(target,item)
if target.result.missed
target.sv.miss_action(@subject, item)
return @miss = true
elsif target.result.evaded or target.sv.counter_id != 0
target.sv.evasion_action(@subject, item)
return @miss = true
elsif target.sv.reflection_id != 0
N03.set_damage_anime_data(targets, target, [target.sv.reflection_id, false, false, true])
target.sv.reflection_id = 0
@reflection_data = [] if @reflection_data == nil
return @reflection_data.push([N03.get_attack_anime_id(-3, @subject), false, false, true])
end
target.sv.damage_action(@subject, item)
N03.set_damage(@subject, -target.result.hp_drain, -target.result.mp_drain) if target != @subject
@spriteset.set_damage_pop(target)
@spriteset.set_damage_pop(@subject) if target != @subject && @subject.result.hp_damage != 0 or @subject.result.mp_damage != 0
N03.set_damage_anime_data(targets, target, @subject.sv.damage_anime_data) if @subject.sv.damage_anime_data != []
end
#--------------------------------------------------------------------------
# ● 飞行动画处理
#--------------------------------------------------------------------------
def set_move_anime(item)
for data in @subject.sv.m_a_data
@subject.sv.damage_anime_data = data[4]
hit_targets = []
for target in data[1]
damage_anime(data[1], target, item) if data[0]
hit_targets.push(target) if !@miss
end
@miss = false if !data[3]
@spriteset.set_hit_animation(@subject, data[2], hit_targets, @miss)
end
@subject.sv.set_damage = false
@subject.sv.m_a_data = []
end
end
#==============================================================================
# ■ DataManager
#------------------------------------------------------------------------------
# 这是一个模块管理游戏和数据库对象。
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# ● 创建各种游戏物件 ★再定义
#--------------------------------------------------------------------------
def self.create_game_objects
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_timer = Game_Timer.new
$game_message = Game_Message.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$sv_camera = Battle_Camera.new
end
end
#==============================================================================
# ■ BattleManager
#------------------------------------------------------------------------------
# 这是一个模块管理战斗进行。
#==============================================================================
module BattleManager
#--------------------------------------------------------------------------
# ● 遇敌时时处理 ★再定义
#--------------------------------------------------------------------------
def self.on_encounter
@preemptive = (rand < rate_preemptive)
@surprise = (rand < rate_surprise && !@preemptive)
$sv_camera.mirror = @surprise if N03::BACK_ATTACK
end
#--------------------------------------------------------------------------
# ● 胜利的处理 ★再定义
#--------------------------------------------------------------------------
def self.process_victory
$sv_camera.win_wait = true
end
#--------------------------------------------------------------------------
# ● 胜利
#--------------------------------------------------------------------------
def self.victory
$sv_camera.win_wait = false
N03.camera(nil, N03::BATTLE_CAMERA["战斗结束时"].dup)
for member in $game_party.members do member.sv.start_action(member.sv.win) if member.movable? end
play_battle_end_me
replay_bgm_and_bgs
$game_message.add(sprintf(Vocab::Victory, $game_party.name))
display_exp
gain_gold
gain_drop_items
gain_exp
SceneManager.return
battle_end(0)
return true
end
#--------------------------------------------------------------------------
# ● 逃走的处理 ★再定义
#--------------------------------------------------------------------------
def self.process_escape
$game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
success = @preemptive ? true : (rand < @escape_ratio)
Sound.play_escape
if success
process_abort
for member in $game_party.members do member.sv.start_action(member.sv.escape) if member.movable? end
else
@escape_ratio += 0.1
$game_message.add('\.' + Vocab::EscapeFailure)
$game_party.clear_actions
for member in $game_party.members do member.sv.start_action(member.sv.escape_ng) if member.movable? end
end
wait_for_message
return success
end
#--------------------------------------------------------------------------
# ● 输入下个命令 ★再定义
#--------------------------------------------------------------------------
def self.next_command
begin
if !actor || !actor.next_command
$game_party.battle_members[@actor_index].sv.command_action = true
@actor_index += 1
if @actor_index >= $game_party.members.size
for member in $game_party.battle_members.reverse
break member.sv.start_action(member.sv.command_a) if member.inputable?
end
return false
end
end
end until actor.inputable?
actor.sv.start_action(actor.sv.command_b) if actor != nil && actor.inputable?
if pre_actor
pre_actor.sv.start_action(pre_actor.sv.command_a) if pre_actor != nil && pre_actor.inputable?
end
return true
end
#--------------------------------------------------------------------------
# ● 输入上个命令 ★再定义
#--------------------------------------------------------------------------
def self.prior_command
begin
if !actor || !actor.prior_command
$game_party.battle_members[@actor_index].sv.command_action = false
@actor_index -= 1
if @actor_index < 0
for member in $game_party.battle_members
break member.sv.start_action(member.sv.command_a) if member.inputable?
end
return false
end
end
end until actor.inputable?
actor.make_actions if actor.inputable?
actor.sv.start_action(actor.sv.command_b) if actor.inputable?
after_actor.sv.start_action(after_actor.sv.command_a) if after_actor != nil && after_actor.inputable?
return true
end
#--------------------------------------------------------------------------
# ● 取得上个角色输入的命令
#--------------------------------------------------------------------------
def self.pre_actor
return if @actor_index == 0
$game_party.members[@actor_index - 1]
end
#--------------------------------------------------------------------------
# ● 取得输入命令后的角色
#--------------------------------------------------------------------------
def self.after_actor
$game_party.members[@actor_index + 1]
end
#--------------------------------------------------------------------------
# ● 战斗行动作角色前追加
#--------------------------------------------------------------------------
def self.unshift_action_battlers(battler)
@action_battlers.unshift(battler)
end
end
#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
# 处理战斗者的类、它是一个类追加角色的方法。
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# ● 公开实例变量
#--------------------------------------------------------------------------
attr_reader :sv # 侧视图数据
attr_accessor :flash_flg # 闪光标志
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
alias initialize_game_battler_n03 initialize
def initialize
initialize_game_battler_n03
@sv = SideView.new(self)
end
#--------------------------------------------------------------------------
# ● 删除当前的战斗动作
#--------------------------------------------------------------------------
alias remove_current_action_game_battler_n03 remove_current_action
def remove_current_action
return @sv.derivation_skill_id = 0 if @sv.derivation_skill_id != 0
remove_current_action_game_battler_n03
end
#--------------------------------------------------------------------------
# ● 回合结束处理
#--------------------------------------------------------------------------
alias on_turn_end_game_battler_n03 on_turn_end
def on_turn_end
on_turn_end_game_battler_n03
@sv.add_state = []
@sv.result_damage = [@result.hp_damage, @result.mp_damage]
end
#--------------------------------------------------------------------------
# ● 比较参数条件 data=[种别, 数值, 判别]
#--------------------------------------------------------------------------
def comparison_parameter(data)
return true if data[0][0] == 0
kind = data[0]
num = data[1]
select = data[2]
case kind
when 1 ; par = level
when 2 ; par = mhp
when 3 ; par = mmp
when 4 ; par = hp
when 5 ; par = mp
when 6 ; par = tp
when 7 ; par = atk
when 8 ; par = self.def
when 9 ; par = mat
when 10 ; par = mdf
when 11 ; par = agi
when 12 ; par = luk
end
if num < 0
case kind
when 4 ; num = mhp * num / 100
when 5 ; num = mmp * num / 100
when 6 ; num = max_tp * num / 100
end
num = num.abs
end
case select
when 0 ; return par == num
when 1 ; return par < num
when 2 ; return par > num
end
end
#--------------------------------------------------------------------------
# ● 比较装备条件 data=[装备种别, 类型ID]
#--------------------------------------------------------------------------
def comparison_equip(data)
kind = data[0]
items = weapons if kind == 0
items = armors if kind == 1
for item in items
for id in data[1]
return true if id > 0 && item.is_a?(RPG::Weapon) && item == $data_weapons[id.abs]
return true if id > 0 && item.is_a?(RPG::Armor) && item == $data_armors[id.abs]
return true if id < 0 && item.is_a?(RPG::Weapon) && item.wtype_id == id.abs
return true if id < 0 && item.is_a?(RPG::Armor) && item.stype_id == id.abs
end
end
return false
end
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 这是一个类来处理与主角。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 公开实例变量
#--------------------------------------------------------------------------
attr_reader :actor_id # 主角ID
#--------------------------------------------------------------------------
# ● ID
#--------------------------------------------------------------------------
def id
return @actor_id
end
#--------------------------------------------------------------------------
# ● 是否使用精灵 ★再定义
#--------------------------------------------------------------------------
def use_sprite?
return true
end
#--------------------------------------------------------------------------
# ● 实行伤害效果 ★再定义
#--------------------------------------------------------------------------
def perform_damage_effect
return if !N03::ACTOR_DAMAGE
$game_troop.screen.start_shake(5, 5, 10)
@sprite_effect_type = :blink
Sound.play_actor_damage
end
end
#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
# 它是一个类来处理敌人的角色。
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● 公开实例变量
#--------------------------------------------------------------------------
attr_reader :enemy_id # 敌人ID
#--------------------------------------------------------------------------
# ● ID
#--------------------------------------------------------------------------
def id
return @enemy_id
end
#--------------------------------------------------------------------------
# ● 等级
#--------------------------------------------------------------------------
def level
return @sv.level
end
#--------------------------------------------------------------------------
# ● 实行伤害效果 ★再定义
#--------------------------------------------------------------------------
def perform_damage_effect
return if !N03::ENEMY_DAMAGE
@sprite_effect_type = :blink
Sound.play_enemy_damage
end
#--------------------------------------------------------------------------
# ● 武器
#--------------------------------------------------------------------------
def weapons
weapon1 = $data_weapons[@sv.enemy_weapon1_id]
weapon2 = $data_weapons[@sv.enemy_weapon2_id]
return [weapon1, weapon2]
end
#--------------------------------------------------------------------------
# ● 防具
#--------------------------------------------------------------------------
def armors
return [$data_armors[@sv.enemy_shield_id]]
end
#--------------------------------------------------------------------------
# ● 二刀流的判定
#--------------------------------------------------------------------------
def dual_wield?
return $data_weapons[@sv.enemy_weapon2_id] != nil
end
#--------------------------------------------------------------------------
# ● 角色图像变更
#--------------------------------------------------------------------------
def graphics_change(battler_name)
@battler_name = battler_name
end
#--------------------------------------------------------------------------
# ● 取得通常攻击的动画ID
#--------------------------------------------------------------------------
def atk_animation_id1
return weapons[0].animation_id if weapons[0]
return weapons[1] ? 0 : 1
end
#--------------------------------------------------------------------------
# ● 取得通常攻击的动画ID (二刀流:武器2)
#--------------------------------------------------------------------------
def atk_animation_id2
return weapons[1] ? weapons[1].animation_id : 0
end
end
#==============================================================================
# ■ Sprite_Base
#------------------------------------------------------------------------------
# 这是显示你添加处理精灵之类的。
#==============================================================================
class Sprite_Base < Sprite
#--------------------------------------------------------------------------
# ● 更新动画的坐标 (有归位)
#--------------------------------------------------------------------------
def update_animation_position_horming
return if @action_end_cancel
ani_ox_set if @horming
camera_zoom = $sv_camera.zoom
camera_zoom = 1 if @move_anime
kind = 1
kind = -1 if @ani_mirror && !@anime_no_mirror
cell_data = @animation.frames[@animation.frame_max - (@ani_duration + @ani_rate - 1) / @ani_rate].cell_data
for i in 0..15
@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
@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
end
end
#--------------------------------------------------------------------------
# ● 动画原始的坐标设置
#--------------------------------------------------------------------------
def ani_ox_set
if !SceneManager.scene_is?(Scene_Battle)
@real_x = x
@real_y = y
end
@ani_ox = @real_x - ox + width / 2
@ani_oy = @real_y - oy + height / 2
@ani_oy -= height / 2 if @animation.position == 0
@ani_oy += height / 2 if @animation.position == 2
end
#--------------------------------------------------------------------------
# ● 更新动画
#--------------------------------------------------------------------------
alias update_animation_sprite_base_n03 update_animation
def update_animation
update_animation_position_horming if animation? && SceneManager.scene_is?(Scene_Battle) && @animation.position != 3
update_animation_sprite_base_n03
end
#--------------------------------------------------------------------------
# ● 动画的原点设定 ★再定义
#--------------------------------------------------------------------------
def set_animation_origin
return ani_ox_set if @animation.position != 3
if viewport == nil
@ani_ox = Graphics.width / 2
@ani_oy = Graphics.height / 2
else
@ani_ox = viewport.rect.width / 2
@ani_oy = viewport.rect.height / 2
end
end
#--------------------------------------------------------------------------
# ● 动画精灵的设定 ★再定义
#--------------------------------------------------------------------------
def animation_set_sprites(frame)
camera_zoom = 1
camera_zoom = $sv_camera.zoom if @anime_camera_zoom && @animation.position != 3 && SceneManager.scene_is?(Scene_Battle)
camera_x = $sv_camera.x
camera_y = $sv_camera.y
camera_x = camera_y = 0 if @animation.position == 3 or !SceneManager.scene_is?(Scene_Battle)
plus_z = 5
plus_z = 1000 if @animation.position == 3
plus_z = -17 if @plus_z != nil && @plus_z == false
plus_z = -self.z + 10 if @plus_z != nil && @plus_z == false && @animation.position == 3
cell_data = frame.cell_data
@ani_sprites.each_with_index do |sprite, i|
next unless sprite
pattern = cell_data[i, 0]
if !pattern || pattern < 0
sprite.visible = false
next
end
sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192,
pattern % 100 / 5 * 192, 192, 192)
if @ani_mirror && !@anime_no_mirror
sprite.x = (@ani_ox - cell_data[i, 1] - camera_x) * camera_zoom
sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
sprite.angle = (360 - cell_data[i, 4])
sprite.mirror = (cell_data[i, 5] == 0)
else
sprite.x = (@ani_ox + cell_data[i, 1] - camera_x) * camera_zoom
sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
end
sprite.z = self.z + plus_z + i
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] * camera_zoom / 100.0
sprite.zoom_y = cell_data[i, 3] * camera_zoom/ 100.0
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
#--------------------------------------------------------------------------
# ● 精灵标志
#--------------------------------------------------------------------------
def set(battler, horming, camera_zoom, no_mirror)
@battler = battler
@next = true
self.bitmap = Bitmap.new(@battler.sv.cw, @battler.sv.ch)
self.ox = bitmap.width / 2
self.oy = bitmap.height
@horming = horming
@anime_camera_zoom = camera_zoom
@anime_no_mirror = no_mirror
@battler.sv.reset_anime_data
end
#--------------------------------------------------------------------------
# ● 精灵坐标集
#--------------------------------------------------------------------------
def set_position(z, zoom_x, zoom_y, real_x, real_y)
self.z = z
self.zoom_x = zoom_x
self.zoom_y = zoom_y
@real_x = real_x
@real_y = real_y
end
#--------------------------------------------------------------------------
# ● 其他精灵的定时处理
#--------------------------------------------------------------------------
def other_process_timing(timing)
se_flag = true
se_flag = @se_flag if @se_flag != nil
@battler.sv.timing.push([se_flag, timing.dup])
end
#--------------------------------------------------------------------------
# ● 其他角色的定时处理
#--------------------------------------------------------------------------
def target_battler_process_timing(timing)
for target in @timing_targets
target.sv.timing.push([false, timing.dup])
end
end
#--------------------------------------------------------------------------
# ● SE 闪光的定时处理
#--------------------------------------------------------------------------
alias animation_process_timing_sprite_base_n03 animation_process_timing
def animation_process_timing(timing)
target_battler_process_timing(timing) if @timing_targets && @timing_targets != []
return other_process_timing(timing) if @next != nil
animation_process_timing_sprite_base_n03(timing)
end
#--------------------------------------------------------------------------
# ● 释放动画
#--------------------------------------------------------------------------
alias dispose_animation_sprite_base_n03 dispose_animation
def dispose_animation
dispose_animation_sprite_base_n03
end
end
#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
# 这是显示精灵角色的。
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# ● 公开实例变量
#--------------------------------------------------------------------------
attr_accessor :removing # 队伍脱离
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
alias initialize_sprite_battler_n03 initialize
def initialize(viewport, battler = nil)
initialize_sprite_battler_n03(viewport, battler)
@real_x = @real_y = 0
update_bitmap if @battler != nil
end
#--------------------------------------------------------------------------
# ● 开始动画 ★再定义
#--------------------------------------------------------------------------
def start_animation(animation, mirror = false)
return next_animation(animation, mirror) if animation?
@animation = animation
if @animation
@horming = @battler.sv.anime_horming
@anime_camera_zoom = @battler.sv.anime_camera_zoom
@anime_no_mirror = @battler.sv.anime_no_mirror
@timing_targets = @battler.sv.timing_targets
@plus_z = @battler.sv.anime_plus_z
@battler.sv.reset_anime_data
@ani_mirror = mirror
set_animation_rate
@ani_duration = @animation.frame_max * @ani_rate + 1
load_animation_bitmap
make_animation_sprites
set_animation_origin
end
end
#--------------------------------------------------------------------------
# ● 开始下一个动画
#--------------------------------------------------------------------------
def next_animation(animation, mirror)
@next_anime = [] if @next_anime == nil
@next_anime.push(Sprite_Base.new(viewport))
@next_anime[@next_anime.size - 1].set(battler, @battler.sv.anime_horming, @battler.sv.anime_camera_zoom, @battler.sv.anime_no_mirror)
@next_anime[@next_anime.size - 1].set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y)
@next_anime[@next_anime.size - 1].start_animation(animation, mirror)
end
#--------------------------------------------------------------------------
# ● 创建影图行
#--------------------------------------------------------------------------
def create_shadow
reset_shadow
return if @battler.sv.shadow == false
@shadow = Sprite.new(viewport) if @shadow == nil
@shadow.bitmap = Cache.character(@battler.sv.shadow)
@shadow.ox = @shadow.bitmap.width / 2
@shadow.oy = @shadow.bitmap.height / 2
end
#--------------------------------------------------------------------------
# ● 初始化影图形
#--------------------------------------------------------------------------
def reset_shadow
return if @shadow == nil
@shadow.dispose
@shadow = nil
end
#--------------------------------------------------------------------------
# ● 更新传输位图 ★再定义
#--------------------------------------------------------------------------
def update_bitmap
update_bitmap_enemy if !@battler.actor?
update_bitmap_actor if @battler.actor?
update_src_rect if @battler != nil
update_color if @battler != nil
end
#--------------------------------------------------------------------------
# ● 传输位图:敌人
#--------------------------------------------------------------------------
def update_bitmap_enemy
if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
@battler_graphic_file_index = @battler.sv.graphic_file_index
@graphic_mirror_flag = @battler.sv.graphic_mirror_flag
self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue)
@battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
create_shadow
init_visibility
@battler_id = @battler.id
end
end
#--------------------------------------------------------------------------
# ● 传输位图:主角
#--------------------------------------------------------------------------
def update_bitmap_actor
if @battler.character_name != @battler_name or @battler.character_index != @battler_index
@battler_name = @battler.character_name
@battler_index = @battler.character_index
@battler_graphic_file_index = @battler.sv.graphic_file_index
@graphic_mirror_flag = @battler.sv.graphic_mirror_flag
self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index)
@battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id) if !@battler.is_a?(Game_Summon)
create_shadow
init_visibility
@battler_id = @battler.id
end
end
#--------------------------------------------------------------------------
# ● 初始化可见状态 ★再定义
#--------------------------------------------------------------------------
def init_visibility
@battler_visible = @battler.alive?
@battler_visible = true if @battler.sv.state(1) != "敌人战斗不能"
@battler_visible = false if @battler.hidden?
@battler.sv.opacity = 0 unless @battler_visible
self.opacity = 0 unless @battler_visible
self.opacity = 255 if @battler_visible
@battler.sv.weapon_visible = @battler_visible
end
#--------------------------------------------------------------------------
# ● 更新传输矩形
#--------------------------------------------------------------------------
def update_src_rect
return if @battler.sv.collapse
if @battler_graphic_file_index != @battler.sv.graphic_file_index
@battler_graphic_file_index = @battler.sv.graphic_file_index
self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index) if @battler.actor?
self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue) if !@battler.actor?
@battler.sv.set_graphics(self.bitmap.width, self.bitmap.height)
end
anime_off if @battler.sv.anime_off
self.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
self.opacity = @battler.sv.opacity if @battler_visible
set_process_timing(@battler.sv.timing) if @battler && @battler.sv.timing != []
end
#--------------------------------------------------------------------------
# ● 更新位置 ★再定义
#--------------------------------------------------------------------------
def update_position
@real_x = @battler.sv.x / 100
@real_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust)/ 100
if battler.is_a?(Game_Summon) #如果是召喚成員 則x軸減40
@real_x = @real_x -40#($fu_wan_actor.sv.x / 100) - 40 #
# @real_y = ($fu_wan_actor.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust)/ 100
end
self.x = @real_x - $sv_camera.x
self.y = @real_y - $sv_camera.y
self.z = @battler.sv.z - @battler.sv.c / 100
if @battler.sv.h <= 0
self.x += $sv_camera.sx / 100
self.y += $sv_camera.sy / 100
end
self.x *= $sv_camera.zoom
self.y *= $sv_camera.zoom
end
#--------------------------------------------------------------------------
# ● 更新原点 ★再定义
#--------------------------------------------------------------------------
def update_origin
return if !bitmap or @battler.sv.collapse
self.ox = @battler.sv.ox
self.oy = @battler.sv.oy
self.angle = @battler.sv.angle
self.zoom_x = @battler.sv.zoom_x * $sv_camera.zoom
self.zoom_y = @battler.sv.zoom_y * $sv_camera.zoom
self.mirror = @battler.sv.mirror if !@graphic_mirror_flag
self.mirror = !@battler.sv.mirror if @graphic_mirror_flag
end
#--------------------------------------------------------------------------
# ● 更新影图像
#--------------------------------------------------------------------------
def update_shadow
@shadow.visible = @battler.sv.shadow_visible
@shadow.opacity = @battler.sv.opacity if @battler.sv.opacity_data[3]
@shadow.opacity = self.opacity if !@battler.sv.opacity_data[3]
@shadow.x = @real_x - $sv_camera.x
@shadow.y = (@battler.sv.y - @battler.sv.c)/ 100 - $sv_camera.y
@shadow.z = @battler.sv.z - 10
@shadow.zoom_x = $sv_camera.zoom
@shadow.zoom_y = $sv_camera.zoom
@shadow.x += $sv_camera.sx / 100
@shadow.y += $sv_camera.sy / 100
@shadow.x *= $sv_camera.zoom
@shadow.y *= $sv_camera.zoom
@shadow.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
end
#--------------------------------------------------------------------------
# ● 更新气球
#--------------------------------------------------------------------------
def update_balloon
if @battler.sv.balloon_data == [] && @balloon
@balloon_data = []
@balloon.dispose
return @balloon = nil
elsif @battler.sv.balloon_data != [] && @battler.sv.balloon_data != @balloon_data
@balloon_data = @battler.sv.balloon_data
@balloon = Sprite.new(self.viewport)
@balloon.bitmap = Cache.system("Balloon")
@balloon.zoom_x = @balloon_data[3]
@balloon.zoom_y = @balloon_data[3]
@balloon.ox = 32 if @battler.sv.mirror
@balloon.oy = 16
@balloon_count = 0
end
return if !@balloon
@balloon.opacity = self.opacity
@balloon.x = self.x
@balloon.y = self.y - @battler.sv.ch * $sv_camera.zoom
@balloon.z = self.z + 20
@balloon.src_rect.set(32 + @balloon_count / @balloon_data[2] * 32, @balloon_data[1] * 32, 32, 32) if @balloon_count % @balloon_data[2] == 0
@balloon.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
@balloon_count += 1
@balloon_count = 0 if @balloon_count == @balloon_data[2] * 7
end
#--------------------------------------------------------------------------
# ● 更新色调变更
#--------------------------------------------------------------------------
def update_color
color_set if @battler.sv.color_set != []
return if @color_data == nil
@color_data[4] -= 1
if @color_data[4] == 0 && @color_data[5] != 0
@color_data[4] = @color_data[5]
@color_data[5] = 0
@color_data[6] = [0,0,0,0]
elsif @color_data[4] == 0
@remain_color_data = @color_data
@battler.sv.color = @color_data.dup
return @color_data = nil
end
for i in 0..3
@color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
end
@battler.sv.color = @color_data.dup
self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
end
#--------------------------------------------------------------------------
# ● 更新残像
#--------------------------------------------------------------------------
def update_mirage
if @battler.sv.mirage == [] && @mirages
@mirage_data = []
for mirage in @mirages do mirage.dispose end
return @mirages = nil
elsif @battler.sv.mirage != [] && @battler.sv.mirage != @mirage_data
@mirage_data = @battler.sv.mirage
@mirages = []
for i in 0...@mirage_data[1] do @mirages[i] = Sprite.new(self.viewport) end
@mirage_count = 0
end
return if !@mirages
@mirage_count += 1
@mirage_count = 0 if @mirage_count == @mirage_data[2] * @mirages.size
for i in [email]0...@mirages.size[/email]
mirage_body(@mirages[i], @mirage_data[4]) if @mirage_count == 1 + i * @mirage_data[2]
end
end
#--------------------------------------------------------------------------
# ● 残像本体
#--------------------------------------------------------------------------
def mirage_body(body, opacity)
body.bitmap = self.bitmap.dup
body.x = self.x
body.y = self.y
body.ox = self.ox
body.oy = self.oy
body.z = self.z - 20
body.mirror = self.mirror
body.angle = self.angle
body.opacity = opacity * self.opacity / 255
body.zoom_x = self.zoom_x
body.zoom_y = self.zoom_y
body.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
body.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
end
#--------------------------------------------------------------------------
# ● 更新下一个动画
#--------------------------------------------------------------------------
def update_next_anime
return if !@next_anime
for anime in @next_anime
anime.update
anime.set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y) if @horming
anime.dispose if !anime.animation?
@next_anime.delete(anime) if !anime.animation?
end
end
#--------------------------------------------------------------------------
# ● 更新帧数
#--------------------------------------------------------------------------
alias update_sprite_battler_n03 update
def update
@battler.sv.update if @battler
update_sprite_battler_n03
update_next_anime
update_shadow if @battler && @shadow
update_mirage if @battler
update_balloon if @battler
update_remove if @battler && @removing && @battler.sv.change_up
end
#--------------------------------------------------------------------------
# ● 战斗动画消除
#--------------------------------------------------------------------------
def anime_off
@battler.sv.anime_off = false
dispose_animation
for anime in @next_anime do anime.dispose_animation end if @next_anime
end
#--------------------------------------------------------------------------
# ● 角色替换
#--------------------------------------------------------------------------
def remove
@battler.sv.start_action(@battler.sv.remove_action)
$sv_camera.wait = 40
@battler.sv.add_action("eval('set_change')")
@removing = true
end
#--------------------------------------------------------------------------
# ● 更新角色替换
#--------------------------------------------------------------------------
def update_remove
@battler.sv.change_up = false
@removing = false
@battler = nil
end
#--------------------------------------------------------------------------
# ● 加入角色
#--------------------------------------------------------------------------
def join(join_battler)
$sv_camera.wait = 30
@battler = join_battler
@battler_name = @battler.character_name
@battler_index = @battler.character_index
@battler_graphic_file_index = @battler.sv.graphic_file_index
self.bitmap = Cache.character(@battler_name)
@battler.sv.setup(self.bitmap.width, self.bitmap.height, true)
create_shadow
init_visibility
end
#--------------------------------------------------------------------------
# ● 通常的设定返回 ★再定义
#--------------------------------------------------------------------------
def revert_to_normal
self.blend_type = 0
self.opacity = 255
end
#--------------------------------------------------------------------------
# ● 更新战斗不能效果
#--------------------------------------------------------------------------
alias update_collapse_sprite_battler_n03 update_collapse
def update_collapse
return if @battler.sv.state(1) != "敌人战斗不能"
update_collapse_sprite_battler_n03
@battler.sv.weapon_visible = false
end
#--------------------------------------------------------------------------
# ● 更新Boss战斗不能效果 ★再定义
#--------------------------------------------------------------------------
def update_boss_collapse
@effect_duration = @battler.sv.ch if @effect_duration >= @battler.sv.ch
alpha = @effect_duration * 120 / @battler.sv.ch
self.ox = @battler.sv.cw / 2 + @effect_duration % 2 * 4 - 2
self.blend_type = 1
self.color.set(255, 255, 255, 255 - alpha)
self.opacity = alpha
self.src_rect.y -= 1
Sound.play_boss_collapse2 if @effect_duration % 20 == 19
end
#--------------------------------------------------------------------------
# ● 另个精灵的定时处理
#--------------------------------------------------------------------------
def set_process_timing(timing_data)
for data in timing_data
set_timing(data[0],data[1])
end
@battler.sv.timing = []
end
#--------------------------------------------------------------------------
# ● 定时的处理
#--------------------------------------------------------------------------
def set_timing(se_flag, data)
@ani_rate = 4
data.se.play if se_flag
case data.flash_scope
when 1 ;self.flash(data.flash_color, data.flash_duration * @ani_rate)
when 2 ;viewport.flash(data.flash_color, data.flash_duration * @ani_rate) if viewport
when 3 ;self.flash(nil, data.flash_duration * @ani_rate)
end
end
#--------------------------------------------------------------------------
# ● 色调变更
#--------------------------------------------------------------------------
def color_set
set = @battler.sv.color_set
@battler.sv.color_set= []
set[4] = 1 if set[4] == 0
@remain_color_data = [0,0,0,0] if @remain_color_data == nil
@color_data = @remain_color_data
@color_data[4] = set[4]
@color_data[5] = set[5]
@color_data[6] = set
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
alias dispose_sprite_battler_n03 dispose
def dispose
dispose_sprite_battler_n03
@shadow.dispose if @shadow != nil
@balloon.dispose if @balloon != nil
for mirage in @mirages do mirage.dispose end if @mirages != nil
for anime in @next_anime do anime.dispose end if @next_anime
end
end
#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
# 这是一个类结合了精灵的战斗画面。
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● 战斗背景(地)创建精灵 ★再定义
#--------------------------------------------------------------------------
def create_battleback1
@back1_sprite = Sprite_Battle_Back.new(@viewport1, 1, battleback1_name)
@back1_sprite.set_graphics(battleback1_bitmap) if battleback1_name != nil
@back1_sprite.z = 0
end
#--------------------------------------------------------------------------
# ● 战斗背景(壁)创建精灵 ★再定义
#--------------------------------------------------------------------------
def create_battleback2
@back2_sprite = Sprite_Battle_Back.new(@viewport1, 2, battleback2_name)
@back2_sprite.set_graphics(battleback2_bitmap) if battleback2_name != nil
@back2_sprite.z = 1
end
#--------------------------------------------------------------------------
# ● 创建角色精灵 ★再定义
#--------------------------------------------------------------------------
def create_actors
@actor_sprites = []
for i in 0...$game_party.max_battle_members # max_battle_members參戰角色的最大數
@actor_sprites[i] = Sprite_Battler.new(@viewport1, $game_party.members[i])
end
@effect_sprites = Spriteset_Sideview.new(@viewport1) #处理战斗画面的精灵的类
end
#--------------------------------------------------------------------------
# ● 更新角色精灵 ★再定义
#--------------------------------------------------------------------------
def update_actors
@actor_sprites.each_with_index do |sprite, i|
sprite_join($game_party.members[i], sprite) if sprite.battler == nil && sprite.battler != $game_party.members[i]
sprite.remove if sprite.battler != nil && !sprite.removing && sprite.battler != $game_party.members[i]
sprite.update
end
@effect_sprites.update
update_program
end
#--------------------------------------------------------------------------
# ● 加入精灵成员
#--------------------------------------------------------------------------
def sprite_join(member, sprite)
for sp in @actor_sprites
sp.update_remove if member == sp.battler && !sp.battler.sv.change_up
end
sprite.join(member)
end
#--------------------------------------------------------------------------
# ● 更新战斗程序
#--------------------------------------------------------------------------
def update_program
return if $sv_camera.program_scroll == []
for data in $sv_camera.program_scroll
@back1_sprite.start_back_data(data) if data[2] == 1
@back2_sprite.start_back_data(data) if data[2] == 2
end
$sv_camera.program_scroll = []
end
#--------------------------------------------------------------------------
# ● 实行打击时的战斗动画
#--------------------------------------------------------------------------
def set_hit_animation(battler, weapon_index, hit_targets, miss)
@effect_sprites.set_hit_animation(battler, weapon_index, hit_targets, miss)
end
#--------------------------------------------------------------------------
# ● 伤害POP
#--------------------------------------------------------------------------
def set_damage_pop(target)
@effect_sprites.set_damage_pop(target)
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
alias dispose_spriteset_battle_n03 dispose
def dispose
dispose_spriteset_battle_n03
@effect_sprites.dispose
end
end
#==============================================================================
# ■ Window_BattleLog
#------------------------------------------------------------------------------
# 进行战斗的实况显示窗口。
#==============================================================================
class Window_BattleLog < Window_Selectable
#--------------------------------------------------------------------------
# ● 等待 ★再定义
#--------------------------------------------------------------------------
def wait
end
#--------------------------------------------------------------------------
# ● 等待和清除 ★再定义
#--------------------------------------------------------------------------
def wait_and_clear
$sv_camera.wait = 10
end
#--------------------------------------------------------------------------
# ● 显示动作结果 ★再定义
#--------------------------------------------------------------------------
def display_action_results(target, item)
if target.result.used
last_line_number = line_number
display_critical(target, item)
display_damage(target, item)
display_affected_status(target, item)
display_failure(target, item)
end
off if !N03::BATTLE_LOG
end
#--------------------------------------------------------------------------
# ● 隐藏窗口
#--------------------------------------------------------------------------
def off
@back_sprite.visible = self.visible = false
end
end
#==============================================================================
# ■ Game_Interpreter
#------------------------------------------------------------------------------
# 这是一个事件命令的解释器。
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# ● 开关的操作
#--------------------------------------------------------------------------
alias command_121_game_interpreter_n03 command_121
def command_121
command_121_game_interpreter_n03
$sv_camera.program_check
end
end
召喚 =begin ============================================================================== ** Battle Summons Author: Tsukihime Date: Jul 10, 2012 ------------------------------------------------------------------------------ ** Change log Jul 10 -added summon_only_battle to game system as a flag Jun 24 -fixed enemy summoning: only refresh newly summoned sprites Jun 12 -assign specific summons to items/skills -summon ID is now the same as the actor ID -added remove summon functionality. May 30 -summon limits and type limits added -summons recover all after battle -summon implemented as a skill -added Command Setup compatibility -added enemy summons -summon equip menu added May 20 -option to remove all actors when summon appears -actors will return when the summon disappears May 19 -Created summon scene/window -added summon command -summons are now treated as actors and level accordingly May 18 -Initial release ------------------------------------------------------------------------------ Summon battlers to fight for you! In the configuration, designate skills that should be treated as "summon skills". Then set up the skill in the database. Enemies can also be set up to use the summon skill. They will need a list of enemy ID's to choose from. Tag enemies with the enemy ID's they should summon <summons: 1,2,3> Then give them the summon skill in their action list To add a summon to your party, use the script call $game_party.add_summon(summon_id) To remove a summon from your party, $game_party.remove_summon(summon_id) To force summon a party to battle, use the call $game_summons.summon(id) ============================================================================== =end $imported = {} if $imported.nil? $imported["Tsuki_BattleSummon"] = true #============================================================================== # ** Configuration. #============================================================================== module Tsuki module Battle_Summon #召喚技能編號或道具編號 Summon_Skill = [166] Summon_Item = [111,112] #動物技能 Animal_Skill = [218] Animal_Item = [211,212] #釋放技能或道具 Release_Skill = [195] Release_Item = [111,112] #補捉技能或道具 Catch_Skill = [196] Catch_Item = [111,112] # variable used to determine the number of turns summoned Default_Summon_Turns = 3 Summon_Turn_Variable = 1 Summon_Limit = 4 # 召喚數最大值 Summon_Type_Limit = 4 # How many different summons you can have in battle召喚種類最大值 # 召喚成功訊息 # format [user name], [summon name] Summon_Message = "%s 召喚了 %s !" # Should the summon command be shown in battle? Enable_Summon_Command = false # 召喚後使用者是否消失 Summon_Only_Battle = false #動物及保鏢的id區分 設定角色為16以後均為動物 Animal_Id = 16 # Monster Hunter add-on requires that script. It adds all captured monsters # to your summon list rather than the party list. Monster_Hunter_Addon = false #============================================================================== # ** 是否為召喚效果 #============================================================================== def self.summon_effect?(item) return Summon_Skill.include?(item.id) if item.is_a?(RPG::Skill)#是否召喚技能 return Summon_Item.include?(item.id) if item.is_a?(RPG::Item)#是否為召喚道具 return false end #============================================================================== # ** 是否為動物效果 #============================================================================== def self.animal_effect?(item) return Animal_Skill.include?(item.id) if item.is_a?(RPG::Skill)#是否動物技能 return Animal_Item.include?(item.id) if item.is_a?(RPG::Item)#是否動物道具 return false end #============================================================================== # ** 是否為釋放效果 #============================================================================== def self.release_effect?(item) return Release_Skill.include?(item.id) if item.is_a?(RPG::Skill)#是否釋放技能 return Release_Item.include?(item.id) if item.is_a?(RPG::Item)#是否釋放道具 return false end #============================================================================== # ** 是否為補捉效果 #============================================================================== def self.catch_effect?(item) return Catch_Skill.include?(item.id) if item.is_a?(RPG::Skill)#是否補捉技能 return Catch_Item.include?(item.id) if item.is_a?(RPG::Item)#是否補捉道具 return false end Enemy_Summon_Regex = /<summons:?\s*(.*)\s*>/i Summon_Limit_Regex = /<summon-max:?\s*(\d+)\s*>/i Summon_ID_Regex = /<summon:?\s*(\d+)\s*>/i end end module RPG class Actor < BaseItem def summon_limit return @summon_limit unless @summon_limit.nil? res = Tsuki::Battle_Summon::Summon_Limit_Regex.match(self.note) return @summon_limit = res ? res[1].to_i : 99 end end class Enemy < BaseItem def enemy_summons return @enemy_summon unless @enemy_summon.nil? return @enemy_summon = load_notetags_enemy_summons end def load_notetags_enemy_summons summons = [] self.note.split(/[\r\n]+/).each do |line| case line when Tsuki::Battle_Summon::Enemy_Summon_Regex $1.scan(/\d+/).each {|id| summons << id.to_i} end end return summons end end class UsableItem < BaseItem def summon_id return @summon_id unless @summon_id.nil? res = Tsuki::Battle_Summon::Summon_ID_Regex.match(self.note) return @summon_id = res ? res[1].to_i : 0 end end end module DataManager class << self alias :tsuki_battle_summon_create_objects :create_game_objects alias :tsuki_battle_summon_make_save_contents :make_save_contents alias :tsuki_battle_summon_extract_save_contents :extract_save_contents end def self.create_game_objects tsuki_battle_summon_create_objects $game_summons = Game_Summons.new end def self.make_save_contents contents = tsuki_battle_summon_make_save_contents contents[:summons] = $game_summons contents end def self.extract_save_contents(contents) tsuki_battle_summon_extract_save_contents(contents) $game_summons = contents[:summons] end end module BattleManager class << self alias :tsuki_battle_summon_turn_end :turn_end alias :tsuki_battle_summon_gain_exp :gain_exp alias :tsuki_battle_summon_battle_end :battle_end end def self.turn_end p "動物回合結束" tsuki_battle_summon_turn_end $game_summons.update_summons end def self.gain_exp tsuki_battle_summon_gain_exp $game_summons.battle_members.each do |summon| summon.gain_exp($game_troop.exp_total) end wait_for_message end def self.battle_end(result) tsuki_battle_summon_battle_end(result) $game_summons.on_battle_end end end class Spriteset_Battle def refresh_enemies new_enemies = $game_troop.members.reverse.collect do |enemy| @enemy_sprites << Sprite_Battler.new(@viewport1, enemy) if enemy.summoned? end end end class Game_System attr_accessor :summon_only_battle alias :th_battle_summon_init_system :initialize def initialize th_battle_summon_init_system @summon_only_battle = Tsuki::Battle_Summon::Summon_Only_Battle end end class Game_Action attr_accessor :summon_id #id of summon to call alias :th_battle_summon_clear_action :clear def clear th_battle_summon_clear_action @summon_id = 0 end end class Game_ActionResult attr_accessor :called_summon alias :th_battle_summon_clear_results :clear def clear th_battle_summon_clear_results clear_summon_result end def clear_summon_result @called_summon = nil end def called_summon_text if @called_summon fmt = Tsuki::Battle_Summon::Summon_Message sprintf(fmt, @battler.name, @called_summon.name) else "" end end end class Game_Battler < Game_BattlerBase include Tsuki::Battle_Summon #-------------------------------------------------------------------------- # ● 是否為召喚動作 #-------------------------------------------------------------------------- def is_summon_action?(item) return false unless item Tsuki::Battle_Summon.summon_effect?(item) end #-------------------------------------------------------------------------- # ● 是否為動物召喚動作 #-------------------------------------------------------------------------- def is_animal_action?(item) return false unless item Tsuki::Battle_Summon.animal_effect?(item) end #-------------------------------------------------------------------------- # ● 是否為釋放動作 #-------------------------------------------------------------------------- def is_release_action?(item) return false unless item Tsuki::Battle_Summon.release_effect?(item) end #-------------------------------------------------------------------------- # ● 是否為補捉動作 #-------------------------------------------------------------------------- def is_catch_action?(item) return false unless item Tsuki::Battle_Summon.catch_effect?(item) end #-------------------------------------------------------------------------- # ● 重寫 技能/物品的效果 #-------------------------------------------------------------------------- alias :th_summon_battler_item_apply :item_apply def item_apply(user, item) th_summon_battler_item_apply(user, item) summon_battler(user, item) if is_summon_action?(item) summon_battler(user, item) if is_animal_action?(item) release_battler(user, item) if is_release_action?(item) catch_enemy(user, item) if is_catch_action?(item) make_miss_popups(user, item)#配合Ace_Battle_Engine腳本 移到腳本最後 end #-------------------------------------------------------------------------- # ● 召喚戰鬥者 #-------------------------------------------------------------------------- def summon_battler(user, item) called_summon = user.friends_unit.summon_battler(user.actions[0].summon_id) #called_summon = $game_troop.summon_battler(user.actions[0].summon_id) if Summon1_Skill if called_summon @result.success = true @result.called_summon = called_summon end end #-------------------------------------------------------------------------- # ● 釋放怪物 #-------------------------------------------------------------------------- def release_battler(user, item) enemy_id = user.recruit_enemy # called_summon = $game_troop.summon_battler(3) called_summon = $game_troop.summon_battler(enemy_id) if called_summon @result.success = true @result.called_summon = called_summon user.recruit_enemy = 0 #清空被補怪物 end end #-------------------------------------------------------------------------- # ● 補捉怪物 #-------------------------------------------------------------------------- def catch_enemy(user, item) if $fu_wan_target.hp_rate <= 0.7 user.recruit_enemy = $fu_wan_target.enemy_id @result.success = true $fu_wan_target.add_state(56) $fu_wan_target.hide end end #-------------------------------------------------------------------------- # ● 附加新的狀態 #-------------------------------------------------------------------------- alias summon_add_new_state add_new_state def add_new_state(state_id) # die if state_id ==56 summon_add_new_state(state_id) end end class Game_BattlerBase #-------------------------------------------------------------------------- # ● 檢查是否含有無法戰鬥狀態 #-------------------------------------------------------------------------- def death_state? state?(death_state_id) #|| state?(56) end end class Game_Enemy < Game_Battler attr_accessor :just_summoned alias :th_battle_summon_init_enemy :initialize def initialize(index, enemy_id) th_battle_summon_init_enemy(index, enemy_id) @just_summoned = false init_summons end def summoned? if @just_summoned @just_summoned = false return true end return false end def init_summons @summons = enemy.enemy_summons end alias :th_battle_summon_make_enemy_actions :make_actions def make_actions th_battle_summon_make_enemy_actions @actions.each do |action| make_summon_action(action) if is_summon_action?(action.item) end end # pick a random target to draw a random magic from def make_summon_action(action) action.summon_id = @summons.sample end end class Game_Summon < Game_Actor attr_reader :summon_id attr_accessor :summon_turns attr_accessor :summon_index def initialize(actor_id) super(actor_id) @summon_id = actor_id @summon_turns = 0 @summon_index = 0 # 0 if not summoned @dupe = false end def can_dupe? @dupe end def update_summon p " @summon_turns" p @summon_turns @summon_turns -= 1 if @summon_turns <= 0 $game_summons.unsummon(@summon_id) end end def die $game_summons.unsummon(@summon_id) super end def index $game_summons.members.index(self) end end class Game_Summons < Game_Unit include Tsuki::Battle_Summon def initialize @data = [nil] @ids = [nil] @dispatched = [] @summon_count = 0 #how many summons are on the field @limit = Summon_Limit @type_limit = Summon_Type_Limit @menu_actor_id = 0 end def [](summon_id) @data[summon_id] ||= Game_Summon.new(summon_id) end def members in_battle ? battle_members : all_summons end def all_summons @data.select {|summon| !summon.nil?} end # summons that are currently in battle def battle_members @dispatched.collect {|id| @data[id]} end def summon_actor(id) return if @ids.include?(id) summon = Game_Summon.new(id) @data[id] = summon @ids << id end def unsummon(id) return unless @dispatched.include?(id) @dispatched.delete_at(@data[id].summon_index - 1) @data[id].summon_index = 0 @summon_count -= 1 end def summon(id) return 0 unless @data[id] @data[id].summon_turns = [Default_Summon_Turns, $game_variables[Summon_Turn_Variable]].max @data[id].make_actions @summon_count += 1 @data[id].summon_index = @summon_count @dispatched << id return id end def can_summon?(summon_id) return false if @data[summon_id].nil? return false if @summon_count >= @limit || @dispatched.uniq.size >= @type_limit return false if @dispatched.include?(summon_id) && !@data[summon_id].can_dupe? return true end def update_summons members.each {|summon| summon.update_summon} end def on_battle_end alive_members.each {|summon| summon.recover_all } @dispatched = [] @summon_count = 0 end def menu_actor @data[@menu_actor_id] || members[0] end def menu_actor=(summon) return unless summon @menu_actor_id = summon.summon_id end def menu_actor_next index = members.index(menu_actor) || -1 index = (index + 1) % members.size self.menu_actor = members[index] end def menu_actor_prev index = members.index(menu_actor) || 1 index = (index + members.size - 1) % members.size self.menu_actor = members[index] end end #============================================================================== # * #============================================================================== class Game_Party < Game_Unit include Tsuki::Battle_Summon alias tsuki_battle_summon_initialize_party initialize def initialize tsuki_battle_summon_initialize_party @summons = [] end alias tsuki_battle_summon_battle_members battle_members def battle_members summons = $game_summons.battle_members if $game_system.summon_only_battle summons.empty? ? tsuki_battle_summon_battle_members : summons else members = tsuki_battle_summon_battle_members members.concat(summons) end end def summons @summons.collect {|id| $game_summons[id]} end # try to call a summon, return summoned_id if successful def summon_battler(id) return unless $game_summons.can_summon?(id) summoned_id = $game_summons.summon(id) return $game_summons[summoned_id] end def add_summon(summon_id) $game_summons.summon_actor(summon_id) @summons.push(summon_id) unless @summons.include?(summon_id) end def remove_summon(summon_id) @summons.delete(summon_id) end def clear_summons @summons = [] end def on_battle_end super # clear_summons end #-------------------------------------------------------------------------- # ● 取得參戰角色(不納入召喚獸) #-------------------------------------------------------------------------- def battle_members1 all_members[0, max_battle_members].select {|actor| actor.exist? && !actor.is_a?(Game_Summon) } end end class Game_Troop < Game_Unit # create a new enemy on the spot def summon_battler(enemy_id) return unless $data_enemies[enemy_id] new_enemy = Game_Enemy.new(@enemies.size, enemy_id) new_enemy.just_summoned = true new_enemy.screen_x = rand(Graphics.width / 2) + 100 new_enemy.screen_y = rand(Graphics.height / 2) + 100 new_enemy.add_state(55) @enemies.push(new_enemy) SceneManager.scene.refresh_enemies return new_enemy end end class Game_Interpreter def add_actor_summon(actor_id) $game_party.add_summon(actor_id) end def summon_battler(summon_id) $game_party.summon_battler(summon_id) end end #============================================================================== # ** Menu windows and scenes #============================================================================== class Window_SummonList < Window_Selectable include Tsuki::Battle_Summon #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y, width, height) super @actor = nil @data = [] refresh end #-------------------------------------------------------------------------- # * Set Category #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh self.oy = 0 end #-------------------------------------------------------------------------- # * Get Digit Count #-------------------------------------------------------------------------- def col_max return 2 end def item_height 104 end #-------------------------------------------------------------------------- # * Get Number of Items #-------------------------------------------------------------------------- def item_max @data ? @data.size : 1 end #-------------------------------------------------------------------------- # * Get Item #-------------------------------------------------------------------------- def item @data && index >= 0 ? @data[index] : nil end #-------------------------------------------------------------------------- # * Get Activation State of Selection Item #-------------------------------------------------------------------------- def current_item_enabled? enable?(@data[index]) end def enable?(summon) summon && !$game_summons.battle_members.include?(summon) end def include?(summon) return false unless summon && summon.actor_id < Animal_Id #小於動物之id才列出 return true end def select_last select(0) end def make_item_list @data = $game_party.summons.select {|item| include?(item) } @data.push(nil) if include?(nil) end def draw_item(index) summon = @data[index] if summon rect = item_rect(index) rect.width -= 4 draw_summon_basic(summon, rect.x + 4, rect.y, enable?(summon)) draw_actor_face(summon, rect.x + rect.width - 96, rect.y) end end def draw_summon_name(summon, x, y, enabled, width = 112) change_color(normal_color, enabled) draw_text(x, y, width, line_height, summon.name) end def draw_summon_basic(summon, x, y, enabled=true, width=172) return unless summon text_width = text_size(summon.name).width draw_summon_name(summon, x, y + line_height*0, enabled) draw_actor_level(summon, x, y + line_height*1) draw_actor_hp(summon, x, y + line_height*2) draw_actor_mp(summon, x, y + line_height*3) end def update_help @help_window.set_item(item) end def refresh make_item_list create_contents draw_all_items end end class Window_SummonCommand < Window_HorzCommand def window_width Graphics.width end def make_command_list add_command("Equip", :equip) add_command("Skill", :skill) add_command("Status", :status) end end class Scene_Summons < Scene_MenuBase def start super create_summon_command create_summon_window end def create_summon_command @summon_command = Window_SummonCommand.new(0, 0) @summon_command.set_handler(:cancel, method(:return_scene)) @summon_command.set_handler(:equip, method(:command_personal)) @summon_command.set_handler(:skill, method(:command_personal)) @summon_command.set_handler(:status, method(:command_personal)) end def create_summon_window wy = @summon_command.height width = Graphics.width height = Graphics.height - wy @summon_window = Window_SummonList.new(0, wy, width, height) end def command_personal @summon_window.select_last @summon_window.activate @summon_window.set_handler(:ok, method(:on_personal_ok)) @summon_window.set_handler(:cancel, method(:on_personal_cancel)) end def on_personal_ok $game_summons.menu_actor = @summon_window.item case @summon_command.current_symbol when :equip SceneManager.call(Scene_SummonEquip) when :skill SceneManager.call(Scene_SummonSkill) when :status SceneManager.call(Scene_SummonStatus) end end def on_personal_cancel @summon_window.unselect @summon_command.activate end end class Scene_SummonSkill < Scene_Skill def start super @actor = $game_summons.menu_actor on_actor_change end def next_actor @actor = $game_summons.menu_actor_next on_actor_change end def prev_actor @actor = $game_summons.menu_actor_prev on_actor_change end end class Scene_SummonEquip < Scene_Equip def start super @actor = $game_summons.menu_actor on_actor_change end def next_actor @actor = $game_summons.menu_actor_next on_actor_change end def prev_actor @actor = $game_summons.menu_actor_prev on_actor_change end end class Scene_SummonStatus < Scene_Status def start super @actor = $game_summons.menu_actor on_actor_change end def next_actor @actor = $game_summons.menu_actor_next on_actor_change end def prev_actor @actor = $game_summons.menu_actor_prev on_actor_change end end #============================================================================== # ** Battle windows and scenes #============================================================================== class Window_BattleSummon < Window_SummonList def initialize(help_window, info_viewport) y = 0 super(0, y, Graphics.width, info_viewport.rect.y - y) self.visible = false @help_window = help_window @info_viewport = info_viewport select(0) end def enable?(summon) summon && $game_summons.can_summon?(summon.summon_id) end end class Window_BattleStatus < Window_Selectable def content_height $game_party.battle_members.size * line_height - standard_padding * 2 end alias tsuki_battle_summon_status_refresh refresh def refresh create_contents tsuki_battle_summon_status_refresh end end #-------------------------------------------------------------------------- # *召喚動物視窗 #-------------------------------------------------------------------------- class Window_Summon_animal_List < Window_BattleSummon include Tsuki::Battle_Summon def include?(summon) return false unless summon && summon.actor_id >= Animal_Id #Animal_Id 動物之id return true end end #============================================================================== # class Scene_Battle #============================================================================== class Scene_Battle < Scene_Base def refresh_enemies @spriteset.refresh_enemies end #============================================================================== # ** 改寫 建立所有視窗 #============================================================================== alias :battle_summon_create_battle_windows :create_all_windows def create_all_windows battle_summon_create_battle_windows create_summon_window create_summon_animal_window end #============================================================================== # ** 建立召喚視窗 #============================================================================== def create_summon_window @summon_window = Window_BattleSummon.new(@help_window, @info_viewport) @summon_window.set_handler(:ok, method(:on_summon_ok)) @summon_window.set_handler(:cancel, method(:on_summon_cancel)) end #============================================================================== # ** 建立召喚動物視窗 #============================================================================== def create_summon_animal_window @animal_window = Window_Summon_animal_List.new(@help_window, @info_viewport) @animal_window.set_handler(:ok, method(:on_animal_ok)) @animal_window.set_handler(:cancel, method(:on_animal_cancel)) end #-------------------------------------------------------------------------- # ●改寫 技能“確定” #-------------------------------------------------------------------------- alias :th_battle_summon_on_skill_ok :on_skill_ok def on_skill_ok @skill = @skill_window.item if Tsuki::Battle_Summon.summon_effect?(@skill) BattleManager.actor.input.set_skill(@skill.id) BattleManager.actor.last_skill.object = @skill @skill_window.hide if @skill.summon_id > 0 BattleManager.actor.input.summon_id = @skill.summon_id next_command else activate_summon_window end elsif Tsuki::Battle_Summon.animal_effect?(@skill) #動物效果 BattleManager.actor.input.set_skill(@skill.id) BattleManager.actor.last_skill.object = @skill @skill_window.hide if @skill.summon_id > 0 BattleManager.actor.input.summon_id = @skill.summon_id next_command else activate_animal_window end else th_battle_summon_on_skill_ok end end alias :th_battle_summon_on_item_ok :on_item_ok def on_item_ok @item = @item_window.item if Tsuki::Battle_Summon.summon_effect?(@item) BattleManager.actor.input.set_item(@item.id) $game_party.last_item.object = @item @item_window.hide if @item.summon_id > 0 BattleManager.actor.input.summon_id = @skill.summon_id next_command else activate_summon_window end else th_battle_summon_on_item_ok end end def command_summon activate_summon_window end #-------------------------------------------------------------------------- # ●召喚者“確定” #-------------------------------------------------------------------------- def on_summon_ok BattleManager.actor.input.summon_id = @summon_window.item.summon_id @animal_window.hide @summon_window.hide next_command end #-------------------------------------------------------------------------- # ●召喚“取消” #-------------------------------------------------------------------------- def on_summon_cancel @summon_window.hide @skill_window.show.activate if @skill @item_window.show.activate if @item end #-------------------------------------------------------------------------- # ●動物“確定” #-------------------------------------------------------------------------- def on_animal_ok BattleManager.actor.input.summon_id = @animal_window.item.summon_id @animal_window.hide next_command end #-------------------------------------------------------------------------- # ●動物“取消” #-------------------------------------------------------------------------- def on_animal_cancel @animal_window.hide @skill_window.show.activate if @skill @item_window.show.activate if @item end #-------------------------------------------------------------------------- # ●起用召喚視窗 #-------------------------------------------------------------------------- def activate_summon_window @summon_window.refresh @summon_window.show.activate end #-------------------------------------------------------------------------- # ●起用動物視窗 #-------------------------------------------------------------------------- def activate_animal_window @animal_window.refresh @animal_window.show.activate end end class Window_BattleLog < Window_Selectable alias :th_battle_summon_display_damage :display_damage def display_damage(target, item) th_battle_summon_display_damage(target, item) display_summon_results(target, item) end def display_summon_results(target, item) return unless target.result.called_summon && Tsuki::Battle_Summon.summon_effect?(item) add_text(target.result.called_summon_text) wait end end #end #============================================================================== # ** Update menu scene to add option #============================================================================== class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # * Add arena command to List #-------------------------------------------------------------------------- alias tsuki_summons_commands add_main_commands def add_main_commands tsuki_summons_commands # add_command("Summons", :summons) #增加地圖上選單指令 end end class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * Add arena handler #-------------------------------------------------------------------------- alias tsuki_summons_command_window create_command_window def create_command_window tsuki_summons_command_window @command_window.set_handler(:summons, method(:command_summons)) end def command_summons SceneManager.call(Scene_Summons) end end #============================================================================== # ** Compatibility mods #============================================================================== if $imported["FP_InventoryPlus"] class Scene_Battle < Scene_Base # directly use item from inventory def on_item_ok @item = @item_window.item if Tsuki::Battle_Summon.summon_effect?(@item) BattleManager.actor.input.set_item(@item) $game_party.last_item.object = @item @item_window.hide if @item.summon_id > 0 BattleManager.actor.input.summon_id = @item.summon_id next_command else activate_summon_window end else th_battle_summon_on_item_ok end end end end if $imported["Tsuki_CommandSetup"] class Scene_Battle < Scene_Base alias :th_battle_summon_command_use_skill :command_use_skill def command_use_skill @skill = $data_skills[@actor_command_window.current_data[:ext]] if Tsuki::Battle_Summon.summon_effect?(@skill) BattleManager.actor.input.set_skill(@skill.id) BattleManager.actor.last_skill.object = @skill @skill_window.hide if @skill.summon_id > 0 BattleManager.actor.input.summon_id = @skill.summon_id next_command else activate_summon_window end else th_battle_summon_command_use_skill end end def on_summon_cancel @enemy_draw_window.hide if @skill == $data_skills[@actor_command_window.current_data[:ext]] @actor_command_window.activate else @summon_window.hide @skill_window.show.activate end end end end #============================================================================== # ** Add-ons #============================================================================== if Tsuki::Battle_Summon::Monster_Hunter_Addon if $imported["Tsuki_MonsterHunter"] module Monster_Hunter def self.create_game_actor(actor_id) return if $BTEST $game_summons.summon_actor(actor_id) end end else msgbox("Monster Hunter must placed above this script") end end #============================================================================== # ** 角色類 #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 定義案例變量 #-------------------------------------------------------------------------- attr_accessor :recruit_enemy # 抓獲的敵人 #-------------------------------------------------------------------------- # ● 設定 #-------------------------------------------------------------------------- alias recruit_setup setup def setup(actor_id) recruit_setup(actor_id) @recruit_enemy = 0 end #-------------------------------------------------------------------------- # ● 生成自動戰鬥用的行動候選清單 #-------------------------------------------------------------------------- def make_action_list list = [] list.push(Game_Action.new(self).set_attack.evaluate) if !self.is_a?(Game_Summon) #如果是召喚獸則自動戰鬥不加入普攻 usable_skills.each do |skill| list.push(Game_Action.new(self).set_skill(skill.id).evaluate) end list end #-------------------------------------------------------------------------- end
召喚
=begin
==============================================================================
** Battle Summons
Author: Tsukihime
Date: Jul 10, 2012
------------------------------------------------------------------------------
** Change log
Jul 10
-added summon_only_battle to game system as a flag
Jun 24
-fixed enemy summoning: only refresh newly summoned sprites
Jun 12
-assign specific summons to items/skills
-summon ID is now the same as the actor ID
-added remove summon functionality.
May 30
-summon limits and type limits added
-summons recover all after battle
-summon implemented as a skill
-added Command Setup compatibility
-added enemy summons
-summon equip menu added
May 20
-option to remove all actors when summon appears
-actors will return when the summon disappears
May 19
-Created summon scene/window
-added summon command
-summons are now treated as actors and level accordingly
May 18
-Initial release
------------------------------------------------------------------------------
Summon battlers to fight for you!
In the configuration, designate skills that should be treated as
"summon skills". Then set up the skill in the database.
Enemies can also be set up to use the summon skill.
They will need a list of enemy ID's to choose from.
Tag enemies with the enemy ID's they should summon
<summons: 1,2,3>
Then give them the summon skill in their action list
To add a summon to your party, use the script call
$game_party.add_summon(summon_id)
To remove a summon from your party,
$game_party.remove_summon(summon_id)
To force summon a party to battle, use the call
$game_summons.summon(id)
==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Tsuki_BattleSummon"] = true
#==============================================================================
# ** Configuration.
#==============================================================================
module Tsuki
module Battle_Summon
#召喚技能編號或道具編號
Summon_Skill = [166]
Summon_Item = [111,112]
#動物技能
Animal_Skill = [218]
Animal_Item = [211,212]
#釋放技能或道具
Release_Skill = [195]
Release_Item = [111,112]
#補捉技能或道具
Catch_Skill = [196]
Catch_Item = [111,112]
# variable used to determine the number of turns summoned
Default_Summon_Turns = 3
Summon_Turn_Variable = 1
Summon_Limit = 4 # 召喚數最大值
Summon_Type_Limit = 4 # How many different summons you can have in battle召喚種類最大值
# 召喚成功訊息
# format [user name], [summon name]
Summon_Message = "%s 召喚了 %s !"
# Should the summon command be shown in battle?
Enable_Summon_Command = false
# 召喚後使用者是否消失
Summon_Only_Battle = false
#動物及保鏢的id區分 設定角色為16以後均為動物
Animal_Id = 16
# Monster Hunter add-on requires that script. It adds all captured monsters
# to your summon list rather than the party list.
Monster_Hunter_Addon = false
#==============================================================================
# ** 是否為召喚效果
#==============================================================================
def self.summon_effect?(item)
return Summon_Skill.include?(item.id) if item.is_a?(RPG::Skill)#是否召喚技能
return Summon_Item.include?(item.id) if item.is_a?(RPG::Item)#是否為召喚道具
return false
end
#==============================================================================
# ** 是否為動物效果
#==============================================================================
def self.animal_effect?(item)
return Animal_Skill.include?(item.id) if item.is_a?(RPG::Skill)#是否動物技能
return Animal_Item.include?(item.id) if item.is_a?(RPG::Item)#是否動物道具
return false
end
#==============================================================================
# ** 是否為釋放效果
#==============================================================================
def self.release_effect?(item)
return Release_Skill.include?(item.id) if item.is_a?(RPG::Skill)#是否釋放技能
return Release_Item.include?(item.id) if item.is_a?(RPG::Item)#是否釋放道具
return false
end
#==============================================================================
# ** 是否為補捉效果
#==============================================================================
def self.catch_effect?(item)
return Catch_Skill.include?(item.id) if item.is_a?(RPG::Skill)#是否補捉技能
return Catch_Item.include?(item.id) if item.is_a?(RPG::Item)#是否補捉道具
return false
end
Enemy_Summon_Regex = /<summons:?\s*(.*)\s*>/i
Summon_Limit_Regex = /<summon-max:?\s*(\d+)\s*>/i
Summon_ID_Regex = /<summon:?\s*(\d+)\s*>/i
end
end
module RPG
class Actor < BaseItem
def summon_limit
return @summon_limit unless @summon_limit.nil?
res = Tsuki::Battle_Summon::Summon_Limit_Regex.match(self.note)
return @summon_limit = res ? res[1].to_i : 99
end
end
class Enemy < BaseItem
def enemy_summons
return @enemy_summon unless @enemy_summon.nil?
return @enemy_summon = load_notetags_enemy_summons
end
def load_notetags_enemy_summons
summons = []
self.note.split(/[\r\n]+/).each do |line|
case line
when Tsuki::Battle_Summon::Enemy_Summon_Regex
$1.scan(/\d+/).each {|id| summons << id.to_i}
end
end
return summons
end
end
class UsableItem < BaseItem
def summon_id
return @summon_id unless @summon_id.nil?
res = Tsuki::Battle_Summon::Summon_ID_Regex.match(self.note)
return @summon_id = res ? res[1].to_i : 0
end
end
end
module DataManager
class << self
alias :tsuki_battle_summon_create_objects :create_game_objects
alias :tsuki_battle_summon_make_save_contents :make_save_contents
alias :tsuki_battle_summon_extract_save_contents :extract_save_contents
end
def self.create_game_objects
tsuki_battle_summon_create_objects
$game_summons = Game_Summons.new
end
def self.make_save_contents
contents = tsuki_battle_summon_make_save_contents
contents[:summons] = $game_summons
contents
end
def self.extract_save_contents(contents)
tsuki_battle_summon_extract_save_contents(contents)
$game_summons = contents[:summons]
end
end
module BattleManager
class << self
alias :tsuki_battle_summon_turn_end :turn_end
alias :tsuki_battle_summon_gain_exp :gain_exp
alias :tsuki_battle_summon_battle_end :battle_end
end
def self.turn_end
p "動物回合結束"
tsuki_battle_summon_turn_end
$game_summons.update_summons
end
def self.gain_exp
tsuki_battle_summon_gain_exp
$game_summons.battle_members.each do |summon|
summon.gain_exp($game_troop.exp_total)
end
wait_for_message
end
def self.battle_end(result)
tsuki_battle_summon_battle_end(result)
$game_summons.on_battle_end
end
end
class Spriteset_Battle
def refresh_enemies
new_enemies = $game_troop.members.reverse.collect do |enemy|
@enemy_sprites << Sprite_Battler.new(@viewport1, enemy) if enemy.summoned?
end
end
end
class Game_System
attr_accessor :summon_only_battle
alias :th_battle_summon_init_system :initialize
def initialize
th_battle_summon_init_system
@summon_only_battle = Tsuki::Battle_Summon::Summon_Only_Battle
end
end
class Game_Action
attr_accessor :summon_id #id of summon to call
alias :th_battle_summon_clear_action :clear
def clear
th_battle_summon_clear_action
@summon_id = 0
end
end
class Game_ActionResult
attr_accessor :called_summon
alias :th_battle_summon_clear_results :clear
def clear
th_battle_summon_clear_results
clear_summon_result
end
def clear_summon_result
@called_summon = nil
end
def called_summon_text
if @called_summon
fmt = Tsuki::Battle_Summon::Summon_Message
sprintf(fmt, @battler.name, @called_summon.name)
else
""
end
end
end
class Game_Battler < Game_BattlerBase
include Tsuki::Battle_Summon
#--------------------------------------------------------------------------
# ● 是否為召喚動作
#--------------------------------------------------------------------------
def is_summon_action?(item)
return false unless item
Tsuki::Battle_Summon.summon_effect?(item)
end
#--------------------------------------------------------------------------
# ● 是否為動物召喚動作
#--------------------------------------------------------------------------
def is_animal_action?(item)
return false unless item
Tsuki::Battle_Summon.animal_effect?(item)
end
#--------------------------------------------------------------------------
# ● 是否為釋放動作
#--------------------------------------------------------------------------
def is_release_action?(item)
return false unless item
Tsuki::Battle_Summon.release_effect?(item)
end
#--------------------------------------------------------------------------
# ● 是否為補捉動作
#--------------------------------------------------------------------------
def is_catch_action?(item)
return false unless item
Tsuki::Battle_Summon.catch_effect?(item)
end
#--------------------------------------------------------------------------
# ● 重寫 技能/物品的效果
#--------------------------------------------------------------------------
alias :th_summon_battler_item_apply :item_apply
def item_apply(user, item)
th_summon_battler_item_apply(user, item)
summon_battler(user, item) if is_summon_action?(item)
summon_battler(user, item) if is_animal_action?(item)
release_battler(user, item) if is_release_action?(item)
catch_enemy(user, item) if is_catch_action?(item)
make_miss_popups(user, item)#配合Ace_Battle_Engine腳本 移到腳本最後
end
#--------------------------------------------------------------------------
# ● 召喚戰鬥者
#--------------------------------------------------------------------------
def summon_battler(user, item)
called_summon = user.friends_unit.summon_battler(user.actions[0].summon_id)
#called_summon = $game_troop.summon_battler(user.actions[0].summon_id) if Summon1_Skill
if called_summon
@result.success = true
@result.called_summon = called_summon
end
end
#--------------------------------------------------------------------------
# ● 釋放怪物
#--------------------------------------------------------------------------
def release_battler(user, item)
enemy_id = user.recruit_enemy
# called_summon = $game_troop.summon_battler(3)
called_summon = $game_troop.summon_battler(enemy_id)
if called_summon
@result.success = true
@result.called_summon = called_summon
user.recruit_enemy = 0 #清空被補怪物
end
end
#--------------------------------------------------------------------------
# ● 補捉怪物
#--------------------------------------------------------------------------
def catch_enemy(user, item)
if $fu_wan_target.hp_rate <= 0.7
user.recruit_enemy = $fu_wan_target.enemy_id
@result.success = true
$fu_wan_target.add_state(56)
$fu_wan_target.hide
end
end
#--------------------------------------------------------------------------
# ● 附加新的狀態
#--------------------------------------------------------------------------
alias summon_add_new_state add_new_state
def add_new_state(state_id)
# die if state_id ==56
summon_add_new_state(state_id)
end
end
class Game_BattlerBase
#--------------------------------------------------------------------------
# ● 檢查是否含有無法戰鬥狀態
#--------------------------------------------------------------------------
def death_state?
state?(death_state_id) #|| state?(56)
end
end
class Game_Enemy < Game_Battler
attr_accessor :just_summoned
alias :th_battle_summon_init_enemy :initialize
def initialize(index, enemy_id)
th_battle_summon_init_enemy(index, enemy_id)
@just_summoned = false
init_summons
end
def summoned?
if @just_summoned
@just_summoned = false
return true
end
return false
end
def init_summons
@summons = enemy.enemy_summons
end
alias :th_battle_summon_make_enemy_actions :make_actions
def make_actions
th_battle_summon_make_enemy_actions
@actions.each do |action|
make_summon_action(action) if is_summon_action?(action.item)
end
end
# pick a random target to draw a random magic from
def make_summon_action(action)
action.summon_id = @summons.sample
end
end
class Game_Summon < Game_Actor
attr_reader :summon_id
attr_accessor :summon_turns
attr_accessor :summon_index
def initialize(actor_id)
super(actor_id)
@summon_id = actor_id
@summon_turns = 0
@summon_index = 0 # 0 if not summoned
@dupe = false
end
def can_dupe?
@dupe
end
def update_summon
p " @summon_turns"
p @summon_turns
@summon_turns -= 1
if @summon_turns <= 0
$game_summons.unsummon(@summon_id)
end
end
def die
$game_summons.unsummon(@summon_id)
super
end
def index
$game_summons.members.index(self)
end
end
class Game_Summons < Game_Unit
include Tsuki::Battle_Summon
def initialize
@data = [nil]
@ids = [nil]
@dispatched = []
@summon_count = 0 #how many summons are on the field
@limit = Summon_Limit
@type_limit = Summon_Type_Limit
@menu_actor_id = 0
end
def [](summon_id)
@data[summon_id] ||= Game_Summon.new(summon_id)
end
def members
in_battle ? battle_members : all_summons
end
def all_summons
@data.select {|summon| !summon.nil?}
end
# summons that are currently in battle
def battle_members
@dispatched.collect {|id| @data[id]}
end
def summon_actor(id)
return if @ids.include?(id)
summon = Game_Summon.new(id)
@data[id] = summon
@ids << id
end
def unsummon(id)
return unless @dispatched.include?(id)
@dispatched.delete_at(@data[id].summon_index - 1)
@data[id].summon_index = 0
@summon_count -= 1
end
def summon(id)
return 0 unless @data[id]
@data[id].summon_turns = [Default_Summon_Turns, $game_variables[Summon_Turn_Variable]].max
@data[id].make_actions
@summon_count += 1
@data[id].summon_index = @summon_count
@dispatched << id
return id
end
def can_summon?(summon_id)
return false if @data[summon_id].nil?
return false if @summon_count >= @limit || @dispatched.uniq.size >= @type_limit
return false if @dispatched.include?(summon_id) && !@data[summon_id].can_dupe?
return true
end
def update_summons
members.each {|summon| summon.update_summon}
end
def on_battle_end
alive_members.each {|summon| summon.recover_all }
@dispatched = []
@summon_count = 0
end
def menu_actor
@data[@menu_actor_id] || members[0]
end
def menu_actor=(summon)
return unless summon
@menu_actor_id = summon.summon_id
end
def menu_actor_next
index = members.index(menu_actor) || -1
index = (index + 1) % members.size
self.menu_actor = members[index]
end
def menu_actor_prev
index = members.index(menu_actor) || 1
index = (index + members.size - 1) % members.size
self.menu_actor = members[index]
end
end
#==============================================================================
# *
#==============================================================================
class Game_Party < Game_Unit
include Tsuki::Battle_Summon
alias tsuki_battle_summon_initialize_party initialize
def initialize
tsuki_battle_summon_initialize_party
@summons = []
end
alias tsuki_battle_summon_battle_members battle_members
def battle_members
summons = $game_summons.battle_members
if $game_system.summon_only_battle
summons.empty? ? tsuki_battle_summon_battle_members : summons
else
members = tsuki_battle_summon_battle_members
members.concat(summons)
end
end
def summons
@summons.collect {|id| $game_summons[id]}
end
# try to call a summon, return summoned_id if successful
def summon_battler(id)
return unless $game_summons.can_summon?(id)
summoned_id = $game_summons.summon(id)
return $game_summons[summoned_id]
end
def add_summon(summon_id)
$game_summons.summon_actor(summon_id)
@summons.push(summon_id) unless @summons.include?(summon_id)
end
def remove_summon(summon_id)
@summons.delete(summon_id)
end
def clear_summons
@summons = []
end
def on_battle_end
super
# clear_summons
end
#--------------------------------------------------------------------------
# ● 取得參戰角色(不納入召喚獸)
#--------------------------------------------------------------------------
def battle_members1
all_members[0, max_battle_members].select {|actor| actor.exist? && !actor.is_a?(Game_Summon) }
end
end
class Game_Troop < Game_Unit
# create a new enemy on the spot
def summon_battler(enemy_id)
return unless $data_enemies[enemy_id]
new_enemy = Game_Enemy.new(@enemies.size, enemy_id)
new_enemy.just_summoned = true
new_enemy.screen_x = rand(Graphics.width / 2) + 100
new_enemy.screen_y = rand(Graphics.height / 2) + 100
new_enemy.add_state(55)
@enemies.push(new_enemy)
SceneManager.scene.refresh_enemies
return new_enemy
end
end
class Game_Interpreter
def add_actor_summon(actor_id)
$game_party.add_summon(actor_id)
end
def summon_battler(summon_id)
$game_party.summon_battler(summon_id)
end
end
#==============================================================================
# ** Menu windows and scenes
#==============================================================================
class Window_SummonList < Window_Selectable
include Tsuki::Battle_Summon
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
@actor = nil
@data = []
refresh
end
#--------------------------------------------------------------------------
# * Set Category
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
self.oy = 0
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 2
end
def item_height
104
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
@data ? @data.size : 1
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
@data && index >= 0 ? @data[index] : nil
end
#--------------------------------------------------------------------------
# * Get Activation State of Selection Item
#--------------------------------------------------------------------------
def current_item_enabled?
enable?(@data[index])
end
def enable?(summon)
summon && !$game_summons.battle_members.include?(summon)
end
def include?(summon)
return false unless summon && summon.actor_id < Animal_Id #小於動物之id才列出
return true
end
def select_last
select(0)
end
def make_item_list
@data = $game_party.summons.select {|item| include?(item) }
@data.push(nil) if include?(nil)
end
def draw_item(index)
summon = @data[index]
if summon
rect = item_rect(index)
rect.width -= 4
draw_summon_basic(summon, rect.x + 4, rect.y, enable?(summon))
draw_actor_face(summon, rect.x + rect.width - 96, rect.y)
end
end
def draw_summon_name(summon, x, y, enabled, width = 112)
change_color(normal_color, enabled)
draw_text(x, y, width, line_height, summon.name)
end
def draw_summon_basic(summon, x, y, enabled=true, width=172)
return unless summon
text_width = text_size(summon.name).width
draw_summon_name(summon, x, y + line_height*0, enabled)
draw_actor_level(summon, x, y + line_height*1)
draw_actor_hp(summon, x, y + line_height*2)
draw_actor_mp(summon, x, y + line_height*3)
end
def update_help
@help_window.set_item(item)
end
def refresh
make_item_list
create_contents
draw_all_items
end
end
class Window_SummonCommand < Window_HorzCommand
def window_width
Graphics.width
end
def make_command_list
add_command("Equip", :equip)
add_command("Skill", :skill)
add_command("Status", :status)
end
end
class Scene_Summons < Scene_MenuBase
def start
super
create_summon_command
create_summon_window
end
def create_summon_command
@summon_command = Window_SummonCommand.new(0, 0)
@summon_command.set_handler(:cancel, method(:return_scene))
@summon_command.set_handler(:equip, method(:command_personal))
@summon_command.set_handler(:skill, method(:command_personal))
@summon_command.set_handler(:status, method(:command_personal))
end
def create_summon_window
wy = @summon_command.height
width = Graphics.width
height = Graphics.height - wy
@summon_window = Window_SummonList.new(0, wy, width, height)
end
def command_personal
@summon_window.select_last
@summon_window.activate
@summon_window.set_handler(:ok, method(:on_personal_ok))
@summon_window.set_handler(:cancel, method(:on_personal_cancel))
end
def on_personal_ok
$game_summons.menu_actor = @summon_window.item
case @summon_command.current_symbol
when :equip
SceneManager.call(Scene_SummonEquip)
when :skill
SceneManager.call(Scene_SummonSkill)
when :status
SceneManager.call(Scene_SummonStatus)
end
end
def on_personal_cancel
@summon_window.unselect
@summon_command.activate
end
end
class Scene_SummonSkill < Scene_Skill
def start
super
@actor = $game_summons.menu_actor
on_actor_change
end
def next_actor
@actor = $game_summons.menu_actor_next
on_actor_change
end
def prev_actor
@actor = $game_summons.menu_actor_prev
on_actor_change
end
end
class Scene_SummonEquip < Scene_Equip
def start
super
@actor = $game_summons.menu_actor
on_actor_change
end
def next_actor
@actor = $game_summons.menu_actor_next
on_actor_change
end
def prev_actor
@actor = $game_summons.menu_actor_prev
on_actor_change
end
end
class Scene_SummonStatus < Scene_Status
def start
super
@actor = $game_summons.menu_actor
on_actor_change
end
def next_actor
@actor = $game_summons.menu_actor_next
on_actor_change
end
def prev_actor
@actor = $game_summons.menu_actor_prev
on_actor_change
end
end
#==============================================================================
# ** Battle windows and scenes
#==============================================================================
class Window_BattleSummon < Window_SummonList
def initialize(help_window, info_viewport)
y = 0
super(0, y, Graphics.width, info_viewport.rect.y - y)
self.visible = false
@help_window = help_window
@info_viewport = info_viewport
select(0)
end
def enable?(summon)
summon && $game_summons.can_summon?(summon.summon_id)
end
end
class Window_BattleStatus < Window_Selectable
def content_height
$game_party.battle_members.size * line_height - standard_padding * 2
end
alias tsuki_battle_summon_status_refresh refresh
def refresh
create_contents
tsuki_battle_summon_status_refresh
end
end
#--------------------------------------------------------------------------
# *召喚動物視窗
#--------------------------------------------------------------------------
class Window_Summon_animal_List < Window_BattleSummon
include Tsuki::Battle_Summon
def include?(summon)
return false unless summon && summon.actor_id >= Animal_Id #Animal_Id 動物之id
return true
end
end
#==============================================================================
# class Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
def refresh_enemies
@spriteset.refresh_enemies
end
#==============================================================================
# ** 改寫 建立所有視窗
#==============================================================================
alias :battle_summon_create_battle_windows :create_all_windows
def create_all_windows
battle_summon_create_battle_windows
create_summon_window
create_summon_animal_window
end
#==============================================================================
# ** 建立召喚視窗
#==============================================================================
def create_summon_window
@summon_window = Window_BattleSummon.new(@help_window, @info_viewport)
@summon_window.set_handler(:ok, method(:on_summon_ok))
@summon_window.set_handler(:cancel, method(:on_summon_cancel))
end
#==============================================================================
# ** 建立召喚動物視窗
#==============================================================================
def create_summon_animal_window
@animal_window = Window_Summon_animal_List.new(@help_window, @info_viewport)
@animal_window.set_handler(:ok, method(:on_animal_ok))
@animal_window.set_handler(:cancel, method(:on_animal_cancel))
end
#--------------------------------------------------------------------------
# ●改寫 技能“確定”
#--------------------------------------------------------------------------
alias :th_battle_summon_on_skill_ok :on_skill_ok
def on_skill_ok
@skill = @skill_window.item
if Tsuki::Battle_Summon.summon_effect?(@skill)
BattleManager.actor.input.set_skill(@skill.id)
BattleManager.actor.last_skill.object = @skill
@skill_window.hide
if @skill.summon_id > 0
BattleManager.actor.input.summon_id = @skill.summon_id
next_command
else
activate_summon_window
end
elsif Tsuki::Battle_Summon.animal_effect?(@skill) #動物效果
BattleManager.actor.input.set_skill(@skill.id)
BattleManager.actor.last_skill.object = @skill
@skill_window.hide
if @skill.summon_id > 0
BattleManager.actor.input.summon_id = @skill.summon_id
next_command
else
activate_animal_window
end
else
th_battle_summon_on_skill_ok
end
end
alias :th_battle_summon_on_item_ok :on_item_ok
def on_item_ok
@item = @item_window.item
if Tsuki::Battle_Summon.summon_effect?(@item)
BattleManager.actor.input.set_item(@item.id)
$game_party.last_item.object = @item
@item_window.hide
if @item.summon_id > 0
BattleManager.actor.input.summon_id = @skill.summon_id
next_command
else
activate_summon_window
end
else
th_battle_summon_on_item_ok
end
end
def command_summon
activate_summon_window
end
#--------------------------------------------------------------------------
# ●召喚者“確定”
#--------------------------------------------------------------------------
def on_summon_ok
BattleManager.actor.input.summon_id = @summon_window.item.summon_id
@animal_window.hide
@summon_window.hide
next_command
end
#--------------------------------------------------------------------------
# ●召喚“取消”
#--------------------------------------------------------------------------
def on_summon_cancel
@summon_window.hide
@skill_window.show.activate if @skill
@item_window.show.activate if @item
end
#--------------------------------------------------------------------------
# ●動物“確定”
#--------------------------------------------------------------------------
def on_animal_ok
BattleManager.actor.input.summon_id = @animal_window.item.summon_id
@animal_window.hide
next_command
end
#--------------------------------------------------------------------------
# ●動物“取消”
#--------------------------------------------------------------------------
def on_animal_cancel
@animal_window.hide
@skill_window.show.activate if @skill
@item_window.show.activate if @item
end
#--------------------------------------------------------------------------
# ●起用召喚視窗
#--------------------------------------------------------------------------
def activate_summon_window
@summon_window.refresh
@summon_window.show.activate
end
#--------------------------------------------------------------------------
# ●起用動物視窗
#--------------------------------------------------------------------------
def activate_animal_window
@animal_window.refresh
@animal_window.show.activate
end
end
class Window_BattleLog < Window_Selectable
alias :th_battle_summon_display_damage :display_damage
def display_damage(target, item)
th_battle_summon_display_damage(target, item)
display_summon_results(target, item)
end
def display_summon_results(target, item)
return unless target.result.called_summon && Tsuki::Battle_Summon.summon_effect?(item)
add_text(target.result.called_summon_text)
wait
end
end
#end
#==============================================================================
# ** Update menu scene to add option
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# * Add arena command to List
#--------------------------------------------------------------------------
alias tsuki_summons_commands add_main_commands
def add_main_commands
tsuki_summons_commands
# add_command("Summons", :summons) #增加地圖上選單指令
end
end
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# * Add arena handler
#--------------------------------------------------------------------------
alias tsuki_summons_command_window create_command_window
def create_command_window
tsuki_summons_command_window
@command_window.set_handler(:summons, method(:command_summons))
end
def command_summons
SceneManager.call(Scene_Summons)
end
end
#==============================================================================
# ** Compatibility mods
#==============================================================================
if $imported["FP_InventoryPlus"]
class Scene_Battle < Scene_Base
# directly use item from inventory
def on_item_ok
@item = @item_window.item
if Tsuki::Battle_Summon.summon_effect?(@item)
BattleManager.actor.input.set_item(@item)
$game_party.last_item.object = @item
@item_window.hide
if @item.summon_id > 0
BattleManager.actor.input.summon_id = @item.summon_id
next_command
else
activate_summon_window
end
else
th_battle_summon_on_item_ok
end
end
end
end
if $imported["Tsuki_CommandSetup"]
class Scene_Battle < Scene_Base
alias :th_battle_summon_command_use_skill :command_use_skill
def command_use_skill
@skill = $data_skills[@actor_command_window.current_data[:ext]]
if Tsuki::Battle_Summon.summon_effect?(@skill)
BattleManager.actor.input.set_skill(@skill.id)
BattleManager.actor.last_skill.object = @skill
@skill_window.hide
if @skill.summon_id > 0
BattleManager.actor.input.summon_id = @skill.summon_id
next_command
else
activate_summon_window
end
else
th_battle_summon_command_use_skill
end
end
def on_summon_cancel
@enemy_draw_window.hide
if @skill == $data_skills[@actor_command_window.current_data[:ext]]
@actor_command_window.activate
else
@summon_window.hide
@skill_window.show.activate
end
end
end
end
#==============================================================================
# ** Add-ons
#==============================================================================
if Tsuki::Battle_Summon::Monster_Hunter_Addon
if $imported["Tsuki_MonsterHunter"]
module Monster_Hunter
def self.create_game_actor(actor_id)
return if $BTEST
$game_summons.summon_actor(actor_id)
end
end
else
msgbox("Monster Hunter must placed above this script")
end
end
#==============================================================================
# ** 角色類
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 定義案例變量
#--------------------------------------------------------------------------
attr_accessor :recruit_enemy # 抓獲的敵人
#--------------------------------------------------------------------------
# ● 設定
#--------------------------------------------------------------------------
alias recruit_setup setup
def setup(actor_id)
recruit_setup(actor_id)
@recruit_enemy = 0
end
#--------------------------------------------------------------------------
# ● 生成自動戰鬥用的行動候選清單
#--------------------------------------------------------------------------
def make_action_list
list = []
list.push(Game_Action.new(self).set_attack.evaluate) if !self.is_a?(Game_Summon) #如果是召喚獸則自動戰鬥不加入普攻
usable_skills.each do |skill|
list.push(Game_Action.new(self).set_skill(skill.id).evaluate)
end
list
end
#--------------------------------------------------------------------------
end
|
|