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

Project1

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

[已经过期] 不攻击敌人

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
10 小时
注册时间
2014-8-15
帖子
22
跳转到指定楼层
1
发表于 2014-8-24 16:14:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
安攻击了  1号人物打了 其他3人 没反应直接跳过了 为啥?
请问 是那里出错了

Lv1.梦旅人

梦石
0
星屑
50
在线时间
10 小时
注册时间
2014-8-15
帖子
22
2
 楼主| 发表于 2014-8-24 16:27:54 | 只看该作者
本帖最后由 RyanBern 于 2014-8-24 19:17 编辑

怪物还没名字     角色1安攻击  打怪  角色2 .3 .4 安攻击  角色没反应 不打过 直接跳过了






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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
26 小时
注册时间
2014-8-24
帖子
12
3
发表于 2014-8-24 21:12:22 | 只看该作者
本帖最后由 SinTASO 于 2014-8-24 21:14 编辑

请注意你的语言!我觉得是一堆无意义的乱码。
———————————————————————
你把一号人物的数据复制到二三四号人物上,然后测试。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

4
发表于 2014-8-27 09:33:10 | 只看该作者
你把一号角色复制几个测试也会这样吗?那就是有什么其他的问题吧,比如角色速度低了不执行任何操作什么的设定
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-10-1 06:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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