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

Project1

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

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2050
在线时间
162 小时
注册时间
2014-6-21
帖子
120
跳转到指定楼层
1
发表于 2021-9-30 16:28:24 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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





RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4.  
  5. # 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。
  6.  
  7. # 开关定义:
  8.  
  9. $不显示金钱窗口 = 41
  10.  
  11. $不显示物品窗口 = 42
  12.  
  13. $不显示武器窗口 = 43
  14.  
  15. $不显示防具窗口 = 44
  16.  
  17. # 以上开关,当打开的时候,获得物品将不会提示,比如默认打开41号开关,获得金钱不再提示
  18.  
  19. # ————————————————————————————————————
  20.  
  21. class Interpreter  
  22.   #--------------------------------------------------------------------------
  23.   # ● 增减金钱
  24.   #--------------------------------------------------------------------------
  25.   def command_125
  26.     value = operate_value(@parameters[0], @parameters[1], @parameters[2])
  27.     $game_party.gain_gold(value)
  28.     if $game_switches[$不显示金钱窗口]==false
  29.       carol3_66RPG = Window_Base.new((640-160)/2,128,180,100)
  30.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  31.       if value >= 0
  32.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得金钱:")
  33.         #——声效,可以自己改
  34.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  35.       else
  36.         carol3_66RPG.contents.draw_text(0,0,240,32,"支付金钱:")
  37.         #——声效,可以自己改
  38.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  39.       end   
  40.       carol3_66RPG.contents.draw_text(0,32,240,32,value.abs.to_s)
  41.       carol3_66RPG.contents.draw_text(0,32,140,32, $data_system.words.gold,2)
  42.       carol3_66RPG.opacity = 160
  43.       for i in 0..30
  44.         Graphics.update
  45.       end
  46.       for i in 0..10
  47.         carol3_66RPG.opacity -= 30
  48.         carol3_66RPG.contents_opacity -= 30
  49.         Graphics.update
  50.       end
  51.       carol3_66RPG.dispose
  52.     end
  53.     return true
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ● 增减物品
  57.   #--------------------------------------------------------------------------
  58.   def command_126
  59.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  60.     $game_party.gain_item(@parameters[0], value)
  61.     if $game_switches[$不显示物品窗口]==false
  62.       carol3_66RPG_item = $data_items[@parameters[0]]
  63.       carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  64.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  65.       if value >= 0
  66.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得物品:")   
  67.         #——声效,可以自己改
  68.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  69.       else
  70.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去物品:")   
  71.         #——声效,可以自己改
  72.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  73.       end
  74.       carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  75.       carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  76.       carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  77.       carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  78.       carol3_66RPG.opacity = 160
  79.       for i in 0..30
  80.         Graphics.update
  81.       end
  82.       for i in 0..10
  83.         carol3_66RPG.opacity -= 30
  84.         carol3_66RPG.contents_opacity -= 30
  85.         Graphics.update
  86.       end
  87.       carol3_66RPG.dispose
  88.     end
  89.     return true
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   # ● 增减武器
  93.   #--------------------------------------------------------------------------
  94.   def command_127
  95.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  96.     $game_party.gain_weapon(@parameters[0], value)
  97.     if $game_switches[$不显示武器窗口]==false
  98.       carol3_66RPG_item = $data_weapons[@parameters[0]]
  99.       carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  100.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  101.       if value >= 0
  102.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得武器:")   
  103.         #——声效,可以自己改
  104.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  105.       else
  106.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去武器:")   
  107.         #——声效,可以自己改
  108.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  109.       end
  110.       carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  111.       carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  112.       carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  113.       carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  114.       carol3_66RPG.opacity = 160
  115.       for i in 0..30
  116.         Graphics.update
  117.       end
  118.       for i in 0..10
  119.         carol3_66RPG.opacity -= 30
  120.         carol3_66RPG.contents_opacity -= 30
  121.         Graphics.update
  122.       end
  123.       carol3_66RPG.dispose
  124.     end
  125.     return true
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ● 增减防具
  129.   #--------------------------------------------------------------------------
  130.   def command_128
  131.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  132.     $game_party.gain_armor(@parameters[0], value)
  133.     if $game_switches[$不显示防具窗口]==false
  134.       carol3_66RPG_item = $data_armors[@parameters[0]]
  135.       carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
  136.       carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
  137.       if value >= 0
  138.         carol3_66RPG.contents.draw_text(0,0,240,32,"获得:")   
  139.         #——声效,可以自己改
  140.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  141.       else
  142.         carol3_66RPG.contents.draw_text(0,0,240,32,"失去:")   
  143.         #——声效,可以自己改
  144.         Audio.se_play("Audio/SE/"+"XT-(获得物品)",100,100)
  145.       end
  146.       carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
  147.       carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
  148.       carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
  149.       carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
  150.       carol3_66RPG.opacity = 160
  151.       for i in 0..30
  152.         Graphics.update
  153.       end
  154.       for i in 0..10
  155.         carol3_66RPG.opacity -= 30
  156.         carol3_66RPG.contents_opacity -= 30
  157.         Graphics.update
  158.       end
  159.       carol3_66RPG.dispose
  160.     end
  161.     return true
  162.   end
  163. end
  164.  
  165.  
  166.  
  167. #==============================================================================
  168. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  169. #==============================================================================

Lv5.捕梦者 (版主)

梦石
1
星屑
23963
在线时间
3338 小时
注册时间
2011-7-8
帖子
3925

开拓者

2
发表于 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 网络脚本 *
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2050
在线时间
162 小时
注册时间
2014-6-21
帖子
120
3
 楼主| 发表于 2021-9-30 21:58:35 | 只看该作者
guoxiaomi 发表于 2021-9-30 20:34
在所有的carol3_66RPG.opacity = 160后面加上
carol3_66RPG.z = 999
反正把999往大了改…… ...

感谢大佬 解决了我疑惑的问题
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2050
在线时间
162 小时
注册时间
2014-6-21
帖子
120
4
 楼主| 发表于 2021-9-30 22:08:30 | 只看该作者
guoxiaomi 发表于 2021-9-30 20:34
在所有的carol3_66RPG.opacity = 160后面加上
carol3_66RPG.z = 999
反正把999往大了改…… ...

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



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

使用道具 举报

Lv5.捕梦者 (版主)

梦石
1
星屑
23963
在线时间
3338 小时
注册时间
2011-7-8
帖子
3925

开拓者

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

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2050
在线时间
162 小时
注册时间
2014-6-21
帖子
120
6
 楼主| 发表于 2021-10-1 15:03:06 | 只看该作者
guoxiaomi 发表于 2021-9-30 23:26
全动画脚本……不太想看……

好吧 还是感谢大佬
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
1
星屑
23963
在线时间
3338 小时
注册时间
2011-7-8
帖子
3925

开拓者

7
发表于 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 网络脚本 *
回复 支持 反对

使用道具 举报

Lv3.寻梦者

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

大佬就是大佬 非常的nice
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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