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

Project1

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

[已经解决] 横版脚本849行发生错误

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
124 小时
注册时间
2013-5-11
帖子
96
跳转到指定楼层
1
发表于 2014-7-31 22:13:24 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 夜飞尔-流星 于 2014-7-31 22:32 编辑


发生错误的之前,下达是弓箭手攻击的指令.
确认弓箭素材都在.
求助...
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Sideview Ver100
  3. #------------------------------------------------------------------------------
  4. #  管理角色侧视图战斗设定。
  5. #   汉化by: 圣痕
  6. #==============================================================================
  7. class SideView
  8.   #--------------------------------------------------------------------------
  9.   # ● 定义实例变量
  10.   #--------------------------------------------------------------------------
  11.   attr_accessor   :x                    # 画面X坐标
  12.   attr_accessor   :y                    # 画面Y坐标
  13.   attr_accessor   :z                    # 画面Z坐标
  14.   attr_accessor   :h                    # 高度坐标
  15.   attr_accessor   :j                    # 跳跃坐标
  16.   attr_accessor   :c                    # 曲线坐标
  17.   attr_accessor   :ox                   # 横原点
  18.   attr_accessor   :oy                   # 纵原点
  19.   attr_accessor   :oy_adjust            # 縦原点修正
  20.   attr_accessor   :angle                # 旋转角度
  21.   attr_accessor   :zoom_x               # 横扩大率
  22.   attr_accessor   :zoom_y               # 纵扩大率
  23.   attr_accessor   :pattern_w            # 细胞横位置(矩形内)
  24.   attr_accessor   :pattern_h            # 细胞縦位置(矩形内)
  25.   attr_accessor   :sx                   # 细胞横位置(画像全体)
  26.   attr_accessor   :sy                   # 细胞縦位置(画像全体)
  27.   attr_accessor   :pattern_type         # 单元更新类型
  28.   attr_accessor   :pattern_time         # 单元更新间隔
  29.   attr_accessor   :graphic_name         # 角色画像文件名
  30.   attr_accessor   :graphic_file_index   # 角色画像文件名指数
  31.   attr_accessor   :graphic_index        # 角色画像指数
  32.   attr_accessor   :cw                   # 矩形横组件
  33.   attr_accessor   :ch                   # 矩形纵组件
  34.   attr_accessor   :shadow_visible       # 阴影表示
  35.   attr_accessor   :weapon_visible       # 武器表示
  36.  
  37.   attr_accessor   :wait                 # 下一个动作等待时间
  38.   attr_accessor   :weapon_index         # 显示图像的武器排列指数
  39.   attr_accessor   :weapon_end           # 武器动画结束标记
  40.   attr_accessor   :force_action         # 強制动作
  41.   attr_accessor   :target_battler       # 目标角色情報
  42.   attr_accessor   :second_targets       # 第二个目标角色情報
  43.   attr_accessor   :m_a_targets          # 飞行动画目标情報
  44.   attr_accessor   :individual_targets   # 个别处理目标角色情报
  45.   attr_accessor   :effect_data          # 效果数据
  46.   attr_accessor   :anime_id             # 动画ID配列
  47.   attr_accessor   :anime_move_id        # 飞行动画ID配列
  48.   attr_accessor   :mirror               # 反转标志
  49.   attr_accessor   :opacity              # 透明度
  50.   attr_accessor   :opacity_data         # 透明度操作情报
  51.   attr_accessor   :set_damage           # 战斗场景的损伤处理
  52.   attr_accessor   :m_a_data             # 飞行动画情报
  53.   attr_accessor   :m_a_starter          # 飞行动画开始目标情报
  54.   attr_accessor   :action_end           # 行动后结束
  55.   attr_accessor   :damage_anime_data    # 战斗损伤动画的数据
  56.   attr_accessor   :anime_no_mirror      # 战斗动画禁止反转
  57.   attr_accessor   :anime_horming        # 战斗动画归位标志
  58.   attr_accessor   :anime_camera_zoom    # 战斗动画扩大缩小的相机
  59.   attr_accessor   :anime_plus_z         # 战斗动画Z坐标修正
  60.   attr_accessor   :derivation_skill_id  # 技能连发ID
  61.   attr_accessor   :immortal             # 无敌标志
  62.   attr_accessor   :mirage               # 残像数据
  63.   attr_accessor   :balloon_data         # 气球数据
  64.   attr_accessor   :timing               # 从角色不同的时序数据
  65.   attr_accessor   :timing_targets       # 时间数据传递另个角色
  66.   attr_accessor   :color_set            # 色调变更数据
  67.   attr_accessor   :color                # 色调数据
  68.   attr_accessor   :change_up            # 画像变更数据
  69.   attr_accessor   :hit                  # 更加次数
  70.   attr_accessor   :add_state            # 增加状态的显示防止标记
  71.   attr_accessor   :counter_id           # 计数器时的技能ID
  72.   attr_accessor   :reflection_id        # 魔法反射式的动画ID
  73.   attr_accessor   :result_damage        # 回合结束时的HP数据变更
  74.   attr_accessor   :active               # 行动权
  75.   attr_accessor   :anime_off            # 战斗动画删除
  76.   attr_accessor   :command_action       # 行动指令标志
  77.  
  78.   attr_accessor   :base_x               # 初期位置 X坐标
  79.   attr_accessor   :base_y               # 初期位置 Y坐标
  80.   attr_accessor   :base_h               # 初期位置 高度坐标
  81.   attr_accessor   :max_pattern_w        # 单元的横分割数
  82.   attr_accessor   :max_pattern_h        # 单元的纵分割数
  83.  
  84.   attr_reader     :collapse             # 角色战斗不能
  85.   attr_reader     :picture              # 图片显示标记
  86.   #--------------------------------------------------------------------------
  87.   # ● 初始化物件
  88.   #--------------------------------------------------------------------------
  89.   def initialize(battler)
  90.     [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  91.     reset
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ● 初始化
  95.   #--------------------------------------------------------------------------
  96.   def reset
  97.     @x = 0
  98.     @y = 0
  99.     @z = 0
  100.     @h = 0
  101.     @j = 0
  102.     @c = 0
  103.     [url=home.php?mod=space&uid=271873]@jump[/url] = []
  104.     @curve = []
  105.     @ox = 0
  106.     @oy = 0
  107.     @oy_adjust = 0
  108.     @z_plus = 0
  109.     @move_time = 0
  110.     [url=home.php?mod=space&uid=124954]@Angle[/url] = 0
  111.     @angle_time = 0
  112.     @zoom_x = 1
  113.     @zoom_y = 1
  114.     @zoom_time = 0
  115.     @pattern_w = 0
  116.     @pattern_h = 0
  117.     @sx = 0
  118.     @sy = 0
  119.     @pattern_type = 0
  120.     @pattern_time = 0
  121.     @pattern_rest_time = 0
  122.     @graphic_name = ""
  123.     @graphic_file_index = ""
  124.     @graphic_index = 0
  125.     @cw = 0
  126.     @ch = 0
  127.     @shadow_visible = false
  128.     @weapon_visible = true
  129.  
  130.     [url=home.php?mod=space&uid=36110]@Wait[/url] = 0
  131.     @weapon_index = []
  132.     @weapon_end = true
  133.     @full_action = []
  134.     @action = []
  135.     @force_action = ""
  136.     @target_battler = []
  137.     @second_targets = []
  138.     @individual_targets = []
  139.     @m_a_targets = []
  140.     @effect_data = []
  141.     @anime_id = []
  142.     @anime_move_id = []
  143.     @opacity = 255
  144.     @opacity_data = []
  145.     @set_damage = false
  146.     @m_a_data = []
  147.     @m_a_starter = []
  148.     @action_end = false
  149.     @damage_anime_data = []
  150.     @anime_no_mirror = false
  151.     @anime_horming = false
  152.     @anime_camera_zoom = false
  153.     @anime_plus_z = true
  154.     @derivation_skill_id = 0
  155.     @immortal = false
  156.     @mirage = []
  157.     @play_data = []
  158.     @balloon_data = []
  159.     @picture = false
  160.     @timing = []
  161.     @timing_targets = []
  162.     @color_set = []
  163.     [url=home.php?mod=space&uid=10453]@color[/url] = []
  164.     @change_up = false
  165.     @non_motion = false
  166.     @graphics_change = false
  167.     @hit = []
  168.     @add_state = []
  169.     @collapse = false
  170.     @counter_id = 0
  171.     @reflection_id = 0
  172.     @result_damage = [0,0]
  173.     @active = false
  174.     @anime_off = false
  175.     @command_action = false
  176.  
  177.     @base_x = 0
  178.     @base_y = 0
  179.     @base_z = 0
  180.     @base_h = 0
  181.     @max_pattern_w = 0
  182.     @max_pattern_h = 0
  183.     @pattern_kind = 0
  184.     @pattern_count = 0
  185.     @move_time = 0
  186.     [url=home.php?mod=space&uid=111303]@mirror[/url] = false
  187.     @battler.set_graphic(@pre_change_data[0], @pre_change_data[1], @pre_change_data[2], @pre_change_data[3]) if @pre_change_data != nil
  188.     @pre_change_data = nil
  189.   end  
  190.   #--------------------------------------------------------------------------
  191.   # ● 格局
  192.   #--------------------------------------------------------------------------
  193.   def setup(bitmap_width, bitmap_height, first_action_flag)
  194.     reset if first_action_flag
  195.     set_data
  196.     set_base_position if !@graphics_change
  197.     set_graphics(bitmap_width, bitmap_height)
  198.     set_target
  199.     setup_graphics_change if @graphics_change
  200.     first_battler_anime_set if first_action_flag
  201.   end  
  202.   #--------------------------------------------------------------------------
  203.   # ● 取得角色数据
  204.   #--------------------------------------------------------------------------
  205.   def set_data
  206.     return if @battler == nil
  207.     if @battler.actor?
  208.       @graphic_name = @battler.character_name
  209.       @graphic_index = @battler.character_index
  210.     else
  211.       @graphic_name = @battler.battler_name
  212.       @graphic_index = 0
  213.     end
  214.     @max_pattern_w = max_pattern[0]
  215.     @max_pattern_h = max_pattern[1]
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # ● 基础坐标设置 data=[X轴, Y轴, H轴]  moment_set…即时配置
  219.   #--------------------------------------------------------------------------
  220.   def set_base_position(moment_set = true)
  221.     mirroring_reset
  222.     if @battler.actor?
  223.       data = N03::ACTOR_POSITION[@battler.index].dup
  224.       @base_x = data[0] * 100 if !@mirror
  225.       @base_x = (Graphics.width - data[0]) * 100 if @mirror
  226.     else
  227.       data = [@battler.screen_x, @battler.screen_y, 0].dup
  228.       @base_x = data[0] * 100 if !$sv_camera.mirror
  229.       @base_x = (Graphics.width - data[0]) * 100 if $sv_camera.mirror
  230.     end
  231.     @base_y = data[1] * 100
  232.     @base_h = data[2] * 100
  233.     @base_z = @y
  234.     return if !moment_set
  235.     @x = @base_x
  236.     @y = @base_y
  237.     @z = @base_z
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● 取得图像数据
  241.   #--------------------------------------------------------------------------
  242.   def set_graphics(bitmap_width, bitmap_height)
  243.     sign = @graphic_name[/^[\!\$]./]
  244.     if sign && sign.include?('$')
  245.       @cw = bitmap_width / @max_pattern_w
  246.       @ch = bitmap_height / @max_pattern_h
  247.     elsif @max_pattern_w == 1 && @max_pattern_h == 1
  248.       @cw = bitmap_width
  249.       @ch = bitmap_height
  250.     else
  251.       @cw = bitmap_width / (@max_pattern_w * 4)
  252.       @ch = bitmap_height / (@max_pattern_h * 2)
  253.     end
  254.     @ox = @cw / 2
  255.     @oy = @ch
  256.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  257.     @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  258.   end
  259.   #--------------------------------------------------------------------------
  260.   # ● 设定目标
  261.   #--------------------------------------------------------------------------
  262.   def set_target(target = nil)
  263.     @target_battler = target
  264.     @target_battler = [@battler] if target == nil
  265.     @second_targets = @target_battler
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ● 设置图像的变更
  269.   #--------------------------------------------------------------------------
  270.   def setup_graphics_change
  271.     @graphics_change = false
  272.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  273.     @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  274.   end  
  275.   #--------------------------------------------------------------------------
  276.   # ● 取得战斗开始时的待机动画图像数据
  277.   #--------------------------------------------------------------------------
  278.   def first_battler_anime_set
  279.     loop do
  280.       update
  281.       break if @action_data == nil
  282.       break if @action_data[0] == "motion"
  283.       break if @action_data[0] == "move" && @action_data[8] != ""
  284.       break if @full_action == []
  285.     end
  286.     start_action(first_action) if @battler.movable?
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● 开始动作
  290.   #--------------------------------------------------------------------------
  291.   def start_action(kind = nil)
  292.     return if @event_fix && $game_troop.interpreter.running?
  293.     # 等待中的场合取消
  294.     return @wait -= 1 if @wait > 0 && kind == nil
  295.     action_setup(false) if kind != nil
  296.     set_action(kind)
  297.     @action = kind if @action == nil
  298.     # 动作顺序行动结束处理转变
  299.     action_terminate if @action == nil
  300.     # 决定下一个动作
  301.     @action_data = N03::ACTION[@action]
  302.     next_action
  303.   end
  304.   #--------------------------------------------------------------------------
  305.   # ● 初始化行动参数
  306.   #--------------------------------------------------------------------------
  307.   def action_setup(reset = true)
  308.     @event_fix = false
  309.     @set_damage = false
  310.     @action_end = false
  311.     @balloon_data = []
  312.     @loop_act = []
  313.     angle_reset if reset
  314.     zoom_reset if reset
  315.     opacity_reset if reset
  316.     @curve = []
  317.     @c = 0
  318.     convert_jump
  319.   end  
  320.   #--------------------------------------------------------------------------
  321.   # ● 行动结束的处理
  322.   #--------------------------------------------------------------------------
  323.   def action_terminate
  324.     @mirage = [] if @mirage_end
  325.     mirroring_reset
  326.     @picture = false
  327.     @individual_targets = []
  328.     action_setup if @active
  329.     action_setup(false) if !@active
  330.     # 待机开始行动迁移
  331.     stand_by_action if !@non_motion
  332.     # 战斗行动激活结束权利
  333.     next_battler
  334.   end  
  335.   #--------------------------------------------------------------------------
  336.   # ● 新动作内容的決定
  337.   #--------------------------------------------------------------------------
  338.   def set_action(kind = nil)
  339.     full_act = N03::FULLACTION[kind]
  340.     @full_action = full_act.dup if full_act != nil
  341.     @action = @full_action.shift
  342.     # 参考全部动作如果全部动作统合
  343.     full_act2 = N03::FULLACTION[@action]
  344.     @full_action = full_act2.dup + @full_action if full_act2 != nil
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● 采取下个行动
  348.   #--------------------------------------------------------------------------
  349.   def next_action
  350.     @wait = 0
  351.     # 捷径确认
  352.     eval(@action) if @action != nil && @action_data == nil && N03::FULLACTION[@action] == nil
  353.     # 体能设定
  354.     @wait = @action.to_i if @wait == 0 && @action_data == nil
  355.     @wait = rand(@wait.abs + 1) if @wait < 0
  356.     # 开始动作
  357.     action_play
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # ● 待机开始动作迁移
  361.   #--------------------------------------------------------------------------
  362.   def stand_by_action
  363.     # 通常待机
  364.     stand_by_act = normal
  365.     # HP的1/4紧要关头行动
  366.     stand_by_act = pinch if @battler.hp <= @battler.mhp / 4
  367.     # 状态检查
  368.     stand_by_act = state(@battler.states[0].id) if @battler.states[0] != nil && state(@battler.states[0].id) != nil
  369.     # 指令检查
  370.     stand_by_act = command if @command_action && command != nil
  371.     set_action(stand_by_act)
  372.     @action = stand_by_act if @action == nil
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # ● 开始强制动作
  376.   #--------------------------------------------------------------------------
  377.   def start_force_action
  378.     return if @active
  379.     start_action(@force_action)
  380.     @force_action = ""
  381.   end  
  382.   #--------------------------------------------------------------------------
  383.   # ● 追加动作
  384.   #--------------------------------------------------------------------------
  385.   def add_action(kind)
  386.     @full_action.push(kind)
  387.   end  
  388.   #--------------------------------------------------------------------------
  389.   # ● 插入动作
  390.   #--------------------------------------------------------------------------
  391.   def unshift_action(kind)
  392.     @full_action.unshift(kind)
  393.   end  
  394.   #--------------------------------------------------------------------------
  395.   # ● 更新帧数
  396.   #--------------------------------------------------------------------------
  397.   def update
  398.     # 开始动作
  399.     start_action
  400.     # 开始强制动作
  401.     start_force_action if @force_action != ""
  402.     # 更新动画模式
  403.     update_pattern
  404.     # 更新移动
  405.     update_move
  406.     # 更新旋转
  407.     update_angle if @angle_time != 0
  408.     # 更新扩大缩小
  409.     update_zoom if @zoom_time != 0
  410.     # 更新透明度
  411.     update_opacity if @opacity_data != []
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ● 更新动画模式
  415.   #--------------------------------------------------------------------------
  416.   def update_pattern
  417.     return @pattern_rest_time -= 1 if @pattern_rest_time != 0
  418.     return if @max_pattern_w == 1 && @max_pattern_h == 1
  419.     @pattern_rest_time = @pattern_time
  420.     # 开始播放・取得结束单元位置
  421.     if @pattern_kind > 0 # 通常播放中
  422.       @pattern_start = 0
  423.       @pattern_end = @max_pattern_w - 1
  424.     elsif @pattern_kind < 0 # 逆转播放中
  425.       @pattern_start = @max_pattern_w - 1
  426.       @pattern_end = 0
  427.     end
  428.     # 结束单程的播放
  429.     @pattern_count += 1 if @pattern_w == @pattern_end && @pattern_kind != 0
  430.     # 循环处理
  431.     case @pattern_type.abs
  432.     when  1,3 # 单程
  433.       @pattern_kind =  0 if @pattern_count != 0 && @pattern_type ==  1
  434.       @pattern_kind =  0 if @pattern_count != 0 && @pattern_type == -1
  435.       @pattern_kind =  1 if @pattern_count != 0 && @pattern_type ==  3
  436.       @pattern_kind = -1 if @pattern_count != 0 && @pattern_type == -3
  437.       @pattern_w = @pattern_start - @pattern_kind if @pattern_count != 0 && @pattern_type.abs == 3
  438.       @pattern_count = 0
  439.     when  2,4 # 往返
  440.       @pattern_kind = -1 if @pattern_count == 1 && @pattern_type ==  2
  441.       @pattern_kind =  1 if @pattern_count == 1 && @pattern_type == -2
  442.       @pattern_kind =  0 if @pattern_count == 2 && @pattern_type ==  2
  443.       @pattern_kind =  0 if @pattern_count == 2 && @pattern_type == -2
  444.       @pattern_kind = -1 if @pattern_count == 1 && @pattern_type ==  4
  445.       @pattern_kind =  1 if @pattern_count == 1 && @pattern_type == -4
  446.       @pattern_kind =  1 if @pattern_count == 2 && @pattern_type ==  4
  447.       @pattern_kind = -1 if @pattern_count == 2 && @pattern_type == -4
  448.       @pattern_count = 0 if @pattern_count == 2
  449.     end
  450.     # 更新单元
  451.     @pattern_w += 1 * @pattern_kind
  452.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # ● 更新移动
  456.   #--------------------------------------------------------------------------
  457.   def update_move
  458.     @z = @y / 100 + @z_plus
  459.     return if @move_time == 0
  460.     target_position_set if @horming_move
  461.     @x = (@x * (@move_time - 1) + @target_x) / @move_time
  462.     @y = (@y * (@move_time - 1) + @target_y) / @move_time
  463.     @h = (@h * (@move_time - 1) + @target_h) / @move_time if @move_h != nil
  464.     @c += @curve[@move_time - 1] if @curve[@move_time - 1] != nil
  465.     @j += @jump[@move_time - 1] if @jump[@move_time - 1] != nil
  466.     @move_time -= 1
  467.     convert_jump if @move_time == 0
  468.   end
  469.   #--------------------------------------------------------------------------
  470.   # ● 更新移动目标
  471.   #--------------------------------------------------------------------------
  472.   def target_position_set
  473.     target_position = N03.get_targets_position(@move_targets, @horming_move)
  474.     @target_x = target_position[0] + @move_x
  475.     @target_y = target_position[1] + @move_y
  476.     @target_h = target_position[2] + @move_h if @move_h != nil
  477.   end  
  478.   #--------------------------------------------------------------------------
  479.   # ● 更新旋转
  480.   #--------------------------------------------------------------------------
  481.   def update_angle
  482.     @angle += @angling
  483.     @angle_time -= 1
  484.     return if @angle_time != 0
  485.     return angle_reset if @angle_data[4] == 0
  486.     angling(@angle_data) if @angle_data[4] == 2
  487.   end  
  488.   #--------------------------------------------------------------------------
  489.   # ● 更新扩大缩小
  490.   #--------------------------------------------------------------------------
  491.   def update_zoom
  492.     @zoom_x += @zooming_x
  493.     @zoom_y += @zooming_y
  494.     @zoom_time -= 1
  495.     return if @zoom_time != 0
  496.     return zoom_reset if @zoom_data[4] == 0
  497.     zooming(@zoom_data) if @zoom_data[4] == 2
  498.   end
  499.   #--------------------------------------------------------------------------
  500.   # ● 更新透明度
  501.   #--------------------------------------------------------------------------
  502.   def update_opacity
  503.     @opacity += @opacity_data[2]
  504.     @opacity_data[0] -= 1
  505.     return if @opacity_data[0] != 0
  506.     return if !@opacity_data[5]
  507.     @opacity_data[2] *= -1
  508.     @opacity_data[0] = @opacity_data[1]
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● 实行动作
  512.   #--------------------------------------------------------------------------
  513.   def action_play
  514.     return if @action_data == nil
  515.     action = @action_data[0]
  516.     # 战斗角色反转的场合
  517.     return mirroring                    if action == "mirror"
  518.     # 残像的场合
  519.     return mirage_set                   if action == "mirage"
  520.     # 回转的场合  
  521.     return angling                      if action == "angle"
  522.     # 扩大缩小的场合
  523.     return zooming                      if action == "zoom"
  524.     # 透明度操作的场合  
  525.     return set_opacity                  if action == "opacity"
  526.     # 战斗角色动画的場合
  527.     return battler_anime                if action == "motion"
  528.     # 移动的場合
  529.     return move                         if action == "move"
  530.     # 武器动画的場合
  531.     return weapon_anime([@action_data]) if action == "wp"
  532.     # 跳过动画的場合
  533.     return move_anime                   if action == "m_a"
  534.     # 战斗场景通讯的场合(战斗不能)
  535.     return set_play_data                if action == "collapse" or action == "no_collapse"
  536.     # 显示战斗数据库的动画的場合  
  537.     return battle_anime                 if action == "anime"
  538.     # 摄影的場合
  539.     return camera                       if action == "camera"
  540.     # 画面摇动的場合
  541.     return shake                        if action == "shake"
  542.     # 画面色调变更的場合
  543.     return color_effect                 if action == "color"
  544.     # 过渡的場合
  545.     return transition                   if action == "ts"
  546.     # 气球动画显示的場合  
  547.     return balloon_anime                if action == "balloon"
  548.     # 图片显示的場合
  549.     return picture_set                  if action == "pic"
  550.     # 状态操作的場合
  551.     return state_set                    if action == "sta"
  552.     # FPS变更的場合
  553.     return fps                          if action == "fps"
  554.     # 战斗角色图像变更的場合  
  555.     return graphics_change              if action == "change"
  556.     # 技能衍生的場合  
  557.     return derivating_skill             if action == "der"
  558.     # BGM/BGS/SE演奏的場合  
  559.     return sound                        if action == "sound"
  560.     # 电影再生的場合  
  561.     return movie                        if action == "movie"
  562.     # 游戏开关操作的場合  
  563.     return switches                     if action == "switch"
  564.     # 变量开关操作的場合  
  565.     return variable                     if action == "variable"
  566.     # 条件分岐(游戏开关)的場合
  567.     return nece_1                       if action == "n_1"
  568.     # 条件分岐(游戏变量)的場合
  569.     return nece_2                       if action == "n_2"
  570.     # 条件分岐(状态)的場合
  571.     return nece_3                       if action == "n_3"
  572.     # 条件分岐(技能)的場合
  573.     return nece_4                       if action == "n_4"
  574.     # 条件分岐(参数)的場合
  575.     return nece_5                       if action == "n_5"
  576.     # 条件分岐(装备)的場合
  577.     return nece_6                       if action == "n_6"
  578.     # 条件分岐(脚本)的場合
  579.     return nece_7                       if action == "n_7"
  580.     # 第二目标操作的場合  
  581.     return second_targets_set           if action == "s_t"
  582.     # 呼叫公共事件的場合  
  583.     return call_common_event            if action == "common"
  584.     # 战斗动画关闭的場合  
  585.     return @anime_off = true            if action == "anime_off"
  586.     # 强制战斗结束的場合  
  587.     return BattleManager.process_abort  if action == "battle_end"
  588.     # 画面固定的場合  
  589.     return Graphics.freeze              if action == "graphics_freeze"
  590.     # 损坏动画的場合  
  591.     return damage_anime                 if action == "damage_anime"
  592.     # 武器不可见的場合  
  593.     return @weapon_visible = false      if action == "weapon_off"
  594.     # 武器可见的場合  
  595.     return @weapon_visible = true       if action == "weapon_on"
  596.     # 等待取消的場合
  597.     return @non_motion = true           if action == "non_motion"
  598.     # 等待取消解除的場合
  599.     return @non_motion = false          if action == "non_motion_cancel"
  600.     # 初期位置变更的場合
  601.     return change_base_position         if action == "change_base_position"
  602.     # 初期位置变更解除的場合
  603.     return set_base_position(false)     if action == "set_base_position"
  604.     # 强制行动的場合  
  605.     return force_act                    if action == "force_action"
  606.     # 强制行动的場合 (第二目标)
  607.     return force_act2                   if action == "force_action2"
  608.     # 个人开始的場合
  609.     return individual_start             if action == "individual_start"
  610.     # 个人结束的場合
  611.     return individual_end               if action == "individual_end"
  612.     # 循环开始的場合
  613.     return loop_start                   if action == "loop_start"
  614.     # 循环结束的場合
  615.     return loop_end                     if action == "loop_end"
  616.     # 只有行动的場合
  617.     return only_action_on               if action == "only_action_on"
  618.     # 只有行动解除的場合
  619.     return only_action_off              if action == "only_action_off"
  620.     # 下个战斗角色的場合
  621.     return next_battler                 if action == "next_battler"
  622.     # 画面变更标记的場合
  623.     return set_change                   if action == "set_change"
  624.     # 脚本操作的場合   
  625.     return eval(@action_data[0])
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ● 实行角色反转
  629.   #--------------------------------------------------------------------------
  630.   def mirroring
  631.     @mirror = !@mirror
  632.   end  
  633.   #--------------------------------------------------------------------------
  634.   # ● 初始化反转
  635.   #--------------------------------------------------------------------------
  636.   def mirroring_reset
  637.     @mirror = false
  638.     mirroring if !@battler.actor? && N03::ENEMY_MIRROR
  639.     mirroring if $sv_camera.mirror
  640.   end  
  641.   #--------------------------------------------------------------------------
  642.   # ● 实行残像
  643.   #--------------------------------------------------------------------------
  644.   def mirage_set
  645.     @mirage = @action_data.dup
  646.     @mirage_end = @mirage[3]
  647.     @mirage = [] if @mirage[1] == 0
  648.   end  
  649.   #--------------------------------------------------------------------------
  650.   # ● 实行旋转
  651.   #--------------------------------------------------------------------------
  652.   def angling(data = @action_data)
  653.     @angle_data = data.dup
  654.     @oy = @ch / 2
  655.     @oy_adjust = @ch * 50
  656.     @angle_time = data[1]
  657.     start_angle = data[2] * N03.mirror_num(@mirror)
  658.     end_angle = data[3] * N03.mirror_num(@mirror)
  659.     # 时间要是0以下时立即到最后角度
  660.     @angle_time = 1 if @angle_time <= 0
  661.     # 从旋转时间计算一格相当于的角度
  662.     @angling = (end_angle - start_angle) / @angle_time
  663.     # 不能整除的剩余到初期角度
  664.     @angle = (end_angle - start_angle) % @angle_time + start_angle
  665.   end
  666.   #--------------------------------------------------------------------------
  667.   # ● 初始化旋转
  668.   #--------------------------------------------------------------------------
  669.   def angle_reset
  670.     @oy = @ch
  671.     @angle = @angle_time = @oy_adjust = 0
  672.   end  
  673.   #--------------------------------------------------------------------------
  674.   # ● 实行扩大缩小
  675.   #--------------------------------------------------------------------------
  676.   def zooming(data = @action_data)
  677.     @zoom_data = data.dup
  678.     @zoom_time = data[1]
  679.     start_zoom_x = data[2][0]
  680.     start_zoom_y = data[2][1]
  681.     end_zoom_x = data[3][0]
  682.     end_zoom_y = data[3][1]
  683.     # 时间是0以下时跳过
  684.     @zoom_time = 1 if @zoom_time <= 0
  685.     # 从放大时间中计算一格相当于的放大率
  686.     @zooming_x = (end_zoom_x - start_zoom_x) / @zoom_time
  687.     @zooming_y = (end_zoom_y - start_zoom_y) / @zoom_time
  688.     # 开始的大小
  689.     @zoom_x = start_zoom_x
  690.     @zoom_y = start_zoom_y
  691.   end  
  692.   #--------------------------------------------------------------------------
  693.   # ● 实行扩大缩小
  694.   #--------------------------------------------------------------------------
  695.   def zoom_reset
  696.     @zoom_x = @zoom_y = 1
  697.     @zoom_time = 0
  698.   end  
  699.   #--------------------------------------------------------------------------
  700.   # ● 角色透明度操作
  701.   #--------------------------------------------------------------------------
  702.   def set_opacity
  703.     data = @action_data.dup
  704.     @opacity = data[2]
  705.     opacity_move = (data[3] - data[2])/ data[1]
  706.     @opacity_data = [data[1], data[1], opacity_move, data[4], data[5], data[6]]
  707.     @wait = data[1] if data[7]
  708.     @wait *= 2 if data[6] && data[7]
  709.   end
  710.   #--------------------------------------------------------------------------
  711.   # ● 初始化透明度操作
  712.   #--------------------------------------------------------------------------
  713.   def opacity_reset
  714.     @opacity = 255
  715.     @opacity = 0 if @battler.hidden?
  716.     @opacity_data = []
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # ● 实行角色动画
  720.   #--------------------------------------------------------------------------
  721.   def battler_anime(anime_data = nil)
  722.     anime_data = @action_data.dup if anime_data == nil
  723.     @graphic_file_index = anime_data[1] if !graphic_fix
  724.     @pattern_h = anime_data[2]
  725.     @pattern_w = anime_data[3]
  726.     @pattern_h = 0 if @max_pattern_w == 1
  727.     @pattern_w = 0 if @max_pattern_h == 1
  728.     @pattern_type = anime_data[4]
  729.     @pattern_time = anime_data[5]
  730.     @pattern_rest_time = anime_data[5]
  731.     @pattern_count = 0
  732.     @pattern_kind = 1
  733.     @pattern_kind = -1 if @pattern_type < 0
  734.     @pattern_kind = 0 if @pattern_type == 0
  735.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  736.     @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  737.     @z_plus = anime_data[6]
  738.     @wait = set_anime_wait if anime_data[7]
  739.     @shadow_visible = anime_data[8]
  740.     weapon_anime(anime_data)
  741.   end
  742.   #--------------------------------------------------------------------------
  743.   # ● 计算等待动画
  744.   #--------------------------------------------------------------------------
  745.   def set_anime_wait
  746.     if @pattern_type > 0
  747.       pattern_time_a = @max_pattern_w - @pattern_w.abs
  748.     elsif @pattern_type < 0
  749.       pattern_time_a = @pattern_w.abs + 1
  750.     else
  751.       return @pattern_time if @pattern_type == 0
  752.     end
  753.     case @pattern_type
  754.     when 1,-1, 3,-3
  755.       return pattern_time_a * @pattern_time
  756.     when 2,-2, 4,-4
  757.       return pattern_time_a * @pattern_time + (@max_pattern_w - 2) * @pattern_time
  758.     end
  759.   end  
  760.   #--------------------------------------------------------------------------
  761.   # ● 实行移动
  762.   #--------------------------------------------------------------------------
  763.   def move
  764.     @move_targets = N03.get_targets(@action_data[1].abs, @battler)
  765.     return if @move_targets == []
  766.     @move_targets = [@battler] if @action_data[1].abs == 7
  767.     @move_x = @action_data[2] * 100 * N03.mirror_num(@mirror)
  768.     @move_y = @action_data[3] * 100
  769.     @move_h = @action_data[4] * 100 if @action_data[4] != nil
  770.     @move_h = nil if @action_data[4] == nil
  771.     battler_anime(N03::ACTION[@action_data[8]].dup) if N03::ACTION[@action_data[8]] != nil
  772.     @horming_move = true
  773.     @horming_move = false if @action_data[1] < 0 or @action_data[1].abs == 7
  774.     target_position_set
  775.     target_position = [@target_x, @target_y, @target_z]
  776.     distanse_move = @action_data[5] > 0
  777.     @move_time = N03.distanse_calculation(@action_data[5].abs, target_position, [@x, @y, @z], distanse_move)
  778.     @wait = @move_time
  779.     curve
  780.     jump
  781.     @move_time = 1 if @move_time == 0
  782.     @horming_move = false if !@move_targets or @move_targets.include?(@battler)
  783.     update_move if @move_time == 1
  784.   end  
  785.   #--------------------------------------------------------------------------
  786.   # ● 实行曲线
  787.   #--------------------------------------------------------------------------
  788.   def curve
  789.     @c = 0
  790.     return if @action_data[6] == 0
  791.     @curve = N03.parabola([@action_data[6], -@action_data[6]], @move_time, 100, 4)
  792.   end  
  793.   #--------------------------------------------------------------------------
  794.   # ● 实行跳跃
  795.   #--------------------------------------------------------------------------
  796.   def jump
  797.     convert_jump
  798.     return if @action_data[7] == [0,0]
  799.     @jump = N03.parabola(@action_data[7].dup, @move_time, 100)
  800.   end  
  801.   #--------------------------------------------------------------------------
  802.   # ● J坐标(跳跃高度)H坐标变换
  803.   #--------------------------------------------------------------------------
  804.   def convert_jump
  805.     @h += @j
  806.     @j = 0
  807.     @jump = []
  808.   end  
  809.   #--------------------------------------------------------------------------
  810.   # ● 实行数据库战斗动画
  811.   #--------------------------------------------------------------------------
  812.   def battle_anime
  813.     data = @action_data.dup
  814.     targets = N03.get_targets(data[2], @battler)
  815.     return if targets == []
  816.     data[8] = !data[8] if @mirror
  817.     @set_damage           = data[5]
  818.     @damage_anime_data[0] = N03.get_attack_anime_id(data[1], @battler)
  819.     @damage_anime_data[1] = data[8]
  820.     @damage_anime_data[2] = data[7]
  821.     @damage_anime_data[3] = data[6]
  822.     @damage_anime_data[4] = data[9]
  823.     @wait = N03.get_anime_time(@damage_anime_data[0]) - 2 if data[4]
  824.     return if @set_damage
  825.     for target in targets do display_anime(targets, target, data) end
  826.   end
  827.   #--------------------------------------------------------------------------
  828.   # ● 开始武器动画
  829.   #--------------------------------------------------------------------------
  830.   def weapon_anime(anime_data)
  831.     @weapon_end = true
  832.     for i in 9...anime_data.size
  833.       set_effect_data(anime_data[i]) if anime_data[i] != ""
  834.     end
  835.   end
  836.   #--------------------------------------------------------------------------
  837.   # ● 开始飞行动画
  838.   #--------------------------------------------------------------------------
  839.   def move_anime
  840.     @m_a_starter = []
  841.     @m_a_targets = []
  842.     starters = N03.get_targets(@action_data[2], @battler)
  843.     targets = N03.get_targets(@action_data[3], @battler)
  844.     return if starters == [] or targets == []
  845.     single_start = true if starters != nil && @action_data[2] < 0
  846.     single_start = true if @action_data[1][0] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][0], @battler)].position == 3
  847.     starters = [starters[0]] if single_start
  848.     single_end = true if targets != nil && @action_data[3] < 0
  849.     single_end = true if @action_data[1][1] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][1], @battler)].position == 3
  850.     targets = [targets[0]] if single_end
  851.     se_flag = true
  852.     for starter in starters
  853.       for target in targets
  854.         data = @action_data.dup
  855.         data[17] = se_flag
  856.         @effect_data.push(data)
  857.         @m_a_targets.push(target)
  858.         @m_a_starter.push(starter)
  859.         se_flag = false
  860.       end
  861.     end  
  862.   end
  863.   #--------------------------------------------------------------------------
  864.   # ● 效果通讯设置
  865.   #--------------------------------------------------------------------------
  866.   def set_effect_data(data = @action)
  867.     action_data = N03::ACTION[data]
  868.     return if action_data == nil
  869.     @effect_data.push(action_data.dup)
  870.   end
  871.   #--------------------------------------------------------------------------
  872.   # ● 战斗场景通讯的数据储存
  873.   #--------------------------------------------------------------------------
  874.   def set_play_data(data = @action_data)
  875.     @play_data = data.dup
  876.   end
  877.   #--------------------------------------------------------------------------
  878.   # ● 战斗动画显示
  879.   #--------------------------------------------------------------------------
  880.   def display_anime(targets, target, data)
  881.     return if !N03.first_of_all_screen_anime(data[1], target, targets)
  882.     target.animation_id         = N03.get_attack_anime_id(data[1], @battler)
  883.     target.animation_mirror     = data[8]
  884.     target.sv.anime_horming     = data[3]
  885.     target.sv.anime_camera_zoom = data[6]
  886.     target.sv.anime_no_mirror   = data[7]
  887.     target.sv.anime_plus_z      = data[9]
  888.   end
  889.   #--------------------------------------------------------------------------
  890.   # ● 初始化战斗动画扩张数据
  891.   #--------------------------------------------------------------------------
  892.   def reset_anime_data
  893.     @anime_no_mirror = false
  894.     @anime_horming = false
  895.     @anime_camera_zoom = false
  896.     @timing_targets = []
  897.     @anime_plus_z = true
  898.   end  
  899.   #--------------------------------------------------------------------------
  900.   # ● 摄影机
  901.   #--------------------------------------------------------------------------
  902.   def camera
  903.     data = @action_data.dup
  904.     N03.camera(@battler, data)
  905.     @wait = data[4] if data[5]
  906.   end  
  907.   #--------------------------------------------------------------------------
  908.   # ● 画面的摇动
  909.   #--------------------------------------------------------------------------
  910.   def shake
  911.     data = @action_data.dup
  912.     $sv_camera.shake(data[1], data[2], data[3])
  913.     @wait = data[3] if data[4]
  914.   end
  915.   #--------------------------------------------------------------------------
  916.   # ● 画面色调变更
  917.   #--------------------------------------------------------------------------
  918.   def color_effect
  919.     case @action_data[1]
  920.     when 0,1,2,3,4,5
  921.       targets = N03.get_targets(@action_data[1], @battler)
  922.     when 6
  923.       screen = true
  924.     when 7
  925.       targets = [@battler] + @target_battler
  926.     when 8
  927.       screen = true
  928.       targets = $game_troop.members + $game_party.battle_members - [@battler]
  929.     when 9
  930.       screen = true
  931.       targets = $game_troop.members + $game_party.battle_members - [@battler] - @target_battler
  932.     when 10
  933.       screen = true
  934.       targets = $game_troop.members + $game_party.battle_members
  935.     end
  936.     return if screen == nil && targets == []
  937.     for target in targets do target.sv.color_set = @action_data[2] end if targets
  938.     @wait = @action_data[2][4] if @action_data[3]
  939.     return if !screen
  940.     $sv_camera.color_set[1] = @action_data[2]
  941.     $sv_camera.color_set[2] = @action_data[2]
  942.   end  
  943.   #--------------------------------------------------------------------------
  944.   # ● 过渡
  945.   #--------------------------------------------------------------------------
  946.   def transition
  947.     $sv_camera.perform_transition(@action_data)
  948.   end  
  949.   #--------------------------------------------------------------------------
  950.   # ● 气球动画显示
  951.   #--------------------------------------------------------------------------
  952.   def balloon_anime
  953.     @balloon_data = @action_data.dup
  954.   end  
  955.   #--------------------------------------------------------------------------
  956.   # ● 图片显示
  957.   #--------------------------------------------------------------------------
  958.   def picture_set
  959.     @picture = true
  960.     set_effect_data
  961.   end
  962.   #--------------------------------------------------------------------------
  963.   # ● 状态操作
  964.   #--------------------------------------------------------------------------
  965.   def state_set
  966.     targets = N03.get_targets(@action_data[1], @battler)
  967.     return if targets == []
  968.     case @action_data[2]
  969.     when 1 ; targets = [targets[rand(targets.size)]]
  970.     when 2 ; targets -= @battler if targets.include?(@battler)
  971.     end
  972.     for target in targets
  973.       for id in @action_data[4]
  974.         target.add_state(id) if @action_data[3] == "+"
  975.         target.remove_state(id) if @action_data[3] == "-"
  976.       end
  977.     end
  978.   end
  979.   #--------------------------------------------------------------------------
  980.   # ● FPS变更
  981.   #--------------------------------------------------------------------------
  982.   def fps
  983.     Graphics.frame_rate = @action_data[1]
  984.     start_action
  985.   end
  986.   #--------------------------------------------------------------------------
  987.   # ● 角色画像变更的場合
  988.   #--------------------------------------------------------------------------
  989.   def graphics_change
  990.     @graphics_change = true
  991.     return @battler.graphics_change(@action_data[3]) if !@battler.actor?
  992.     @pre_change_data = [@battler.character_name, @battler.character_index, @battler.face_name, @battler.face_index] if @pre_change_data == nil && !@action_data[1]
  993.     if @action_data[4] == []
  994.       face_name = @battler.face_name
  995.       face_index = @battler.face_index
  996.     else
  997.       face_name = @action_data[4][1]
  998.       face_index = @action_data[4][0]
  999.     end
  1000.     @battler.set_graphic(@action_data[3], @action_data[2], face_name, face_index)
  1001.   end
  1002.   #--------------------------------------------------------------------------
  1003.   # ● 技能连发
  1004.   #--------------------------------------------------------------------------
  1005.   def derivating_skill
  1006.     # 如果让没学的的技能不能连发时
  1007.     return if !@action_data[1] && !@battler.skill_learn?($data_skills[@action_data[3]])
  1008.     # 如果技能不能连发成本不够时
  1009.     return if !@action_data[2] && !@battler.skill_cost_payable?($data_skills[@action_data[3]])
  1010.     # 连发
  1011.     @derivation_skill_id = @action_data[3]
  1012.     # 取消之后的动作
  1013.     @full_action = []
  1014.   end
  1015.   #--------------------------------------------------------------------------
  1016.   # ● BGM/BGS/SE演奏
  1017.   #--------------------------------------------------------------------------
  1018.   def sound
  1019.     pitch = @action_data[2]
  1020.     vol   = @action_data[3]
  1021.     name  = @action_data[4]
  1022.     case @action_data[1]
  1023.     when "se"
  1024.       Audio.se_play("Audio/SE/" + name, vol, pitch)
  1025.     when "bgm"
  1026.       # 没有指定名字时、不改变现在的BGM
  1027.       name = RPG::BGM.last.name if @action_data[4] == ""
  1028.       Audio.bgm_play("Audio/BGM/" + name, vol, pitch)
  1029.     when "bgs"
  1030.       name = RPG::BGS.last.name if @action_data[4] == ""
  1031.       Audio.bgs_play("Audio/BGS/" + name, vol, pitch)
  1032.     end
  1033.   end
  1034.   #--------------------------------------------------------------------------
  1035.   # ● 电影播放
  1036.   #--------------------------------------------------------------------------
  1037.   def movie
  1038.     Graphics.play_movie('Movies/' + @action_data[1])
  1039.   end
  1040.   #--------------------------------------------------------------------------
  1041.   # ● 游戏开关的操作
  1042.   #--------------------------------------------------------------------------
  1043.   def switches
  1044.     for id in @action_data[1]
  1045.       $game_switches[id] = true if id > 0
  1046.       $sv_camera.switches[id.abs] = true  if id < 0
  1047.     end
  1048.     for id in @action_data[2]
  1049.       $game_switches[id] = false if id > 0
  1050.       $sv_camera.switches[id.abs] = false  if id < 0
  1051.     end
  1052.     $sv_camera.program_check
  1053.   end
  1054.   #--------------------------------------------------------------------------
  1055.   # ● 游戏变量操作
  1056.   #--------------------------------------------------------------------------
  1057.   def variable
  1058.     # 检查操作
  1059.     operand = @action_data[3]
  1060.     operand = $game_variables[@action_data[3].abs] if @action_data[3] < 0
  1061.     # 变数操作的分歧
  1062.     case @action_data[2]
  1063.     when 0 ; $game_variables[@action_data[1]] = operand  # 代入
  1064.     when 1 ; $game_variables[@action_data[1]] += operand # 加法
  1065.     when 2 ; $game_variables[@action_data[1]] -= operand # 减法
  1066.     when 3 ; $game_variables[@action_data[1]] *= operand # 乘法
  1067.     when 4 ; $game_variables[@action_data[1]] /= operand # 除法
  1068.     when 5 ; $game_variables[@action_data[1]] %= operand # 剩余
  1069.     end
  1070.   end  
  1071.   #--------------------------------------------------------------------------
  1072.   # ● 条件分岐 (游戏开关)
  1073.   #--------------------------------------------------------------------------
  1074.   def nece_1
  1075.     judgment = $game_switches[@action_data[1]] == @action_data[2] if @action_data[1] > 0
  1076.     judgment = $sv_camera.switches[@action_data[1].abs] == @action_data[2] if @action_data[1] < 0
  1077.     action_diverging(judgment, @action_data[3])
  1078.   end  
  1079.   #--------------------------------------------------------------------------
  1080.   # ● 条件分岐 (游戏变量)
  1081.   #--------------------------------------------------------------------------
  1082.   def nece_2
  1083.     variable = $game_variables[@action_data[1]]
  1084.     num = @action_data[2]
  1085.     num = $game_variables[@action_data[2].abs] if num < 0
  1086.     case @action_data[3]
  1087.     when 0 ; judgment = variable == num
  1088.     when 1 ; judgment = variable < num
  1089.     when 2 ; judgment = variable > num
  1090.     end  
  1091.     action_diverging(judgment, @action_data[4])
  1092.   end  
  1093.   #--------------------------------------------------------------------------
  1094.   # ● 条件分岐 (状态)
  1095.   #--------------------------------------------------------------------------
  1096.   def nece_3
  1097.     targets = N03.get_targets(@action_data[1], @battler)
  1098.     return if targets == []
  1099.     member_num = @action_data[4]
  1100.     member_num = targets.size if @action_data[4] == 0 && targets.size > 1
  1101.     hit_count = 0
  1102.     miss_count = 0
  1103.     for target in targets
  1104.       hit_count += 1 if target.state?(@action_data[2])
  1105.       miss_count += 1 if !target.state?(@action_data[2])
  1106.     end
  1107.     case @action_data[3]
  1108.     when 0 ; judgment = hit_count >= member_num
  1109.     when 1 ; judgment = miss_count >= member_num
  1110.     end
  1111.     action_diverging(judgment, @action_data[5])
  1112.   end  
  1113.   #--------------------------------------------------------------------------
  1114.   # ● 条件分岐 (技能)
  1115.   #--------------------------------------------------------------------------
  1116.   def nece_4
  1117.     targets = N03.get_targets(@action_data[1], @battler)
  1118.     return if targets == []
  1119.     member_num = @action_data[4]
  1120.     member_num = targets.size if @action_data[4] == 0 && targets.size > 1
  1121.     hit_count = 0
  1122.     miss_count = 0
  1123.     for target in targets
  1124.       hit_count += 1 if target.skill_learn?($data_skills[@action_data[2]]) && target.skill_conditions_met?($data_skills[@action_data[2]])
  1125.       miss_count += 1 if !target.skill_learn?($data_skills[@action_data[2]]) or !target.skill_conditions_met?($data_skills[@action_data[2]])
  1126.     end
  1127.     case @action_data[3]
  1128.     when 0 ; judgment = hit_count >= member_num
  1129.     when 1 ; judgment = miss_count >= member_num
  1130.     end
  1131.     action_diverging(judgment, @action_data[5])
  1132.   end  
  1133.   #--------------------------------------------------------------------------
  1134.   # ● 条件分岐 (参数)
  1135.   #--------------------------------------------------------------------------
  1136.   def nece_5
  1137.     targets = N03.get_targets(@action_data[1], @battler)
  1138.     return if targets == []
  1139.     member_num = @action_data[5]
  1140.     member_num = targets.size if @action_data[5] == 0 && targets.size > 1
  1141.     hit_count = 0
  1142.     for target in targets
  1143.       hit_count += 1 if target.comparison_parameter([@action_data[2],@action_data[3],@action_data[4]])
  1144.     end
  1145.     judgment = hit_count >= member_num
  1146.     action_diverging(judgment, @action_data[6])
  1147.   end  
  1148.   #--------------------------------------------------------------------------
  1149.   # ● 条件分岐 (装备)
  1150.   #--------------------------------------------------------------------------
  1151.   def nece_6
  1152.     targets = N03.get_targets(@action_data[1], @battler)
  1153.     return if targets == []
  1154.     member_num = @action_data[5]
  1155.     member_num = targets.size if @action_data[5] == 0 && targets.size > 1
  1156.     hit_count = 0
  1157.     miss_count = 0
  1158.     for target in targets
  1159.       hit_count += 1 if target.comparison_equip([@action_data[2],@action_data[3]])
  1160.       miss_count += 1 if !target.comparison_equip([@action_data[2],@action_data[3]])
  1161.     end
  1162.     case @action_data[4]
  1163.     when 0 ; judgment = hit_count >= member_num
  1164.     when 1 ; judgment = miss_count >= member_num
  1165.     end
  1166.     action_diverging(judgment, @action_data[6])
  1167.   end  
  1168.   #--------------------------------------------------------------------------
  1169.   # ● 条件分岐 (脚本)
  1170.   #--------------------------------------------------------------------------
  1171.   def nece_7
  1172.     judgment = eval(@action_data[2])
  1173.     action_diverging(judgment, @action_data[1])
  1174.   end  
  1175.   #--------------------------------------------------------------------------
  1176.   # ● 动作的分岐  
  1177.   #--------------------------------------------------------------------------
  1178.   def action_diverging(judgment, kind)
  1179.     result = 0
  1180.     if judgment
  1181.       result = 1 if kind == 1
  1182.       result = 2 if kind == 2
  1183.     else
  1184.       result = 1 if kind == 0
  1185.     end
  1186.     # 全部动作结束
  1187.     return @full_action = []  if result == 2
  1188.     # 清楚下一个动作
  1189.     @full_action.shift if result == 1
  1190.     set_action
  1191.     # 实行下一个动作
  1192.     @action_data = N03::ACTION[@action]
  1193.     next_action
  1194.   end
  1195.   #--------------------------------------------------------------------------
  1196.   # ● 第二个目标的操作
  1197.   #--------------------------------------------------------------------------
  1198.   def second_targets_set
  1199.     targets = N03.get_targets(@action_data[1], @battler)
  1200.     for target in targets
  1201.       targets.delete(target) if @action_data[2][1] == 1 && target.index != @action_data[2][0]
  1202.       targets.delete(target) if @action_data[2][1] == 2 && target.index == @action_data[2][0].abs
  1203.       targets.delete(target) if @action_data[3] > 0 && target.id != @action_data[3]
  1204.       targets.delete(target) if @action_data[3] < 0 && target.id == @action_data[3].abs
  1205.       targets.delete(target) if @action_data[4] > 0 && !target.state?(@action_data[4])
  1206.       targets.delete(target) if @action_data[4] < 0 && target.state?(@action_data[4].abs)
  1207.       targets.delete(target) if @action_data[5] > 0 && !target.skill_conditions_met?($data_skills[@action_data[5]])
  1208.       targets.delete(target) if @action_data[5] < 0 && target.skill_conditions_met?($data_skills[@action_data[5].abs])
  1209.       targets.delete(target) if !target.comparison_parameter(@action_data[6])
  1210.       targets.delete(target) if !@action_data[7][1].include?(0) && !target.comparison_equip(@action_data[7])
  1211.     end
  1212.     return @second_targets = [] if targets.size == 0
  1213.     case @action_data[8]
  1214.     when 1 ; targets = [targets[rand(targets.size)]]
  1215.     when 2 ; targets.delete(@battler)
  1216.     end
  1217.     return @second_targets = [] if targets.size == 0
  1218.     @second_targets = targets
  1219.     case @action_data[9]
  1220.     when 0 ; return
  1221.     when 1 ; set_play_data(["second_targets_set"])
  1222.     when 2 ; set_play_data(["targets_set"])
  1223.     end
  1224.     @wait += 1
  1225.   end
  1226.   #--------------------------------------------------------------------------
  1227.   # ● 公共事件的呼叫
  1228.   #--------------------------------------------------------------------------
  1229.   def call_common_event
  1230.     $game_temp.reserve_common_event(@action_data[1])
  1231.     $sv_camera.event = true
  1232.     @event_fix = @action_data[2]
  1233.   end
  1234.   #--------------------------------------------------------------------------
  1235.   # ● 伤害动画
  1236.   #--------------------------------------------------------------------------
  1237.   def damage_anime(delay_time = 12)
  1238.     anime(N03.get_attack_anime_id(-3, @battler), wait = true)
  1239.     action_play
  1240.     @wait -= delay_time
  1241.     @full_action.unshift("eval('@damage_anime_data = []
  1242.     @set_damage = true')")
  1243.   end
  1244.   #--------------------------------------------------------------------------
  1245.   # ● 通常战斗不能
  1246.   #--------------------------------------------------------------------------
  1247.   def normal_collapse
  1248.     @collapse = true
  1249.     return
  1250.   end
  1251.   #--------------------------------------------------------------------------
  1252.   # ● 初期位置变更
  1253.   #--------------------------------------------------------------------------
  1254.   def change_base_position
  1255.     @base_x = @x
  1256.     @base_y = @y
  1257.     @base_h = @h
  1258.   end  
  1259.   #--------------------------------------------------------------------------
  1260.   # ● 实行强制动作
  1261.   #--------------------------------------------------------------------------
  1262.   def force_act
  1263.     target(@full_action.shift)
  1264.   end
  1265.   #--------------------------------------------------------------------------
  1266.   # ● 实行强制动作 (第二个目标)
  1267.   #--------------------------------------------------------------------------
  1268.   def force_act2
  1269.     target2(@full_action.shift)
  1270.   end
  1271.   #--------------------------------------------------------------------------
  1272.   # ● 开始个别处理
  1273.   #--------------------------------------------------------------------------
  1274.   def individual_start
  1275.     @individual_targets = @target_battler.dup
  1276.     @remain_targets = @target_battler.dup
  1277.     @target_battler = [@individual_targets[0]]
  1278.     # 重复部分的动作并保持
  1279.     @individual_act = @full_action.dup
  1280.   end
  1281.   #--------------------------------------------------------------------------
  1282.   # ● 结束个别处理
  1283.   #--------------------------------------------------------------------------
  1284.   def individual_end
  1285.     @individual_targets.shift
  1286.     for target in @individual_targets
  1287.       @individual_targets.shift if target.dead?
  1288.     end
  1289.     # 目标没有残留时行动完毕
  1290.     return @target_battler = @remain_targets if @individual_targets.size == 0
  1291.     @full_action = @individual_act.dup
  1292.     @target_battler = [@individual_targets[0]]
  1293.   end
  1294.   #--------------------------------------------------------------------------
  1295.   # ● 循环開始
  1296.   #--------------------------------------------------------------------------
  1297.   def loop_start
  1298.     # 重复部分的动作并保持
  1299.     @loop_act = @full_action.dup
  1300.   end
  1301.   #--------------------------------------------------------------------------
  1302.   # ● 循环结束
  1303.   #--------------------------------------------------------------------------
  1304.   def loop_end
  1305.     # 动作重复
  1306.     @full_action = @loop_act.dup if @loop_act != []
  1307.   end
  1308.   #--------------------------------------------------------------------------
  1309.   # ● 下个动作角色
  1310.   #--------------------------------------------------------------------------
  1311.   def next_battler
  1312.     @action_end = true
  1313.     @active = false
  1314.   end
  1315.   #--------------------------------------------------------------------------
  1316.   # ● 图像变更标记
  1317.   #--------------------------------------------------------------------------
  1318.   def set_change
  1319.     @change_up = true
  1320.   end
  1321.   #--------------------------------------------------------------------------
  1322.   # ● 战斗场景通讯
  1323.   #--------------------------------------------------------------------------
  1324.   def play_data
  1325.     data = @play_data
  1326.     @play_data = []
  1327.     return data
  1328.   end
  1329.   #--------------------------------------------------------------------------
  1330.   # ● 捷径指令
  1331.   #--------------------------------------------------------------------------
  1332.   def anime(anime_id, wait = true)
  1333.     @action_data = ["anime",anime_id,1,false,wait,false,true,false]
  1334.   end
  1335.   def anime_me(anime_id, wait = true)
  1336.     @action_data = ["anime",anime_id,0,false,wait,false,true,false]
  1337.   end
  1338.   def se(file, pitch = 100)
  1339.     @action_data = ["sound",  "se", pitch, 100, file]
  1340.   end
  1341.   def target(act)
  1342.     for target in @target_battler do target.sv.force_action = act end
  1343.   end
  1344.   def target2(act)
  1345.     for target in @second_targets do target.sv.force_action = act end
  1346.   end
  1347.   def delay(time)
  1348.     @wait = @battler.index * time
  1349.   end
  1350.   #--------------------------------------------------------------------------
  1351.   # ● 取得角色ID
  1352.   #--------------------------------------------------------------------------
  1353.   def id
  1354.     return @battler.id if @battler.actor?
  1355.     return [email]-@battler.id[/email]
  1356.   end
  1357.   #--------------------------------------------------------------------------
  1358.   # ● 取得被致命一击
  1359.   #--------------------------------------------------------------------------
  1360.   def critical?
  1361.     return @battler.result.critical
  1362.   end
  1363.   #--------------------------------------------------------------------------
  1364.   # ● 取得被回复标记
  1365.   #--------------------------------------------------------------------------
  1366.   def recovery?
  1367.     recovery = false
  1368.     recovery = true if @battler.result.hp_damage < 0
  1369.     recovery = true if @battler.result.mp_damage < 0
  1370.     recovery = true if @battler.result.tp_damage < 0
  1371.     return recovery
  1372.   end
  1373.   #--------------------------------------------------------------------------
  1374.   # ● 取得被损伤技能ID
  1375.   #--------------------------------------------------------------------------
  1376.   def damage_skill_id
  1377.     return @damage_skill_id
  1378.   end
  1379.   #--------------------------------------------------------------------------
  1380.   # ● 取得被损伤物品ID
  1381.   #--------------------------------------------------------------------------
  1382.   def damage_item_id
  1383.     return @damage_item_id
  1384.   end
  1385.   #--------------------------------------------------------------------------
  1386.   # ● 取得装备武器ID
  1387.   #--------------------------------------------------------------------------
  1388.   def weapon_id
  1389.     return 0 if !@battler.weapons[0]
  1390.     return @battler.weapons[0].id
  1391.   end
  1392.   #--------------------------------------------------------------------------
  1393.   # ● 取得装备武器的类型
  1394.   #--------------------------------------------------------------------------
  1395.   def weapon_type
  1396.     return 0 if !@battler.weapons[0]
  1397.     return @battler.weapons[0].wtype_id
  1398.   end
  1399.   #--------------------------------------------------------------------------
  1400.   # ● 是否装备盾
  1401.   #--------------------------------------------------------------------------
  1402.   def shield?
  1403.     for armor in @battler.armors do return true if armor != nil && armor.etype_id == 1 end
  1404.     return false
  1405.   end
  1406.   #--------------------------------------------------------------------------
  1407.   # ● 是否有伤害
  1408.   #--------------------------------------------------------------------------
  1409.   def damage_zero?
  1410.     return @battler.result.hp_damage == 0 && @battler.result.mp_damage == 0 && @battler.result.tp_damage == 0
  1411.   end
  1412.   #--------------------------------------------------------------------------
  1413.   # ● 取得技能ID
  1414.   #--------------------------------------------------------------------------
  1415.   def skill_id
  1416.     return @counter_id if @counter_id != 0
  1417.     return 0 if @battler.current_action == nil or @battler.current_action.item == nil
  1418.     return 0 if @battler.current_action.item.is_a?(RPG::Item)
  1419.     return @battler.current_action.item.id
  1420.   end
  1421.   #--------------------------------------------------------------------------
  1422.   # ● 取得技能的种类
  1423.   #--------------------------------------------------------------------------
  1424.   def skill_type
  1425.     return 0 if skill_id == 0
  1426.     return $data_skills[skill_id].stype_id
  1427.   end
  1428.   #--------------------------------------------------------------------------
  1429.   # ● 取得技能名字
  1430.   #--------------------------------------------------------------------------
  1431.   def skill_name
  1432.     return "" if skill_id == 0
  1433.     return $data_skills[skill_id].name
  1434.   end
  1435.   #--------------------------------------------------------------------------
  1436.   # ● 取得物品ID
  1437.   #--------------------------------------------------------------------------
  1438.   def item_id
  1439.     return 0 if @battler.current_action == nil or @battler.current_action.item == nil
  1440.     return @battler.current_action.item.id
  1441.   end
  1442.   #--------------------------------------------------------------------------
  1443.   # ● 攻击动作
  1444.   #--------------------------------------------------------------------------
  1445.   def attack_action(item)
  1446.     return skill_action if item.is_a?(RPG::Skill)
  1447.     return item_action
  1448.   end
  1449.   #--------------------------------------------------------------------------
  1450.   # ● 基础动作伤害
  1451.   #--------------------------------------------------------------------------
  1452.   def damage_action_base(item)
  1453.     @damage_skill_id = 0
  1454.     @damage_item_id = 0
  1455.     @damage_skill_id = item.id if item.is_a?(RPG::Skill)
  1456.     @damage_item_id = item.id if item.is_a?(RPG::Item)
  1457.   end  
  1458.   #--------------------------------------------------------------------------
  1459.   # ● 动作伤害
  1460.   #--------------------------------------------------------------------------
  1461.   def damage_action(attacker, item)
  1462.     damage_action_base(item)
  1463.     act = damage(attacker)
  1464.     return if @active
  1465.     start_action(act) if act != nil
  1466.   end
  1467.   #--------------------------------------------------------------------------
  1468.   # ● 回避动作
  1469.   #--------------------------------------------------------------------------
  1470.   def evasion_action(attacker, item)
  1471.     damage_action_base(item)
  1472.     act = evasion(attacker)
  1473.     return if @active
  1474.     start_action(act) if act != nil
  1475.   end
  1476.   #--------------------------------------------------------------------------
  1477.   # ● 失误动作
  1478.   #--------------------------------------------------------------------------
  1479.   def miss_action(attacker, item)
  1480.     damage_action_base(item)
  1481.     act = miss(attacker)
  1482.     return if @active
  1483.     start_action(act) if act != nil
  1484.   end
  1485.   #--------------------------------------------------------------------------
  1486.   # ● Flash动作同时处理
  1487.   #--------------------------------------------------------------------------
  1488.   def flash_action
  1489.     return "閃き"
  1490.   end
  1491.  
  1492. end
  1493.  
  1494.  
  1495. #==============================================================================
  1496. # ■ module N03
  1497. #------------------------------------------------------------------------------
  1498. #  这是一个侧视战斗的模块。
  1499. #==============================================================================
  1500. module N03
  1501.   #--------------------------------------------------------------------------
  1502.   # ● 取得敌人角色队伍
  1503.   #--------------------------------------------------------------------------
  1504.   def self.get_enemy_unit(battler)
  1505.     return $game_troop if battler.actor?
  1506.     return $game_party
  1507.   end
  1508.   #--------------------------------------------------------------------------
  1509.   # ● 取得我方角色队伍
  1510.   #--------------------------------------------------------------------------
  1511.   def self.get_party_unit(battler)
  1512.     return $game_party if battler.actor?
  1513.     return $game_troop
  1514.   end
  1515.   #--------------------------------------------------------------------------
  1516.   # ● 取得战斗动画时间
  1517.   #--------------------------------------------------------------------------
  1518.   def self.get_anime_time(anime_id)
  1519.     return 0 if anime_id <= 0
  1520.     return $data_animations[anime_id].frame_max * 4
  1521.   end
  1522.   #--------------------------------------------------------------------------
  1523.   # ● 取得攻击动画
  1524.   #--------------------------------------------------------------------------
  1525.   def self.get_attack_anime_id(kind, battler)
  1526.     return $data_skills[battler.sv.counter_id].animation_id if kind == -3 && battler.sv.counter_id != 0
  1527.     case kind
  1528.     when -1 ; anime_id = battler.atk_animation_id1
  1529.     when -2 ; anime_id = battler.atk_animation_id2
  1530.     when -3
  1531.       if battler.current_action != nil
  1532.         anime_id = battler.current_action.item.animation_id if battler.current_action.item != nil
  1533.       end
  1534.     else    ; anime_id = kind
  1535.     end
  1536.     case anime_id
  1537.     when -1 ; anime_id = battler.atk_animation_id1
  1538.     when -2 ; anime_id = battler.atk_animation_id2
  1539.     end
  1540.     return anime_id if anime_id
  1541.     return 0
  1542.   end  
  1543.   #--------------------------------------------------------------------------
  1544.   # ● 战斗动画数据
  1545.   #--------------------------------------------------------------------------
  1546.   def self.set_damage_anime_data(targets, target, data)
  1547.     return if !first_of_all_screen_anime(data[0], target, targets)
  1548.     target.animation_id         = data[0]
  1549.     target.animation_mirror     = data[1]
  1550.     target.sv.anime_no_mirror   = data[2]
  1551.     target.sv.anime_camera_zoom = data[3]
  1552.     target.sv.anime_plus_z      = data[4]
  1553.   end   
  1554.   #--------------------------------------------------------------------------
  1555.   # ● 取得目标
  1556.   #--------------------------------------------------------------------------
  1557.   def self.get_targets(kind, battler)
  1558.     case kind.abs
  1559.     when 0 ; return [battler].dup
  1560.     when 1 ; return battler.sv.target_battler.dup
  1561.     when 2 ; return get_enemy_unit(battler).members.dup
  1562.     when 3 ; return get_party_unit(battler).members.dup
  1563.     when 4 ; return $game_troop.members.dup + $game_party.battle_members.dup
  1564.     when 5 ; return battler.sv.second_targets.dup
  1565.     end
  1566.   end  
  1567.   #--------------------------------------------------------------------------
  1568.   # ● 目标的坐标取得
  1569.   #--------------------------------------------------------------------------
  1570.   def self.get_targets_position(targets, horming, m_a = nil)
  1571.     return [0,0,0] if targets == nil && !$sv_camera.mirror
  1572.     return [Graphics.width,0,0] if targets == nil && $sv_camera.mirror
  1573.     x = y = h = 0
  1574.     for i in 0...targets.size
  1575.       x += targets[i].sv.base_x if !horming
  1576.       y += targets[i].sv.base_y if !horming
  1577.       h += targets[i].sv.base_h if !horming
  1578.       x += targets[i].sv.x if horming
  1579.       y += targets[i].sv.y if horming
  1580.       h += targets[i].sv.h if horming
  1581.       y -= targets[i].sv.ch * 100 if m_a == 0
  1582.       y -= targets[i].sv.ch * 50 if m_a == 1
  1583.     end
  1584.     return [x / targets.size, y / targets.size, h / targets.size]
  1585.   end
  1586.   #--------------------------------------------------------------------------
  1587.   # ● 速度转换时间
  1588.   #--------------------------------------------------------------------------
  1589.   def self.distanse_calculation(time, target_position, self_position, distanse_move)
  1590.     return time if !distanse_move
  1591.     distanse_x = self_position[0] - target_position[0]
  1592.     distanse_x = target_position[0] - self_position[0] if target_position[0] > self_position[0]
  1593.     distanse_y = self_position[1] - target_position[1]
  1594.     distanse_y = target_position[1] - self_position[1] if target_position[1] > self_position[1]
  1595.     if self_position[2] != nil && target_position[2] != nil
  1596.       distanse_h = self_position[2] - target_position[2]
  1597.       distanse_h = target_position[2] - self_position[2] if target_position[2] > self_position[2]
  1598.     else
  1599.       distanse_h = 0
  1600.     end
  1601.     distanse = [distanse_x, distanse_y, distanse_h].max
  1602.     return distanse / (time * 100) + 1
  1603.   end
  1604.   #--------------------------------------------------------------------------
  1605.   # ● 计算抛物线移动
  1606.   #--------------------------------------------------------------------------
  1607.   def self.parabola(data, time, size, type = 1)
  1608.     move_data = data
  1609.     move_data[0] *= size
  1610.     move_data[1] *= size
  1611.     move = []
  1612.     move_d = []
  1613.     for i in 0...time / 2
  1614.       move[i] = move_data[0]
  1615.       move_d[i] = move_data[1]
  1616.       move_data[0] = move_data[0] * type / (1 + type)
  1617.       move_data[1] = move_data[1] * type / (1 + type)
  1618.     end
  1619.     move = move + move_d.reverse!
  1620.     move.reverse!
  1621.     adjust = move.inject(0) {|result, item| result + item }
  1622.     move[move.size - 1] += adjust if data[0] == data[1] && adjust != 0
  1623.     move.unshift(0) if time % 2 != 0
  1624.     return move
  1625.   end
  1626.   #--------------------------------------------------------------------------
  1627.   # ● 反转数值
  1628.   #--------------------------------------------------------------------------
  1629.   def self.mirror_num(mirror)
  1630.     return 1 if !mirror
  1631.     return -1
  1632.   end  
  1633.   #--------------------------------------------------------------------------
  1634.   # ● 摄影机
  1635.   #--------------------------------------------------------------------------
  1636.   def self.camera(battler, data)
  1637.     battler = $game_party.battle_members[0] if !battler
  1638.     cx = data[2][0] * 100
  1639.     cy = data[2][1] * 100
  1640.     return $sv_camera.move(cx, cy, data[3], data[4], true) if data[1] == 6
  1641.     targets = self.get_targets(data[1], battler)
  1642.     return if targets == nil or targets == []
  1643.     position = self.get_targets_position(targets, true)
  1644.     $sv_camera.move(position[0], position[1] - position[2], data[3], data[4], false)
  1645.   end
  1646.   #--------------------------------------------------------------------------
  1647.   # ● 禁止战斗不能
  1648.   #--------------------------------------------------------------------------
  1649.   def self.immortaling
  1650.     # 赋予全体不死状态
  1651.     for member in $game_party.battle_members + $game_troop.members
  1652.       # 事件操作等无敌设定就会解除flag的无效
  1653.       member.sv.immortal = true if member.state?(N03::IMMORTAL_ID)
  1654.       member.add_state(N03::IMMORTAL_ID)
  1655.     end
  1656.     return true
  1657.   end  
  1658.   #--------------------------------------------------------------------------
  1659.   # ● 允许战斗不能
  1660.   #--------------------------------------------------------------------------
  1661.   def self.unimmortaling
  1662.     # 解除全体不死状态(如果事件等无敌设定以外)
  1663.     for member in $game_party.battle_members + $game_troop.members
  1664.       next if member.dead?
  1665.       # 不死身状态行动中被解除的场合、从状态中解除无效
  1666.       member.sv.immortal = false if !member.state?(N03::IMMORTAL_ID) && member.sv.immortal
  1667.       next member.sv.immortal = false if member.sv.immortal
  1668.       member.remove_state(N03::IMMORTAL_ID)
  1669.       next if member.hp != 0
  1670.       member.add_state(1)
  1671.       member.perform_collapse_effect
  1672.       member.sv.action_terminate
  1673.     end
  1674.     return false
  1675.   end  
  1676.   #--------------------------------------------------------------------------
  1677.   # ● 技能连发
  1678.   #--------------------------------------------------------------------------
  1679.   def self.derived_skill(battler)
  1680.     battler.force_action(battler.sv.derivation_skill_id, -2)
  1681.     BattleManager.unshift_action_battlers(battler)
  1682.   end
  1683.   #--------------------------------------------------------------------------
  1684.   # ● 创建伤害
  1685.   #--------------------------------------------------------------------------
  1686.   def self.set_damage(battler, hp_damage, mp_damage)
  1687.     battler.result.hp_damage = hp_damage
  1688.     battler.result.mp_damage = mp_damage
  1689.   end
  1690.   #--------------------------------------------------------------------------
  1691.   # ● 确认目标生死
  1692.   #--------------------------------------------------------------------------
  1693.   def self.targets_alive?(targets)
  1694.     return false if targets == []
  1695.     for target in targets do return true if !target.dead? end
  1696.     return false
  1697.   end
  1698.   #--------------------------------------------------------------------------
  1699.   # ● 定位到第二个目标
  1700.   #--------------------------------------------------------------------------
  1701.   def self.s_targets(battler)
  1702.     battler.sv.target_battler = battler.sv.second_targets
  1703.     return battler.sv.second_targets
  1704.   end  
  1705.   #--------------------------------------------------------------------------
  1706.   # ● 定位目标到第二个目标
  1707.   #--------------------------------------------------------------------------
  1708.   def self.targets_set(battler)
  1709.     battler.sv.second_targets = battler.current_action.make_targets.compact
  1710.     battler.sv.target_battler = battler.sv.second_targets
  1711.   end  
  1712.   #--------------------------------------------------------------------------
  1713.   # ● 实行战斗动画判定 (对象:实行第一个目标时的画面的动画)
  1714.   #--------------------------------------------------------------------------
  1715.   def self.first_of_all_screen_anime(anime_id, target, targets)
  1716.     anime = $data_animations[anime_id]
  1717.     return false if !anime
  1718.     return true if anime.position != 3
  1719.     return false if anime.position == 3 && target != targets[0]
  1720.     targets.delete(target)
  1721.     target.sv.timing_targets = targets
  1722.     return true
  1723.   end
  1724.   #--------------------------------------------------------------------------
  1725.   # ● 战斗不能是否附加攻击
  1726.   #--------------------------------------------------------------------------
  1727.   def self.dead_attack?(battler, item)
  1728.     for state in battler.atk_states
  1729.       return true if state == battler.death_state_id
  1730.     end
  1731.     for effect in item.effects
  1732.       return true if effect.code == 21 && effect.data_id == battler.death_state_id
  1733.     end
  1734.     return false
  1735.   end
  1736. end
  1737.  
  1738. #==============================================================================
  1739. # ■ Sprite_Weapon
  1740. #------------------------------------------------------------------------------
  1741. #  这是一个显示武器的脚本。
  1742. #==============================================================================
  1743. class Sprite_Weapon < Sprite_Base
  1744.   #--------------------------------------------------------------------------
  1745.   # ● 公开实例变量 
  1746.   #--------------------------------------------------------------------------
  1747.   attr_reader   :index                       # 武器图像排列的index
  1748.   attr_reader   :battler                     # 角色图像
  1749.   attr_reader   :move_time                   # 图像达到目标的为止的这段时间
  1750.   attr_reader   :through                     # 贯穿标记
  1751.   attr_reader   :action_end                  # 武器动作结束的标记
  1752.   attr_reader   :action_end_cancel           # 武器动作结束,取消的标记
  1753.   attr_reader   :hit_position                # 图像达到目标时的坐标
  1754.   attr_accessor :hit_anime_id                # 图像达到目标时的动画ID
  1755.   #--------------------------------------------------------------------------
  1756.   # ● 初始化物件
  1757.   #--------------------------------------------------------------------------
  1758.   def initialize(viewport, index, battler)
  1759.     super(viewport)
  1760.     @index = index
  1761.     @battler = battler
  1762.     @position_x = @position_y = 0
  1763.     @o = 0
  1764.     @real_x = @real_y = 0
  1765.     @mirror = @battler.sv.mirror
  1766.     reset
  1767.     set_action
  1768.   end
  1769.   #--------------------------------------------------------------------------
  1770.   # ● 初始化
  1771.   #--------------------------------------------------------------------------
  1772.   def reset
  1773.     @z_plus = 0
  1774.     @weapon_data = []
  1775.     @move_data = []
  1776.     @move_x = 0
  1777.     @move_y = 0
  1778.     @orbit = []
  1779.     @through = false
  1780.     @distanse_move = false
  1781.     @weapon_width = 0
  1782.     @weapon_height = 0
  1783.     @anime_time = 0
  1784.     @anime_position = 1
  1785.     @move_time = 0
  1786.     @hit_anime_id = 0
  1787.     @move_anime = true
  1788.     @action_end = false
  1789.     @action_end_cancel = false
  1790.     reset_position
  1791.   end  
  1792.   #--------------------------------------------------------------------------
  1793.   # ● 动作设置
  1794.   #--------------------------------------------------------------------------
  1795.   def set_action
  1796.     return if @battler.sv.effect_data == []
  1797.     weapon_anime if @battler.sv.effect_data[0][0] == "wp"
  1798.     move_anime if @battler.sv.effect_data[0][0] == "m_a"
  1799.     @battler.sv.effect_data.shift
  1800.   end
  1801.   #--------------------------------------------------------------------------
  1802.   # ● 实行武器动画
  1803.   #--------------------------------------------------------------------------
  1804.   def weapon_anime
  1805.     @weapon_data = @battler.sv.effect_data[0].dup
  1806.     set_graphics
  1807.     set_ox
  1808.     set_weapon_move
  1809.   end
  1810.   #--------------------------------------------------------------------------
  1811.   # ● 实行动画移动
  1812.   #--------------------------------------------------------------------------
  1813.   def move_anime
  1814.     @move_data = @battler.sv.effect_data[0].dup
  1815.     # 取得目标
  1816.     @target_battler = [@battler.sv.m_a_targets.shift]
  1817.     @target_battler = N03.get_targets(@move_data[3], @battler) if @move_data[3] < 0
  1818.     set_move
  1819.     return if @move_data[16] == ""
  1820.     weapon_data = N03::ACTION[@move_data[16]]
  1821.     return if weapon_data == nil
  1822.     @weapon_data = weapon_data.dup
  1823.     set_graphics
  1824.     set_ox
  1825.     set_weapon_move
  1826.   end
  1827.   #--------------------------------------------------------------------------
  1828.   # ● 取得武器图像
  1829.   #--------------------------------------------------------------------------  
  1830.   def set_graphics
  1831.     # 武器不依赖图像设定的情况下
  1832.     if @weapon_data[13] != ""
  1833.       self.bitmap = Cache.character(@weapon_data[13]).dup
  1834.       @weapon_width = self.bitmap.width
  1835.       @weapon_height = self.bitmap.height
  1836.       return
  1837.     end
  1838.     # 取得武器
  1839.     weapon = @battler.weapons[0]
  1840.     # 取得二刀流武器
  1841.     if @weapon_data[10]
  1842.       weapon = nil
  1843.       for armor in @battler.armors do break weapon = armor if armor.is_a?(RPG::Armor) && armor.etype_id == 1 end
  1844.       weapon = @battler.weapons[1] if !weapon
  1845.     end  
  1846.     # 如果没有武器将取消处理
  1847.     return if weapon == nil
  1848.     # 指数取得
  1849.     file_index = @weapon_data[12]
  1850.     # 如果使用图标
  1851.     if @weapon_data[1] == 0
  1852.       icon_index = weapon.icon_index
  1853.       self.bitmap = Cache.system("Iconset" + file_index).dup
  1854.       self.src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1855.       @weapon_width = @weapon_height = 24
  1856.     # 独自图像指定
  1857.     else
  1858.       file_name = @battler.sv.weapon_graphic(weapon.id, weapon.wtype_id) if weapon.is_a?(RPG::Weapon)
  1859.       file_name = @battler.sv.shield_graphic(weapon.id, weapon.atype_id) if weapon.is_a?(RPG::Armor)
  1860.       self.bitmap = Cache.character(file_name + file_index).dup
  1861.       @weapon_width = self.bitmap.width
  1862.       @weapon_height = self.bitmap.height
  1863.       return if @weapon_data[1] == 1
  1864.       # 2003规范的武器动画
  1865.       @weapon_width /= @battler.sv.max_pattern[0]
  1866.     end
  1867.   end
  1868.   #--------------------------------------------------------------------------
  1869.   # ● 取得图像的原点
  1870.   #--------------------------------------------------------------------------  
  1871.   def set_ox
  1872.     # 反转时设置为相反
  1873.     if @mirror
  1874.       case @weapon_data[6]
  1875.       when 1 ; @weapon_data[6] = 2 # 左上→右上角
  1876.       when 2 ; @weapon_data[6] = 1 # 右上→左上角
  1877.       when 3 ; @weapon_data[6] = 4 # 左下→右下角
  1878.       when 4 ; @weapon_data[6] = 3 # 右下→左下角
  1879.       end
  1880.     end
  1881.     # 原点的設定
  1882.     case @weapon_data[6]
  1883.     when 0 # 中心
  1884.       self.ox = @weapon_width / 2
  1885.       self.oy = @weapon_height / 2
  1886.     when 1 # 左上
  1887.       self.ox = 0
  1888.       self.oy = 0
  1889.     when 2 # 右上
  1890.       self.ox = @weapon_width
  1891.       self.oy = 0
  1892.     when 3 # 左下
  1893.       self.ox = 0
  1894.       self.oy = @weapon_height
  1895.     when 4 # 右下
  1896.       self.ox = @weapon_width
  1897.       self.oy = @weapon_height
  1898.     when 5 # 同角色位置
  1899.       self.ox = @weapon_width / 2
  1900.       self.oy = @weapon_height
  1901.     end
  1902.   end  
  1903.   #--------------------------------------------------------------------------
  1904.   # ● 取得角色的坐标
  1905.   #--------------------------------------------------------------------------  
  1906.   def set_battler_position
  1907.     @position_x = @battler.sv.x + @weapon_data[3][0] * N03.mirror_num(@mirror) * 100
  1908.     @position_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust) + @weapon_data[3][1] * 100
  1909.     reset_position
  1910.   end
  1911.   #--------------------------------------------------------------------------
  1912.   # ● 初始化坐标
  1913.   #--------------------------------------------------------------------------  
  1914.   def reset_position
  1915.     @real_x = @position_x / 100
  1916.     @real_y = @position_y / 100
  1917.     @real_zoom_x = 1
  1918.     @real_zoom_y = 1
  1919.   end
  1920.   #--------------------------------------------------------------------------
  1921.   # ● 战斗动画显示
  1922.   #--------------------------------------------------------------------------  
  1923.   def set_animation(anime_id)
  1924.     return if $data_animations[anime_id] == nil
  1925.     @anime_position = $data_animations[anime_id].position
  1926.     @horming = true
  1927.     @horming = false if @anime_position == 3
  1928.     @anime_camera_zoom = true
  1929.     @anime_no_mirror = false
  1930.     start_animation($data_animations[anime_id], @mirror)
  1931.     timings = $data_animations[anime_id].timings
  1932.   end
  1933.   #--------------------------------------------------------------------------
  1934.   # ● 实行打击时的战斗动画
  1935.   #--------------------------------------------------------------------------  
  1936.   def set_hit_animation(position_data, hit_anime_id, target)
  1937.     return if $data_animations[hit_anime_id] == nil
  1938.     @real_x = position_data[0]
  1939.     @real_y = position_data[1]
  1940.     @position_x = position_data[0] * 100
  1941.     @position_y = position_data[1] * 100
  1942.     self.z = position_data[2]
  1943.     @z_plus = 1000
  1944.     @action_end = false
  1945.     @horming = true
  1946.     set_animation(hit_anime_id)
  1947.     @anime_time = $data_animations[hit_anime_id].frame_max * 4
  1948.     @timing_targets = [target]
  1949.     @move_time = @hit_anime_id = 0
  1950.     @weapon_data = []
  1951.   end
  1952.   #--------------------------------------------------------------------------
  1953.   # ● 角色时间追加
  1954.   #--------------------------------------------------------------------------  
  1955.   def timing_battler_set(target)
  1956.     @timing_targets.push(target)
  1957.   end
  1958.   #--------------------------------------------------------------------------
  1959.   # ● 取得武器的移动
  1960.   #--------------------------------------------------------------------------  
  1961.   def set_weapon_move
  1962.     # 取得开始位置
  1963.     set_battler_position if @move_time == 0
  1964.     @z_plus = 50 if @z_plus == 0 && @weapon_data[9]
  1965.     self.z = @battler.sv.z + @z_plus
  1966.     # 反转处理
  1967.     @mirror = !@mirror if @weapon_data[7]
  1968.     self.mirror = @mirror
  1969.     # 更新模式设置
  1970.     set_pattern
  1971.     @max_pattern = 2 if @max_pattern == 1
  1972.     # 计算武器移动
  1973.     @weapon_move_data = []
  1974.     @weapon_angle_data = []
  1975.     @weapon_zoom_data = []
  1976.     num = N03.mirror_num(@mirror)
  1977.     for i in 0...@max_pattern
  1978.       move_data_x = @weapon_data[2][0] * num * 100 * i / (@max_pattern - 1)
  1979.       move_data_y = @weapon_data[2][1] * 100 * i / (@max_pattern - 1)
  1980.       move_angle = @weapon_data[4] * num + (@weapon_data[5] * num - @weapon_data[4] * num) * i / (@max_pattern - 1)
  1981.       move_zoom_x = 1 + (@weapon_data[8][0] - 1) * i / (@max_pattern - 1)
  1982.       move_zoom_y = 1 + (@weapon_data[8][1] - 1) * i / (@max_pattern - 1)
  1983.       @weapon_move_data.push([move_data_x, move_data_y])
  1984.       @weapon_angle_data.push(move_angle)
  1985.       @weapon_zoom_data.push([move_zoom_x, move_zoom_y])
  1986.     end
  1987.   end  
  1988.   #--------------------------------------------------------------------------
  1989.   # ● 更新模式
  1990.   #--------------------------------------------------------------------------
  1991.   def set_pattern
  1992.     if @weapon_data[11] == -1
  1993.       return @max_pattern = @battler.sv.max_pattern[0] if @battler.sv.pattern_type != 0
  1994.       @count = @battler.sv.pattern_time
  1995.       @max_count = @battler.sv.pattern_time
  1996.       @max_pattern = @battler.sv.max_pattern[0]
  1997.       @repeat = false
  1998.     else
  1999.       @count = @weapon_data[11][0]
  2000.       @max_count = @weapon_data[11][0]
  2001.       @max_pattern = @weapon_data[11][1]
  2002.       @repeat = @weapon_data[11][2]
  2003.     end
  2004.     @pattern = 0
  2005.   end
  2006.   #--------------------------------------------------------------------------
  2007.   # ● 实行移动
  2008.   #--------------------------------------------------------------------------
  2009.   def set_move
  2010.     # 取得战斗动画
  2011.     set_animation(@move_data[1][0]) if $data_animations[@move_data[1][0]] != nil && $data_animations[@move_data[1][0]].position != 3
  2012.     @anime_camera_zoom = @move_data[13]
  2013.     @loop = @move_data[14]
  2014.     @loop = false if @move_data[1][0] == 0
  2015.     @anime_no_mirror = @move_data[15]
  2016.     @se_flag = @move_data[17]
  2017.     # 取得开始位置
  2018.     start_position
  2019.     @z_plus = 1000 if @move_data[9]
  2020.     # 目标角色图像的动画的反映SE和时机设定
  2021.     @timing_targets = @target_battler
  2022.     # 计算坐标
  2023.     @move_x = @move_data[5][0] * 100 * N03.mirror_num(@mirror)
  2024.     @move_y = @move_data[5][1] * 100
  2025.     # 计算时间或速度
  2026.     @distanse_move = true if @move_data[6] > 0
  2027.     @move_time = @move_data[6].abs
  2028.     # 时间为0的时、如果被描写成动画显示时间
  2029.     if @move_time == 0
  2030.       @move_time = $data_animations[@move_data[1][0]].frame_max * 4 if $data_animations[@move_data[1][0]]
  2031.       @move_time = 1 if !$data_animations[@move_data[1][0]]
  2032.       @distanse_move = false
  2033.     end
  2034.     # 贯穿类型的场合
  2035.     @through = true if @move_data[7] == 1
  2036.     @auto_through_flag = false
  2037.     @auto_through_flag = true if @move_data[7] == 0
  2038.     # 计算目标坐标
  2039.     if @target_battler == nil
  2040.       @target_x = @move_x * 100
  2041.       @target_x = (Graphics.width - @move_x) * 100 if @mirror
  2042.       @target_y = @move_y * 100
  2043.     else
  2044.       move_data_set
  2045.     end
  2046.     # 计算目标达到的时间
  2047.     @move_time = distanse_calculation(@move_time, @target_x, @target_y)
  2048.     # 计算圆形轨道
  2049.     orbit
  2050.     # 角色的体能设定
  2051.     @battler.sv.wait = @move_time - 1 if @move_data[10][0]
  2052.     @move_horming = @move_data[12]
  2053.   end  
  2054.   #--------------------------------------------------------------------------
  2055.   # ● 速度转换时间
  2056.   #--------------------------------------------------------------------------
  2057.   def distanse_calculation(time, target_x, target_y)
  2058.     return time if !@distanse_move
  2059.     distanse_x = @position_x - @target_x
  2060.     distanse_x = @target_x - @position_x if @target_x > @position_x
  2061.     distanse_y = @position_y - @target_y
  2062.     distanse_y = @target_y - @position_y if @target_y > @position_y
  2063.     distanse = [distanse_x, distanse_y].max
  2064.     return distanse / (time * 100) + 1
  2065.   end
  2066.   #--------------------------------------------------------------------------
  2067.   # ● 更新移动目标
  2068.   #--------------------------------------------------------------------------
  2069.   def move_data_set
  2070.     return if @target_battler == nil
  2071.     position = N03.get_targets_position(@target_battler, true, @anime_position)
  2072.     @target_x = position[0] + @move_x
  2073.     @target_y = position[1] - position[2] + @move_y
  2074.   end
  2075.   #--------------------------------------------------------------------------
  2076.   # ● 计算开始位置
  2077.   #--------------------------------------------------------------------------
  2078.   def start_position
  2079.     starter = [@battler.sv.m_a_starter.shift]
  2080.     starter = N03.get_targets(@move_data[2], @battler) if @move_data[2] < 0
  2081.     position = [0, 0]
  2082.     position = N03.get_targets_position(starter, true, @anime_position) if starter != nil
  2083.     @position_x = position[0] + @move_data[4][0] * 100
  2084.     @position_y = position[1] + position[2] + @move_data[4][1] * 100
  2085.     @position_z = @position_y
  2086.   end  
  2087.   #--------------------------------------------------------------------------
  2088.   # ● 计算原型轨道
  2089.   #--------------------------------------------------------------------------
  2090.   def orbit
  2091.     orbit_data = @move_data[8].dup
  2092.     orbit_data[0] *= 100
  2093.     orbit_data[1] *= 100
  2094.     orbit_d = []
  2095.     for i in 0...@move_time / 2
  2096.       @orbit[i] = orbit_data[0]
  2097.       orbit_data[0] /= 2
  2098.       orbit_d[i] = orbit_data[1]
  2099.       orbit_data[1] /= 2
  2100.     end
  2101.     @orbit = @orbit + orbit_d.reverse!
  2102.     @orbit.reverse!
  2103.   end  
  2104.   #--------------------------------------------------------------------------
  2105.   # ● 更新框架
  2106.   #--------------------------------------------------------------------------
  2107.   def update
  2108.     update_hit_anime if @anime_time != 0
  2109.     update_move if @move_time != 0
  2110.     update_weapon_move if @weapon_data != []
  2111.     update_position
  2112.     update_color
  2113.     self.visible = @battler.sv.weapon_visible
  2114.     super
  2115.   end
  2116.   #--------------------------------------------------------------------------
  2117.   # ● 打击时的战斗动画
  2118.   #--------------------------------------------------------------------------
  2119.   def update_hit_anime
  2120.     @anime_time -= 1
  2121.     @action_end = true if @anime_time == 0
  2122.   end
  2123.   #--------------------------------------------------------------------------
  2124.   # ● 更新移动
  2125.   #--------------------------------------------------------------------------
  2126.   def update_move
  2127.     move_data_set if @move_horming && !@hit_position
  2128.     through_set(@move_time, @target_x, @target_y) if @move_time == 1 && !@hit_position
  2129.     @o += @orbit[@move_time - 1] if @orbit[@move_time - 1] != nil
  2130.     @position_x = (@position_x * (@move_time - 1) + @target_x) / @move_time
  2131.     @position_y = (@position_y * (@move_time - 1) + @target_y) / @move_time + @o
  2132.     reset_position
  2133.     set_animation(@move_data[1][0]) if @loop && !animation?
  2134.     @move_time -= 1
  2135.     return if @move_time != 0
  2136.     @action_end = true if !@action_end_cancel
  2137.   end
  2138.   #--------------------------------------------------------------------------
  2139.   # ● 更新武器的移动
  2140.   #--------------------------------------------------------------------------
  2141.   def update_weapon_move
  2142.     pattern = update_pattern
  2143.     set_battler_position if @move_time == 0 && !@action_end_cancel
  2144.     @real_x = @position_x / 100 + @weapon_move_data[pattern][0] / 100
  2145.     @real_y = @position_y / 100 + @weapon_move_data[pattern][1] / 100
  2146.     @real_zoom_x = @weapon_zoom_data[pattern][0]
  2147.     @real_zoom_y = @weapon_zoom_data[pattern][1]
  2148.     self.angle = @weapon_angle_data[pattern]
  2149.     self.src_rect.set(@weapon_width * pattern, 0, @weapon_width, @weapon_height) if @weapon_data[1] == 2
  2150.   end
  2151.   #--------------------------------------------------------------------------
  2152.   # ● 更新模式
  2153.   #--------------------------------------------------------------------------
  2154.   def update_pattern
  2155.     return @battler.sv.pattern_w if @count == nil
  2156.     @count -= 1
  2157.     return @pattern if @count != 0
  2158.     @count = @max_count
  2159.     @pattern += 1
  2160.     if !@repeat && @pattern == @max_pattern
  2161.       @pattern = @max_pattern - 1
  2162.     elsif @pattern == @max_pattern
  2163.       @pattern = 0
  2164.     end
  2165.     return @pattern
  2166.   end
  2167.   #--------------------------------------------------------------------------
  2168.   # ● 更新坐标
  2169.   #--------------------------------------------------------------------------
  2170.   def update_position
  2171.     self.x = (@real_x - $sv_camera.x) * $sv_camera.convert / 1000
  2172.     self.y = (@real_y - $sv_camera.y) * $sv_camera.convert / 1000
  2173.     self.x += $sv_camera.sx / 100 unless @battler.sv.h != 0 && @weapon_data != []
  2174.     self.y += $sv_camera.sy / 100 unless @battler.sv.h != 0 && @weapon_data != []
  2175.     self.z = @battler.sv.z + @z_plus - 10
  2176.     self.zoom_x = @real_zoom_x * $sv_camera.zoom
  2177.     self.zoom_y = @real_zoom_y * $sv_camera.zoom
  2178.     self.opacity = @battler.sv.opacity if @battler.sv.opacity_data[4]
  2179.   end
  2180.   #--------------------------------------------------------------------------
  2181.   # ● 贯穿的处理
  2182.   #--------------------------------------------------------------------------
  2183.   def through_set(time, target_x, target_y)
  2184.     @hit_anime_id = N03.get_attack_anime_id(@move_data[1][1], @battler)
  2185.     @battler.sv.wait = N03.get_anime_time(@hit_anime_id) if @move_data[10][1]
  2186.     moving_x = (target_x / 100 - @position_x / 100) / time
  2187.     moving_y = (target_y / 100 - @position_y / 100) / time
  2188.     goal_x = $sv_camera.max_left - 100 if moving_x < 0
  2189.     goal_x = Graphics.width + $sv_camera.max_right + 100 if moving_x > 0
  2190.     goal_y = $sv_camera.max_top - 100 if moving_y < 0
  2191.     goal_y = Graphics.height + $sv_camera.max_bottom + 100 if moving_y > 0
  2192.     if goal_x == nil &&  goal_y == nil
  2193.       time = 0
  2194.       reset_position
  2195.     else
  2196.       time = move_calculation(moving_x, moving_y, goal_x, goal_y)
  2197.     end
  2198.     target_x = @position_x + moving_x * time * 100
  2199.     target_y = @position_y + moving_y * time * 100
  2200.     @pre_data = [time, target_x, target_y]
  2201.     @battler.sv.m_a_data.push([@move_data[11], @target_battler, @index, @auto_through_flag, []])
  2202.     @action_end_cancel = true
  2203.     @hit_position = [@real_x, @real_y, self.z]
  2204.   end  
  2205.   #--------------------------------------------------------------------------
  2206.   # ● 达到时间预算
  2207.   #--------------------------------------------------------------------------
  2208.   def move_calculation(moving_x, moving_y, goal_x, goal_y)
  2209.     move_x = @position_x / 100
  2210.     move_y = @position_y / 100
  2211.     time = 0
  2212.     loop do
  2213.       move_x += moving_x
  2214.       move_y += moving_y
  2215.       time += 1
  2216.       return time if moving_x < 0 && move_x < goal_x
  2217.       return time if moving_x > 0 && move_x > goal_x
  2218.       return time if moving_y < 0 && move_y < goal_y
  2219.       return time if moving_y > 0 && move_y > goal_y
  2220.     end
  2221.   end   
  2222.   #--------------------------------------------------------------------------
  2223.   # ● 错误时从处理消失转换成贯穿处理
  2224.   #--------------------------------------------------------------------------
  2225.   def through_change
  2226.     @action_end_cancel = false
  2227.     @through = true
  2228.     @move_time = @pre_data[0]
  2229.     @target_x = @pre_data[1]
  2230.     @target_y = @pre_data[2]
  2231.     @pre_data = nil
  2232.   end  
  2233.   #--------------------------------------------------------------------------
  2234.   # ● SE 闪光灯和处理的时间
  2235.   #--------------------------------------------------------------------------
  2236.   def animation_process_timing(timing)
  2237.     return if !@timing_targets
  2238.     se_flag = true
  2239.     se_flag = @se_flag if @se_flag != nil
  2240.     for target in @timing_targets
  2241.       target.sv.timing.push([se_flag, timing.dup])
  2242.       se_flag = false if @animation.position == 3
  2243.     end  
  2244.   end
  2245.   #--------------------------------------------------------------------------
  2246.   # ● 更新色调
  2247.   #--------------------------------------------------------------------------
  2248.   def update_color
  2249.     return if @battler.sv.color == []
  2250.     self.color.set(@battler.sv.color[0], @battler.sv.color[1], @battler.sv.color[2], @battler.sv.color[3])
  2251.   end
  2252.   #--------------------------------------------------------------------------
  2253.   # ● 释放
  2254.   #--------------------------------------------------------------------------
  2255.   def dispose
  2256.     super
  2257.     self.bitmap.dispose if self.bitmap != nil
  2258.   end
  2259. end
  2260.  
  2261. #==============================================================================
  2262. # ■ Sprite_Battle_Picture
  2263. #------------------------------------------------------------------------------
  2264. #  这是一个画面的图象显示。
  2265. #==============================================================================
  2266. class Sprite_Battle_Picture < Sprite
  2267.   #--------------------------------------------------------------------------
  2268.   # ● 公开实例变量
  2269.   #--------------------------------------------------------------------------
  2270.   attr_accessor   :action_end           # 结束标记
  2271.   #--------------------------------------------------------------------------
  2272.   # ● 初始化物件
  2273.   #--------------------------------------------------------------------------
  2274.   def initialize(viewport = nil)
  2275.     super(viewport)
  2276.     @action_end = false
  2277.     self.ox = 0
  2278.   end
  2279.   #--------------------------------------------------------------------------
  2280.   # ● 集合
  2281.   #--------------------------------------------------------------------------
  2282.   def set(battler)
  2283.     @battler = battler
  2284.     @data = @battler.sv.effect_data.shift
  2285.     @time = @data[4]
  2286.     @mirror = $sv_camera.mirror
  2287.     @mirror = false if !@data[8]
  2288.     self.opacity = @data[6][0]
  2289.     @s_x = @data[2][0] if @data[2] != []
  2290.     @s_x = Graphics.width - @data[2][0]  if @data[2] != [] && @mirror
  2291.     @s_y = @data[2][1] if @data[2] != []
  2292.     @e_x = @data[3][0] if @data[3] != []
  2293.     @e_x = Graphics.width - @data[3][0] if @data[3] != [] && @mirror
  2294.     @e_y = @data[3][1] if @data[3] != []
  2295.     @s_x = self.x if @data[2] == []
  2296.     @s_y = self.y if @data[2] == []
  2297.     @e_x = self.x if @data[3] == []
  2298.     @e_y = self.y if @data[3] == []
  2299.     self.x = @s_x
  2300.     self.y = @s_y
  2301.     return @action_end = true if @time == 0
  2302.     @move_x = (@e_x * 1.0 - @s_x) / @time
  2303.     @move_y = (@e_y * 1.0 - @s_y) / @time
  2304.     self.z = @data[5]
  2305.     return set_plane(battler) if @data[7] != []
  2306.     self.bitmap = Cache.picture(@data[9]) if !bitmap or @data[9] != ""
  2307.     return @action_end = true if !bitmap
  2308.     self.mirror = @mirror
  2309.     self.ox = self.bitmap.width if @mirror
  2310.   end
  2311.   #--------------------------------------------------------------------------
  2312.   # ● 过渡平面
  2313.   #--------------------------------------------------------------------------
  2314.   def set_plane(battler)
  2315.     @viewport = Viewport.new(@data[2][0],@data[2][1],@data[7][0],@data[7][1]) if !@viewport
  2316.     viewport = @viewport
  2317.     @plane = Plane.new(viewport) if !@plane
  2318.     @plane.bitmap = Cache.picture(@data[9]) if !@plane.bitmap or @data[9] != ""
  2319.     return @action_end = true if !@plane.bitmap
  2320.     @plane.ox = @data[7][0]
  2321.     @plane.oy = @data[7][1]
  2322.     @plane.opacity = @data[6][0]
  2323.     @move_x = @remain_move[0] if @data[2] == @data[3]
  2324.     @move_y = @remain_move[1] if @data[2] == @data[3]
  2325.     @remain_move = [@move_x, @move_y]
  2326.   end
  2327.   #--------------------------------------------------------------------------
  2328.   # ● 更新帧数
  2329.   #--------------------------------------------------------------------------
  2330.   def update
  2331.     @action_end = true if !@battler.sv.picture
  2332.     return if @time == 0
  2333.     return if @action_end
  2334.     @time -= 1
  2335.     return plane_update if @plane
  2336.     super
  2337.     self.x += @move_x
  2338.     self.y += @move_y
  2339.     self.opacity += @data[6][1]
  2340.     return if @time != 1
  2341.     self.x = @e_x
  2342.     self.y = @e_y
  2343.     @time = 0
  2344.   end
  2345.   #--------------------------------------------------------------------------
  2346.   # ● 更新平面
  2347.   #--------------------------------------------------------------------------
  2348.   def plane_update
  2349.     @plane.ox += @move_x
  2350.     @plane.oy += @move_y
  2351.     @plane.opacity += @data[6][1]
  2352.     @time = @data[4] if @time == 0
  2353.   end
  2354.   #--------------------------------------------------------------------------
  2355.   # ● 释放
  2356.   #--------------------------------------------------------------------------
  2357.   def dispose
  2358.     bitmap.dispose if bitmap
  2359.     @plane.dispose if @plane
  2360.     @viewport.dispose if @viewport
  2361.     super
  2362.   end
  2363. end
  2364.  
  2365. #==============================================================================
  2366. # ■ Sprite_Back_Picture
  2367. #------------------------------------------------------------------------------
  2368. #  这是一个精灵的一段画面。
  2369. #==============================================================================
  2370. class Sprite_Back_Picture < Plane
  2371.   #--------------------------------------------------------------------------
  2372.   # ● 公开实例变量 
  2373.   #--------------------------------------------------------------------------
  2374.   attr_accessor   :action_end           # 结束标记
  2375.   #--------------------------------------------------------------------------
  2376.   # ● 初始化物件
  2377.   #--------------------------------------------------------------------------
  2378.   def initialize(viewport = nil, index)
  2379.     super(viewport)
  2380.     @index = index
  2381.     @real_x = 0
  2382.     @real_y = 0
  2383.     @real_opacity = 0
  2384.     @move_x = 0
  2385.     @move_y = 0
  2386.     @move_opacity = 0
  2387.     @time = 0
  2388.     @switche = 0
  2389.     @action_end = false
  2390.   end
  2391.   #--------------------------------------------------------------------------
  2392.   # ● 格局
  2393.   #--------------------------------------------------------------------------
  2394.   def setup(data)
  2395.     self.bitmap = Cache.picture(data[9])
  2396.     self.z = data[6]
  2397.     @switche = data[1]
  2398.     mirror = $sv_camera.mirror
  2399.     mirror = false if !data[8]
  2400.     @move_x = data[3][0]
  2401.     @move_x *= -1 if mirror
  2402.     @move_y = data[3][1]
  2403.     @time = data[4]
  2404.     @time = -1 if @time == 0
  2405.     @real_opacity = (data[5][0] + 1) * 100
  2406.     @move_opacity = data[5][1]
  2407.     @start_opacity = data[5][0]
  2408.     @shake_ok = data[7]
  2409.   end
  2410.   #--------------------------------------------------------------------------
  2411.   # ● 更新帧数
  2412.   #--------------------------------------------------------------------------
  2413.   def update
  2414.     update_picture if @time != 0
  2415.     self.ox = $sv_camera.x - @real_x
  2416.     self.oy = $sv_camera.y - @real_y
  2417.     if @shake_ok
  2418.       self.ox -= $sv_camera.sx / 100
  2419.       self.oy -= $sv_camera.sy / 100
  2420.     end
  2421.     self.ox *= $sv_camera.zoom
  2422.     self.oy *= $sv_camera.zoom
  2423.     self.zoom_x = @zoom_x * $sv_camera.zoom
  2424.     self.zoom_y = @zoom_y * $sv_camera.zoom
  2425.     self.opacity = @real_opacity / 100
  2426.     @move_opacity *= -1 if self.opacity == 255 or self.opacity <= @start_opacity
  2427.     @switche
  2428.     @action_end = true if @switche > 0 && !$game_switches[@switche]
  2429.     @action_end = true if @switche < 0 && !$sv_camera.switches[@switche.abs]
  2430.   end
  2431.   #--------------------------------------------------------------------------
  2432.   # ● 更新图片
  2433.   #--------------------------------------------------------------------------
  2434.   def update_picture
  2435.     @real_x += @move_x / 100
  2436.     @real_y += @move_y / 100
  2437.     @real_x = 0 if @real_x >= self.bitmap.width or @real_x <= -self.bitmap.width
  2438.     @real_y = 0 if @real_y >= self.bitmap.height or @real_y <= -self.bitmap.height
  2439.     @zoom_x = 1
  2440.     @zoom_y = 1
  2441.     @real_opacity += @move_opacity
  2442.     @time -= 1
  2443.     @time = -1 if @time < -100
  2444.   end
  2445. end
  2446.  
  2447. #==============================================================================
  2448. # ■ Sprite_Back_Picture
  2449. #------------------------------------------------------------------------------
  2450. #  这是一个精灵的伤害显示。
  2451. #==============================================================================
  2452. class Sprite_Damage < Sprite
  2453.   #--------------------------------------------------------------------------
  2454.   # ● 公开实例变量 
  2455.   #--------------------------------------------------------------------------
  2456.   attr_reader   :action_end                  # POP结束标记
  2457.   #--------------------------------------------------------------------------
  2458.   # ● 初始化物件
  2459.   #--------------------------------------------------------------------------
  2460.   def initialize(viewport = nil, battler)
  2461.     super(viewport)
  2462.     @battler = battler
  2463.     @time = 0
  2464.     return @action_end = true if !@battler
  2465.     @direction = -1
  2466.     @direction *= -1 if @battler.actor?
  2467.     @direction *= -1 if $sv_camera.mirror
  2468.     set_state
  2469.     set_damage
  2470.     update
  2471.   end
  2472.   #--------------------------------------------------------------------------
  2473.   # ● 显示状态
  2474.   #--------------------------------------------------------------------------
  2475.   def set_state
  2476.     return if !N03::STATE_POP
  2477.     states = @battler.result.added_state_objects
  2478.     states.delete($data_states[@battler.death_state_id]) if @battler.result.hp_damage != 0
  2479.     return if states == []
  2480.     return if @battler.sv.add_state == @battler.result.added_state_objects
  2481.     @battler.sv.add_state = states.dup
  2482.     @st = []
  2483.     @st_base = []
  2484.     for i in 0...states.size
  2485.       @st[i] = Sprite.new
  2486.       bitmap_state(@st[i], states[i])
  2487.       @st_base[i] = []
  2488.       @st_base[i][0] = @direction * (-20 + 5 * i) + @battler.sv.x / 100
  2489.       @st_base[i][1] = -40 - @state_height * i + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100
  2490.       @st[i].z = 1000 + i
  2491.       @st[i].opacity = 0
  2492.     end
  2493.     @time = @pop_time = 80
  2494.   end   
  2495.   #--------------------------------------------------------------------------
  2496.   # ● 状态图像
  2497.   #--------------------------------------------------------------------------
  2498.   def bitmap_state(state, state_object)
  2499.     name = state_object.name
  2500.     state.bitmap = Cache.system("Iconset").dup
  2501.     state.src_rect.set(state_object.icon_index % 16 * 24, state_object.icon_index / 16 * 24, 24, 24)
  2502.     @state_height = 24
  2503.   end
  2504.   #--------------------------------------------------------------------------
  2505.   # ● 显示打击伤害
  2506.   #--------------------------------------------------------------------------
  2507.   def hit_count
  2508.     for i in [email]0...@battler.sv.hit.size[/email]
  2509.       if @battler.sv.hit[i] == nil
  2510.         @hit = i
  2511.         return @battler.sv.hit[i] = @hit
  2512.       end
  2513.     end
  2514.     @hit = @battler.sv.hit.size
  2515.     @battler.sv.hit.push(@hit)
  2516.   end  
  2517.   #--------------------------------------------------------------------------
  2518.   # ● 显示伤害
  2519.   #--------------------------------------------------------------------------
  2520.   def set_damage
  2521.     return @action_end = true if !N03::DAMAGE_POP
  2522.     damage = @battler.result.hp_damage if @battler.result.hp_damage != 0
  2523.     damage = @battler.result.hp_drain  if @battler.result.hp_drain  != 0
  2524.     damage = @battler.result.mp_damage if @battler.result.mp_damage != 0
  2525.     damage = @battler.result.mp_drain  if @battler.result.mp_drain  != 0
  2526.     damage = @battler.result.tp_damage if @battler.result.tp_damage != 0
  2527.     if !damage or damage == 0
  2528.       @action_end = true if @st == nil
  2529.       return # 状态POP考虑设置@action_end不返回
  2530.     end
  2531.     hit_count
  2532.     # @hit = @battler.sv.hit
  2533.     # @battler.sv.hit += 1 if damage != 0
  2534.     file = N03::DAMAGE_PLUS if damage > 0
  2535.     file = N03::DAMAGE_MINUS if damage < 0
  2536.     add_file = N03::DAMAGE_MP if @battler.result.mp_damage != 0
  2537.     add_file = N03::DAMAGE_TP if @battler.result.tp_damage != 0
  2538.     adjust_x = N03::DAMAGE_ADJUST
  2539.     @num = []
  2540.     @num_base = []
  2541.     damage = damage.abs
  2542.     max_num = damage.to_s.size
  2543.     max_num += 1 if add_file != nil
  2544.     for i in 0...max_num
  2545.       @num[i] = Sprite.new
  2546.       if add_file != nil && i == max_num - 1
  2547.         @num[i].bitmap = Cache.system(add_file)
  2548.         cw = (damage % (10 * 10 ** i))/(10 ** i)
  2549.         sw = 0 if sw == nil
  2550.       else
  2551.         @num[i].bitmap = Cache.system(file)
  2552.         cw = (damage % (10 * 10 ** i))/(10 ** i)
  2553.         sw = @num[i].bitmap.width / 10
  2554.         @num[i].src_rect.set(cw * sw, 0, sw, @num[i].bitmap.height)
  2555.       end
  2556.       @num_base[i] = []
  2557.       @num_base[i][0] = (sw + adjust_x) * i * -1 + (@battler.sv.x / 100)
  2558.       @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
  2559.       @num_base[i][0] -= @num[i].bitmap.width / 2 - adjust_x if add_file != nil && i == max_num - 1
  2560.       @num[i].z = 1000 + i + @hit * 10
  2561.     end
  2562.     @time = @pop_time = 80
  2563.   end
  2564.   #--------------------------------------------------------------------------
  2565.   # ● 更新帧数
  2566.   #--------------------------------------------------------------------------
  2567.   def update
  2568.     return if @time == 0
  2569.     for i in [email]0...@st.size[/email] do update_state_move(@st[i], i) end if @st != nil
  2570.     for i in [email]0...@num.size[/email] do update_num_move(@num[i], i) end if @num != nil
  2571.     @time -= 1
  2572.     @action_end = true if @time == 0
  2573.   end
  2574.   #--------------------------------------------------------------------------
  2575.   # ● 更新状态图像
  2576.   #--------------------------------------------------------------------------
  2577.   def update_state_move(state, index)
  2578.     min = @pop_time - index * 2
  2579.     case @time
  2580.     when min-15..min
  2581.       @st_base[index][0] += @direction
  2582.       state.opacity += 25
  2583.     when min-80..min-50
  2584.       @st_base[index][0] += @direction
  2585.       state.opacity -= 25
  2586.     end
  2587.     state.x = (@st_base[index][0] - $sv_camera.x) * $sv_camera.zoom
  2588.     state.y = (@st_base[index][1] - $sv_camera.y) * $sv_camera.zoom
  2589.   end
  2590.   #--------------------------------------------------------------------------
  2591.   # ● 更新数值
  2592.   #--------------------------------------------------------------------------
  2593.   def update_num_move(num, index)
  2594.     min = @pop_time - index * 2
  2595.     case @time
  2596.     when min-1..min
  2597.       @num_base[index][0] += @direction * @hit
  2598.       @num_base[index][1] -= 5 + @hit * 2
  2599.     when min-3..min-2
  2600.       @num_base[index][0] += @direction * @hit
  2601.       @num_base[index][1] -= 4 + @hit * 2
  2602.     when min-6..min-4
  2603.       @num_base[index][0] += @direction
  2604.       @num_base[index][1] -= 3 + @hit * 2
  2605.     when min-14..min-7
  2606.       @num_base[index][0] += @direction
  2607.       @num_base[index][1] += 2
  2608.     when min-17..min-15
  2609.       @num_base[index][1] -= 2 + @hit * 2
  2610.     when min-23..min-18
  2611.       @num_base[index][1] += 1
  2612.     when min-27..min-24
  2613.       @num_base[index][1] -= 1
  2614.     when min-30..min-28
  2615.       @num_base[index][1] += 1
  2616.     when min-33..min-31
  2617.       @num_base[index][1] -= 1
  2618.     when min-36..min-34
  2619.       @num_base[index][1] += 1
  2620.     end
  2621.     num.x = (@num_base[index][0] - $sv_camera.x) * $sv_camera.zoom
  2622.     num.y = (@num_base[index][1] - $sv_camera.y) * $sv_camera.zoom
  2623.     num.opacity = 256 - (12 - @time) * 32
  2624.     num.visible = false if @time == 0
  2625.   end
  2626.   #--------------------------------------------------------------------------
  2627.   # ● 释放
  2628.   #--------------------------------------------------------------------------
  2629.   def dispose
  2630.     @battler.sv.hit[@hit] = nil if @hit
  2631.     bitmap.dispose if bitmap
  2632.     for i in [email]0...@num.size[/email] do @num[i].dispose end if @num != nil
  2633.     for i in [email]0...@st.size[/email] do @st[i].dispose end if @st != nil
  2634.     super
  2635.   end
  2636. end
  2637.  
  2638. #==============================================================================
  2639. # ■ Window_Skill_name
  2640. #------------------------------------------------------------------------------
  2641. #  这是一个显示技能名字的窗口。
  2642. #==============================================================================
  2643. class Window_Skill_name < Window_Base
  2644.   #--------------------------------------------------------------------------
  2645.   # ● 初始化物件
  2646.   #--------------------------------------------------------------------------
  2647.   def initialize(text)
  2648.     super(0, 0, Graphics.width, line_height + standard_padding * 2)
  2649.     draw_text(4, 0, Graphics.width - 64, line_height,text, 1)
  2650.   end
  2651. end
  2652.  
  2653. #==============================================================================
  2654. # ■ Spriteset_Sideview
  2655. #------------------------------------------------------------------------------
  2656. #  处理战斗画面的精灵的类。本类在横版战斗类的內定使用。
  2657. #==============================================================================
  2658. class Spriteset_Sideview
  2659.   #--------------------------------------------------------------------------
  2660.   # ● 初始化物件
  2661.   #--------------------------------------------------------------------------
  2662.   def initialize(viewport)
  2663.     @viewport = viewport
  2664.     @weapons = []
  2665.     @pictures = []
  2666.     @back_pic = []
  2667.     @damage = []
  2668.     $sv_camera.setup
  2669.     N03.camera(nil, N03::BATTLE_CAMERA["ターン開始前"].dup)
  2670.   end
  2671.   #--------------------------------------------------------------------------
  2672.   # ● 更新帧数
  2673.   #--------------------------------------------------------------------------
  2674.   def update
  2675.     update_battler_data
  2676.     update_damage
  2677.     update_pictures
  2678.     update_back_pic
  2679.     update_weapons
  2680.   end  
  2681.   #--------------------------------------------------------------------------
  2682.   # ● 更新角色数据
  2683.   #--------------------------------------------------------------------------
  2684.   def update_battler_data
  2685.     for battler in $game_party.battle_members + $game_troop.members
  2686.       weapon_end(battler) if battler.sv.weapon_end
  2687.       next if battler.sv.effect_data == []
  2688.       for effect_data in battler.sv.effect_data do set_effects(battler, effect_data) end
  2689.     end
  2690.   end
  2691.   #--------------------------------------------------------------------------
  2692.   # ● 更新伤害图像
  2693.   #--------------------------------------------------------------------------
  2694.   def update_damage
  2695.     for i in [email]0...@damage.size[/email]
  2696.       next if @damage[i] == nil
  2697.       @damage[i].update if @damage[i] != nil
  2698.       next if !@damage[i].action_end
  2699.       @damage[i].dispose
  2700.       @damage[i] = nil
  2701.     end
  2702.   end
  2703.   #--------------------------------------------------------------------------
  2704.   # ● 更新图片动作
  2705.   #--------------------------------------------------------------------------
  2706.   def update_pictures
  2707.     for i in [email]0...@pictures.size[/email]
  2708.       next if @pictures[i] == nil
  2709.       @pictures[i].update if @pictures[i] != nil
  2710.       next if !@pictures[i].action_end
  2711.       @pictures[i].dispose
  2712.       @pictures[i] = nil
  2713.     end
  2714.   end
  2715.   #--------------------------------------------------------------------------
  2716.   # ● 更新期间图片
  2717.   #--------------------------------------------------------------------------
  2718.   def update_back_pic
  2719.     set_back_pic if $sv_camera.program_picture != []
  2720.     for i in [email]0...@back_pic.size[/email]
  2721.       next if @back_pic[i] == nil
  2722.       @back_pic[i].update if @back_pic[i] != nil
  2723.       next if !@back_pic[i].action_end
  2724.       @back_pic[i].dispose
  2725.       @back_pic[i] = nil
  2726.     end
  2727.   end
  2728.   #--------------------------------------------------------------------------
  2729.   # ● 更新武器动作
  2730.   #--------------------------------------------------------------------------
  2731.   def update_weapons
  2732.     for i in [email]0...@weapons.size[/email]
  2733.       next if @weapons[i] == nil
  2734.       @weapons[i].update if @weapons[i] != nil
  2735.       next if !@weapons[i].action_end
  2736.       @weapons[i].dispose
  2737.       @weapons[i] = nil
  2738.     end
  2739.   end
  2740.   #--------------------------------------------------------------------------
  2741.   # ● 实行伤害
  2742.   #--------------------------------------------------------------------------
  2743.   def set_damage_pop(target)
  2744.     for i in [email]0...@damage.size[/email]
  2745.       next if @damage[i] != nil
  2746.       return @damage[i] = Sprite_Damage.new(@viewport, target)
  2747.     end
  2748.     @damage.push(Sprite_Damage.new(@viewport, target))
  2749.   end
  2750.   #--------------------------------------------------------------------------
  2751.   # ● 实行期间图片
  2752.   #--------------------------------------------------------------------------
  2753.   def set_back_pic
  2754.     for data in $sv_camera.program_picture
  2755.       if @back_pic[data[2]] != nil
  2756.         @back_pic[data[2]].dispose
  2757.         @back_pic[data[2]] = nil
  2758.       end
  2759.       @back_pic[data[2]] = Sprite_Back_Picture.new(@viewport, data[2])
  2760.       @back_pic[data[2]].setup(data)
  2761.     end
  2762.     $sv_camera.program_picture = []
  2763.   end
  2764.   #--------------------------------------------------------------------------
  2765.   # ● 开始效果
  2766.   #--------------------------------------------------------------------------
  2767.   def set_effects(battler, effect_data)
  2768.     case effect_data[0]
  2769.     when "pic" ; set_pictures(battler, effect_data)
  2770.     when  "wp" ; set_weapons(battler,  true)
  2771.     when "m_a" ; set_weapons(battler, false)
  2772.     end
  2773.   end
  2774.   #--------------------------------------------------------------------------
  2775.   # ● 实行图片动作
  2776.   #--------------------------------------------------------------------------
  2777.   def set_pictures(battler, effect_data)
  2778.     @pictures[effect_data[1]] = Sprite_Battle_Picture.new if @pictures[effect_data[1]] == nil
  2779.     @pictures[effect_data[1]].set(battler)
  2780.   end
  2781.   #--------------------------------------------------------------------------
  2782.   # ● 实行武器动作
  2783.   #--------------------------------------------------------------------------
  2784.   def set_weapons(battler, weapon_flag, test = true)
  2785.     for i in [email]0...@weapons.size[/email]
  2786.       next if @weapons[i] != nil
  2787.       @weapons[i] = Sprite_Weapon.new(@viewport, i, battler)
  2788.       battler.sv.weapon_index.push(i) if weapon_flag
  2789.       return i
  2790.     end
  2791.     @weapons.push(Sprite_Weapon.new(@viewport, @weapons.size, battler))
  2792.     battler.sv.weapon_index.push(@weapons.size - 1) if weapon_flag
  2793.     return @weapons.size - 1
  2794.   end
  2795.   #--------------------------------------------------------------------------
  2796.   # ● 角色的武器动作结束
  2797.   #--------------------------------------------------------------------------
  2798.   def weapon_end(battler)
  2799.     battler.sv.weapon_end = false
  2800.     for index in battler.sv.weapon_index
  2801.       weapon_index = battler.sv.weapon_index.shift
  2802.       @weapons[weapon_index].dispose if @weapons[weapon_index] != nil
  2803.       @weapons[weapon_index] = nil
  2804.     end
  2805.     battler.sv.weapon_index.compact!
  2806.   end  
  2807.   #--------------------------------------------------------------------------
  2808.   # ● 实行打击時的战斗动画
  2809.   #--------------------------------------------------------------------------
  2810.   def set_hit_animation(battler, weapon_index, hit_targets, miss)
  2811.     weapon = @weapons[weapon_index]
  2812.     for target in hit_targets
  2813.       next @weapons[@hit_index].timing_battler_set(target) if @hit_index != nil
  2814.       @hit_index = set_weapons(battler, false, false)
  2815.       @weapons[@hit_index].set_hit_animation(weapon.hit_position, weapon.hit_anime_id, target)
  2816.     end
  2817.     @hit_index = nil
  2818.     if !weapon.through && !miss
  2819.       @weapons[weapon_index].dispose
  2820.       @weapons[weapon_index] = nil
  2821.     else
  2822.       @weapons[weapon_index].through_change
  2823.     end
  2824.   end
  2825.   #--------------------------------------------------------------------------
  2826.   # ● 初始化侧视图数据
  2827.   #--------------------------------------------------------------------------
  2828.   def reset_sideview
  2829.     $sv_camera.reset
  2830.     for member in $game_troop.members + $game_party.battle_members do member.sv.reset end
  2831.   end  
  2832.   #--------------------------------------------------------------------------
  2833.   # ● 释放
  2834.   #--------------------------------------------------------------------------
  2835.   def dispose
  2836.     dispose_effects(@weapons)
  2837.     dispose_effects(@pictures)
  2838.     dispose_effects(@back_pic)
  2839.     dispose_effects(@damage)
  2840.     reset_sideview
  2841.   end
  2842.   #--------------------------------------------------------------------------
  2843.   # ● 释放图像效果
  2844.   #--------------------------------------------------------------------------
  2845.   def dispose_effects(effects)
  2846.     for i in 0...effects.size
  2847.       effects[i].dispose if effects[i] != nil
  2848.       effects[i] = nil
  2849.     end
  2850.   end
  2851. end
  2852.  
  2853.  
  2854. #==============================================================================
  2855. # ■ Sprite_Battle_Back
  2856. #------------------------------------------------------------------------------
  2857. #  战斗背景用的精灵。
  2858. #==============================================================================
  2859. class Sprite_Battle_Back < Plane
  2860.   #--------------------------------------------------------------------------
  2861.   # ● 初始化物件
  2862.   #--------------------------------------------------------------------------
  2863.   def initialize(viewport = nil, index, battleback_name)
  2864.     super(viewport)
  2865.     @index = index
  2866.     if @index == 1
  2867.       data = N03::FLOOR1_DATA[battleback_name]
  2868.       data = N03::FLOOR1_DATA["全Battlebacks1"] if data == nil
  2869.     elsif @index == 2
  2870.       data = N03::FLOOR2_DATA[battleback_name]
  2871.       data = N03::FLOOR2_DATA["全Battlebacks2"] if data == nil
  2872.     end   
  2873.     data = data.dup
  2874.     @adjust_position = data[0]
  2875.     @zoom_x = data[1][0] / 100.0
  2876.     @zoom_y = data[1][1] / 100.0
  2877.     @shake_on = data[2]
  2878.     $game_switches[data[3]] = true if data[3] > 0
  2879.     $sv_camera.switches[data[3].abs] = true if data[3] < 0
  2880.     reset_scroll
  2881.     reset_back_data(battleback_name)
  2882.   end
  2883.   #--------------------------------------------------------------------------
  2884.   # ● 初始化背景滚动
  2885.   #--------------------------------------------------------------------------
  2886.   def reset_scroll
  2887.     @scroll_x = 0
  2888.     @scroll_y = 0
  2889.     @move_x = 0
  2890.     @move_y = 0
  2891.   end
  2892.   #--------------------------------------------------------------------------
  2893.   # ● 初始化背景数据
  2894.   #--------------------------------------------------------------------------
  2895.   def reset_back_data(battleback_name)
  2896.     @back_data = []
  2897.     @active_data = ["scroll",0, @move_x, @move_y, false, battleback_name,""]
  2898.     start_back_data(@active_data)
  2899.   end  
  2900.   #--------------------------------------------------------------------------
  2901.   # ● 背景图像的设置
  2902.   #--------------------------------------------------------------------------
  2903.   def set_graphics(new_bitmap)
  2904.     self.bitmap = new_bitmap
  2905.     @base_x = (self.bitmap.width * @zoom_x - Graphics.width) / 2 + @adjust_position[0]
  2906.     @base_y = (self.bitmap.height * @zoom_y - Graphics.height) / 2 + @adjust_position[1]
  2907.     # 限制坐标取得
  2908.     max_top =  0
  2909.     max_bottom = self.bitmap.height * @zoom_y - Graphics.height
  2910.     max_left = 0
  2911.     max_right = self.bitmap.width * @zoom_x - Graphics.width
  2912.     exist = true
  2913.     exist = false if self.bitmap.height == 32 && self.bitmap.width == 32
  2914.     $sv_camera.setting(@index, [max_top, max_bottom, max_left, max_right, @base_x, @base_y,exist])
  2915.   end
  2916.   #--------------------------------------------------------------------------
  2917.   # ● 更新帧数
  2918.   #--------------------------------------------------------------------------
  2919.   def update
  2920.     return if !bitmap
  2921.     update_back_data
  2922.     update_scroll unless @move_x == 0 && @move_y == 0
  2923.     update_color
  2924.     update_position
  2925.     update_back_adjust if @bt_back != nil
  2926.     create_back_adjust if @bt_back == nil && !@active_data[10] && @scroll_x == 0 && @scroll_y == 0
  2927.   end
  2928.   #--------------------------------------------------------------------------
  2929.   # ● 更新背景数据
  2930.   #--------------------------------------------------------------------------
  2931.   def update_back_data
  2932.     delete = true if @active_data[1] > 0 && !$game_switches[@active_data[1]]
  2933.     delete = true if @active_data[1] < 0 && !$sv_camera.switches[@active_data[1].abs]
  2934.     return if !delete
  2935.     for i in [email]0...@back_data.size[/email]
  2936.       @back_data[i] = nil if @back_data[i][1] > 0 && !$game_switches[@back_data[i][1]]
  2937.       @back_data[i] = nil if @back_data[i][1] < 0 && !$sv_camera.switches[@back_data[i][1].abs]
  2938.     end
  2939.     @back_data.compact!
  2940.     next_back_data
  2941.   end
  2942.   #--------------------------------------------------------------------------
  2943.   # ● 下一个背景资料设置
  2944.   #--------------------------------------------------------------------------
  2945.   def next_back_data
  2946.     @back_data.delete(@active_data[11]) if @active_data[11] != nil
  2947.     @back_data.push(@active_data[11]) if @active_data[11] != nil
  2948.     @active_data = nil
  2949.     data = @back_data.pop
  2950.     @back_data = [@active_data] if @back_data.size == 0
  2951.     start_back_data(data)
  2952.   end  
  2953.   #--------------------------------------------------------------------------
  2954.   # ● 实行背景数据
  2955.   #--------------------------------------------------------------------------
  2956.   def start_back_data(data)
  2957.     return if back_data_remain(data)
  2958.     bt_back_dispose
  2959.     pre_active_data = @active_data
  2960.     @active_data[8] = [@back_name, @move_x, @move_y, @scroll_x, @scroll_y] if @active_data != nil
  2961.     @back_data.push(@active_data)     if @active_data != nil
  2962.     @active_data = data.dup
  2963.     @active_data[5] = @back_name      if @active_data[5] == ""
  2964.     @active_data[9] = set_back_adjust if @active_data[9] == nil
  2965.     back_data_scroll_on               if @active_data[8] == nil && @active_data[9][0] == false
  2966.     set_remain_back_data              if @active_data[8] != nil
  2967.     create_back(@active_data[5])      if @active_data[9][0] == false
  2968.     create_back_adjust                if @active_data[10]
  2969.     @active_data[11] = pre_active_data if pre_active_data && @active_data[7] == false
  2970.   end  
  2971.   #--------------------------------------------------------------------------
  2972.   # ● 背景数据的保持
  2973.   #--------------------------------------------------------------------------
  2974.   def back_data_remain(data)
  2975.     remain = false
  2976.     remain = true if data[6] != "" && @active_data != nil && @active_data[9] != nil && @active_data[9][0] != false
  2977.     remain = true if @active_data != nil && @active_data[7] == false
  2978.     return remain if !remain
  2979.     @remain = true
  2980.     @back_data.push(data)
  2981.     return remain
  2982.   end  
  2983.   #--------------------------------------------------------------------------
  2984.   # ● 背景变更修正数据
  2985.   #--------------------------------------------------------------------------
  2986.   def set_back_adjust
  2987.     bt_adjust = []
  2988.     sign = -1
  2989.     if @active_data[6] == ""
  2990.       reset_scroll if @active_data[3][0] == 0 &&  @active_data[3][1] == 0
  2991.       bt_adjust = [false,false,0,0]
  2992.       return bt_adjust
  2993.     elsif @move_x != 0 or @active_data[3][0] != 0
  2994.       sign = 1 if @move_x < 0
  2995.       bt_adjust[0] = [self.bitmap.width * @zoom_x * sign, 0]
  2996.       bt_adjust[1] = [self.bitmap.width * @zoom_x * sign * 2, 0]
  2997.     elsif @move_y != 0 or @active_data[3][1] != 0
  2998.       sign = 1 if @move_y < 0
  2999.       bt_adjust[0] = [0, self.bitmap.height * @zoom_y * sign]
  3000.       bt_adjust[1] = [0, self.bitmap.height * @zoom_y * sign * 2]
  3001.     else
  3002.       reset_scroll if @active_data[3][0] == 0 &&  @active_data[3][1] == 0
  3003.       bt_adjust = [false,false,0,0]
  3004.       return bt_adjust
  3005.     end
  3006.     bt_adjust[2] = [bt_adjust[0][0], bt_adjust[0][1]]
  3007.     return bt_adjust
  3008.   end
  3009.   #--------------------------------------------------------------------------
  3010.   # ● 实行背景滚动数据
  3011.   #--------------------------------------------------------------------------
  3012.   def back_data_scroll_on
  3013.     mirror = $sv_camera.mirror
  3014.     mirror = false if !@active_data[4]
  3015.     @move_x = @active_data[3][0]
  3016.     @move_x *= -1 if mirror
  3017.     @move_y = @active_data[3][1]
  3018.   end
  3019.   #--------------------------------------------------------------------------
  3020.   # ● 实行保持背景数据
  3021.   #--------------------------------------------------------------------------
  3022.   def set_remain_back_data
  3023.     return back_data_scroll_on if @move_x != 0 or @move_y != 0
  3024.     create_back(@active_data[8][0])
  3025.     @move_x    = @active_data[8][1]
  3026.     @move_y    = @active_data[8][2]
  3027.     @scroll_x  = @active_data[8][3]
  3028.     @scroll_y  = @active_data[8][4]
  3029.   end  
  3030.   #--------------------------------------------------------------------------
  3031.   # ● 创建背景图像
  3032.   #--------------------------------------------------------------------------
  3033.   def create_back(back_name)
  3034.     return if back_name == @back_name or back_name == ""
  3035.     self.bitmap = Cache.battleback1(back_name) if @index == 1
  3036.     self.bitmap = Cache.battleback2(back_name) if @index == 2
  3037.     @back_name = back_name
  3038.   end  
  3039.   #--------------------------------------------------------------------------
  3040.   # ● 创建背景变更修正图像
  3041.   #--------------------------------------------------------------------------
  3042.   def create_back_adjust
  3043.     return if @active_data[9][0] == false
  3044.     @active_data[10] = true
  3045.     mirror = $sv_camera.mirror
  3046.     mirror = false if !@active_data[4]
  3047.     @bt_back = []
  3048.     @bt_back[0] = Sprite.new(viewport)
  3049.     @bt_back[0].bitmap = Cache.battleback1(@active_data[6]) if @index == 1
  3050.     @bt_back[0].bitmap = Cache.battleback2(@active_data[6]) if @index == 2
  3051.     @bt_back[0].mirror = mirror
  3052.     @bt_back[1] = Sprite.new(viewport)
  3053.     @bt_back[1].bitmap = Cache.battleback1(@active_data[5]) if @index == 1
  3054.     @bt_back[1].bitmap = Cache.battleback2(@active_data[5]) if @index == 2
  3055.     @bt_back[1].mirror = mirror
  3056.   end
  3057.   #--------------------------------------------------------------------------
  3058.   # ● 更新背景滚动
  3059.   #--------------------------------------------------------------------------
  3060.   def update_scroll
  3061.     @scroll_x += @move_x
  3062.     @scroll_y += @move_y
  3063.     @scroll_x = 0 if @scroll_x / 100 >= self.bitmap.width * @zoom_x or @scroll_x / 100 <= -self.bitmap.width * @zoom_x
  3064.     @scroll_y = 0 if @scroll_y / 100 >= self.bitmap.height * @zoom_y or @scroll_y / 100 <= -self.bitmap.height * @zoom_y
  3065.   end
  3066.   #--------------------------------------------------------------------------
  3067.   # ● 更新色调变更
  3068.   #--------------------------------------------------------------------------
  3069.   def update_color
  3070.     color_set if $sv_camera.color_set[@index] != nil
  3071.     return if @color_data == nil
  3072.     @color_data[4] -= 1
  3073.     if @color_data[4] == 0 && @color_data[5] != 0
  3074.       @color_data[4] = @color_data[5]
  3075.       @color_data[5] = 0
  3076.       @color_data[6] = [0,0,0,0]
  3077.     elsif @color_data[4] == 0
  3078.       @remain_color_data = @color_data
  3079.       return @color_data = nil
  3080.     end  
  3081.     for i in 0..3
  3082.       @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
  3083.     end  
  3084.     self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
  3085.   end
  3086.   #--------------------------------------------------------------------------
  3087.   # ● 更新坐标
  3088.   #--------------------------------------------------------------------------
  3089.   def update_position
  3090.     self.ox = $sv_camera.x + @base_x - @scroll_x / 100
  3091.     self.oy = $sv_camera.y + @base_y - @scroll_y / 100
  3092.     self.ox -= $sv_camera.sx / 100 if @shake_on
  3093.     self.oy -= $sv_camera.sy / 100 if @shake_on
  3094.     self.zoom_x = @zoom_x * $sv_camera.zoom
  3095.     self.zoom_y = @zoom_y * $sv_camera.zoom
  3096.     self.ox *= $sv_camera.zoom
  3097.     self.oy *= $sv_camera.zoom
  3098.     self.z = @index * 10
  3099.   end
  3100.   #--------------------------------------------------------------------------
  3101.   # ● 更新背景变更修正图像
  3102.   #--------------------------------------------------------------------------
  3103.   def update_back_adjust
  3104.     @active_data[9][0][0] = 0 if @scroll_x == 0
  3105.     @active_data[9][0][1] = 0 if @scroll_y == 0
  3106.     @active_data[9][1][0] -= @active_data[9][2][0] if @scroll_x == 0
  3107.     @active_data[9][1][1] -= @active_data[9][2][1] if @scroll_y == 0
  3108.     for i in [email]0...@bt_back.size[/email]
  3109.       @bt_back[i].x = -self.ox + @active_data[9][i][0] * $sv_camera.zoom
  3110.       @bt_back[i].y = -self.oy + @active_data[9][i][1] * $sv_camera.zoom
  3111.       @bt_back[i].zoom_x = self.zoom_x
  3112.       @bt_back[i].zoom_y = self.zoom_y
  3113.       @bt_back[i].z = self.z + 1
  3114.       @bt_back[i].color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  3115.     end
  3116.     back_data_scroll_on if @active_data[9][0][0] == 0 && @active_data[9][0][1] == 0
  3117.     return unless @active_data[9][1][0] == 0 && @active_data[9][1][1] == 0
  3118.     bt_back_dispose
  3119.     create_back(@active_data[5])
  3120.     @active_data[9][0] = false
  3121.     next_back_data if @remain && @back_data.size != 1
  3122.     @remain = false
  3123.   end
  3124.   #--------------------------------------------------------------------------
  3125.   # ● 色调变更
  3126.   #--------------------------------------------------------------------------
  3127.   def color_set
  3128.     set = $sv_camera.color_set[@index]
  3129.     $sv_camera.color_set[@index] = nil
  3130.     set[4] = 1 if set[4] == 0
  3131.     @remain_color_data = [0,0,0,0] if @remain_color_data == nil
  3132.     @color_data = @remain_color_data
  3133.     @color_data[4] = set[4]
  3134.     @color_data[5] = set[5]
  3135.     @color_data[6] = set
  3136.   end
  3137.   #--------------------------------------------------------------------------
  3138.   # ● 背景变更修正的释放
  3139.   #--------------------------------------------------------------------------
  3140.   def bt_back_dispose
  3141.     for i in [email]0...@bt_back.size[/email] do @bt_back[i].dispose end if @bt_back != nil
  3142.     @bt_back = nil
  3143.   end  
  3144.   #--------------------------------------------------------------------------
  3145.   # ● 释放
  3146.   #--------------------------------------------------------------------------
  3147.   def dispose
  3148.     bitmap.dispose if bitmap
  3149.     bt_back_dispose
  3150.     super
  3151.   end
  3152. end  
  3153.  
  3154. #==============================================================================
  3155. # ■ Battle_Camera
  3156. #------------------------------------------------------------------------------
  3157. #  这是一个类来处理相机和战斗的计划。
  3158. #==============================================================================
  3159. class Battle_Camera
  3160.   #--------------------------------------------------------------------------
  3161.   # ● 公开实例的变量
  3162.   #--------------------------------------------------------------------------
  3163.   attr_reader   :sx                 # 摇动X坐标
  3164.   attr_reader   :sy                 # 摇动Y坐标
  3165.   attr_reader   :max_top            # 上限界坐标
  3166.   attr_reader   :max_bottom         # 下限界坐标
  3167.   attr_reader   :max_left           # 左限界坐标
  3168.   attr_reader   :max_right          # 右限界坐标
  3169.   attr_accessor :switches           # 侧视图专用开关
  3170.   attr_accessor :color_set          # 色调变更数据
  3171.   attr_accessor :wait               # 战斗场景的强制体能
  3172.   attr_accessor :win_wait           # 战斗胜利前的体能
  3173.   attr_accessor :mirror             # 画面反转标记
  3174.   attr_accessor :program_scroll     # 战斗程序 背景的自动滚动
  3175.   attr_accessor :program_picture    # 战斗程序 期间图片
  3176.   attr_accessor :event              # 公共事件呼叫
  3177.   #--------------------------------------------------------------------------
  3178.   # ● 初始化物件
  3179.   #--------------------------------------------------------------------------
  3180.   def initialize
  3181.     @switches = []
  3182.     @max_data = []
  3183.     @color_set = []
  3184.     @wait = 0
  3185.     @win_wait = false
  3186.     @mirror = false
  3187.     @event = false
  3188.     setup
  3189.   end
  3190.   #--------------------------------------------------------------------------
  3191.   # ● 相机X坐标
  3192.   #--------------------------------------------------------------------------
  3193.   def x
  3194.     return @x / 100
  3195.   end
  3196.   #--------------------------------------------------------------------------
  3197.   # ● 相机Y坐标
  3198.   #--------------------------------------------------------------------------
  3199.   def y
  3200.     return @y / 100
  3201.   end
  3202.   #--------------------------------------------------------------------------
  3203.   # ● 变焦率
  3204.   #--------------------------------------------------------------------------
  3205.   def zoom
  3206.     return @zoom * 0.001
  3207.   end
  3208.   #--------------------------------------------------------------------------
  3209.   # ● 变焦虑的坐标变换
  3210.   #--------------------------------------------------------------------------
  3211.   def convert
  3212.     return @zoom
  3213.   end
  3214.   #--------------------------------------------------------------------------
  3215.   # ● 相机设置
  3216.   #--------------------------------------------------------------------------
  3217.   def setup
  3218.     @x = 0
  3219.     @y = 0
  3220.     @sx = 0
  3221.     @sy = 0
  3222.     @zoom = 1000
  3223.     @time = 0
  3224.     @shake_time = 0
  3225.     program_setup
  3226.   end
  3227.   #--------------------------------------------------------------------------
  3228.   # ● 初始化相机
  3229.   #--------------------------------------------------------------------------
  3230.   def reset
  3231.     @switches = []
  3232.     @max_data = []
  3233.     @color_set = []
  3234.     @wait = 0
  3235.     @win_wait = false
  3236.     @mirror = false
  3237.     program_setup(false)
  3238.   end  
  3239.   #--------------------------------------------------------------------------
  3240.   # ● 战斗安装程序
  3241.   #--------------------------------------------------------------------------
  3242.   def program_setup(check = true)
  3243.     @played_program  = []
  3244.     @program_switch  = []
  3245.     @program_sound   = []
  3246.     @program_scroll  = []
  3247.     @program_se      = []
  3248.     @program_shake   = []
  3249.     @program_color   = []
  3250.     @program_picture = []
  3251.     @program_base = N03::BATTLE_PROGRAM.values.dup
  3252.     program_check if check
  3253.   end  
  3254.   #--------------------------------------------------------------------------
  3255.   # ● 战斗的检测程序
  3256.   #--------------------------------------------------------------------------
  3257.   def program_check
  3258.     for data in @program_base
  3259.       if program_start?(data) && !@played_program.include?(data)
  3260.         @played_program.push(data.dup)
  3261.         @program_scroll.push(data.dup)  if data[0] == "scroll"
  3262.         @program_picture.push(data.dup) if data[0] == "kpic"
  3263.         start_sound(data.dup)           if data[0] == "sound"
  3264.         start_program_switch(data.dup)  if data[0] == "switch"
  3265.         start_program_se(data.dup)      if data[0] == "keep_se"
  3266.         start_program_shake(data.dup)   if data[0] == "keep_sk"
  3267.         start_program_color(data.dup)   if data[0] == "keep_c"
  3268.       else
  3269.         @played_program.delete(data)  if !program_start?(data)
  3270.         @program_scroll.delete(data)  if data[0] == "scroll"
  3271.         @program_picture.delete(data) if data[0] == "kpic"
  3272.         @program_switch.delete(data)  if data[0] == "switch"
  3273.         @program_sound.delete(data)   if data[0] == "sound"
  3274.         @program_se.delete(data)      if data[0] == "keep_se"
  3275.         @program_shake.delete(data)   if data[0] == "keep_sk"
  3276.         @program_color.delete(data)   if data[0] == "keep_c"
  3277.       end
  3278.     end
  3279.   end
  3280.   #--------------------------------------------------------------------------
  3281.   # ● 战斗程序开始
  3282.   #--------------------------------------------------------------------------
  3283.   def program_start?(data)
  3284.     start = false
  3285.     start = true if $game_switches[data[1].abs] && data[1] > 0
  3286.     start = true if @switches[data[1].abs] && data[1] < 0
  3287.     return start
  3288.   end  
  3289.   #--------------------------------------------------------------------------
  3290.   # ● 战斗程序 开关操作开始
  3291.   #--------------------------------------------------------------------------
  3292.   def start_program_switch(data)
  3293.     data[4] = data[4] + rand(data[5] + 1)
  3294.     data[4] = 1 if data[4] <= 0
  3295.     @program_switch.push(data)
  3296.   end
  3297.   #--------------------------------------------------------------------------
  3298.   # ● 更新开关操作
  3299.   #--------------------------------------------------------------------------
  3300.   def update_program_switch
  3301.     for data in @program_switch
  3302.       data[4] -= 1
  3303.       next @program_switch.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3304.       next @program_switch.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3305.       next if data[4] != 0
  3306.       for id in data[2]
  3307.         $game_switches[id] = true if id > 0
  3308.         @switches[id.abs] = true  if id < 0
  3309.       end
  3310.       for id in data[3]
  3311.         $game_switches[id] = false if id > 0
  3312.         @switches[id.abs] = false  if id < 0
  3313.       end
  3314.       @program_switch.delete(data)
  3315.       program_check
  3316.     end  
  3317.   end
  3318.   #--------------------------------------------------------------------------
  3319.   # ● 战斗程序 BGM/BGS的开始
  3320.   #--------------------------------------------------------------------------
  3321.   def start_sound(data)
  3322.     @program_sound.push(data)
  3323.     name = data[5]
  3324.     case data[2]
  3325.     when "se"
  3326.       Audio.se_play("Audio/SE/" + name, data[4], data[3])
  3327.     when "bgm"
  3328.       name = RPG::BGM.last.name if data[5] == ""
  3329.       Audio.bgm_play("Audio/BGM/" + name, data[4], data[3])
  3330.     when "bgs"
  3331.       name = RPG::BGS.last.name if data[5] == ""
  3332.       Audio.bgs_play("Audio/BGS/" + name, data[4], data[3])
  3333.     end
  3334.   end
  3335.   #--------------------------------------------------------------------------
  3336.   # ● 战斗程序 期间SE的开始
  3337.   #--------------------------------------------------------------------------
  3338.   def start_program_se(data)
  3339.     data[3] = [data[2], data[3]]
  3340.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3341.     @program_se.push(data)
  3342.     Audio.se_play("Audio/SE/" + data[7], data[5], data[4]) if data[6]
  3343.   end
  3344.   #--------------------------------------------------------------------------
  3345.   # ● 更新期间SE
  3346.   #--------------------------------------------------------------------------
  3347.   def update_program_se
  3348.     for data in @program_se
  3349.       data[2] -= 1
  3350.       next @program_se.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3351.       next @program_se.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3352.       next if data[2] != 0
  3353.       Audio.se_play("Audio/SE/" + data[7], data[5], data[4])
  3354.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3355.     end  
  3356.   end
  3357.   #--------------------------------------------------------------------------
  3358.   # ● 战斗程序 开始期间摇动
  3359.   #--------------------------------------------------------------------------
  3360.   def start_program_shake(data)
  3361.     data[3] = [data[2], data[3]]
  3362.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3363.     @program_shake.push(data)
  3364.     shake(data[4], data[5], data[6]) if data[7]
  3365.   end
  3366.   #--------------------------------------------------------------------------
  3367.   # ● 更新期间摇动
  3368.   #--------------------------------------------------------------------------
  3369.   def update_program_shake
  3370.     for data in @program_shake
  3371.       data[2] -= 1
  3372.       next @program_shake.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3373.       next @program_shake.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3374.       next if data[2] != 0
  3375.       shake(data[4], data[5], data[6])
  3376.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3377.     end  
  3378.   end
  3379.   #--------------------------------------------------------------------------
  3380.   # ● 战斗程序 开始期间色调变更
  3381.   #--------------------------------------------------------------------------
  3382.   def start_program_color(data)
  3383.     data[3] = [data[2], data[3]]
  3384.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3385.     data[7] = true if data[4] == 0 or data[4] == 4
  3386.     case data[4]
  3387.     when 1   ;data[4] = $game_troop.members
  3388.     when 2   ;data[4] = $game_party.battle_members
  3389.     when 3,4 ;data[4] = $game_troop.members + $game_party.battle_members
  3390.     else ;data[4] = []
  3391.     end
  3392.     @program_color.push(data)
  3393.     return if !data[6]
  3394.     for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
  3395.     @color_set[1] = data[5] if data[7]
  3396.     @color_set[2] = data[5] if data[7]
  3397.   end
  3398.   #--------------------------------------------------------------------------
  3399.   # ● 更新期间色调变更
  3400.   #--------------------------------------------------------------------------
  3401.   def update_program_color
  3402.     for data in @program_color
  3403.       data[2] -= 1
  3404.       next @program_color.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3405.       next @program_color.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3406.       next if data[2] != 0
  3407.       for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
  3408.       @color_set[1] = data[5] if data[7]
  3409.       @color_set[2] = data[5] if data[7]
  3410.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3411.     end
  3412.   end
  3413.   #--------------------------------------------------------------------------
  3414.   # ● 实行过渡
  3415.   #--------------------------------------------------------------------------
  3416.   def perform_transition(data)
  3417.     Graphics.transition(data[2], "Graphics/Pictures/" + data[3], data[1])
  3418.   end  
  3419.   #--------------------------------------------------------------------------
  3420.   # ● 取得背景相机的限制值  data=[max_top, max_bottom, max_left, max_right]
  3421.   #--------------------------------------------------------------------------
  3422.   def setting(index, data)
  3423.     @max_data[index - 1] = data
  3424.     return if index != 2
  3425.     setup
  3426.     # 相机的中心坐标
  3427.     @center_x     = (Graphics.width / 2 + N03::CAMERA_POSITION[0]) * 100
  3428.     @center_y     = (Graphics.height / 2 + N03::CAMERA_POSITION[1]) * 100
  3429.     # 上下左右的移动限制距离
  3430.     @max_top    = [@max_data[0][5], @max_data[1][5]].min * -1
  3431.     @max_bottom = [@max_data[0][1], @max_data[1][1]].min + @max_top
  3432.     @max_left   = [@max_data[0][4], @max_data[1][4]].min  * -1
  3433.     @max_right  = [@max_data[0][3], @max_data[1][3]].min + @max_left
  3434.     exist_data = @max_data[0] if !@max_data[1][6]
  3435.     exist_data = @max_data[1] if !@max_data[0][6]
  3436.     @max_top    = exist_data[5] * -1        if exist_data != nil
  3437.     @max_bottom = exist_data[1] + @max_top  if exist_data != nil
  3438.     @max_left   = exist_data[4] * -1        if exist_data != nil
  3439.     @max_right  = exist_data[3] + @max_left if exist_data != nil
  3440.     @max_top = @max_bottom = @max_left = @max_right = 0 if !@max_data[1][6] && !@max_data[0][6]
  3441.     @max_width    = @max_right - @max_left + Graphics.width
  3442.     @max_height   = @max_bottom - @max_top + Graphics.height
  3443.     # 扩大缩小限制值
  3444.     max_zoom_x    = 100 * Graphics.width / @max_width
  3445.     max_zoom_y    = 100 * Graphics.height / @max_height
  3446.     @max_zoom_out = [max_zoom_x, max_zoom_y].max
  3447.   end
  3448.   #--------------------------------------------------------------------------
  3449.   # ● 相机移动
  3450.   #--------------------------------------------------------------------------
  3451.   def move(target_x, target_y, zoom, time, screen = true)
  3452.     # 调整战斗背景以上尺寸的变焦来减少
  3453.     @target_zoom = [zoom * 0.01, @max_zoom_out * 0.01].max
  3454.     target_x *= -1 if screen && @mirror
  3455.     # 变焦分钟的中心坐标修正
  3456.     if screen && @target_zoom != 1
  3457.       target_x = target_x + @center_x
  3458.       target_y = target_y + @center_y
  3459.     end
  3460.     adjust_x = @center_x * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
  3461.     adjust_y = @center_y * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
  3462.     adjust_x = 0 if adjust_x.nan?
  3463.     adjust_y = 0 if adjust_y.nan?
  3464.     adjust_x = @center_x if !screen && adjust_x == 0
  3465.     adjust_y = @center_y if !screen && adjust_y == 0
  3466.     @target_x = target_x - adjust_x.to_i
  3467.     @target_y = target_y - adjust_y.to_i
  3468.     @target_zoom = (@target_zoom * 1000).to_i
  3469.     @zoom = @zoom.to_i
  3470.     limit_test
  3471.     # 马上实行当时间是0的场合
  3472.     return @time = time.abs if time != 0
  3473.     @time = 1
  3474.     update
  3475.   end
  3476.   #--------------------------------------------------------------------------
  3477.   # ● 计算限制的坐标
  3478.   #--------------------------------------------------------------------------
  3479.   def limit_test
  3480.     new_width = @max_width * @target_zoom / 1000
  3481.     new_height = @max_height * @target_zoom / 1000
  3482.     new_max_right = @max_right - (@max_width - new_width)
  3483.     new_max_bottom = @max_bottom - (@max_height - new_height)
  3484.     # 画面移动目标限制的场合、限制坐标设置
  3485.     if @target_x < @max_left * 100
  3486.       @target_x = @max_left * 100
  3487.     end
  3488.     if @target_x > new_max_right * 100
  3489.       @target_x = new_max_right * 100
  3490.     end
  3491.     if @target_y < @max_top * 100
  3492.       @target_y = @max_top * 100
  3493.     end
  3494.     if @target_y > new_max_bottom * 100
  3495.       @target_y = new_max_bottom * 100
  3496.     end
  3497.   end
  3498.   #--------------------------------------------------------------------------
  3499.   # ● 画面的摇动
  3500.   #--------------------------------------------------------------------------
  3501.   def shake(power, speed, time)
  3502.     @shake_x = power[0] * 100
  3503.     @shake_y = power[1] * 100
  3504.     @power_time_base = @power_time = speed
  3505.     @shake_time = time
  3506.     update_shake
  3507.   end
  3508.   #--------------------------------------------------------------------------
  3509.   # ● 更新摇动
  3510.   #--------------------------------------------------------------------------
  3511.   def update_shake
  3512.     @sx = (@sx * (@power_time - 1) + @shake_x) / @power_time
  3513.     @sy = (@sy * (@power_time - 1) + @shake_y) / @power_time
  3514.     @power_time -= 1
  3515.     @shake_time -= 1
  3516.     return @sx = @sy = 0 if @shake_time == 0
  3517.     return if @power_time != 0
  3518.     @power_time = @power_time_base
  3519.     @shake_x = @shake_x * -4 / 5
  3520.     @shake_y = @shake_y * -4 / 5
  3521.   end
  3522.   #--------------------------------------------------------------------------
  3523.   # ● 更新帧数
  3524.   #--------------------------------------------------------------------------
  3525.   def update
  3526.     update_shake if @shake_time != 0
  3527.     update_program
  3528.     return if @time == 0
  3529.     @x = (@x * (@time - 1) + @target_x) / @time
  3530.     @y = (@y * (@time - 1) + @target_y) / @time
  3531.     @zoom = (@zoom * (@time - 1) + @target_zoom) / @time
  3532.     @time -= 1
  3533.   end
  3534.   #--------------------------------------------------------------------------
  3535.   # ● 更新程序
  3536.   #--------------------------------------------------------------------------
  3537.   def update_program
  3538.     update_program_switch if @program_switch != []
  3539.     update_program_se     if @program_se != []
  3540.     update_program_shake  if @program_shake != []
  3541.     update_program_color  if @program_color != []
  3542.   end
  3543. end
  3544.  
  3545. #==============================================================================
  3546. # ■ Scene_Battle
  3547. #------------------------------------------------------------------------------
  3548. #  它是一类用于执行该过程的战斗画面。
  3549. #==============================================================================
  3550. class Scene_Battle < Scene_Base
  3551.   #--------------------------------------------------------------------------
  3552.   # ● 更新帧数(基本)
  3553.   #--------------------------------------------------------------------------
  3554.   alias update_basic_scene_battle_n03 update_basic
  3555.   def update_basic
  3556.     update_basic_scene_battle_n03
  3557.     $sv_camera.update
  3558.     $sv_camera.wait = N03::TURN_END_WAIT + 1 if $sv_camera.win_wait
  3559.     camera_wait
  3560.   end
  3561.   #--------------------------------------------------------------------------
  3562.   # ● 相机体能
  3563.   #--------------------------------------------------------------------------
  3564.   def camera_wait
  3565.     process_event if $sv_camera.event
  3566.     $sv_camera.event = false if $sv_camera.event
  3567.     while $sv_camera.wait != 0
  3568.       Graphics.update
  3569.       Input.update
  3570.       update_all_windows
  3571.       $game_timer.update
  3572.       $game_troop.update
  3573.       $sv_camera.update
  3574.       @spriteset.update
  3575.       update_info_viewport
  3576.       update_message_open
  3577.       $sv_camera.wait -= 1 if $sv_camera.wait > 0
  3578.       $sv_camera.wait = 1 if $sv_camera.wait == 0 && @spriteset.effect?
  3579.       BattleManager.victory if $sv_camera.win_wait && $sv_camera.wait == 0
  3580.     end
  3581.   end
  3582.   #--------------------------------------------------------------------------
  3583.   # ● 相机体能集
  3584.   #--------------------------------------------------------------------------
  3585.   def set_camera_wait(time)
  3586.     $sv_camera.wait = time
  3587.     camera_wait
  3588.   end  
  3589.   #--------------------------------------------------------------------------
  3590.   # ● 实行等待直到效果结束 ★再定义
  3591.   #--------------------------------------------------------------------------
  3592.   def wait_for_effect
  3593.   end
  3594.   #--------------------------------------------------------------------------
  3595.   # ● 开始回合
  3596.   #--------------------------------------------------------------------------
  3597.   alias turn_start_scene_battle_n03 turn_start
  3598.   def turn_start
  3599.     turn_start_scene_battle_n03
  3600.     N03.camera(nil, N03::BATTLE_CAMERA["ターン開始後"].dup)
  3601.   end
  3602.   #--------------------------------------------------------------------------
  3603.   # ● 回合结束
  3604.   #--------------------------------------------------------------------------
  3605.   alias turn_end_scene_battle_n03 turn_end
  3606.   def turn_end
  3607.     turn_end_scene_battle_n03
  3608.     for member in $game_troop.members + $game_party.members
  3609.       N03.set_damage(member, member.sv.result_damage[0],member.sv.result_damage[1])
  3610.       member.sv.result_damage = [0,0]
  3611.       @spriteset.set_damage_pop(member) if member.result.hp_damage != 0 or member.result.mp_damage != 0
  3612.     end
  3613.     set_camera_wait(N03::TURN_END_WAIT)
  3614.     N03.camera(nil, N03::BATTLE_CAMERA["ターン開始前"].dup) if $game_party.inputable?
  3615.     @log_window.clear
  3616.   end
  3617.   #--------------------------------------------------------------------------
  3618.   # ● 技能/使用物品 ★再定义
  3619.   #--------------------------------------------------------------------------
  3620.   def use_item
  3621.     item = @subject.current_action.item
  3622.     display_item(item)
  3623.     @subject.use_item(item)
  3624.     refresh_status
  3625.     @targets = @subject.current_action.make_targets.compact
  3626.     @targets = [@subject] if @targets.size == 0
  3627.     set_substitute(item)
  3628.     for time in item.repeats.times do play_sideview(@targets, item) end
  3629.     end_reaction(item)
  3630.     display_end_item
  3631.   end
  3632.   #--------------------------------------------------------------------------
  3633.   # ● 技能/显示物品名
  3634.   #--------------------------------------------------------------------------
  3635.   def display_item(item)
  3636.     return @log_window.display_use_item(@subject, item) if N03::BATTLE_LOG
  3637.     @log_window.off
  3638.     @skill_name_window = Window_Skill_name.new(item.name) unless N03::NO_DISPLAY_SKILL_ID.include?(item.id) && item.is_a?(RPG::Skill)
  3639.   end  
  3640.   #--------------------------------------------------------------------------
  3641.   # ● 技能/显示物品名结束
  3642.   #--------------------------------------------------------------------------
  3643.   def display_end_item
  3644.     @skill_name_window.dispose if @skill_name_window != nil
  3645.     @skill_name_window = nil
  3646.     set_camera_wait(N03::ACTION_END_WAIT) if @subject.sv.derivation_skill_id == 0
  3647.     @log_window.clear if N03::BATTLE_LOG
  3648.   end  
  3649.   #--------------------------------------------------------------------------
  3650.   # ● 反击/魔法反射/代替处理
  3651.   #--------------------------------------------------------------------------
  3652.   def end_reaction(item)
  3653.     end_substitute if @substitute != nil
  3654.     set_reflection(item) if @reflection_data != nil
  3655.     set_counter_attack if @counter_attacker != nil
  3656.   end  
  3657.   #--------------------------------------------------------------------------
  3658.   # ● 发动反击 ★再定义
  3659.   #--------------------------------------------------------------------------
  3660.   def invoke_counter_attack(target, item)
  3661.     return if @subject.sv.counter_id != 0
  3662.     @counter_attacker = [] if @counter_attacker == nil
  3663.     return apply_item_effects(apply_substitute(target, item), item) if !target.movable?
  3664.     @log_window.add_text(sprintf(Vocab::CounterAttack, target.name)) if N03::BATTLE_LOG
  3665.     target.sv.counter_id = target.sv.counter_skill_id
  3666.     @counter_attacker.push(target)
  3667.   end
  3668.   #--------------------------------------------------------------------------
  3669.   # ● 发动魔法反射 ★再定义
  3670.   #--------------------------------------------------------------------------
  3671.   def invoke_magic_reflection(target, item)
  3672.     return if @subject.sv.reflection_id != 0
  3673.     @log_window.add_text(sprintf(Vocab::MagicReflection, target.name)) if N03::BATTLE_LOG
  3674.     target.sv.reflection_id = target.sv.reflection_anime_id
  3675.   end
  3676.   #--------------------------------------------------------------------------
  3677.   # ● 代替应用 ★再定义
  3678.   #--------------------------------------------------------------------------
  3679.   def apply_substitute(target, item)
  3680.     return target if @substitute == nil
  3681.     return target if !check_substitute(target, item)
  3682.     return @substitute
  3683.   end
  3684.   #--------------------------------------------------------------------------
  3685.   # ● 代替设置
  3686.   #--------------------------------------------------------------------------
  3687.   def set_substitute(item)
  3688.     @substitute = N03.get_enemy_unit(@subject).substitute_battler
  3689.     return if @substitute == nil
  3690.     s_targets = []
  3691.     for i in [email]0...@targets.size[/email]
  3692.       next if @targets[i] == @substitute
  3693.       next if !check_substitute(@targets[i], item)
  3694.       @log_window.add_text(sprintf(Vocab::Substitute, @substitute.name, @targets[i].name))
  3695.       @targets[i].sv.start_action(@targets[i].sv.substitute_receiver_start_action)
  3696.       s_targets.push(@targets[i])
  3697.       @targets[i] = @substitute
  3698.     end
  3699.     return @substitute = nil if s_targets == []
  3700.     @substitute.sv.set_target(s_targets)
  3701.     @substitute.sv.start_action(@substitute.sv.substitute_start_action)
  3702.   end  
  3703.   #--------------------------------------------------------------------------
  3704.   # ● 结束代替
  3705.   #--------------------------------------------------------------------------
  3706.   def end_substitute
  3707.     for member in @substitute.sv.target_battler
  3708.       member.sv.start_action(member.sv.substitute_receiver_end_action)
  3709.     end  
  3710.     @substitute.sv.start_action(@substitute.sv.substitute_end_action)
  3711.     @substitute = nil
  3712.   end
  3713.   #--------------------------------------------------------------------------
  3714.   # ● 反击
  3715.   #--------------------------------------------------------------------------
  3716.   def set_counter_attack
  3717.     pre_subject = @subject
  3718.     for attacker in @counter_attacker
  3719.       @subject = attacker
  3720.       item = $data_skills[attacker.sv.counter_skill_id]
  3721.       play_sideview([pre_subject], item)
  3722.     end
  3723.     # 实行同一个计数器者を考虑到计数器ID的初始化动作后
  3724.     for attacker in @counter_attacker do attacker.sv.counter_id = 0 end
  3725.     @subject = pre_subject
  3726.     @counter_attacker = nil
  3727.   end
  3728.   #--------------------------------------------------------------------------
  3729.   # ● 魔法反射
  3730.   #--------------------------------------------------------------------------
  3731.   def set_reflection(item)
  3732.     @log_window.back_to(1)
  3733.     for data in @reflection_data
  3734.       @subject.sv.damage_action(@subject, item)
  3735.       N03.set_damage_anime_data([@subject], @subject, data)
  3736.       apply_item_effects(@subject, item)
  3737.       @spriteset.set_damage_pop(@subject)
  3738.     end
  3739.     set_camera_wait(N03.get_anime_time(@reflection_data[0][0]))
  3740.     @reflection_data = nil
  3741.   end
  3742.   #--------------------------------------------------------------------------
  3743.   # ● 实行侧视图动作
  3744.   #--------------------------------------------------------------------------
  3745.   def play_sideview(targets, item)
  3746.     @subject.sv.set_target(targets)
  3747.     return if @subject.sv.attack_action(item) == nil
  3748.     return if !@subject.movable?
  3749.     return if item.scope != 9 && item.scope != 10 && !N03.targets_alive?(targets)
  3750.     @subject.sv.start_action(@subject.sv.attack_action(item))
  3751.     @subject.sv.unshift_action(@subject.sv.flash_action) if @subject.flash_flg
  3752.     @subject.sv.active = true
  3753.     @subject.sv.command_action = false
  3754.     loop do
  3755.       update_basic
  3756.       data = @subject.sv.play_data
  3757.       @targets = N03.s_targets(@subject) if data[0] == "second_targets_set"
  3758.       N03.targets_set(@subject)          if data[0] == "targets_set"
  3759.       @immortal = N03.immortaling        if data[0] == "no_collapse" && !N03.dead_attack?(@subject, item)
  3760.       @immortal = N03.unimmortaling      if data[0] == "collapse"
  3761.       next set_move_anime(item)          if @subject.sv.m_a_data != []
  3762.       set_damage(item)                   if @subject.sv.set_damage
  3763.       break N03.derived_skill(@subject)  if @subject.sv.derivation_skill_id != 0
  3764.       break                              if @subject.sv.action_end or @subject.hidden?
  3765.     end
  3766.     @immortal = N03.unimmortaling        if @immortal
  3767.   end
  3768.   #--------------------------------------------------------------------------
  3769.   # ● 实行伤害
  3770.   #--------------------------------------------------------------------------
  3771.   def set_damage(item)
  3772.     targets = @targets
  3773.     targets = [@subject.sv.individual_targets[0]] if @subject.sv.individual_targets.size != 0
  3774.     for target in targets do damage_anime(targets.dup, target, item) end
  3775.     @subject.sv.set_damage = false
  3776.     @subject.sv.damage_anime_data = []
  3777.   end
  3778.   #--------------------------------------------------------------------------
  3779.   # ● 战斗动画伤害处理
  3780.   #--------------------------------------------------------------------------
  3781.   def damage_anime(targets, target, item)
  3782.     @log_window.back_to(1) if @log_window.line_number == 5
  3783.     return if item.scope != 9 && item.scope != 10 && target.dead?
  3784.     @miss = false
  3785.     invoke_item(target,item)
  3786.     if target.result.missed
  3787.       target.sv.miss_action(@subject, item)
  3788.       return @miss = true
  3789.     elsif target.result.evaded or target.sv.counter_id != 0
  3790.       target.sv.evasion_action(@subject, item)
  3791.       return @miss = true
  3792.     elsif target.sv.reflection_id != 0
  3793.       N03.set_damage_anime_data(targets, target, [target.sv.reflection_id, false, false, true])
  3794.       target.sv.reflection_id = 0
  3795.       @reflection_data = [] if @reflection_data == nil
  3796.       return @reflection_data.push([N03.get_attack_anime_id(-3, @subject), false, false, true])
  3797.     end
  3798.     target.sv.damage_action(@subject, item)
  3799.     N03.set_damage(@subject, -target.result.hp_drain, -target.result.mp_drain) if target != @subject
  3800.     @spriteset.set_damage_pop(target)
  3801.     @spriteset.set_damage_pop(@subject) if target != @subject && @subject.result.hp_damage != 0 or @subject.result.mp_damage != 0
  3802.     N03.set_damage_anime_data(targets, target, @subject.sv.damage_anime_data) if @subject.sv.damage_anime_data != []
  3803.   end
  3804.   #--------------------------------------------------------------------------
  3805.   # ● 飞行动画处理
  3806.   #--------------------------------------------------------------------------
  3807.   def set_move_anime(item)
  3808.     for data in @subject.sv.m_a_data
  3809.       @subject.sv.damage_anime_data = data[4]
  3810.       hit_targets = []
  3811.       for target in data[1]
  3812.         damage_anime(data[1], target, item) if data[0]
  3813.         hit_targets.push(target) if !@miss
  3814.       end
  3815.       @miss = false if !data[3]
  3816.       @spriteset.set_hit_animation(@subject, data[2], hit_targets, @miss)
  3817.     end
  3818.     @subject.sv.set_damage = false
  3819.     @subject.sv.m_a_data = []
  3820.   end
  3821. end
  3822.  
  3823. #==============================================================================
  3824. # ■ DataManager
  3825. #------------------------------------------------------------------------------
  3826. #  这是一个模块管理游戏和数据库对象。
  3827. #==============================================================================
  3828. module DataManager
  3829.   #--------------------------------------------------------------------------
  3830.   # ● 创建各种游戏物件 ★再定义
  3831.   #--------------------------------------------------------------------------
  3832.   def self.create_game_objects
  3833.     $game_temp          = Game_Temp.new
  3834.     $game_system        = Game_System.new
  3835.     $game_timer         = Game_Timer.new
  3836.     $game_message       = Game_Message.new
  3837.     $game_switches      = Game_Switches.new
  3838.     $game_variables     = Game_Variables.new
  3839.     $game_self_switches = Game_SelfSwitches.new
  3840.     $game_actors        = Game_Actors.new
  3841.     $game_party         = Game_Party.new
  3842.     $game_troop         = Game_Troop.new
  3843.     $game_map           = Game_Map.new
  3844.     $game_player        = Game_Player.new
  3845.     $sv_camera          = Battle_Camera.new
  3846.   end
  3847. end
  3848.  
  3849. #==============================================================================
  3850. # ■ BattleManager
  3851. #------------------------------------------------------------------------------
  3852. #  这是一个模块管理战斗进行。
  3853. #==============================================================================
  3854. module BattleManager
  3855.   #--------------------------------------------------------------------------
  3856.   # ● 遇敌时时处理 ★再定义
  3857.   #--------------------------------------------------------------------------
  3858.   def self.on_encounter
  3859.     @preemptive = (rand < rate_preemptive)
  3860.     @surprise = (rand < rate_surprise && !@preemptive)
  3861.     $sv_camera.mirror = @surprise if N03::BACK_ATTACK
  3862.   end
  3863.   #--------------------------------------------------------------------------
  3864.   # ● 胜利的处理 ★再定义
  3865.   #--------------------------------------------------------------------------
  3866.   def self.process_victory
  3867.     $sv_camera.win_wait = true
  3868.   end  
  3869.   #--------------------------------------------------------------------------
  3870.   # ● 胜利
  3871.   #--------------------------------------------------------------------------
  3872.   def self.victory
  3873.     $sv_camera.win_wait = false
  3874.     N03.camera(nil, N03::BATTLE_CAMERA["戦闘終了時"].dup)
  3875.     for member in $game_party.members do member.sv.start_action(member.sv.win) if member.movable? end
  3876.     play_battle_end_me
  3877.     replay_bgm_and_bgs
  3878.     $game_message.add(sprintf(Vocab::Victory, $game_party.name))
  3879.     display_exp
  3880.     gain_gold
  3881.     gain_drop_items
  3882.     gain_exp
  3883.     SceneManager.return
  3884.     battle_end(0)
  3885.     return true
  3886.   end
  3887.   #--------------------------------------------------------------------------
  3888.   # ● 逃走的处理 ★再定义
  3889.   #--------------------------------------------------------------------------
  3890.   def self.process_escape
  3891.     $game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
  3892.     success = @preemptive ? true : (rand < @escape_ratio)
  3893.     Sound.play_escape
  3894.     if success
  3895.       process_abort
  3896.       for member in $game_party.members do member.sv.start_action(member.sv.escape) if member.movable? end
  3897.     else
  3898.       @escape_ratio += 0.1
  3899.       $game_message.add('\.' + Vocab::EscapeFailure)
  3900.       $game_party.clear_actions
  3901.       for member in $game_party.members do member.sv.start_action(member.sv.escape_ng) if member.movable? end
  3902.     end
  3903.     wait_for_message
  3904.     return success
  3905.   end
  3906.   #--------------------------------------------------------------------------
  3907.   # ● 输入下个命令 ★再定义
  3908.   #--------------------------------------------------------------------------
  3909.   def self.next_command
  3910.     begin
  3911.       if !actor || !actor.next_command
  3912.         $game_party.battle_members[@actor_index].sv.command_action = true
  3913.         @actor_index += 1
  3914.         if @actor_index >= $game_party.members.size
  3915.           for member in $game_party.battle_members.reverse
  3916.             break member.sv.start_action(member.sv.command_a) if member.inputable?
  3917.           end
  3918.           return false
  3919.         end
  3920.       end
  3921.     end until actor.inputable?
  3922.     actor.sv.start_action(actor.sv.command_b) if actor != nil && actor.inputable?
  3923.     if pre_actor
  3924.       pre_actor.sv.start_action(pre_actor.sv.command_a) if pre_actor != nil && pre_actor.inputable?
  3925.     end
  3926.     return true
  3927.   end
  3928.   #--------------------------------------------------------------------------
  3929.   # ● 输入上个命令 ★再定义
  3930.   #--------------------------------------------------------------------------
  3931.   def self.prior_command
  3932.     begin
  3933.       if !actor || !actor.prior_command
  3934.         $game_party.battle_members[@actor_index].sv.command_action = false
  3935.         @actor_index -= 1
  3936.         if @actor_index < 0
  3937.           for member in $game_party.battle_members
  3938.             break member.sv.start_action(member.sv.command_a) if member.inputable?
  3939.           end
  3940.           return false
  3941.         end
  3942.       end
  3943.     end until actor.inputable?
  3944.     actor.make_actions if actor.inputable?
  3945.     actor.sv.start_action(actor.sv.command_b) if actor.inputable?
  3946.     after_actor.sv.start_action(after_actor.sv.command_a) if after_actor != nil && after_actor.inputable?
  3947.     return true
  3948.   end
  3949.   #--------------------------------------------------------------------------
  3950.   # ● 取得上个角色输入的命令
  3951.   #--------------------------------------------------------------------------
  3952.   def self.pre_actor
  3953.     return if @actor_index == 0
  3954.     $game_party.members[@actor_index - 1]
  3955.   end
  3956.   #--------------------------------------------------------------------------
  3957.   # ● 取得输入命令后的角色
  3958.   #--------------------------------------------------------------------------
  3959.   def self.after_actor
  3960.     $game_party.members[@actor_index + 1]
  3961.   end
  3962.   #--------------------------------------------------------------------------
  3963.   # ● 战斗行动作角色前追加
  3964.   #--------------------------------------------------------------------------
  3965.   def self.unshift_action_battlers(battler)
  3966.     @action_battlers.unshift(battler)
  3967.   end
  3968. end  
  3969.  
  3970. #==============================================================================
  3971. # ■ Game_Battler
  3972. #------------------------------------------------------------------------------
  3973. #  处理战斗者的类、它是一个类追加角色的方法。
  3974. #==============================================================================
  3975. class Game_Battler < Game_BattlerBase
  3976.   #--------------------------------------------------------------------------
  3977.   # ● 公开实例变量
  3978.   #--------------------------------------------------------------------------
  3979.   attr_reader   :sv                     # 侧视图数据
  3980.   attr_accessor :flash_flg              # 闪光标志
  3981.   #--------------------------------------------------------------------------
  3982.   # ● 初始化物件
  3983.   #--------------------------------------------------------------------------
  3984.   alias initialize_game_battler_n03 initialize
  3985.   def initialize
  3986.     initialize_game_battler_n03
  3987.     @sv = SideView.new(self)
  3988.   end
  3989.   #--------------------------------------------------------------------------
  3990.   # ● 删除当前的战斗动作
  3991.   #--------------------------------------------------------------------------
  3992.   alias remove_current_action_game_battler_n03 remove_current_action
  3993.   def remove_current_action
  3994.     return @sv.derivation_skill_id = 0 if @sv.derivation_skill_id != 0
  3995.     remove_current_action_game_battler_n03
  3996.   end
  3997.   #--------------------------------------------------------------------------
  3998.   # ● 回合结束处理
  3999.   #--------------------------------------------------------------------------
  4000.   alias on_turn_end_game_battler_n03 on_turn_end
  4001.   def on_turn_end
  4002.     on_turn_end_game_battler_n03
  4003.     @sv.add_state = []
  4004.     @sv.result_damage = [@result.hp_damage, @result.mp_damage]
  4005.   end
  4006.   #--------------------------------------------------------------------------
  4007.   # ● 比较参数条件 data=[种别, 数值, 判别]
  4008.   #--------------------------------------------------------------------------
  4009.   def comparison_parameter(data)
  4010.     return true if data[0][0] == 0
  4011.     kind = data[0]
  4012.     num = data[1]
  4013.     select = data[2]
  4014.     case kind
  4015.     when  1 ; par = level
  4016.     when  2 ; par = mhp
  4017.     when  3 ; par = mmp
  4018.     when  4 ; par = hp
  4019.     when  5 ; par = mp
  4020.     when  6 ; par = tp
  4021.     when  7 ; par = atk
  4022.     when  8 ; par = self.def
  4023.     when  9 ; par = mat
  4024.     when 10 ; par = mdf
  4025.     when 11 ; par = agi
  4026.     when 12 ; par = luk
  4027.     end
  4028.     if num < 0
  4029.       case kind
  4030.       when  4 ; num = mhp * num / 100
  4031.       when  5 ; num = mmp * num / 100
  4032.       when  6 ; num = max_tp * num / 100
  4033.       end
  4034.       num = num.abs
  4035.     end  
  4036.     case select
  4037.     when  0 ; return par == num
  4038.     when  1 ; return par < num
  4039.     when  2 ; return par > num
  4040.     end
  4041.   end
  4042.   #--------------------------------------------------------------------------
  4043.   # ● 比较装备条件 data=[装备种别, 类型ID]
  4044.   #--------------------------------------------------------------------------
  4045.   def comparison_equip(data)
  4046.     kind = data[0]
  4047.     items = weapons if kind == 0
  4048.     items = armors  if kind == 1
  4049.     for item in items
  4050.       for id in data[1]
  4051.         return true if id > 0 && item.is_a?(RPG::Weapon) && item == $data_weapons[id.abs]
  4052.         return true if id > 0 && item.is_a?(RPG::Armor) && item == $data_armors[id.abs]
  4053.         return true if id < 0 && item.is_a?(RPG::Weapon) && item.wtype_id == id.abs
  4054.         return true if id < 0 && item.is_a?(RPG::Armor) && item.stype_id == id.abs
  4055.       end
  4056.     end
  4057.     return false
  4058.   end
  4059.  
  4060. end  
  4061. #==============================================================================
  4062. # ■ Game_Actor
  4063. #------------------------------------------------------------------------------
  4064. #  这是一个类来处理与主角。
  4065. #==============================================================================
  4066. class Game_Actor < Game_Battler
  4067.   #--------------------------------------------------------------------------
  4068.   # ● 公开实例变量
  4069.   #--------------------------------------------------------------------------
  4070.   attr_reader :actor_id                    # 主角ID
  4071.   #--------------------------------------------------------------------------
  4072.   # ● ID
  4073.   #--------------------------------------------------------------------------
  4074.   def id
  4075.     return @actor_id
  4076.   end
  4077.   #--------------------------------------------------------------------------
  4078.   # ● 是否使用精灵 ★再定义
  4079.   #--------------------------------------------------------------------------
  4080.   def use_sprite?
  4081.     return true
  4082.   end
  4083.   #--------------------------------------------------------------------------
  4084.   # ● 实行伤害效果 ★再定义
  4085.   #--------------------------------------------------------------------------
  4086.   def perform_damage_effect
  4087.     return if !N03::ACTOR_DAMAGE
  4088.     $game_troop.screen.start_shake(5, 5, 10)
  4089.     @sprite_effect_type = :blink
  4090.     Sound.play_actor_damage
  4091.   end
  4092.  
  4093. end
  4094.  
  4095. #==============================================================================
  4096. # ■ Game_Enemy
  4097. #------------------------------------------------------------------------------
  4098. #  它是一个类来处理敌人的角色。
  4099. #==============================================================================
  4100. class Game_Enemy < Game_Battler
  4101.   #--------------------------------------------------------------------------
  4102.   # ● 公开实例变量
  4103.   #--------------------------------------------------------------------------
  4104.   attr_reader :enemy_id                    # 敌人ID
  4105.   #--------------------------------------------------------------------------
  4106.   # ● ID
  4107.   #--------------------------------------------------------------------------
  4108.   def id
  4109.     return @enemy_id
  4110.   end
  4111.   #--------------------------------------------------------------------------
  4112.   # ● 等级
  4113.   #--------------------------------------------------------------------------
  4114.   def level
  4115.     return @sv.level
  4116.   end
  4117.   #--------------------------------------------------------------------------
  4118.   # ● 实行伤害效果 ★再定义
  4119.   #--------------------------------------------------------------------------
  4120.   def perform_damage_effect
  4121.     return if !N03::ENEMY_DAMAGE
  4122.     @sprite_effect_type = :blink
  4123.     Sound.play_enemy_damage
  4124.   end
  4125.   #--------------------------------------------------------------------------
  4126.   # ● 武器
  4127.   #--------------------------------------------------------------------------
  4128.   def weapons
  4129.     weapon1 = $data_weapons[@sv.enemy_weapon1_id]
  4130.     weapon2 = $data_weapons[@sv.enemy_weapon2_id]
  4131.     return [weapon1, weapon2]
  4132.   end
  4133.   #--------------------------------------------------------------------------
  4134.   # ● 防具
  4135.   #--------------------------------------------------------------------------
  4136.   def armors
  4137.     return [$data_armors[@sv.enemy_shield_id]]
  4138.   end
  4139.   #--------------------------------------------------------------------------
  4140.   # ● 二刀流的判定
  4141.   #--------------------------------------------------------------------------
  4142.   def dual_wield?
  4143.     return $data_weapons[@sv.enemy_weapon2_id] != nil
  4144.   end
  4145.   #--------------------------------------------------------------------------
  4146.   # ● 角色图像变更
  4147.   #--------------------------------------------------------------------------
  4148.   def graphics_change(battler_name)
  4149.     @battler_name = battler_name
  4150.   end
  4151.   #--------------------------------------------------------------------------
  4152.   # ● 取得通常攻击的动画ID
  4153.   #--------------------------------------------------------------------------
  4154.   def atk_animation_id1
  4155.     return weapons[0].animation_id if weapons[0]
  4156.     return weapons[1] ? 0 : 1
  4157.   end
  4158.   #--------------------------------------------------------------------------
  4159.   # ● 取得通常攻击的动画ID (二刀流:武器2)
  4160.   #--------------------------------------------------------------------------
  4161.   def atk_animation_id2
  4162.     return weapons[1] ? weapons[1].animation_id : 0
  4163.   end
  4164. end
  4165.  
  4166. #==============================================================================
  4167. # ■ Sprite_Base
  4168. #------------------------------------------------------------------------------
  4169. #  这是显示你添加处理精灵之类的。
  4170. #==============================================================================
  4171. class Sprite_Base < Sprite
  4172.   #--------------------------------------------------------------------------
  4173.   # ● 更新动画的坐标 (有归位)
  4174.   #--------------------------------------------------------------------------
  4175.   def update_animation_position_horming
  4176.     return if @action_end_cancel
  4177.     ani_ox_set if @horming
  4178.     camera_zoom = $sv_camera.zoom
  4179.     camera_zoom = 1 if @move_anime
  4180.     kind = 1
  4181.     kind = -1 if @ani_mirror && !@anime_no_mirror
  4182.     cell_data = @animation.frames[@animation.frame_max - (@ani_duration + @ani_rate - 1) / @ani_rate].cell_data
  4183.     for i in 0..15
  4184.       @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
  4185.       @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
  4186.     end
  4187.   end
  4188.   #--------------------------------------------------------------------------
  4189.   # ● 动画原始的坐标设置
  4190.   #--------------------------------------------------------------------------
  4191.   def ani_ox_set
  4192.     if !SceneManager.scene_is?(Scene_Battle)
  4193.       @real_x = x
  4194.       @real_y = y
  4195.     end
  4196.     @ani_ox = @real_x - ox + width / 2
  4197.     @ani_oy = @real_y - oy + height / 2
  4198.     @ani_oy -= height / 2 if @animation.position == 0
  4199.     @ani_oy += height / 2 if @animation.position == 2
  4200.   end
  4201.   #--------------------------------------------------------------------------
  4202.   # ● 更新动画
  4203.   #--------------------------------------------------------------------------
  4204.   alias update_animation_sprite_base_n03 update_animation
  4205.   def update_animation
  4206.     update_animation_position_horming if animation? && SceneManager.scene_is?(Scene_Battle) && @animation.position != 3
  4207.     update_animation_sprite_base_n03
  4208.   end
  4209.   #--------------------------------------------------------------------------
  4210.   # ● 动画的原点设定 ★再定义
  4211.   #--------------------------------------------------------------------------
  4212.   def set_animation_origin
  4213.     return ani_ox_set if @animation.position != 3
  4214.     if viewport == nil
  4215.       @ani_ox = Graphics.width / 2
  4216.       @ani_oy = Graphics.height / 2
  4217.     else
  4218.       @ani_ox = viewport.rect.width / 2
  4219.       @ani_oy = viewport.rect.height / 2
  4220.     end
  4221.   end
  4222.   #--------------------------------------------------------------------------
  4223.   # ● 动画精灵的设定 ★再定义
  4224.   #--------------------------------------------------------------------------
  4225.   def animation_set_sprites(frame)
  4226.     camera_zoom = 1
  4227.     camera_zoom = $sv_camera.zoom if @anime_camera_zoom && @animation.position != 3 && SceneManager.scene_is?(Scene_Battle)
  4228.     camera_x = $sv_camera.x
  4229.     camera_y = $sv_camera.y
  4230.     camera_x = camera_y = 0 if @animation.position == 3 or !SceneManager.scene_is?(Scene_Battle)
  4231.     plus_z = 5
  4232.     plus_z = 1000 if @animation.position == 3
  4233.     plus_z = -17 if @plus_z != nil && @plus_z == false
  4234.     plus_z = -self.z + 10 if @plus_z != nil && @plus_z == false && @animation.position == 3
  4235.     cell_data = frame.cell_data
  4236.     @ani_sprites.each_with_index do |sprite, i|
  4237.       next unless sprite
  4238.       pattern = cell_data[i, 0]
  4239.       if !pattern || pattern < 0
  4240.         sprite.visible = false
  4241.         next
  4242.       end
  4243.       sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  4244.       sprite.visible = true
  4245.       sprite.src_rect.set(pattern % 5 * 192,
  4246.         pattern % 100 / 5 * 192, 192, 192)
  4247.       if @ani_mirror && !@anime_no_mirror
  4248.         sprite.x = (@ani_ox - cell_data[i, 1] - camera_x) * camera_zoom
  4249.         sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
  4250.         sprite.angle = (360 - cell_data[i, 4])
  4251.         sprite.mirror = (cell_data[i, 5] == 0)
  4252.       else
  4253.         sprite.x = (@ani_ox + cell_data[i, 1] - camera_x) * camera_zoom
  4254.         sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
  4255.         sprite.angle = cell_data[i, 4]
  4256.         sprite.mirror = (cell_data[i, 5] == 1)
  4257.       end
  4258.       sprite.z = self.z + plus_z + i
  4259.       sprite.ox = 96
  4260.       sprite.oy = 96
  4261.       sprite.zoom_x = cell_data[i, 3] * camera_zoom / 100.0
  4262.       sprite.zoom_y = cell_data[i, 3] * camera_zoom/ 100.0
  4263.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  4264.       sprite.blend_type = cell_data[i, 7]
  4265.     end
  4266.   end
  4267.   #--------------------------------------------------------------------------
  4268.   # ● 精灵标志
  4269.   #--------------------------------------------------------------------------
  4270.   def set(battler, horming, camera_zoom, no_mirror)
  4271.     @battler = battler
  4272.     @next = true
  4273.     self.bitmap = Bitmap.new(@battler.sv.cw, @battler.sv.ch)
  4274.     self.ox = bitmap.width / 2
  4275.     self.oy = bitmap.height
  4276.     @horming = horming
  4277.     @anime_camera_zoom = camera_zoom
  4278.     @anime_no_mirror = no_mirror
  4279.     @battler.sv.reset_anime_data
  4280.   end  
  4281.   #--------------------------------------------------------------------------
  4282.   # ● 精灵坐标集
  4283.   #--------------------------------------------------------------------------
  4284.   def set_position(z, zoom_x, zoom_y, real_x, real_y)
  4285.     self.z = z
  4286.     self.zoom_x = zoom_x
  4287.     self.zoom_y = zoom_y
  4288.     @real_x = real_x
  4289.     @real_y = real_y
  4290.   end
  4291.   #--------------------------------------------------------------------------
  4292.   # ● 其他精灵的定时处理
  4293.   #--------------------------------------------------------------------------
  4294.   def other_process_timing(timing)
  4295.     se_flag = true
  4296.     se_flag = @se_flag if @se_flag != nil
  4297.     @battler.sv.timing.push([se_flag, timing.dup])
  4298.   end
  4299.   #--------------------------------------------------------------------------
  4300.   # ● 其他角色的定时处理
  4301.   #--------------------------------------------------------------------------
  4302.   def target_battler_process_timing(timing)
  4303.     for target in @timing_targets
  4304.       target.sv.timing.push([false, timing.dup])
  4305.     end  
  4306.   end
  4307.   #--------------------------------------------------------------------------
  4308.   # ● SE 闪光的定时处理
  4309.   #--------------------------------------------------------------------------
  4310.   alias animation_process_timing_sprite_base_n03 animation_process_timing
  4311.   def animation_process_timing(timing)
  4312.     target_battler_process_timing(timing) if @timing_targets && @timing_targets != []
  4313.     return other_process_timing(timing) if @next != nil
  4314.     animation_process_timing_sprite_base_n03(timing)
  4315.   end
  4316.   #--------------------------------------------------------------------------
  4317.   # ● 释放动画
  4318.   #--------------------------------------------------------------------------
  4319.   alias dispose_animation_sprite_base_n03 dispose_animation
  4320.   def dispose_animation
  4321.     dispose_animation_sprite_base_n03
  4322.   end
  4323. end
  4324.  
  4325.  
  4326. #==============================================================================
  4327. # ■ Sprite_Battler
  4328. #------------------------------------------------------------------------------
  4329. #  这是显示精灵角色的。
  4330. #==============================================================================
  4331. class Sprite_Battler < Sprite_Base
  4332.   #--------------------------------------------------------------------------
  4333.   # ● 公开实例变量
  4334.   #--------------------------------------------------------------------------
  4335.   attr_accessor   :removing             # 队伍脱离
  4336.   #--------------------------------------------------------------------------
  4337.   # ● 初始化物件
  4338.   #--------------------------------------------------------------------------
  4339.   alias initialize_sprite_battler_n03 initialize
  4340.   def initialize(viewport, battler = nil)
  4341.     initialize_sprite_battler_n03(viewport, battler)
  4342.     @real_x = @real_y = 0
  4343.     update_bitmap if @battler != nil
  4344.   end
  4345.   #--------------------------------------------------------------------------
  4346.   # ● 开始动画 ★再定义
  4347.   #--------------------------------------------------------------------------
  4348.   def start_animation(animation, mirror = false)
  4349.     return next_animation(animation, mirror) if animation?
  4350.     @animation = animation
  4351.     if @animation
  4352.       @horming = @battler.sv.anime_horming
  4353.       @anime_camera_zoom = @battler.sv.anime_camera_zoom
  4354.       @anime_no_mirror = @battler.sv.anime_no_mirror
  4355.       @timing_targets = @battler.sv.timing_targets
  4356.       @plus_z = @battler.sv.anime_plus_z
  4357.       @battler.sv.reset_anime_data
  4358.       @ani_mirror = mirror
  4359.       set_animation_rate
  4360.       @ani_duration = @animation.frame_max * @ani_rate + 1
  4361.       load_animation_bitmap
  4362.       make_animation_sprites
  4363.       set_animation_origin
  4364.     end
  4365.   end
  4366.   #--------------------------------------------------------------------------
  4367.   # ● 开始下一个动画
  4368.   #--------------------------------------------------------------------------
  4369.   def next_animation(animation, mirror)
  4370.     @next_anime = [] if @next_anime == nil
  4371.     @next_anime.push(Sprite_Base.new(viewport))
  4372.     @next_anime[@next_anime.size - 1].set(battler, @battler.sv.anime_horming, @battler.sv.anime_camera_zoom, @battler.sv.anime_no_mirror)
  4373.     @next_anime[@next_anime.size - 1].set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y)
  4374.     @next_anime[@next_anime.size - 1].start_animation(animation, mirror)
  4375.   end
  4376.   #--------------------------------------------------------------------------
  4377.   # ● 创建影图行
  4378.   #--------------------------------------------------------------------------
  4379.   def create_shadow
  4380.     reset_shadow
  4381.     return if @battler.sv.shadow == false
  4382.     @shadow = Sprite.new(viewport) if @shadow == nil
  4383.     @shadow.bitmap = Cache.character(@battler.sv.shadow)
  4384.     @shadow.ox = @shadow.bitmap.width / 2
  4385.     @shadow.oy = @shadow.bitmap.height / 2
  4386.   end
  4387.   #--------------------------------------------------------------------------
  4388.   # ● 初始化影图形
  4389.   #--------------------------------------------------------------------------
  4390.   def reset_shadow
  4391.     return if @shadow == nil
  4392.     @shadow.dispose
  4393.     @shadow = nil
  4394.   end  
  4395.   #--------------------------------------------------------------------------
  4396.   # ● 更新传输位图 ★再定义
  4397.   #--------------------------------------------------------------------------
  4398.   def update_bitmap
  4399.     update_bitmap_enemy if !@battler.actor?
  4400.     update_bitmap_actor if @battler.actor?
  4401.     update_src_rect if @battler != nil
  4402.     update_color if @battler != nil
  4403.   end
  4404.   #--------------------------------------------------------------------------
  4405.   # ● 传输位图:敌人
  4406.   #--------------------------------------------------------------------------
  4407.   def update_bitmap_enemy
  4408.     if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue
  4409.       @battler_name = @battler.battler_name
  4410.       @battler_hue = @battler.battler_hue
  4411.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4412.       @graphic_mirror_flag = @battler.sv.graphic_mirror_flag
  4413.       self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue)
  4414.       @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  4415.       create_shadow
  4416.       init_visibility
  4417.       @battler_id = @battler.id
  4418.     end
  4419.   end  
  4420.   #--------------------------------------------------------------------------
  4421.   # ● 传输位图:主角
  4422.   #--------------------------------------------------------------------------
  4423.   def update_bitmap_actor
  4424.     if @battler.character_name != @battler_name or @battler.character_index != @battler_index
  4425.       @battler_name = @battler.character_name
  4426.       @battler_index = @battler.character_index
  4427.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4428.       @graphic_mirror_flag = @battler.sv.graphic_mirror_flag
  4429.       self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index)
  4430.       @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  4431.       create_shadow
  4432.       init_visibility
  4433.       @battler_id = @battler.id
  4434.     end
  4435.   end
  4436.   #--------------------------------------------------------------------------
  4437.   # ● 初始化可见状态 ★再定义
  4438.   #--------------------------------------------------------------------------
  4439.   def init_visibility
  4440.     @battler_visible = @battler.alive?
  4441.     @battler_visible = true if @battler.sv.state(1) != "敵コラプス"
  4442.     @battler_visible = false if @battler.hidden?
  4443.     @battler.sv.opacity = 0 unless @battler_visible
  4444.     self.opacity = 0 unless @battler_visible
  4445.     self.opacity = 255 if @battler_visible
  4446.     @battler.sv.weapon_visible = @battler_visible
  4447.   end
  4448.   #--------------------------------------------------------------------------
  4449.   # ● 更新传输矩形
  4450.   #--------------------------------------------------------------------------
  4451.   def update_src_rect
  4452.     return if @battler.sv.collapse
  4453.     if @battler_graphic_file_index != @battler.sv.graphic_file_index
  4454.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4455.       self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index) if @battler.actor?
  4456.       self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue) if !@battler.actor?
  4457.       @battler.sv.set_graphics(self.bitmap.width, self.bitmap.height)
  4458.     end
  4459.     anime_off if @battler.sv.anime_off
  4460.     self.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
  4461.     self.opacity = @battler.sv.opacity if @battler_visible
  4462.     set_process_timing(@battler.sv.timing) if @battler && @battler.sv.timing != []
  4463.   end
  4464.   #--------------------------------------------------------------------------
  4465.   # ● 更新位置 ★再定义
  4466.   #--------------------------------------------------------------------------
  4467.   def update_position
  4468.     @real_x = @battler.sv.x / 100
  4469.     @real_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust)/ 100
  4470.     self.x = @real_x - $sv_camera.x
  4471.     self.y = @real_y - $sv_camera.y
  4472.     self.z = @battler.sv.z - @battler.sv.c / 100
  4473.     if @battler.sv.h <= 0
  4474.       self.x += $sv_camera.sx / 100
  4475.       self.y += $sv_camera.sy / 100
  4476.     end  
  4477.     self.x *= $sv_camera.zoom
  4478.     self.y *= $sv_camera.zoom
  4479.   end
  4480.   #--------------------------------------------------------------------------
  4481.   # ● 更新原点 ★再定义
  4482.   #--------------------------------------------------------------------------
  4483.   def update_origin
  4484.     return if !bitmap or @battler.sv.collapse
  4485.     self.ox = @battler.sv.ox
  4486.     self.oy = @battler.sv.oy
  4487.     self.angle = @battler.sv.angle
  4488.     self.zoom_x = @battler.sv.zoom_x * $sv_camera.zoom
  4489.     self.zoom_y = @battler.sv.zoom_y * $sv_camera.zoom
  4490.     self.mirror = @battler.sv.mirror if !@graphic_mirror_flag
  4491.     self.mirror = !@battler.sv.mirror if @graphic_mirror_flag
  4492.   end
  4493.   #--------------------------------------------------------------------------
  4494.   # ● 更新影图像
  4495.   #--------------------------------------------------------------------------
  4496.   def update_shadow
  4497.     @shadow.visible = @battler.sv.shadow_visible
  4498.     @shadow.opacity = @battler.sv.opacity if @battler.sv.opacity_data[3]
  4499.     @shadow.opacity = self.opacity if !@battler.sv.opacity_data[3]
  4500.     @shadow.x = @real_x - $sv_camera.x
  4501.     @shadow.y = (@battler.sv.y - @battler.sv.c)/ 100 - $sv_camera.y
  4502.     @shadow.z = @battler.sv.z - 10
  4503.     @shadow.zoom_x = $sv_camera.zoom
  4504.     @shadow.zoom_y = $sv_camera.zoom
  4505.     @shadow.x += $sv_camera.sx / 100
  4506.     @shadow.y += $sv_camera.sy / 100
  4507.     @shadow.x *= $sv_camera.zoom
  4508.     @shadow.y *= $sv_camera.zoom
  4509.     @shadow.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4510.   end
  4511.   #--------------------------------------------------------------------------
  4512.   # ● 更新气球
  4513.   #--------------------------------------------------------------------------
  4514.   def update_balloon
  4515.     if @battler.sv.balloon_data == [] && @balloon
  4516.       @balloon_data = []
  4517.       @balloon.dispose
  4518.       return @balloon = nil
  4519.     elsif @battler.sv.balloon_data != [] && @battler.sv.balloon_data != @balloon_data
  4520.       @balloon_data = @battler.sv.balloon_data
  4521.       @balloon = Sprite.new(self.viewport)
  4522.       @balloon.bitmap = Cache.system("Balloon")
  4523.       @balloon.zoom_x = @balloon_data[3]
  4524.       @balloon.zoom_y = @balloon_data[3]
  4525.       @balloon.ox = 32 if @battler.sv.mirror
  4526.       @balloon.oy = 16
  4527.       @balloon_count = 0
  4528.     end
  4529.     return if !@balloon
  4530.     @balloon.opacity = self.opacity
  4531.     @balloon.x = self.x
  4532.     @balloon.y = self.y - @battler.sv.ch * $sv_camera.zoom
  4533.     @balloon.z = self.z + 20
  4534.     @balloon.src_rect.set(32 + @balloon_count / @balloon_data[2] * 32, @balloon_data[1] * 32, 32, 32) if @balloon_count % @balloon_data[2] == 0
  4535.     @balloon.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4536.     @balloon_count += 1
  4537.     @balloon_count = 0 if @balloon_count == @balloon_data[2] * 7
  4538.   end
  4539.   #--------------------------------------------------------------------------
  4540.   # ● 更新色调变更
  4541.   #--------------------------------------------------------------------------
  4542.   def update_color
  4543.     color_set if @battler.sv.color_set != []
  4544.     return if @color_data == nil
  4545.     @color_data[4] -= 1
  4546.     if @color_data[4] == 0 && @color_data[5] != 0
  4547.       @color_data[4] = @color_data[5]
  4548.       @color_data[5] = 0
  4549.       @color_data[6] = [0,0,0,0]
  4550.     elsif @color_data[4] == 0
  4551.       @remain_color_data = @color_data
  4552.       @battler.sv.color = @color_data.dup
  4553.       return @color_data = nil
  4554.     end  
  4555.     for i in 0..3
  4556.       @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
  4557.     end  
  4558.     @battler.sv.color = @color_data.dup
  4559.     self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
  4560.   end
  4561.   #--------------------------------------------------------------------------
  4562.   # ● 更新残像
  4563.   #--------------------------------------------------------------------------
  4564.   def update_mirage
  4565.     if @battler.sv.mirage == [] && @mirages
  4566.       @mirage_data = []
  4567.       for mirage in @mirages do mirage.dispose end
  4568.       return @mirages = nil
  4569.     elsif @battler.sv.mirage != [] && @battler.sv.mirage != @mirage_data
  4570.       @mirage_data = @battler.sv.mirage
  4571.       @mirages = []
  4572.       for i in 0...@mirage_data[1] do @mirages[i] = Sprite.new(self.viewport) end
  4573.       @mirage_count = 0
  4574.     end
  4575.     return if !@mirages
  4576.     @mirage_count += 1
  4577.     @mirage_count = 0 if @mirage_count == @mirage_data[2] * @mirages.size
  4578.     for i in [email]0...@mirages.size[/email]
  4579.       mirage_body(@mirages[i], @mirage_data[4]) if @mirage_count == 1 + i * @mirage_data[2]
  4580.     end
  4581.   end
  4582.   #--------------------------------------------------------------------------
  4583.   # ● 残像本体
  4584.   #--------------------------------------------------------------------------
  4585.   def mirage_body(body, opacity)
  4586.     body.bitmap = self.bitmap.dup
  4587.     body.x = self.x
  4588.     body.y = self.y
  4589.     body.ox = self.ox
  4590.     body.oy = self.oy
  4591.     body.z = self.z - 20
  4592.     body.mirror = self.mirror
  4593.     body.angle = self.angle
  4594.     body.opacity = opacity * self.opacity / 255
  4595.     body.zoom_x = self.zoom_x
  4596.     body.zoom_y = self.zoom_y   
  4597.     body.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
  4598.     body.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4599.   end   
  4600.   #--------------------------------------------------------------------------
  4601.   # ● 更新下一个动画
  4602.   #--------------------------------------------------------------------------
  4603.   def update_next_anime
  4604.     return if !@next_anime
  4605.     for anime in @next_anime
  4606.       anime.update
  4607.       anime.set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y) if @horming
  4608.       anime.dispose if !anime.animation?
  4609.       @next_anime.delete(anime) if !anime.animation?
  4610.     end  
  4611.   end
  4612.   #--------------------------------------------------------------------------
  4613.   # ● 更新帧数
  4614.   #--------------------------------------------------------------------------
  4615.   alias update_sprite_battler_n03 update
  4616.   def update
  4617.     @battler.sv.update if @battler
  4618.     update_sprite_battler_n03
  4619.     update_next_anime
  4620.     update_shadow  if @battler && @shadow
  4621.     update_mirage  if @battler
  4622.     update_balloon if @battler
  4623.     update_remove if @battler && @removing && @battler.sv.change_up
  4624.   end
  4625.   #--------------------------------------------------------------------------
  4626.   # ● 战斗动画消除
  4627.   #--------------------------------------------------------------------------
  4628.   def anime_off
  4629.     @battler.sv.anime_off = false
  4630.     dispose_animation
  4631.     for anime in @next_anime do anime.dispose_animation end if @next_anime
  4632.   end
  4633.   #--------------------------------------------------------------------------
  4634.   # ● 角色替换
  4635.   #--------------------------------------------------------------------------
  4636.   def remove
  4637.     @battler.sv.start_action(@battler.sv.remove_action)
  4638.     $sv_camera.wait = 40
  4639.     @battler.sv.add_action("eval('set_change')")
  4640.     @removing = true
  4641.   end
  4642.   #--------------------------------------------------------------------------
  4643.   # ● 更新角色替换
  4644.   #--------------------------------------------------------------------------
  4645.   def update_remove
  4646.     @battler.sv.change_up = false
  4647.     @removing = false
  4648.     @battler = nil
  4649.   end  
  4650.   #--------------------------------------------------------------------------
  4651.   # ● 加入角色
  4652.   #--------------------------------------------------------------------------
  4653.   def join(join_battler)
  4654.     $sv_camera.wait = 30
  4655.     @battler = join_battler
  4656.     @battler_name = @battler.character_name
  4657.     @battler_index = @battler.character_index
  4658.     @battler_graphic_file_index = @battler.sv.graphic_file_index
  4659.     self.bitmap = Cache.character(@battler_name)
  4660.     @battler.sv.setup(self.bitmap.width, self.bitmap.height, true)
  4661.     create_shadow
  4662.     init_visibility
  4663.   end
  4664.   #--------------------------------------------------------------------------
  4665.   # ● 通常的设定返回 ★再定义
  4666.   #--------------------------------------------------------------------------
  4667.   def revert_to_normal
  4668.     self.blend_type = 0
  4669.     self.opacity = 255
  4670.   end
  4671.   #--------------------------------------------------------------------------
  4672.   # ● 更新战斗不能效果
  4673.   #--------------------------------------------------------------------------
  4674.   alias update_collapse_sprite_battler_n03 update_collapse
  4675.   def update_collapse
  4676.     return if @battler.sv.state(1) != "敵コラプス"
  4677.     update_collapse_sprite_battler_n03
  4678.     @battler.sv.weapon_visible = false
  4679.   end
  4680.   #--------------------------------------------------------------------------
  4681.   # ● 更新Boss战斗不能效果 ★再定义
  4682.   #--------------------------------------------------------------------------
  4683.   def update_boss_collapse
  4684.     @effect_duration = @battler.sv.ch if @effect_duration >= @battler.sv.ch
  4685.     alpha = @effect_duration * 120 / @battler.sv.ch
  4686.     self.ox = @battler.sv.cw / 2 + @effect_duration % 2 * 4 - 2
  4687.     self.blend_type = 1
  4688.     self.color.set(255, 255, 255, 255 - alpha)
  4689.     self.opacity = alpha
  4690.     self.src_rect.y -= 1
  4691.     Sound.play_boss_collapse2 if @effect_duration % 20 == 19
  4692.   end
  4693.   #--------------------------------------------------------------------------
  4694.   # ● 另个精灵的定时处理
  4695.   #--------------------------------------------------------------------------
  4696.   def set_process_timing(timing_data)
  4697.     for data in timing_data
  4698.       set_timing(data[0],data[1])
  4699.     end
  4700.     @battler.sv.timing = []
  4701.   end
  4702.   #--------------------------------------------------------------------------
  4703.   # ● 定时的处理
  4704.   #--------------------------------------------------------------------------
  4705.   def set_timing(se_flag, data)
  4706.     @ani_rate = 4
  4707.     data.se.play if se_flag
  4708.     case data.flash_scope
  4709.     when 1 ;self.flash(data.flash_color, data.flash_duration * @ani_rate)
  4710.     when 2 ;viewport.flash(data.flash_color, data.flash_duration * @ani_rate) if viewport
  4711.     when 3 ;self.flash(nil, data.flash_duration * @ani_rate)
  4712.     end
  4713.   end
  4714.   #--------------------------------------------------------------------------
  4715.   # ● 色调变更
  4716.   #--------------------------------------------------------------------------
  4717.   def color_set
  4718.     set = @battler.sv.color_set
  4719.     @battler.sv.color_set= []
  4720.     set[4] = 1 if set[4] == 0
  4721.     @remain_color_data = [0,0,0,0] if @remain_color_data == nil
  4722.     @color_data = @remain_color_data
  4723.     @color_data[4] = set[4]
  4724.     @color_data[5] = set[5]
  4725.     @color_data[6] = set
  4726.   end
  4727.   #--------------------------------------------------------------------------
  4728.   # ● 释放
  4729.   #--------------------------------------------------------------------------
  4730.   alias dispose_sprite_battler_n03 dispose
  4731.   def dispose
  4732.     dispose_sprite_battler_n03
  4733.     @shadow.dispose if @shadow != nil
  4734.     @balloon.dispose if @balloon != nil
  4735.     for mirage in @mirages do mirage.dispose end if @mirages != nil
  4736.     for anime in @next_anime do anime.dispose end if @next_anime
  4737.   end
  4738. end
  4739.  
  4740.  
  4741. #==============================================================================
  4742. # ■ Spriteset_Battle
  4743. #------------------------------------------------------------------------------
  4744. #  这是一个类结合了精灵的战斗画面。
  4745. #==============================================================================
  4746. class Spriteset_Battle
  4747.   #--------------------------------------------------------------------------
  4748.   # ● 战斗背景(地)创建精灵 ★再定义
  4749.   #--------------------------------------------------------------------------
  4750.   def create_battleback1
  4751.     @back1_sprite = Sprite_Battle_Back.new(@viewport1, 1, battleback1_name)
  4752.     @back1_sprite.set_graphics(battleback1_bitmap) if battleback1_name != nil
  4753.     @back1_sprite.z = 0
  4754.   end
  4755.   #--------------------------------------------------------------------------
  4756.   # ● 战斗背景(壁)创建精灵 ★再定义
  4757.   #--------------------------------------------------------------------------
  4758.   def create_battleback2
  4759.     @back2_sprite = Sprite_Battle_Back.new(@viewport1, 2, battleback2_name)
  4760.     @back2_sprite.set_graphics(battleback2_bitmap) if battleback2_name != nil
  4761.     @back2_sprite.z = 1
  4762.   end
  4763.   #--------------------------------------------------------------------------
  4764.   # ● 创建角色精灵 ★再定义
  4765.   #--------------------------------------------------------------------------
  4766.   def create_actors
  4767.     @actor_sprites = []
  4768.     for i in 0...$game_party.max_battle_members
  4769.       @actor_sprites[i] = Sprite_Battler.new(@viewport1, $game_party.members[i])
  4770.     end
  4771.     @effect_sprites = Spriteset_Sideview.new(@viewport1)
  4772.   end
  4773.   #--------------------------------------------------------------------------
  4774.   # ● 更新角色精灵 ★再定义
  4775.   #--------------------------------------------------------------------------
  4776.   def update_actors
  4777.     @actor_sprites.each_with_index do |sprite, i|
  4778.       sprite_join($game_party.members[i], sprite) if sprite.battler == nil && sprite.battler != $game_party.members[i]
  4779.       sprite.remove if sprite.battler != nil && !sprite.removing && sprite.battler != $game_party.members[i]
  4780.       sprite.update
  4781.     end
  4782.     @effect_sprites.update
  4783.     update_program
  4784.   end
  4785.   #--------------------------------------------------------------------------
  4786.   # ● 加入精灵成员
  4787.   #--------------------------------------------------------------------------
  4788.   def sprite_join(member, sprite)
  4789.     for sp in @actor_sprites
  4790.       sp.update_remove if member == sp.battler && !sp.battler.sv.change_up
  4791.     end
  4792.     sprite.join(member)
  4793.   end
  4794.   #--------------------------------------------------------------------------
  4795.   # ● 更新战斗程序
  4796.   #--------------------------------------------------------------------------
  4797.   def update_program
  4798.     return if $sv_camera.program_scroll == []
  4799.     for data in  $sv_camera.program_scroll
  4800.       @back1_sprite.start_back_data(data) if data[2] == 1
  4801.       @back2_sprite.start_back_data(data) if data[2] == 2
  4802.     end
  4803.     $sv_camera.program_scroll = []
  4804.   end
  4805.   #--------------------------------------------------------------------------
  4806.   # ● 实行打击时的战斗动画
  4807.   #--------------------------------------------------------------------------
  4808.   def set_hit_animation(battler, weapon_index, hit_targets, miss)
  4809.     @effect_sprites.set_hit_animation(battler, weapon_index, hit_targets, miss)
  4810.   end
  4811.   #--------------------------------------------------------------------------
  4812.   # ● 伤害POP
  4813.   #--------------------------------------------------------------------------
  4814.   def set_damage_pop(target)
  4815.     @effect_sprites.set_damage_pop(target)
  4816.   end
  4817.   #--------------------------------------------------------------------------
  4818.   # ● 释放
  4819.   #--------------------------------------------------------------------------
  4820.   alias dispose_spriteset_battle_n03 dispose
  4821.   def dispose
  4822.     dispose_spriteset_battle_n03
  4823.     @effect_sprites.dispose
  4824.   end
  4825. end
  4826.  
  4827. #==============================================================================
  4828. # ■ Window_BattleLog
  4829. #------------------------------------------------------------------------------
  4830. #  进行战斗的实况显示窗口。
  4831. #==============================================================================
  4832. class Window_BattleLog < Window_Selectable
  4833.   #--------------------------------------------------------------------------
  4834.   # ● 等待 ★再定义
  4835.   #--------------------------------------------------------------------------
  4836.   def wait
  4837.   end
  4838.   #--------------------------------------------------------------------------
  4839.   # ● 等待和清除 ★再定义
  4840.   #--------------------------------------------------------------------------
  4841.   def wait_and_clear
  4842.     $sv_camera.wait = 10
  4843.   end
  4844.   #--------------------------------------------------------------------------
  4845.   # ● 显示动作结果 ★再定义
  4846.   #--------------------------------------------------------------------------
  4847.   def display_action_results(target, item)
  4848.     if target.result.used
  4849.       last_line_number = line_number
  4850.       display_critical(target, item)
  4851.       display_damage(target, item)
  4852.       display_affected_status(target, item)
  4853.       display_failure(target, item)
  4854.     end
  4855.     off if !N03::BATTLE_LOG
  4856.   end
  4857.   #--------------------------------------------------------------------------
  4858.   # ● 隐藏窗口
  4859.   #--------------------------------------------------------------------------
  4860.   def off
  4861.     @back_sprite.visible = self.visible = false
  4862.   end
  4863. end
  4864. #==============================================================================
  4865. # ■ Game_Interpreter
  4866. #------------------------------------------------------------------------------
  4867. #  这是一个事件命令的解释器。
  4868. #==============================================================================
  4869. class Game_Interpreter
  4870.   #--------------------------------------------------------------------------
  4871.   # ● 开关的操作
  4872.   #--------------------------------------------------------------------------
  4873.   alias command_121_game_interpreter_n03 command_121
  4874.   def command_121
  4875.     command_121_game_interpreter_n03
  4876.     $sv_camera.program_check
  4877.   end
  4878. end

点评

是哪个横版?你问题描述得不够详细的说  发表于 2014-7-31 22:16

Lv1.梦旅人

梦石
0
星屑
50
在线时间
124 小时
注册时间
2013-5-11
帖子
96
2
 楼主| 发表于 2014-7-31 22:34:38 | 只看该作者
@VIPArcher 已更新
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
124 小时
注册时间
2013-5-11
帖子
96
3
 楼主| 发表于 2014-7-31 22:39:50 | 只看该作者
问题已自行解决.
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-25 19:17

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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