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

Project1

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

[已经解决] 事件压住表情动画的问题?[采用全动画战斗脚本]

 关闭 [复制链接]

Lv2.观梦者

梦石
0
星屑
344
在线时间
185 小时
注册时间
2007-9-2
帖子
168
跳转到指定楼层
1
发表于 2009-9-3 19:43:04 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 zhli667 于 2009-9-6 11:05 编辑

如图~事件压住表情动画了,应该是在“全动画战斗脚本”中调整。只是不知道该在哪调整?高手帮帮忙吖~~~谢谢了~~


[全动画战斗脚本]
  1. #==============================================================================
  2. # ■ 全动画战斗系统(修改加强再加强版)
  3. #------------------------------------------------------------------------------
  4. #  By whbm
  5. #   应用脚本 彩虹神剑 By 66
  6. #==============================================================================
  7.     $fangyu = 0
  8. #   修改内容:
  9. #   1.修改战斗失败继续后被怪打就出现死亡静态或者不再出现死亡动态的BUG
  10. #   2.改变防御方式,怪打的时候防御动作才显现,打完就恢复
  11. #   3.修正一个角色死亡后,其他角色添加第6号状态的问题,就是那个一个死了,其他的都要被
  12. #     打好几次的BUG.
  13. #   4.修正不显示战斗胜利图的BUG
  14. #                                        by 星云
  15. #   5.在此脚本中增加了施法动画(放在第八个★动画里面)
  16. #   6.修复了伤害数值与动画被敌人挡住的情况
  17. #   7.修复了攻击动画帧数过多的情况下和人物死亡判定情况下的挨打动画(闪烁判定)
  18. #   8.增加了伤害美化效果(可选,素材放在Pictures文件夹的子文件夹Srting中)
  19. #   9.修改了总伤害与分段伤害显示不一致的BUG
  20. #   10.修复了全画面动画向下的错误
  21. #   11.其他问题会继续跟进
  22. #                                        by 果冻叮当猫
  23. #有问题,找蚂蚁 redant修改
  24. #==============================================================================
  25. #简要介绍:
  26. #    本脚本实现了战斗的动态效果,其中包含了待机、攻击、防御、挨打、胜利、死亡。类似于超级横版、超级战斗。但是本系统特色在于所有效果的实现并不是靠庞大的战斗图,而是使用了数据库中的动画。这样不仅突破了不同人不同祯数量的限制,并且方便了单动画单祯的修改。
  27. #使用方法:
  28. #    个人觉得还是比较简单,但是大量的怪物还是会令人头痛。
  29. #    1.数据库的设置
  30. #      敌人必要的动画有待机、挨打、死亡三个必要的动画
  31. #      角色必要的动画有待机、挨打、防御、死亡动态、胜利动态、死亡静态、胜利静态
  32. #
  33. #      死亡静态与胜利静态:动画中只有1祯,为相应动态动画的最后一祯
  34. #      
  35. #      剩下的就是人物攻击的动画,和正常的动画是一样设置
  36. #      如图中的攻击等待动画只是为了在播放攻击动画的同时消除人物本身(素材原因,人物攻击的时候离开了原位,如果是在原位置放魔法是用不上的)
  37. #    2.战斗图的设置
  38. #      战斗图其实只是一个透明的图片,它只是用来描述一个敌人或者角色的大小,并与相应的战斗动画编号相衔接。
  39. #      战斗图的文件名格式如下:
  40. #          名字★待机★防御★挨打★死亡动态★死亡静态★胜利动态★胜利静态★施法动画(本人自己添加的).png
  41. #          (其中“名字”一项与动画无关)
  42. #          例如:
  43. #          紫烟★140★141★148★149★150★144★145★146.png
  44. #      对于敌人无胜利动画或者防御动画,请保持该位置为空,例如:
  45. #          蓝若冰★124★★126★127★128★★★129.png
  46. #    综上,设置就这么完成了。
  47. #注意事项:
  48. #    1.由于系统中待机由动画实现,所以无法使用状态附带动画的功能。
  49. #    2.可以在脚本中使用Ctrl+Shift+F通篇搜索“小改动”,可以修改某些窗口的Z值。
  50. #    3.当您将此系统向您的工程中移植的时候也要注意事项2中的“小改动”。
  51. #    4.系统是从游戏“石焚刃暖”中提取出来的,或许会有疏漏与多余的东西,BUG也是不免的。大家尽管提便是。     
  52. #==============================================================================
  53. module RPG
  54.   class Sprite < ::Sprite
  55.     @@_animations = []
  56.     @@_reference_count = {}
  57.    
  58.     def dispose
  59.       dispose_damage
  60.       dispose_animation
  61.       dispose_loop_animation
  62.        dispose_loop_animation1
  63.       super
  64.     end
  65.    
  66.    
  67.   
  68.    
  69.     def loop_animation1(animation)
  70.       return if animation == @_loop_animation1
  71.       dispose_loop_animation1
  72.       @_loop_animation1 = animation
  73.       return if @_loop_animation1 == nil
  74.       @_loop_animation1_index = 0
  75.       animation_name = @_loop_animation1.animation_name
  76.       animation_hue = @_loop_animation1.animation_hue
  77.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  78.       if @@_reference_count.include?(bitmap)
  79.         @@_reference_count[bitmap] += 1
  80.       else
  81.         @@_reference_count[bitmap] = 1
  82.       end
  83.       @_loop_animation1_sprites = []
  84.       for i in 0..15
  85.         sprite = ::Sprite.new(self.viewport)
  86.         sprite.bitmap = bitmap
  87.         sprite.visible = false
  88.         @_loop_animation1_sprites.push(sprite)
  89.       end
  90.       update_loop_animation1
  91.     end
  92.    
  93.    
  94.    

  95.     def dispose_loop_animation1
  96.       if @_loop_animation1_sprites != nil
  97.         sprite = @_loop_animation1_sprites[0]
  98.         if sprite != nil
  99.           @@_reference_count[sprite.bitmap] -= 1
  100.           if @@_reference_count[sprite.bitmap] == 0
  101.             sprite.bitmap.dispose
  102.           end
  103.         end
  104.         for sprite in @_loop_animation1_sprites
  105.           sprite.dispose
  106.         end
  107.         @_loop_animation1_sprites = nil
  108.         @_loop_animation1 = nil
  109.       end
  110.     end
  111.    
  112.    
  113.    
  114.    
  115.     def update_loop_animation1
  116.       frame_index = @_loop_animation1_index
  117.       cell_data = @_loop_animation1.frames[frame_index].cell_data
  118.       position = @_loop_animation1.position
  119.       animation_set_sprites(@_loop_animation1_sprites, cell_data, position)
  120.       for timing in @_loop_animation1.timings
  121.         if timing.frame == frame_index
  122.           animation_process_timing(timing, true)
  123.         end
  124.       end
  125.     end
  126.    
  127.   end
  128. end


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

  442.       #......................................................................
  443. #     case self.index
  444.   #  when 0
  445.    #   return 400
  446.    # when 1
  447.    #   return 470
  448.    # when 2
  449.    #   return 540
  450.    # when 3
  451.     #  return 610
  452.     #else
  453.     #  return 0
  454.     #end
  455.   #end
  456.   #--------------------------------------------------------------------------
  457.   # ● 取得战斗画面的 Y 坐标
  458.   #--------------------------------------------------------------------------
  459.   def screen_y
  460.     #........................................................................
  461.     case self.index
  462.     when 0
  463.       return 400
  464.     when 1
  465.       return 280
  466.     when 2
  467.       return 290
  468.     when 3
  469.       return 400
  470.     end
  471.    
  472.   end
  473.   #--------------------------------------------------------------------------
  474.   # ● 取得战斗画面的 Z 坐标
  475.   #--------------------------------------------------------------------------
  476.   def screen_z
  477.     # 返回计算后的队伍 Z 坐标的排列顺序
  478.     case self.index
  479.     when 0
  480.       return 4200
  481.     when 1
  482.       return 4100
  483.     when 2
  484.       return 4000
  485.     when 3
  486.       return 3900
  487.     end
  488.     end
  489. end

  490. class Scene_Battle
  491.   #..........................................................................
  492.   #--------------------------------------------------------------------------
  493.   # ● 返回phase
  494.   #--------------------------------------------------------------------------
  495.   def phase
  496.     return @phase
  497.   end
  498.   #--------------------------------------------------------------------------
  499.   # ● 返回phase4_step
  500.   #--------------------------------------------------------------------------
  501.   def phase4_step
  502.     return @phase4_step
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ● 返回phase4_step
  506.   #--------------------------------------------------------------------------
  507.   def actor_command_active?
  508.     return @actor_command_window.active
  509.   end
  510.   #..........................................................................
  511. end
  512. class Game_Battler
  513.   #..........................................................................
  514.   #--------------------------------------------------------------------------
  515.   # ● 获取循环的动画 ID
  516.   #--------------------------------------------------------------------------  
  517.   def show_damage(value)
  518.     @show_damage_value = value
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ● 获取循环的动画 ID
  522.   #--------------------------------------------------------------------------
  523.   def show_damage_value
  524.     return @show_damage_value
  525.   end
  526.   #--------------------------------------------------------------------------
  527.   # ● 获取循环的动画 ID
  528.   #--------------------------------------------------------------------------
  529.   def battler_ani
  530.     return @battler_ani
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # ● 获取循环的动画 ID
  534.   #--------------------------------------------------------------------------
  535.   def setup_battler_ani(battler_ani, once = 0)
  536.     @battler_ani = battler_ani
  537.     @once = once
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ● 获取循环的动画 ID
  541.   #--------------------------------------------------------------------------
  542.   def setup_battler_hurt_ani(hurt)
  543.     @hurt = hurt
  544.   end  
  545.   #--------------------------------------------------------------------------
  546.   # ● 获取循环的动画 ID
  547.   #--------------------------------------------------------------------------
  548.   def setup_battler_dead_ani(over)
  549.     @over = over
  550.   end
  551.   #--------------------------------------------------------------------------
  552.   # ● 获取循环的动画 ID
  553.   #--------------------------------------------------------------------------
  554.   def battler_dead_ani
  555.     return @over
  556.   end
  557.   #--------------------------------------------------------------------------
  558.   # ● 获取循环的动画 ID
  559.   #--------------------------------------------------------------------------
  560.   def battler_ani_once
  561.     return @once
  562.   end
  563.   #--------------------------------------------------------------------------
  564.   # ● 获取循环的动画 ID
  565.   #--------------------------------------------------------------------------
  566.   def battler_hurt_ani
  567.     return @hurt
  568.   end
  569.   #..........................................................................
  570. end
  571. class Sprite_Battler < RPG::Sprite
  572.   #..........................................................................
  573.   #--------------------------------------------------------------------------
  574.   # ● 胜利图
  575.   #--------------------------------------------------------------------------
  576.   def win
  577.     if @battler_name != nil and not @battler.hidden and not @battler.dead?
  578.       @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  579.     end
  580.   end
  581.   #..........................................................................
  582.   #--------------------------------------------------------------------------
  583.   # ● 释放
  584.   #--------------------------------------------------------------------------
  585.   def dispose
  586.     if self.bitmap != nil
  587.       self.bitmap.dispose
  588.     end
  589.     super
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # ● 刷新画面
  593.   #--------------------------------------------------------------------------
  594.   def update
  595.     super
  596.     # 战斗者为 nil 的情况下
  597.     if @battler == nil
  598.       self.bitmap = nil
  599.       loop_animation(nil)
  600.        loop_animation1(nil)
  601.       return
  602.     end
  603.     # 文件名和色相与当前情况有差异的情况下
  604.     if @battler.battler_name != @battler_name or
  605.        @battler.battler_hue != @battler_hue
  606.       @battler_hue = @battler.battler_hue
  607.       # 获取、设置位图
  608.       @battler_name = @battler.battler_name
  609.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  610.       #.......................................................................
  611.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  612.       #.......................................................................
  613.       @width = bitmap.width
  614.       @height = bitmap.height
  615.       self.ox = @width / 2
  616.       self.oy = @height
  617.       # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  618.       if @battler.is_a?(Game_Enemy)
  619.         if @battler.dead? or @battler.hidden
  620.           self.opacity = 0
  621.         end
  622.       end
  623.     end
  624.     # 动画 ID 与当前的情况有差异的情况下
  625.     #.........................................................................
  626.     if @battler.battler_ani != @battler_ani
  627.       @battler_ani = @battler.battler_ani
  628.       loop_animation($data_animations[@battler_ani.to_i])
  629.       

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

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

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

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

  1519.   #........................................................................
  1520.   @once = 0
  1521.   @frame_index = -1
  1522.   @last_frame = 0
  1523.   # HZHJ追加1
  1524.   @state_sprites = []
  1525.   for i in 0..4
  1526.     @state_sprites.push(RPG::Sprite.new(viewport))
  1527.   end
  1528. ####################################################################
  1529. end
  1530. #####################################################################
  1531. # HZHJ追加2
  1532.   alias hzhj_dis dispose
  1533.   def dispose
  1534.     hzhj_dis
  1535.     for hzhj in @state_sprites
  1536.       hzhj.dispose
  1537.     end
  1538.   end
  1539. #--------------------------------------------------------------------------
  1540. # ● 刷新画面
  1541. #    增添跳跃功能
  1542. #--------------------------------------------------------------------------
  1543. def update
  1544.   super
  1545.   # HZHJ追加3
  1546.     for hzhj in @state_sprites
  1547.       hzhj.update
  1548.     end
  1549.   # 战斗者为 nil 的情况下
  1550.   if @battler == nil
  1551.     self.bitmap = nil
  1552.     loop_animation(nil)
  1553.    loop_animation1(nil)
  1554.    #HZHJ追加4
  1555.     for hzhj in @state_sprites
  1556.       hzhj.loop_animation1(nil)
  1557.     end
  1558.     return
  1559.   end
  1560.   # 文件名和色相与当前情况有差异的情况下
  1561.   if @battler.battler_name != @battler_name or
  1562.      @battler.battler_hue != @battler_hue
  1563.     # 获取、设置位图
  1564.     @battler_name = @battler.battler_name
  1565.     @battler_hue = @battler.battler_hue
  1566.     self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1567.     #.......................................................................
  1568.     if not @battler.hidden and not @battler.dead?
  1569.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1570.     end
  1571.     #.......................................................................
  1572.     @width = bitmap.width
  1573.     @height = bitmap.height
  1574.     self.ox = @width / 2
  1575.     self.oy = @height
  1576.   end
  1577.   #.......................................................................
  1578.   update_actor_animation
  1579.   update_enemy_animation
  1580.   #.......................................................................
  1581.   # 动画 ID 与当前的情况有差异的情况下
  1582.   #.........................................................................
  1583.   if @battler.is_a?(Game_Enemy)
  1584.     if @once == 1 and @loop_animation_once == 1 and
  1585.        @battler.battler_dead_ani == 1
  1586.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1587.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1588.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1589.     end
  1590.   end
  1591.   if @battler.is_a?(Game_Actor)
  1592.     ####################################################################
  1593.     if @once == 1 and @loop_animation_once == 1 and $scene.phase != 5 and
  1594.        @battler.battler_dead_ani == 1 and @battler.dead?
  1595.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1596.     #######################################################################
  1597.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1598.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1599.       #################################################################
  1600.       $fangyu = 0
  1601.       @battler.setup_battler_dead_ani(0)
  1602.       ########################################################
  1603.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase == 5 and
  1604.           not @battler.dead?
  1605.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[7])
  1606.       ######################################################
  1607.       $fangyu = 0
  1608.       @battler.setup_battler_dead_ani(0)
  1609.       ######################################################
  1610.     end
  1611.   end
  1612.   
  1613. if @battler.damage == nil and
  1614.        @battler.state_animation_id != @state_animation_id
  1615.       @state_animation_id = @battler.state_animation_id
  1616.      # loop_animation($data_animations[@state_animation_id])
  1617.        loop_animation1($data_animations[@state_animation_id])
  1618.     end
  1619. # HZHJ追加5
  1620.   if @battler.damage == nil and $game_temp.phase4step5
  1621.     for i in 0..4
  1622.       if @battler.states[i+1] != nil
  1623.         @state_sprites[i].loop_animation1($data_animations[$data_states[@battler.states[i+1]].animation_id])
  1624.         @state_sprites[i].x = self.x
  1625.         @state_sprites[i].y = self.y
  1626.         @state_sprites[i].z = self.z
  1627.         @state_sprites[i].ox = self.ox
  1628.         @state_sprites[i].oy = self.oy
  1629.         @state_sprites[i].opacity = self.opacity
  1630.         @state_sprites[i].visible = self.visible
  1631.         @state_sprites[i].src_rect = self.src_rect
  1632.       else
  1633.         @state_sprites[i].loop_animation1($data_animations[0])
  1634.       end
  1635.     end
  1636.   end
  1637.    
  1638.   if @battler.battler_ani != @battler_ani
  1639.     @battler_ani = @battler.battler_ani
  1640.     @once = @battler.battler_ani_once
  1641.     loop_animation($data_animations[@battler_ani.to_i])
  1642.     # @battler.state_animation_id != @state_animation_id
  1643.       #@state_animation_id = @battler.state_animation_id
  1644.      # loop_animation($data_animations[@state_animation_id])
  1645.       # loop_animation1($data_animations[@state_animation_id])
  1646.      
  1647.    
  1648.   end
  1649.   #.........................................................................
  1650.   # 明灭
  1651.   if @battler.blink
  1652.     blink_on
  1653.   else
  1654.     blink_off
  1655.   end
  1656.   # 不可见的情况下
  1657.   unless @battler_visible
  1658.     # 出现
  1659.     if not @battler.hidden and not @battler.dead? and
  1660.        (@battler.damage == nil or @battler.damage_pop)
  1661.       #.......................................................................
  1662.       if @battler.is_a?(Game_Enemy)
  1663.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1664.         #appear
  1665.       else
  1666.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1667.       end
  1668.       #.......................................................................
  1669.       @battler_visible = true
  1670.     end
  1671.   end
  1672.   # 可见的情况下
  1673.   if @battler_visible
  1674.     # 逃跑
  1675.     if @battler.hidden
  1676.       $game_system.se_play($data_system.escape_se)
  1677.       escape
  1678.       @battler_visible = false
  1679.     end
  1680.     # 白色闪烁
  1681.     if @battler.white_flash
  1682.       whiten
  1683.       @battler.white_flash = false
  1684.     end
  1685.     # 动画
  1686.     if @battler.animation_id != 0
  1687.       animation = $data_animations[@battler.animation_id]
  1688.       animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  1689.       # animation(animation, @battler.animation_hit)
  1690.       @battler.animation_id = 0
  1691.     end
  1692.     # 伤害
  1693.     if @battler.damage_pop
  1694.       if $game_temp.battle_solid_damage
  1695.          damage(@battler.damage, @battler.critical)
  1696.          $game_temp.battle_solid_damage = false
  1697.        end

  1698.       
  1699.       @battler.damage = nil
  1700.       @battler.critical = false
  1701.       @battler.damage_pop = false
  1702.     end
  1703.     # korapusu
  1704.     if @battler.damage == nil and @battler.dead?
  1705.       if @battler.is_a?(Game_Enemy)
  1706.         if @battler.battler_dead_ani != 1
  1707.           #p "Battler Death Error"
  1708.           $game_system.se_play($data_system.enemy_collapse_se)
  1709.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1710.           @battler.setup_battler_dead_ani(1)
  1711.         end
  1712.         #.....................................................................
  1713.         collapse
  1714.         #.....................................................................
  1715.       else
  1716.         #.....................................................................
  1717.         if @battler.battler_dead_ani != 1
  1718.           #p "Battler Death Error"
  1719.           $game_system.se_play($data_system.enemy_collapse_se)
  1720.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1721.           @battler.setup_battler_dead_ani(1)
  1722.         end
  1723.         #.....................................................................
  1724.       end
  1725.       @battler_visible = false
  1726.     end
  1727.   end
  1728.   # 设置活动块的坐标
  1729.   if @flash_shake_switch == true
  1730.     self.x = @battler.screen_x
  1731.     self.y = @battler.screen_y
  1732.     self.z = @battler.screen_z
  1733.     @flash_shake_switch = false
  1734.   end
  1735.   if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
  1736.     if @battler.is_a?(Game_Enemy)
  1737.       case @flash_shake
  1738.       when 9..10
  1739.         self.x -=4
  1740.         self.y -=4
  1741.         self.z = @battler.screen_z
  1742.       when 6..8
  1743.         self.x -=2
  1744.         self.y -=2
  1745.         self.z = @battler.screen_z
  1746.       when 3..5
  1747.         self.x +=2
  1748.         self.y +=2
  1749.         self.z = @battler.screen_z
  1750.       when 1..2
  1751.         self.x +=4
  1752.         self.y +=4
  1753.         self.z = @battler.screen_z
  1754.       end
  1755.     end
  1756.     if @battler.is_a?(Game_Actor)
  1757.       case @flash_shake
  1758.       when 9..10
  1759.         self.x +=4
  1760.         self.y +=4
  1761.         self.z = @battler.screen_z
  1762.       when 6..8
  1763.         self.x +=2
  1764.         self.y +=2
  1765.         self.z = @battler.screen_z
  1766.       when 3..5
  1767.         self.x -=2
  1768.         self.y -=2
  1769.         self.z = @battler.screen_z
  1770.       when 1..2
  1771.         self.x -=4
  1772.         self.y -=4
  1773.         self.z = @battler.screen_z
  1774.       end
  1775.     end
  1776.    @flash_shake -= 1
  1777.   end
  1778. end
  1779. end

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

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

Lv1.梦旅人

℃ake

梦石
0
星屑
50
在线时间
8 小时
注册时间
2009-6-6
帖子
787
2
发表于 2009-9-5 11:11:14 | 只看该作者
要么调高动画的Z,要么调低事件的Z。
我爱66RPG,但我讨厌66.
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
344
在线时间
185 小时
注册时间
2007-9-2
帖子
168
3
 楼主| 发表于 2009-9-6 02:03:01 | 只看该作者
怎么调高动画的Z值吖?从哪调整啊~~~
另外调低事件的Z值也行,哪个好调条那个吧~还望高手能说清楚些~~~再次感谢了。。。
新手作品:《幻想》———缓慢制作中———
   
合击技能!哇哈哈~~~                                                                     金山寺求宝~~~
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
344
在线时间
185 小时
注册时间
2007-9-2
帖子
168
4
 楼主| 发表于 2009-9-6 11:06:04 | 只看该作者
自己解决了……
新手作品:《幻想》———缓慢制作中———
   
合击技能!哇哈哈~~~                                                                     金山寺求宝~~~
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-30 22:46

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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