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

Project1

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

[已经过期] 使用全动画脚本后,中毒不显示掉血(附工程)

[复制链接]

Lv1.梦旅人

梦石
0
星屑
136
在线时间
623 小时
注册时间
2008-11-16
帖子
440
跳转到指定楼层
1
发表于 2014-4-1 22:55:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 萧萧风色 于 2014-4-2 10:33 编辑

RT,中毒减血的效果正常,可是不显示中毒掉血的数值。我尝试修改damage_pop相关的脚本,但无果恳请各位高手帮忙看看
范例工程地址:
链接: http://pan.baidu.com/s/1dDnCwnB 提取密码: yqqp
附上全动画脚本
  1. #==============================================================================
  2. # ■ 全动画战斗系统(修改加强再加强版)
  3. #------------------------------------------------------------------------------
  4. #  By whbm
  5. #   应用脚本 彩虹神剑 By 66
  6. #==============================================================================
  7.     $fangyu = 0
  8. #新加部分 改进基础 叮当猫的全动画脚本
  9. #================
  10. module RPG
  11.   class Sprite < ::Sprite
  12.     @@_animations = []
  13.     @@_reference_count = {}
  14.    
  15.     def dispose
  16.       dispose_damage
  17.       dispose_animation
  18.       dispose_loop_animation
  19.        dispose_loop_animation1
  20.       super
  21.     end
  22.    
  23.    
  24.   
  25.    
  26.     def loop_animation1(animation)
  27.       return if animation == @_loop_animation1
  28.       dispose_loop_animation1
  29.       @_loop_animation1 = animation
  30.       return if @_loop_animation1 == nil
  31.       @_loop_animation1_index = 0
  32.       animation_name = @_loop_animation1.animation_name
  33.       animation_hue = @_loop_animation1.animation_hue
  34.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  35.       if @@_reference_count.include?(bitmap)
  36.         @@_reference_count[bitmap] += 1
  37.       else
  38.         @@_reference_count[bitmap] = 1
  39.       end
  40.       @_loop_animation1_sprites = []
  41.       for i in 0..15
  42.         sprite = ::Sprite.new(self.viewport)
  43.         sprite.bitmap = bitmap
  44.         sprite.visible = false
  45.         @_loop_animation1_sprites.push(sprite)
  46.       end
  47.       update_loop_animation1
  48.     end
  49.    
  50.    
  51.    

  52.     def dispose_loop_animation1
  53.       if @_loop_animation1_sprites != nil
  54.         sprite = @_loop_animation1_sprites[0]
  55.         if sprite != nil
  56.           @@_reference_count[sprite.bitmap] -= 1
  57.           if @@_reference_count[sprite.bitmap] == 0
  58.             sprite.bitmap.dispose
  59.           end
  60.         end
  61.         for sprite in @_loop_animation1_sprites
  62.           sprite.dispose
  63.         end
  64.         @_loop_animation1_sprites = nil
  65.         @_loop_animation1 = nil
  66.       end
  67.     end
  68.    
  69.    
  70.    
  71.    
  72.     def update_loop_animation1
  73.       frame_index = @_loop_animation1_index
  74.       cell_data = @_loop_animation1.frames[frame_index].cell_data
  75.       position = @_loop_animation1.position
  76.       animation_set_sprites(@_loop_animation1_sprites, cell_data, position)
  77.       for timing in @_loop_animation1.timings
  78.         if timing.frame == frame_index
  79.           animation_process_timing(timing, true)
  80.         end
  81.       end
  82.     end
  83.    
  84.   end
  85. end
  86. #===============
  87. #新加部分

  88. class Spriteset_Battle
  89.   #--------------------------------------------------------------------------
  90.   # ● 初始化变量
  91.   #--------------------------------------------------------------------------
  92.   def initialize
  93.     # 生成显示端口
  94.     @viewport1 = Viewport.new(0, 0, 640, 480)
  95.     @viewport2 = Viewport.new(0, 0, 640, 480)
  96.     @viewport3 = Viewport.new(0, 0, 640, 480)
  97.     @viewport4 = Viewport.new(0, 0, 640, 480)
  98.     @viewport2.z = 101
  99.     @viewport3.z = 200
  100.     @viewport4.z = 5000
  101.     # 生成战斗背景活动块
  102.     @battleback_sprite = Sprite.new(@viewport1)
  103.     # 生成敌人活动块
  104.     @enemy_sprites = []
  105.     for enemy in $game_troop.enemies.reverse
  106. #      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  107.       @enemy_sprites.push(Sprite_Battler.new(@viewport4, enemy))#敌人的显示高度
  108.     end
  109.     # 生成敌人活动块
  110.     @actor_sprites = []
  111.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  112.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  113.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  114.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  115.     # 生成天候
  116.     @weather = RPG::Weather.new(@viewport1)
  117.     # 生成图片活动块
  118.     @picture_sprites = []
  119.     for i in 51..100
  120.       @picture_sprites.push(Sprite_Picture.new(@viewport3,
  121.         $game_screen.pictures[i]))
  122.     end
  123.     # 生成计时器块
  124.     @timer_sprite = Sprite_Timer.new
  125.     # 刷新画面
  126.     update
  127.   end
  128.   #..........................................................................
  129.   #--------------------------------------------------------------------------
  130.   # ● 胜利图
  131.   #--------------------------------------------------------------------------
  132.   def win
  133.     for sprite in @actor_sprites
  134.       sprite.win
  135.     end
  136.   end
  137.   #..........................................................................
  138.   #--------------------------------------------------------------------------
  139.   # ● 刷新画面
  140.   #--------------------------------------------------------------------------
  141.   def update
  142.     # 刷新角色的活动块 (对应角色的替换)
  143.     @actor_sprites[0].battler = $game_party.actors[0]
  144.     @actor_sprites[1].battler = $game_party.actors[1]
  145.     @actor_sprites[2].battler = $game_party.actors[2]
  146.     @actor_sprites[3].battler = $game_party.actors[3]
  147.     # 战斗背景的文件名与现在情况有差异的情况下
  148.     if @battleback_name != $game_temp.battleback_name
  149.       @battleback_name = $game_temp.battleback_name
  150.       if @battleback_sprite.bitmap != nil
  151.         @battleback_sprite.bitmap.dispose
  152.       end
  153.       @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  154.       @battleback_sprite.src_rect.set(0, 0, 640, 480)
  155.     end
  156.     # 刷新战斗者的活动块
  157.     for sprite in @enemy_sprites + @actor_sprites
  158.       sprite.update
  159.     end
  160.     # 刷新天气图形
  161.     @weather.type = $game_screen.weather_type
  162.     @weather.max = $game_screen.weather_max
  163.     @weather.update
  164.     # 刷新图片活动块
  165.     for sprite in @picture_sprites
  166.       sprite.update
  167.     end
  168.     # 刷新计时器活动块
  169.     @timer_sprite.update
  170.     # 设置画面的色调与震动位置
  171.     @viewport1.tone = $game_screen.tone
  172.     @viewport1.ox = $game_screen.shake
  173.     # 设置画面的闪烁色
  174.     @viewport4.color = $game_screen.flash_color
  175.     # 刷新显示端口
  176.     @viewport1.update
  177.     @viewport2.update
  178.     @viewport4.update
  179.   end
  180. end
  181. class Arrow_Enemy < Arrow_Base
  182.   #--------------------------------------------------------------------------
  183.   # ● 获取光标指向的敌人
  184.   #--------------------------------------------------------------------------
  185.   def enemy
  186.     return $game_troop.enemies[@index]
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● 刷新画面
  190.   #--------------------------------------------------------------------------
  191.   def update
  192.     super
  193.     # 如果指向不存在的敌人就离开
  194.     $game_troop.enemies.size.times do
  195.       break if self.enemy.exist?
  196.       [url=home.php?mod=space&uid=370741]@Index[/url] += 1
  197.       [url=home.php?mod=space&uid=370741]@Index[/url] %= $game_troop.enemies.size
  198.     end
  199.     # 光标右
  200.     if Input.repeat?(Input::RIGHT)
  201.       $game_system.se_play($data_system.cursor_se)
  202.       $game_troop.enemies.size.times do
  203.         @index += 1
  204.         @index %= $game_troop.enemies.size
  205.         break if self.enemy.exist?
  206.       end
  207.     end
  208.     # 光标左
  209.     if Input.repeat?(Input::LEFT)
  210.       $game_system.se_play($data_system.cursor_se)
  211.       $game_troop.enemies.size.times do
  212.         @index += $game_troop.enemies.size - 1
  213.         @index %= $game_troop.enemies.size
  214.         break if self.enemy.exist?
  215.       end
  216.     end
  217.     # 设置活动块坐标
  218.     if self.enemy != nil
  219.       self.x = self.enemy.screen_x + self.ox
  220.       self.y = self.enemy.screen_y + self.oy
  221.     end
  222.   end
  223. end
  224. class Arrow_Actor < Arrow_Base
  225.   #--------------------------------------------------------------------------
  226.   # ● 获取光标指向的角色
  227.   #--------------------------------------------------------------------------
  228.   def actor
  229.     return $game_party.actors[@index]
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ● 刷新画面
  233.   #--------------------------------------------------------------------------
  234.   def update
  235.     super
  236.     # 光标右
  237.     if Input.repeat?(Input::RIGHT)
  238.       $game_system.se_play($data_system.cursor_se)
  239.       @index += 1
  240.       @index %= $game_party.actors.size
  241.     end
  242.     # 光标左
  243.     if Input.repeat?(Input::LEFT)
  244.       $game_system.se_play($data_system.cursor_se)
  245.       @index += $game_party.actors.size - 1
  246.       @index %= $game_party.actors.size
  247.     end
  248.     # 设置活动块坐标
  249.     if self.actor != nil
  250.       self.x = self.actor.screen_x + self.ox
  251.       self.y = self.actor.screen_y + self.oy
  252.     end
  253.   end
  254. end
  255. class Scene_Battle
  256.   #--------------------------------------------------------------------------
  257.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  258.   #--------------------------------------------------------------------------
  259.   def update_phase4_step3
  260.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  261.     if @animation1_id == 0
  262.       @active_battler.white_flash = true
  263.     else
  264.     # 添加施法动画
  265. #     @active_battler.setup_battler_ani(@active_battler.battler_name.split(/★/)[8], 1)
  266.       @active_battler.animation_id = @animation1_id
  267.       @active_battler.animation_hit = true
  268.     end
  269.     # 对像方动画
  270.     for target in @target_battlers
  271.       target.animation_id = @animation2_id
  272.       target.animation_hit = (target.damage != "Miss")
  273.       ###########################################################
  274.       target.setup_battler_dead_ani(0)
  275.       ############################################################
  276.       #.......................................................................
  277.       if target.is_a?(Game_Actor)
  278.         ##############
  279.         if target.guarding?
  280.           $fangyu = 1
  281.         end
  282.         ##############
  283.         if target.current_action.kind == 0 and target.current_action.basic == 1
  284.            target.setup_battler_ani(target.battler_name.split(/★/)[2], 1)
  285.          #else
  286.            #target.current_action.kind == 0 and target.current_action.basic == 1
  287.           # target.setup_battler_ani(target.battler_name.split(/★/)[3], 0)
  288.            else
  289.          target.setup_battler_hurt_ani(0)
  290.         end
  291.       end
  292.       if target.is_a?(Game_Enemy)
  293.        if target.current_action.kind == 0 and target.current_action.basic == 1
  294.           target.setup_battler_ani(target.battler_name.split(/★/)[1])
  295.         else
  296.           target.setup_battler_hurt_ani(0)
  297.         end
  298.       end
  299.       #.......................................................................
  300.     end
  301.     # 对像方动画
  302.     for target in @target_battlers
  303.       target.animation_id = @animation2_id
  304.       target.animation_hit = (target.damage != "Miss")
  305.       #......................................................................
  306.     end
  307.     # 限制动画长度、最低 8 帧
  308.     @wait_count = 8
  309.     # 移至步骤 5
  310.     @phase4_step = 5
  311.   end
  312.   #--------------------------------------------------------------------------
  313.   # ● 刷新画面 (主回合步骤 4 : 对像方动画) ★
  314.   #--------------------------------------------------------------------------
  315.   def update_phase4_step4
  316.     # 移至步骤 5
  317.     @phase4_step = 5
  318.   end
  319. end
  320. class Game_Actor < Game_Battler
  321.   
  322. #小改动
  323. #############################################################################
  324. #                                横版修改                                   #
  325. #############################################################################
  326.   
  327.   #--------------------------------------------------------------------------
  328.   # ● 取得战斗画面的 X 坐标
  329.   #--------------------------------------------------------------------------
  330. #  def screen_x
  331. #    case self.index
  332. #    when 0
  333. #      return 515
  334. #    when 1
  335. #      return 440
  336. #    when 2
  337. #      return 590
  338. #    when 3
  339. #      return 390
  340. #    else
  341. #      return 640
  342. #    end
  343. #  end
  344.   #--------------------------------------------------------------------------
  345.   # ● 取得战斗画面的 Y 坐标
  346.   #--------------------------------------------------------------------------
  347. #  def screen_y
  348. #    case self.index
  349. #    when 0
  350. #      return 310
  351. #    when 1
  352. #      return 295
  353. #    when 2
  354. #      return 325
  355. #    when 3
  356. #      return 340
  357. #    else
  358. #      return 1000
  359. #    end
  360. #  end
  361.   #--------------------------------------------------------------------------
  362.   # ● 取得战斗画面的 Z 坐标
  363.   #--------------------------------------------------------------------------
  364. #  def screen_z
  365. #    case self.index
  366. #    when 0
  367. #      return 1
  368. #    when 1
  369. #      return 0
  370. #    when 2
  371. #      return 2
  372. #    when 3
  373. #      return 3
  374. #    else
  375. #      return 0
  376. #    end
  377. #  end
  378.   
  379.   
  380. #############################################################################
  381.   
  382.   
  383.   
  384.   def screen_x
  385.     # 返回计算后的队伍 X 坐标的排列顺序
  386.   #if $game_party.actors[1].name ="南宫复"
  387.      case self.index
  388.     when 0
  389.       return 400
  390.     when 1
  391.       return 470
  392.     when 2
  393.       return 540
  394.     when 3
  395.       return 610
  396.   # end
  397.   else
  398.     return 400
  399.   end
  400. end

  401.       #......................................................................
  402. #     case self.index
  403.   #  when 0
  404.    #   return 400
  405.    # when 1
  406.    #   return 470
  407.    # when 2
  408.    #   return 540
  409.    # when 3
  410.     #  return 610
  411.     #else
  412.     #  return 0
  413.     #end
  414.   #end
  415.   #--------------------------------------------------------------------------
  416.   # ● 取得战斗画面的 Y 坐标
  417.   #--------------------------------------------------------------------------
  418.   def screen_y
  419.     #........................................................................
  420.     case self.index
  421.     when 0
  422.       return 420
  423.     when 1
  424.       return 350
  425.     when 2
  426.       return 280
  427.     when 3
  428.       return 120
  429.       end
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 取得战斗画面的 Z 坐标
  433.   #--------------------------------------------------------------------------
  434.   def screen_z
  435.     # 返回计算后的队伍 Z 坐标的排列顺序
  436.     if self.index != nil
  437.       return 4 - self.index
  438.     else
  439.       return 0
  440.     end
  441.   end
  442. end

  443. class Scene_Battle
  444.   #..........................................................................
  445.   #--------------------------------------------------------------------------
  446.   # ● 返回phase
  447.   #--------------------------------------------------------------------------
  448.   def phase
  449.     return @phase
  450.   end
  451.   #--------------------------------------------------------------------------
  452.   # ● 返回phase4_step
  453.   #--------------------------------------------------------------------------
  454.   def phase4_step
  455.     return @phase4_step
  456.   end
  457.   #--------------------------------------------------------------------------
  458.   # ● 返回phase4_step
  459.   #--------------------------------------------------------------------------
  460.   def actor_command_active?
  461.     return @actor_command_window.active
  462.   end
  463.   #..........................................................................
  464. end
  465. class Game_Battler
  466.   #..........................................................................
  467.   #--------------------------------------------------------------------------
  468.   # ● 获取循环的动画 ID
  469.   #--------------------------------------------------------------------------  
  470.   def show_damage(value)
  471.     @show_damage_value = value
  472.   end
  473.   #--------------------------------------------------------------------------
  474.   # ● 获取循环的动画 ID
  475.   #--------------------------------------------------------------------------
  476.   def show_damage_value
  477.     return @show_damage_value
  478.   end
  479.   #--------------------------------------------------------------------------
  480.   # ● 获取循环的动画 ID
  481.   #--------------------------------------------------------------------------
  482.   def battler_ani
  483.     return @battler_ani
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● 获取循环的动画 ID
  487.   #--------------------------------------------------------------------------
  488.   def setup_battler_ani(battler_ani, once = 0)
  489.     @battler_ani = battler_ani
  490.     @once = once
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● 获取循环的动画 ID
  494.   #--------------------------------------------------------------------------
  495.   def setup_battler_hurt_ani(hurt)
  496.     @hurt = hurt
  497.   end  
  498.   #--------------------------------------------------------------------------
  499.   # ● 获取循环的动画 ID
  500.   #--------------------------------------------------------------------------
  501.   def setup_battler_dead_ani(over)
  502.     @over = over
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ● 获取循环的动画 ID
  506.   #--------------------------------------------------------------------------
  507.   def battler_dead_ani
  508.     return @over
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● 获取循环的动画 ID
  512.   #--------------------------------------------------------------------------
  513.   def battler_ani_once
  514.     return @once
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ● 获取循环的动画 ID
  518.   #--------------------------------------------------------------------------
  519.   def battler_hurt_ani
  520.     return @hurt
  521.   end
  522.   #..........................................................................
  523. end
  524. class Sprite_Battler < RPG::Sprite
  525.   #..........................................................................
  526.   #--------------------------------------------------------------------------
  527.   # ● 胜利图
  528.   #--------------------------------------------------------------------------
  529.   def win
  530.     if @battler_name != nil and not @battler.hidden and not @battler.dead?
  531.       @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  532.     end
  533.   end
  534.   #..........................................................................
  535.   #--------------------------------------------------------------------------
  536.   # ● 释放
  537.   #--------------------------------------------------------------------------
  538.   def dispose
  539.     if self.bitmap != nil
  540.       self.bitmap.dispose
  541.     end
  542.     super
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ● 刷新画面
  546.   #--------------------------------------------------------------------------
  547.   def update
  548.     super
  549.     # 战斗者为 nil 的情况下
  550.     if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
  551.       self.bitmap = nil
  552.       loop_animation(nil)
  553.        loop_animation1(nil)
  554.       return
  555.     end
  556.     # 文件名和色相与当前情况有差异的情况下
  557.     if @battler.battler_name != @battler_name or
  558.        @battler.battler_hue != @battler_hue
  559.       @battler_hue = @battler.battler_hue
  560.       # 获取、设置位图
  561.       @battler_name = @battler.battler_name
  562.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  563.       #.......................................................................
  564.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  565.       #.......................................................................
  566.       @width = bitmap.width
  567.       [url=home.php?mod=space&uid=291977]@height[/url] = bitmap.height
  568.       self.ox = @width / 2
  569.       self.oy = @height
  570.       # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  571.       if @battler.is_a?(Game_Enemy)
  572.         if @battler.dead? or @battler.hidden
  573.           self.opacity = 0
  574.         end
  575.       end
  576.     end
  577.     # 动画 ID 与当前的情况有差异的情况下
  578.     #.........................................................................
  579.     if @battler.battler_ani != @battler_ani
  580.       @battler_ani = @battler.battler_ani
  581.       loop_animation($data_animations[@battler_ani.to_i])
  582.       

  583.       
  584.      end
  585.    
  586.     #.........................................................................
  587.     # 应该被显示的角色的情况下
  588.     if @battler.is_a?(Game_Actor) and @battler_visible
  589.       # 不是主状态的时候稍稍降低点透明度
  590.       if $game_temp.battle_main_phase
  591.         self.opacity += 3 if self.opacity < 255
  592.       else
  593.         self.opacity -= 3 if self.opacity > 207
  594.       end
  595.     end
  596.     # 明灭
  597.     if @battler.blink
  598.       blink_on
  599.     else
  600.       blink_off
  601.     end
  602.     # 不可见的情况下
  603.     unless @battler_visible
  604.       # 出现 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  605.       if not @battler.hidden and not @battler.dead? and
  606.          (@battler.damage == nil or @battler.damage_pop)
  607.         if @battler.is_a?(Game_Enemy)
  608.           appear
  609. #######################################################################
  610. # HZHJ追加6
  611.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  612.       if @battler.states[i+1] != nil
  613.         @state_sprites[i].loop_animation1($data_animations[$data_states[@battler.states[i+1]].animation_id])
  614.         @state_sprites[i].x = self.x
  615.         @state_sprites[i].y = self.y
  616.         @state_sprites[i].z = self.z
  617.         @state_sprites[i].ox = self.ox
  618.         @state_sprites[i].oy = self.oy
  619.         @state_sprites[i].opacity = self.opacity
  620.         @state_sprites[i].visible = self.visible
  621.         @state_sprites[i].src_rect = self.src_rect
  622.       else
  623.         @state_sprites[i].loop_animation1($data_animations[0])
  624.       end
  625.     end
  626. #####################################################################
  627.         else
  628.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  629.         end
  630.         @battler_visible = true
  631.       end
  632.     end
  633.     # 可见的情况下
  634.     if @battler_visible
  635.       # 逃跑
  636.       if @battler.hidden
  637.         $game_system.se_play($data_system.escape_se)
  638.         escape
  639. #######################################################################
  640. # HZHJ追加7
  641.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  642.       if @battler.states[i+1] != nil
  643.         @state_sprites[i].loop_animation1($data_animations[$data_states[@battler.states[i+1]].animation_id])
  644.         @state_sprites[i].x = self.x
  645.         @state_sprites[i].y = self.y
  646.         @state_sprites[i].z = self.z
  647.         @state_sprites[i].ox = self.ox
  648.         @state_sprites[i].oy = self.oy
  649.         @state_sprites[i].opacity = self.opacity
  650.         @state_sprites[i].visible = self.visible
  651.         @state_sprites[i].src_rect = self.src_rect
  652.       else
  653.         @state_sprites[i].loop_animation1($data_animations[0])
  654.       end
  655.     end
  656. #####################################################################
  657.         @battler_visible = false
  658.       end
  659.       # 白色闪烁
  660.       if @battler.white_flash
  661.         whiten
  662.         @battler.white_flash = false
  663.       end
  664.       # 动画
  665.       if @battler.animation_id != 0
  666.         animation = $data_animations[@battler.animation_id]
  667.         animation(animation, @battler.animation_hit)
  668.         @battler.animation_id = 0
  669.       end
  670.       # 伤害
  671.       if @battler.damage_pop
  672.         damage(@battler.damage, @battler.critical)
  673.         @battler.damage = nil
  674.         @battler.critical = false
  675.         @battler.damage_pop = false
  676.       end
  677.       # korapusu
  678.       if @battler.damage == nil and @battler.dead?
  679.         #....................................................................
  680.         if @battler.is_a?(Game_Enemy)
  681.           $game_system.se_play($data_system.enemy_collapse_se)
  682.           #collapse
  683.         else
  684.           $game_system.se_play($data_system.actor_collapse_se)
  685.         end
  686.         #....................................................................
  687.         @battler_visible = false
  688.       end
  689.     end
  690.     # 设置活动块的坐标
  691.     self.x = @battler.screen_x
  692.     self.y = @battler.screen_y
  693.     self.z = @battler.screen_z
  694.   end
  695. end
  696. module RPG
  697.   class Sprite < ::Sprite
  698.     def damage(value, critical)
  699.       dispose_damage
  700.       if value.is_a?(Numeric)
  701.         damage_string = value.abs.to_s
  702.       else
  703.         damage_string = value.to_s
  704.       end
  705.       bitmap = Bitmap.new(160, 48)
  706.       bitmap.font.name = "Arial Black"
  707.       bitmap.font.size = 32
  708.       bitmap.font.color.set(0, 0, 0)
  709.       bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  710.       bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  711.       bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  712.       bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  713.       if value.is_a?(Numeric) and value < 0
  714.         bitmap.font.color.set(176, 255, 144)
  715.       else
  716.         bitmap.font.color.set(255, 255, 255)
  717.       end
  718.       bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  719.       if critical
  720.         bitmap.font.size = 20
  721.         bitmap.font.color.set(0, 0, 0)
  722.         bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
  723.         bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
  724.         bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
  725.         bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
  726.         bitmap.font.color.set(255, 255, 255)
  727.         bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
  728.       end
  729.       @_damage_sprite = ::Sprite.new(self.viewport)
  730.       @_damage_sprite.bitmap = bitmap
  731.       @_damage_sprite.ox = 80
  732.       @_damage_sprite.oy = 20
  733.       @_damage_sprite.x = self.x
  734.       @_damage_sprite.x -= self.bitmap.width/2 if @battler.is_a?(Game_Actor)
  735.       @_damage_sprite.y = self.y - self.oy / 2
  736.       @_damage_sprite.z = 3000
  737.       @_damage_duration = 40
  738.     end
  739.   end
  740. end
  741. module RPG
  742. #--------------------------------------------------------------------------
  743. # ● 常量设定
  744. #--------------------------------------------------------------------------
  745. # 是否显示总伤害
  746. SHOW_TOTAL_DAMAGE = true
  747. # 角色受攻击时是否跳一下
  748. BATTLER_JUMP = true
  749. # 伤害美化字符串文件夹名(放在Pictures文件夹中的子文件夹)
  750. #STRING_DOCUMENTS = ""
  751. # 是否使用伤害美化效果
  752. USE_DAMAGE = true

  753. class Sprite < ::Sprite
  754.    #==========================================
  755.    # 修改说明:
  756.    # @flash_shake用来制作挨打时候跳跃
  757.    # @_damage    用来记录每次打击之后弹出数字
  758.    # @_total_damage 记录总伤害
  759.    # @_total_damage_duration 总伤害持续帧
  760.    #==========================================
  761.    #alias 66RPG_rainbow_initialize : initialize
  762.    def initialize(viewport = nil)
  763.      #66RPG_rainbow_initialize(viewport)
  764.      super(viewport)
  765.      @_whiten_duration = 0
  766.      @_appear_duration = 0
  767.      @_escape_duration = 0
  768.      @_collapse_duration = 0
  769.      @_damage_duration = 0
  770.      @_animation_duration = 0
  771.      @_blink = false
  772.      # 挨打时候跳跃
  773.      @flash_shake = 0
  774.      # 伤害记录数组
  775.      @_damage = []
  776.      # 总伤害数字
  777.      @_total_damage = 0
  778.      # 总伤害持续帧
  779.      @_total_damage_duration = 0
  780.      #.........................................................................
  781.      #记录已经发生的伤害的变量
  782.      @p_dam=0
  783.      @hits=0
  784.      ############ #小改动
  785.      #记录前一次攻击次数
  786.      @temp_hits=0
  787.      #判断是否为最后一次攻击
  788.      @last_hits=0
  789.      ############
  790.      #.........................................................................
  791.    end
  792.     def animation_set_sprites(sprites, cell_data, position)
  793.       for i in 0..15
  794.         sprite = sprites[i]
  795.         pattern = cell_data[i, 0]
  796.         if sprite == nil or pattern == nil or pattern == -1
  797.           sprite.visible = false if sprite != nil
  798.           next
  799.         end
  800.         sprite.visible = true
  801.         sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  802.         if position == 3
  803.           if self.viewport != nil
  804.             sprite.x = self.viewport.rect.width / 2
  805.             sprite.y = self.viewport.rect.height - 160
  806.           else
  807.             sprite.x = 320
  808.             sprite.y = 240
  809.           end
  810.         else
  811.           sprite.x = self.x - self.ox + self.src_rect.width / 2
  812.           sprite.y = self.y - self.oy + self.src_rect.height / 2
  813.           sprite.y -= self.src_rect.height / 4 if position == 0
  814.           sprite.y += self.src_rect.height / 4 if position == 2
  815.         end
  816.         sprite.x += cell_data[i, 1]
  817.         sprite.y += cell_data[i, 2]
  818.         sprite.z =1
  819.         sprite.ox = 96
  820.         sprite.oy = 96
  821.         sprite.zoom_x = cell_data[i, 3] / 100.0
  822.         sprite.zoom_y = cell_data[i, 3] / 100.0
  823.         sprite.angle = cell_data[i, 4]
  824.         sprite.mirror = (cell_data[i, 5] == 1)
  825.         sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  826.         sprite.blend_type = cell_data[i, 7]
  827.       end
  828.     end

  829.    #--------------------------------------------------------------------------
  830.    #美化的伤害处理
  831.    #--------------------------------------------------------------------------
  832.     def damage(value, critical)
  833.       
  834. if USE_DAMAGE == true then
  835.   
  836.       # 释放伤害,效果是伤害数字快速消失,觉得不如不消失好看......
  837.       #dispose_damage
  838.       #清除hit数
  839.       dispose_hit
  840.       # 如果伤害值是数值
  841.       if value.is_a?(Numeric)
  842.         # 绝对值转为字符串
  843.         damage_string = value.abs.to_s
  844.       else
  845.         # 转为字符串
  846.         damage_string = value.to_s
  847.       end
  848.       # 初始化位图
  849.       bitmap = Bitmap.new(162, 64)
  850.       bitmap.font.name = ["华文行楷","黑体", "宋体"]
  851.       bitmap.font.size = 32
  852.       # 伤害值是数值的情况下
  853.       if value.is_a?(Numeric)
  854.         # 分割伤害值字符串
  855.         damage_array = damage_string.scan(/./)
  856.         damage_x = 81 - damage_string.size * 9
  857.         # 伤害值为负的情况下
  858.         if value < 0
  859.           # 调用回复数字表
  860.           rect_y = 32
  861.         else
  862.           # 调用伤害数字表
  863.           rect_y = 0
  864.         end
  865.         # 循环伤害值字符串
  866.         for char in damage_array
  867.           number = char.to_i
  868.           # 显示伤害数字
  869.           bitmap.blt(damage_x, 32, RPG::Cache.picture( "Damage"),#"Damagenew"),
  870.           Rect.new(number * 18, rect_y, 18, 32))
  871.           # 后移一位
  872.           damage_x += 18
  873.         end
  874.       # 伤害值不是数值的情况
  875.       else
  876.         # 如果伤害值不是 Miss
  877.         unless value == "Miss"
  878.           # 系统默认描画字符串
  879.           bitmap.font.color.set(0, 0, 0)
  880.           bitmap.draw_text(-1, 27, 162, 36, damage_string, 1)
  881.           bitmap.draw_text(+1, 27, 162, 36, damage_string, 1)
  882.           bitmap.draw_text(-1, 29, 162, 36, damage_string, 1)
  883.           bitmap.draw_text(+1, 29, 162, 36, damage_string, 1)
  884.           bitmap.font.color.set(255, 255, 255)
  885.           bitmap.draw_text(0, 28, 162, 36, damage_string, 1)
  886.         # Miss 的情况下
  887.         else
  888.           # 显示未击中图画
  889.           bitmap.blt(36, 28, RPG::Cache.picture("Damage"), Rect.new(90, 64, 90, 32))
  890.         end
  891.       end
  892.       # 会心一击标志打开的情况
  893.       if critical
  894.         #会心一击伤害效果
  895. ###########################################################
  896.        $game_screen.start_flash(Color.new(255,255,255,255),5)
  897. ###########################################################
  898.         # 显示会心一击图画
  899.         bitmap.blt(36, 0, RPG::Cache.picture( "Damage"), Rect.new(0, 64, 90, 32))
  900.       end
  901.       
  902. else
  903.       
  904.      #.........................................................................
  905.      #清除hit数
  906.      dispose_hit
  907.      #.........................................................................
  908.      if value.is_a?(Numeric)
  909.        damage_string = value.abs.to_s
  910.      else
  911.        damage_string = value.to_s
  912.      end
  913.      bitmap = Bitmap.new(160, 48)
  914.      bitmap.font.name = "Arial Black"
  915.      bitmap.font.size = 32
  916.      bitmap.font.color.set(0, 0, 0)
  917.      bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  918.      bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  919.      bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  920.      bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  921.      #=======================================
  922.      # 修改:颜色
  923.      #=======================================
  924.      if value.is_a?(Numeric) and value < 0
  925.        bitmap.font.color.set(176, 255, 144)
  926.      else
  927.        bitmap.font.color.set(255, 55, 55)
  928.      end
  929.      bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  930.      if critical
  931.        #会心一击伤害效果
  932. ###########################################################
  933.        $game_screen.start_flash(Color.new(255,255,255,255),5)
  934. ###########################################################
  935.        bitmap.font.size = 20
  936.        bitmap.font.color.set(0, 0, 0)
  937.        bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
  938.        bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
  939.        bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
  940.        bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
  941.        bitmap.font.color.set(255, 255, 255)
  942.        bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
  943.      end
  944.      
  945. end
  946.    
  947.      # 伤害值定位     
  948.      @_damage_sprite = ::Sprite.new#(self.viewport)
  949.      @_damage_sprite.bitmap = bitmap
  950.      @_damage_sprite.ox = 80
  951.      @_damage_sprite.oy = 20
  952.      @_damage_sprite.x = self.x
  953.      @_damage_sprite.y = self.y - self.oy / 2
  954.      @_damage_sprite.z = 3000
  955.      @_damage_duration = 40
  956.      #=======================================
  957.      # 修改:推入新的伤害
  958.      #=======================================
  959.      @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  960.      # 总伤害处理
  961.      make_total_damage(value)
  962.      
  963.      
  964.      
  965.     end
  966.    #--------------------------------------------------------------------------
  967.    # ● 返回 @hits
  968.    #--------------------------------------------------------------------------
  969.    def get_hit
  970.      return @hits
  971.    end
  972.    #--------------------------------------------------------------------------
  973.    # ● hit数的美化描绘
  974.     # ● hit数的美化描绘
  975.    #--------------------------------------------------------------------------
  976.    #..........................................................................
  977.    def hit
  978.      # 如果伤害值是数值
  979.      # 转为字符串
  980.      value=@hits
  981.      hits_string = value.to_s
  982.      # 初始化位图
  983.      bitmap = Bitmap.new(320, 64)
  984.      bitmap.font.name = "Arial Black"
  985.      bitmap.font.size = 32
  986.      # 分割伤害值字符串
  987.      hits_array = hits_string.scan(/./)
  988.      hits_x = - 36.2#hits_string.size * 18.1 # 81 - hits_string.size * 18.1
  989.      rect_y = 0
  990.      # 循环伤害值字符串
  991.      for char in hits_array
  992.        # 后移一位
  993.        hits_x += 36.2
  994.        number = char.to_i
  995.        # 显示伤害数字
  996.        bitmap.blt(hits_x, 0, RPG::Cache.picture("Number"),
  997.        Rect.new(number * 36.2, rect_y, 36.2, 50))
  998.      end
  999.      hits_x += 18.1
  1000.      bitmap.blt(hits_x, 0, RPG::Cache.picture("HITS"),
  1001.                 Rect.new(0, -21, 90, 50))
  1002.      # 伤害值定位
  1003.      @_hits_sprite = ::Sprite.new(self.viewport)
  1004.      @_hits_sprite.bitmap = bitmap
  1005.      @_hits_sprite.x = 560 - hits_string.size * 36.2
  1006.      @_hits_sprite.y = 70
  1007.      @_hits_sprite.z = 3000
  1008.      @_hits_duration = 40
  1009.    end
  1010.    #.......................................................................................
  1011.    #--------------------------------------------------------------------------
  1012.    # ● 美化的总伤害处理
  1013.    #--------------------------------------------------------------------------
  1014.    def make_total_damage(value)
  1015.      
  1016. if USE_DAMAGE == true then     
  1017.      
  1018.      if value.is_a?(Numeric)# and SHOW_TOTAL_DAMAGE
  1019.        @_total_damage += value
  1020.         # 绝对值转为字符串
  1021.         damage_string = @_total_damage.abs.to_s
  1022.       else
  1023.         return
  1024.       end
  1025. #####################################################小改动
  1026.      if SHOW_TOTAL_DAMAGE
  1027. #####################################################
  1028.       # 初始化位图
  1029.       bitmap = Bitmap.new(300, 150)
  1030.       bitmap.font.name = "Arial Black"
  1031.       bitmap.font.size = 30
  1032.       # 伤害值是数值的情况下
  1033.       if value.is_a?(Numeric)
  1034.         # 分割伤害值字符串
  1035.         damage_array = damage_string.scan(/./)
  1036.         damage_x = 40 - damage_string.size * 9
  1037.         # 伤害值为负的情况下
  1038.         if value < 0
  1039.           # 调用回复数字表
  1040.           name=  "Number3"
  1041.         else
  1042.           # 调用伤害数字表
  1043.           name=   "Number2"
  1044.         end
  1045.         # 循环伤害值字符串
  1046.         for char in damage_array
  1047.           number = char.to_i
  1048.           # 显示伤害数字
  1049.           bitmap.blt(damage_x, 0, RPG::Cache.picture(name),
  1050.           Rect.new(number * 30, 0, 30, 50))
  1051.           # 后移一位
  1052.           damage_x += 26
  1053.         end
  1054. #####################################################小改动
  1055.      end
  1056. #####################################################
  1057.       end
  1058.       
  1059. else
  1060.             
  1061.    #--------------------------------------------------------------------------
  1062.    # ● 总伤害处理
  1063.    #--------------------------------------------------------------------------
  1064.      if value.is_a?(Numeric)# and SHOW_TOTAL_DAMAGE
  1065.        @_total_damage += value
  1066.      else
  1067.        return
  1068.      end
  1069. #####################################################小改动
  1070.      if SHOW_TOTAL_DAMAGE
  1071. #####################################################
  1072.      bitmap = Bitmap.new(300, 150)
  1073.      bitmap.font.name = "Arial Black"
  1074.      bitmap.font.size = 48
  1075.      bitmap.font.color.set(0, 0, 0)
  1076.      bitmap.draw_text(+2, 12+2, 160, 36, @_total_damage.abs.to_s, 1)
  1077.      if @_total_damage < 0
  1078.        bitmap.font.color.set(80, 255, 00)
  1079.      else
  1080.        bitmap.font.color.set(255, 140, 0)
  1081.      end
  1082.      bitmap.draw_text(0, 12, 160, 36, @_total_damage.abs.to_s, 1)
  1083. #####################################################小改动
  1084.      end
  1085. #####################################################
  1086. end

  1087.      if @_total_damage_sprite.nil?
  1088.        @_total_damage_sprite = ::Sprite.new#(self.viewport)
  1089.        @_total_damage_sprite.ox = 80
  1090.        @_total_damage_sprite.oy = 20
  1091.        @_total_damage_sprite.z = 3000
  1092.      end
  1093.      @_total_damage_sprite.bitmap = bitmap
  1094.      @_total_damage_sprite.zoom_x = 1.5
  1095.      @_total_damage_sprite.zoom_y = 1.5
  1096.      @_total_damage_sprite.x = self.x
  1097.      @_total_damage_sprite.y = self.y  - self.oy / 2 - 64
  1098.      @_total_damage_sprite.z = 3001
  1099.      #.........................................................................
  1100.      @_total_damage_duration = 40
  1101.      #.........................................................................
  1102.      #.........................................................................
  1103.      #hit数描绘
  1104.      @hits+=1
  1105.      hit
  1106.      #.........................................................................
  1107.    end
  1108.    def animation(animation, hit, battler_damage="", battler_critical=false)
  1109.      dispose_animation      
  1110.      #=======================================
  1111.      # 修改:记录伤害和critical
  1112.      #=======================================
  1113.      @battler_damage = battler_damage
  1114.      @battler_critical = battler_critical
  1115.      @_animation = animation
  1116.      return if @_animation == nil
  1117.      @_animation_hit = hit
  1118.      @_animation_duration = @_animation.frame_max
  1119.      animation_name = @_animation.animation_name
  1120.      animation_hue = @_animation.animation_hue
  1121.      bitmap = RPG::Cache.animation(animation_name, animation_hue)
  1122.      #=======================================
  1123.      # 修改:计算总闪光权限值
  1124.      #=======================================
  1125.      for timing in @_animation.timings
  1126.        quanzhong = animation_process_timing(timing, @_animation_hit,true)
  1127.        @all_quanzhong += quanzhong
  1128.        # 记录最后一次闪光
  1129.        @_last_frame = timing.frame if quanzhong != 0
  1130.      end
  1131.      #.........................................................................
  1132.      @last_frame = @_last_frame
  1133.      #.........................................................................
  1134.      if @@_reference_count.include?(bitmap)
  1135.        @@_reference_count[bitmap] += 1
  1136.      else
  1137.        @@_reference_count[bitmap] = 1
  1138.      end
  1139.      #=======================================
  1140.      # 修改:行动方动画不显示伤害
  1141.      #=======================================
  1142.      if $scene.is_a?(Scene_Battle)
  1143.        if $scene.animation1_id == @battler.animation_id
  1144.          @battler_damage = ""
  1145.        end
  1146.      end
  1147.      @_animation_sprites = []
  1148.      if @_animation.position != 3 or not @@_animations.include?(animation)
  1149.        for i in 0..15
  1150.          sprite = ::Sprite.new(self.viewport)
  1151.          sprite.bitmap = bitmap
  1152.          sprite.visible = false
  1153.          @_animation_sprites.push(sprite)
  1154.        end
  1155.        unless @@_animations.include?(animation)
  1156.          @@_animations.push(animation)
  1157.        end
  1158.      end
  1159.      update_animation
  1160.    end
  1161.    #=======================================
  1162.    # 修改:更换清除伤害的算法,以防万一
  1163.    #       本内容在脚本中没有使用过
  1164.    #=======================================
  1165.    def dispose_damage
  1166.      for damage in @_damage.reverse
  1167.        damage[0].bitmap.dispose
  1168.        damage[0].dispose
  1169.        @_damage.delete(damage)
  1170.      end
  1171.      @_total_damage = 0
  1172.      @_last_frame = -1
  1173.      if @_total_damage_sprite != nil
  1174.        @_total_damage_duration = 0
  1175.        @_total_damage_sprite.bitmap.dispose
  1176.        @_total_damage_sprite.dispose
  1177.        @_total_damage_sprite = nil
  1178.      end
  1179.    end
  1180.    #=======================================
  1181.    # 清除hit数
  1182.    #=======================================
  1183.    #...........................................................................
  1184.    def dispose_hit
  1185.      if @_hits_sprite != nil
  1186.        @_hits_sprite.bitmap.dispose
  1187.        @_hits_sprite.dispose
  1188.        @_hits_sprite = nil
  1189.      end
  1190.    end
  1191.    #...........................................................................
  1192.    def dispose_animation
  1193.      #=======================================
  1194.      # 修改:清除记录的伤害,清除权重记录
  1195.      #=======================================
  1196.      @battler_damage = nil
  1197.      @battler_critical = nil
  1198.      @all_quanzhong = 1
  1199.      @_total_damage = 0
  1200.      @_last_frame = -1
  1201.      #.........................................................................
  1202.      @hits = 0
  1203.      #.........................................................................
  1204.      if @_animation_sprites != nil
  1205.        sprite = @_animation_sprites[0]
  1206.        if sprite != nil
  1207.          @@_reference_count[sprite.bitmap] -= 1
  1208.          if @@_reference_count[sprite.bitmap] == 0
  1209.            sprite.bitmap.dispose
  1210.          end
  1211.        end
  1212.        for sprite in @_animation_sprites
  1213.          sprite.dispose
  1214.        end
  1215.        @_animation_sprites = nil
  1216.        @_animation = nil
  1217.      end
  1218.    end
  1219.    def update
  1220.      super
  1221.      if @_whiten_duration > 0
  1222.        @_whiten_duration -= 1
  1223.        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  1224.      end
  1225.      if @_appear_duration > 0
  1226.        @_appear_duration -= 1
  1227.        self.opacity = (16 - @_appear_duration) * 16
  1228.      end
  1229.      if @_escape_duration > 0
  1230.        @_escape_duration -= 1
  1231.        self.opacity = 256 - (32 - @_escape_duration) * 10
  1232.      end
  1233.      if @_collapse_duration > 0
  1234.        @_collapse_duration -= 1
  1235.        self.opacity = 256 - (48 - @_collapse_duration) * 6
  1236.      end
  1237.      #=======================================
  1238.      # 修改:更新算法,更新弹出
  1239.      #=======================================
  1240.      if @_damage_duration > 0
  1241.        @_damage_duration -= 1
  1242.        for damage in @_damage
  1243.          damage[0].x = self.x + self.viewport.rect.x -
  1244.                        self.ox + self.src_rect.width / 2 +
  1245.                        (40 - damage[1]) * damage[3] / 10
  1246.          damage[0].y -= damage[4]+damage[1]/10
  1247.          damage[0].opacity = damage[1]*20
  1248.          damage[1] -= 1
  1249.          if damage[1]==0
  1250.            damage[0].bitmap.dispose
  1251.            damage[0].dispose
  1252.            @_damage.delete(damage)
  1253.            next
  1254.          end
  1255.        end
  1256.      end
  1257.      #=======================================
  1258.      # 添加:弹出总伤害
  1259.      #=======================================
  1260.      if @_total_damage_duration > 0
  1261.        @_total_damage_duration -= 1
  1262.        @_total_damage_sprite.y -= 1 if @_total_damage_duration % 2 == 0
  1263.        if @_total_damage_sprite.zoom_x > 1.0
  1264.          @_total_damage_sprite.zoom_x -= 0.05
  1265.        end
  1266.        if @_total_damage_sprite.zoom_y > 1.0
  1267.          @_total_damage_sprite.zoom_y -= 0.05
  1268.        end
  1269.        @_total_damage_sprite.opacity = 256 - (24 - @_total_damage_duration) * 16
  1270.        #......................................................................
  1271.        if @_total_damage_duration <= 7 and @_total_damage_duration > 0
  1272.          @_hits_sprite.opacity -= 32
  1273.          @_hits_sprite.x += 1
  1274.        end
  1275.        #......................................................................
  1276.        if @_total_damage_duration <= 0
  1277.          #.....................................................................
  1278.          dispose_hit
  1279. ##########################
  1280.          @_total_damage = 0
  1281. ##########################
  1282.          #.....................................................................
  1283.          @_total_damage = 0
  1284.          @_total_damage_duration = 0
  1285. #####################################################小改动
  1286.          if SHOW_TOTAL_DAMAGE
  1287.          @_total_damage_sprite.bitmap.dispose
  1288.          end
  1289. #####################################################
  1290.          @_total_damage_sprite.dispose
  1291.          @_total_damage_sprite = nil
  1292.        end
  1293.      end
  1294.      #=======================================
  1295.      if @_animation != nil and (Graphics.frame_count % 2 == 0)
  1296.        @_animation_duration -= 1
  1297.        update_animation
  1298.      end
  1299.      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  1300.        update_loop_animation
  1301.        @_loop_animation_index += 1
  1302.        #......................................................................
  1303.        @loop_animation_once = 0
  1304.        @loop_animation_once = 1 if @once == 1 and @_loop_animation_index == @_loop_animation.frame_max
  1305.        #......................................................................
  1306.        @_loop_animation_index %= @_loop_animation.frame_max
  1307.      end
  1308.      
  1309.      if @_loop_animation1 != nil and (Graphics.frame_count % 2 == 0)
  1310.         update_loop_animation1
  1311.         @_loop_animation1_index += 1
  1312.         @_loop_animation1_index %= @_loop_animation1.frame_max
  1313.       end
  1314.       
  1315.      if @_blink
  1316.        @_blink_count = (@_blink_count + 1) % 32
  1317.        if @_blink_count < 16
  1318.          alpha = (16 - @_blink_count) * 6
  1319.        else
  1320.          alpha = (@_blink_count - 16) * 6
  1321.        end
  1322.        self.color.set(255, 255, 255, alpha)
  1323.      end
  1324.      @@_animations.clear
  1325.    end
  1326.    #..........................................................................
  1327.    def loop_animation_once
  1328.      return @_loop_animation_once
  1329.    end
  1330.    #..........................................................................
  1331.    def update_animation
  1332.      if @_animation_duration > 0
  1333.        frame_index = @_animation.frame_max - @_animation_duration
  1334.        @frame_index = frame_index
  1335.        cell_data = @_animation.frames[frame_index].cell_data
  1336.        position = @_animation.position
  1337.        animation_set_sprites(@_animation_sprites, cell_data, position)
  1338.        #=======================================
  1339.        # 修改:弹出伤害,权重计算
  1340.        #=======================================
  1341.        for timing in @_animation.timings
  1342.          if timing.frame == frame_index
  1343.            t = 1.0 * animation_process_timing(timing, @_animation_hit)            
  1344.            #p t,"当前权重", @all_quanzhong,"总权重"
  1345.            if @battler_damage.is_a?(Numeric) and t != 0
  1346.              t *= @battler_damage
  1347.              t /= @all_quanzhong
  1348.              t = t.to_i
  1349.              #在闪光不是最后一次的情况下,把这次伤害加入到已经发生的伤害中★★★★★★★★★★★★★★★★★★★★★★★★★★
  1350.              if frame_index != @_last_frame
  1351.              @p_dam+= t
  1352.              end
  1353.              #p @p_dam,"已发生伤害",@battler_damage,"总伤害"(调试用)★★★★★★★★★★★★★★★★★★★★★★★★★★
  1354.              #闪光为最后一次的情况下,改变这次伤害的计算方法(总伤害-已经发生伤害)★★★★★★★★★★★★★★★★★★★★★★★★★★
  1355.              if frame_index == @_last_frame
  1356.                t= @battler_damage-@p_dam
  1357.              end
  1358.              #p t,"当前伤害",@battler_damage,"总伤害"
  1359.              # 最后一次闪光的话,伤害修正
  1360.              if frame_index == @_last_frame
  1361.                @_total_damage = @battler_damage - t
  1362.                @p_dam=0      #已经发生的伤害归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1363.             end
  1364.              #p t,@battler_damage,@all_quanzhong
  1365.              damage(t,@battler_critical)
  1366.             #连击次数归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1367.             if frame_index == @_last_frame
  1368.                       ############ #小改动
  1369.                       @last_hits=1
  1370.                       @temp_hits=0
  1371.                       ############
  1372.                       @hits=0
  1373.             end
  1374.            # 防止重复播放miss
  1375.            elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
  1376.              damage(@battler_damage,@battler_critical)
  1377.            end
  1378.          end
  1379.        end
  1380.      else
  1381.        dispose_animation
  1382.      end
  1383.    end
  1384.    #=======================================
  1385.    # 修改:敌人跳跃的功能 + 添加返回数值
  1386.    #=======================================
  1387.    def update_loop_animation
  1388.      frame_index = @_loop_animation_index
  1389.      cell_data = @_loop_animation.frames[frame_index].cell_data
  1390.      position = @_loop_animation.position
  1391.      #·改·
  1392.      if @wait_count.to_i <= 0
  1393.        @wait_count = 0
  1394.        animation_set_sprites(@_loop_animation_sprites, cell_data, position)
  1395.      else
  1396.        @wait_count -= 1
  1397.        for sprite in @_loop_animation_sprites
  1398.          sprite.visible = false
  1399.        end
  1400.      end
  1401.      if @wait_flash.to_i <= 0
  1402.        @wait_flash = 0
  1403.      else
  1404.        @wait_flash -= 1
  1405.        for sprite in @_loop_animation_sprites
  1406.          sprite.blend_type = 1
  1407.        end
  1408.      end
  1409.      #·改·
  1410.      for timing in @_loop_animation.timings
  1411.        if timing.frame == frame_index
  1412.          animation_process_timing(timing, true)
  1413.        end
  1414.      end
  1415.    end
  1416.    #=======================================
  1417.    # 修改:敌人跳跃的功能 + 添加返回数值
  1418.    #=======================================
  1419.    def loop_animation(animation)
  1420.      return if animation == @_loop_animation
  1421.      dispose_loop_animation
  1422.   
  1423.      @_loop_animation = animation
  1424.      return if @_loop_animation == nil
  1425.      @_loop_animation_index = 0
  1426.      animation_name = @_loop_animation.animation_name
  1427.      animation_hue = @_loop_animation.animation_hue
  1428.      bitmap = RPG::Cache.animation(animation_name, animation_hue)
  1429.      if @@_reference_count.include?(bitmap)
  1430.        @@_reference_count[bitmap] += 1
  1431.      else
  1432.        @@_reference_count[bitmap] = 1
  1433.      end
  1434.      @_loop_animation_sprites = []
  1435.      for i in 0..15
  1436.        sprite = ::Sprite.new
  1437.        sprite.bitmap = bitmap
  1438.        sprite.visible = false
  1439.        @_loop_animation_sprites.push(sprite)
  1440.      end
  1441.      update_loop_animation
  1442.    end
  1443.    #=======================================
  1444.    # 修改:敌人跳跃的功能 + 添加返回数值
  1445.    #=======================================
  1446.     def animation_process_timing(timing, hit,dontflash=false)
  1447.       if (timing.condition == 0) or
  1448.          (timing.condition == 1 and hit == true) or
  1449.          (timing.condition == 2 and hit == false)
  1450.         unless dontflash
  1451.           if timing.se.name != ""
  1452.             se = timing.se
  1453.             Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
  1454.           end
  1455.         end
  1456.         case timing.flash_scope
  1457.         when 1
  1458.           unless dontflash
  1459.             self.flash(timing.flash_color, timing.flash_duration * 2)
  1460.             #....................................................................
  1461.             @wait_flash = timing.flash_duration
  1462.             #....................................................................
  1463.             if @_total_damage >0
  1464.               @flash_shake_switch = true
  1465.               @flash_shake = 10
  1466.             end
  1467.           end
  1468.           return timing.flash_color.alpha * timing.flash_duration
  1469.         when 2
  1470.           unless dontflash
  1471.             if self.viewport != nil
  1472.               self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
  1473.               return timing.flash_color.alpha * timing.flash_duration
  1474.             end
  1475.           end
  1476.         when 3
  1477.           unless dontflash
  1478.             self.flash(nil, timing.flash_duration * 2)
  1479.             #@_loop_animation_count = 1
  1480.             #·改·
  1481.             @wait_count = timing.flash_duration
  1482.             #·改·
  1483.           end
  1484.           return timing.flash_color.alpha * timing.flash_duration
  1485.         end
  1486.       end      
  1487.       return 0
  1488.     end   
  1489. end
  1490. end
  1491. #==============================================================================
  1492. # ■ Sprite_Battler
  1493. #==============================================================================
  1494. class Sprite_Battler < RPG::Sprite
  1495. #--------------------------------------------------------------------------
  1496. # ● 初始化对像
  1497. #    添加跳跃记录
  1498. #--------------------------------------------------------------------------
  1499. def initialize(viewport, battler = nil)
  1500.   super(viewport)
  1501.   @battler = battler
  1502.   @battler_visible = false
  1503.   @flash_shake_switch = true

  1504.   #........................................................................
  1505.   @once = 0
  1506.   @frame_index = -1
  1507.   @last_frame = 0
  1508.   #........................................................................
  1509. #######################################################################
  1510. # HZHJ追加1
  1511.   @state_sprites = []
  1512.   for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  1513.     @state_sprites.push(RPG::Sprite.new(viewport))
  1514.   end
  1515. ####################################################################
  1516. end
  1517. #####################################################################
  1518. # HZHJ追加2
  1519.   alias hzhj_dis dispose
  1520.   def dispose
  1521.     hzhj_dis
  1522.     for hzhj in @state_sprites
  1523.       hzhj.dispose
  1524.     end
  1525.   end
  1526. #######################################################################

  1527. #--------------------------------------------------------------------------
  1528. # ● 刷新画面
  1529. #    增添跳跃功能
  1530. #--------------------------------------------------------------------------
  1531. def update
  1532.   super
  1533. ######################################################################
  1534. # HZHJ追加3
  1535.     for hzhj in @state_sprites
  1536.       hzhj.update
  1537.     end
  1538. #######################################################################
  1539.   # 战斗者为 nil 的情况下
  1540.   if @battler == nil
  1541.     self.bitmap = nil
  1542.     loop_animation(nil)
  1543.    loop_animation1(nil)
  1544. ######################################################################
  1545. # HZHJ追加4
  1546.     for hzhj in @state_sprites
  1547.       hzhj.loop_animation1(nil)
  1548.     end
  1549. #######################################################################
  1550.     return
  1551.   end
  1552.   # 文件名和色相与当前情况有差异的情况下
  1553.   if @battler.battler_name != @battler_name or
  1554.      @battler.battler_hue != @battler_hue
  1555.     # 获取、设置位图
  1556.     @battler_name = @battler.battler_name
  1557.     @battler_hue = @battler.battler_hue
  1558.     self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1559.     #.......................................................................
  1560.     if not @battler.hidden and not @battler.dead?
  1561.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1562.     end
  1563.     #.......................................................................
  1564.     @width = bitmap.width
  1565.     [url=home.php?mod=space&uid=291977]@height[/url] = bitmap.height
  1566.     self.ox = @width / 2
  1567.     self.oy = @height
  1568.   end
  1569.   #.......................................................................
  1570.   update_actor_animation
  1571.   update_enemy_animation
  1572.   #.......................................................................
  1573.   # 动画 ID 与当前的情况有差异的情况下
  1574.   #.........................................................................
  1575.   if @battler.is_a?(Game_Enemy)
  1576.     if @once == 1 and @loop_animation_once == 1 and
  1577.        @battler.battler_dead_ani == 1
  1578.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1579.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1580.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1581.     end
  1582.   end
  1583.   if @battler.is_a?(Game_Actor)
  1584.     ####################################################################
  1585.     if @once == 1 and @loop_animation_once == 1 and $scene.phase != 5 and
  1586.        @battler.battler_dead_ani == 1 and @battler.dead?
  1587.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1588.     #######################################################################
  1589.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1590.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1591.       #################################################################
  1592.       $fangyu = 0
  1593.       @battler.setup_battler_dead_ani(0)
  1594.       ########################################################
  1595.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase == 5 and
  1596.           not @battler.dead?
  1597.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[7])
  1598.       ######################################################
  1599.       $fangyu = 0
  1600.       @battler.setup_battler_dead_ani(0)
  1601.       ######################################################
  1602.     end
  1603.   end
  1604.   
  1605. if @battler.damage == nil and
  1606.        @battler.state_animation_id != @state_animation_id
  1607.       @state_animation_id = @battler.state_animation_id
  1608.        loop_animation1($data_animations[@state_animation_id])
  1609.     end
  1610. #######################################################################
  1611. # HZHJ追加5
  1612.   if @battler.damage == nil and $game_temp.phase4step5
  1613.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  1614.       if @battler.states[i+1] != nil
  1615.         @state_sprites[i].loop_animation1($data_animations[$data_states[@battler.states[i+1]].animation_id])
  1616.         @state_sprites[i].x = self.x
  1617.         @state_sprites[i].y = self.y
  1618.         @state_sprites[i].z = self.z
  1619.         @state_sprites[i].ox = self.ox
  1620.         @state_sprites[i].oy = self.oy
  1621.         @state_sprites[i].opacity = self.opacity
  1622.         @state_sprites[i].visible = self.visible
  1623.         @state_sprites[i].src_rect = self.src_rect
  1624.       else
  1625.         @state_sprites[i].loop_animation1($data_animations[0])
  1626.       end
  1627.     end
  1628.   end
  1629. #####################################################################
  1630.   if @battler.battler_ani != @battler_ani
  1631.     @battler_ani = @battler.battler_ani
  1632.     @once = @battler.battler_ani_once
  1633.     loop_animation($data_animations[@battler_ani.to_i])
  1634.   end
  1635.   #.........................................................................
  1636.   # 明灭
  1637.   if @battler.blink
  1638.     blink_on
  1639.   else
  1640.     blink_off
  1641.   end
  1642.   # 不可见的情况下
  1643.   unless @battler_visible
  1644.     # 出现
  1645.     if not @battler.hidden and not @battler.dead? and
  1646.        (@battler.damage == nil or @battler.damage_pop)
  1647.       #.......................................................................
  1648.       if @battler.is_a?(Game_Enemy)
  1649.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1650.         #appear
  1651.       else
  1652.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1653.       end
  1654.       #.......................................................................
  1655.       @battler_visible = true
  1656.     end
  1657.   end
  1658.   # 可见的情况下
  1659.   if @battler_visible
  1660.     # 逃跑
  1661.     if @battler.hidden
  1662.       $game_system.se_play($data_system.escape_se)
  1663.       escape
  1664.       @battler_visible = false
  1665.     end
  1666.     # 白色闪烁
  1667.     if @battler.white_flash
  1668.       whiten
  1669.       @battler.white_flash = false
  1670.     end
  1671.     # 动画
  1672.     if @battler.animation_id != 0
  1673.       animation = $data_animations[@battler.animation_id]
  1674.       animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  1675.       # animation(animation, @battler.animation_hit)
  1676.       @battler.animation_id = 0
  1677.     end
  1678.     # 伤害
  1679.     if @battler.damage_pop
  1680.       @battler.damage = nil
  1681.       @battler.critical = false
  1682.       @battler.damage_pop = false
  1683.     end
  1684.     # korapusu
  1685.     if @battler.damage == nil and @battler.dead?
  1686.       if @battler.is_a?(Game_Enemy)
  1687.         if @battler.battler_dead_ani != 1
  1688.           #p "Battler Death Error"
  1689.           $game_system.se_play($data_system.enemy_collapse_se)
  1690.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1691.           @battler.setup_battler_dead_ani(1)
  1692.         end
  1693.         #.....................................................................
  1694.         collapse
  1695. #######################################################################
  1696. # HZHJ追加8
  1697.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  1698.       if @battler.states[i+1] != nil
  1699.         @state_sprites[i].loop_animation1($data_animations[$data_states[@battler.states[i+1]].animation_id])
  1700.         @state_sprites[i].x = self.x
  1701.         @state_sprites[i].y = self.y
  1702.         @state_sprites[i].z = self.z
  1703.         @state_sprites[i].ox = self.ox
  1704.         @state_sprites[i].oy = self.oy
  1705.         @state_sprites[i].opacity = self.opacity
  1706.         @state_sprites[i].visible = self.visible
  1707.         @state_sprites[i].src_rect = self.src_rect
  1708.       else
  1709.         @state_sprites[i].loop_animation1($data_animations[0])
  1710.       end
  1711.     end
  1712. #####################################################################
  1713.         #.....................................................................
  1714.       else
  1715.         #.....................................................................
  1716.         if @battler.battler_dead_ani != 1
  1717.           #p "Battler Death Error"
  1718.           $game_system.se_play($data_system.enemy_collapse_se)
  1719.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1720.           @battler.setup_battler_dead_ani(1)
  1721.         end
  1722.         #.....................................................................
  1723.       end
  1724.       @battler_visible = false
  1725.     end
  1726.   end
  1727.   # 设置活动块的坐标
  1728.   if @flash_shake_switch == true
  1729.     self.x = @battler.screen_x
  1730.     self.y = @battler.screen_y
  1731.     self.z = @battler.screen_z
  1732.     @flash_shake_switch = false
  1733.   end
  1734.   if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
  1735.     if @battler.is_a?(Game_Enemy)
  1736.       case @flash_shake
  1737.       when 9..10
  1738.         self.x -=4
  1739.         self.y -=4
  1740.         self.z = @battler.screen_z
  1741.       when 6..8
  1742.         self.x -=2
  1743.         self.y -=2
  1744.         self.z = @battler.screen_z
  1745.       when 3..5
  1746.         self.x +=2
  1747.         self.y +=2
  1748.         self.z = @battler.screen_z
  1749.       when 1..2
  1750.         self.x +=4
  1751.         self.y +=4
  1752.         self.z = @battler.screen_z
  1753.       end
  1754.     end
  1755.     if @battler.is_a?(Game_Actor)
  1756.       case @flash_shake
  1757.       when 9..10
  1758.         self.x +=4
  1759.         self.y +=4
  1760.         self.z = @battler.screen_z
  1761.       when 6..8
  1762.         self.x +=2
  1763.         self.y +=2
  1764.         self.z = @battler.screen_z
  1765.       when 3..5
  1766.         self.x -=2
  1767.         self.y -=2
  1768.         self.z = @battler.screen_z
  1769.       when 1..2
  1770.         self.x -=4
  1771.         self.y -=4
  1772.         self.z = @battler.screen_z
  1773.       end
  1774.     end
  1775.    @flash_shake -= 1
  1776.   end
  1777. end
  1778. end

  1779. #==============================================================================
  1780. # ■ Scene_Battle
  1781. #------------------------------------------------------------------------------
  1782. #  处理战斗画面的类。
  1783. #==============================================================================

  1784. class Scene_Battle
  1785. #--------------------------------------------------------------------------
  1786. # ● 定义实例变量
  1787. #--------------------------------------------------------------------------
  1788. attr_reader   :animation1_id                    # 行动方动画ID
  1789. end
  1790. class Sprite_Battler < RPG::Sprite
  1791.   #--------------------------------------------------------------------------
  1792.   # ● 处理角色动作
  1793.   #--------------------------------------------------------------------------
  1794.   def update_actor_animation
  1795.     if @battler.is_a?(Game_Actor)
  1796.       if @battler.show_damage_value != nil
  1797.         self.damage(@battler.show_damage_value, false)
  1798.         @battler.show_damage(nil)
  1799.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1800.         @battler.setup_battler_hurt_ani(1)
  1801.       end
  1802.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1 and @battler.show_damage_value != nil
  1803.         # 防御的时候
  1804.         if @hits > @temp_hits and not @battler.dead?
  1805.           ############ #小改动
  1806.           @temp_hits+=1
  1807.           ############
  1808.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1809.           @battler.setup_battler_hurt_ani(1)
  1810.           #################################################################
  1811.         elsif @last_hits == 1 and not @battler.dead?
  1812.           ############ #小改动
  1813.           @last_hits = 0
  1814.           ############
  1815.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1816.           @battler.setup_battler_hurt_ani(1)
  1817.           #################################################################
  1818.         elsif @frame_index != -1 and @frame_index != @last_frame and not @battler.dead? and [email protected]_a?(Numeric)
  1819.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1820.           @battler.setup_battler_hurt_ani(1)
  1821.           #################################################################
  1822.         elsif @last_hits == 1 and not @battler.dead? and [email protected]_a?(Numeric)
  1823.           ############ #小改动
  1824.           @last_hits = 0
  1825.           ############
  1826.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1827.           @battler.setup_battler_hurt_ani(1)
  1828.           #################################################################
  1829.         end
  1830.       else
  1831.         # 单回合只有一次攻击
  1832.        if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1
  1833.           ############ #小改动
  1834.           @last_hits = 0
  1835.           ############
  1836.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1837.           @battler.setup_battler_hurt_ani(1)
  1838.           #################################################################
  1839.         # 单回合多次攻击
  1840.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1
  1841.           ############ #小改动
  1842.           @temp_hits+=1
  1843.           ############
  1844.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1845.           @battler.setup_battler_hurt_ani(1)
  1846.         ########################################################################
  1847.         # 死亡之前攻击
  1848.        elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1 and @battler.dead? and @battler.battler_dead_ani != 1
  1849.           ############ #小改动
  1850.           @temp_hits+=1
  1851.           ############
  1852.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1853.           @battler.setup_battler_hurt_ani(1)
  1854.           #################################################################
  1855.         # 闪避的回合
  1856.        elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1857.           @last_hits = 0
  1858.           #################################################################
  1859.         # 无伤害的攻击
  1860.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1861.           @last_hits = 0
  1862.           #################################################################
  1863.         # 死亡判定
  1864.        elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1865. #          for actor in $game_party.actors
  1866. #默认的话  如果死亡  其他角色添加第六号状态
  1867. #《石焚刃暖》里 是狂暴状态
  1868. #            if @battler != actor
  1869. #              actor.add_state(6)
  1870. #            end
  1871. #          end
  1872.           @last_hits = 0
  1873.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1874.           @battler.setup_battler_dead_ani(1)
  1875.           #################################################################
  1876.         # 胜利判定
  1877.        elsif $scene.phase == 5 and @once == 0 and @battler_name != nil and not @battler.hidden and not @battler.dead? and $game_temp.battle_proc == nil
  1878.              @once = 1
  1879.              @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  1880.         end
  1881.       end
  1882.     end
  1883.   end
  1884.   #--------------------------------------------------------------------------
  1885.   # ● 处理敌人动作
  1886.   #--------------------------------------------------------------------------
  1887.   def update_enemy_animation
  1888.     if @battler.is_a?(Game_Enemy)
  1889.       if @battler.show_damage_value != nil
  1890.         self.damage(@battler.show_damage_value, false)
  1891.         @battler.show_damage(nil)
  1892.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1893.         @battler.setup_battler_hurt_ani(1)
  1894.       end
  1895.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
  1896.       else
  1897.         # 单回合只有一次攻击
  1898.         if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1899.           ############ #小改动
  1900.           @last_hits = 0
  1901.           ############
  1902.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1903.           @battler.setup_battler_hurt_ani(1)
  1904.           #################################################################
  1905.         # 单回合多次攻击
  1906.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1907.           ############ #小改动
  1908.           @temp_hits+=1
  1909.           ############
  1910.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1911.           @battler.setup_battler_hurt_ani(1)
  1912.           #################################################################
  1913.         # 死亡之前攻击
  1914.        elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and @battler.dead? and @battler.battler_dead_ani != 1
  1915.           ############ #小改动
  1916.           @temp_hits+=1
  1917.           ############
  1918.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1919.           @battler.setup_battler_hurt_ani(1)
  1920.           #################################################################
  1921.         # 无伤害的攻击
  1922.         elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1923.           @last_hits = 0
  1924.           #################################################################
  1925.         # 闪避的回合
  1926.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1927.           @last_hits = 0
  1928.           #################################################################
  1929.         # 死亡判定
  1930.         elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1931.           @last_hits = 0
  1932.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1933.           @battler.setup_battler_dead_ani(1)
  1934.           collapse
  1935.         end
  1936.       end
  1937.     end
  1938.   end
  1939. end

复制代码
希望大家可以支持《吃货计划:绫重奏》https://rpg.blue/forum.php?mod=viewthread&tid=402357&extra=&page=1
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-4-26 07:30

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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