查看: 2490|回复: 7

[已经解决] 怎么把得失物品自动提示的显示调到最顶级

[复制链接]
梦石
0
星屑
2292
在线时间
195 小时
注册时间
2014-6-21
回帖
104
发表于 2021-9-30 16:28:24 | 显示全部楼层 |阅读模式

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

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

×
我用图片做了个手电的效果 但是在图片的遮挡下就把得失物品自动提示档住了,怎么把得失物品自动提示的显示调到最顶级(脚本小白)
QQ图片20210930162524.png




  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================

  4. # 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。

  5. # 开关定义:

  6. $不显示金钱窗口 = 41

  7. $不显示物品窗口 = 42

  8. $不显示武器窗口 = 43

  9. $不显示防具窗口 = 44

  10. # 以上开关,当打开的时候,获得物品将不会提示,比如默认打开41号开关,获得金钱不再提示

  11. # ————————————————————————————————————

  12. class Interpreter  
  13.   #--------------------------------------------------------------------------
  14.   # ● 增减金钱
  15.   #--------------------------------------------------------------------------
  16.   def command_125
  17.     value = operate_value(@parameters[0], @parameters[1], @parameters[2])
  18.     $game_party.gain_gold(value)
  19.     if $game_switches[$不显示金钱窗口]==false
  20.       carol3_66RPG = Window_Base.new((640-160)/2,128,180,100)
  21.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  22.       if value >= 0
  23.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得金钱:")
  24.         #——声效,可以自己改
  25.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  26.       else
  27.         carol3_66RPG.contents.draw_text(0,0,240,32,"支付金钱:")
  28.         #——声效,可以自己改
  29.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  30.       end   
  31.       carol3_66RPG.contents.draw_text(0,32,240,32,value.abs.to_s)
  32.       carol3_66RPG.contents.draw_text(0,32,140,32, $data_system.words.gold,2)
  33.       carol3_66RPG.opacity = 160
  34.       for i in 0..30
  35.         Graphics.update
  36.       end
  37.       for i in 0..10
  38.         carol3_66RPG.opacity -= 30
  39.         carol3_66RPG.contents_opacity -= 30
  40.         Graphics.update
  41.       end
  42.       carol3_66RPG.dispose
  43.     end
  44.     return true
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # ● 增减物品
  48.   #--------------------------------------------------------------------------
  49.   def command_126
  50.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  51.     $game_party.gain_item(@parameters[0], value)
  52.     if $game_switches[$不显示物品窗口]==false
  53.       carol3_66RPG_item = $data_items[@parameters[0]]
  54.       carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  55.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  56.       if value >= 0
  57.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得物品:")   
  58.         #——声效,可以自己改
  59.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  60.       else
  61.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去物品:")   
  62.         #——声效,可以自己改
  63.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  64.       end
  65.       carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  66.       carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  67.       carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  68.       carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  69.       carol3_66RPG.opacity = 160
  70.       for i in 0..30
  71.         Graphics.update
  72.       end
  73.       for i in 0..10
  74.         carol3_66RPG.opacity -= 30
  75.         carol3_66RPG.contents_opacity -= 30
  76.         Graphics.update
  77.       end
  78.       carol3_66RPG.dispose
  79.     end
  80.     return true
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● 增减武器
  84.   #--------------------------------------------------------------------------
  85.   def command_127
  86.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  87.     $game_party.gain_weapon(@parameters[0], value)
  88.     if $game_switches[$不显示武器窗口]==false
  89.       carol3_66RPG_item = $data_weapons[@parameters[0]]
  90.       carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  91.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  92.       if value >= 0
  93.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得武器:")   
  94.         #——声效,可以自己改
  95.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  96.       else
  97.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去武器:")   
  98.         #——声效,可以自己改
  99.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  100.       end
  101.       carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  102.       carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  103.       carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  104.       carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  105.       carol3_66RPG.opacity = 160
  106.       for i in 0..30
  107.         Graphics.update
  108.       end
  109.       for i in 0..10
  110.         carol3_66RPG.opacity -= 30
  111.         carol3_66RPG.contents_opacity -= 30
  112.         Graphics.update
  113.       end
  114.       carol3_66RPG.dispose
  115.     end
  116.     return true
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● 增减防具
  120.   #--------------------------------------------------------------------------
  121.   def command_128
  122.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  123.     $game_party.gain_armor(@parameters[0], value)
  124.     if $game_switches[$不显示防具窗口]==false
  125.       carol3_66RPG_item = $data_armors[@parameters[0]]
  126.       carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  127.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  128.       if value >= 0
  129.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得:")   
  130.         #——声效,可以自己改
  131.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  132.       else
  133.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去:")   
  134.         #——声效,可以自己改
  135.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  136.       end
  137.       carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  138.       carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  139.       carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  140.       carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  141.       carol3_66RPG.opacity = 160
  142.       for i in 0..30
  143.         Graphics.update
  144.       end
  145.       for i in 0..10
  146.         carol3_66RPG.opacity -= 30
  147.         carol3_66RPG.contents_opacity -= 30
  148.         Graphics.update
  149.       end
  150.       carol3_66RPG.dispose
  151.     end
  152.     return true
  153.   end
  154. end



  155. #==============================================================================
  156. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  157. #==============================================================================
