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

Project1

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

[解决] 这高亮代码的问题怎么还没解决啊

[复制链接]

Lv1.梦旅人

路人党员

梦石
0
星屑
51
在线时间
2276 小时
注册时间
2010-12-30
帖子
3225
跳转到指定楼层
1
发表于 2013-11-3 21:18:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 英顺的马甲 于 2013-11-3 21:23 编辑

RUBY 代码复制
  1. [url=home.php?mod=space&uid=114926]@sprite[/url] = Sprite.new

这让脚本挡情何以堪啊?!
同时又让脚本使用者情何以堪啊?!
最重要的是这要叫被@到那位情何以堪啊?!

点评

这绝对是来报复社会的……  发表于 2013-11-3 22:14
本人擅长XP,如果有脚本或者Ruby方面的问题欢迎发电邮到[email protected]咨询,本人很少检查电邮所以不一定会及时回复,本人不会直接出手解决问题只会提供一个方向,所以谢绝伸手党

Lv3.寻梦者

梦石
0
星屑
2744
在线时间
2630 小时
注册时间
2013-1-16
帖子
5657

贵宾

2
发表于 2013-11-3 21:37:59 | 只看该作者
本帖最后由 myownroc 于 2013-11-3 21:42 编辑

发脚本前先@ sprite一下好了…
谁叫他那么无聊,弄这个名字

点评

我从来不用高亮代码的,问题是技术区的各位可不一定啊== 而且这也没真正解决问题吧==  发表于 2013-11-3 22:01
(Created by @喵kano)


施工现场:hotege.github.io
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

八宝粥的基叔

梦石
0
星屑
4509
在线时间
5228 小时
注册时间
2009-4-29
帖子
14318

贵宾

3
发表于 2013-11-3 23:07:24 | 只看该作者
本帖最后由 protosssonny 于 2013-11-3 23:09 编辑

这个问题已经被反映了无数次了,但是始终没有人答复,估计已经放弃治疗了。
不光如此,还有邮箱的情形
  1.         for i in [email]0...@target_battler.size[/email]
  2.           if @target_battler[i] != nil
  3.             time += 1
  4.             target_x += @target_battler[i].position_x
  5.             target_y += @target_battler[i].position_y
  6.           end  
  7.         end
复制代码
如果改ID首字母大写,还会把本来是小写的类变量首字母变成大写,如
  1. [url=home.php?mod=space&uid=370741]@Index[/url]
复制代码
在发脚本前先@会出现的ID,对于脚本行数少还好办,行数多了不是说改就能改的。

点评

原装代码也有这bug的么?==  发表于 2013-11-4 08:33
《逝去的回忆3:四叶草之梦》真情发布,欢迎点击图片下载试玩喵。

《逝去的回忆3》的讨论群:
一群:192885514
二群:200460747
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

八宝粥的基叔

梦石
0
星屑
4509
在线时间
5228 小时
注册时间
2009-4-29
帖子
14318

贵宾

4
发表于 2013-11-3 23:11:13 | 只看该作者
本帖最后由 protosssonny 于 2013-11-3 23:12 编辑

