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

Project1

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

[已经过期] 如何在战斗中描绘所有的伤害?

[复制链接]

Lv1.梦旅人

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

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

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

x
战斗中默认描绘显示的伤害是:角色攻击敌人的伤害、敌人攻击角色的伤害、补血的值。

但是没有定义描绘中毒(即状态中的连续伤害)的伤害、用事件页写出的增减HPSP的伤害。吾辈找了半天脚本没找到在哪定义的=。=
请问应该怎样修改相应脚本可以达到描绘所有的伤害?
希望大家可以支持《吃货计划:绫重奏》https://rpg.blue/forum.php?mod=viewthread&tid=402357&extra=&page=1

Lv5.捕梦者

梦石
0
星屑
31919
在线时间
5080 小时
注册时间
2012-11-19
帖子
4877

开拓者

2
发表于 2013-10-16 21:48:39 | 只看该作者
话说中毒时,有显示伤害的啊!

点评

没有啊,可能是我使用外挂脚本把定义覆盖了吧=。=所以说大大应该在哪里改这些东西啊?  发表于 2013-10-16 22:42
xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
31919
在线时间
5080 小时
注册时间
2012-11-19
帖子
4877

开拓者

3
发表于 2013-10-16 23:00:57 | 只看该作者
找找外挂脚本的战斗场景里有没有下面脚本打 ☆ 号标注的那段
  1. #--------------------------------------------------------------------------
  2.   def update_phase4_step1
  3.     # 隐藏帮助窗口
  4.     @help_window.visible = false
  5.     # 判定胜败
  6.     if judge
  7.       # 胜利或者失败的情况下 : 过程结束
  8.       return
  9.     end
  10.     # 强制行动的战斗者不存在的情况下
  11.     if $game_temp.forcing_battler == nil
  12.       # 设置战斗事件
  13.       setup_battle_event
  14.       # 执行战斗事件中的情况下
  15.       if $game_system.battle_interpreter.running?
  16.         return
  17.       end
  18.     end
  19.     # 强制行动的战斗者存在的情况下
  20.     if $game_temp.forcing_battler != nil
  21.       # 在头部添加后移动
  22.       @action_battlers.delete($game_temp.forcing_battler)
  23.       @action_battlers.unshift($game_temp.forcing_battler)
  24.     end
  25.     # 未行动的战斗者不存在的情况下 (全员已经行动)
  26.     if @action_battlers.size == 0
  27.       # 开始同伴命令回合
  28.       start_phase2
  29.       return
  30.     end
  31.     # 初始化动画 ID 和公共事件 ID
  32.     @animation1_id = 0
  33.     @animation2_id = 0
  34.     @common_event_id = 0
  35.     # 未行动的战斗者移动到序列的头部
  36.     @active_battler = @action_battlers.shift
  37.     # 如果已经在战斗之外的情况下
  38.     if @active_battler.index == nil
  39.       return
  40.     end
  41. # ☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
  42.     # 连续伤害
  43.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  44.       @active_battler.slip_damage_effect  # ☆☆☆ 应用连续伤害
  45.       @active_battler.damage_pop = true   # ☆☆☆ 打开伤害显示开关
  46.     end
  47. # ☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
  48.     # 自然解除状态
  49.     @active_battler.remove_states_auto
  50.     # 刷新状态窗口
  51.     @status_window.refresh
  52.     # 移至步骤 2
  53.     @phase4_step = 2
  54.   end
复制代码

评分

参与人数 1星屑 +60 收起 理由
myownroc + 60 塞糖

查看全部评分

xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
136
在线时间
623 小时
注册时间
2008-11-16
帖子
440
4
 楼主| 发表于 2013-10-17 00:26:11 | 只看该作者
芯☆淡茹水 发表于 2013-10-16 23:00
找找外挂脚本的战斗场景里有没有下面脚本打 ☆ 号标注的那段