复制代码
梦石
1
星屑
24088
在线时间
3339 小时
注册时间
2011-7-8
回帖
3862

开拓者

发表于 2021-9-30 20:34:19 | 显示全部楼层
在所有的carol3_66RPG.opacity = 160后面加上
carol3_66RPG.z = 999
反正把999往大了改……

评分

参与人数 1星屑 +100 赞 +1 收起 理由
RyanBern + 100 + 1 大佬就是大佬,非常nice

查看全部评分

熟悉rgss和ruby,xp区版主~
正在填坑:《膜拜组传奇》讲述膜拜组和学霸们的故事。
已上steam:与TXBD合作的Reformers《变革者》
* 战斗调用公共事件 *
* RGSOS 网络脚本 *
回复

使用道具 举报

梦石
0
星屑
2292
在线时间
195 小时
注册时间
2014-6-21
回帖
104
 楼主| 发表于 2021-9-30 21:58:35 | 显示全部楼层
guoxiaomi 发表于 2021-9-30 20:34
在所有的carol3_66RPG.opacity = 160后面加上
carol3_66RPG.z = 999
反正把999往大了改…… ...

感谢大佬 解决了我疑惑的问题
回复

使用道具 举报

梦石
0
星屑
2292
在线时间
195 小时
注册时间
2014-6-21
回帖
104
 楼主| 发表于 2021-9-30 22:08:30 | 显示全部楼层
guoxiaomi 发表于 2021-9-30 20:34
在所有的carol3_66RPG.opacity = 160后面加上
carol3_66RPG.z = 999
反正把999往大了改…… ...