我是怕脚本太长导致3楼显示不出,所以不得已连帖写在4楼。
官方如果不解决这个问题,像这样的脚本会让人疯掉。
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Sprite_Battler Ver3.3
  3. #------------------------------------------------------------------------------
  4. #  角色用于现实的战斗动作。
  5. #==============================================================================
  6. class Sprite_Battler < Sprite_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初期化
  9.   #--------------------------------------------------------------------------
  10.   def initialize(viewport, battler = nil)
  11.     super(viewport)
  12.     [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  13.     @battler_visible = false
  14.     @effect_type = 0                   # 效果的种类
  15.     @effect_duration = 0               # 效果的残留时间
  16.     @move_x = 0                        # 已变化的X坐标的累计
  17.     @move_y = 0                        # 已变化的Y坐标的累计
  18.     @move_z = 0                        # 已变化的Z坐标的累计
  19.     @distanse_x = 0                    # X坐标的移动距离
  20.     @distanse_y = 0                    # Y坐标的移动距离
  21.     @moving_x = 0                      #1单位所相当的X坐标移动距离
  22.     @moving_y = 0                      #1单位所相当的Y坐标移动距离
  23.     @move_speed_x = 0                  # X坐标的移动速度
  24.     @move_speed_y = 0                  # Y坐标的移动速度
  25.     @move_speed_plus_x = 0             # X坐标在加减速时的补充移动速度
  26.     @move_speed_plus_y = 0             # Y坐标在加减速时的补充移动速度
  27.     @move_boost_x = 0                  # X坐标加速度
  28.     @move_boost_y = 0                  # Y坐标加速度
  29.     @jump_time = 0                     # 跳跃时间
  30.     @jump_time_plus = 0                # 跳跃时间补充
  31.     @jump_up = 0                       # 跳跃上升
  32.     @jump_down = 0                     # 跳跃下降
  33.     @jump_size = 0                     # 跳跃高度
  34.     @float_time = 0                    # 漂浮时间
  35.     @float_up = 0                      # 1单位所相当于的浮遊高度
  36.     @jump_plus = 0                     # 根据跳跃补充影位置
  37.     [url=home.php?mod=space&uid=124954]@Angle[/url] = 0                         # 旋转角度
  38.     @angling = 0                       # 1单位所相当于的旋转角度
  39.     @angle_time = 0                    # 旋转时间
  40.     @angle_reset = 0                   # 是否初始化角度
  41.     @zoom_x = 0                        # 横向放大率
  42.     @zoom_y = 0                        # 纵向放大率
  43.     @zooming_x = 0                     # 1单位所相当于的横向放大率
  44.     @zooming_y = 0                     # 1单位所相当于的纵向放大率
  45.     @zoom_time = 0                     # 放大时间
  46.     @zoom_reset = 0                    # 是否初始化放大
  47.     @target_battler = []               # 目标角色情报
  48.     @now_targets = []                  # 目标角色记忆
  49.     @pattern = 0                       # 横图片位置(更新位置)
  50.     @pattern_back = false              # 循环标志
  51.     [url=home.php?mod=space&uid=36110]@Wait[/url] = 0                          # 到下个动作的等待时间
  52.     @unloop_wait = 0                   # 非循环系动画完毕时的等待时间
  53.     @action = []                       # 行动
  54.     @anime_kind = 0                    # 纵图片位置(动画种类位置)
  55.     @anime_speed = 0                   # 图片更新速度
  56.     @frame = 0                         # 被消费图片更新时间
  57.     @anime_loop = 0                    # 循环方式
  58.     @anime_end = false                 # 角色的动画是否完毕
  59.     @anime_freeze = false              # 是否是固定动画
  60.     @anime_freeze_kind = false         # 固定图案位置
  61.     @anime_moving = false              # 是否在飞出动画中
  62.     @base_width = N01::ANIME_PATTERN   # 图片的横分割数
  63.     @base_height = N01::ANIME_KIND     # 图片的纵分割数
  64.     @width = 0                         # 横矩形
  65.     [url=home.php?mod=space&uid=291977]@height[/url] = 0                        # 纵矩形
  66.     @picture_time = 0                  # 图片显示时间
  67.     @individual_targets = []           # 单独处理的保持目标
  68.     @balloon_duration = 65             # 飞出动画时间
  69.     [url=home.php?mod=space&uid=30269]@reverse[/url] = false                   # 动画的反向再生标志
  70.     # 角色不存在的时候将中断处理
  71.     return @battler_visible = false if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
  72.     # 角色是主人公时、或者敌方动画为NO时
  73.     @anime_flug = true if @battler.actor?
  74.     @anime_flug = true if !@battler.actor? && @battler.anime_on
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● 角色作成
  78.   #--------------------------------------------------------------------------
  79.   def make_battler
  80.     # 初期配置的取得
  81.     @battler.base_position
  82.     # 色相通过角色认别
  83.     @battler_hue = @battler.battler_hue
  84.     # 角色是主人公时、或者敌方动画为NO时
  85.     if @anime_flug
  86.       # 准备武器
  87.       @weapon_R = Sprite_Weapon.new(viewport,@battler)
  88.       # 取得我方人物名、敌人角色名
  89.       @battler_name = @battler.character_name if @battler.actor?
  90.       @battler_name = @battler.battler_name unless @battler.actor?
  91.       # 敌方角色是主人公时、或者敌方动画为NO时为NO的时候 画像被角色是主人公时、或者敌方动画为NO时
  92.       self.mirror = true if !@battler.actor? && @battler.action_mirror
  93.       # 是不是利用行图片图来改变转送前的矩形尺寸的认识处
  94.       self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME
  95.       self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME
  96.       # 获取转送前的矩形
  97.       @width = self.bitmap.width / @base_width
  98.       [url=home.php?mod=space&uid=291977]@height[/url] = self.bitmap.height / @base_height
  99.       # 矩形设定
  100.       @sx = @pattern * @width
  101.       @sy = @anime_kind * @height
  102.       # 角色本体的描绘
  103.       self.src_rect.set(@sx, @sy, @width, @height)
  104.     # 不作动画的角色时
  105.     else
  106.       # bitmap的获取、设定
  107.       @battler_name = @battler.battler_name
  108.       self.bitmap = Cache.battler(@battler_name, @battler_hue)
  109.       @width = bitmap.width
  110.       [url=home.php?mod=space&uid=291977]@height[/url] = bitmap.height
  111.     end
  112.     # 偷袭时画像角色是主人公时、或者敌方动画为NO时
  113.     if $back_attack && @battler.actor?
  114.       self.mirror = true
  115.     elsif $back_attack && !@battler.actor?
  116.       self.mirror = true
  117.       self.mirror = false if @battler.action_mirror
  118.     else
  119.       self.mirror = false
  120.       self.mirror = true if !@battler.actor? && @battler.action_mirror
  121.     end
  122.     # ....
  123.     @weapon_R.mirroring if self.mirror && @weapon_R != nil
  124.     # 位置初期化
  125.     @battler.reset_coordinate
  126.     # 决定原点
  127.     self.ox = @width / 2
  128.     self.oy = @height * 2 / 3
  129.     # 设定偷袭时的坐标
  130.     update_move
  131.     # 准备飞出动画的精灵
  132.     @move_anime = Sprite_MoveAnime.new(viewport,battler)
  133.     # 准备图片用精灵
  134.     @picture = Sprite.new
  135.     # 作成伤害精灵
  136.     @damage = Sprite_Damage.new(viewport,battler)
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 影作成
  140.   #--------------------------------------------------------------------------
  141.   def make_shadow
  142.     @shadow.dispose if [url=home.php?mod=space&uid=31758]@Shadow[/url] != nil
  143.     @battler_hue = @battler.battler_hue
  144.     [url=home.php?mod=space&uid=31758]@Shadow[/url] = Sprite.new(viewport)
  145.     @shadow.z = self.z - 4
  146.     @shadow.visible = false
  147.     # 准备角色的影子精灵
  148.     @shadow.bitmap = Cache.character(@battler.shadow)
  149.     @shadow_height = @shadow.bitmap.height
  150.     # 影位置的稍微调整
  151.     @shadow_plus_x = @battler.shadow_plus[0] - @width / 2
  152.     @shadow_plus_y = @battler.shadow_plus[1]
  153.     # 配合角色画像的大小使用影画像
  154.     @shadow.zoom_x = @width * 1.0 / @shadow.bitmap.width
  155.     # 更新
  156.     update_shadow
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ● 解放
  160.   #--------------------------------------------------------------------------
  161.   def dispose
  162.     self.bitmap.dispose if self.bitmap != nil
  163.     @weapon_R.dispose if @weapon_R != nil
  164.     @move_anime.dispose if @move_anime != nil
  165.     @picture.dispose if @picture != nil
  166.     @shadow.dispose if @shadow != nil
  167.     @damage.dispose if @damage != nil
  168.     @balloon.dispose if @balloon != nil
  169.     mirage_off
  170.     # 画像変更リセット
  171.     @battler.graphic_change(@before_graphic) if @before_graphic != nil
  172.     super
  173.   end  
  174.   #--------------------------------------------------------------------------
  175.   # ● 伤害动作  action = [动画ID,角色是主人公时、或者敌方动画为NO时标志,反方向许可]
  176.   #--------------------------------------------------------------------------
  177.   def damage_action(action)
  178.     damage = @battler.hp_damage
  179.     damage = @battler.mp_damage if @battler.mp_damage != 0
  180.     # 如果HP和MP两个同时做出伤害
  181.     if @battler.hp_damage != 0 && @battler.mp_damage != 0
  182.       @battler.double_damage = true
  183.       damage = @battler.hp_damage
  184.     end  
  185.     # 吸收攻击使HP为0的处理
  186.     if action[0] == "absorb"
  187.       absorb = true
  188.       action[0] = nil
  189.     end
  190.     # 只有在命中时动画才被执行
  191.     unless @battler.evaded or @battler.missed or action[0] == nil
  192.       @battler.animation_id = action[0]
  193.       @battler.animation_mirror = action[1]
  194.     end
  195.     # 执行伤害动画
  196.     start_action(@battler.damage_hit) if damage > 0 && action[2]
  197.     # 攻击没有命中时执行回避动画
  198.     if @battler.evaded or @battler.missed
  199.       start_action(@battler.evasion) if action[2]
  200.       Sound.play_evasion
  201.     end
  202.     @damage.damage_pop unless absorb or action[3] != nil
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● 伤害数值POP
  206.   #--------------------------------------------------------------------------
  207.   def damage_pop(damage)
  208.     @damage.damage_pop(damage)
  209.   end  
  210.   #--------------------------------------------------------------------------
  211.   # ● 战斗开始行动
  212.   #--------------------------------------------------------------------------
  213.   def first_action
  214.     # 检查能否行动、只有在不能的情况下那个状态的动作开始
  215.     action = @battler.first_action unless @battler.restriction >= 4
  216.     action = $data_states[@battler.state_id].base_action if @battler.states[0] != nil && @battler.restriction >= 4
  217.     start_action(action)
  218.     # 影スプライトを用意
  219.     make_shadow if N01::SHADOW
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # ● 动作开始
  223.   #--------------------------------------------------------------------------
  224.   def start_action(kind)
  225.     # 初期化各种动作
  226.     reset
  227.     #记录现在取得的待机动作
  228.     stand_by
  229.     # 决定新的动作内容
  230.     @action = N01::ACTION[kind].dup
  231.     # 从行动配列的前头开始移动
  232.     active = @action.shift
  233.     # 自动完毕
  234.     @action.push("完毕")
  235.     # 确定现在的动作
  236.     @active_action = N01::ANIME[active]
  237.     # 等待设定
  238.     @wait = active.to_i if @active_action == nil
  239.     # 单独动作开始
  240.     action
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● 强制单独动作开始
  244.   #--------------------------------------------------------------------------
  245.   def start_one_action(kind,back)
  246.     # 初期化各种动作
  247.     reset
  248.     # 记录现在取得的待机动作
  249.     stand_by
  250.     # 设置坐标初始化动作
  251.     @action = [back]
  252.     # 自动完毕
  253.     @action.push("完毕")
  254.     # 确定现在的动作
  255.     @active_action = N01::ANIME[kind]
  256.     # 单独动作开始
  257.     action
  258.   end
  259.   #--------------------------------------------------------------------------
  260.   # ● 到下一个动作
  261.   #--------------------------------------------------------------------------
  262.   def next_action
  263.     # 等待中时取消
  264.     return @wait -= 1 if @wait > 0
  265.     # 或者全部图片动画没有被完成时取消
  266.     return if @anime_end == false
  267.     # 最后的图片显示等待
  268.     return @unloop_wait -= 1 if @unloop_wait > 0
  269.     # 从行动配列的前头开始移动
  270.     active = @action.shift
  271.     # 确定现在的动作
  272.     @active_action = N01::ANIME[active]
  273.     # 等待设定
  274.     @wait = active.to_i if @active_action == nil
  275.     # 单独动作开始
  276.     action
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● 待机动作
  280.   #--------------------------------------------------------------------------
  281.   def stand_by
  282.     # 到通常待机
  283.     @repeat_action = @battler.normal
  284.     # HP为1/4时显示危急表情
  285.     @repeat_action = @battler.pinch if @battler.hp <= @battler.maxhp / 4
  286.     # 防御中
  287.     @repeat_action = @battler.defence if @battler.guarding?
  288.     # 如果什么状态都没有时完毕
  289.     return if @battler.state_id == nil
  290.     for state in @battler.states.reverse
  291.       # 动作禁止的状态时跳过处理
  292.       next if state.extension.include?("禁止状态动作")
  293.       # 敌方被动作禁止状态时跳过处理
  294.       next if @battler.is_a?(Game_Enemy) && state.extension.include?("敌方除外")
  295.       #  状态的表情
  296.       @repeat_action = state.base_action
  297.     end
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ● 待机动作的插入
  301.   #--------------------------------------------------------------------------
  302.   def push_stand_by
  303.     action = @battler.normal
  304.     action = @battler.pinch if @battler.hp <= @battler.maxhp / 4
  305.     action = @battler.defence if @battler.guarding?
  306.     for state in @battler.states.reverse
  307.       # 动作禁止的状态时跳过处理
  308.       next if state.extension.include?("禁止状态动作")
  309.       # 敌方被动作禁止状态时跳过处理
  310.       next if @battler.is_a?(Game_Enemy) && state.extension.include?("敌方除外")
  311.       #  状态的表情
  312.       action = state.base_action
  313.     end
  314.     @repeat_action = action
  315.     #  插入
  316.     @action.delete("完毕")
  317.     act = N01::ACTION[action].dup
  318.     for i in 0...act.size
  319.       @action.push(act[i])
  320.     end  
  321.     @action.push("完毕")
  322.     @anime_end = true
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # ● 各种变化的初期化
  326.   #--------------------------------------------------------------------------
  327.   def reset
  328.     self.zoom_x = self.zoom_y = 1
  329.     self.oy = @height * 2 / 3
  330.     @angle = self.angle = 0
  331.     @anime_end = true
  332.     @non_repeat = false
  333.     @anime_freeze = false
  334.     @unloop_wait = 0
  335.   end  
  336.   #--------------------------------------------------------------------------
  337.   # ● 跳跃的初期化
  338.   #--------------------------------------------------------------------------
  339.   def jump_reset
  340.     @battler.jump = @jump_time = @jump_time_plus = @jump_up = @jump_down = 0
  341.     @jump_size = @jump_plus = @float_time = @float_up = 0
  342.   end
  343.   #--------------------------------------------------------------------------
  344.   # ● 受取目标情报
  345.   #--------------------------------------------------------------------------
  346.   def get_target(target)
  347.     # 单独处理中是中止(全区域中自身被卷
  348.     return if @battler.individual
  349.     @target_battler = target
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # ● 动作情报在角色中收藏
  353.   #--------------------------------------------------------------------------
  354.   def send_action(action)
  355.     @battler.play = 0
  356.     @battler.play = action if @battler.active
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ● 角色追加
  360.   #--------------------------------------------------------------------------
  361.   def battler_join
  362.     if @battler.exist? && !@battler_visible
  363.       # 从战斗不能的復活时的处理被跳过
  364.       if @battler.revival && @anime_flug
  365.         return @battler.revival = false
  366.       elsif @battler.revival && !@anime_flug
  367.         @battler.revival = false
  368.         self.visible = true
  369.         return
  370.       end
  371.       @anime_flug = true if @battler.actor?
  372.       @anime_flug = true if !@battler.actor? && @battler.anime_on
  373.       make_battler
  374.       first_action
  375.     end
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ● 图片更新 ※再定义
  379.   #--------------------------------------------------------------------------
  380.   def update
  381.     super
  382.     # 角色不存在时跳过
  383.     return self.bitmap = nil if @battler == nil
  384.     # 追加角色
  385.     battler_join
  386.     # 到下一个动作
  387.     next_action
  388.     # 动画图像更新
  389.     update_anime_pattern
  390.     # 目标更新
  391.     update_target
  392.     # 強制アクション更新
  393.     update_force_action
  394.     # 坐标更新
  395.     update_move
  396.     # 影更新
  397.     update_shadow if @shadow != nil
  398.     # 武器更新
  399.     @weapon_R.update if @weapon_action
  400.     # 漂浮更新
  401.     update_float if @float_time > 0
  402.     # 旋转更新
  403.     update_angle if @angle_time > 0
  404.     # 放大缩小更新
  405.     update_zoom if @zoom_time > 0
  406.     # 残像更新
  407.     update_mirage if @mirage_flug
  408.     # 图片更新
  409.     update_picture if @picture_time > 0
  410.     # 飞出动画更新
  411.     update_move_anime if @anime_moving
  412.     # 飞出动画更新(图片动画)
  413.     update_balloon if @balloon_duration <= 64
  414.     # 伤害精灵更新
  415.     @damage.update if @damage != nil
  416.     setup_new_effect
  417.     update_effect
  418.     update_battler_bitmap
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # ● 动画图像更新
  422.   #--------------------------------------------------------------------------
  423.   def update_anime_pattern
  424.     # 更新时间在到之前跳过
  425.     return @frame -= 1 if @frame != 0
  426.     # 只有在必要的时候更新武器动画
  427.     @weapon_R.action if @weapon_action && @weapon_R != nil
  428.     # 动画到最后是检查是否是循环
  429.     if @pattern_back
  430.       # 往返循环
  431.       if @anime_loop == 0
  432.         # 反向再生
  433.         if @reverse
  434.           @pattern += 1
  435.           if @pattern == @base_width - 1
  436.             @pattern_back = false
  437.             @anime_end = true
  438.           end
  439.         # 通常再生
  440.         else  
  441.           @pattern -= 1
  442.           if @pattern == 0
  443.             @pattern_back = false
  444.             @anime_end = true
  445.           end  
  446.         end  
  447.       # 单程或者是不循环时
  448.       else
  449.         @anime_end = true
  450.         if @anime_loop == 1
  451.           @pattern = 0 if !@reverse
  452.           @pattern = @base_width - 1 if @reverse
  453.           @pattern_back = false
  454.         end  
  455.       end  
  456.     # 推进动画      
  457.     else
  458.       if @reverse
  459.         @pattern -= 1
  460.         @pattern_back = true if @pattern == 0
  461.       else  
  462.         @pattern += 1
  463.         @pattern_back = true if @pattern == @base_width - 1
  464.       end  
  465.     end
  466.     # 初期化更新时间
  467.     @frame = @anime_speed
  468.     # 动画固定时,固定横矩形
  469.     return if @anime_freeze
  470.     # 设定转送处的矩形
  471.     return unless @anime_flug
  472.     @sx = @pattern * @width
  473.     @sy = @anime_kind * @height
  474.     self.src_rect.set(@sx, @sy, @width, @height)
  475.   end
  476.   #--------------------------------------------------------------------------
  477.   # ● 动画图像更新
  478.   #--------------------------------------------------------------------------
  479.   def update_target
  480.     # 目标确认
  481.     return if @battler.force_target == 0
  482.     # 单独处理中中止(全区域中自身被卷入时目标情报是不是)
  483.     return if @battler.individual
  484.     @target_battler = @battler.force_target[1]
  485.     @battler.force_target = 0
  486.   end  
  487.   #--------------------------------------------------------------------------
  488.   # ● 強制动作更新 action = [识别,复原,实行动作]
  489.   #--------------------------------------------------------------------------
  490.   def update_force_action
  491.     # 确认強制动作
  492.     action = @battler.force_action
  493.     return if action == 0
  494.     @battler.force_action = 0
  495.     # 主动中不能插入
  496.     return if @battler.active
  497.     # 击倒时就那样直接连接行动
  498.     return collapse_action if action[0] == "N01collapse"
  499.     # 单独时就那样直接连接
  500.     return start_one_action(action[2],action[1]) if action[0] == "单独"
  501.     # 通用作为动作对待
  502.     start_action(action[2])
  503.     # 有无坐标复原
  504.     return if action[1] == ""
  505.     # 完毕位置替换成重复动作
  506.     @action.delete("完毕")
  507.     @action.push(action[1])
  508.     @action.push("完毕")
  509.   end   
  510.   #--------------------------------------------------------------------------
  511.   # ● 坐标更新
  512.   #--------------------------------------------------------------------------
  513.   def update_move
  514.     # 补完加减速中距离的增减
  515.     if @move_speed_plus_x > 0
  516.       # 计算移动
  517.       @move_x += @moving_x
  518.       # 实行移动
  519.       @battler.move_x = @move_x
  520.       @move_speed_plus_x -= 1
  521.     elsif @move_speed_x > 0
  522.       # 加速时
  523.       if @move_boost_x != 0
  524.         @moving_x += @move_boost_x
  525.       end  
  526.       # 计算移动
  527.       @move_x += @moving_x
  528.       # 实行移动
  529.       @battler.move_x = @move_x
  530.       @move_speed_x -= 1
  531.     end
  532.     # 补完加减速中距离的增减
  533.     if @move_speed_plus_y > 0
  534.       # 计算移动
  535.       @move_y += @moving_y
  536.       # 实行移动
  537.       @battler.move_y = @move_y
  538.       @move_speed_plus_y -= 1
  539.     elsif @move_speed_y > 0
  540.       # 加速时
  541.       if @move_boost_y != 0
  542.         @moving_y += @move_boost_y
  543.       end  
  544.       # 计算移动
  545.       @move_y += @moving_y
  546.       # 实行移动
  547.       @battler.move_y = @move_y
  548.       @move_speed_y -= 1
  549.     end
  550.     # 跳跃上升
  551.     if @jump_up != 0
  552.       # 计算移动
  553.       @jump_plus += @jump_up
  554.       # 实行移动
  555.       @battler.jump = @jump_plus
  556.       @jump_up = @jump_up / 2
  557.       @jump_time -= 1
  558.       # 如果跳跃到了顶点时
  559.       if @jump_time == 0 or @jump_up == @jump_sign
  560.         @jump_down = @jump_up * 2 * @jump_sign * @jump_sign2
  561.         @jump_time_plus += @jump_time * 2
  562.         @jump_up = 0
  563.         return
  564.       end  
  565.     end  
  566.     # 跳跃下降
  567.     if @jump_down != 0
  568.       if @jump_time_plus != 0
  569.         @jump_time_plus -= 1
  570.       elsif @jump_down != @jump_size
  571.         # 计算移动
  572.         @jump_plus += @jump_down
  573.         # 实行移动
  574.         @battler.jump = @jump_plus
  575.         @jump_down = @jump_down * 2
  576.         if @jump_down == @jump_size
  577.           if @jump_flug
  578.             @jump_flug = false
  579.           else
  580.             # 计算移动
  581.             @jump_plus += @jump_down
  582.             # 实行移动
  583.             @battler.jump = @jump_plus
  584.             @jump_down = @jump_size = 0
  585.           end
  586.         end  
  587.       end
  588.     end
  589.     # 设定精灵的坐标
  590.     self.x = @battler.position_x
  591.     self.y = @battler.position_y
  592.     self.z = @battler.position_z
  593.   end
  594.   #--------------------------------------------------------------------------
  595.   # ● 影更新
  596.   #--------------------------------------------------------------------------
  597.   def update_shadow
  598.     @shadow.opacity = self.opacity
  599.     @shadow.x = @battler.position_x + @shadow_plus_x
  600.     @shadow.y = @battler.position_y + @shadow_plus_y - @jump_plus
  601.     @shadow.z = @battler.position_z - 4
  602.   end
  603.   #--------------------------------------------------------------------------
  604.   # ● 漂浮更新
  605.   #--------------------------------------------------------------------------
  606.   def update_float
  607.     @float_time -= 1
  608.     @jump_plus += @float_up
  609.     @battler.jump = @jump_plus
  610.   end   
  611.   #--------------------------------------------------------------------------
  612.   # ● 旋转更新
  613.   #--------------------------------------------------------------------------
  614.   def update_angle
  615.     # 实行旋转
  616.     @angle += @angling
  617.     self.angle = @angle
  618.     @angle_time -= 1
  619.     # 旋转时间结束时项目初始化
  620.     return @angle = 0 if @angle_time == 0
  621.     # 如果有复原标志时角度返回0
  622.     self.angle = 0 if @angle_reset
  623.   end  
  624.   #--------------------------------------------------------------------------
  625.   # ● 扩大缩小更新
  626.   #--------------------------------------------------------------------------
  627.   def update_zoom
  628.     # 实行扩大缩小
  629.     @zoom_x += @zooming_x
  630.     @zoom_y += @zooming_y
  631.     self.zoom_x = @zoom_x
  632.     self.zoom_y = @zoom_y
  633.     @zoom_time -= 1
  634.     # 扩大缩小时间结束时项目初始化
  635.     return if @zoom_time != 0
  636.     @zoom_x = @zoom_y = 0
  637.     self.oy = @height * 2 / 3
  638.     # 如果有复原标志时还原
  639.     self.zoom_x = self.zoom_y = 1 if @zoom_reset
  640.   end  
  641.   #--------------------------------------------------------------------------
  642.   # ● 残像更新
  643.   #--------------------------------------------------------------------------
  644.   def update_mirage
  645.     # 残像最大能显示3个、2格图片中更新
  646.     mirage(@mirage0) if @mirage_count == 1
  647.     mirage(@mirage1) if @mirage_count == 3
  648.     mirage(@mirage2) if @mirage_count == 5
  649.     @mirage_count += 1
  650.     @mirage_count = 0 if @mirage_count == 6
  651.   end
  652.   #--------------------------------------------------------------------------
  653.   # ● 图片更新
  654.   #--------------------------------------------------------------------------
  655.   def update_picture
  656.     @picture_time -= 1
  657.     @picture.x += @moving_pic_x
  658.     @picture.y += @moving_pic_y
  659.   end  
  660.   #--------------------------------------------------------------------------
  661.   # ● 飞出动画 更新
  662.   #--------------------------------------------------------------------------
  663.   def update_move_anime
  664.     @move_anime.update
  665.     @anime_moving = false if @move_anime.finish?
  666.     @move_anime.action_reset if @move_anime.finish?
  667.   end  
  668.   #--------------------------------------------------------------------------
  669.   # ● 崩坏效果的更新 ※再定义
  670.   #--------------------------------------------------------------------------
  671.   def update_collapse
  672.     normal_collapse if @collapse_type == 2
  673.     boss_collapse1 if @collapse_type == 3
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # ● 飞出动画更新 (图片动画)
  677.   #--------------------------------------------------------------------------
  678.   def update_balloon
  679.     @balloon_duration -= 1 if @balloon_duration > 0 && !@balloon_back
  680.     @balloon_duration += 1 if @balloon_back
  681.     if @balloon_duration == 64
  682.       @balloon_back = false
  683.       @balloon.visible = false
  684.     elsif @balloon_duration == 0
  685.       @balloon.visible = false if @balloon_loop == 0
  686.       @balloon_back = true if @balloon_loop == 1
  687.     end   
  688.     @balloon.x = self.x
  689.     @balloon.y = self.y
  690.     @balloon.z = 10
  691.     @balloon.opacity = self.opacity
  692.     sx = 7 * 32 if @balloon_duration < 12
  693.     sx = (7 - (@balloon_duration - 12) / 8) * 32 unless @balloon_duration < 12
  694.     @balloon.src_rect.set(sx, @balloon_id * 32, 32, 32)
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # ● 转送处bitmap的更新 ※再定义
  698.   #--------------------------------------------------------------------------
  699.   def update_battler_bitmap
  700.     if @battler.actor?
  701.       if @battler.character_name != @battler_name or @battler.battler_hue != @battler_hue
  702.         @battler_name = @battler.character_name
  703.         @battler_hue = @battler.battler_hue
  704.       end
  705.     else
  706.       if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue
  707.         @battler_name = @battler.battler_name
  708.         @battler_hue = @battler.battler_hue
  709.       end
  710.       if !@battler.exist?
  711.         self.opacity = 0 if @effect_duration == 0 && @battler.collapse_type != 1
  712.       end  
  713.     end  
  714.   end
  715.   #--------------------------------------------------------------------------
  716.   # ● 实行动作
  717.   #--------------------------------------------------------------------------
  718.   def action
  719.     return if @active_action == nil
  720.     action = @active_action[0]
  721.     # 反转时
  722.     return mirroring if action == "反转"
  723.     # 旋转时   
  724.     return angling if action == "angle"
  725.     # 扩大缩小时  
  726.     return zooming if action == "zoom"
  727.     # 残像ON时
  728.     return mirage_on if action == "残像ON"
  729.     # 残像OFF时
  730.     return mirage_off if action == "残像OFF"
  731.     # 图片表示时
  732.     return picture if action == "pic"
  733.     # 图片消去时
  734.     return @picture.visible = false && @picture_time = 0 if action == "消去图片"
  735.     # 图片文件变更时  
  736.     return graphics_change if action == "change"
  737.     # 战斗动画表示时  
  738.     return battle_anime if action == "anime"
  739.     # 飞出动画表示时 (图片动画)
  740.     return balloon_anime if action == "balloon"
  741.     #  BGM/BGS/SE演奏时   
  742.     return sound if action == "sound"
  743.     # 游戏开关操作时  
  744.     return $game_switches[@active_action[1]] = @active_action[2] if action == "switch"
  745.     # 游戏变量操作时   
  746.     return variable if action == "variable"
  747.     # 二刀限定时
  748.     return two_swords if action == "二刀限定"
  749.     # 非二刀限定时
  750.     return non_two_swords if action == "非二刀限定"
  751.     # 动作条件时
  752.     return necessary if action == "nece"
  753.     # 技能连发时   
  754.     return derivating if action == "der"
  755.     # 单独处理开始时
  756.     return individual_action if action == "个别处理开始"
  757.     # 单独处理完毕时
  758.     return individual_action_end if action == "个别处理完毕"
  759.     # 待机不能移动場合
  760.     return non_repeat if action == "待机不能移动"
  761.     # 变更初期位置时
  762.     return @battler.change_base_position(self.x, self.y) if action == "变更初期位置"
  763.     # 解除变更初期位置
  764.     return @battler.base_position if action == "变更初期位置解除"
  765.     # 变更目标时   
  766.     return change_target if action == "target"
  767.     # 目标的击倒许可
  768.     return send_action(action) if action == "击倒许可"
  769.     # 解除主动
  770.     return send_action(action) if action == "解除主动"
  771.     # 赋予状态时  
  772.     return state_on if action == "sta+"
  773.     # 解除状态时  
  774.     return state_off if action == "sta-"
  775.     # 变更游戏整体的行进速度时
  776.     return Graphics.frame_rate = @active_action[1] if action == "fps"
  777.     # 漂浮时  
  778.     return floating if action == "float"
  779.     # 脚本操作时   
  780.     return eval(@active_action[1]) if action == "script"
  781.     # 强制动作时  
  782.     return force_action if @active_action.size == 4
  783.     # 坐标初始化时  
  784.     return reseting if @active_action.size == 5
  785.     # 移动时
  786.     return moving if @active_action.size == 7
  787.     # 角色动画时
  788.     return battler_anime if @active_action.size == 9
  789.     # 动画飛ばし时
  790.     return moving_anime if @active_action.size == 11
  791.     # 完毕时
  792.     return anime_finish if action == "完毕"
  793.   end
  794.   #--------------------------------------------------------------------------
  795.   # ● 实行反转
  796.   #--------------------------------------------------------------------------
  797.   def mirroring  
  798.     # 如果已经反转就还原
  799.     if self.mirror
  800.       self.mirror = false
  801.       # 武器动画也反映
  802.       @weapon_R.mirroring if @anime_flug
  803.     else
  804.       self.mirror = true
  805.       # 武器动画也反映
  806.       @weapon_R.mirroring if @anime_flug
  807.     end
  808.   end  
  809.   #--------------------------------------------------------------------------
  810.   # ● 实行旋转
  811.   #--------------------------------------------------------------------------
  812.   def angling  
  813.     # 初期化跳跃
  814.     jump_reset
  815.     # 情报确认
  816.     @angle_time = @active_action[1]
  817.     start_angle = @active_action[2]
  818.     end_angle = @active_action[3]
  819.     @angle_reset = @active_action[4]
  820.     # 袭击時时逆转
  821.     start_angle *= -1 if $back_attack
  822.     end_angle *= -1 if $back_attack
  823.     # 敌方被逆转
  824.     start_angle *= -1 if @battler.is_a?(Game_Enemy)
  825.     end_angle *= -1 if @battler.is_a?(Game_Enemy)
  826.     # 时间要是0以下时立即到最后角度
  827.     if @angle_time <= 0
  828.       self.angle = end_angle
  829.       return  @angle_time = 0
  830.     end  
  831.     # 从旋转时间计算一格相当于的角度
  832.     @angling = (end_angle - start_angle) / @angle_time
  833.     # 不能整除的剩余到初期角度
  834.     @angle = (end_angle - start_angle) % @angle_time + start_angle
  835.   end
  836.   #--------------------------------------------------------------------------
  837.   # ● 实行放大缩小
  838.   #--------------------------------------------------------------------------
  839.   def zooming  
  840.     # 初期化跳跃
  841.     jump_reset
  842.     # 情报确认
  843.     @zoom_time = @active_action[1]
  844.     zoom_x = @active_action[2] - 1
  845.     zoom_y = @active_action[3] - 1
  846.     @zoom_reset = @active_action[4]
  847.     @zoom_x = @zoom_y = 1
  848.     # 时间是0以下时跳过
  849.     return @zoom_time = 0 if @zoom_time <= 0
  850.     # 从放大时间中计算一格相当于的放大率
  851.     @zooming_x = zoom_x / @zoom_time
  852.     @zooming_y = zoom_y / @zoom_time
  853.   end  
  854.   #--------------------------------------------------------------------------
  855.   # ● 残像開始
  856.   #--------------------------------------------------------------------------
  857.   def mirage_on
  858.     # 战斗不能時不表现残像
  859.     return if @battler.dead?
  860.     @mirage0 = Sprite.new(self.viewport)
  861.     @mirage1 = Sprite.new(self.viewport)
  862.     @mirage2 = Sprite.new(self.viewport)
  863.     @mirage_flug = true
  864.     @mirage_count = 0
  865.   end  
  866.   #--------------------------------------------------------------------------
  867.   # ● 残像表示
  868.   #--------------------------------------------------------------------------
  869.   def mirage(body)
  870.     body.bitmap = self.bitmap.dup
  871.     body.x = self.x
  872.     body.y = self.y
  873.     body.ox = self.ox
  874.     body.oy = self.oy
  875.     body.z = self.z
  876.     body.mirror = self.mirror
  877.     body.angle = @angle
  878.     body.opacity = 160
  879.     body.zoom_x = self.zoom_x
  880.     body.zoom_y = self.zoom_y   
  881.     body.src_rect.set(@sx, @sy, @width, @height) if @anime_flug
  882.     body.src_rect.set(0, 0, @width, @height) unless @anime_flug
  883.   end   
  884.   #--------------------------------------------------------------------------
  885.   # ● 残像完毕
  886.   #--------------------------------------------------------------------------
  887.   def mirage_off
  888.     @mirage_flug = false
  889.     @mirage0.dispose if @mirage0 != nil
  890.     @mirage1.dispose if @mirage1 != nil
  891.     @mirage2.dispose if @mirage2 != nil
  892.   end   
  893.   #--------------------------------------------------------------------------
  894.   # ● 图片表示
  895.   #--------------------------------------------------------------------------
  896.   def picture
  897.     # 确认移动开始位置
  898.     pic_x = @active_action[1]
  899.     pic_y = @active_action[2]
  900.     # 确认移动完毕位置
  901.     pic_end_x = @active_action[3]
  902.     pic_end_y = @active_action[4]
  903.     @picture_time = @active_action[5]
  904.     # 用时间除、计算一个相当于的移动速度
  905.     @moving_pic_x = (pic_end_x - pic_x)/ @picture_time
  906.     @moving_pic_y = (pic_end_y - pic_y)/ @picture_time
  907.     # 不能整除时到最初上加算
  908.     plus_x = (pic_end_x - pic_x)% @picture_time
  909.     plus_y = (pic_end_y - pic_y)% @picture_time
  910.     # 图片表示
  911.     @picture.bitmap = Cache.picture(@active_action[7])
  912.     @picture.x = pic_x + plus_x
  913.     @picture.y = pic_y + plus_y
  914.     # Z坐标调整
  915.     @picture.z = 1
  916.     @picture.z = 1000 if @active_action[6]
  917.     @picture.visible = true
  918.   end
  919.   #--------------------------------------------------------------------------
  920.   # ● (修改)图像文件变更
  921.   #--------------------------------------------------------------------------
  922.   def graphics_change  
  923.     if @battler.is_a?(Game_Enemy)
  924.       @battler_name = @active_action[2]
  925.       self.bitmap = Cache.battler(@battler.original_name + @battler_name ,@battler_hue)
  926.     else  
  927.       # 主人公限定
  928.       # 图像变更
  929.       @battler_name = @active_action[2]
  930.       # 是否使用歩行图像中改变转送处的矩形
  931.       self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME
  932.       self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME
  933.       # 获取转送处的矩形
  934.       @width = self.bitmap.width / @base_width
  935.       @height = self.bitmap.height / @base_height
  936.       # 如果想让战斗后的人物图也显示为变更
  937.       @before_graphic = @battler.character_name if @active_action[1]
  938.       @battler.graphic_change(@active_action[2])
  939.     end
  940.   end  
  941.   #--------------------------------------------------------------------------
  942.   # ● 显示战斗动画 [判別,ID,对象,反转,等待,二刀标志]
  943.   #--------------------------------------------------------------------------
  944.   def battle_anime
  945.     # 取消敌人的二刀标志动画处理
  946.     return if @active_action[5] && !@battler.actor?
  947.     # 不是二刀的角色,取消二刀标志动画处
  948.     return if @active_action[5] && @battler.weapons[1] == nil
  949.     # 如果二刀为右手(上面设置过)无武器
  950.     if @battler.actor?
  951.       return if !@active_action[5] && @battler.weapons[0] == nil && @battler.weapons[1] != nil
  952.     end
  953.     anime_id = @active_action[1]
  954.     mirror = @active_action[3]
  955.     # 偷袭时动画画像被反转
  956.     if $back_attack
  957.       mirror = true if @active_action[3] == false
  958.       mirror = false if @active_action[3]
  959.     end
  960.     # 武器和技能动画时
  961.     if anime_id < 0
  962.       # 用行动的种类分歧动画处
  963.       if @battler.action.skill? && anime_id != -2
  964.         anime_id = @battler.action.skill.animation_id
  965.       elsif @battler.action.item? && anime_id != -2
  966.         anime_id = @battler.action.item.animation_id
  967.       else
  968.         # 没有武器时使用空手动画
  969.         anime_id = N01::NO_WEAPON
  970.         if @battler.actor?
  971.           weapon_id = @battler.weapon_id
  972.           anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0
  973.           # 二刀动画时
  974.           anime_id = @battler.atk_animation_id2 if @active_action[5]
  975.         else
  976.           weapon_id = @battler.weapon
  977.           anime_id = $data_weapons[weapon_id].animation_id if weapon_id != 0
  978.         end
  979.       end
  980.       # 等待设定
  981.       @wait = $data_animations[anime_id].frame_max * 4 if $data_animations[anime_id] != nil && @active_action[4]
  982.       waitflug = true
  983.       # 显示伤害动画时、为了先计算出伤害計
  984.       damage_action = [anime_id, mirror, true]
  985.       return @battler.play = ["对象动画",damage_action] if @battler.active
  986.     end
  987.     # 实行动画
  988.     if @active_action[2] == 0 && $data_animations[anime_id] != nil
  989.       @battler.animation_id = anime_id
  990.       @battler.animation_mirror = mirror
  991.     elsif $data_animations[anime_id] != nil
  992.       for target in @target_battler
  993.         target.animation_id = anime_id
  994.         target.animation_mirror = mirror
  995.       end   
  996.     end
  997.     # 等待设定
  998.     @wait = $data_animations[anime_id].frame_max * 4 if $data_animations[anime_id] != nil && @active_action[4] && !waitflug
  999.   end
  1000.   #--------------------------------------------------------------------------
  1001.   # ● 显示飞出动画 (图片动画)
  1002.   #--------------------------------------------------------------------------
  1003.   def balloon_anime
  1004.     return if self.opacity == 0
  1005.     if @balloon == nil
  1006.       @balloon = Sprite.new
  1007.       @balloon.bitmap = Cache.system("Balloon")
  1008.       @balloon.ox = @width / 16
  1009.       @balloon.oy = @balloon.height / 10 + @height / 3
  1010.     end
  1011.     @balloon_id = @active_action[1]
  1012.     @balloon_loop = @active_action[2]
  1013.     @balloon_duration = 64
  1014.     @balloon_back = false
  1015.     update_balloon
  1016.     @balloon.visible = true
  1017.   end  
  1018.   #--------------------------------------------------------------------------
  1019.   # ● BGM/BGS/SE演奏
  1020.   #--------------------------------------------------------------------------
  1021.   def sound   
  1022.     # 获取情报
  1023.     pitch = @active_action[2]
  1024.     vol =  @active_action[3]
  1025.     name = @active_action[4]
  1026.     # 实行
  1027.     case @active_action[1]
  1028.     when "se"
  1029.       Audio.se_play("Audio/SE/" + name, vol, pitch)
  1030.     when "bgm"
  1031.       # 没有指定名字时、不改变现在的BGM
  1032.       if @active_action[4] == ""
  1033.         now_bgm = RPG::BGM.last
  1034.         name = now_bgm.name
  1035.       end
  1036.       Audio.bgm_play("Audio/BGM/" + name, vol, pitch)
  1037.     when "bgs"
  1038.       # 没有指定名字时、不改变现在的BGS
  1039.       if @active_action[4] == ""
  1040.         now_bgs = RPG::BGS.last
  1041.         name = now_bgs.name
  1042.       end
  1043.       Audio.bgs_play("Audio/BGS/" + name, vol, pitch)
  1044.     end
  1045.   end
  1046.   #--------------------------------------------------------------------------
  1047.   # ● 游戏变量操作
  1048.   #--------------------------------------------------------------------------
  1049.   def variable
  1050.     # 检查操作
  1051.     operand = @active_action[3]
  1052.     # 变数操作的分歧
  1053.     case @active_action[2]
  1054.     when 0 # 代入
  1055.       $game_variables[@active_action[1]] = operand
  1056.     when 1 # 加算
  1057.       $game_variables[@active_action[1]] += operand
  1058.     when 2 # 減算
  1059.       $game_variables[@active_action[1]] -= operand
  1060.     when 3 # 乗算
  1061.       $game_variables[@active_action[1]] *= operand
  1062.     when 4 # 除算
  1063.       $game_variables[@active_action[1]] /= operand
  1064.     when 5 # 剰余
  1065.       $game_variables[@active_action[1]] %= operand
  1066.     end
  1067.   end  
  1068.   #--------------------------------------------------------------------------
  1069.   # ● 二刀限定
  1070.   #--------------------------------------------------------------------------
  1071.   def two_swords
  1072.     # 敌方不被处理
  1073.     return @action.shift unless @battler.actor?
  1074.     # 左手(下部显示)没有武器就会消除下面
  1075.     return @action.shift if @battler.weapons[1] == nil
  1076.     # 从行动配类的前面移动
  1077.     active = @action.shift
  1078.     # 确定现在的动作
  1079.     @active_action = N01::ANIME[active]
  1080.     # 等待设定
  1081.     @wait = active.to_i if @active_action == nil
  1082.     # 单独动作开始
  1083.     action
  1084.   end
  1085.   #--------------------------------------------------------------------------
  1086.   # ● 非二刀限定
  1087.   #--------------------------------------------------------------------------
  1088.   def non_two_swords
  1089.     # 敌方不被处理
  1090.     return unless @battler.actor?
  1091.     # 左手(下部显示)没有武器就会消除下面
  1092.     return @action.shift if @battler.weapons[1] != nil
  1093.     # 从行动配类的前面移动
  1094.     active = @action.shift
  1095.     # 确定现在的动作
  1096.     @active_action = N01::ANIME[active]
  1097.     # 等待设定
  1098.     @wait = active.to_i if @active_action == nil
  1099.     # 单独动作开始
  1100.     action
  1101.   end
  1102.   #--------------------------------------------------------------------------
  1103.   # ● 动作条件
  1104.   #--------------------------------------------------------------------------
  1105.   def necessary
  1106.     nece1 = @active_action[3]
  1107.     nece2 = @active_action[4]
  1108.     # 目标确认
  1109.     case @active_action[1]
  1110.     #0自身 1目标 2敌全体 3我方全体
  1111.     when 0
  1112.       target = [$game_party.members[@battler.index]] if @battler.is_a?(Game_Actor)
  1113.       target = [$game_troop.members[@battler.index]] if @battler.is_a?(Game_Enemy)
  1114.     when 1
  1115.       target = @target_battler
  1116.     when 2
  1117.       target = $game_troop.members
  1118.     when 3
  1119.       target = $game_party.members
  1120.     end
  1121.     # 目标为空出时看作失败
  1122.     return start_action(@battler.recover_action) if target.size == 0
  1123.     # 内容确认
  1124.     case @active_action[2]
  1125.     # 指定了状态ID时
  1126.     when 0
  1127.       # 补充正号为「正在此状态」、负号为「不在此状态」的条件
  1128.       state_on = true if nece2 > 0
  1129.       # 获取条件人数
  1130.       state_member = nece2.abs
  1131.       # 0从队友数中获取
  1132.       if nece2 == 0
  1133.         state_member = $game_party.members.size if @battler.is_a?(Game_Actor)
  1134.         state_member = $game_troop.members.size if @battler.is_a?(Game_Enemy)
  1135.       end  
  1136.       # 目标的状态确认后清点人数
  1137.       for member in target
  1138.         state_member -= 1 if member.state?(nece1)
  1139.       end
  1140.       # 条件全部满足后执行动作
  1141.       if state_member == 0 && state_on
  1142.         return
  1143.       elsif state_member == nece2.abs
  1144.         return if state_on == nil
  1145.       end  
  1146.     # 指定了参数时
  1147.     when 1  
  1148.       # 补充了正号为「数值以上」、负号为「数值以下」的条件
  1149.       num_over = true if nece2 > 0
  1150.       # 参照数値
  1151.       num = 0
  1152.       # 确认目标的参数
  1153.       for member in target
  1154.         # 参照参数来分歧
  1155.         case  nece1
  1156.         when 0 # 现HP
  1157.           num += member.hp
  1158.         when 1 # 现MP
  1159.           num += member.mp
  1160.         when 2 # 攻击力
  1161.           num += member.atk
  1162.         when 3 # 防御力
  1163.           num += member.def
  1164.         when 4 # 精神力
  1165.           num += member.spi
  1166.         when 5 # 敏捷性
  1167.           num += member.agi
  1168.         end
  1169.       end
  1170.       # 平均
  1171.       num = num / target.size
  1172.       # 条件全部满足后执行动作
  1173.       if num > nece2.abs && num_over
  1174.         return
  1175.       elsif num < nece2.abs
  1176.         return if num_over == nil
  1177.       end
  1178.     # 指定了开关时
  1179.     when 2
  1180.       # 条件全部满足后执行动作
  1181.       if $game_switches[nece1]
  1182.         # 补充为true时「开关ON」、false时「开关OFF」的条件
  1183.         return if nece2
  1184.       # 开关为OFF时与ON时是相反的  
  1185.       else
  1186.         return unless nece2
  1187.       end  
  1188.     # 指定了变量时
  1189.     when 3
  1190.       #补充为正号时「数值以上」、负号时「数値以下」的条件
  1191.       if nece2 > 0
  1192.         return if $game_variables[nece1] > nece2
  1193.       else
  1194.         return unless $game_variables[nece1] > nece2.abs
  1195.       end
  1196.     # 指定了习得技能时
  1197.     when 4
  1198.       # 获取技能条件人数
  1199.       skill_member = nece2.abs
  1200.       for member in target
  1201.         skill_member -= 1 if member.skill_learn?(nece1)
  1202.         # 条件确认
  1203.         return if skill_member == 0
  1204.       end  
  1205.     end
  1206.     # 条件没有被满足时动作中断
  1207.     return @action = ["完毕"] if @non_repeat
  1208.     # 不让防御中看起来不自然,坐标不被还原
  1209.     action = @battler.recover_action
  1210.     action = @battler.defence if @battler.guarding?
  1211.     return start_action(action)
  1212.   end  
  1213.   #--------------------------------------------------------------------------
  1214.   # ● 技能连发
  1215.   #--------------------------------------------------------------------------
  1216.   def derivating
  1217.     # 如果让没学的的技能不能连发时
  1218.     return if !@active_action[2] && !@battler.skill_id_learn?(@active_action[3])
  1219.     # 确率分岐
  1220.     return if rand(100) > @active_action[1]
  1221.     # 连发成功
  1222.     @battler.derivation = @active_action[3]
  1223.     # 之后的动作被中断
  1224.     @action = ["完毕"]
  1225.   end
  1226.   #--------------------------------------------------------------------------
  1227.   # ● 个别处理开始
  1228.   #--------------------------------------------------------------------------
  1229.   def individual_action
  1230.     # 反复标志ON
  1231.     @battler.individual = true
  1232.     # 保持反复动作
  1233.     @individual_act = @action.dup
  1234.     # 保持目标、一个一个的发出行动目标
  1235.     send_action(["个别处理"])
  1236.     @individual_targets = @target_battler.dup
  1237.     @target_battler = [@individual_targets.shift]
  1238.   end
  1239.   #--------------------------------------------------------------------------
  1240.   # ● 个别处理完毕
  1241.   #--------------------------------------------------------------------------
  1242.   def individual_action_end
  1243.     # 目标没有残留时行动完毕
  1244.     return @battler.individual = false if @individual_targets.size == 0
  1245.     @action = @individual_act.dup
  1246.     @target_battler = [@individual_targets.shift]
  1247.   end  
  1248.   #--------------------------------------------------------------------------
  1249.   # ● 待机不能移动
  1250.   #--------------------------------------------------------------------------
  1251.   def non_repeat
  1252.     @repeat_action = []
  1253.     @non_repeat = true
  1254.     anime_finish
  1255.   end  
  1256.   #--------------------------------------------------------------------------
  1257.   # ● 目标变更 action = [判別, 变更对象, 变更处]
  1258.   #--------------------------------------------------------------------------
  1259.   def change_target
  1260.     # 还原自身变更了的目标
  1261.     return @target_battler = @now_targets.dup if @active_action[2] == 3
  1262.     # 发送目标情报
  1263.     target = [@battler] if @active_action[2] == 0
  1264.     target = @target_battler.dup if @active_action[2] != 0
  1265.     # 自身的目标发送到对方时、记录现在的
  1266.     if @active_action[2] == 2
  1267.       @now_targets = @target_battler.dup
  1268.       @target_battler = []
  1269.     end  
  1270.     # 发送目标指定目录时
  1271.     if @active_action[1] >= 1000
  1272.       members = $game_party.members if @battler.actor?
  1273.       members = $game_troop.members unless @battler.actor?
  1274.       index = @active_action[1] - 1000
  1275.       if index < members.size
  1276.         if members[index].exist? && @battler.index != index
  1277.           # 目标变更
  1278.           members[index].force_target = ["N01target_change", target]
  1279.           # 自身的目标发送到相手时
  1280.           @target_battler = [members[index]] if @active_action[2] == 2
  1281.           change = true
  1282.         else
  1283.           for member in members
  1284.             next if @battler.index == member.index
  1285.             next unless member.exist?
  1286.             member.force_target = ["N01target_change", target]
  1287.             @target_battler = [member] if @active_action[2] == 2
  1288.             break change = true
  1289.           end
  1290.         end
  1291.       end
  1292.     # 指定了发送目标的状态ID时
  1293.     elsif @active_action[1] > 0
  1294.       for member in $game_party.members + $game_troop.members
  1295.         if member.state?(@active_action[1])
  1296.           member.force_target = ["N01target_change", target]
  1297.           @target_battler.push(member) if @active_action[2] == 2
  1298.           change = true
  1299.         end  
  1300.       end  
  1301.     # 指定了发送目标学的的技能时
  1302.     elsif @active_action[1] < 0
  1303.       skill_id = @active_action[1].abs
  1304.       for actor in $game_party.members
  1305.         if actor.skill_id_learn?(skill_id)
  1306.           actor.force_target = ["N01target_change", target]
  1307.           @target_battler.push(target) if @active_action[2] == 2
  1308.           change = true
  1309.         end  
  1310.       end
  1311.     # 发送目标是目标时
  1312.     else
  1313.       for member in @target_battler
  1314.         member.force_target = ["N01target_change", target]
  1315.         @target_battler.push(member) if @active_action[2] == 2
  1316.         change = true
  1317.       end
  1318.     end
  1319.     # 条件没有被满足时动作中断
  1320.     return if change
  1321.     return @action = ["完毕"] if @non_repeat
  1322.     return start_action(@battler.recover_action)
  1323.   end   
  1324.   #--------------------------------------------------------------------------
  1325.   # ● 状态付与
  1326.   #--------------------------------------------------------------------------
  1327.   def state_on  
  1328.     state_id = @active_action[2]
  1329.     # 分歧对象
  1330.     case @active_action[1]
  1331.     when 0
  1332.       @battler.add_state(state_id) if rand(100) < @battler.state_probability(state_id)
  1333.     when 1
  1334.       if @target_battler != nil
  1335.         for target in @target_battler
  1336.           target.add_state(state_id) if rand(100) < target.state_probability(state_id)
  1337.         end
  1338.       end
  1339.     when 2
  1340.       for target in $game_troop.members
  1341.         target.add_state(state_id) if rand(100) < target.state_probability(state_id)
  1342.       end
  1343.     when 3
  1344.       for target in $game_party.members
  1345.         target.add_state(state_id) if rand(100) < target.state_probability(state_id)
  1346.       end
  1347.     when 4
  1348.       for target in $game_party.members
  1349.         if target.index != @battler.index
  1350.           target.add_state(state_id) if rand(100) < target.state_probability(state_id)
  1351.         end  
  1352.       end
  1353.     end
  1354.   end
  1355.   #--------------------------------------------------------------------------
  1356.   # ● 状态解除
  1357.   #--------------------------------------------------------------------------
  1358.   def state_off  
  1359.     state_id = @active_action[2]
  1360.     # 分歧对象
  1361.     case @active_action[1]
  1362.     when 0
  1363.       @battler.remove_state(state_id)
  1364.     when 1
  1365.       if @target_battler != nil
  1366.         for target in @target_battler
  1367.           target.remove_state(state_id)
  1368.         end
  1369.       end
  1370.     when 2
  1371.       for target in $game_troop.members
  1372.         target.remove_state(state_id)
  1373.       end
  1374.     when 3
  1375.       for target in $game_party.members
  1376.         target.remove_state(state_id)
  1377.       end
  1378.     when 4
  1379.       for target in $game_party.members
  1380.         if target.index != @battler.index
  1381.           target.remove_state(state_id)
  1382.         end  
  1383.       end
  1384.     end
  1385.   end  
  1386.   #--------------------------------------------------------------------------
  1387.   # ● 浮遊实行
  1388.   #--------------------------------------------------------------------------
  1389.   def floating  
  1390.     # 初期化跳跃
  1391.     jump_reset
  1392.     # 情报确认
  1393.     @jump_plus = @active_action[1]
  1394.     float_end = @active_action[2]
  1395.     @float_time = @active_action[3]
  1396.     # 计算一格相当的移动高度
  1397.     @float_up = (float_end - @jump_plus)/ @float_time
  1398.     # 漂浮结束前不执行下个动作
  1399.     @wait = @float_time
  1400.     # 反映漂浮动画的设定
  1401.     if @anime_flug
  1402.       move_anime = N01::ANIME[@active_action[4]]
  1403.       # 没有指定图片时跳过处理
  1404.       if move_anime != nil
  1405.         # 写下现在的动作
  1406.         @active_action = move_anime
  1407.         # 角色动画开始
  1408.         battler_anime
  1409.         # 漂浮完毕时即动画完毕
  1410.         @anime_end = true
  1411.       end
  1412.     end
  1413.     # 漂浮到初期高度
  1414.     @battler.jump = @jump_plus
  1415.   end      
  1416.   #--------------------------------------------------------------------------
  1417.   # ● 强制动作
  1418.   #--------------------------------------------------------------------------
  1419.   def force_action
  1420.     # 动作是单独还是通用的判别
  1421.     kind = @active_action[0]
  1422.     # 确认有无复原
  1423.     rebirth = @active_action[2]
  1424.     # 获取强制动作的内容
  1425.     play = @active_action[3]
  1426.     # 归纳上面3个情报
  1427.     action = [kind,rebirth,play]
  1428.     # 目标指定目录时
  1429.     if @active_action[1] >= 1000
  1430.       members = $game_party.members if @battler.actor?
  1431.       members = $game_troop.members unless @battler.actor?
  1432.       index = @active_action[1] - 1000
  1433.       if index < members.size
  1434.         if members[index].exist? && @battler.index != index
  1435.           # 交付角色情报
  1436.           return members[index].force_action = action
  1437.         else
  1438.           for target in members
  1439.             next if @battler.index == target.index
  1440.             next unless target.exist?
  1441.             force = true
  1442.             break target.force_action = action
  1443.           end
  1444.         end
  1445.       end
  1446.       # 条件没有被满足时动作中断
  1447.       return if force
  1448.       return @action = ["完毕"] if @non_repeat
  1449.       return start_action(@battler.recover_action)
  1450.     # 指定目标时  
  1451.     elsif @active_action[1] == 0
  1452.       for target in @target_battler
  1453.         target.force_action = action if target != nil
  1454.       end
  1455.     # 指定了状态ID时  
  1456.     elsif @active_action[1] > 0
  1457.       for target in $game_party.members + $game_troop.members
  1458.         target.force_action = action if target.state?(@active_action[1])
  1459.       end
  1460.     # 指定了习得技能时  
  1461.     elsif @active_action[1] < 0  
  1462.       # 敌方不被处理
  1463.       return if @battler.is_a?(Game_Enemy)
  1464.       for actor in $game_party.members
  1465.         # 自身除外
  1466.         unless actor.id == @battler.id
  1467.           # 交付角色情报
  1468.           actor.force_action = action if actor.skill_id_learn?(@active_action[1].abs)
  1469.         end
  1470.       end
  1471.     end
  1472.   end
  1473.   #--------------------------------------------------------------------------
  1474.   # ● 实行坐标初始化
  1475.   #--------------------------------------------------------------------------
  1476.   def reseting
  1477.     # 初期化跳跃
  1478.     jump_reset
  1479.     # 回転を元に戻す
  1480.     self.angle = 0
  1481.     # 情报确认
  1482.     @distanse_x   = @move_x * -1
  1483.     @distanse_y   = @move_y * -1
  1484.     @move_speed_x = @active_action[1]
  1485.     @move_speed_y = @move_speed_x
  1486.     @move_boost_x = @active_action[2]
  1487.     @move_boost_y = @move_boost_x
  1488.     @jump         = @active_action[3]
  1489.     # 计算移动
  1490.     move_distance
  1491.     # 反映移动画面的设定
  1492.     if @anime_flug
  1493.       move_anime = N01::ANIME[@active_action[4]]
  1494.       # 没有指定图片时跳过处理
  1495.       if move_anime != nil
  1496.         # 写下现在的动作
  1497.         @active_action = move_anime
  1498.         # 角色动画开始
  1499.         battler_anime
  1500.       end
  1501.       # 移动完毕时即动画也完毕
  1502.       @anime_end = true
  1503.     end
  1504.   end
  1505.   #--------------------------------------------------------------------------
  1506.   # ● 计算移动
  1507.   #--------------------------------------------------------------------------
  1508.   def moving  
  1509.     # 初期化跳跃
  1510.     jump_reset
  1511.     # 方便调出X轴的移动
  1512.     xx = @active_action[1]
  1513.     # 袭击时X轴逆转
  1514.     xx *= -1 if $back_attack
  1515.     # 确认移动目标的目标
  1516.     case @active_action[0]
  1517.     when 0 # 自身
  1518.       @distanse_x = xx
  1519.       @distanse_y = @active_action[2]
  1520.     when 1 # 目标
  1521.       # 目标没有决定时、变换成自身
  1522.       if @target_battler == nil
  1523.         @distanse_x = xx
  1524.         @distanse_y = @active_action[2]
  1525.       else
  1526.         # 一个一个的确认目标对象
  1527.         target_x = 0
  1528.         target_y = 0
  1529.         time = 0
  1530.         for i in [email]0...@target_battler.size[/email]
  1531.           if @target_battler[i] != nil
  1532.             time += 1
  1533.             target_x += @target_battler[i].position_x
  1534.             target_y += @target_battler[i].position_y
  1535.           end  
  1536.         end
  1537.         # 目标空出时、变换成自身
  1538.         if time == 0
  1539.           @distanse_x = xx
  1540.           @distanse_y = @active_action[2]
  1541.         else  
  1542.           # 计算出复数目标的中心位置
  1543.           target_x = target_x / time
  1544.           target_y = target_y / time
  1545.           # 算出最终的移动距离
  1546.           @distanse_y = target_y - self.y + @active_action[2]
  1547.           # X坐标是角色和敌人的逆向计算
  1548.           if @battler.is_a?(Game_Actor)
  1549.             @distanse_x = target_x - self.x + xx
  1550.           else
  1551.             @distanse_x = self.x - target_x + xx
  1552.           end  
  1553.         end  
  1554.       end  
  1555.     when 2 # 画面
  1556.       # X坐标是角色和敌人的逆向计算
  1557.       if @battler.is_a?(Game_Actor)
  1558.         @distanse_x = xx - self.x
  1559.         @distanse_x = Graphics.width + xx - self.x if $back_attack
  1560.       else
  1561.         @distanse_x = self.x - xx
  1562.         @distanse_x = self.x - (Graphics.width + xx) if $back_attack
  1563.       end
  1564.       @distanse_y = @active_action[2] - self.y
  1565.     when 3 # 初期位置
  1566.       # X坐标是角色和敌人的逆向计算
  1567.       if @battler.is_a?(Game_Actor)
  1568.         @distanse_x = xx + @battler.base_position_x - self.x
  1569.       else
  1570.         @distanse_x = xx + self.x - @battler.base_position_x
  1571.       end
  1572.       @distanse_y = @active_action[2] + @battler.base_position_y - @battler.position_y
  1573.     end
  1574.     @move_speed_x = @active_action[3]
  1575.     @move_speed_y = @active_action[3]
  1576.     @move_boost_x = @active_action[4]
  1577.     @move_boost_y = @active_action[4]
  1578.     @jump         = @active_action[5]
  1579.     @jump_plus = 0
  1580.     # 计算移动
  1581.     move_distance
  1582.     # 反映移动画面的设定
  1583.     if @anime_flug
  1584.       move_anime = N01::ANIME[@active_action[6]]
  1585.       # 没有指定图片时跳过处理
  1586.       if move_anime != nil
  1587.         # 写下现在的动作
  1588.         @active_action = move_anime
  1589.         # 角色动画开始
  1590.         battler_anime
  1591.       end  
  1592.       # 移动完毕时即动画也完毕
  1593.       @anime_end = true
  1594.     end
  1595.   end
  1596.   #--------------------------------------------------------------------------
  1597.   # ● 计算移动
  1598.   #--------------------------------------------------------------------------
  1599.   def move_distance
  1600.     # 速度为0时、停留在那个地方
  1601.     if @move_speed_x == 0
  1602.       @moving_x = 0
  1603.       @moving_y = 0
  1604.     else  
  1605.       # 计算一格相当的移动距离
  1606.       @moving_x = @distanse_x / @move_speed_x
  1607.       @moving_y = @distanse_y / @move_speed_y
  1608.       # 剩余的距离在这时移动消化
  1609.       over_x = @distanse_x % @move_speed_x
  1610.       over_y = @distanse_y % @move_speed_y
  1611.       @move_x += over_x
  1612.       @move_y += over_y
  1613.       @battler.move_x = @move_x
  1614.       @battler.move_y = @move_y
  1615.       @distanse_x -= over_x
  1616.       @distanse_y -= over_y
  1617.     end  
  1618.     # 判定是否移动
  1619.     if @distanse_x == 0
  1620.       @move_speed_x = 0
  1621.     end
  1622.     if @distanse_y == 0
  1623.       @move_speed_y = 0
  1624.     end
  1625.     # X座標计算移动
  1626.     # 根据加减速修正移动格数
  1627.     boost_x = @moving_x
  1628.     move_x = 0
  1629.     # 加速时
  1630.     if @move_boost_x > 0 && @distanse_x != 0
  1631.       # 加减速的正负调整成左右移动
  1632.       if @distanse_x == 0
  1633.         @move_boost_x = 0
  1634.       elsif @distanse_x < 0
  1635.         @move_boost_x *= -1
  1636.       end
  1637.       # 事先计算距离的变化
  1638.       for i in 0...@move_speed_x
  1639.         boost_x += @move_boost_x
  1640.         move_x += boost_x
  1641.         # 记录超过距离
  1642.         over_distance = @distanse_x - move_x
  1643.         # 记录右移动时距离超越的时第几格
  1644.         if @distanse_x > 0 && over_distance < 0
  1645.           @move_speed_x = i
  1646.           break
  1647.         # 记录左移动时距离超越的时第几格
  1648.         elsif @distanse_x < 0 && over_distance > 0
  1649.           @move_speed_x = i
  1650.           break
  1651.         end
  1652.       end
  1653.       # 将超越距离还原到前一次
  1654.       before = over_distance + boost_x
  1655.       # 剩余的距离加算到等速移动的格数中
  1656.       @move_speed_plus_x = (before / @moving_x).abs
  1657.       # 即使这样剩余的距离也在这时移动消化
  1658.       @move_x += before % @moving_x
  1659.       @battler.move_x = @move_x
  1660.     # 减速时  
  1661.     elsif @move_boost_x < 0 && @distanse_x != 0
  1662.       # 加减速的正负调整成左右移动
  1663.       if @distanse_x == 0
  1664.         @move_boost_x = 0
  1665.       elsif @distanse_x < 0
  1666.         @move_boost_x *= -1
  1667.       end
  1668.       # 事先计算距离的变化
  1669.       for i in 0...@move_speed_x
  1670.         boost_x += @move_boost_x
  1671.         move_x += boost_x
  1672.         # 记录不足的距离
  1673.         lost_distance = @distanse_x - move_x
  1674.         before = lost_distance
  1675.         # 记录右移动速度到0时是第几格
  1676.         if @distanse_x > 0 && boost_x < 0
  1677.           @move_speed_x = i - 1
  1678.           # 不足的距离还原到前一次
  1679.           before = lost_distance + boost_x
  1680.           break
  1681.         # 记录左移动速度到0时是第几格
  1682.         elsif @distanse_x < 0 && boost_x > 0
  1683.           @move_speed_x= i - 1
  1684.           # 不足的距离还原到前一次
  1685.           before = lost_distance + boost_x
  1686.           break
  1687.         end
  1688.       end
  1689.       # 不足的距离加算到等速移动的格数中
  1690.       plus = before / @moving_x
  1691.       @move_speed_plus_x = plus.abs
  1692.       # 即使这样剩余的距离也在这时移动消化
  1693.       @move_x += before % @moving_x
  1694.       @battler.move_x = @move_x
  1695.     end
  1696.     # Y座標计算移动
  1697.     # 根据加减速修正移动格数
  1698.     boost_y = @moving_y
  1699.     move_y = 0
  1700.     # 加速时
  1701.     if @move_boost_y > 0 && @distanse_y != 0
  1702.       # 加减速的正负调整成左右移动
  1703.       if @distanse_y == 0
  1704.         @move_boost_y = 0
  1705.       elsif @distanse_y < 0
  1706.         @move_boost_y *= -1
  1707.       end
  1708.       # 事先计算距离的变化
  1709.       for i in 0...@move_speed_y
  1710.         boost_y += @move_boost_y
  1711.         move_y += boost_y
  1712.         # 记录超过距离
  1713.         over_distance = @distanse_y - move_y
  1714.         # 记录右移动时距离超越的时第几格
  1715.         if @distanse_y > 0 && over_distance < 0
  1716.           @move_speed_y = i
  1717.           break
  1718.         # 记录左移动时距离超越的时第几格
  1719.         elsif @distanse_y < 0 && over_distance > 0
  1720.           @move_speed_y = i
  1721.           break
  1722.         end
  1723.       end
  1724.       # 将超越距离还原到前一次
  1725.       before = over_distance + boost_y
  1726.       # 剩余的距离加算到等速移动的格数中
  1727.       @move_speed_plus_y = (before / @moving_y).abs
  1728.       # 即使这样剩余的距离也在这时移动消化
  1729.       @move_y += before % @moving_y
  1730.       @battler.move_y = @move_y
  1731.     # 减速时  
  1732.     elsif @move_boost_y < 0 && @distanse_y != 0
  1733.       # 加减速的正负调整成左右移动
  1734.       if @distanse_y == 0
  1735.         @move_boost_y = 0
  1736.       elsif @distanse_y < 0
  1737.         @move_boost_y *= -1
  1738.       end
  1739.       # 事先计算距离的变化
  1740.       for i in 0...@move_speed_y
  1741.         boost_y += @move_boost_y
  1742.         move_y += boost_y
  1743.         # 记录不足的距离
  1744.         lost_distance = @distanse_y - move_y
  1745.         before = lost_distance
  1746.         # 记录右移动速度到0时是第几格
  1747.         if @distanse_y > 0 && boost_y < 0
  1748.           @move_speed_y = i
  1749.           # 不足的距离还原到前一次
  1750.           before = lost_distance + boost_y
  1751.           break
  1752.         # 记录左移动速度到0时是第几格
  1753.         elsif @distanse_y < 0 && boost_y > 0
  1754.           @move_speed_y = i
  1755.           # 不足的距离还原到前一次
  1756.           before = lost_distance + boost_y
  1757.           break
  1758.         end
  1759.       end
  1760.       # 不足的距离加算到等速移动的格数中
  1761.       plus = before / @moving_y
  1762.       @move_speed_plus_y = plus.abs
  1763.       # 即使这样剩余的距离也在这时移动消化
  1764.       @move_y += before % @moving_y
  1765.       @battler.move_y = @move_y
  1766.     end
  1767.     # 算出移动完毕的时间
  1768.     x = @move_speed_plus_x + @move_speed_x
  1769.     y = @move_speed_plus_y + @move_speed_y
  1770.     if x > y
  1771.       end_time = x
  1772.     else
  1773.       end_time = y
  1774.     end
  1775.     # 移动完毕前不进行下个动作
  1776.     @wait = end_time
  1777.     # 计算跳跃
  1778.     if @jump != 0
  1779.       # 没有移动只跳跃时
  1780.       if @wait == 0
  1781.         # 时间记入
  1782.         @wait = @active_action[3]
  1783.       end  
  1784.       # 从移动完毕时间算出跳跃时间
  1785.       @jump_time = @wait / 2
  1786.       # 不能插入时的剩余时间
  1787.       @jump_time_plus = @wait % 2
  1788.       # 判别跳跃是正还是负
  1789.       @jump_sign = 0
  1790.       @jump_sign2 = 0
  1791.       if @jump < 0
  1792.         @jump_sign = -1
  1793.         @jump_sign2 = 1
  1794.         @jump = @jump * -1
  1795.       else
  1796.         @jump_sign = 1
  1797.         @jump_sign2 = -1
  1798.       end
  1799.       # 决定跳跃初始速度
  1800.       @jump_up = 2 ** @jump * @jump_sign
  1801.       # 略微调整条约时间的尾数
  1802.       if @jump_time == 0
  1803.         @jump_up = 0
  1804.       elsif @jump_time != 1
  1805.         @jump_size = @jump_up * @jump_sign * @jump_sign2
  1806.       else
  1807.         @jump_size = @jump_up * 2 * @jump_sign * @jump_sign2
  1808.         @jump_flug = true
  1809.       end  
  1810.     end
  1811.   end
  1812.   #--------------------------------------------------------------------------
  1813.   # ● 角色动画开始
  1814.   #--------------------------------------------------------------------------
  1815.   def battler_anime
  1816.     # 反映动画设定
  1817.     @anime_kind  = @active_action[1]
  1818.     @anime_speed = @active_action[2]
  1819.     @anime_loop  = @active_action[3]
  1820.     # 如果有等待时间时加算
  1821.     @unloop_wait = @active_action[4]
  1822.     @anime_end = true
  1823.     @reverse = false
  1824.     # 只有有武器动作时进行更新
  1825.     if @weapon_R != nil && @active_action[8] != ""
  1826.       # 确认武器的设定
  1827.       weapon_kind = N01::ANIME[@active_action[8]]
  1828.       # 敌方和不使用二刀角色的取消二刀标志
  1829.       two_swords_flug = weapon_kind[11]
  1830.       return if two_swords_flug && !@battler.actor?
  1831.       return if two_swords_flug && @battler.weapons[1] == nil && @battler.actor?
  1832.       if @battler.actor? && @battler.weapons[0] == nil && !two_swords_flug
  1833.         @weapon_R.action_reset
  1834.       elsif @battler.actor? && @battler.weapons[1] == nil && two_swords_flug
  1835.         @weapon_R.action_reset
  1836.       elsif !@battler.actor? && @battler.weapon == 0
  1837.         @weapon_R.action_reset
  1838.       else
  1839.         # 初期化
  1840.         @weapon_R.action_reset
  1841.         # 动画图像是固定时的获取武器位置
  1842.         if @active_action[5] != -1
  1843.           @weapon_R.freeze(@active_action[5])
  1844.         end
  1845.         # 设定武器画像
  1846.         @weapon_R.weapon_graphics unless two_swords_flug
  1847.         @weapon_R.weapon_graphics(true) if two_swords_flug
  1848.         # 交付武器动作
  1849.         @weapon_R.weapon_action(@active_action[8],@anime_loop)
  1850.         @weapon_action = true
  1851.         # 更新最初的武器动作
  1852.         @weapon_R.action
  1853.       end
  1854.     elsif @weapon_R != nil
  1855.       @weapon_R.action_reset
  1856.     end  
  1857.     @anime_end = false
  1858.     # 动画图片是固定时
  1859.     if @active_action[5] != -1 && @active_action[5] != -2
  1860.       # 标志ON
  1861.       @anime_freeze = true
  1862.       # 看作动画是通常的完毕了
  1863.       @anime_end = true
  1864.     # 单程逆转再生时
  1865.     elsif @active_action[5] == -2
  1866.       @anime_freeze = false
  1867.       # 标志ON
  1868.       @reverse = true
  1869.       # 更新最初的动画图像
  1870.       @pattern = @base_width - 1
  1871.       # 只有在有武器动画时更新
  1872.       if @weapon_action && @weapon_R != nil
  1873.         @weapon_R.action
  1874.         @weapon_R.update
  1875.       end
  1876.     # 更新通常动画时  
  1877.     else  
  1878.       @anime_freeze = false
  1879.       # 更新最初的动画图像
  1880.       @pattern = 0
  1881.       # 只有在有武器动画时更新
  1882.       if @weapon_action && @weapon_R != nil
  1883.         @weapon_R.action
  1884.         @weapon_R.update
  1885.       end
  1886.     end  
  1887.     @pattern_back = false
  1888.     @frame = @anime_speed
  1889.     # Z座標設定
  1890.     @battler.move_z = @active_action[6]
  1891.     # 是否有影
  1892.     if @shadow != nil
  1893.       @shadow.visible = true if @active_action[7]
  1894.       @shadow.visible = false unless @active_action[7]
  1895.     end
  1896.     # 分期从编号读取文件名
  1897.     if @active_action[0] == 0
  1898.       file_name = @battler_name
  1899.     else
  1900.       file_name = @battler_name + "_" + @active_action[0].to_s
  1901.     end  
  1902.     # 无动画角色时处理完毕
  1903.     return unless @anime_flug
  1904.     self.bitmap = Cache.character(file_name)
  1905.     # 设定转送处的矩形
  1906.     @sx = @pattern * @width
  1907.     @sy = @anime_kind * @height
  1908.     @sx = @active_action[5] * @width if @anime_freeze
  1909.     self.src_rect.set(@sx, @sy, @width, @height)
  1910.   end
  1911.   #--------------------------------------------------------------------------
  1912.   # ● 动画飞出
  1913.   #--------------------------------------------------------------------------
  1914.   def moving_anime
  1915.     # 如果前个飞出动画还有残留时初期化
  1916.     @move_anime.action_reset if @anime_moving
  1917.     @anime_moving = true
  1918.     # 袭击中动画、武器画像反转
  1919.     mirror = false
  1920.     mirror = true if $back_attack
  1921.     # 动画ID
  1922.     id = @active_action[1]
  1923.     # 対象
  1924.     target = @active_action[2]
  1925.     x = y = mem = 0
  1926.     # 对象为单体时
  1927.     if target == 0
  1928.       # 目标没有决定时、变换成自身
  1929.       if @target_battler == nil
  1930.         x = self.x
  1931.         y = self.y
  1932.       else
  1933.         # 没有决定目标时、变换为自身
  1934.         if @target_battler[0] == nil
  1935.           x = self.x
  1936.           y = self.y
  1937.         else  
  1938.           # 目标空出时、变换为自身
  1939.           x = @target_battler[0].position_x
  1940.           y = @target_battler[0].position_y
  1941.         end  
  1942.       end  
  1943.     # 对象在敌方中心时  
  1944.     elsif target == 1
  1945.       # 自身是主人公时计算敌方的中心
  1946.       if @battler.is_a?(Game_Actor)
  1947.         for target in $game_troop.members
  1948.           x += target.position_x
  1949.           y += target.position_y
  1950.           mem += 1
  1951.         end
  1952.         x = x / mem
  1953.         y = y / mem
  1954.       # 自身是敌方时计算主人公的中心
  1955.       else
  1956.         for target in $game_party.members
  1957.           x += target.position_x
  1958.           y += target.position_y
  1959.           mem += 1
  1960.         end
  1961.         x = x / mem
  1962.         y = y / mem
  1963.       end
  1964.     # 对象在我方中心时  
  1965.     elsif target == 2
  1966.       # 自身是主人公时计算主人公的中心
  1967.       if @battler.is_a?(Game_Actor)
  1968.         for target in $game_party.members
  1969.           x += target.position_x
  1970.           y += target.position_y
  1971.           mem += 1
  1972.         end
  1973.         x = x / mem
  1974.         y = y / mem
  1975.       # 自身是敌方时计算敌方的中心
  1976.       else
  1977.         for target in $game_troop.members
  1978.           x += target.position_x
  1979.           y += target.position_y
  1980.           mem += 1
  1981.         end
  1982.         x = x / mem
  1983.         y = y / mem
  1984.       end
  1985.     # 对象是自身时  
  1986.     else
  1987.       x = self.x
  1988.       y = self.y
  1989.     end  
  1990.     # 开始位置的略微调整
  1991.     plus_x = @active_action[6]
  1992.     plus_y = @active_action[7]
  1993.     # 敌方是X轴逆转
  1994.     plus_x *= -1 if @battler.is_a?(Game_Enemy)
  1995.     # 算出最终的移动距离
  1996.     distanse_x = x - self.x - plus_x
  1997.     distanse_y = y - self.y - plus_y
  1998.     # 飞出类型
  1999.     type = @active_action[3]
  2000.     # 速度
  2001.     speed = @active_action[4]
  2002.     # 轨道
  2003.     orbit = @active_action[5]
  2004.     # 如果自身在开始位置时
  2005.     if @active_action[8] == 0
  2006.       @move_anime.base_x = self.x + plus_x
  2007.       @move_anime.base_y = self.y + plus_y
  2008.     # 对象在开始位置时
  2009.     elsif @active_action[8] == 1
  2010.       @move_anime.base_x = x + plus_x
  2011.       @move_anime.base_y = y + plus_y
  2012.       # 把距离作为反面
  2013.       distanse_y = distanse_y * -1
  2014.       distanse_x = distanse_x * -1
  2015.     # 如果不能动
  2016.     else
  2017.       @move_anime.base_x = x
  2018.       @move_anime.base_y = y
  2019.       distanse_x = distanse_y = 0
  2020.     end
  2021.     # 无武器动作时不显示武器
  2022.     if @active_action[10] == ""
  2023.       weapon = ""  
  2024.     # 无动画的敌方不显示武器
  2025.     elsif @anime_flug != true
  2026.       weapon = ""  
  2027.     # 武器动作时
  2028.     else
  2029.       # 确认是否指定了飞出武器图片
  2030.       if @battler.is_a?(Game_Actor)
  2031.         battler = $game_party.members[@battler.index]
  2032.         weapon_id = battler.weapon_id
  2033.       else  
  2034.         battler = $game_troop.members[@battler.index]
  2035.         weapon_id = battler.weapon
  2036.       end  
  2037.       # 判别是武器动作情报取得还是使用武器画像
  2038.       weapon_act = N01::ANIME[@active_action[10]].dup if @active_action[10] != ""
  2039.       # 如果利用武器画像时并不是空手
  2040.       if weapon_id != 0 && weapon_act.size == 3
  2041.         weapon_file = $data_weapons[weapon_id].flying_graphic
  2042.         # 如果没有指定别的画像时获取既存的武
  2043.         if weapon_file == ""
  2044.           weapon_name = $data_weapons[weapon_id].graphic
  2045.           icon_weapon = false
  2046.           # 然后没有指定时使用ICON图片
  2047.           if weapon_name == ""
  2048.             weapon_name = $data_weapons[weapon_id].icon_index
  2049.             icon_weapon = true
  2050.           end  
  2051.         # 指定时获取那个图片名  
  2052.         else
  2053.           icon_weapon = false
  2054.           weapon_name = weapon_file
  2055.         end
  2056.         # 武器动作情报取得
  2057.         weapon = @active_action[10]
  2058.       # 指定了武器画像时不显示空手
  2059.       elsif weapon_act.size == 3
  2060.         weapon = ""
  2061.       # 使用技能画像
  2062.       elsif weapon_act != nil && @battler.action.skill != nil
  2063.         icon_weapon = false
  2064.         weapon_name = $data_skills[@battler.action.skill.id].flying_graphic
  2065.         weapon = @active_action[10]
  2066.       end
  2067.     end
  2068.     # 决定Z坐标
  2069.     @move_anime.z = 1
  2070.     @move_anime.z = 1000 if @active_action[9]
  2071.     # 已上的全部情报都已飞出动画送到精灵
  2072.     @move_anime.anime_action(id,mirror,distanse_x,distanse_y,type,speed,orbit,weapon,weapon_name,icon_weapon)
  2073.   end  
  2074.   #--------------------------------------------------------------------------
  2075.   # ● 动作完毕
  2076.   #--------------------------------------------------------------------------
  2077.   def anime_finish
  2078.     # 单独处理完毕省略时做反复
  2079.     return individual_action_end if @individual_targets.size != 0
  2080.     # 主动向角色归纳动作情报
  2081.     send_action(@active_action[0]) if @battler.active
  2082.     # 如果有残像时开放
  2083.     mirage_off if @mirage_flug
  2084.     # 重复待机动作
  2085.     start_action(@repeat_action) unless @non_repeat
  2086.   end   
  2087.   #--------------------------------------------------------------------------
  2088.   # ● 击倒动作
  2089.   #--------------------------------------------------------------------------
  2090.   def collapse_action
  2091.     @non_repeat = true
  2092.     @effect_type = COLLAPSE
  2093.     @collapse_type = @battler.collapse_type unless @battler.actor?
  2094.     @battler_visible = false unless @battler.actor?
  2095.     @effect_duration = N01::COLLAPSE_WAIT + 48 if @collapse_type == 2
  2096.     @effect_duration = 401 if @collapse_type == 3
  2097.   end  
  2098.   #--------------------------------------------------------------------------
  2099.   # ● 普通击倒
  2100.   #--------------------------------------------------------------------------
  2101.   def normal_collapse
  2102.     if @effect_duration == 47
  2103.       Sound.play_enemy_collapse
  2104.       self.blend_type = 1
  2105.       self.color.set(255, 128, 128, 128)
  2106.     end
  2107.     self.opacity = 256 - (48 - @effect_duration) * 6 if @effect_duration <= 47
  2108.   end  
  2109.   #--------------------------------------------------------------------------
  2110.   # ● BOSS击倒
  2111.   #--------------------------------------------------------------------------
  2112.   def boss_collapse1
  2113.     if @effect_duration == 320
  2114.       Audio.se_play("Audio/SE/Absorb1", 100, 80)
  2115.       self.flash(Color.new(255, 255, 255), 60)
  2116.       viewport.flash(Color.new(255, 255, 255), 20)
  2117.     end
  2118.     if @effect_duration == 280
  2119.       Audio.se_play("Audio/SE/Absorb1", 100, 80)
  2120.       self.flash(Color.new(255, 255, 255), 60)
  2121.       viewport.flash(Color.new(255, 255, 255), 20)
  2122.     end
  2123.     if @effect_duration == 220
  2124.       Audio.se_play("Audio/SE/Earth4", 100, 80)
  2125.       reset
  2126.       self.blend_type = 1
  2127.       self.color.set(255, 128, 128, 128)
  2128.       self.wave_amp = 6
  2129.     end
  2130.     if @effect_duration < 220
  2131.       self.src_rect.set(0, @effect_duration / 2 - 110, @width, @height)
  2132.       self.x += 8 if @effect_duration % 4 == 0
  2133.       self.x -= 8 if @effect_duration % 4 == 2
  2134.       self.wave_amp += 1 if @effect_duration % 10 == 0
  2135.       self.opacity = @effect_duration
  2136.       return if @effect_duration < 50
  2137.       Audio.se_play("Audio/SE/Earth4", 100, 50) if @effect_duration % 50 == 0
  2138.     end
  2139.   end
  2140. end
《逝去的回忆3:四叶草之梦》真情发布,欢迎点击图片下载试玩喵。

《逝去的回忆3》的讨论群:
一群:192885514
二群:200460747
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-11 16:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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