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

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: 步平凡
打印 上一主题 下一主题

[已经过期] 请问如何调整技能动画优先度?

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3794
在线时间
1965 小时
注册时间
2013-1-3
帖子
9531
11
发表于 2020-2-28 22:05:30 | 只看该作者
本帖最后由 紫英晓狼1130 于 2020-2-28 22:11 编辑

你自己搜一下全屏动画就行了
自己再整合一下
这个系统我还在完善中,目前我手里的已经和当年的有点变化了
还有我已经取消分享链接了,你就自己存着算了,别拿出来分享了
当年七夕小雨做一套仙剑系统还收钱呢……
你就自己研究研究吧,有啥问题@我就行,几个月上一次还是没问题的,好像我死了一样……
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6253
在线时间
981 小时
注册时间
2010-12-3
帖子
45
12
发表于 2020-2-29 10:27:48 | 只看该作者
试试这个...将你要压在特效下的动画编号打在case @_animation.id里

动画分层.zip

201.89 KB, 下载次数: 23

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
555
在线时间
111 小时
注册时间
2013-11-22
帖子
301
13
发表于 2020-3-21 01:30:46 | 只看该作者
这套系统是他自己整合的 肯定不能外挂脚本的
要是外挂也需要自己动手整合
而且师父的工程已经取消分享了
建议您有问题私信他吧 毕竟是没面世的自整合系统
轩辕剑系统 哈哈
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1562
在线时间
158 小时
注册时间
2020-3-17
帖子
55
14
发表于 2020-3-21 11:56:14 | 只看该作者
我这里有个全动画战斗的脚本,发来看看(水水)
RUBY 代码复制
  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.  
  103. class Spriteset_Battle
  104.   #--------------------------------------------------------------------------
  105.   # ● 初始化变量
  106.   #--------------------------------------------------------------------------
  107.   def initialize
  108.     # 生成显示端口
  109.     @viewport1 = Viewport.new(0, 0, 640, 480)
  110.     @viewport2 = Viewport.new(0, 0, 640, 480)
  111.     @viewport3 = Viewport.new(0, 0, 640, 480)
  112.     @viewport4 = Viewport.new(0, 0, 640, 480)
  113.     @viewport2.z = 101
  114.     @viewport3.z = 200
  115.     @viewport4.z = 5000
  116.     # 生成战斗背景活动块
  117.     @battleback_sprite = Sprite.new(@viewport1)
  118.     # 生成敌人活动块
  119.     @enemy_sprites = []
  120.     for enemy in $game_troop.enemies.reverse
  121. #      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  122.       @enemy_sprites.push(Sprite_Battler.new(@viewport4, enemy))#敌人的显示高度
  123.     end
  124.     # 生成敌人活动块
  125.     @actor_sprites = []
  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.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  130.         #######################################################
  131.     #若是5人制,加入次行,现在暂时废止
  132.     #  @actor_sprites.push(Sprite_Battler.new(@viewport2))
  133.     #########################################################
  134.     # 生成天候
  135.     @weather = RPG::Weather.new(@viewport1)
  136.     # 生成图片活动块
  137.     @picture_sprites = []
  138.     for i in 51..100
  139.       @picture_sprites.push(Sprite_Picture.new(@viewport3,
  140.         $game_screen.pictures[i]))
  141.     end
  142.     # 生成计时器块
  143.     @timer_sprite = Sprite_Timer.new
  144.     # 刷新画面
  145.     update
  146.   end
  147.   #..........................................................................
  148.   #--------------------------------------------------------------------------
  149.   # ● 胜利图
  150.   #--------------------------------------------------------------------------
  151.   def win
  152.     for sprite in @actor_sprites
  153.       sprite.win
  154.     end
  155.   end
  156.   #..........................................................................
  157.   #--------------------------------------------------------------------------
  158.   # ● 刷新画面
  159.   #--------------------------------------------------------------------------
  160.   def update
  161.     # 刷新角色的活动块 (对应角色的替换)
  162.     @actor_sprites[0].battler = $game_party.actors[0]
  163.     @actor_sprites[1].battler = $game_party.actors[1]
  164.     @actor_sprites[2].battler = $game_party.actors[2]
  165.     @actor_sprites[3].battler = $game_party.actors[3]
  166.     # 战斗背景的文件名与现在情况有差异的情况下
  167.     if @battleback_name != $game_temp.battleback_name
  168.       @battleback_name = $game_temp.battleback_name
  169.       if @battleback_sprite.bitmap != nil
  170.         @battleback_sprite.bitmap.dispose
  171.       end
  172.       @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  173.       @battleback_sprite.src_rect.set(0, 0, 640, 480)
  174.     end
  175.     # 刷新战斗者的活动块
  176.     for sprite in @enemy_sprites + @actor_sprites
  177.       sprite.update
  178.     end
  179.     # 刷新天气图形
  180.     @weather.type = $game_screen.weather_type
  181.     @weather.max = $game_screen.weather_max
  182.     @weather.update
  183.     # 刷新图片活动块
  184.     for sprite in @picture_sprites
  185.       sprite.update
  186.     end
  187.     # 刷新计时器活动块
  188.     @timer_sprite.update
  189.     # 设置画面的色调与震动位置
  190.     @viewport1.tone = $game_screen.tone
  191.     @viewport1.ox = $game_screen.shake
  192.     # 设置画面的闪烁色
  193.     @viewport4.color = $game_screen.flash_color
  194.     # 刷新显示端口
  195.     @viewport1.update
  196.     @viewport2.update
  197.     @viewport4.update
  198.   end
  199. end
  200. class Arrow_Enemy < Arrow_Base
  201.   #--------------------------------------------------------------------------
  202.   # ● 获取光标指向的敌人
  203.   #--------------------------------------------------------------------------
  204.   def enemy
  205.     return $game_troop.enemies[@index]
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ● 刷新画面
  209.   #--------------------------------------------------------------------------
  210.   def update
  211.     super
  212.     # 如果指向不存在的敌人就离开
  213.     $game_troop.enemies.size.times do
  214.       break if self.enemy.exist?
  215.       @index += 1
  216.       @index %= $game_troop.enemies.size
  217.     end
  218.     # 光标右
  219.     if Input.repeat?(Input::RIGHT)
  220.       $game_system.se_play($data_system.cursor_se)
  221.       $game_troop.enemies.size.times do
  222.         @index += 1
  223.         @index %= $game_troop.enemies.size
  224.         break if self.enemy.exist?
  225.       end
  226.     end
  227.     # 光标左
  228.     if Input.repeat?(Input::LEFT)
  229.       $game_system.se_play($data_system.cursor_se)
  230.       $game_troop.enemies.size.times do
  231.         @index += $game_troop.enemies.size - 1
  232.         @index %= $game_troop.enemies.size
  233.         break if self.enemy.exist?
  234.       end
  235.     end
  236.     # 设置活动块坐标
  237.     if self.enemy != nil
  238.       self.x = self.enemy.screen_x + self.ox
  239.       self.y = self.enemy.screen_y + self.oy
  240.     end
  241.   end
  242. end
  243. class Arrow_Actor < Arrow_Base
  244.   #--------------------------------------------------------------------------
  245.   # ● 获取光标指向的角色
  246.   #--------------------------------------------------------------------------
  247.   def actor
  248.     return $game_party.actors[@index]
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # ● 刷新画面
  252.   #--------------------------------------------------------------------------
  253.   def update
  254.     super
  255.     # 光标右
  256.     if Input.repeat?(Input::RIGHT)
  257.       $game_system.se_play($data_system.cursor_se)
  258.       @index += 1
  259.       @index %= $game_party.actors.size
  260.     end
  261.     # 光标左
  262.     if Input.repeat?(Input::LEFT)
  263.       $game_system.se_play($data_system.cursor_se)
  264.       @index += $game_party.actors.size - 1
  265.       @index %= $game_party.actors.size
  266.     end
  267.     # 设置活动块坐标
  268.     if self.actor != nil
  269.       self.x = self.actor.screen_x + self.ox
  270.       self.y = self.actor.screen_y + self.oy
  271.     end
  272.   end
  273. end
  274. class Scene_Battle
  275.   #--------------------------------------------------------------------------
  276.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  277.   #--------------------------------------------------------------------------
  278.   #################################################
  279.   ###############################################
  280.   #此处为了改出自身施法动画做了较大修改
  281.   #恢复性技能要设置一个属性!默认#21
  282.   ###################################################
  283.   ###################################################
  284. def update_phase4_step3
  285.  
  286.   case @active_battler.current_action.kind
  287.  
  288.   when 1
  289.     #-----------------
  290.     #buff技能
  291.     #------------------
  292.  
  293.     ################################################
  294.    if $data_skills[@active_battler.current_action.skill_id].element_set.include?(21)
  295. #给buff型技能设定一个属性,默认21
  296.  
  297.      # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  298.      if @animation1_id == 0
  299.        @active_battler.white_flash = true
  300.      else
  301.        @active_battler.animation_id = @animation1_id
  302.        @active_battler.animation_hit = true
  303.      end
  304.  
  305.     # 限制动画长度、最低 8 帧
  306.     @wait_count = 8
  307.     # 移至步骤 4
  308.     @phase4_step = 4 #转到第四步就会显示了
  309.  
  310.  
  311.     else   
  312.     #$data_skills[@active_battler.current_action.skill_id].element_set.include?(11)
  313.     #------------------------
  314.     #buff之外的技能
  315.     #------------------------
  316.     #=========
  317.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  318.     ############################################
  319. # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  320.     if @animation1_id == 0
  321.       @active_battler.white_flash = true
  322.     else
  323.     # 添加施法动画
  324. #     @active_battler.setup_battler_ani(@active_battler.battler_name.split(/★/)[8], 1)
  325.       @active_battler.animation_id = @animation1_id
  326.       @active_battler.animation_hit = true
  327.     end
  328.     # 对像方动画
  329.     for target in @target_battlers
  330.       target.animation_id = @animation2_id
  331.       target.animation_hit = (target.damage != "Miss")
  332.       ###########################################################
  333.       target.setup_battler_dead_ani(0)
  334.       ############################################################
  335.       #.......................................................................
  336.       if target.is_a?(Game_Actor)
  337.         ##############
  338.         if target.guarding?
  339.           $fangyu = 1
  340.         end
  341.         ##############
  342.         if target.current_action.kind == 0 and target.current_action.basic == 1
  343.            target.setup_battler_ani(target.battler_name.split(/★/)[2], 1)
  344.          #else
  345.            #target.current_action.kind == 0 and target.current_action.basic == 1
  346.           # target.setup_battler_ani(target.battler_name.split(/★/)[3], 0)
  347.            else
  348.          target.setup_battler_hurt_ani(0)
  349.         end
  350.       end
  351.       if target.is_a?(Game_Enemy)
  352.        if target.current_action.kind == 0 and target.current_action.basic == 1
  353.           target.setup_battler_ani(target.battler_name.split(/★/)[1])
  354.         else
  355.           target.setup_battler_hurt_ani(0)
  356.         end
  357.       end
  358.       #.......................................................................
  359.     end
  360.     # 对像方动画
  361.     for target in @target_battlers
  362.       target.animation_id = @animation2_id
  363.       target.animation_hit = (target.damage != "Miss")
  364.       #......................................................................
  365.     end
  366.     # 限制动画长度、最低 8 帧
  367.     @wait_count = 8
  368.     # 移至步骤 5
  369.     @phase4_step = 5
  370. end
  371.  
  372.   ###############################################################333
  373.              #----------------
  374.   when 2 #物品
  375.               #----------
  376.      if @animation1_id == 0
  377.       @active_battler.white_flash = true
  378.     else
  379.       @active_battler.animation_id = @animation1_id
  380.       @active_battler.animation_hit = true
  381.     end
  382.  
  383.     # 限制动画长度、最低 8 帧
  384.     @wait_count = 8
  385.     # 移至步骤 4
  386.     @phase4_step = 4
  387.  
  388.   when 0
  389.  
  390.    # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  391.     if @animation1_id == 0
  392.       @active_battler.white_flash = true
  393.     else
  394.     # 添加施法动画
  395. #     @active_battler.setup_battler_ani(@active_battler.battler_name.split(/★/)[8], 1)
  396.       @active_battler.animation_id = @animation1_id
  397.       @active_battler.animation_hit = true
  398.     end
  399.     # 对像方动画
  400.     for target in @target_battlers
  401.       target.animation_id = @animation2_id
  402.       target.animation_hit = (target.damage != "Miss")
  403.       ###########################################################
  404.       target.setup_battler_dead_ani(0)
  405.       ############################################################
  406.       #.......................................................................
  407.       if target.is_a?(Game_Actor)
  408.         ##############
  409.         if target.guarding?
  410.           $fangyu = 1
  411.         end
  412.         ##############
  413.         if target.current_action.kind == 0 and target.current_action.basic == 1
  414.            target.setup_battler_ani(target.battler_name.split(/★/)[2], 1)
  415.          #else
  416.            #target.current_action.kind == 0 and target.current_action.basic == 1
  417.           # target.setup_battler_ani(target.battler_name.split(/★/)[3], 0)
  418.            else
  419.          target.setup_battler_hurt_ani(0)
  420.         end
  421.       end
  422.       if target.is_a?(Game_Enemy)
  423.        if target.current_action.kind == 0 and target.current_action.basic == 1
  424.           target.setup_battler_ani(target.battler_name.split(/★/)[1])
  425.         else
  426.           target.setup_battler_hurt_ani(0)
  427.         end
  428.       end
  429.       #.......................................................................
  430.     end
  431.     # 对像方动画
  432.     for target in @target_battlers
  433.       target.animation_id = @animation2_id
  434.       target.animation_hit = (target.damage != "Miss")
  435.       #......................................................................
  436.     end
  437.     # 限制动画长度、最低 8 帧
  438.     @wait_count = 8
  439.     # 移至步骤 5
  440.     @phase4_step = 5
  441.  
  442.   end
  443. end
  444. #--------------------------------------------------------------------------
  445.   # ● 刷新画面 (主回合步骤 4 : 对像方动画) ★
  446.   #--------------------------------------------------------------------------
  447.   def update_phase4_step4
  448.     # 对像方动画
  449.     for target in @target_battlers
  450.       target.animation_id = @animation2_id
  451.       target.animation_hit = (target.damage != "Miss")
  452.       #......................................................................
  453.  
  454.  
  455.     end
  456.     # 限制动画长度、最低 8 帧
  457.     @wait_count = 8
  458.     # 移至步骤 5
  459.     @phase4_step = 5
  460.   end
  461. end
  462. ######################################################3
  463.  
  464. #############################################################################
  465. #                                横版修改   
  466. #改角色的坐标#
  467. ###注意,此处虽然按照5人制改了坐标,但是因为前面未设置,所以无效
  468.  
  469. #############################################################################
  470. class Game_Actor < Game_Battler
  471.  
  472. #--------------------------------------------------------------------------
  473.   # ● 取得战斗画面的 X 坐标
  474.   #--------------------------------------------------------------------------
  475.   def screen_x
  476.     case self.index  
  477.     when 0
  478.       return 500
  479.     when 1
  480.       return 430
  481.     when 2
  482.       return 580
  483.     when 3
  484.       return 390
  485.     when 4
  486.       return 460
  487.     else
  488.       return 640
  489.     end
  490.   end
  491.   #----
  492.   #--------------------------------------------------------------------------
  493.   # ● 取得战斗画面的 Y 坐标
  494.   #--------------------------------------------------------------------------
  495.   def screen_y
  496.     # 返回计算后的队伍 Y 坐标的排列顺序
  497.     case self.index  
  498.     when 0
  499.       return 310
  500.     when 1
  501.       return 295
  502.     when 2
  503.       return 325
  504.     when 3
  505.       return 340
  506.     when 4
  507.       return 360
  508.     else
  509.       return 1000
  510.     end
  511.   end
  512.   #--------------------------------------------------------------------------
  513.   # ● 取得战斗画面的 Z 坐标
  514.   #--------------------------------------------------------------------------
  515.   def screen_z
  516.     # 返回计算后的队伍 Z 坐标的排列顺序
  517.     if self.index != nil
  518.       return 4 - self.index
  519.     else
  520.       return 0
  521.     end
  522.   end
  523. end
  524. class Scene_Battle
  525.  
  526.  
  527.  
  528. #--------------------------------------------------------------------------
  529.   # ● 取得战斗画面的 X 坐标
  530.   #--------------------------------------------------------------------------
  531.   def screen_x
  532.     # 返回计算后的队伍 X 坐标的排列顺序
  533.     if self.index != nil
  534.       #......................................................................
  535.       return self.index * 90 + 500
  536.       #......................................................................
  537.     else
  538.       return 0
  539.     end
  540.   end
  541.   #--------------------------------------------------------------------------
  542.   # ● 取得战斗画面的 Y 坐标
  543.   #--------------------------------------------------------------------------
  544.   def screen_y
  545.     #........................................................................
  546.     return 464 - self.index * 110
  547.     #........................................................................
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # ● 取得战斗画面的 Z 坐标
  551.   #--------------------------------------------------------------------------
  552.   def screen_z
  553.     # 返回计算后的队伍 Z 坐标的排列顺序
  554.     if self.index != nil
  555.       return 4 - self.index
  556.     else
  557.       return 0
  558.     end
  559.   end
  560. end
  561.  
  562. class Scene_Battle
  563.   #..........................................................................
  564.   #--------------------------------------------------------------------------
  565.   # ● 返回phase
  566.   #--------------------------------------------------------------------------
  567.   def phase
  568.     return @phase
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● 返回phase4_step
  572.   #--------------------------------------------------------------------------
  573.   def phase4_step
  574.     return @phase4_step
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ● 返回phase4_step
  578.   #--------------------------------------------------------------------------
  579.   def actor_command_active?
  580.     return @actor_command_window.active
  581.   end
  582.   #..........................................................................
  583. end
  584. class Game_Battler
  585.   #..........................................................................
  586.   #--------------------------------------------------------------------------
  587.   # ● 获取循环的动画 ID
  588.   #--------------------------------------------------------------------------  
  589.   def show_damage(value)
  590.     @show_damage_value = value
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ● 获取循环的动画 ID
  594.   #--------------------------------------------------------------------------
  595.   def show_damage_value
  596.     return @show_damage_value
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # ● 获取循环的动画 ID
  600.   #--------------------------------------------------------------------------
  601.   def battler_ani
  602.     return @battler_ani
  603.   end
  604.   #--------------------------------------------------------------------------
  605.   # ● 获取循环的动画 ID
  606.   #--------------------------------------------------------------------------
  607.   def setup_battler_ani(battler_ani, once = 0)
  608.     @battler_ani = battler_ani
  609.     @once = once
  610.   end
  611.   #--------------------------------------------------------------------------
  612.   # ● 获取循环的动画 ID
  613.   #--------------------------------------------------------------------------
  614.   def setup_battler_hurt_ani(hurt)
  615.     @hurt = hurt
  616.   end  
  617.   #--------------------------------------------------------------------------
  618.   # ● 获取循环的动画 ID
  619.   #--------------------------------------------------------------------------
  620.   def setup_battler_dead_ani(over)
  621.     @over = over
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # ● 获取循环的动画 ID
  625.   #--------------------------------------------------------------------------
  626.   def battler_dead_ani
  627.     return @over
  628.   end
  629.   #--------------------------------------------------------------------------
  630.   # ● 获取循环的动画 ID
  631.   #--------------------------------------------------------------------------
  632.   def battler_ani_once
  633.     return @once
  634.   end
  635.   #--------------------------------------------------------------------------
  636.   # ● 获取循环的动画 ID
  637.   #--------------------------------------------------------------------------
  638.   def battler_hurt_ani
  639.     return @hurt
  640.   end
  641.   #########################
  642.   #..........................................................................
  643. end
  644. class Sprite_Battler < RPG::Sprite
  645.   #..........................................................................
  646.   #--------------------------------------------------------------------------
  647.   # ● 胜利图
  648.   #--------------------------------------------------------------------------
  649.   def win
  650.     if @battler_name != nil and not @battler.hidden and not @battler.dead?
  651.       @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  652.     end
  653.   end
  654.   #..........................................................................
  655.   #--------------------------------------------------------------------------
  656.   # ● 释放
  657.   #--------------------------------------------------------------------------
  658.   def dispose
  659.     if self.bitmap != nil
  660.       self.bitmap.dispose
  661.     end
  662.     super
  663.   end
  664.   #--------------------------------------------------------------------------
  665.   # ● 刷新画面
  666.   #--------------------------------------------------------------------------
  667.   def update
  668.     super
  669.     # 战斗者为 nil 的情况下
  670.     if @battler == nil
  671.       self.bitmap = nil
  672.       loop_animation(nil)
  673.        loop_animation1(nil)
  674.       return
  675.     end
  676.     # 文件名和色相与当前情况有差异的情况下
  677.     if @battler.battler_name != @battler_name or
  678.        @battler.battler_hue != @battler_hue
  679.       @battler_hue = @battler.battler_hue
  680.       # 获取、设置位图
  681.       @battler_name = @battler.battler_name
  682.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  683.       #.......................................................................
  684.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  685.       #.......................................................................
  686.       @width = bitmap.width
  687.       @height = bitmap.height
  688.       self.ox = @width / 2
  689.       self.oy = @height
  690.       # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  691.       if @battler.is_a?(Game_Enemy)
  692.         if @battler.dead? or @battler.hidden
  693.           self.opacity = 0
  694.         end
  695.       end
  696.     end
  697.     # 动画 ID 与当前的情况有差异的情况下
  698.     #.........................................................................
  699.     if @battler.battler_ani != @battler_ani
  700.       @battler_ani = @battler.battler_ani
  701.       loop_animation($data_animations[@battler_ani.to_i])
  702.  
  703.  
  704.  
  705.      end
  706.  
  707.     #.........................................................................
  708.     # 应该被显示的角色的情况下
  709.     if @battler.is_a?(Game_Actor) and @battler_visible
  710.       # 不是主状态的时候稍稍降低点透明度
  711.       if $game_temp.battle_main_phase
  712.         self.opacity += 3 if self.opacity < 255
  713.       else
  714.         self.opacity -= 3 if self.opacity > 207
  715.       end
  716.     end
  717.     # 明灭
  718.     if @battler.blink
  719.       blink_on
  720.     else
  721.       blink_off
  722.     end
  723.     # 不可见的情况下
  724.     unless @battler_visible
  725.       # 出现 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  726.       if not @battler.hidden and not @battler.dead? and
  727.          (@battler.damage == nil or @battler.damage_pop)
  728.         if @battler.is_a?(Game_Enemy)
  729.           appear
  730.         else
  731.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  732.         end
  733.         @battler_visible = true
  734.       end
  735.     end
  736.     # 可见的情况下
  737.     if @battler_visible
  738.       # 逃跑
  739.       if @battler.hidden
  740.         $game_system.se_play($data_system.escape_se)
  741.         escape
  742.         @battler_visible = false
  743.       end
  744.       # 白色闪烁
  745.       if @battler.white_flash
  746.         whiten
  747.         @battler.white_flash = false
  748.       end
  749.       # 动画
  750.       if @battler.animation_id != 0
  751.         animation = $data_animations[@battler.animation_id]
  752.         animation(animation, @battler.animation_hit)
  753.         @battler.animation_id = 0
  754.       end
  755.       # 伤害
  756.       if @battler.damage_pop
  757.         damage(@battler.damage, @battler.critical)
  758.         @battler.damage = nil
  759.         @battler.critical = false
  760.         @battler.damage_pop = false
  761.       end
  762.       # korapusu
  763.       if @battler.damage == nil and @battler.dead?
  764.         #....................................................................
  765.         if @battler.is_a?(Game_Enemy)
  766.           $game_system.se_play($data_system.enemy_collapse_se)
  767.           #collapse
  768.         else
  769.           $game_system.se_play($data_system.actor_collapse_se)
  770.         end
  771.         #....................................................................
  772.         @battler_visible = false
  773.       end
  774.     end
  775.     # 设置活动块的坐标
  776.     self.x = @battler.screen_x
  777.     self.y = @battler.screen_y
  778.     self.z = @battler.screen_z
  779.   end
  780. end
  781. module RPG
  782.   class Sprite < ::Sprite
  783.     def damage(value, critical)
  784.       dispose_damage
  785.       if value.is_a?(Numeric)
  786.         damage_string = value.abs.to_s
  787.       else
  788.         damage_string = value.to_s
  789.       end
  790.       bitmap = Bitmap.new(160, 48)
  791.       bitmap.font.name = "Arial Black"
  792.       bitmap.font.size = 32
  793.       bitmap.font.color.set(0, 0, 0)
  794.       bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  795.       bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  796.       bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  797.       bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  798.       if value.is_a?(Numeric) and value < 0
  799.         bitmap.font.color.set(176, 255, 144)
  800.       else
  801.         bitmap.font.color.set(255, 255, 255)
  802.       end
  803.       bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  804.       if critical
  805.         bitmap.font.size = 20
  806.         bitmap.font.color.set(0, 0, 0)
  807.         bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
  808.         bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
  809.         bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
  810.         bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
  811.         bitmap.font.color.set(255, 255, 255)
  812.         bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
  813.       end
  814.       @_damage_sprite = ::Sprite.new(self.viewport)
  815.       @_damage_sprite.bitmap = bitmap
  816.       @_damage_sprite.ox = 80
  817.       @_damage_sprite.oy = 20
  818.       @_damage_sprite.x = self.x
  819.       @_damage_sprite.x -= self.bitmap.width/2 if @battler.is_a?(Game_Actor)
  820.       @_damage_sprite.y = self.y - self.oy / 2
  821.       @_damage_sprite.z = 3000
  822.       @_damage_duration = 40
  823.     end
  824.   end
  825. end
  826. ###########################################################
  827. ##############################################################
  828. #在此处更改伤害显示图
  829. #################################################################
  830. module RPG
  831. #--------------------------------------------------------------------------
  832. # ● 常量设定
  833. #--------------------------------------------------------------------------
  834. # 是否显示总伤害
  835. SHOW_TOTAL_DAMAGE = true
  836. # 角色受攻击时是否跳一下
  837. BATTLER_JUMP = false
  838. # 伤害美化字符串文件夹名(放在Pictures文件夹中的子文件夹)
  839. STRING_DOCUMENTS = "String/"
  840. # 是否使用伤害美化效果
  841. USE_DAMAGE =true
  842. # 连续伤害的动画ID
  843. SLIP_DAMAGE_ANIMATION_ID = 236
  844.  
  845. class Sprite < ::Sprite
  846.    #==========================================
  847.    # 修改说明:
  848.    # @flash_shake用来制作挨打时候跳跃
  849.    # @_damage    用来记录每次打击之后弹出数字
  850.    # @_total_damage 记录总伤害
  851.    # @_total_damage_duration 总伤害持续帧
  852.    #==========================================
  853.    #alias 66RPG_rainbow_initialize : initialize
  854.    def initialize(viewport = nil)
  855.      #66RPG_rainbow_initialize(viewport)
  856.      super(viewport)
  857.      @_whiten_duration = 0
  858.      @_appear_duration = 0
  859.      @_escape_duration = 0
  860.      @_collapse_duration = 0
  861.      @_damage_duration = 0
  862.      @_animation_duration = 0
  863.      @_blink = false
  864.      # 挨打时候跳跃
  865.      @flash_shake = 0
  866.      # 伤害记录数组
  867.      @_damage = []
  868.      # 总伤害数字
  869.      @_total_damage = 0
  870.      # 总伤害持续帧
  871.      @_total_damage_duration = 0
  872.      #.........................................................................
  873.      #记录已经发生的伤害的变量
  874.      @p_dam=0
  875.      @hits=0
  876.      ############ #小改动
  877.      #记录前一次攻击次数
  878.      @temp_hits=0
  879.      #判断是否为最后一次攻击
  880.      @last_hits=0
  881.      ############
  882.      #.........................................................................
  883.    end
  884.    #--------------------------------------------------------------------------
  885.    #美化的伤害处理
  886.    #--------------------------------------------------------------------------
  887.     def damage(value, critical)
  888.  
  889. if USE_DAMAGE == true then
  890.  
  891.       # 释放伤害,效果是伤害数字快速消失,觉得不如不消失好看......
  892.       #dispose_damage
  893.       #清除hit数
  894.       dispose_hit
  895.       # 如果伤害值是数值
  896.       if value.is_a?(Numeric)
  897.         # 绝对值转为字符串
  898.         damage_string = value.abs.to_s
  899.       else
  900.         # 转为字符串
  901.         damage_string = value.to_s
  902.       end
  903.       # 初始化位图
  904.       bitmap = Bitmap.new(162, 64)
  905.       bitmap.font.name = ["华文行楷","黑体", "宋体"]
  906.       bitmap.font.size = 32
  907.       # 伤害值是数值的情况下
  908.       if value.is_a?(Numeric)
  909.         # 分割伤害值字符串
  910.         damage_array = damage_string.scan(/./)
  911.         damage_x = 81 - damage_string.size * 9
  912.         # 伤害值为负的情况下
  913.         if value < 0
  914.           # 调用回复数字表
  915.           rect_y = 32
  916.         else
  917.           # 调用伤害数字表
  918.           rect_y = 0
  919.         end
  920.         # 循环伤害值字符串
  921.         for char in damage_array
  922.           number = char.to_i
  923.           # 显示伤害数字
  924.           bitmap.blt(damage_x, 32, RPG::Cache.picture(STRING_DOCUMENTS + "Damage"),#"Damagenew"),
  925.           Rect.new(number * 18, rect_y, 18, 32))
  926.           # 后移一位
  927.           damage_x += 18
  928.         end
  929.       # 伤害值不是数值的情况
  930.       else
  931.         # 如果伤害值不是 Miss
  932.         unless value == "Miss"
  933.           # 系统默认描画字符串
  934.           bitmap.font.color.set(0, 0, 0)
  935.           bitmap.draw_text(-1, 27, 162, 36, damage_string, 1)
  936.           bitmap.draw_text(+1, 27, 162, 36, damage_string, 1)
  937.           bitmap.draw_text(-1, 29, 162, 36, damage_string, 1)
  938.           bitmap.draw_text(+1, 29, 162, 36, damage_string, 1)
  939.           bitmap.font.color.set(255, 255, 255)
  940.           bitmap.draw_text(0, 28, 162, 36, damage_string, 1)
  941.         # Miss 的情况下
  942.         else
  943.           # 显示未击中图画
  944.           bitmap.blt(36, 28, RPG::Cache.picture(STRING_DOCUMENTS + "Damage"), Rect.new(90, 64, 90, 32))
  945.         end
  946.       end
  947.       # 会心一击标志打开的情况
  948.       if critical
  949.         #会心一击伤害效果
  950. ###########################################################
  951.         $game_screen.start_flash(Color.new(255,255,255,255),5)
  952. ###########################################################
  953.         # 显示会心一击图画
  954.         bitmap.blt(36, 0, RPG::Cache.picture(STRING_DOCUMENTS + "Damage"), Rect.new(0, 64, 90, 32))
  955.       end
  956.  
  957. else
  958.  
  959.      #.........................................................................
  960.      #清除hit数
  961.      dispose_hit
  962.      #.........................................................................
  963.      if value.is_a?(Numeric)
  964.        damage_string = value.abs.to_s
  965.      else
  966.        damage_string = value.to_s
  967.      end
  968.      bitmap = Bitmap.new(160, 48)
  969.      bitmap.font.name = "Arial Black"
  970.      bitmap.font.size = 32
  971.      bitmap.font.color.set(0, 0, 0)
  972.      bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  973.      bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  974.      bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  975.      bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  976.      #=======================================
  977.      # 修改:颜色
  978.      #=======================================
  979.      if value.is_a?(Numeric) and value < 0
  980.        bitmap.font.color.set(176, 255, 144)
  981.      else
  982.        bitmap.font.color.set(255, 55, 55)
  983.      end
  984.      bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  985.      if critical
  986.        #会心一击伤害效果
  987. ###########################################################
  988.        $game_screen.start_flash(Color.new(255,255,255,255),5)
  989. ###########################################################
  990.        bitmap.font.size = 20
  991.        bitmap.font.color.set(0, 0, 0)
  992.        bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
  993.        bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
  994.        bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
  995.        bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
  996.        bitmap.font.color.set(255, 255, 255)
  997.        bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
  998.      end
  999.  
  1000. end
  1001.  
  1002.      # 伤害值定位     
  1003.      @_damage_sprite = ::Sprite.new#(self.viewport)
  1004.      @_damage_sprite.bitmap = bitmap
  1005.      @_damage_sprite.ox = 80
  1006.      @_damage_sprite.oy = 20
  1007.      @_damage_sprite.x = self.x
  1008.      @_damage_sprite.y = self.y - self.oy / 2
  1009.      @_damage_sprite.z = 3000
  1010.      @_damage_duration = 40
  1011.      #=======================================
  1012.      # 修改:推入新的伤害
  1013.      #=======================================
  1014.      @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  1015.      # 总伤害处理
  1016.      make_total_damage(value)
  1017.  
  1018.  
  1019.  
  1020.     end
  1021.    #--------------------------------------------------------------------------
  1022.    # ● 返回 @hits
  1023.    #--------------------------------------------------------------------------
  1024.    def get_hit
  1025.      return @hits
  1026.    end
  1027.    #--------------------------------------------------------------------------
  1028.    # ● hit数的美化描绘
  1029.    #--------------------------------------------------------------------------
  1030.    #..........................................................................
  1031.    def hit
  1032.      # 如果伤害值是数值
  1033.      # 转为字符串
  1034.      value=@hits
  1035.      hits_string = value.to_s
  1036.      # 初始化位图
  1037.      bitmap = Bitmap.new(320, 64)
  1038.      bitmap.font.name = "Arial Black"
  1039.      bitmap.font.size = 32
  1040.      # 分割伤害值字符串
  1041.      hits_array = hits_string.scan(/./)
  1042.      hits_x = - 36.2#hits_string.size * 18.1 # 81 - hits_string.size * 18.1
  1043.      rect_y = 0
  1044.      # 循环伤害值字符串
  1045.      for char in hits_array
  1046.        # 后移一位
  1047.        hits_x += 36.2
  1048.        number = char.to_i
  1049.        # 显示伤害数字
  1050.        bitmap.blt(hits_x, 0, RPG::Cache.picture(STRING_DOCUMENTS + "Number"),
  1051.        Rect.new(number * 36.2, rect_y, 36.2, 50))
  1052.      end
  1053.      hits_x += 18.1
  1054.      bitmap.blt(hits_x, 0, RPG::Cache.picture(STRING_DOCUMENTS + "HITS"),
  1055.                 Rect.new(0, -21, 90, 50))
  1056.      # 伤害值定位
  1057.      @_hits_sprite = ::Sprite.new(self.viewport)
  1058.      @_hits_sprite.bitmap = bitmap
  1059.      @_hits_sprite.x = 560 - hits_string.size * 36.2
  1060.      @_hits_sprite.y = 70
  1061.      @_hits_sprite.z = 3000
  1062.      @_hits_duration = 40
  1063.    end
  1064.    #..........................................................................
  1065.    #--------------------------------------------------------------------------
  1066.    # ● 美化的总伤害处理
  1067.    #--------------------------------------------------------------------------
  1068.    def make_total_damage(value)
  1069.  
  1070. if USE_DAMAGE == true then     
  1071.  
  1072.      if value.is_a?(Numeric)# and SHOW_TOTAL_DAMAGE
  1073.        @_total_damage += value
  1074.         # 绝对值转为字符串
  1075.         damage_string = @_total_damage.abs.to_s
  1076.       else
  1077.         return
  1078.       end
  1079. #####################################################小改动
  1080.      if SHOW_TOTAL_DAMAGE
  1081. #####################################################
  1082.       # 初始化位图
  1083.       bitmap = Bitmap.new(300, 150)
  1084.       bitmap.font.name = "Arial Black"
  1085.       bitmap.font.size = 32
  1086.       # 伤害值是数值的情况下
  1087.       if value.is_a?(Numeric)
  1088.         # 分割伤害值字符串
  1089.         damage_array = damage_string.scan(/./)
  1090.         damage_x = 40 - damage_string.size * 9
  1091.         # 伤害值为负的情况下
  1092.         if value < 0
  1093.           # 调用回复数字表
  1094.           name= STRING_DOCUMENTS + "Number3"
  1095.         else
  1096.           # 调用伤害数字表
  1097.           name= STRING_DOCUMENTS + "Number2"
  1098.         end
  1099.         # 循环伤害值字符串
  1100.         for char in damage_array
  1101.           number = char.to_i
  1102.           # 显示伤害数字
  1103.           bitmap.blt(damage_x, 0, RPG::Cache.picture(name),
  1104.           Rect.new(number * 36.2, 0, 36.2, 50))
  1105.           # 后移一位
  1106.           damage_x += 36.2
  1107.         end
  1108. #####################################################小改动
  1109.      end
  1110. #####################################################
  1111.       end
  1112.  
  1113. else
  1114.    #--------------------------------------------------------------------------
  1115.    # ● 总伤害处理
  1116.    #--------------------------------------------------------------------------
  1117.      if value.is_a?(Numeric)# and SHOW_TOTAL_DAMAGE
  1118.        @_total_damage += value
  1119.      else
  1120.        return
  1121.      end
  1122. #####################################################小改动
  1123.      if SHOW_TOTAL_DAMAGE
  1124. #####################################################
  1125.      bitmap = Bitmap.new(300, 150)
  1126.      bitmap.font.name = "Arial Black"
  1127.      bitmap.font.size = 48
  1128.      bitmap.font.color.set(0, 0, 0)
  1129.      bitmap.draw_text(+2, 12+2, 160, 36, @_total_damage.abs.to_s, 1)
  1130.      if @_total_damage < 0
  1131.        bitmap.font.color.set(80, 255, 00)
  1132.      else
  1133.        bitmap.font.color.set(255, 140, 0)
  1134.      end
  1135.      bitmap.draw_text(0, 12, 160, 36, @_total_damage.abs.to_s, 1)
  1136. #####################################################小改动
  1137.      end
  1138. #####################################################
  1139. end
  1140.  
  1141.      if @_total_damage_sprite.nil?
  1142.        @_total_damage_sprite = ::Sprite.new#(self.viewport)
  1143.        @_total_damage_sprite.ox = 80
  1144.        @_total_damage_sprite.oy = 20
  1145.        @_total_damage_sprite.z = 3000
  1146.      end
  1147.      @_total_damage_sprite.bitmap = bitmap
  1148.      @_total_damage_sprite.zoom_x = 1.5
  1149.      @_total_damage_sprite.zoom_y = 1.5
  1150.      @_total_damage_sprite.x = self.x
  1151.      @_total_damage_sprite.y = self.y  - self.oy / 2 - 64
  1152.      @_total_damage_sprite.z = 3001
  1153.      #.........................................................................
  1154.      @_total_damage_duration = 40
  1155.      #.........................................................................
  1156.      #.........................................................................
  1157.      #hit数描绘
  1158.      @hits+=1
  1159.      hit
  1160.      #.........................................................................
  1161.    end
  1162.    def animation(animation, hit, battler_damage="", battler_critical=false)
  1163.      dispose_animation      
  1164.      #=======================================
  1165.      # 修改:记录伤害和critical
  1166.      #=======================================
  1167.      @battler_damage = battler_damage
  1168.      @battler_critical = battler_critical
  1169.      @_animation = animation
  1170.      return if @_animation == nil
  1171.      @_animation_hit = hit
  1172.      @_animation_duration = @_animation.frame_max
  1173.      animation_name = @_animation.animation_name
  1174.      animation_hue = @_animation.animation_hue
  1175.      bitmap = RPG::Cache.animation(animation_name, animation_hue)
  1176.      #=======================================
  1177.      # 修改:计算总闪光权限值
  1178.      #=======================================
  1179.      for timing in @_animation.timings
  1180.        quanzhong = animation_process_timing(timing, @_animation_hit,true)
  1181.        @all_quanzhong += quanzhong
  1182.        # 记录最后一次闪光
  1183.        @_last_frame = timing.frame if quanzhong != 0
  1184.      end
  1185.      #.........................................................................
  1186.      @last_frame = @_last_frame
  1187.      #.........................................................................
  1188.      if @@_reference_count.include?(bitmap)
  1189.        @@_reference_count[bitmap] += 1
  1190.      else
  1191.        @@_reference_count[bitmap] = 1
  1192.      end
  1193.      #=======================================
  1194.      # 修改:行动方动画不显示伤害
  1195.      #=======================================
  1196.      if $scene.is_a?(Scene_Battle)
  1197.        if $scene.animation1_id == @battler.animation_id
  1198.          @battler_damage = ""
  1199.        end
  1200.      end
  1201.      @_animation_sprites = []
  1202.      if @_animation.position != 3 or not @@_animations.include?(animation)
  1203.        for i in 0..15
  1204.          sprite = ::Sprite.new(self.viewport)
  1205.          sprite.bitmap = bitmap
  1206.          sprite.visible = false
  1207.          @_animation_sprites.push(sprite)
  1208.        end
  1209.        unless @@_animations.include?(animation)
  1210.          @@_animations.push(animation)
  1211.        end
  1212.      end
  1213.      update_animation
  1214.    end
  1215.    #=======================================
  1216.    # 修改:更换清除伤害的算法,以防万一
  1217.    #       本内容在脚本中没有使用过
  1218.    #=======================================
  1219.    def dispose_damage
  1220.      for damage in @_damage.reverse
  1221.        damage[0].bitmap.dispose
  1222.        damage[0].dispose
  1223.        @_damage.delete(damage)
  1224.      end
  1225.      @_total_damage = 0
  1226.      @_last_frame = -1
  1227.      if @_total_damage_sprite != nil
  1228.        @_total_damage_duration = 0
  1229.        @_total_damage_sprite.bitmap.dispose
  1230.        @_total_damage_sprite.dispose
  1231.        @_total_damage_sprite = nil
  1232.      end
  1233.    end
  1234.    #=======================================
  1235.    # 清除hit数
  1236.    #=======================================
  1237.    #...........................................................................
  1238.    def dispose_hit
  1239.      if @_hits_sprite != nil
  1240.        @_hits_sprite.bitmap.dispose
  1241.        @_hits_sprite.dispose
  1242.        @_hits_sprite = nil
  1243.      end
  1244.    end
  1245.    #...........................................................................
  1246.    def dispose_animation
  1247.      #=======================================
  1248.      # 修改:清除记录的伤害,清除权重记录
  1249.      #=======================================
  1250.      @battler_damage = nil
  1251.      @battler_critical = nil
  1252.      @all_quanzhong = 1
  1253.      @_total_damage = 0
  1254.      @_last_frame = -1
  1255.      #.........................................................................
  1256.      @hits = 0
  1257.      #.........................................................................
  1258.      if @_animation_sprites != nil
  1259.        sprite = @_animation_sprites[0]
  1260.        if sprite != nil
  1261.          @@_reference_count[sprite.bitmap] -= 1
  1262.          if @@_reference_count[sprite.bitmap] == 0
  1263.            sprite.bitmap.dispose
  1264.          end
  1265.        end
  1266.        for sprite in @_animation_sprites
  1267.          sprite.dispose
  1268.        end
  1269.        @_animation_sprites = nil
  1270.        @_animation = nil
  1271.      end
  1272.    end
  1273.    def update
  1274.      super
  1275.      if @_whiten_duration > 0
  1276.        @_whiten_duration -= 1
  1277.        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  1278.      end
  1279.      if @_appear_duration > 0
  1280.        @_appear_duration -= 1
  1281.        self.opacity = (16 - @_appear_duration) * 16
  1282.      end
  1283.      if @_escape_duration > 0
  1284.        @_escape_duration -= 1
  1285.        self.opacity = 256 - (32 - @_escape_duration) * 10
  1286.      end
  1287.      if @_collapse_duration > 0
  1288.        @_collapse_duration -= 1
  1289.        self.opacity = 256 - (48 - @_collapse_duration) * 6
  1290.      end
  1291.      #=======================================
  1292.      # 修改:更新算法,更新弹出
  1293.      #=======================================
  1294.      if @_damage_duration > 0
  1295.        @_damage_duration -= 1
  1296.        for damage in @_damage
  1297.          damage[0].x = self.x + self.viewport.rect.x -
  1298.                        self.ox + self.src_rect.width / 2 +
  1299.                        (40 - damage[1]) * damage[3] / 10
  1300.          damage[0].y -= damage[4]+damage[1]/10
  1301.          damage[0].opacity = damage[1]*20
  1302.          damage[1] -= 1
  1303.          if damage[1]==0
  1304.            damage[0].bitmap.dispose
  1305.            damage[0].dispose
  1306.            @_damage.delete(damage)
  1307.            next
  1308.          end
  1309.        end
  1310.      end
  1311.      #=======================================
  1312.      # 添加:弹出总伤害
  1313.      #=======================================
  1314.      if @_total_damage_duration > 0
  1315.        @_total_damage_duration -= 1
  1316.        @_total_damage_sprite.y -= 1 if @_total_damage_duration % 2 == 0
  1317.        if @_total_damage_sprite.zoom_x > 1.0
  1318.          @_total_damage_sprite.zoom_x -= 0.05
  1319.        end
  1320.        if @_total_damage_sprite.zoom_y > 1.0
  1321.          @_total_damage_sprite.zoom_y -= 0.05
  1322.        end
  1323.        @_total_damage_sprite.opacity = 256 - (24 - @_total_damage_duration) * 16
  1324.        #......................................................................
  1325.        if @_total_damage_duration <= 7 and @_total_damage_duration > 0
  1326.          @_hits_sprite.opacity -= 32
  1327.          @_hits_sprite.x += 1
  1328.        end
  1329.        #......................................................................
  1330.        if @_total_damage_duration <= 0
  1331.          #.....................................................................
  1332.          dispose_hit
  1333. ##########################
  1334.          @_total_damage = 0
  1335. ##########################
  1336.          #.....................................................................
  1337.          @_total_damage = 0
  1338.          @_total_damage_duration = 0
  1339. #####################################################小改动
  1340.          if SHOW_TOTAL_DAMAGE
  1341.          @_total_damage_sprite.bitmap.dispose
  1342.          end
  1343. #####################################################
  1344.          @_total_damage_sprite.dispose
  1345.          @_total_damage_sprite = nil
  1346.        end
  1347.      end
  1348.      #=======================================
  1349.      if @_animation != nil and (Graphics.frame_count % 2 == 0)
  1350.        @_animation_duration -= 1
  1351.        update_animation
  1352.      end
  1353.      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  1354.        update_loop_animation
  1355.        @_loop_animation_index += 1
  1356.        #......................................................................
  1357.        @loop_animation_once = 0
  1358.        @loop_animation_once = 1 if @once == 1 and @_loop_animation_index == @_loop_animation.frame_max
  1359.        #......................................................................
  1360.        @_loop_animation_index %= @_loop_animation.frame_max
  1361.      end
  1362.  
  1363.      if @_loop_animation1 != nil and (Graphics.frame_count % 2 == 0)
  1364.         update_loop_animation1
  1365.         @_loop_animation1_index += 1
  1366.         @_loop_animation1_index %= @_loop_animation1.frame_max
  1367.       end
  1368.  
  1369.      if @_blink
  1370.        @_blink_count = (@_blink_count + 1) % 32
  1371.        if @_blink_count < 16
  1372.          alpha = (16 - @_blink_count) * 6
  1373.        else
  1374.          alpha = (@_blink_count - 16) * 6
  1375.        end
  1376.        self.color.set(255, 255, 255, alpha)
  1377.      end
  1378.      @@_animations.clear
  1379.    end
  1380.    #..........................................................................
  1381.    def loop_animation_once
  1382.      return @_loop_animation_once
  1383.    end
  1384.    #..........................................................................
  1385.    def update_animation
  1386.      if @_animation_duration > 0
  1387.        frame_index = @_animation.frame_max - @_animation_duration
  1388.        @frame_index = frame_index
  1389.        cell_data = @_animation.frames[frame_index].cell_data
  1390.        position = @_animation.position
  1391.        animation_set_sprites(@_animation_sprites, cell_data, position)
  1392.        #=======================================
  1393.        # 修改:弹出伤害,权重计算
  1394.        #=======================================
  1395.        for timing in @_animation.timings
  1396.          if timing.frame == frame_index
  1397.            t = 1.0 * animation_process_timing(timing, @_animation_hit)            
  1398.            #p t,"当前权重", @all_quanzhong,"总权重"
  1399.            if @battler_damage.is_a?(Numeric) and t != 0
  1400.              t *= @battler_damage
  1401.              t /= @all_quanzhong
  1402.              t = t.to_i
  1403.              #在闪光不是最后一次的情况下,把这次伤害加入到已经发生的伤害中★★★★★★★★★★★★★★★★★★★★★★★★★★
  1404.              if frame_index != @_last_frame
  1405.              @p_dam+= t
  1406.              end
  1407.              #p @p_dam,"已发生伤害",@battler_damage,"总伤害"(调试用)★★★★★★★★★★★★★★★★★★★★★★★★★★
  1408.              #闪光为最后一次的情况下,改变这次伤害的计算方法(总伤害-已经发生伤害)★★★★★★★★★★★★★★★★★★★★★★★★★★
  1409.              if frame_index == @_last_frame
  1410.                t= @battler_damage-@p_dam
  1411.              end
  1412.              #p t,"当前伤害",@battler_damage,"总伤害"
  1413.              # 最后一次闪光的话,伤害修正
  1414.              if frame_index == @_last_frame
  1415.                @_total_damage = @battler_damage - t
  1416.                @p_dam=0      #已经发生的伤害归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1417.             end
  1418.              #p t,@battler_damage,@all_quanzhong
  1419.              damage(t,@battler_critical)
  1420.             #连击次数归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1421.             if frame_index == @_last_frame
  1422.                       ############ #小改动
  1423.                       @last_hits=1
  1424.                       @temp_hits=0
  1425.                       ############
  1426.                       @hits=0
  1427.             end
  1428.            # 防止重复播放miss
  1429.            elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
  1430.              damage(@battler_damage,@battler_critical)
  1431.            end
  1432.          end
  1433.        end
  1434.      else
  1435.        dispose_animation
  1436.      end
  1437.    end
  1438.    #=======================================
  1439.    # 修改:敌人跳跃的功能 + 添加返回数值
  1440.    #=======================================
  1441.    def update_loop_animation
  1442.      frame_index = @_loop_animation_index
  1443.      cell_data = @_loop_animation.frames[frame_index].cell_data
  1444.      position = @_loop_animation.position
  1445.      #•改•
  1446.      if @wait_count.to_i <= 0
  1447.        @wait_count = 0
  1448.        animation_set_sprites(@_loop_animation_sprites, cell_data, position)
  1449.      else
  1450.        @wait_count -= 1
  1451.        for sprite in @_loop_animation_sprites
  1452.          sprite.visible = false
  1453.        end
  1454.      end
  1455.      if @wait_flash.to_i <= 0
  1456.        @wait_flash = 0
  1457.      else
  1458.        @wait_flash -= 1
  1459.        for sprite in @_loop_animation_sprites
  1460.          sprite.blend_type = 1
  1461.        end
  1462.      end
  1463.      #•改•
  1464.      for timing in @_loop_animation.timings
  1465.        if timing.frame == frame_index
  1466.          animation_process_timing(timing, true)
  1467.        end
  1468.      end
  1469.    end
  1470.    #=======================================
  1471.    # 修改:敌人跳跃的功能 + 添加返回数值
  1472.    #=======================================
  1473.    def loop_animation(animation)
  1474.      return if animation == @_loop_animation
  1475.      dispose_loop_animation
  1476.  
  1477.      @_loop_animation = animation
  1478.      return if @_loop_animation == nil
  1479.      @_loop_animation_index = 0
  1480.      animation_name = @_loop_animation.animation_name
  1481.      animation_hue = @_loop_animation.animation_hue
  1482.      bitmap = RPG::Cache.animation(animation_name, animation_hue)
  1483.      if @@_reference_count.include?(bitmap)
  1484.        @@_reference_count[bitmap] += 1
  1485.      else
  1486.        @@_reference_count[bitmap] = 1
  1487.      end
  1488.      @_loop_animation_sprites = []
  1489.      for i in 0..15
  1490.        sprite = ::Sprite.new
  1491.        sprite.bitmap = bitmap
  1492.        sprite.visible = false
  1493.        @_loop_animation_sprites.push(sprite)
  1494.      end
  1495.      update_loop_animation
  1496.    end
  1497.    #=======================================
  1498.    # 修改:敌人跳跃的功能 + 添加返回数值
  1499.    #=======================================
  1500.     def animation_process_timing(timing, hit,dontflash=false)
  1501.       if (timing.condition == 0) or
  1502.          (timing.condition == 1 and hit == true) or
  1503.          (timing.condition == 2 and hit == false)
  1504.         unless dontflash
  1505.           if timing.se.name != ""
  1506.             se = timing.se
  1507.             Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
  1508.           end
  1509.         end
  1510.         case timing.flash_scope
  1511.         when 1
  1512.           unless dontflash
  1513.             self.flash(timing.flash_color, timing.flash_duration * 2)
  1514.             #....................................................................
  1515.             @wait_flash = timing.flash_duration
  1516.             #....................................................................
  1517.             if @_total_damage >0
  1518.               @flash_shake_switch = true
  1519.               @flash_shake = 10
  1520.             end
  1521.           end
  1522.           return timing.flash_color.alpha * timing.flash_duration
  1523.         when 2
  1524.           unless dontflash
  1525.             if self.viewport != nil
  1526.               self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
  1527.               return timing.flash_color.alpha * timing.flash_duration
  1528.             end
  1529.           end
  1530.         when 3
  1531.           unless dontflash
  1532.             self.flash(nil, timing.flash_duration * 2)
  1533.             #@_loop_animation_count = 1
  1534.             #•改•
  1535.             @wait_count = timing.flash_duration
  1536.             #•改•
  1537.           end
  1538.           return timing.flash_color.alpha * timing.flash_duration
  1539.         end
  1540.       end      
  1541.       return 0
  1542.     end   
  1543. end
  1544. end
  1545. #==============================================================================
  1546. # ■ Sprite_Battler
  1547. #==============================================================================
  1548. class Sprite_Battler < RPG::Sprite
  1549. #--------------------------------------------------------------------------
  1550. # ● 初始化对像
  1551. #    添加跳跃记录
  1552. #--------------------------------------------------------------------------
  1553. def initialize(viewport, battler = nil)
  1554.   super(viewport)
  1555.   @battler = battler
  1556.   @battler_visible = false
  1557.   @flash_shake_switch = true
  1558.  
  1559.   #........................................................................
  1560.   @once = 0
  1561.   @frame_index = -1
  1562.   @last_frame = 0
  1563.   #........................................................................
  1564. end
  1565. #--------------------------------------------------------------------------
  1566. # ● 刷新画面
  1567. #    增添跳跃功能
  1568. #--------------------------------------------------------------------------
  1569. def update
  1570.   super
  1571.   # 战斗者为 nil 的情况下
  1572.   if @battler == nil
  1573.     self.bitmap = nil
  1574.     loop_animation(nil)
  1575.    loop_animation1(nil)
  1576.     return
  1577.   end
  1578.   # 文件名和色相与当前情况有差异的情况下
  1579.   if @battler.battler_name != @battler_name or
  1580.      @battler.battler_hue != @battler_hue
  1581.     # 获取、设置位图
  1582.     @battler_name = @battler.battler_name
  1583.     @battler_hue = @battler.battler_hue
  1584.     self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1585.     #.......................................................................
  1586.     if not @battler.hidden and not @battler.dead?
  1587.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1588.     end
  1589.     #.......................................................................
  1590.     @width = bitmap.width
  1591.     @height = bitmap.height
  1592.     self.ox = @width / 2
  1593.     self.oy = @height
  1594.   end
  1595.   #.......................................................................
  1596.   update_actor_animation
  1597.   update_enemy_animation
  1598.   #.......................................................................
  1599.   # 动画 ID 与当前的情况有差异的情况下
  1600.   #.........................................................................
  1601.   if @battler.is_a?(Game_Enemy)
  1602.     if @once == 1 and @loop_animation_once == 1 and
  1603.        @battler.battler_dead_ani == 1
  1604.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1605.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1606.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1607.     end
  1608.   end
  1609.   if @battler.is_a?(Game_Actor)
  1610.     ####################################################################
  1611.     if @once == 1 and @loop_animation_once == 1 and $scene.phase != 5 and
  1612.        @battler.battler_dead_ani == 1 and @battler.dead?
  1613.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1614.     #######################################################################
  1615.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1616.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1617.       #################################################################
  1618.       $fangyu = 0
  1619.       @battler.setup_battler_dead_ani(0)
  1620.       ########################################################
  1621.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase == 5 and
  1622.           not @battler.dead?
  1623.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[7])
  1624.       ######################################################
  1625.       $fangyu = 0
  1626.       @battler.setup_battler_dead_ani(0)
  1627.       ######################################################
  1628.     end
  1629.   end
  1630.  
  1631. if @battler.damage == nil and
  1632.        @battler.state_animation_id != @state_animation_id
  1633.       @state_animation_id = @battler.state_animation_id
  1634.      # loop_animation($data_animations[@state_animation_id])
  1635.        loop_animation1($data_animations[@state_animation_id])
  1636.     end
  1637.  
  1638.  
  1639.   if @battler.battler_ani != @battler_ani
  1640.     @battler_ani = @battler.battler_ani
  1641.     @once = @battler.battler_ani_once
  1642.     loop_animation($data_animations[@battler_ani.to_i])
  1643.     # @battler.state_animation_id != @state_animation_id
  1644.       #@state_animation_id = @battler.state_animation_id
  1645.      # loop_animation($data_animations[@state_animation_id])
  1646.       # loop_animation1($data_animations[@state_animation_id])
  1647.  
  1648.  
  1649.   end
  1650.   #.........................................................................
  1651.   # 明灭
  1652.   if @battler.blink
  1653.     blink_on
  1654.   else
  1655.     blink_off
  1656.   end
  1657.   # 不可见的情况下
  1658.   unless @battler_visible
  1659.     # 出现
  1660.     if not @battler.hidden and not @battler.dead? and
  1661.        (@battler.damage == nil or @battler.damage_pop)
  1662.       #.......................................................................
  1663.       if @battler.is_a?(Game_Enemy)
  1664.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1665.         #appear
  1666.       else
  1667.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1668.       end
  1669.       #.......................................................................
  1670.       @battler_visible = true
  1671.     end
  1672.   end
  1673.   # 可见的情况下
  1674.   if @battler_visible
  1675.     # 逃跑
  1676.     if @battler.hidden
  1677.       $game_system.se_play($data_system.escape_se)
  1678.       escape
  1679.       @battler_visible = false
  1680.     end
  1681.     # 白色闪烁
  1682.     if @battler.white_flash
  1683.       whiten
  1684.       @battler.white_flash = false
  1685.     end
  1686.     # 动画
  1687.     if @battler.animation_id != 0
  1688.       animation = $data_animations[@battler.animation_id]
  1689.       animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  1690.       # animation(animation, @battler.animation_hit)
  1691.       @battler.animation_id = 0
  1692.     end
  1693.     # 伤害
  1694.     if @battler.damage_pop
  1695.       @battler.damage = nil
  1696.       @battler.critical = false
  1697.       @battler.damage_pop = false
  1698.     end
  1699.     # korapusu
  1700.     if @battler.damage == nil and @battler.dead?
  1701.       if @battler.is_a?(Game_Enemy)
  1702.         if @battler.battler_dead_ani != 1
  1703.           #p "Battler Death Error"
  1704.           $game_system.se_play($data_system.enemy_collapse_se)
  1705.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1706.           @battler.setup_battler_dead_ani(1)
  1707.         end
  1708.         #.....................................................................
  1709.         collapse
  1710.         #.....................................................................
  1711.       else
  1712.         #.....................................................................
  1713.         if @battler.battler_dead_ani != 1
  1714.           #p "Battler Death Error"
  1715.           $game_system.se_play($data_system.enemy_collapse_se)
  1716.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1717.           @battler.setup_battler_dead_ani(1)
  1718.         end
  1719.         #.....................................................................
  1720.       end
  1721.       @battler_visible = false
  1722.     end
  1723.   end
  1724.   # 设置活动块的坐标
  1725.   if @flash_shake_switch == true
  1726.     self.x = @battler.screen_x
  1727.     self.y = @battler.screen_y
  1728.     self.z = @battler.screen_z
  1729.     @flash_shake_switch = false
  1730.   end
  1731.   if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
  1732.     if @battler.is_a?(Game_Enemy)
  1733.       case @flash_shake
  1734.       when 9..10
  1735.         self.x -=4
  1736.         self.y -=4
  1737.         self.z = @battler.screen_z
  1738.       when 6..8
  1739.         self.x -=2
  1740.         self.y -=2
  1741.         self.z = @battler.screen_z
  1742.       when 3..5
  1743.         self.x +=2
  1744.         self.y +=2
  1745.         self.z = @battler.screen_z
  1746.       when 1..2
  1747.         self.x +=4
  1748.         self.y +=4
  1749.         self.z = @battler.screen_z
  1750.       end
  1751.     end
  1752.     if @battler.is_a?(Game_Actor)
  1753.       case @flash_shake
  1754.       when 9..10
  1755.         self.x +=4
  1756.         self.y +=4
  1757.         self.z = @battler.screen_z
  1758.       when 6..8
  1759.         self.x +=2
  1760.         self.y +=2
  1761.         self.z = @battler.screen_z
  1762.       when 3..5
  1763.         self.x -=2
  1764.         self.y -=2
  1765.         self.z = @battler.screen_z
  1766.       when 1..2
  1767.         self.x -=4
  1768.         self.y -=4
  1769.         self.z = @battler.screen_z
  1770.       end
  1771.     end
  1772.    @flash_shake -= 1
  1773.   end
  1774. end
  1775. end
  1776.  
  1777. #==============================================================================
  1778. # ■ Scene_Battle
  1779. #------------------------------------------------------------------------------
  1780. #  处理战斗画面的类。
  1781. #==============================================================================
  1782.  
  1783. class Scene_Battle
  1784. #--------------------------------------------------------------------------
  1785. # ● 定义实例变量
  1786. #--------------------------------------------------------------------------
  1787. attr_reader   :animation1_id                    # 行动方动画ID
  1788. end
  1789. class Sprite_Battler < RPG::Sprite
  1790.   #--------------------------------------------------------------------------
  1791.   # ● 处理角色动作
  1792.   #--------------------------------------------------------------------------
  1793.   def update_actor_animation
  1794.     if @battler.is_a?(Game_Actor)
  1795.       if @battler.show_damage_value != nil
  1796.         self.damage(@battler.show_damage_value, false)
  1797.         @battler.show_damage(nil)
  1798.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1799.         @battler.setup_battler_hurt_ani(1)
  1800.       end
  1801.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1 and @battler.show_damage_value != nil
  1802.         # 防御的时候
  1803.         if @hits > @temp_hits and not @battler.dead?
  1804.           ############ #小改动
  1805.           @temp_hits+=1
  1806.           ############
  1807.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1808.           @battler.setup_battler_hurt_ani(1)
  1809.           #################################################################
  1810.         elsif @last_hits == 1 and not @battler.dead?
  1811.           ############ #小改动
  1812.           @last_hits = 0
  1813.           ############
  1814.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1815.           @battler.setup_battler_hurt_ani(1)
  1816.           #################################################################
  1817.         elsif @frame_index != -1 and @frame_index != @last_frame and not @battler.dead? and !@battler.damage.is_a?(Numeric)
  1818.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1819.           @battler.setup_battler_hurt_ani(1)
  1820.           #################################################################
  1821.         elsif @last_hits == 1 and not @battler.dead? and !@battler.damage.is_a?(Numeric)
  1822.           ############ #小改动
  1823.           @last_hits = 0
  1824.           ############
  1825.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1826.           @battler.setup_battler_hurt_ani(1)
  1827.           #################################################################
  1828.         end
  1829.       else
  1830.         # 单回合只有一次攻击
  1831.        if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1
  1832.           ############ #小改动
  1833.           @last_hits = 0
  1834.           ############
  1835.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1836.           @battler.setup_battler_hurt_ani(1)
  1837.           #################################################################
  1838.         # 单回合多次攻击
  1839.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and  
  1840. $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  
  1849. @battler.dead? and @battler.battler_dead_ani != 1
  1850.           ############ #小改动
  1851.           @temp_hits+=1
  1852.           ############
  1853.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1854.           @battler.setup_battler_hurt_ani(1)
  1855.           #################################################################
  1856.         # 闪避的回合
  1857.        elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1858.           @last_hits = 0
  1859.           #################################################################
  1860.         # 无伤害的攻击
  1861.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1862.           @last_hits = 0
  1863.           #################################################################
  1864.         # 死亡判定
  1865.        elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1866.  
  1867.           @last_hits = 0
  1868.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1869.           @battler.setup_battler_dead_ani(1)
  1870.           #################################################################
  1871.         # 胜利判定
  1872.        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
  1873.              @once = 1
  1874.              @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  1875.         end
  1876.       end
  1877.     end
  1878.   end
  1879.   #--------------------------------------------------------------------------
  1880.   # ● 处理敌人动作
  1881.   #--------------------------------------------------------------------------
  1882.   def update_enemy_animation
  1883.     if @battler.is_a?(Game_Enemy)
  1884.       if @battler.show_damage_value != nil
  1885.         self.damage(@battler.show_damage_value, false)
  1886.         @battler.show_damage(nil)
  1887.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1888.         @battler.setup_battler_hurt_ani(1)
  1889.       end
  1890.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
  1891.       else
  1892.         # 单回合只有一次攻击
  1893.         if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1894.           ############ #小改动
  1895.           @last_hits = 0
  1896.           ############
  1897.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1898.           @battler.setup_battler_hurt_ani(1)
  1899.           #################################################################
  1900.         # 单回合多次攻击
  1901.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1902.           ############ #小改动
  1903.           @temp_hits+=1
  1904.           ############
  1905.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1906.           @battler.setup_battler_hurt_ani(1)
  1907.           #################################################################
  1908.         # 死亡之前攻击
  1909.        elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and @battler.dead? and  
  1910. @battler.battler_dead_ani != 1
  1911.           ############ #小改动
  1912.           @temp_hits+=1
  1913.           ############
  1914.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1915.           @battler.setup_battler_hurt_ani(1)
  1916.           #################################################################
  1917.         # 无伤害的攻击
  1918.         elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1919.           @last_hits = 0
  1920.           #################################################################
  1921.         # 闪避的回合
  1922.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1923.           @last_hits = 0
  1924.           #################################################################
  1925.         # 死亡判定
  1926.         elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1927.           @last_hits = 0
  1928.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1929.           @battler.setup_battler_dead_ani(1)
  1930.           collapse
  1931.         end
  1932.       end
  1933.     end
  1934.   end
  1935. end
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-19 19:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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