还有个问题 也是层级关系 我用的全动画 在战斗里显示图片层级没有战斗图高
123456.png


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

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

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

  295.      # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  296.      if @animation1_id == 0
  297.        @active_battler.white_flash = true
  298.      else
  299.        @active_battler.animation_id = @animation1_id
  300.        @active_battler.animation_hit = true
  301.      end

  302.     # 限制动画长度、最低 8 帧
  303.     @wait_count = 8
  304.     # 移至步骤 4
  305.     @phase4_step = 4 #转到第四步就会显示了
  306.    

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

  366.     # 限制动画长度、最低 8 帧
  367.     @wait_count = 8
  368.     # 移至步骤 5
  369.     @phase4_step = 5
  370. end

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

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

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

  464. #############################################################################
  465. class Game_Actor < Game_Battler
  466.   
  467. #--------------------------------------------------------------------------
  468.   # ● 取得战斗画面的 X 坐标
  469.   #--------------------------------------------------------------------------
  470.   def screen_x
  471.     case self.index  
  472.     when 0
  473.        return 417
  474.        #角色1的横坐标
  475.       when 1
  476.        return 461
  477.        #角色2的横坐标
  478.       when 2
  479.        return 535
  480.        #角色3的横坐标
  481.       when 3
  482.        return 586
  483.        #角色4的横坐标
  484.     else
  485.       return 640
  486.     end
  487.   end
  488.   #----
  489.   #--------------------------------------------------------------------------
  490.   # ● 取得战斗画面的 Y 坐标
  491.   #--------------------------------------------------------------------------
  492.   def screen_y
  493.     # 返回计算后的队伍 Y 坐标的排列顺序
  494.     case self.index  
  495.     when 0
  496.        return 231
  497.        #角色1的纵坐标
  498.       when 1
  499.        return 326
  500.        #角色2的纵坐标
  501.       when 2
  502.        return 231
  503.        #角色3的纵坐标
  504.       when 3
  505.        return 326
  506.        #角色4的纵坐标
  507.     else
  508.       return 1000320
  509.     end
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # ● 取得战斗画面的 Z 坐标
  513.   #--------------------------------------------------------------------------
  514.   def screen_z
  515.     # 返回计算后的队伍 Z 坐标的排列顺序
  516.     case self.index
  517.     when 0
  518.       return 100
  519.     when 1
  520.       return 90
  521.     when 2
  522.       return 80
  523.     when 3
  524.       return 70
  525.     else
  526.       return 0
  527.     end
  528.   end
  529. end

  530. class Scene_Battle

  531. #--------------------------------------------------------------------------
  532.   # ● 取得战斗画面的 X 坐标
  533.   #--------------------------------------------------------------------------
  534.   def screen_x
  535.     # 返回计算后的队伍 X 坐标的排列顺序
  536.     if self.index != nil
  537.       #......................................................................
  538.       return self.index * 90 + 500
  539.       #......................................................................
  540.     else
  541.       return 0
  542.     end
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ● 取得战斗画面的 Y 坐标
  546.   #--------------------------------------------------------------------------
  547.   def screen_y
  548.     #........................................................................
  549.     return 464 - self.index * 110
  550.     #........................................................................
  551.   end
  552.    #--------------------------------------------------------------------------
  553.   # ● 取得战斗画面的 Z 坐标
  554.   #--------------------------------------------------------------------------
  555.   def screen_z
  556.     # 返回计算后的队伍 Z 坐标的排列顺序
  557.     case self.index
  558.     when 0
  559.       return 100
  560.     when 1
  561.       return 90
  562.     when 2
  563.       return 80
  564.     when 3
  565.       return 70
  566.     else
  567.       return 0
  568.     end
  569.   end
  570. end

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

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

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

  1143.      bitmap.draw_text(0, 12, 160, 36, @_total_damage.abs.to_s, 1)
  1144. #####################################################小改动
  1145.      end
  1146. #####################################################
  1147. end

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

  1567.   #........................................................................
  1568.   @once = 0
  1569.   @frame_index = -1
  1570.   @last_frame = 0
  1571.   #........................................................................
  1572. end
  1573. #--------------------------------------------------------------------------
  1574. # ● 刷新画面
  1575. #    增添跳跃功能
  1576. #--------------------------------------------------------------------------
  1577. def update
  1578.   super
  1579.   # 战斗者为 nil 的情况下
  1580.   if @battler == nil
  1581.     self.bitmap = nil
  1582.     loop_animation(nil)
  1583.    loop_animation1(nil)
  1584.     return
  1585.   end
  1586.   # 文件名和色相与当前情况有差异的情况下
  1587.   if @battler.battler_name != @battler_name or
  1588.      @battler.battler_hue != @battler_hue
  1589.     # 获取、设置位图
  1590.     @battler_name = @battler.battler_name
  1591.     @battler_hue = @battler.battler_hue
  1592.     self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1593.     #.......................................................................
  1594.     if not @battler.hidden and not @battler.dead?
  1595.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1596.     end
  1597.     #.......................................................................
  1598.     @width = bitmap.width
  1599.     @height = bitmap.height
  1600.     self.ox = @width / 2
  1601.     self.oy = @height
  1602.    
  1603.   end
  1604.   #.......................................................................
  1605.   update_actor_animation
  1606.   update_enemy_animation
  1607.   #.......................................................................
  1608.   # 动画 ID 与当前的情况有差异的情况下
  1609.   #.........................................................................
  1610.   if @battler.is_a?(Game_Enemy)
  1611.     if @once == 1 and @loop_animation_once == 1 and
  1612.        @battler.battler_dead_ani == 1
  1613.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1614.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1615.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1616.     end
  1617.   end
  1618.   if @battler.is_a?(Game_Actor)
  1619.     ####################################################################
  1620.     if @once == 1 and @loop_animation_once == 1 and $scene.phase != 5 and
  1621.        @battler.battler_dead_ani == 1 and @battler.dead?
  1622.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1623.     #######################################################################
  1624.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1625.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1626.       #################################################################
  1627.       $fangyu = 0
  1628.       @battler.setup_battler_dead_ani(0)
  1629.       ########################################################
  1630.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase == 5 and
  1631.           not @battler.dead?
  1632.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[7])
  1633.       ######################################################
  1634.       $fangyu = 0
  1635.       @battler.setup_battler_dead_ani(0)
  1636.       ######################################################
  1637.     end
  1638.   end
  1639.   
  1640. if @battler.damage == nil and
  1641.        @battler.state_animation_id != @state_animation_id
  1642.       @state_animation_id = @battler.state_animation_id
  1643.      # loop_animation($data_animations[@state_animation_id])
  1644.        loop_animation1($data_animations[@state_animation_id])
  1645.     end

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

  1784. #==============================================================================
  1785. # ■ Scene_Battle
  1786. #------------------------------------------------------------------------------
  1787. #  处理战斗画面的类。
  1788. #==============================================================================

  1789. class Scene_Battle
  1790. #--------------------------------------------------------------------------
  1791. # ● 定义实例变量
  1792. #--------------------------------------------------------------------------
  1793. attr_reader   :animation1_id                    # 行动方动画ID
  1794. end
  1795. class Sprite_Battler < RPG::Sprite
  1796.   #--------------------------------------------------------------------------
  1797.   # ● 处理角色动作
  1798.   #--------------------------------------------------------------------------
  1799.   def update_actor_animation
  1800.     if @battler.is_a?(Game_Actor)
  1801.       if @battler.show_damage_value != nil
  1802.         self.damage(@battler.show_damage_value, false)
  1803.         @battler.show_damage(nil)
  1804.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1805.         @battler.setup_battler_hurt_ani(1)
  1806.       end
  1807.       @last_frame = $fanime_frame_max if $fanime_frame_max > @last_frame
  1808.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1 and @battler.show_damage_value != nil
  1809.         # 防御的时候
  1810.         if @hits > @temp_hits and not @battler.dead?
  1811.           ############ #小改动
  1812.           @temp_hits+=1
  1813.           ############
  1814.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1815.           @battler.setup_battler_hurt_ani(1)
  1816.           #################################################################
  1817.         elsif @last_hits == 1 and not @battler.dead?
  1818.           ############ #小改动
  1819.           @last_hits = 0
  1820.           ############
  1821.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1822.           @battler.setup_battler_hurt_ani(1)
  1823.           #################################################################
  1824.         elsif @frame_index != -1 and @frame_index != @last_frame and not @battler.dead? and !@battler.damage.is_a?(Numeric)
  1825.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1826.           @battler.setup_battler_hurt_ani(1)
  1827.           #################################################################
  1828.         elsif @last_hits == 1 and not @battler.dead? and !@battler.damage.is_a?(Numeric)
  1829.           ############ #小改动
  1830.           @last_hits = 0
  1831.           ############
  1832.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
  1833.           @battler.setup_battler_hurt_ani(1)
  1834.           #################################################################
  1835.         end
  1836.       else
  1837.         # 单回合只有一次攻击
  1838.        if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1
  1839.           ############ #小改动
  1840.           @last_hits = 0
  1841.           ############
  1842.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1843.           @battler.setup_battler_hurt_ani(1)
  1844.           #################################################################
  1845.         # 单回合多次攻击
  1846.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and  
  1847. $fangyu != 1
  1848.           ############ #小改动
  1849.           @temp_hits+=1
  1850.           ############
  1851.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1852.           @battler.setup_battler_hurt_ani(1)
  1853.         ########################################################################
  1854.         # 死亡之前攻击
  1855.        elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1 and  
  1856. @battler.dead? and @battler.battler_dead_ani != 1
  1857.           ############ #小改动
  1858.           @temp_hits+=1
  1859.           ############
  1860.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1861.           @battler.setup_battler_hurt_ani(1)
  1862.           #################################################################
  1863.         # 闪避的回合
  1864.        elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1865.           @last_hits = 0
  1866.           #################################################################
  1867.         # 无伤害的攻击
  1868.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1869.           @last_hits = 0
  1870.           #################################################################
  1871.         # 死亡判定
  1872.         
  1873.         elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1874.        #elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1875.           @last_hits = 0
  1876.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1877.           #@battler.setup_battler_dead_ani(1)
  1878.           #################################################################
  1879.         # 胜利判定
  1880.        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
  1881.              @once = 1
  1882.              @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  1883.         end
  1884.       end
  1885.     end
  1886.   end
  1887.   #--------------------------------------------------------------------------
  1888.   # ● 处理敌人动作
  1889.   #--------------------------------------------------------------------------
  1890.   def update_enemy_animation
  1891.     if @battler.is_a?(Game_Enemy)
  1892.       if @battler.show_damage_value != nil
  1893.         self.damage(@battler.show_damage_value, false)
  1894.         @battler.show_damage(nil)
  1895.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1896.         @battler.setup_battler_hurt_ani(1)
  1897.       end
  1898.       @last_frame = $fanime_frame_max if $fanime_frame_max > @last_frame
  1899.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
  1900.       else
  1901.         # 单回合只有一次攻击
  1902.         if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1903.           ############ #小改动
  1904.           @last_hits = 0
  1905.           ############
  1906.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1907.           @battler.setup_battler_hurt_ani(1)
  1908.           #################################################################
  1909.         # 单回合多次攻击
  1910.        elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1911.           ############ #小改动
  1912.           @temp_hits+=1
  1913.           ############
  1914.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1915.           @battler.setup_battler_hurt_ani(1)
  1916.           #################################################################
  1917.         # 死亡之前攻击
  1918.        elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and @battler.dead? and  
  1919. @battler.battler_dead_ani != 1
  1920.           ############ #小改动
  1921.           @temp_hits+=1
  1922.           ############
  1923.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1924.           @battler.setup_battler_hurt_ani(1)
  1925.           #################################################################
  1926.         # 无伤害的攻击
  1927.         elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
  1928.           @last_hits = 0
  1929.           #################################################################
  1930.         # 闪避的回合
  1931.         elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
  1932.           @last_hits = 0
  1933.           #################################################################
  1934.         # 死亡判定
  1935.         elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1936.         #elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1937.           @last_hits = 0
  1938.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1939.           @battler.setup_battler_dead_ani(1)
  1940.           collapse        
  1941.         end
  1942.       end
  1943.     end
  1944.   end
  1945. end

  1946. class Scene_Battle
  1947.   alias update101 update
  1948.   def update
  1949.     update101
  1950.     @actor_command_window.z=4999
  1951.     @item_window.z=4999 if @item_window
  1952.     @skill_window.z=4999 if @skill_window
  1953.   end
  1954.   
  1955.   alias start_phase5101 start_phase5
  1956.   def start_phase5
  1957.     @spriteset.win #显示战斗胜利动画
  1958.     start_phase5101
  1959.   end
  1960. end
