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

Project1

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

[已经过期] 全动画战斗不显示胜利动画,请高手进来看看。

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3176
在线时间
1442 小时
注册时间
2009-7-27
帖子
1454
跳转到指定楼层
1
发表于 2015-5-18 16:27:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 爆焰 于 2015-5-18 16:29 编辑

就是这个主站上面全动画战斗脚本,其他的动画都正常,就是挨打有时候不显示,有时候又会显示。还有就是胜利动态动画,胜利了也不显示。
请问是什么问题?

还有个小小的请求,就是帮忙改一下防御动画,点防御就一直防御在那里实在难看。有没有办法让角色受到攻击时才显示防御呢?
  1. #==============================================================================
  2. # ■ 全动画战斗
  3. #------------------------------------------------------------------------------
  4. #  By whbm
  5. #   应用脚本 彩虹神剑 By 66
  6. #==============================================================================

  7. #==============================================================================
  8. #简要介绍:
  9. #    本脚本实现了战斗的动态效果,其中包含了待机、攻击、防御、挨打、胜利、死亡。类似于超级横版、超级战斗。但是本系统特色在于所有效果的实现并不是靠庞大的战斗图,而是使用了数据库中的动画。这样不仅突破了不同人不同祯数量的限制,并且方便了单动画单祯的修改。
  10. #使用方法:
  11. #    个人觉得还是比较简单,但是大量的怪物还是会令人头痛。
  12. #    1.数据库的设置
  13. #      敌人必要的动画有待机、挨打、死亡三个必要的动画
  14. #      角色必要的动画有待机、挨打、防御、死亡动态、胜利动态、死亡静态、胜利静态
  15. #
  16. #      死亡静态与胜利静态:动画中只有1祯,为相应动态动画的最后一祯
  17. #      
  18. #      剩下的就是人物攻击的动画,和正常的动画是一样设置
  19. #      如图中的攻击等待动画只是为了在播放攻击动画的同时消除人物本身(素材原因,人物攻击的时候离开了原位,如果是在原位置放魔法是用不上的)
  20. #    2.战斗图的设置
  21. #      战斗图其实只是一个透明的图片,它只是用来描述一个敌人或者角色的大小,并与相应的战斗动画编号相衔接。
  22. #      战斗图的文件名格式如下:
  23. #          名字★待机★防御★挨打★死亡动态★死亡静态★胜利动态★胜利静态.png
  24. #          (其中“名字”一项与动画无关)
  25. #          例如:
  26. #          紫烟★140★141★148★149★150★144★145.png
  27. #      对于敌人无胜利动画或者防御动画,请保持该位置为空,例如:
  28. #          蓝若冰★124★★126★127★★★.png
  29. #    综上,设置就这么完成了。
  30. #注意事项:
  31. #    1.由于系统中待机由动画实现,所以无法使用状态附带动画的功能。
  32. #    2.可以在脚本中使用Ctrl+Shift+F通篇搜索“小改动”,可以修改某些窗口的Z值。
  33. #    3.当您将此系统向您的工程中移植的时候也要注意事项2中的“小改动”。
  34. #    4.系统是从游戏“石焚刃暖”中提取出来的,或许会有疏漏与多余的东西,BUG也是不免的。大家尽管提便是。     
  35. #==============================================================================
  36. class Spriteset_Battle
  37.   #--------------------------------------------------------------------------
  38.   # ● 初始化变量
  39.   #--------------------------------------------------------------------------
  40.   def initialize
  41.     # 生成显示端口
  42.     @viewport1 = Viewport.new(0, 0, 640, 480)
  43.     @viewport2 = Viewport.new(0, 0, 640, 480)
  44.     @viewport3 = Viewport.new(0, 0, 640, 480)
  45.     @viewport4 = Viewport.new(0, 0, 640, 480)
  46.     @viewport2.z = 101
  47.     @viewport3.z = 200
  48.     @viewport4.z = 5000
  49.     # 生成战斗背景活动块
  50.     @battleback_sprite = Sprite.new(@viewport1)
  51.     # 生成敌人活动块
  52.     @enemy_sprites = []
  53.     for enemy in $game_troop.enemies.reverse
  54.       @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  55.     end
  56.     # 生成敌人活动块
  57.     @actor_sprites = []
  58.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  59.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  60.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  61.     @actor_sprites.push(Sprite_Battler.new(@viewport2))
  62.     # 生成天候
  63.     @weather = RPG::Weather.new(@viewport1)
  64.     # 生成图片活动块
  65.     @picture_sprites = []
  66.     for i in 51..100
  67.       @picture_sprites.push(Sprite_Picture.new(@viewport3,
  68.         $game_screen.pictures[i]))
  69.     end
  70.     # 生成计时器块
  71.     @timer_sprite = Sprite_Timer.new
  72.     # 刷新画面
  73.     update
  74.   end
  75.   #..........................................................................
  76.   #--------------------------------------------------------------------------
  77.   # ● 胜利图
  78.   #--------------------------------------------------------------------------
  79.   def win
  80.     for sprite in @actor_sprites
  81.       sprite.win
  82.     end
  83.   end
  84.   #..........................................................................
  85.   #--------------------------------------------------------------------------
  86.   # ● 刷新画面
  87.   #--------------------------------------------------------------------------
  88.   def update
  89.     # 刷新角色的活动块 (对应角色的替换)
  90.     @actor_sprites[0].battler = $game_party.actors[0]
  91.     @actor_sprites[1].battler = $game_party.actors[1]
  92.     @actor_sprites[2].battler = $game_party.actors[2]
  93.     @actor_sprites[3].battler = $game_party.actors[3]
  94.     # 战斗背景的文件名与现在情况有差异的情况下
  95.     if @battleback_name != $game_temp.battleback_name
  96.       @battleback_name = $game_temp.battleback_name
  97.       if @battleback_sprite.bitmap != nil
  98.         @battleback_sprite.bitmap.dispose
  99.       end
  100.       @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  101.       @battleback_sprite.src_rect.set(0, 0, 640, 480)
  102.     end
  103.     # 刷新战斗者的活动块
  104.     for sprite in @enemy_sprites + @actor_sprites
  105.       sprite.update
  106.     end
  107.     # 刷新天气图形
  108.     @weather.type = $game_screen.weather_type
  109.     @weather.max = $game_screen.weather_max
  110.     @weather.update
  111.     # 刷新图片活动块
  112.     for sprite in @picture_sprites
  113.       sprite.update
  114.     end
  115.     # 刷新计时器活动块
  116.     @timer_sprite.update
  117.     # 设置画面的色调与震动位置
  118.     @viewport1.tone = $game_screen.tone
  119.     @viewport1.ox = $game_screen.shake
  120.     # 设置画面的闪烁色
  121.     @viewport4.color = $game_screen.flash_color
  122.     # 刷新显示端口
  123.     @viewport1.update
  124.     @viewport2.update
  125.     @viewport4.update
  126.   end
  127. end
  128. class Arrow_Enemy < Arrow_Base
  129.   #--------------------------------------------------------------------------
  130.   # ● 获取光标指向的敌人
  131.   #--------------------------------------------------------------------------
  132.   def enemy
  133.     return $game_troop.enemies[@index]
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● 刷新画面
  137.   #--------------------------------------------------------------------------
  138.   def update
  139.     super
  140.     # 如果指向不存在的敌人就离开
  141.     $game_troop.enemies.size.times do
  142.       break if self.enemy.exist?
  143.       @index += 1
  144.       @index %= $game_troop.enemies.size
  145.     end
  146.     # 光标右
  147.     if Input.repeat?(Input::RIGHT)
  148.       $game_system.se_play($data_system.cursor_se)
  149.       $game_troop.enemies.size.times do
  150.         @index += 1
  151.         @index %= $game_troop.enemies.size
  152.         break if self.enemy.exist?
  153.       end
  154.     end
  155.     # 光标左
  156.     if Input.repeat?(Input::LEFT)
  157.       $game_system.se_play($data_system.cursor_se)
  158.       $game_troop.enemies.size.times do
  159.         @index += $game_troop.enemies.size - 1
  160.         @index %= $game_troop.enemies.size
  161.         break if self.enemy.exist?
  162.       end
  163.     end
  164.     # 设置活动块坐标
  165.     if self.enemy != nil
  166.       self.x = self.enemy.screen_x + self.ox
  167.       self.y = self.enemy.screen_y + self.oy
  168.     end
  169.   end
  170. end
  171. class Arrow_Actor < Arrow_Base
  172.   #--------------------------------------------------------------------------
  173.   # ● 获取光标指向的角色
  174.   #--------------------------------------------------------------------------
  175.   def actor
  176.     return $game_party.actors[@index]
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ● 刷新画面
  180.   #--------------------------------------------------------------------------
  181.   def update
  182.     super
  183.     # 光标右
  184.     if Input.repeat?(Input::RIGHT)
  185.       $game_system.se_play($data_system.cursor_se)
  186.       @index += 1
  187.       @index %= $game_party.actors.size
  188.     end
  189.     # 光标左
  190.     if Input.repeat?(Input::LEFT)
  191.       $game_system.se_play($data_system.cursor_se)
  192.       @index += $game_party.actors.size - 1
  193.       @index %= $game_party.actors.size
  194.     end
  195.     # 设置活动块坐标
  196.     if self.actor != nil
  197.       self.x = self.actor.screen_x + self.ox
  198.       self.y = self.actor.screen_y + self.oy
  199.     end
  200.   end
  201. end
  202. class Scene_Battle
  203.   #--------------------------------------------------------------------------
  204.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  205.   #--------------------------------------------------------------------------
  206.   def update_phase4_step3
  207.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  208.     if @animation1_id == 0
  209.       @active_battler.white_flash = true
  210.     else
  211.       @active_battler.animation_id = @animation1_id
  212.       @active_battler.animation_hit = true
  213.     end
  214.     # 对像方动画
  215.     for target in @target_battlers
  216.       target.animation_id = @animation2_id
  217.       target.animation_hit = (target.damage != "Miss")
  218.       #.......................................................................
  219.       if target.is_a?(Game_Actor)
  220.         if target.current_action.kind == 0 and target.current_action.basic == 1
  221.           target.setup_battler_ani(target.battler_name.split(/★/)[2])
  222.         else
  223.           target.setup_battler_hurt_ani(0)
  224.         end
  225.       end
  226.       if target.is_a?(Game_Enemy)
  227.         if target.current_action.kind == 0 and target.current_action.basic == 1
  228.           target.setup_battler_ani(target.battler_name.split(/★/)[1])
  229.         else
  230.           target.setup_battler_hurt_ani(0)
  231.         end
  232.       end
  233.       #.......................................................................
  234.     end
  235.     # 对像方动画
  236.     for target in @target_battlers
  237.       target.animation_id = @animation2_id
  238.       target.animation_hit = (target.damage != "Miss")
  239.       #......................................................................
  240.     end
  241.     # 限制动画长度、最低 8 帧
  242.     @wait_count = 8
  243.     # 移至步骤 5
  244.     @phase4_step = 5
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 刷新画面 (主回合步骤 4 : 对像方动画) ★
  248.   #--------------------------------------------------------------------------
  249.   def update_phase4_step4
  250.     # 限制动画长度、最低 8 帧
  251.     @wait_count = 8
  252.     # 移至步骤 5
  253.     @phase4_step = 5
  254.   end
  255. end

  256. class Scene_Battle
  257.   #..........................................................................
  258.   #--------------------------------------------------------------------------
  259.   # ● 返回phase
  260.   #--------------------------------------------------------------------------
  261.   def phase
  262.     return @phase
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● 返回phase4_step
  266.   #--------------------------------------------------------------------------
  267.   def phase4_step
  268.     return @phase4_step
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● 返回phase4_step
  272.   #--------------------------------------------------------------------------
  273.   def actor_command_active?
  274.     return @actor_command_window.active
  275.   end
  276.   #..........................................................................
  277. end
  278. class Game_Battler
  279.   #..........................................................................
  280.   #--------------------------------------------------------------------------
  281.   # ● 获取循环的动画 ID
  282.   #--------------------------------------------------------------------------  
  283.   def show_damage(value)
  284.     @show_damage_value = value
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ● 获取循环的动画 ID
  288.   #--------------------------------------------------------------------------
  289.   def show_damage_value
  290.     return @show_damage_value
  291.   end
  292.   #--------------------------------------------------------------------------
  293.   # ● 获取循环的动画 ID
  294.   #--------------------------------------------------------------------------
  295.   def battler_ani
  296.     return @battler_ani
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● 获取循环的动画 ID
  300.   #--------------------------------------------------------------------------
  301.   def setup_battler_ani(battler_ani, once = 0)
  302.     @battler_ani = battler_ani
  303.     @once = once
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ● 获取循环的动画 ID
  307.   #--------------------------------------------------------------------------
  308.   def setup_battler_hurt_ani(hurt)
  309.     @hurt = hurt
  310.   end  
  311.   #--------------------------------------------------------------------------
  312.   # ● 获取循环的动画 ID
  313.   #--------------------------------------------------------------------------
  314.   def setup_battler_dead_ani(over)
  315.     @over = over
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 获取循环的动画 ID
  319.   #--------------------------------------------------------------------------
  320.   def battler_dead_ani
  321.     return @over
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● 获取循环的动画 ID
  325.   #--------------------------------------------------------------------------
  326.   def battler_ani_once
  327.     return @once
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● 获取循环的动画 ID
  331.   #--------------------------------------------------------------------------
  332.   def battler_hurt_ani
  333.     return @hurt
  334.   end
  335.   #..........................................................................
  336. end
  337. class Sprite_Battler < RPG::Sprite
  338.   #..........................................................................
  339.   #--------------------------------------------------------------------------
  340.   # ● 胜利图
  341.   #--------------------------------------------------------------------------
  342.   def win
  343.     if @battler_name != nil and not @battler.hidden and not @battler.dead?
  344.       @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1)
  345.     end
  346.   end
  347.   #..........................................................................
  348.   #--------------------------------------------------------------------------
  349.   # ● 释放
  350.   #--------------------------------------------------------------------------
  351.   def dispose
  352.     if self.bitmap != nil
  353.       self.bitmap.dispose
  354.     end
  355.     super
  356.   end
  357.   #--------------------------------------------------------------------------
  358.   # ● 刷新画面
  359.   #--------------------------------------------------------------------------
  360.   def update
  361.     super
  362.     # 战斗者为 nil 的情况下
  363.     if @battler == nil
  364.       self.bitmap = nil
  365.       loop_animation(nil)
  366.       return
  367.     end
  368.     # 文件名和色相与当前情况有差异的情况下
  369.     if @battler.battler_name != @battler_name or
  370.        @battler.battler_hue != @battler_hue
  371.       @battler_hue = @battler.battler_hue
  372.       # 获取、设置位图
  373.       @battler_name = @battler.battler_name
  374.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  375.       #.......................................................................
  376.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  377.       #.......................................................................
  378.       @width = bitmap.width
  379.       @height = bitmap.height
  380.       self.ox = @width / 2
  381.       self.oy = @height
  382.       # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  383.       if @battler.is_a?(Game_Enemy)
  384.         if @battler.dead? or @battler.hidden
  385.           self.opacity = 0
  386.         end
  387.       end
  388.     end
  389.     # 动画 ID 与当前的情况有差异的情况下
  390.     #.........................................................................
  391.     if @battler.battler_ani != @battler_ani
  392.       @battler_ani = @battler.battler_ani
  393.       loop_animation($data_animations[@battler_ani.to_i])
  394.     end
  395.     #.........................................................................
  396.     # 应该被显示的角色的情况下
  397.     if @battler.is_a?(Game_Actor) and @battler_visible
  398.       # 不是主状态的时候稍稍降低点透明度
  399.       if $game_temp.battle_main_phase
  400.         self.opacity += 3 if self.opacity < 255
  401.       else
  402.         self.opacity -= 3 if self.opacity > 207
  403.       end
  404.     end
  405.     # 明灭
  406.     if @battler.blink
  407.       blink_on
  408.     else
  409.       blink_off
  410.     end
  411.     # 不可见的情况下
  412.     unless @battler_visible
  413.       # 出现 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  414.       if not @battler.hidden and not @battler.dead? and
  415.          (@battler.damage == nil or @battler.damage_pop)
  416.         if @battler.is_a?(Game_Enemy)
  417.           appear
  418.         else
  419.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  420.         end
  421.         @battler_visible = true
  422.       end
  423.     end
  424.     # 可见的情况下
  425.     if @battler_visible
  426.       # 逃跑
  427.       if @battler.hidden
  428.         $game_system.se_play($data_system.escape_se)
  429.         escape
  430.         @battler_visible = false
  431.       end
  432.       # 白色闪烁
  433.       if @battler.white_flash
  434.         whiten
  435.         @battler.white_flash = false
  436.       end
  437.       # 动画
  438.       if @battler.animation_id != 0
  439.         animation = $data_animations[@battler.animation_id]
  440.         animation(animation, @battler.animation_hit)
  441.         @battler.animation_id = 0
  442.       end
  443.       # 伤害
  444.       if @battler.damage_pop
  445.         damage(@battler.damage, @battler.critical)
  446.         @battler.damage = nil
  447.         @battler.critical = false
  448.         @battler.damage_pop = false
  449.       end
  450.       # korapusu
  451.       if @battler.damage == nil and @battler.dead?
  452.         #....................................................................
  453.         if @battler.is_a?(Game_Enemy)
  454.           $game_system.se_play($data_system.enemy_collapse_se)
  455.           #collapse
  456.         else
  457.           $game_system.se_play($data_system.actor_collapse_se)
  458.         end
  459.         #....................................................................
  460.         @battler_visible = false
  461.       end
  462.     end
  463.     # 设置活动块的坐标
  464.     self.x = @battler.screen_x
  465.     self.y = @battler.screen_y
  466.     self.z = @battler.screen_z
  467.   end
  468. end

  469. module RPG
  470. #--------------------------------------------------------------------------
  471. # ● 常量设定
  472. #--------------------------------------------------------------------------
  473. # 是否显示总伤害
  474. SHOW_TOTAL_DAMAGE = true
  475. # 角色受攻击时是否跳一下
  476. BATTLER_JUMP = true

  477. class Sprite < ::Sprite
  478.    #==========================================
  479.    # 修改说明:
  480.    # @flash_shake用来制作挨打时候跳跃
  481.    # @_damage    用来记录每次打击之后弹出数字
  482.    # @_total_damage 记录总伤害
  483.    # @_total_damage_duration 总伤害持续帧
  484.    #==========================================
  485.    #alias 66RPG_rainbow_initialize : initialize
  486.    def initialize(viewport = nil)
  487.      #66RPG_rainbow_initialize(viewport)
  488.      super(viewport)
  489.      @_whiten_duration = 0
  490.      @_appear_duration = 0
  491.      @_escape_duration = 0
  492.      @_collapse_duration = 0
  493.      @_damage_duration = 0
  494.      @_animation_duration = 0
  495.      @_blink = false
  496.      # 挨打时候跳跃
  497.      @flash_shake = 0
  498.      # 伤害记录数组
  499.      @_damage = []
  500.      # 总伤害数字
  501.      @_total_damage = 0
  502.      # 总伤害持续帧
  503.      @_total_damage_duration = 0
  504.      #.........................................................................
  505.      @hits = 0
  506.      #.........................................................................
  507.    end
  508.    def damage(value, critical)
  509.      #.........................................................................
  510.      #清除hit数
  511.      dispose_hit
  512.      #.........................................................................
  513.      if value.is_a?(Numeric)
  514.        damage_string = value.abs.to_s
  515.      else
  516.        damage_string = value.to_s
  517.      end
  518.      bitmap = Bitmap.new(160, 48)
  519.      bitmap.font.name = "黑体"
  520.      bitmap.font.size = 24
  521.      bitmap.font.color.set(0, 0, 0)
  522.      bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  523.      bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  524.      bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  525.      bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  526.      #=======================================
  527.      # 修改:颜色
  528.      #=======================================
  529.      if value.is_a?(Numeric) and value < 0
  530.        bitmap.font.color.set(176, 255, 144)
  531.      else
  532.        bitmap.font.color.set(255, 55, 55)
  533.      end
  534.      bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  535.      if critical
  536.        bitmap.font.size = 20
  537.        bitmap.font.color.set(0, 0, 0)
  538.        bitmap.draw_text(-1, -1, 160, 20, "暴击", 1)
  539.        bitmap.draw_text(+1, -1, 160, 20, "暴击", 1)
  540.        bitmap.draw_text(-1, +1, 160, 20, "暴击", 1)
  541.        bitmap.draw_text(+1, +1, 160, 20, "暴击", 1)
  542.        bitmap.font.color.set(255, 255, 255)
  543.        bitmap.draw_text(0, 0, 160, 20, "暴击", 1)
  544.      end
  545.      @_damage_sprite = ::Sprite.new#(self.viewport)
  546.      @_damage_sprite.bitmap = bitmap
  547.      @_damage_sprite.ox = 80
  548.      @_damage_sprite.oy = 20
  549.      @_damage_sprite.x = self.x
  550.      @_damage_sprite.y = self.y - self.oy / 2
  551.      @_damage_sprite.z = 3000
  552.      @_damage_duration = 40
  553.      #=======================================
  554.      # 修改:推入新的伤害
  555.      #=======================================
  556.      @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  557.      # 总伤害处理
  558.      make_total_damage(value)
  559.    end
  560.    #--------------------------------------------------------------------------
  561.    # ● 返回 @hits
  562.    #--------------------------------------------------------------------------
  563.    def get_hit
  564.      return @hits
  565.    end
  566.    #--------------------------------------------------------------------------
  567.    # ● hit数的美化描绘
  568.    #--------------------------------------------------------------------------
  569.    #..........................................................................
  570.    def hit
  571.      # 如果伤害值是数值
  572.      # 转为字符串
  573.      value=@hits
  574.      hits_string = value.to_s
  575.      # 初始化位图
  576.      bitmap = Bitmap.new(320, 64)
  577.      bitmap.font.name = "黑体"
  578.      bitmap.font.size = 32
  579.      # 分割伤害值字符串
  580.      hits_array = hits_string.scan(/./)
  581.      hits_x = - 36.2#hits_string.size * 18.1 # 81 - hits_string.size * 18.1
  582.      rect_y = 0
  583.      # 循环伤害值字符串
  584.      for char in hits_array
  585.        # 后移一位
  586.        hits_x += 36.2
  587.        number = char.to_i
  588.        # 显示伤害数字
  589.        bitmap.blt(hits_x, 0, RPG::Cache.picture("Number"),
  590.        Rect.new(number * 36.2, rect_y, 36.2, 50))
  591.      end
  592.      hits_x += 18.1
  593.      bitmap.blt(hits_x, 0, RPG::Cache.picture("HITS"),
  594.                 Rect.new(0, -21, 90, 50))
  595.      # 伤害值定位
  596.      @_hits_sprite = ::Sprite.new(self.viewport)
  597.      @_hits_sprite.bitmap = bitmap
  598.      @_hits_sprite.x = 560 - hits_string.size * 36.2
  599.      @_hits_sprite.y = 70
  600.      @_hits_sprite.z = 3000
  601.      @_hits_duration = 40
  602.    end
  603.    #..........................................................................
  604.    #--------------------------------------------------------------------------
  605.    # ● 总伤害处理
  606.    #--------------------------------------------------------------------------
  607.    def make_total_damage(value)
  608.      if value.is_a?(Numeric) and SHOW_TOTAL_DAMAGE
  609.        @_total_damage += value
  610.      else
  611.        return
  612.      end
  613.      bitmap = Bitmap.new(300, 150)
  614.      bitmap.font.name = "黑体"
  615.      bitmap.font.size = 28
  616.      bitmap.font.color.set(0, 0, 0)
  617.      bitmap.draw_text(+2, 12+2, 160, 36, @_total_damage.abs.to_s, 1)
  618.      if @_total_damage < 0
  619.        bitmap.font.color.set(80, 255, 00)
  620.      else
  621.        bitmap.font.color.set(255, 140, 0)
  622.      end
  623.      bitmap.draw_text(0, 12, 160, 36, @_total_damage.abs.to_s, 1)
  624.      if @_total_damage_sprite.nil?
  625.        @_total_damage_sprite = ::Sprite.new#(self.viewport)
  626.        @_total_damage_sprite.ox = 80
  627.        @_total_damage_sprite.oy = 20
  628.        @_total_damage_sprite.z = 3000
  629.      end
  630.      @_total_damage_sprite.bitmap = bitmap
  631.      @_total_damage_sprite.zoom_x = 1.5
  632.      @_total_damage_sprite.zoom_y = 1.5
  633.      @_total_damage_sprite.x = self.x
  634.      @_total_damage_sprite.y = self.y  - self.oy / 2 - 64
  635.      @_total_damage_sprite.z = 3001
  636.      #.........................................................................
  637.      @_total_damage_duration = 40
  638.      #.........................................................................
  639.      #.........................................................................
  640.      #hit数描绘
  641.      @hits+=1
  642.      hit
  643.      #.........................................................................
  644.    end
  645.    def animation(animation, hit, battler_damage="", battler_critical=false)
  646.      dispose_animation      
  647.      #=======================================
  648.      # 修改:记录伤害和critical
  649.      #=======================================
  650.      @battler_damage = battler_damage
  651.      @battler_critical = battler_critical
  652.      @_animation = animation
  653.      return if @_animation == nil
  654.      @_animation_hit = hit
  655.      @_animation_duration = @_animation.frame_max
  656.      animation_name = @_animation.animation_name
  657.      animation_hue = @_animation.animation_hue
  658.      bitmap = RPG::Cache.animation(animation_name, animation_hue)
  659.      #=======================================
  660.      # 修改:计算总闪光权限值
  661.      #=======================================
  662.      for timing in @_animation.timings
  663.        quanzhong = animation_process_timing(timing, @_animation_hit,true)
  664.        @all_quanzhong += quanzhong
  665.        # 记录最后一次闪光
  666.        @_last_frame = timing.frame if quanzhong != 0
  667.      end
  668.      #.........................................................................
  669.      @last_frame = @_last_frame
  670.      #.........................................................................
  671.      if @@_reference_count.include?(bitmap)
  672.        @@_reference_count[bitmap] += 1
  673.      else
  674.        @@_reference_count[bitmap] = 1
  675.      end
  676.      #=======================================
  677.      # 修改:行动方动画不显示伤害
  678.      #=======================================
  679.      if $scene.is_a?(Scene_Battle)
  680.        if $scene.animation1_id == @battler.animation_id
  681.          @battler_damage = ""
  682.        end
  683.      end
  684.      @_animation_sprites = []
  685.      if @_animation.position != 3 or not @@_animations.include?(animation)
  686.        for i in 0..15
  687.          sprite = ::Sprite.new(self.viewport)
  688.          sprite.bitmap = bitmap
  689.          sprite.visible = false
  690.          @_animation_sprites.push(sprite)
  691.        end
  692.        unless @@_animations.include?(animation)
  693.          @@_animations.push(animation)
  694.        end
  695.      end
  696.      update_animation
  697.    end
  698.    #=======================================
  699.    # 修改:更换清除伤害的算法,以防万一
  700.    #       本内容在脚本中没有使用过
  701.    #=======================================
  702.    def dispose_damage
  703.      for damage in @_damage.reverse
  704.        damage[0].bitmap.dispose
  705.        damage[0].dispose
  706.        @_damage.delete(damage)
  707.      end
  708.      @_total_damage = 0
  709.      @_last_frame = -1
  710.      if @_total_damage_sprite != nil
  711.        @_total_damage_duration = 0
  712.        @_total_damage_sprite.bitmap.dispose
  713.        @_total_damage_sprite.dispose
  714.        @_total_damage_sprite = nil
  715.      end
  716.    end
  717.    #=======================================
  718.    # 清除hit数
  719.    #=======================================
  720.    #...........................................................................
  721.    def dispose_hit
  722.      if @_hits_sprite != nil
  723.        @_hits_sprite.bitmap.dispose
  724.        @_hits_sprite.dispose
  725.        @_hits_sprite = nil
  726.      end
  727.    end
  728.    #...........................................................................
  729.    def dispose_animation
  730.      #=======================================
  731.      # 修改:清除记录的伤害,清除权重记录
  732.      #=======================================
  733.      @battler_damage = nil
  734.      @battler_critical = nil
  735.      @all_quanzhong = 1
  736.      @_total_damage = 0
  737.      @_last_frame = -1
  738.      #.........................................................................
  739.      @hits = 0
  740.      #.........................................................................
  741.      if @_animation_sprites != nil
  742.        sprite = @_animation_sprites[0]
  743.        if sprite != nil
  744.          @@_reference_count[sprite.bitmap] -= 1
  745.          if @@_reference_count[sprite.bitmap] == 0
  746.            sprite.bitmap.dispose
  747.          end
  748.        end
  749.        for sprite in @_animation_sprites
  750.          sprite.dispose
  751.        end
  752.        @_animation_sprites = nil
  753.        @_animation = nil
  754.      end
  755.    end
  756.    def update
  757.      super
  758.      if @_whiten_duration > 0
  759.        @_whiten_duration -= 1
  760.        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  761.      end
  762.      if @_appear_duration > 0
  763.        @_appear_duration -= 1
  764.        self.opacity = (16 - @_appear_duration) * 16
  765.      end
  766.      if @_escape_duration > 0
  767.        @_escape_duration -= 1
  768.        self.opacity = 256 - (32 - @_escape_duration) * 10
  769.      end
  770.      if @_collapse_duration > 0
  771.        @_collapse_duration -= 1
  772.        self.opacity = 256 - (48 - @_collapse_duration) * 6
  773.      end
  774.      #=======================================
  775.      # 修改:更新算法,更新弹出
  776.      #=======================================
  777.      if @_damage_duration > 0
  778.        @_damage_duration -= 1
  779.        for damage in @_damage
  780.          damage[0].x = self.x + self.viewport.rect.x -
  781.                        self.ox + self.src_rect.width / 2 +
  782.                        (40 - damage[1]) * damage[3] / 10
  783.          damage[0].y -= damage[4]+damage[1]/10
  784.          damage[0].opacity = damage[1]*20
  785.          damage[1] -= 1
  786.          if damage[1]==0
  787.            damage[0].bitmap.dispose
  788.            damage[0].dispose
  789.            @_damage.delete(damage)
  790.            next
  791.          end
  792.        end
  793.      end
  794.      #=======================================
  795.      # 添加:弹出总伤害
  796.      #=======================================
  797.      if @_total_damage_duration > 0
  798.        @_total_damage_duration -= 1
  799.        @_total_damage_sprite.y -= 1 if @_total_damage_duration % 2 == 0
  800.        if @_total_damage_sprite.zoom_x > 1.0
  801.          @_total_damage_sprite.zoom_x -= 0.05
  802.        end
  803.        if @_total_damage_sprite.zoom_y > 1.0
  804.          @_total_damage_sprite.zoom_y -= 0.05
  805.        end
  806.        @_total_damage_sprite.opacity = 256 - (24 - @_total_damage_duration) * 16
  807.        #......................................................................
  808.        if @_total_damage_duration <= 7 and @_total_damage_duration > 0
  809.          @_hits_sprite.opacity -= 32
  810.          @_hits_sprite.x += 1
  811.        end
  812.        #......................................................................
  813.        if @_total_damage_duration <= 0
  814.          #.....................................................................
  815.          dispose_hit
  816.          #.....................................................................
  817.          @_total_damage = 0
  818.          @_total_damage_duration = 0
  819.          @_total_damage_sprite.bitmap.dispose
  820.          @_total_damage_sprite.dispose
  821.          @_total_damage_sprite = nil
  822.        end
  823.      end
  824.      #=======================================
  825.      if @_animation != nil and (Graphics.frame_count % 2 == 0)
  826.        @_animation_duration -= 1
  827.        update_animation
  828.      end
  829.      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  830.        update_loop_animation
  831.        @_loop_animation_index += 1
  832.        #......................................................................
  833.        @loop_animation_once = 0
  834.        @loop_animation_once = 1 if @once == 1 and @_loop_animation_index == @_loop_animation.frame_max
  835.        #......................................................................
  836.        @_loop_animation_index %= @_loop_animation.frame_max
  837.      end
  838.      if @_blink
  839.        @_blink_count = (@_blink_count + 1) % 32
  840.        if @_blink_count < 16
  841.          alpha = (16 - @_blink_count) * 6
  842.        else
  843.          alpha = (@_blink_count - 16) * 6
  844.        end
  845.        self.color.set(255, 255, 255, alpha)
  846.      end
  847.      @@_animations.clear
  848.    end
  849.    #..........................................................................
  850.    def loop_animation_once
  851.      return @_loop_animation_once
  852.    end
  853.    #..........................................................................
  854.    def update_animation
  855.      if @_animation_duration > 0
  856.        frame_index = @_animation.frame_max - @_animation_duration
  857.        @frame_index = frame_index
  858.        cell_data = @_animation.frames[frame_index].cell_data
  859.        position = @_animation.position
  860.        animation_set_sprites(@_animation_sprites, cell_data, position)
  861.        #=======================================
  862.        # 修改:弹出伤害,权重计算
  863.        #=======================================
  864.        for timing in @_animation.timings
  865.          if timing.frame == frame_index
  866.            t = 1.0 * animation_process_timing(timing, @_animation_hit)            
  867.            #p t,"当前权重", @all_quanzhong,"总权重"
  868.            if @battler_damage.is_a?(Numeric) and t != 0
  869.              t *= @battler_damage
  870.              t /= @all_quanzhong
  871.              #p t,"当前伤害",@battler_damage,"总伤害"
  872.              t = t.to_i
  873.              # 最后一次闪光的话,伤害修正
  874.              if frame_index == @_last_frame
  875.                @_total_damage = @battler_damage - t
  876.              end
  877.              #p t,@battler_damage,@all_quanzhong
  878.              damage(t,@battler_critical)
  879.            # 防止重复播放miss
  880.            elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
  881.              damage(@battler_damage,@battler_critical)
  882.            end
  883.          end
  884.        end
  885.      else
  886.        dispose_animation
  887.      end
  888.    end
  889.    #=======================================
  890.    # 修改:敌人跳跃的功能 + 添加返回数值
  891.    #=======================================
  892.    def update_loop_animation
  893.      frame_index = @_loop_animation_index
  894.      cell_data = @_loop_animation.frames[frame_index].cell_data
  895.      position = @_loop_animation.position
  896.      #·改·
  897.      if @wait_count.to_i <= 0
  898.        @wait_count = 0
  899.        animation_set_sprites(@_loop_animation_sprites, cell_data, position)
  900.      else
  901.        @wait_count -= 1
  902.        for sprite in @_loop_animation_sprites
  903.          sprite.visible = false
  904.        end
  905.      end
  906.      if @wait_flash.to_i <= 0
  907.        @wait_flash = 0
  908.      else
  909.        @wait_flash -= 1
  910.        for sprite in @_loop_animation_sprites
  911.          sprite.blend_type = 1
  912.        end
  913.      end
  914.      #·改·
  915.      for timing in @_loop_animation.timings
  916.        if timing.frame == frame_index
  917.          animation_process_timing(timing, true)
  918.        end
  919.      end
  920.    end
  921.    #=======================================
  922.    # 修改:敌人跳跃的功能 + 添加返回数值
  923.    #=======================================
  924.    def loop_animation(animation)
  925.      return if animation == @_loop_animation
  926.      dispose_loop_animation
  927.      @_loop_animation = animation
  928.      return if @_loop_animation == nil
  929.      @_loop_animation_index = 0
  930.      animation_name = @_loop_animation.animation_name
  931.      animation_hue = @_loop_animation.animation_hue
  932.      bitmap = RPG::Cache.animation(animation_name, animation_hue)
  933.      if @@_reference_count.include?(bitmap)
  934.        @@_reference_count[bitmap] += 1
  935.      else
  936.        @@_reference_count[bitmap] = 1
  937.      end
  938.      @_loop_animation_sprites = []
  939.      for i in 0..15
  940.        sprite = ::Sprite.new
  941.        sprite.bitmap = bitmap
  942.        sprite.visible = false
  943.        @_loop_animation_sprites.push(sprite)
  944.      end
  945.      update_loop_animation
  946.    end
  947.    #=======================================
  948.    # 修改:敌人跳跃的功能 + 添加返回数值
  949.    #=======================================
  950.     def animation_process_timing(timing, hit,dontflash=false)
  951.       if (timing.condition == 0) or
  952.          (timing.condition == 1 and hit == true) or
  953.          (timing.condition == 2 and hit == false)
  954.         unless dontflash
  955.           if timing.se.name != ""
  956.             se = timing.se
  957.             Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
  958.           end
  959.         end
  960.         case timing.flash_scope
  961.         when 1
  962.           unless dontflash
  963.             self.flash(timing.flash_color, timing.flash_duration * 2)
  964.             #....................................................................
  965.             @wait_flash = timing.flash_duration
  966.             #....................................................................
  967.             if @_total_damage >0
  968.               @flash_shake_switch = true
  969.               @flash_shake = 10
  970.             end
  971.           end
  972.           return timing.flash_color.alpha * timing.flash_duration
  973.         when 2
  974.           unless dontflash
  975.             if self.viewport != nil
  976.               self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
  977.               return timing.flash_color.alpha * timing.flash_duration
  978.             end
  979.           end
  980.         when 3
  981.           unless dontflash
  982.             self.flash(nil, timing.flash_duration * 2)
  983.             #@_loop_animation_count = 1
  984.             #·改·
  985.             @wait_count = timing.flash_duration
  986.             #·改·
  987.           end
  988.           return timing.flash_color.alpha * timing.flash_duration
  989.         end
  990.       end      
  991.       return 0
  992.     end   
  993. end
  994. end
  995. #==============================================================================
  996. # ■ Sprite_Battler
  997. #==============================================================================
  998. class Sprite_Battler < RPG::Sprite
  999. #--------------------------------------------------------------------------
  1000. # ● 初始化对像
  1001. #    添加跳跃记录
  1002. #--------------------------------------------------------------------------
  1003. def initialize(viewport, battler = nil)
  1004.   super(viewport)
  1005.   @battler = battler
  1006.   @battler_visible = false
  1007.   @flash_shake_switch = true
  1008.   #........................................................................
  1009.   @once = 0
  1010.   @frame_index = -1
  1011.   @last_frame = 0
  1012.   #........................................................................
  1013. end
  1014. #--------------------------------------------------------------------------
  1015. # ● 刷新画面
  1016. #    增添跳跃功能
  1017. #--------------------------------------------------------------------------
  1018. def update
  1019.   super
  1020.   # 战斗者为 nil 的情况下
  1021.   if @battler == nil
  1022.     self.bitmap = nil
  1023.     loop_animation(nil)
  1024.     return
  1025.   end
  1026.   # 文件名和色相与当前情况有差异的情况下
  1027.   if @battler.battler_name != @battler_name or
  1028.      @battler.battler_hue != @battler_hue
  1029.     # 获取、设置位图
  1030.     @battler_name = @battler.battler_name
  1031.     @battler_hue = @battler.battler_hue
  1032.     self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1033.     #.......................................................................
  1034.     if not @battler.hidden and not @battler.dead?
  1035.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1036.     end
  1037.     #.......................................................................
  1038.     @width = bitmap.width
  1039.     @height = bitmap.height
  1040.     self.ox = @width / 2
  1041.     self.oy = @height
  1042.   end
  1043.   #.......................................................................
  1044.   update_actor_animation
  1045.   update_enemy_animation
  1046.   #.......................................................................
  1047.   # 动画 ID 与当前的情况有差异的情况下
  1048.   #.........................................................................
  1049.   if @battler.is_a?(Game_Enemy)
  1050.     if @once == 1 and @loop_animation_once == 1 and
  1051.        @battler.battler_dead_ani == 1
  1052.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1053.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1054.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1055.     end
  1056.   end
  1057.   if @battler.is_a?(Game_Actor)
  1058.     if @once == 1 and @loop_animation_once == 1 and $scene.phase != 5 and
  1059.        @battler.battler_dead_ani == 1
  1060.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
  1061.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
  1062.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1063.     elsif @once == 1 and @loop_animation_once == 1 and $scene.phase == 5 and
  1064.           not @battler.dead?
  1065.       @battler.setup_battler_ani(@battler.battler_name.split(/★/)[7])
  1066.     end
  1067.   end
  1068.   if @battler.battler_ani != @battler_ani
  1069.     @battler_ani = @battler.battler_ani
  1070.     @once = @battler.battler_ani_once
  1071.     loop_animation($data_animations[@battler_ani.to_i])
  1072.   end
  1073.   #.........................................................................
  1074.   # 应该被显示的角色的情况下
  1075.   if @battler.is_a?(Game_Actor) and @battler_visible
  1076.     # 不是主状态的时候稍稍降低点透明度
  1077.     if $game_temp.battle_main_phase
  1078.       self.opacity += 3 if self.opacity < 255
  1079.     else
  1080.       self.opacity -= 3 if self.opacity > 207
  1081.     end
  1082.   end
  1083.   # 明灭
  1084.   if @battler.blink
  1085.     blink_on
  1086.   else
  1087.     blink_off
  1088.   end
  1089.   # 不可见的情况下
  1090.   unless @battler_visible
  1091.     # 出现
  1092.     if not @battler.hidden and not @battler.dead? and
  1093.        (@battler.damage == nil or @battler.damage_pop)
  1094.       #.......................................................................
  1095.       if @battler.is_a?(Game_Enemy)
  1096.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1097.         #appear
  1098.       else
  1099.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
  1100.       end
  1101.       #.......................................................................
  1102.       @battler_visible = true
  1103.     end
  1104.   end
  1105.   # 可见的情况下
  1106.   if @battler_visible
  1107.     # 逃跑
  1108.     if @battler.hidden
  1109.       $game_system.se_play($data_system.escape_se)
  1110.       escape
  1111.       @battler_visible = false
  1112.     end
  1113.     # 白色闪烁
  1114.     if @battler.white_flash
  1115.       whiten
  1116.       @battler.white_flash = false
  1117.     end
  1118.     # 动画
  1119.     if @battler.animation_id != 0
  1120.       animation = $data_animations[@battler.animation_id]
  1121.       animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  1122.       @battler.animation_id = 0
  1123.     end
  1124.     # 伤害
  1125.     if @battler.damage_pop
  1126.       @battler.damage = nil
  1127.       @battler.critical = false
  1128.       @battler.damage_pop = false
  1129.     end
  1130.     # korapusu
  1131.     if @battler.damage == nil and @battler.dead?
  1132.       if @battler.is_a?(Game_Enemy)
  1133.         if @battler.battler_dead_ani != 1
  1134.           #p "Battler Death Error"
  1135.           $game_system.se_play($data_system.enemy_collapse_se)
  1136.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1137.           @battler.setup_battler_dead_ani(1)
  1138.         end
  1139.         #.....................................................................
  1140.         collapse
  1141.         #.....................................................................
  1142.       else
  1143.         #.....................................................................
  1144.         if @battler.battler_dead_ani != 1
  1145.           #p "Battler Death Error"
  1146.           $game_system.se_play($data_system.enemy_collapse_se)
  1147.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1148.           @battler.setup_battler_dead_ani(1)
  1149.         end
  1150.         #.....................................................................
  1151.       end
  1152.       @battler_visible = false
  1153.     end
  1154.   end
  1155.   # 设置活动块的坐标
  1156.   if @flash_shake_switch == true
  1157.     self.x = @battler.screen_x
  1158.     self.y = @battler.screen_y
  1159.     self.z = @battler.screen_z
  1160.     @flash_shake_switch = false
  1161.   end
  1162.   if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
  1163.     if @battler.is_a?(Game_Enemy)
  1164.       case @flash_shake
  1165.       when 9..10
  1166.         self.x -=4
  1167.         self.y -=4
  1168.         self.z = @battler.screen_z
  1169.       when 6..8
  1170.         self.x -=2
  1171.         self.y -=2
  1172.         self.z = @battler.screen_z
  1173.       when 3..5
  1174.         self.x +=2
  1175.         self.y +=2
  1176.         self.z = @battler.screen_z
  1177.       when 1..2
  1178.         self.x +=4
  1179.         self.y +=4
  1180.         self.z = @battler.screen_z
  1181.       end
  1182.     end
  1183.     if @battler.is_a?(Game_Actor)
  1184.       case @flash_shake
  1185.       when 9..10
  1186.         self.x +=4
  1187.         self.y +=4
  1188.         self.z = @battler.screen_z
  1189.       when 6..8
  1190.         self.x +=2
  1191.         self.y +=2
  1192.         self.z = @battler.screen_z
  1193.       when 3..5
  1194.         self.x -=2
  1195.         self.y -=2
  1196.         self.z = @battler.screen_z
  1197.       when 1..2
  1198.         self.x -=4
  1199.         self.y -=4
  1200.         self.z = @battler.screen_z
  1201.       end
  1202.     end
  1203.     @flash_shake -= 1
  1204.   end
  1205. end
  1206. end

  1207. #==============================================================================
  1208. # ■ Scene_Battle
  1209. #------------------------------------------------------------------------------
  1210. #  处理战斗画面的类。
  1211. #==============================================================================

  1212. class Scene_Battle
  1213. #--------------------------------------------------------------------------
  1214. # ● 定义实例变量
  1215. #--------------------------------------------------------------------------
  1216. attr_reader   :animation1_id                    # 行动方动画ID
  1217. end
  1218. class Sprite_Battler < RPG::Sprite
  1219.   #--------------------------------------------------------------------------
  1220.   # ● 处理角色动作
  1221.   #--------------------------------------------------------------------------
  1222.   def update_actor_animation
  1223.     if @battler.is_a?(Game_Actor)
  1224.       if @battler.show_damage_value != nil
  1225.         self.damage(@battler.show_damage_value, false)
  1226.         @battler.show_damage(nil)
  1227.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1228.         @battler.setup_battler_hurt_ani(1)
  1229.       end
  1230.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
  1231.       else
  1232.         if @hits == 1 and not @battler.dead? and @battler.battler_hurt_ani != 1 and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1233.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1234.           @battler.setup_battler_hurt_ani(1)
  1235.         elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1236.           for actor in $game_party.actors
  1237.             if @battler != actor
  1238.               actor.add_state(6)
  1239.             end
  1240.           end
  1241.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1242.           @battler.setup_battler_dead_ani(1)
  1243.         end
  1244.       end
  1245.     end
  1246.   end
  1247.   #--------------------------------------------------------------------------
  1248.   # ● 处理敌人动作
  1249.   #--------------------------------------------------------------------------
  1250.   def update_enemy_animation
  1251.     if @battler.is_a?(Game_Enemy)
  1252.       if @battler.show_damage_value != nil
  1253.         self.damage(@battler.show_damage_value, false)
  1254.         @battler.show_damage(nil)
  1255.         @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1256.         @battler.setup_battler_hurt_ani(1)
  1257.       end
  1258.       if @battler.current_action.kind == 0 and @battler.current_action.basic == 1
  1259.       else
  1260.         if @hits == 1 and not @battler.dead? and @battler.battler_hurt_ani != 1 and @battler.damage.is_a?(Numeric) and @battler.damage > 0
  1261.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
  1262.           @battler.setup_battler_hurt_ani(1)
  1263.         elsif @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
  1264.           @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
  1265.           @battler.setup_battler_dead_ani(1)
  1266.           collapse
  1267.         end
  1268.       end
  1269.     end
  1270.   end
  1271. end
复制代码

博客:我的博客

Lv1.梦旅人

梦石
0
星屑
50
在线时间
226 小时
注册时间
2015-5-8
帖子
329
2
发表于 2015-5-18 16:55:16 | 只看该作者
本帖最后由 妖精蕾贝卡 于 2015-5-18 17:44 编辑

勝利動畫不顯示不是該腳本的問題。
而是沒有在戰鬥結束時執行顯示勝利動畫的動作。
試試在Scene_Battle 2的135行之後加入
  1. # 胜利动画
  2.     @spriteset.win
复制代码
試試效果。
@爆焰
防禦動作的話,這邊嘗試改了一下,暫時我沒辦法實現這功能。

点评

没关系,我自己试试。谢谢了  发表于 2015-5-18 20:48
行了,那关于防御的问题呢?  发表于 2015-5-18 17:16

评分

参与人数 1星屑 +300 收起 理由
hys111111 + 300 认可答案

查看全部评分

我是妖精蕾貝卡,沉默少言,孤獨自卑。完成了一個小遊戲,歡迎試玩。同時也歡迎試玩師傅的遊戲,謝謝。
現正在努力學習事件中,有不明白的地方請各位指教。

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-23 01:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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