我找了,没有找到这一段,这一段还在默认脚本中。我全局搜索了后也没有发现其他脚本有对此重新定义的地方= =
不过我觉得应该是我用的全动画脚本的问题,这个脚本内置了彩虹神剑,它貌似是只描绘动画播放时每次对象闪光时受到的伤害,与默认的伤害描绘完全不同,所以才导致中毒时不描绘吧。请问这个脚本应该改哪里啊?麻烦您了,十分感谢!
下面附上脚本
  1. #==============================================================================
  2. # ■ 全动画战斗系统(修改加强再加强版)
  3. #------------------------------------------------------------------------------
  4. #  By whbm
  5. #   应用脚本 彩虹神剑 By 66
  6. #==============================================================================
  7.     $fangyu = 0
  8. #简要介绍:
  9. #    本脚本实现了战斗的动态效果,其中包含了待机、攻击、防御、挨打、胜利、死亡。类似于超级横版、超级战斗。但是本系统特色在于所有效果的实现并不是靠庞大的战斗图,而是使用了数据库中的动画。这样不仅突破了不同人不同祯数量的限制,并且方便了单动画单祯的修改。
  10. #使用方法:
  11. #    个人觉得还是比较简单,但是大量的怪物还是会令人头痛。
  12. #    1.数据库的设置
  13. #      敌人必要的动画有待机、挨打、死亡三个必要的动画
  14. #      角色必要的动画有待挨打机、、防御、死亡动态、胜利动态、死亡静态、胜利静态
  15. #
  16. #      死亡静态与胜利静态:动画中只有1祯,为相应动态动画的最后一祯
  17. #      
  18. #      剩下的就是人物攻击的动画,和正常的动画是一样设置
  19. #      如图中的攻击等待动画只是为了在播放攻击动画的同时消除人物本身(素材原因,人物攻击的时候离开了原位,如果是在原位置放魔法是用不上的)
  20. #    2.战斗图的设置
  21. #      战斗图其实只是一个透明的图片,它只是用来描述一个敌人或者角色的大小,并与相应的战斗动画编号相衔接。
  22. #      战斗图的文件名格式如下:
  23. #          名字★待机★防御★挨打★死亡动态★死亡静态★胜利动态★胜利静态.png
  24. #          (其中“名字”一项与动画无关)
  25. #          例如:
  26. #          紫烟★140★141★148★149★150★144★145.png
  27. #      对于敌人无胜利动画或者防御动画,请保持该位置为空,例如:
  28. #          蓝若冰★124★★126★127★★★.png
  29. #    综上,设置就这么完成了。     
  30. #==============================================================================
  31. #新加部分 改进基础 叮当猫的全动画脚本
  32. #================
  33. module RPG
  34.   class Sprite < ::Sprite
  35.     @@_animations = []
  36.     @@_reference_count = {}
  37.    
  38.     def dispose
  39.       dispose_damage
  40.       dispose_animation
  41.       dispose_loop_animation
  42.        dispose_loop_animation1
  43.       super
  44.     end
  45.    
  46.    
  47.   
  48.    
  49.     def loop_animation1(animation)
  50.       return if animation == @_loop_animation1
  51.       dispose_loop_animation1
  52.       @_loop_animation1 = animation
  53.       return if @_loop_animation1 == nil
  54.       @_loop_animation1_index = 0
  55.       animation_name = @_loop_animation1.animation_name
  56.       animation_hue = @_loop_animation1.animation_hue
  57.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  58.       if @@_reference_count.include?(bitmap)
  59.         @@_reference_count[bitmap] += 1
  60.       else
  61.         @@_reference_count[bitmap] = 1
  62.       end
  63.       @_loop_animation1_sprites = []
  64.       for i in 0..15
  65.         sprite = ::Sprite.new(self.viewport)
  66.         sprite.bitmap = bitmap
  67.         sprite.visible = false
  68.         @_loop_animation1_sprites.push(sprite)
  69.       end
  70.       update_loop_animation1
  71.     end
  72.    
  73.    
  74.    

  75.     def dispose_loop_animation1
  76.       if @_loop_animation1_sprites != nil
  77.         sprite = @_loop_animation1_sprites[0]
  78.         if sprite != nil
  79.           @@_reference_count[sprite.bitmap] -= 1
  80.           if @@_reference_count[sprite.bitmap] == 0
  81.             sprite.bitmap.dispose
  82.           end
  83.         end
  84.         for sprite in @_loop_animation1_sprites
  85.           sprite.dispose
  86.         end
  87.         @_loop_animation1_sprites = nil
  88.         @_loop_animation1 = nil
  89.       end
  90.     end
  91.    
  92.    
  93.    
  94.    
  95.     def update_loop_animation1
  96.       frame_index = @_loop_animation1_index
  97.       cell_data = @_loop_animation1.frames[frame_index].cell_data
  98.       position = @_loop_animation1.position
  99.       animation_set_sprites(@_loop_animation1_sprites, cell_data, position)
  100.       for timing in @_loop_animation1.timings
  101.         if timing.frame == frame_index
  102.           animation_process_timing(timing, true)
  103.         end
  104.       end
  105.     end
  106.    
  107.   end
  108. end
  109. #===============
  110. #新加部分

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

  364.   def screen_y
  365.     # 返回计算后的队伍 Y 坐标的排列顺序
  366.     case self.index
  367.     when 0
  368.       return 330+60
  369.     when 1
  370.       return 190+60
  371.     when 2
  372.       return 380+30
  373.     end
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 取得战斗画面的 Z 坐标
  377.   #--------------------------------------------------------------------------
  378.   def screen_z
  379.     case self.index
  380.     when 0
  381.       return 0
  382.     when 1
  383.       return 2
  384.     when 2
  385.       return 1
  386.     end
  387.   end
  388. end
  389.   
  390. #############################################################################

  391. class Scene_Battle
  392.   #..........................................................................
  393.   #--------------------------------------------------------------------------
  394.   # ● 返回phase
  395.   #--------------------------------------------------------------------------
  396.   def phase
  397.     return @phase
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ● 返回phase4_step
  401.   #--------------------------------------------------------------------------
  402.   def phase4_step
  403.     return @phase4_step
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● 返回phase4_step
  407.   #--------------------------------------------------------------------------
  408.   def actor_command_active?
  409.     return @actor_command_window.active
  410.   end
  411.   #..........................................................................
  412. end
  413. class Game_Battler
  414.   #..........................................................................
  415.   #--------------------------------------------------------------------------
  416.   # ● 获取循环的动画 ID
  417.   #--------------------------------------------------------------------------  
  418.   def show_damage(value)
  419.     @show_damage_value = value
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # ● 获取循环的动画 ID
  423.   #--------------------------------------------------------------------------
  424.   def show_damage_value
  425.     return @show_damage_value
  426.   end
  427.   #--------------------------------------------------------------------------
  428.   # ● 获取循环的动画 ID
  429.   #--------------------------------------------------------------------------
  430.   def battler_ani
  431.     return @battler_ani
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # ● 获取循环的动画 ID
  435.   #--------------------------------------------------------------------------
  436.   def setup_battler_ani(battler_ani, once = 0)
  437.     @battler_ani = battler_ani
  438.     @once = once
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● 获取循环的动画 ID
  442.   #--------------------------------------------------------------------------
  443.   def setup_battler_hurt_ani(hurt)
  444.     @hurt = hurt
  445.   end  
  446.   #--------------------------------------------------------------------------
  447.   # ● 获取循环的动画 ID
  448.   #--------------------------------------------------------------------------
  449.   def setup_battler_dead_ani(over)
  450.     @over = over
  451.   end
  452.   #--------------------------------------------------------------------------
  453.   # ● 获取循环的动画 ID
  454.   #--------------------------------------------------------------------------
  455.   def battler_dead_ani
  456.     return @over
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # ● 获取循环的动画 ID
  460.   #--------------------------------------------------------------------------
  461.   def battler_ani_once
  462.     return @once
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # ● 获取循环的动画 ID
  466.   #--------------------------------------------------------------------------
  467.   def battler_hurt_ani
  468.     return @hurt
  469.   end
  470.   #..........................................................................
  471. end
  472. class Sprite_Battler < RPG::Sprite
  473.   #..........................................................................
  474.   #--------------------------------------------------------------------------
  475.   # ● 胜利图
  476.   #--------------------------------------------------------------------------
  477.   def win
  478.     if @battler_name != nil and not @battler.hidden and not @battler.dead?
  479.       @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  480.     end
  481.   end
  482.   #..........................................................................
  483.   #--------------------------------------------------------------------------
  484.   # ● 释放
  485.   #--------------------------------------------------------------------------
  486.   def dispose
  487.     if self.bitmap != nil
  488.       self.bitmap.dispose
  489.     end
  490.     super
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● 刷新画面
  494.   #--------------------------------------------------------------------------
  495.   def update
  496.     super
  497.     # 战斗者为 nil 的情况下
  498.     if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
  499.       self.bitmap = nil
  500.       loop_animation(nil)
  501.        loop_animation1(nil)
  502.       return
  503.     end
  504.     # 文件名和色相与当前情况有差异的情况下
  505.     if @battler.battler_name != @battler_name or
  506.        @battler.battler_hue != @battler_hue
  507.       @battler_hue = @battler.battler_hue
  508.       # 获取、设置位图
  509.       @battler_name = @battler.battler_name
  510.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  511.       #.......................................................................
  512.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  513.       #.......................................................................
  514.       @width = bitmap.width
  515.       [url=home.php?mod=space&uid=291977]@height[/url] = bitmap.height
  516.       self.ox = @width / 2
  517.       self.oy = @height
  518.       # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  519.       if @battler.is_a?(Game_Enemy)
  520.         if @battler.dead? or @battler.hidden
  521.           self.opacity = 0
  522.         end
  523.       end
  524.     end
  525.     # 动画 ID 与当前的情况有差异的情况下
  526.     #.........................................................................
  527.     if @battler.battler_ani != @battler_ani
  528.       @battler_ani = @battler.battler_ani
  529.       loop_animation($data_animations[@battler_ani.to_i])
  530.       

  531.       
  532.      end
  533.    
  534.     #.........................................................................
  535.     # 应该被显示的角色的情况下
  536.     if @battler.is_a?(Game_Actor) and @battler_visible
  537.       # 不是主状态的时候稍稍降低点透明度
  538.       if $game_temp.battle_main_phase
  539.         self.opacity += 3 if self.opacity < 255
  540.       else
  541.         self.opacity -= 3 if self.opacity > 207
  542.       end
  543.     end
  544.     # 明灭
  545.     if @battler.blink
  546.       blink_on
  547.     else
  548.       blink_off
  549.     end
  550.     # 不可见的情况下
  551.     unless @battler_visible
  552.       # 出现 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  553.       if not @battler.hidden and not @battler.dead? and
  554.          (@battler.damage == nil or @battler.damage_pop)
  555.         if @battler.is_a?(Game_Enemy)
  556.           appear
  557. #######################################################################
  558. # HZHJ追加6
  559.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  560.       if @battler.states[i+1] != nil
  561.         @state_sprites[i].loop_animation1($data_animations[$data_states[@battler.states[i+1]].animation_id])
  562.         @state_sprites[i].x = self.x
  563.         @state_sprites[i].y = self.y
  564.         @state_sprites[i].z = self.z
  565.         @state_sprites[i].ox = self.ox
  566.         @state_sprites[i].oy = self.oy
  567.         @state_sprites[i].opacity = self.opacity
  568.         @state_sprites[i].visible = self.visible
  569.         @state_sprites[i].src_rect = self.src_rect
  570.       else
  571.         @state_sprites[i].loop_animation1($data_animations[0])
  572.       end
  573.     end
  574. #####################################################################
  575.         else
  576.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  577.         end
  578.         @battler_visible = true
  579.       end
  580.     end
  581.     # 可见的情况下
  582.     if @battler_visible
  583.       # 逃跑
  584.       if @battler.hidden
  585.         $game_system.se_play($data_system.escape_se)
  586.         escape
  587. #######################################################################
  588. # HZHJ追加7
  589.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  590.       if @battler.states[i+1] != nil
  591.         @state_sprites[i].loop_animation1($data_animations[$data_states[@battler.states[i+1]].animation_id])
  592.         @state_sprites[i].x = self.x
  593.         @state_sprites[i].y = self.y
  594.         @state_sprites[i].z = self.z
  595.         @state_sprites[i].ox = self.ox
  596.         @state_sprites[i].oy = self.oy
  597.         @state_sprites[i].opacity = self.opacity
  598.         @state_sprites[i].visible = self.visible
  599.         @state_sprites[i].src_rect = self.src_rect
  600.       else
  601.         @state_sprites[i].loop_animation1($data_animations[0])
  602.       end
  603.     end
  604. #####################################################################
  605.         @battler_visible = false
  606.       end
  607.       # 白色闪烁
  608.       if @battler.white_flash
  609.         whiten
  610.         @battler.white_flash = false
  611.       end
  612.       # 动画
  613.       if @battler.animation_id != 0
  614.         animation = $data_animations[@battler.animation_id]
  615.         animation(animation, @battler.animation_hit)
  616.         @battler.animation_id = 0
  617.       end
  618.       # 伤害
  619.       if @battler.damage_pop
  620.         damage(@battler.damage, @battler.critical)
  621.         @battler.damage = nil
  622.         @battler.critical = false
  623.         @battler.damage_pop = false
  624.       end
  625.       # korapusu
  626.       if @battler.damage == nil and @battler.dead?
  627.         #....................................................................
  628.         if @battler.is_a?(Game_Enemy)
  629.           $game_system.se_play($data_system.enemy_collapse_se)
  630.           #collapse
  631.         else
  632.           $game_system.se_play($data_system.actor_collapse_se)
  633.         end
  634.         #....................................................................
  635.         @battler_visible = false
  636.       end
  637.     end
  638.     # 设置活动块的坐标
  639.     self.x = @battler.screen_x
  640.     self.y = @battler.screen_y
  641.     self.z = @battler.screen_z
  642.   end
  643. end
  644. module RPG
  645.   class Sprite < ::Sprite
  646.     def damage(value, critical)
  647.       dispose_damage
  648.       if value.is_a?(Numeric)
  649.         damage_string = value.abs.to_s
  650.       else
  651.         damage_string = value.to_s
  652.       end
  653.       bitmap = Bitmap.new(160, 48)
  654.       bitmap.font.name = "华康海报体W12(P)"
  655.       bitmap.font.size = 32
  656.       bitmap.font.color.set(0, 0, 0)
  657.       bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  658.       bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  659.       bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  660.       bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  661.       if value.is_a?(Numeric) and value < 0
  662.         bitmap.font.color.set(176, 255, 144)
  663.       else
  664.         bitmap.font.color.set(255, 255, 255)
  665.       end
  666.       bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  667.       if critical
  668.         bitmap.font.size = 20
  669.         bitmap.font.color.set(0, 0, 0)
  670.         bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
  671.         bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
  672.         bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
  673.         bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
  674.         bitmap.font.color.set(255, 255, 255)
  675.         bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
  676.       end
  677.       @_damage_sprite = ::Sprite.new(self.viewport)
  678.       @_damage_sprite.bitmap = bitmap
  679.       @_damage_sprite.ox = 80
  680.       @_damage_sprite.oy = 20
  681.       @_damage_sprite.x = self.x
  682.       @_damage_sprite.x -= self.bitmap.width/2 if @battler.is_a?(Game_Actor)
  683.       @_damage_sprite.y = self.y - self.oy / 2
  684.       @_damage_sprite.z = 3000
  685.       @_damage_duration = 40
  686.     end
  687.   end
  688. end
  689. module RPG
  690. #--------------------------------------------------------------------------
  691. # ● 常量设定
  692. #--------------------------------------------------------------------------
  693. # 是否显示总伤害
  694. SHOW_TOTAL_DAMAGE = true
  695. # 角色受攻击时是否跳一下
  696. BATTLER_JUMP = false
  697. # 伤害美化字符串文件夹名(放在Pictures文件夹中的子文件夹)
  698. #STRING_DOCUMENTS = ""
  699. # 是否使用伤害美化效果
  700. USE_DAMAGE = false

  701. class Sprite < ::Sprite
  702.    #==========================================
  703.    # 修改说明:
  704.    # @flash_shake用来制作挨打时候跳跃
  705.    # @_damage    用来记录每次打击之后弹出数字
  706.    # @_total_damage 记录总伤害
  707.    # @_total_damage_duration 总伤害持续帧
  708.    #==========================================
  709.    #alias 66RPG_rainbow_initialize : initialize
  710.    def initialize(viewport = nil)
  711.      #66RPG_rainbow_initialize(viewport)
  712.      super(viewport)
  713.      @_whiten_duration = 0
  714.      @_appear_duration = 0
  715.      @_escape_duration = 0
  716.      @_collapse_duration = 0
  717.      @_damage_duration = 0
  718.      @_animation_duration = 0
  719.      @_blink = false
  720.      # 挨打时候跳跃
  721.      @flash_shake = 0
  722.      # 伤害记录数组
  723.      @_damage = []
  724.      # 总伤害数字
  725.      @_total_damage = 0
  726.      # 总伤害持续帧
  727.      @_total_damage_duration = 0
  728.      #.........................................................................
  729.      #记录已经发生的伤害的变量
  730.      @p_dam=0
  731.      @hits=0
  732.      ############ #小改动
  733.      #记录前一次攻击次数
  734.      @temp_hits=0
  735.      #判断是否为最后一次攻击
  736.      @last_hits=0
  737.      ############
  738.      #.........................................................................
  739.    end
  740.     def animation_set_sprites(sprites, cell_data, position)
  741.       for i in 0..15
  742.         sprite = sprites[i]
  743.         pattern = cell_data[i, 0]
  744.         if sprite == nil or pattern == nil or pattern == -1
  745.           sprite.visible = false if sprite != nil
  746.           next
  747.         end
  748.         sprite.visible = true
  749.         sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  750.         if position == 3
  751.           if self.viewport != nil
  752.             sprite.x = self.viewport.rect.width / 2
  753.             sprite.y = self.viewport.rect.height - 160
  754.           else
  755.             sprite.x = 320
  756.             sprite.y = 240
  757.           end
  758.         else
  759.           sprite.x = self.x - self.ox + self.src_rect.width / 2
  760.           sprite.y = self.y - self.oy + self.src_rect.height / 2
  761.           sprite.y -= self.src_rect.height / 4 if position == 0
  762.           sprite.y += self.src_rect.height / 4 if position == 2
  763.         end
  764.         sprite.x += cell_data[i, 1]
  765.         sprite.y += cell_data[i, 2]
  766.         sprite.z =1
  767.         sprite.ox = 96
  768.         sprite.oy = 96
  769.         sprite.zoom_x = cell_data[i, 3] / 100.0
  770.         sprite.zoom_y = cell_data[i, 3] / 100.0
  771.         sprite.angle = cell_data[i, 4]
  772.         sprite.mirror = (cell_data[i, 5] == 1)
  773.         sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  774.         sprite.blend_type = cell_data[i, 7]
  775.       end
  776.     end

  777.    #--------------------------------------------------------------------------
  778.    #美化的伤害处理
  779.    #--------------------------------------------------------------------------
  780.     def damage(value, critical)
  781.       
  782. if USE_DAMAGE == true then
  783.   
  784.       # 释放伤害,效果是伤害数字快速消失,觉得不如不消失好看......
  785.       #dispose_damage
  786.       #清除hit数
  787.       dispose_hit
  788.       # 如果伤害值是数值
  789.       if value.is_a?(Numeric)
  790.         # 绝对值转为字符串
  791.         damage_string = value.abs.to_s
  792.       else
  793.         # 转为字符串
  794.         damage_string = value.to_s
  795.       end
  796.       # 初始化位图
  797.       bitmap = Bitmap.new(162, 64)
  798.       bitmap.font.name = ["华文行楷","黑体", "宋体"]
  799.       bitmap.font.size = 32
  800.       # 伤害值是数值的情况下
  801.       if value.is_a?(Numeric)
  802.         # 分割伤害值字符串
  803.         damage_array = damage_string.scan(/./)
  804.         damage_x = 81 - damage_string.size * 9
  805.         # 伤害值为负的情况下
  806.         if value < 0
  807.           # 调用回复数字表
  808.           rect_y = 32
  809.         else
  810.           # 调用伤害数字表
  811.           rect_y = 0
  812.         end
  813.         # 循环伤害值字符串
  814.         for char in damage_array
  815.           number = char.to_i
  816.           # 显示伤害数字
  817.           bitmap.blt(damage_x, 32, RPG::Cache.picture( "Damage"),#"Damagenew"),
  818.           Rect.new(number * 18, rect_y, 18, 32))
  819.           # 后移一位
  820.           damage_x += 18
  821.         end
  822.       # 伤害值不是数值的情况
  823.       else
  824.         # 如果伤害值不是 Miss
  825.         unless value == "Miss"
  826.           # 系统默认描画字符串
  827.           bitmap.font.color.set(0, 0, 0)
  828.           bitmap.draw_text(-1, 27, 162, 36, damage_string, 1)
  829.           bitmap.draw_text(+1, 27, 162, 36, damage_string, 1)
  830.           bitmap.draw_text(-1, 29, 162, 36, damage_string, 1)
  831.           bitmap.draw_text(+1, 29, 162, 36, damage_string, 1)
  832.           bitmap.font.color.set(255, 255, 255)
  833.           bitmap.draw_text(0, 28, 162, 36, damage_string, 1)
  834.         # Miss 的情况下
  835.         else
  836.           # 显示未击中图画
  837.           bitmap.blt(36, 28, RPG::Cache.picture("Damage"), Rect.new(90, 64, 90, 32))
  838.         end
  839.       end
  840.       # 会心一击标志打开的情况
  841.       if critical
  842.         #会心一击伤害效果
  843. ###########################################################
  844.        $game_screen.start_flash(Color.new(255,255,255,255),5)
  845. ###########################################################
  846.         # 显示会心一击图画
  847.         bitmap.blt(36, 0, RPG::Cache.picture( "Damage"), Rect.new(0, 64, 90, 32))
  848.       end
  849.       
  850. else
  851.       
  852.      #.........................................................................
  853.      #清除hit数
  854.      dispose_hit
  855.      #.........................................................................
  856.      if value.is_a?(Numeric)
  857.        damage_string = value.abs.to_s
  858.      else
  859.        damage_string = value.to_s
  860.      end
  861.      bitmap = Bitmap.new(160, 48)
  862.      bitmap.font.name = "华康海报体W12(P)"
  863.      bitmap.font.size = 32
  864.      bitmap.font.color.set(0, 0, 0)
  865.      bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  866.      bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  867.      bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  868.      bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  869.      #=======================================
  870.      # 修改:颜色
  871.      #=======================================
  872.      if value.is_a?(Numeric) and value < 0
  873.        bitmap.font.color.set(176, 255, 144)
  874.      else
  875.        bitmap.font.color.set(255, 55, 55)
  876.      end
  877.      bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  878.      if critical
  879.        #会心一击伤害效果
  880. ###########################################################
  881.        $game_screen.start_flash(Color.new(255,255,255,255),5)
  882. ###########################################################
  883.        bitmap.font.size = 20
  884.        bitmap.font.color.set(0, 0, 0)
  885.        bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
  886.        bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
  887.        bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
  888.        bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
  889.        bitmap.font.color.set(255, 255, 255)
  890.        bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
  891.      end
  892.      
  893. end
  894.    
  895.      # 伤害值定位     
  896.      @_damage_sprite = ::Sprite.new#(self.viewport)
  897.      @_damage_sprite.bitmap = bitmap
  898.      @_damage_sprite.ox = 80
  899.      @_damage_sprite.oy = 20
  900.      @_damage_sprite.x = self.x
  901.      @_damage_sprite.y = self.y - self.oy / 2
  902.      @_damage_sprite.z = 9999999########3000我的小改动
  903.      @_damage_duration = 40
  904.      #=======================================
  905.      # 修改:推入新的伤害
  906.      #=======================================
  907.      @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  908.      # 总伤害处理
  909.      make_total_damage(value)
  910.      
  911.      
  912.      
  913.     end
  914.    #--------------------------------------------------------------------------
  915.    # ● 返回 @hits
  916.    #--------------------------------------------------------------------------
  917.    def get_hit
  918.      return @hits
  919.    end
  920.    #--------------------------------------------------------------------------
  921.    # ● hit数的美化描绘
  922.     # ● hit数的美化描绘
  923.    #--------------------------------------------------------------------------
  924.    #..........................................................................
  925.    def hit
  926.      # 如果伤害值是数值
  927.      # 转为字符串
  928.      value=@hits
  929.      hits_string = value.to_s
  930.      # 初始化位图
  931.      bitmap = Bitmap.new(320, 64)
  932.      bitmap.font.name = "华康海报体W12(P)"
  933.      bitmap.font.size = 32
  934.      # 分割伤害值字符串
  935.      hits_array = hits_string.scan(/./)
  936.      ##########定义分割与显示大小#############################
  937.      
  938.      hits_x = - 32#hits_string.size * 18.1 # 81 - hits_string.size * 18.1
  939.      rect_y = 0
  940.      # 循环伤害值字符串
  941.      for char in hits_array
  942.        # 后移一位
  943.        hits_x += 36.2
  944.        number = char.to_i
  945.        # 显示伤害数字
  946.        bitmap.blt(hits_x, 0, RPG::Cache.picture("Number"),
  947.        Rect.new(number * 32, rect_y, 32, 50))
  948.      end
  949.      hits_x += 18.1
  950.      bitmap.blt(hits_x, 0, RPG::Cache.picture("HITS"),
  951.                 Rect.new(0, -21, 100, 80))
  952.    
  953.      ##########定义分割与显示大小##############################
  954.      # 伤害值定位
  955.      @_hits_sprite = ::Sprite.new(self.viewport)
  956.      @_hits_sprite.bitmap = bitmap
  957.      @_hits_sprite.x = 560 - hits_string.size * 36.2
  958.      @_hits_sprite.y = 10
  959.      @_hits_sprite.z = 3000
  960.      @_hits_duration = 40
  961.    end
  962.    #.......................................................................................
  963.    #--------------------------------------------------------------------------
  964.    # ● 美化的总伤害处理
  965.    #--------------------------------------------------------------------------
  966.    def make_total_damage(value)
  967.      
  968. if USE_DAMAGE == true then     
  969.      
  970.      if value.is_a?(Numeric)# and SHOW_TOTAL_DAMAGE
  971.        @_total_damage += value
  972.         # 绝对值转为字符串
  973.         damage_string = @_total_damage.abs.to_s
  974.       else
  975.         return
  976.       end
  977. #####################################################小改动
  978.      if SHOW_TOTAL_DAMAGE
  979. #####################################################
  980.       # 初始化位图
  981.       bitmap = Bitmap.new(300, 150)
  982.       bitmap.font.name = "Arial Black"
  983.       bitmap.font.size = 30
  984.       # 伤害值是数值的情况下
  985.       if value.is_a?(Numeric)
  986.         # 分割伤害值字符串
  987.         damage_array = damage_string.scan(/./)
  988.         damage_x = 40 - damage_string.size * 9
  989.         # 伤害值为负的情况下
  990.         if value < 0
  991.           # 调用回复数字表
  992.           name=  "Number3"
  993.         else
  994.           # 调用伤害数字表
  995.           name=   "Number2"
  996.         end
  997.         # 循环伤害值字符串
  998.         for char in damage_array
  999.           number = char.to_i
  1000.           # 显示伤害数字
  1001.           bitmap.blt(damage_x, 0, RPG::Cache.picture(name),
  1002.           Rect.new(number * 30, 0, 30, 50))
  1003.           # 后移一位
  1004.           damage_x += 26
  1005.         end
  1006. #####################################################小改动
  1007.      end
  1008. #####################################################
  1009.       end
  1010.       
  1011. else
  1012.             
  1013.    #--------------------------------------------------------------------------
  1014.    # ● 总伤害处理
  1015.    #--------------------------------------------------------------------------
  1016.      if value.is_a?(Numeric)# and SHOW_TOTAL_DAMAGE
  1017.        @_total_damage += value
  1018.      else
  1019.        return
  1020.      end
  1021. #####################################################小改动
  1022.      if SHOW_TOTAL_DAMAGE
  1023. #####################################################
  1024.      bitmap = Bitmap.new(300, 150)####我的小改动(300, 150)
  1025.      bitmap.font.name = "华康海报体W12(P)"
  1026.      bitmap.font.size = 48
  1027.      bitmap.font.color.set(0, 0, 0)
  1028.      bitmap.draw_text(+2, 12+2, 160, 36, @_total_damage.abs.to_s, 1)
  1029.      if @_total_damage < 0
  1030.        bitmap.font.color.set(80, 255, 00)
  1031.      else
  1032.        bitmap.font.color.set(255, 140, 0)
  1033.      end
  1034.      bitmap.draw_text(0, 12, 160, 60, @_total_damage.abs.to_s, 1)####我的小改动(0, 12, 160, 36,
  1035. #####################################################小改动
  1036.      end
  1037. #####################################################
  1038. end

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

  1456.   #........................................................................
  1457.   @once = 0
  1458.   @frame_index = -1
  1459.   @last_frame = 0
  1460.   #........................................................................
  1461. #######################################################################
  1462. # HZHJ追加1
  1463.   @state_sprites = []
  1464.   for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  1465.     @state_sprites.push(RPG::Sprite.new(viewport))
  1466.   end
  1467. ####################################################################
  1468. end
  1469. #####################################################################
  1470. # HZHJ追加2
  1471.   alias hzhj_dis dispose
  1472.   def dispose
  1473.     hzhj_dis
  1474.     for hzhj in @state_sprites
  1475.       hzhj.dispose
  1476.     end
  1477.   end
  1478. #######################################################################

  1479. #--------------------------------------------------------------------------
  1480. # ● 刷新画面
  1481. #    增添跳跃功能
  1482. #--------------------------------------------------------------------------
  1483. def update
  1484.   super
  1485. ######################################################################
  1486. # HZHJ追加3
  1487.     for hzhj in @state_sprites
  1488.       hzhj.update
  1489.     end
  1490. #######################################################################
  1491.   # 战斗者为 nil 的情况下
  1492.   if @battler == nil
  1493.     self.bitmap = nil
  1494.     loop_animation(nil)
  1495.    loop_animation1(nil)
  1496. ######################################################################
  1497. # HZHJ追加4
  1498.     for hzhj in @state_sprites
  1499.       hzhj.loop_animation1(nil)
  1500.     end
  1501. #######################################################################
  1502.     return
  1503.   end
  1504.   # 文件名和色相与当前情况有差异的情况下
  1505.   if @battler.battler_name != @battler_name or
  1506.      @battler.battler_hue != @battler_hue
  1507.     # 获取、设置位图
  1508.     @battler_name = @battler.battler_name
  1509.     @battler_hue = @battler.battler_hue
  1510.     self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1511.     #.......................................................................
  1512.     if not @battler.hidden and not @battler.dead?
  1513.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1514.     end
  1515.     #.......................................................................
  1516.     @width = bitmap.width
  1517.     @height = bitmap.height
  1518.     self.ox = @width / 2
  1519.     self.oy = @height
  1520.   end
  1521.   #.......................................................................
  1522.   update_actor_animation
  1523.   update_enemy_animation
  1524.   #.......................................................................
  1525.   # 动画 ID 与当前的情况有差异的情况下
  1526.   #.........................................................................
  1527.   if @battler.is_a?(Game_Enemy)
  1528.     if @once == 1 and @loop_animation_once == 1 and
  1529.        @battler.battler_dead_ani == 1
  1530.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1531.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1532.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1533.     end
  1534.   end
  1535.   if @battler.is_a?(Game_Actor)
  1536.     ####################################################################
  1537.     if @once == 1 and @loop_animation_once == 1 and $scene.phase != 5 and
  1538.        @battler.battler_dead_ani == 1 and @battler.dead?
  1539.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1540.     #######################################################################
  1541.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1542.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1543.       #################################################################
  1544.       $fangyu = 0
  1545.       @battler.setup_battler_dead_ani(0)
  1546.       ########################################################
  1547.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase == 5 and
  1548.           not @battler.dead?
  1549.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[7])
  1550.       ######################################################
  1551.       $fangyu = 0
  1552.       @battler.setup_battler_dead_ani(0)
  1553.       ######################################################
  1554.     end
  1555.   end
  1556.   
  1557. if @battler.damage == nil and
  1558.        @battler.state_animation_id != @state_animation_id
  1559.       @state_animation_id = @battler.state_animation_id
  1560.        loop_animation1($data_animations[@state_animation_id])
  1561.     end
  1562. #######################################################################
  1563. # HZHJ追加5
  1564.   if @battler.damage == nil and $game_temp.phase4step5
  1565.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  1566.       if @battler.states[i+1] != nil
  1567.         @state_sprites[i].loop_animation1($data_animations[$data_states[@battler.states[i+1]].animation_id])
  1568.         @state_sprites[i].x = self.x
  1569.         @state_sprites[i].y = self.y
  1570.         @state_sprites[i].z = self.z
  1571.         @state_sprites[i].ox = self.ox
  1572.         @state_sprites[i].oy = self.oy
  1573.         @state_sprites[i].opacity = self.opacity
  1574.         @state_sprites[i].visible = self.visible
  1575.         @state_sprites[i].src_rect = self.src_rect
  1576.       else
  1577.         @state_sprites[i].loop_animation1($data_animations[0])
  1578.       end
  1579.     end
  1580.   end
  1581. #####################################################################
  1582.   if @battler.battler_ani != @battler_ani
  1583.     @battler_ani = @battler.battler_ani
  1584.     @once = @battler.battler_ani_once
  1585.     loop_animation($data_animations[@battler_ani.to_i])
  1586.   end
  1587.   #.........................................................................
  1588.   # 明灭
  1589.   if @battler.blink
  1590.     blink_on
  1591.   else
  1592.     blink_off
  1593.   end
  1594.   # 不可见的情况下
  1595.   unless @battler_visible
  1596.     # 出现
  1597.     if not @battler.hidden and not @battler.dead? and
  1598.        (@battler.damage == nil or @battler.damage_pop)
  1599.       #.......................................................................
  1600.       if @battler.is_a?(Game_Enemy)
  1601.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1602.         #appear
  1603.       else
  1604.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1605.       end
  1606.       #.......................................................................
  1607.       @battler_visible = true
  1608.     end
  1609.   end
  1610.   # 可见的情况下
  1611.   if @battler_visible
  1612.     # 逃跑
  1613.     if @battler.hidden
  1614.       $game_system.se_play($data_system.escape_se)
  1615.       escape
  1616.       @battler_visible = false
  1617.     end
  1618.     # 白色闪烁
  1619.     if @battler.white_flash
  1620.       whiten
  1621.       @battler.white_flash = false
  1622.     end
  1623.     # 动画
  1624.     if @battler.animation_id != 0
  1625.       animation = $data_animations[@battler.animation_id]
  1626.       animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  1627.       # animation(animation, @battler.animation_hit)
  1628.       @battler.animation_id = 0
  1629.     end
  1630.     # 伤害
  1631.     if @battler.damage_pop
  1632.       @battler.damage = nil
  1633.       @battler.critical = false
  1634.       @battler.damage_pop = false
  1635.     end
  1636.     # korapusu
  1637.     if @battler.damage == nil and @battler.dead?
  1638.       if @battler.is_a?(Game_Enemy)
  1639.         if @battler.battler_dead_ani != 1
  1640.           #p "Battler Death Error"
  1641.           $game_system.se_play($data_system.enemy_collapse_se)
  1642.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1643.           @battler.setup_battler_dead_ani(1)
  1644.         end
  1645.         #.....................................................................
  1646.         collapse
  1647. #######################################################################
  1648. # HZHJ追加8
  1649.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  1650.       if @battler.states[i+1] != nil
  1651.         @state_sprites[i].loop_animation1($data_animations[$data_states[@battler.states[i+1]].animation_id])
  1652.         @state_sprites[i].x = self.x
  1653.         @state_sprites[i].y = self.y
  1654.         @state_sprites[i].z = self.z
  1655.         @state_sprites[i].ox = self.ox
  1656.         @state_sprites[i].oy = self.oy
  1657.         @state_sprites[i].opacity = self.opacity
  1658.         @state_sprites[i].visible = self.visible
  1659.         @state_sprites[i].src_rect = self.src_rect
  1660.       else
  1661.         @state_sprites[i].loop_animation1($data_animations[0])
  1662.       end
  1663.     end
  1664. #####################################################################
  1665.         #.....................................................................
  1666.       else
  1667.         #.....................................................................
  1668.         if @battler.battler_dead_ani != 1
  1669.           #p "Battler Death Error"
  1670.           $game_system.se_play($data_system.enemy_collapse_se)
  1671.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1672.           @battler.setup_battler_dead_ani(1)
  1673.         end
  1674.         #.....................................................................
  1675.       end
  1676.       @battler_visible = false
  1677.     end
  1678.   end
  1679.   # 设置活动块的坐标
  1680.   if @flash_shake_switch == true
  1681.     self.x = @battler.screen_x
  1682.     self.y = @battler.screen_y
  1683.     self.z = @battler.screen_z
  1684.     @flash_shake_switch = false
  1685.   end
  1686.   if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
  1687.     if @battler.is_a?(Game_Enemy)
  1688.       case @flash_shake
  1689.       when 9..10
  1690.         self.x -=4
  1691.         self.y -=4
  1692.         self.z = @battler.screen_z
  1693.       when 6..8
  1694.         self.x -=2
  1695.         self.y -=2
  1696.         self.z = @battler.screen_z
  1697.       when 3..5
  1698.         self.x +=2
  1699.         self.y +=2
  1700.         self.z = @battler.screen_z
  1701.       when 1..2
  1702.         self.x +=4
  1703.         self.y +=4
  1704.         self.z = @battler.screen_z
  1705.       end
  1706.     end
  1707.     if @battler.is_a?(Game_Actor)
  1708.       case @flash_shake
  1709.       when 9..10
  1710.         self.x +=4
  1711.         self.y +=4
  1712.         self.z = @battler.screen_z
  1713.       when 6..8
  1714.         self.x +=2
  1715.         self.y +=2
  1716.         self.z = @battler.screen_z
  1717.       when 3..5
  1718.         self.x -=2
  1719.         self.y -=2
  1720.         self.z = @battler.screen_z
  1721.       when 1..2
  1722.         self.x -=4
  1723.         self.y -=4
  1724.         self.z = @battler.screen_z
  1725.       end
  1726.     end
  1727.    @flash_shake -= 1
  1728.   end
  1729. end
  1730. end

  1731. #==============================================================================
  1732. # ■ Scene_Battle
  1733. #------------------------------------------------------------------------------
  1734. #  处理战斗画面的类。
  1735. #==============================================================================

  1736. class Scene_Battle
  1737. #--------------------------------------------------------------------------
  1738. # ● 定义实例变量
  1739. #--------------------------------------------------------------------------
  1740. attr_reader   :animation1_id                    # 行动方动画ID
  1741. end
  1742. class Sprite_Battler < RPG::Sprite
  1743.   #--------------------------------------------------------------------------
  1744.   # ● 处理角色动作
  1745.   #--------------------------------------------------------------------------
  1746.   def update_actor_animation
  1747.     if @battler.is_a?(Game_Actor)
  1748.       if @battler.show_damage_value != nil
  1749.         self.damage(@battler.show_damage_value, false)
  1750.         @battler.show_damage(nil)
  1751.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1752.         @battler.setup_battler_hurt_ani(1)
  1753.       end
  1754.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1 and @battler.show_damage_value != nil
  1755.         # 防御的时候
  1756.         if @hits > @temp_hits and not @battler.dead?
  1757.           ############ #小改动
  1758.           @temp_hits+=1
  1759.           ############
  1760.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1761.           @battler.setup_battler_hurt_ani(1)
  1762.           #################################################################
  1763.         elsif @last_hits == 1 and not @battler.dead?
  1764.           ############ #小改动
  1765.           @last_hits = 0
  1766.           ############
  1767.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1768.           @battler.setup_battler_hurt_ani(1)
  1769.           #################################################################
  1770.         elsif @frame_index != -1 and @frame_index != @last_frame and not @battler.dead? and [email protected]_a?(Numeric)
  1771.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1772.           @battler.setup_battler_hurt_ani(1)
  1773.           #################################################################
  1774.         elsif @last_hits == 1 and not @battler.dead? and [email protected]_a?(Numeric)
  1775.           ############ #小改动
  1776.           @last_hits = 0
  1777.           ############
  1778.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1779.           @battler.setup_battler_hurt_ani(1)
  1780.           #################################################################
  1781.         end
  1782.       else
  1783.         # 单回合只有一次攻击
  1784.        if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1
  1785.           ############ #小改动
  1786.           @last_hits = 0
  1787.           ############
  1788.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1789.           @battler.setup_battler_hurt_ani(1)
  1790.           #################################################################
  1791.         # 单回合多次攻击
  1792.        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
  1793.           ############ #小改动
  1794.           @temp_hits+=1
  1795.           ############
  1796.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1797.           @battler.setup_battler_hurt_ani(1)
  1798.         ########################################################################
  1799.         # 死亡之前攻击
  1800.        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
  1801.           ############ #小改动
  1802.           @temp_hits+=1
  1803.           ############
  1804.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1805.           @battler.setup_battler_hurt_ani(1)
  1806.           #################################################################
  1807.         # 闪避的回合
  1808.        elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1809.           @last_hits = 0
  1810.           #################################################################
  1811.         # 无伤害的攻击
  1812.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1813.           @last_hits = 0
  1814.           #################################################################
  1815.         # 死亡判定
  1816.        elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1

  1817.           if $game_actors[1].hp == 0
  1818.             #消除全员渲染状态
  1819.             for state_id in 34..59
  1820.               $game_actors[1].remove_state(state_id, true)
  1821.               $game_actors[2].remove_state(state_id, true)
  1822.               $game_actors[3].remove_state(state_id, true)
  1823.             end
  1824.             #使乐正绫冻结 解冻能力
  1825.             $game_actors[3].add_state(20, true)
  1826.           end
  1827.          
  1828.           #for actor in $game_party.actors
  1829.           #  if @battler != actor
  1830.           #    actor.add_state(6)
  1831.           #  end
  1832.           #end
  1833.           @last_hits = 0
  1834.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1835.           @battler.setup_battler_dead_ani(1)
  1836.           #################################################################
  1837.         # 胜利判定
  1838.        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
  1839.              @once = 1
  1840.              @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  1841.         end
  1842.       end
  1843.     end
  1844.   end
  1845.   #--------------------------------------------------------------------------
  1846.   # ● 处理敌人动作
  1847.   #--------------------------------------------------------------------------
  1848.   def update_enemy_animation
  1849.     if @battler.is_a?(Game_Enemy)
  1850.       if @battler.show_damage_value != nil
  1851.         self.damage(@battler.show_damage_value, false)
  1852.         @battler.show_damage(nil)
  1853.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1854.         @battler.setup_battler_hurt_ani(1)
  1855.       end
  1856.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
  1857.       else
  1858.         # 单回合只有一次攻击
  1859.         if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1860.           ############ #小改动
  1861.           @last_hits = 0
  1862.           ############
  1863.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1864.           @battler.setup_battler_hurt_ani(1)
  1865.           #################################################################
  1866.         # 单回合多次攻击
  1867.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1868.           ############ #小改动
  1869.           @temp_hits+=1
  1870.           ############
  1871.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1872.           @battler.setup_battler_hurt_ani(1)
  1873.           #################################################################
  1874.         # 死亡之前攻击
  1875.        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
  1876.           ############ #小改动
  1877.           @temp_hits+=1
  1878.           ############
  1879.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1880.           @battler.setup_battler_hurt_ani(1)
  1881.           #################################################################
  1882.         # 无伤害的攻击
  1883.         elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1884.           @last_hits = 0
  1885.           #################################################################
  1886.         # 闪避的回合
  1887.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1888.           @last_hits = 0
  1889.           #################################################################
  1890.         # 死亡判定
  1891.         elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1892.           @last_hits = 0
  1893.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1894.           @battler.setup_battler_dead_ani(1)
  1895.           collapse
  1896.         end
  1897.       end
  1898.     end
  1899.   end
  1900. end

复制代码
希望大家可以支持《吃货计划:绫重奏》https://rpg.blue/forum.php?mod=viewthread&tid=402357&extra=&page=1
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-24 21:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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