复制代码
回复

使用道具 举报

梦石
1
星屑
24088
在线时间
3339 小时
注册时间
2011-7-8
回帖
3862

开拓者

发表于 2021-9-30 23:26:58 | 显示全部楼层
全动画脚本……不太想看……
熟悉rgss和ruby,xp区版主~
正在填坑:《膜拜组传奇》讲述膜拜组和学霸们的故事。
已上steam:与TXBD合作的Reformers《变革者》
* 战斗调用公共事件 *
* RGSOS 网络脚本 *
回复

使用道具 举报

梦石
0
星屑
2292
在线时间
195 小时
注册时间
2014-6-21
回帖
104
 楼主| 发表于 2021-10-1 15:03:06 | 显示全部楼层
guoxiaomi 发表于 2021-9-30 23:26
全动画脚本……不太想看……

好吧 还是感谢大佬
回复

使用道具 举报

梦石
1
星屑
24088
在线时间
3339 小时
注册时间
2011-7-8
回帖
3862

开拓者

发表于 2021-10-1 16:23:57 | 显示全部楼层

?

本帖最后由 guoxiaomi 于 2021-10-1 16:27 编辑
link756367658 发表于 2021-10-1 15:03
好吧 还是感谢大佬

  1. @picture_sprites = []
  2.     for i in 51..100
  3.       @picture_sprites.push(Sprite_Picture.new(@viewport3,
  4.         $game_screen.pictures[i]))
  5. # --------------------------
  6. @picture_sprites.z = 9999
  7. # --------------------------
  8.     end
复制代码
战斗中使用显示图片?先试试是不是这里吧?RMXP居然不能设置显示的图片的z值
或者改@viewport3的z值?在114-116行附近,三个viewport的z都被设置成了1,你试一下调整这几个1,比如把@viewport3 = 2看看
熟悉rgss和ruby,xp区版主~
正在填坑:《膜拜组传奇》讲述膜拜组和学霸们的故事。
已上steam:与TXBD合作的Reformers《变革者》
* 战斗调用公共事件 *
* RGSOS 网络脚本 *
回复

使用道具 举报

梦石
0
星屑
2292
在线时间
195 小时
注册时间
2014-6-21
回帖
104
 楼主| 发表于 2021-10-1 17:21:09 | 显示全部楼层
guoxiaomi 发表于 2021-10-1 16:23
战斗中使用显示图片?先试试是不是这里吧?RMXP居然不能设置显示的图片的z值
或者改@viewport3的z值?在1 ...

大佬就是大佬 非常的nice
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部