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

Project1

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

[已经过期] 关于打击次数显示HITS,使用图片作为显示次数

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
跳转到指定楼层
1
发表于 2020-3-11 23:22:35 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我当年看过这个打击显示HITS脚本的范例,就是显示连击次数时,使用的是蓝色图片做显示连击次数。
谁还记得,有这个脚本。或者有范例的希望能给我急需,在此感谢大家

Lv3.寻梦者

梦石
0
星屑
1562
在线时间
158 小时
注册时间
2020-3-17
帖子
55
2
发表于 2020-3-19 17:09:20 | 只看该作者
这个算不算
回复 支持 1 反对 0

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
3
 楼主| 发表于 2020-4-2 15:17:59 | 只看该作者

就是这个
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1562
在线时间
158 小时
注册时间
2020-3-17
帖子
55
4
发表于 2020-4-4 21:00:40 | 只看该作者
本帖最后由 我不是朱鹏 于 2020-4-4 21:02 编辑


额……现在才看见。游戏脚本我先发过来
这个游戏是潘萌制作的《重生学校》,2013年在66rpg发布,百度贴吧“笑谈学校吧”里有游戏的资源。https://tieba.baidu.com/p/4484819088
  1. #==============================================================================
  2. # ■ 全动画战斗系统(修改加强再加强版)
  3. #812行左右有常规设定
  4. #------------------------------------------------------------------------------
  5. #  By whbm
  6. #   应用脚本 彩虹神剑 By 66
  7. #简要介绍:
  8. #    本脚本实现了战斗的动态效果,其中包含了待机、攻击、防御、挨打、胜利、死亡。类似于超级横版、超级战斗。但是本系统特色在于所有效果的实现并不是靠庞大的战斗图,
  9. #而是使用了数据库中的动画。这样不仅突破了不同人不同祯数量的限制,并且方便了单动画单祯的修改。
  10. #使用方法:
  11. #   
  12. #    1.数据库的设置
  13. #      敌人必要的动画有待机、挨打、死亡三个必要的动画
  14. #      角色必要的动画有待机、挨打、防御、死亡动态、胜利动态、死亡静态、胜利静态
  15. #
  16. #      死亡静态与胜利静态:动画中只有1祯,为相应动态动画的最后一祯
  17. #      
  18. #      剩下的就是人物攻击的动画,和正常的动画是一样设置
  19. #      如图中的攻击等待动画只是为了在播放攻击动画的同时消除人物本身(素材原因,人物攻击的时候离开了原位,如果是在原位置放魔法是用不上的)
  20. #    2.战斗图的设置
  21. #      战斗图其实只是一个透明的图片,它只是用来描述一个敌人或者角色的大小,并与相应的战斗动画编号相衔接。
  22. #      战斗图的文件名格式如下:
  23. #          名字★待机★防御★挨打★死亡动态★死亡静态★胜利动态★胜利静态★施法动画(本人自己添加的).png
  24. #          (其中“名字”一项与动画无关)
  25. #          例如:
  26. #          紫烟★140★141★148★149★150★144★145★146.png
  27. #      对于敌人无胜利动画或者防御动画,请保持该位置为空,例如:
  28. #          蓝若冰★124★★126★127★128★★★129.png
  29. #    综上,设置就这么完成了。
  30. #注意!设置战斗动画的闪烁时,不能用画面闪烁,只能用角色闪烁,否则伤害显示会混乱
  31. #==============================================================================
  32.     $fangyu = 0
  33. #################################################################
  34. #此处更改是为了增加状态画面
  35. ##################################################################
  36. #================
  37. module RPG
  38.   class Sprite < ::Sprite
  39.     @@_animations = []
  40.     @@_reference_count = {}
  41.     def dispose
  42.       dispose_damage
  43.       dispose_animation
  44.       dispose_loop_animation
  45.        dispose_loop_animation1
  46.       super
  47.     end
  48.    def loop_animation1(animation)
  49.       return if animation == @_loop_animation1
  50.       dispose_loop_animation1
  51.       @_loop_animation1 = animation
  52.       return if @_loop_animation1 == nil
  53.       @_loop_animation1_index = 0
  54.       animation_name = @_loop_animation1.animation_name
  55.       animation_hue = @_loop_animation1.animation_hue
  56.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  57.       if @@_reference_count.include?(bitmap)
  58.         @@_reference_count[bitmap] += 1
  59.       else
  60.         @@_reference_count[bitmap] = 1
  61.       end
  62.       @_loop_animation1_sprites = []
  63.       for i in 0..15
  64.         sprite = ::Sprite.new(self.viewport)
  65.         sprite.bitmap = bitmap
  66.         sprite.visible = false
  67.         @_loop_animation1_sprites.push(sprite)
  68.       end
  69.       update_loop_animation1
  70.     end
  71.     def dispose_loop_animation1
  72.       if @_loop_animation1_sprites != nil
  73.         sprite = @_loop_animation1_sprites[0]
  74.         if sprite != nil
  75.           @@_reference_count[sprite.bitmap] -= 1
  76.           if @@_reference_count[sprite.bitmap] == 0
  77.             sprite.bitmap.dispose
  78.           end
  79.         end
  80.         for sprite in @_loop_animation1_sprites
  81.           sprite.dispose
  82.         end
  83.         @_loop_animation1_sprites = nil
  84.         @_loop_animation1 = nil
  85.       end
  86.     end
  87.     def update_loop_animation1
  88.       frame_index = @_loop_animation1_index
  89.       cell_data = @_loop_animation1.frames[frame_index].cell_data
  90.       position = @_loop_animation1.position
  91.       animation_set_sprites(@_loop_animation1_sprites, cell_data, position)
  92.       for timing in @_loop_animation1.timings
  93.         if timing.frame == frame_index
  94.           animation_process_timing(timing, true)
  95.         end
  96.       end
  97.     end
  98.   end
  99. end
  100. #===============
  101. #新加部分

  102. class Spriteset_Battle
  103.   #--------------------------------------------------------------------------
  104.   # ● 初始化变量
  105.   #--------------------------------------------------------------------------
  106.   def initialize
  107.     # 生成显示端口
  108.     @viewport1 = Viewport.new(0, 0, 640, 480)
  109.     @viewport2 = Viewport.new(0, 0, 640, 480)
  110.     @viewport3 = Viewport.new(0, 0, 640, 480)
  111.     @viewport4 = Viewport.new(0, 0, 640, 480)
  112.     @viewport2.z = 101
  113.     @viewport3.z = 200
  114.     @viewport4.z = 5000
  115.     # 生成战斗背景活动块
  116.     @battleback_sprite = Sprite.new(@viewport1)
  117.     # 生成敌人活动块
  118.     @enemy_sprites = []
  119.     for enemy in $game_troop.enemies.reverse
  120. #      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  121.       @enemy_sprites.push(Sprite_Battler.new(@viewport4, enemy))#敌人的显示高度
  122.     end
  123.     # 生成敌人活动块
  124.     @actor_sprites = []
  125.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  126.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  127.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  128.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  129.         #######################################################
  130.     #若是5人制,加入次行,现在暂时废止
  131.     #  @actor_sprites.push(Sprite_Battler.new(@viewport2))
  132.     #########################################################
  133.     # 生成天候
  134.     @weather = RPG::Weather.new(@viewport1)
  135.     # 生成图片活动块
  136.     @picture_sprites = []
  137.     for i in 51..100
  138.       @picture_sprites.push(Sprite_Picture.new(@viewport3,
  139.         $game_screen.pictures[i]))
  140.     end
  141.     # 生成计时器块
  142.     @timer_sprite = Sprite_Timer.new
  143.     # 刷新画面
  144.     update
  145.   end
  146.   #..........................................................................
  147.   #--------------------------------------------------------------------------
  148.   # ● 胜利图
  149.   #--------------------------------------------------------------------------
  150.   def win
  151.     for sprite in @actor_sprites
  152.       sprite.win
  153.     end
  154.   end
  155.   #..........................................................................
  156.   #--------------------------------------------------------------------------
  157.   # ● 刷新画面
  158.   #--------------------------------------------------------------------------
  159.   def update
  160.     # 刷新角色的活动块 (对应角色的替换)
  161.     @actor_sprites[0].battler = $game_party.actors[0]
  162.     @actor_sprites[1].battler = $game_party.actors[1]
  163.     @actor_sprites[2].battler = $game_party.actors[2]
  164.     @actor_sprites[3].battler = $game_party.actors[3]
  165.     # 战斗背景的文件名与现在情况有差异的情况下
  166.     if @battleback_name != $game_temp.battleback_name
  167.       @battleback_name = $game_temp.battleback_name
  168.       if @battleback_sprite.bitmap != nil
  169.         @battleback_sprite.bitmap.dispose
  170.       end
  171.       @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  172.       @battleback_sprite.src_rect.set(0, 0, 640, 480)
  173.     end
  174.     # 刷新战斗者的活动块
  175.     for sprite in @enemy_sprites + @actor_sprites
  176.       sprite.update
  177.     end
  178.     # 刷新天气图形
  179.     @weather.type = $game_screen.weather_type
  180.     @weather.max = $game_screen.weather_max
  181.     @weather.update
  182.     # 刷新图片活动块
  183.     for sprite in @picture_sprites
  184.       sprite.update
  185.     end
  186.     # 刷新计时器活动块
  187.     @timer_sprite.update
  188.     # 设置画面的色调与震动位置
  189.     @viewport1.tone = $game_screen.tone
  190.     @viewport1.ox = $game_screen.shake
  191.     # 设置画面的闪烁色
  192.     @viewport4.color = $game_screen.flash_color
  193.     # 刷新显示端口
  194.     @viewport1.update
  195.     @viewport2.update
  196.     @viewport4.update
  197.   end
  198. end
  199. class Arrow_Enemy < Arrow_Base
  200.   #--------------------------------------------------------------------------
  201.   # ● 获取光标指向的敌人
  202.   #--------------------------------------------------------------------------
  203.   def enemy
  204.     return $game_troop.enemies[@index]
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ● 刷新画面
  208.   #--------------------------------------------------------------------------
  209.   def update
  210.     super
  211.     # 如果指向不存在的敌人就离开
  212.     $game_troop.enemies.size.times do
  213.       break if self.enemy.exist?
  214.       @index += 1
  215.       @index %= $game_troop.enemies.size
  216.     end
  217.     # 光标右
  218.     if Input.repeat?(Input::RIGHT)
  219.       $game_system.se_play($data_system.cursor_se)
  220.       $game_troop.enemies.size.times do
  221.         @index += 1
  222.         @index %= $game_troop.enemies.size
  223.         break if self.enemy.exist?
  224.       end
  225.     end
  226.     # 光标左
  227.     if Input.repeat?(Input::LEFT)
  228.       $game_system.se_play($data_system.cursor_se)
  229.       $game_troop.enemies.size.times do
  230.         @index += $game_troop.enemies.size - 1
  231.         @index %= $game_troop.enemies.size
  232.         break if self.enemy.exist?
  233.       end
  234.     end
  235.     # 设置活动块坐标
  236.     if self.enemy != nil
  237.       self.x = self.enemy.screen_x + self.ox
  238.       self.y = self.enemy.screen_y + self.oy
  239.     end
  240.   end
  241. end
  242. class Arrow_Actor < Arrow_Base
  243.   #--------------------------------------------------------------------------
  244.   # ● 获取光标指向的角色
  245.   #--------------------------------------------------------------------------
  246.   def actor
  247.     return $game_party.actors[@index]
  248.   end
  249.   #--------------------------------------------------------------------------
  250.   # ● 刷新画面
  251.   #--------------------------------------------------------------------------
  252.   def update
  253.     super
  254.     # 光标右
  255.     if Input.repeat?(Input::RIGHT)
  256.       $game_system.se_play($data_system.cursor_se)
  257.       @index += 1
  258.       @index %= $game_party.actors.size
  259.     end
  260.     # 光标左
  261.     if Input.repeat?(Input::LEFT)
  262.       $game_system.se_play($data_system.cursor_se)
  263.       @index += $game_party.actors.size - 1
  264.       @index %= $game_party.actors.size
  265.     end
  266.     # 设置活动块坐标
  267.     if self.actor != nil
  268.       self.x = self.actor.screen_x + self.ox
  269.       self.y = self.actor.screen_y + self.oy
  270.     end
  271.   end
  272. end
  273. class Scene_Battle
  274.   #--------------------------------------------------------------------------
  275.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  276.   #--------------------------------------------------------------------------
  277.   #################################################
  278.   ###############################################
  279.   #此处为了改出自身施法动画做了较大修改
  280.   #恢复性技能要设置一个属性!默认#21
  281.   ###################################################
  282.   ###################################################
  283. def update_phase4_step3

  284.   case @active_battler.current_action.kind
  285.   
  286.   when 1
  287.     #-----------------
  288.     #buff技能
  289.     #------------------
  290.    
  291.     ################################################
  292.    if $data_skills[@active_battler.current_action.skill_id].element_set.include?(21)
  293. #给buff型技能设定一个属性,默认21

  294.      # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  295.      if @animation1_id == 0
  296.        @active_battler.white_flash = true
  297.      else
  298.        @active_battler.animation_id = @animation1_id
  299.        @active_battler.animation_hit = true
  300.      end
  301.    
  302.     # 限制动画长度、最低 8 帧
  303.     @wait_count = 8
  304.     # 移至步骤 4
  305.     @phase4_step = 4 #转到第四步就会显示了
  306.    

  307.     else   
  308.     #$data_skills[@active_battler.current_action.skill_id].element_set.include?(11)
  309.     #------------------------
  310.     #buff之外的技能
  311.     #------------------------
  312.     #=========
  313.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  314.     ############################################
  315. # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  316.     if @animation1_id == 0
  317.       @active_battler.white_flash = true
  318.     else
  319.     # 添加施法动画
  320. #     @active_battler.setup_battler_ani(@active_battler.battler_name.split(/★/)[8], 1)
  321.       @active_battler.animation_id = @animation1_id
  322.       @active_battler.animation_hit = true
  323.     end
  324.     # 对像方动画
  325.     for target in @target_battlers
  326.       target.animation_id = @animation2_id
  327.       target.animation_hit = (target.damage != "Miss")
  328.       ###########################################################
  329.       target.setup_battler_dead_ani(0)
  330.       ############################################################
  331.       #.......................................................................
  332.       if target.is_a?(Game_Actor)
  333.         ##############
  334.         if target.guarding?
  335.           $fangyu = 1
  336.         end
  337.         ##############
  338.         if target.current_action.kind == 0 and target.current_action.basic == 1
  339.            target.setup_battler_ani(target.battler_name.split(/★/)[2], 1)
  340.          #else
  341.            #target.current_action.kind == 0 and target.current_action.basic == 1
  342.           # target.setup_battler_ani(target.battler_name.split(/★/)[3], 0)
  343.            else
  344.          target.setup_battler_hurt_ani(0)
  345.         end
  346.       end
  347.       if target.is_a?(Game_Enemy)
  348.        if target.current_action.kind == 0 and target.current_action.basic == 1
  349.           target.setup_battler_ani(target.battler_name.split(/★/)[1])
  350.         else
  351.           target.setup_battler_hurt_ani(0)
  352.         end
  353.       end
  354.       #.......................................................................
  355.     end
  356.     # 对像方动画
  357.     for target in @target_battlers
  358.       target.animation_id = @animation2_id
  359.       target.animation_hit = (target.damage != "Miss")
  360.       #......................................................................
  361.     end
  362.     # 限制动画长度、最低 8 帧
  363.     @wait_count = 8
  364.     # 移至步骤 5
  365.     @phase4_step = 5
  366. end

  367.   ###############################################################333
  368.              #----------------
  369.   when 2 #物品
  370.               #----------
  371.      if @animation1_id == 0
  372.       @active_battler.white_flash = true
  373.     else
  374.       @active_battler.animation_id = @animation1_id
  375.       @active_battler.animation_hit = true
  376.     end
  377.    
  378.     # 限制动画长度、最低 8 帧
  379.     @wait_count = 8
  380.     # 移至步骤 4
  381.     @phase4_step = 4
  382.    
  383.   when 0
  384.    
  385.    # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  386.     if @animation1_id == 0
  387.       @active_battler.white_flash = true
  388.     else
  389.     # 添加施法动画
  390. #     @active_battler.setup_battler_ani(@active_battler.battler_name.split(/★/)[8], 1)
  391.       @active_battler.animation_id = @animation1_id
  392.       @active_battler.animation_hit = true
  393.     end
  394.     # 对像方动画
  395.     for target in @target_battlers
  396.       target.animation_id = @animation2_id
  397.       target.animation_hit = (target.damage != "Miss")
  398.       ###########################################################
  399.       target.setup_battler_dead_ani(0)
  400.       ############################################################
  401.       #.......................................................................
  402.       if target.is_a?(Game_Actor)
  403.         ##############
  404.         if target.guarding?
  405.           $fangyu = 1
  406.         end
  407.         ##############
  408.         if target.current_action.kind == 0 and target.current_action.basic == 1
  409.            target.setup_battler_ani(target.battler_name.split(/★/)[2], 1)
  410.          #else
  411.            #target.current_action.kind == 0 and target.current_action.basic == 1
  412.           # target.setup_battler_ani(target.battler_name.split(/★/)[3], 0)
  413.            else
  414.          target.setup_battler_hurt_ani(0)
  415.         end
  416.       end
  417.       if target.is_a?(Game_Enemy)
  418.        if target.current_action.kind == 0 and target.current_action.basic == 1
  419.           target.setup_battler_ani(target.battler_name.split(/★/)[1])
  420.         else
  421.           target.setup_battler_hurt_ani(0)
  422.         end
  423.       end
  424.       #.......................................................................
  425.     end
  426.     # 对像方动画
  427.     for target in @target_battlers
  428.       target.animation_id = @animation2_id
  429.       target.animation_hit = (target.damage != "Miss")
  430.       #......................................................................
  431.     end
  432.     # 限制动画长度、最低 8 帧
  433.     @wait_count = 8
  434.     # 移至步骤 5
  435.     @phase4_step = 5

  436.   end
  437. end
  438. #--------------------------------------------------------------------------
  439.   # ● 刷新画面 (主回合步骤 4 : 对像方动画) ★
  440.   #--------------------------------------------------------------------------
  441.   def update_phase4_step4
  442.     # 对像方动画
  443.     for target in @target_battlers
  444.       target.animation_id = @animation2_id
  445.       target.animation_hit = (target.damage != "Miss")
  446.       #......................................................................
  447.       
  448.       
  449.     end
  450.     # 限制动画长度、最低 8 帧
  451.     @wait_count = 8
  452.     # 移至步骤 5
  453.     @phase4_step = 5
  454.   end
  455. end
  456. ######################################################3

  457. #############################################################################
  458. #                                横版修改   
  459. #改角色的坐标#
  460. ###注意,此处虽然按照5人制改了坐标,但是因为前面未设置,所以无效

  461. #############################################################################
  462. class Game_Actor < Game_Battler
  463.   
  464. #--------------------------------------------------------------------------
  465.   # ● 取得战斗画面的 X 坐标
  466.   #--------------------------------------------------------------------------
  467.   def screen_x
  468.     case self.index  
  469.     when 0
  470.       return 500
  471.     when 1
  472.       return 430
  473.     when 2
  474.       return 580
  475.     when 3
  476.       return 390
  477.     when 4
  478.       return 460
  479.     else
  480.       return 640
  481.     end
  482.   end
  483.   #----
  484.   #--------------------------------------------------------------------------
  485.   # ● 取得战斗画面的 Y 坐标
  486.   #--------------------------------------------------------------------------
  487.   def screen_y
  488.     # 返回计算后的队伍 Y 坐标的排列顺序
  489.     case self.index  
  490.     when 0
  491.       return 310
  492.     when 1
  493.       return 295
  494.     when 2
  495.       return 325
  496.     when 3
  497.       return 340
  498.     when 4
  499.       return 360
  500.     else
  501.       return 1000
  502.     end
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ● 取得战斗画面的 Z 坐标
  506.   #--------------------------------------------------------------------------
  507.   def screen_z
  508.     # 返回计算后的队伍 Z 坐标的排列顺序
  509.     if self.index != nil
  510.       return 4 - self.index
  511.     else
  512.       return 0
  513.     end
  514.   end
  515. end
  516. class Scene_Battle
  517.   
  518.   
  519.   
  520. #--------------------------------------------------------------------------
  521.   # ● 取得战斗画面的 X 坐标
  522.   #--------------------------------------------------------------------------
  523.   def screen_x
  524.     # 返回计算后的队伍 X 坐标的排列顺序
  525.     if self.index != nil
  526.       #......................................................................
  527.       return self.index * 90 + 500
  528.       #......................................................................
  529.     else
  530.       return 0
  531.     end
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # ● 取得战斗画面的 Y 坐标
  535.   #--------------------------------------------------------------------------
  536.   def screen_y
  537.     #........................................................................
  538.     return 464 - self.index * 110
  539.     #........................................................................
  540.   end
  541.   #--------------------------------------------------------------------------
  542.   # ● 取得战斗画面的 Z 坐标
  543.   #--------------------------------------------------------------------------
  544.   def screen_z
  545.     # 返回计算后的队伍 Z 坐标的排列顺序
  546.     if self.index != nil
  547.       return 4 - self.index
  548.     else
  549.       return 0
  550.     end
  551.   end
  552. end

  553. class Scene_Battle
  554.   #..........................................................................
  555.   #--------------------------------------------------------------------------
  556.   # ● 返回phase
  557.   #--------------------------------------------------------------------------
  558.   def phase
  559.     return @phase
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # ● 返回phase4_step
  563.   #--------------------------------------------------------------------------
  564.   def phase4_step
  565.     return @phase4_step
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ● 返回phase4_step
  569.   #--------------------------------------------------------------------------
  570.   def actor_command_active?
  571.     return @actor_command_window.active
  572.   end
  573.   #..........................................................................
  574. end
  575. class Game_Battler
  576.   #..........................................................................
  577.   #--------------------------------------------------------------------------
  578.   # ● 获取循环的动画 ID
  579.   #--------------------------------------------------------------------------  
  580.   def show_damage(value)
  581.     @show_damage_value = value
  582.   end
  583.   #--------------------------------------------------------------------------
  584.   # ● 获取循环的动画 ID
  585.   #--------------------------------------------------------------------------
  586.   def show_damage_value
  587.     return @show_damage_value
  588.   end
  589.   #--------------------------------------------------------------------------
  590.   # ● 获取循环的动画 ID
  591.   #--------------------------------------------------------------------------
  592.   def battler_ani
  593.     return @battler_ani
  594.   end
  595.   #--------------------------------------------------------------------------
  596.   # ● 获取循环的动画 ID
  597.   #--------------------------------------------------------------------------
  598.   def setup_battler_ani(battler_ani, once = 0)
  599.     @battler_ani = battler_ani
  600.     @once = once
  601.   end
  602.   #--------------------------------------------------------------------------
  603.   # ● 获取循环的动画 ID
  604.   #--------------------------------------------------------------------------
  605.   def setup_battler_hurt_ani(hurt)
  606.     @hurt = hurt
  607.   end  
  608.   #--------------------------------------------------------------------------
  609.   # ● 获取循环的动画 ID
  610.   #--------------------------------------------------------------------------
  611.   def setup_battler_dead_ani(over)
  612.     @over = over
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ● 获取循环的动画 ID
  616.   #--------------------------------------------------------------------------
  617.   def battler_dead_ani
  618.     return @over
  619.   end
  620.   #--------------------------------------------------------------------------
  621.   # ● 获取循环的动画 ID
  622.   #--------------------------------------------------------------------------
  623.   def battler_ani_once
  624.     return @once
  625.   end
  626.   #--------------------------------------------------------------------------
  627.   # ● 获取循环的动画 ID
  628.   #--------------------------------------------------------------------------
  629.   def battler_hurt_ani
  630.     return @hurt
  631.   end
  632.   #########################
  633.   #..........................................................................
  634. end
  635. class Sprite_Battler < RPG::Sprite
  636.   #..........................................................................
  637.   #--------------------------------------------------------------------------
  638.   # ● 胜利图
  639.   #--------------------------------------------------------------------------
  640.   def win
  641.     if @battler_name != nil and not @battler.hidden and not @battler.dead?
  642.       @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  643.     end
  644.   end
  645.   #..........................................................................
  646.   #--------------------------------------------------------------------------
  647.   # ● 释放
  648.   #--------------------------------------------------------------------------
  649.   def dispose
  650.     if self.bitmap != nil
  651.       self.bitmap.dispose
  652.     end
  653.     super
  654.   end
  655.   #--------------------------------------------------------------------------
  656.   # ● 刷新画面
  657.   #--------------------------------------------------------------------------
  658.   def update
  659.     super
  660.     # 战斗者为 nil 的情况下
  661.     if @battler == nil
  662.       self.bitmap = nil
  663.       loop_animation(nil)
  664.        loop_animation1(nil)
  665.       return
  666.     end
  667.     # 文件名和色相与当前情况有差异的情况下
  668.     if @battler.battler_name != @battler_name or
  669.        @battler.battler_hue != @battler_hue
  670.       @battler_hue = @battler.battler_hue
  671.       # 获取、设置位图
  672.       @battler_name = @battler.battler_name
  673.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  674.       #.......................................................................
  675.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  676.       #.......................................................................
  677.       @width = bitmap.width
  678.       @height = bitmap.height
  679.       self.ox = @width / 2
  680.       self.oy = @height
  681.       # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  682.       if @battler.is_a?(Game_Enemy)
  683.         if @battler.dead? or @battler.hidden
  684.           self.opacity = 0
  685.         end
  686.       end
  687.     end
  688.     # 动画 ID 与当前的情况有差异的情况下
  689.     #.........................................................................
  690.     if @battler.battler_ani != @battler_ani
  691.       @battler_ani = @battler.battler_ani
  692.       loop_animation($data_animations[@battler_ani.to_i])
  693.       

  694.       
  695.      end
  696.    
  697.     #.........................................................................
  698.     # 应该被显示的角色的情况下
  699.     if @battler.is_a?(Game_Actor) and @battler_visible
  700.       # 不是主状态的时候稍稍降低点透明度
  701.       if $game_temp.battle_main_phase
  702.         self.opacity += 3 if self.opacity < 255
  703.       else
  704.         self.opacity -= 3 if self.opacity > 207
  705.       end
  706.     end
  707.     # 明灭
  708.     if @battler.blink
  709.       blink_on
  710.     else
  711.       blink_off
  712.     end
  713.     # 不可见的情况下
  714.     unless @battler_visible
  715.       # 出现 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  716.       if not @battler.hidden and not @battler.dead? and
  717.          (@battler.damage == nil or @battler.damage_pop)
  718.         if @battler.is_a?(Game_Enemy)
  719.           appear
  720.         else
  721.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  722.         end
  723.         @battler_visible = true
  724.       end
  725.     end
  726.     # 可见的情况下
  727.     if @battler_visible
  728.       # 逃跑
  729.       if @battler.hidden
  730.         $game_system.se_play($data_system.escape_se)
  731.         escape
  732.         @battler_visible = false
  733.       end
  734.       # 白色闪烁
  735.       if @battler.white_flash
  736.         whiten
  737.         @battler.white_flash = false
  738.       end
  739.       # 动画
  740.       if @battler.animation_id != 0
  741.         animation = $data_animations[@battler.animation_id]
  742.         animation(animation, @battler.animation_hit)
  743.         @battler.animation_id = 0
  744.       end
  745.       # 伤害
  746.       if @battler.damage_pop
  747.         damage(@battler.damage, @battler.critical)
  748.         @battler.damage = nil
  749.         @battler.critical = false
  750.         @battler.damage_pop = false
  751.       end
  752.       # korapusu
  753.       if @battler.damage == nil and @battler.dead?
  754.         #....................................................................
  755.         if @battler.is_a?(Game_Enemy)
  756.           $game_system.se_play($data_system.enemy_collapse_se)
  757.           #collapse
  758.         else
  759.           $game_system.se_play($data_system.actor_collapse_se)
  760.         end
  761.         #....................................................................
  762.         @battler_visible = false
  763.       end
  764.     end
  765.     # 设置活动块的坐标
  766.     self.x = @battler.screen_x
  767.     self.y = @battler.screen_y
  768.     self.z = @battler.screen_z
  769.   end
  770. end
  771. module RPG
  772.   class Sprite < ::Sprite
  773.     def damage(value, critical)
  774.       dispose_damage
  775.       if value.is_a?(Numeric)
  776.         damage_string = value.abs.to_s
  777.       else
  778.         damage_string = value.to_s
  779.       end
  780.       bitmap = Bitmap.new(160, 48)
  781.       bitmap.font.name = "Arial Black"
  782.       bitmap.font.size = 32
  783.       bitmap.font.color.set(0, 0, 0)
  784.       bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  785.       bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  786.       bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  787.       bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  788.       if value.is_a?(Numeric) and value < 0
  789.         bitmap.font.color.set(176, 255, 144)
  790.       else
  791.         bitmap.font.color.set(255, 255, 255)
  792.       end
  793.       bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  794.       if critical
  795.         bitmap.font.size = 20
  796.         bitmap.font.color.set(0, 0, 0)
  797.         bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
  798.         bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
  799.         bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
  800.         bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
  801.         bitmap.font.color.set(255, 255, 255)
  802.         bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
  803.       end
  804.       @_damage_sprite = ::Sprite.new(self.viewport)
  805.       @_damage_sprite.bitmap = bitmap
  806.       @_damage_sprite.ox = 80
  807.       @_damage_sprite.oy = 20
  808.       @_damage_sprite.x = self.x
  809.       @_damage_sprite.x -= self.bitmap.width/2 if @battler.is_a?(Game_Actor)
  810.       @_damage_sprite.y = self.y - self.oy / 2
  811.       @_damage_sprite.z = 3000
  812.       @_damage_duration = 40
  813.     end
  814.   end
  815. end
  816. ###########################################################
  817. ##############################################################
  818. #在此处更改伤害显示图
  819. #################################################################
  820. module RPG
  821. #--------------------------------------------------------------------------
  822. # ● 常量设定
  823. #--------------------------------------------------------------------------
  824. # 是否显示总伤害
  825. SHOW_TOTAL_DAMAGE = true
  826. # 角色受攻击时是否跳一下
  827. BATTLER_JUMP = false
  828. # 伤害美化字符串文件夹名(放在Pictures文件夹中的子文件夹)
  829. STRING_DOCUMENTS = "String/"
  830. # 是否使用伤害美化效果
  831. USE_DAMAGE =true
  832. # 连续伤害的动画ID
  833. SLIP_DAMAGE_ANIMATION_ID = 236

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

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

  1546.   #........................................................................
  1547.   @once = 0
  1548.   @frame_index = -1
  1549.   @last_frame = 0
  1550.   #........................................................................
  1551. end
  1552. #--------------------------------------------------------------------------
  1553. # ● 刷新画面
  1554. #    增添跳跃功能
  1555. #--------------------------------------------------------------------------
  1556. def update
  1557.   super
  1558.   # 战斗者为 nil 的情况下
  1559.   if @battler == nil
  1560.     self.bitmap = nil
  1561.     loop_animation(nil)
  1562.    loop_animation1(nil)
  1563.     return
  1564.   end
  1565.   # 文件名和色相与当前情况有差异的情况下
  1566.   if @battler.battler_name != @battler_name or
  1567.      @battler.battler_hue != @battler_hue
  1568.     # 获取、设置位图
  1569.     @battler_name = @battler.battler_name
  1570.     @battler_hue = @battler.battler_hue
  1571.     self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1572.     #.......................................................................
  1573.     if not @battler.hidden and not @battler.dead?
  1574.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1575.     end
  1576.     #.......................................................................
  1577.     @width = bitmap.width
  1578.     @height = bitmap.height
  1579.     self.ox = @width / 2
  1580.     self.oy = @height
  1581.   end
  1582.   #.......................................................................
  1583.   update_actor_animation
  1584.   update_enemy_animation
  1585.   #.......................................................................
  1586.   # 动画 ID 与当前的情况有差异的情况下
  1587.   #.........................................................................
  1588.   if @battler.is_a?(Game_Enemy)
  1589.     if @once == 1 and @loop_animation_once == 1 and
  1590.        @battler.battler_dead_ani == 1
  1591.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1592.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1593.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1594.     end
  1595.   end
  1596.   if @battler.is_a?(Game_Actor)
  1597.     ####################################################################
  1598.     if @once == 1 and @loop_animation_once == 1 and $scene.phase != 5 and
  1599.        @battler.battler_dead_ani == 1 and @battler.dead?
  1600.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1601.     #######################################################################
  1602.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1603.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1604.       #################################################################
  1605.       $fangyu = 0
  1606.       @battler.setup_battler_dead_ani(0)
  1607.       ########################################################
  1608.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase == 5 and
  1609.           not @battler.dead?
  1610.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[7])
  1611.       ######################################################
  1612.       $fangyu = 0
  1613.       @battler.setup_battler_dead_ani(0)
  1614.       ######################################################
  1615.     end
  1616.   end
  1617.   
  1618. if @battler.damage == nil and
  1619.        @battler.state_animation_id != @state_animation_id
  1620.       @state_animation_id = @battler.state_animation_id
  1621.      # loop_animation($data_animations[@state_animation_id])
  1622.        loop_animation1($data_animations[@state_animation_id])
  1623.     end

  1624.    
  1625.   if @battler.battler_ani != @battler_ani
  1626.     @battler_ani = @battler.battler_ani
  1627.     @once = @battler.battler_ani_once
  1628.     loop_animation($data_animations[@battler_ani.to_i])
  1629.     # @battler.state_animation_id != @state_animation_id
  1630.       #@state_animation_id = @battler.state_animation_id
  1631.      # loop_animation($data_animations[@state_animation_id])
  1632.       # loop_animation1($data_animations[@state_animation_id])
  1633.      
  1634.    
  1635.   end
  1636.   #.........................................................................
  1637.   # 明灭
  1638.   if @battler.blink
  1639.     blink_on
  1640.   else
  1641.     blink_off
  1642.   end
  1643.   # 不可见的情况下
  1644.   unless @battler_visible
  1645.     # 出现
  1646.     if not @battler.hidden and not @battler.dead? and
  1647.        (@battler.damage == nil or @battler.damage_pop)
  1648.       #.......................................................................
  1649.       if @battler.is_a?(Game_Enemy)
  1650.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1651.         #appear
  1652.       else
  1653.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1654.       end
  1655.       #.......................................................................
  1656.       @battler_visible = true
  1657.     end
  1658.   end
  1659.   # 可见的情况下
  1660.   if @battler_visible
  1661.     # 逃跑
  1662.     if @battler.hidden
  1663.       $game_system.se_play($data_system.escape_se)
  1664.       escape
  1665.       @battler_visible = false
  1666.     end
  1667.     # 白色闪烁
  1668.     if @battler.white_flash
  1669.       whiten
  1670.       @battler.white_flash = false
  1671.     end
  1672.     # 动画
  1673.     if @battler.animation_id != 0
  1674.       animation = $data_animations[@battler.animation_id]
  1675.       animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  1676.       # animation(animation, @battler.animation_hit)
  1677.       @battler.animation_id = 0
  1678.     end
  1679.     # 伤害
  1680.     if @battler.damage_pop
  1681.       @battler.damage = nil
  1682.       @battler.critical = false
  1683.       @battler.damage_pop = false
  1684.     end
  1685.     # korapusu
  1686.     if @battler.damage == nil and @battler.dead?
  1687.       if @battler.is_a?(Game_Enemy)
  1688.         if @battler.battler_dead_ani != 1
  1689.           #p "Battler Death Error"
  1690.           $game_system.se_play($data_system.enemy_collapse_se)
  1691.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1692.           @battler.setup_battler_dead_ani(1)
  1693.         end
  1694.         #.....................................................................
  1695.         collapse
  1696.         #.....................................................................
  1697.       else
  1698.         #.....................................................................
  1699.         if @battler.battler_dead_ani != 1
  1700.           #p "Battler Death Error"
  1701.           $game_system.se_play($data_system.enemy_collapse_se)
  1702.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1703.           @battler.setup_battler_dead_ani(1)
  1704.         end
  1705.         #.....................................................................
  1706.       end
  1707.       @battler_visible = false
  1708.     end
  1709.   end
  1710.   # 设置活动块的坐标
  1711.   if @flash_shake_switch == true
  1712.     self.x = @battler.screen_x
  1713.     self.y = @battler.screen_y
  1714.     self.z = @battler.screen_z
  1715.     @flash_shake_switch = false
  1716.   end
  1717.   if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
  1718.     if @battler.is_a?(Game_Enemy)
  1719.       case @flash_shake
  1720.       when 9..10
  1721.         self.x -=4
  1722.         self.y -=4
  1723.         self.z = @battler.screen_z
  1724.       when 6..8
  1725.         self.x -=2
  1726.         self.y -=2
  1727.         self.z = @battler.screen_z
  1728.       when 3..5
  1729.         self.x +=2
  1730.         self.y +=2
  1731.         self.z = @battler.screen_z
  1732.       when 1..2
  1733.         self.x +=4
  1734.         self.y +=4
  1735.         self.z = @battler.screen_z
  1736.       end
  1737.     end
  1738.     if @battler.is_a?(Game_Actor)
  1739.       case @flash_shake
  1740.       when 9..10
  1741.         self.x +=4
  1742.         self.y +=4
  1743.         self.z = @battler.screen_z
  1744.       when 6..8
  1745.         self.x +=2
  1746.         self.y +=2
  1747.         self.z = @battler.screen_z
  1748.       when 3..5
  1749.         self.x -=2
  1750.         self.y -=2
  1751.         self.z = @battler.screen_z
  1752.       when 1..2
  1753.         self.x -=4
  1754.         self.y -=4
  1755.         self.z = @battler.screen_z
  1756.       end
  1757.     end
  1758.    @flash_shake -= 1
  1759.   end
  1760. end
  1761. end

  1762. #==============================================================================
  1763. # ■ Scene_Battle
  1764. #------------------------------------------------------------------------------
  1765. #  处理战斗画面的类。
  1766. #==============================================================================

  1767. class Scene_Battle
  1768. #--------------------------------------------------------------------------
  1769. # ● 定义实例变量
  1770. #--------------------------------------------------------------------------
  1771. attr_reader   :animation1_id                    # 行动方动画ID
  1772. end
  1773. class Sprite_Battler < RPG::Sprite
  1774.   #--------------------------------------------------------------------------
  1775.   # ● 处理角色动作
  1776.   #--------------------------------------------------------------------------
  1777.   def update_actor_animation
  1778.     if @battler.is_a?(Game_Actor)
  1779.       if @battler.show_damage_value != nil
  1780.         self.damage(@battler.show_damage_value, false)
  1781.         @battler.show_damage(nil)
  1782.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1783.         @battler.setup_battler_hurt_ani(1)
  1784.       end
  1785.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1 and @battler.show_damage_value != nil
  1786.         # 防御的时候
  1787.         if @hits > @temp_hits and not @battler.dead?
  1788.           ############ #小改动
  1789.           @temp_hits+=1
  1790.           ############
  1791.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1792.           @battler.setup_battler_hurt_ani(1)
  1793.           #################################################################
  1794.         elsif @last_hits == 1 and not @battler.dead?
  1795.           ############ #小改动
  1796.           @last_hits = 0
  1797.           ############
  1798.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1799.           @battler.setup_battler_hurt_ani(1)
  1800.           #################################################################
  1801.         elsif @frame_index != -1 and @frame_index != @last_frame and not @battler.dead? and [email protected]_a?(Numeric)
  1802.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1803.           @battler.setup_battler_hurt_ani(1)
  1804.           #################################################################
  1805.         elsif @last_hits == 1 and not @battler.dead? and [email protected]_a?(Numeric)
  1806.           ############ #小改动
  1807.           @last_hits = 0
  1808.           ############
  1809.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1810.           @battler.setup_battler_hurt_ani(1)
  1811.           #################################################################
  1812.         end
  1813.       else
  1814.         # 单回合只有一次攻击
  1815.        if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1
  1816.           ############ #小改动
  1817.           @last_hits = 0
  1818.           ############
  1819.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1820.           @battler.setup_battler_hurt_ani(1)
  1821.           #################################################################
  1822.         # 单回合多次攻击
  1823.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and  
  1824. $fangyu != 1
  1825.           ############ #小改动
  1826.           @temp_hits+=1
  1827.           ############
  1828.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1829.           @battler.setup_battler_hurt_ani(1)
  1830.         ########################################################################
  1831.         # 死亡之前攻击
  1832.        elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1 and  
  1833. @battler.dead? and @battler.battler_dead_ani != 1
  1834.           ############ #小改动
  1835.           @temp_hits+=1
  1836.           ############
  1837.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1838.           @battler.setup_battler_hurt_ani(1)
  1839.           #################################################################
  1840.         # 闪避的回合
  1841.        elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1842.           @last_hits = 0
  1843.           #################################################################
  1844.         # 无伤害的攻击
  1845.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1846.           @last_hits = 0
  1847.           #################################################################
  1848.         # 死亡判定
  1849.        elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1

  1850.           @last_hits = 0
  1851.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1852.           @battler.setup_battler_dead_ani(1)
  1853.           #################################################################
  1854.         # 胜利判定
  1855.        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
  1856.              @once = 1
  1857.              @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  1858.         end
  1859.       end
  1860.     end
  1861.   end
  1862.   #--------------------------------------------------------------------------
  1863.   # ● 处理敌人动作
  1864.   #--------------------------------------------------------------------------
  1865.   def update_enemy_animation
  1866.     if @battler.is_a?(Game_Enemy)
  1867.       if @battler.show_damage_value != nil
  1868.         self.damage(@battler.show_damage_value, false)
  1869.         @battler.show_damage(nil)
  1870.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1871.         @battler.setup_battler_hurt_ani(1)
  1872.       end
  1873.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
  1874.       else
  1875.         # 单回合只有一次攻击
  1876.         if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1877.           ############ #小改动
  1878.           @last_hits = 0
  1879.           ############
  1880.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1881.           @battler.setup_battler_hurt_ani(1)
  1882.           #################################################################
  1883.         # 单回合多次攻击
  1884.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1885.           ############ #小改动
  1886.           @temp_hits+=1
  1887.           ############
  1888.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1889.           @battler.setup_battler_hurt_ani(1)
  1890.           #################################################################
  1891.         # 死亡之前攻击
  1892.        elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and @battler.dead? and  
  1893. @battler.battler_dead_ani != 1
  1894.           ############ #小改动
  1895.           @temp_hits+=1
  1896.           ############
  1897.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1898.           @battler.setup_battler_hurt_ani(1)
  1899.           #################################################################
  1900.         # 无伤害的攻击
  1901.         elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1902.           @last_hits = 0
  1903.           #################################################################
  1904.         # 闪避的回合
  1905.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1906.           @last_hits = 0
  1907.           #################################################################
  1908.         # 死亡判定
  1909.         elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1910.           @last_hits = 0
  1911.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1912.           @battler.setup_battler_dead_ani(1)
  1913.           collapse
  1914.         end
  1915.       end
  1916.     end
  1917.   end
  1918. end

复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 00:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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