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

Project1

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

[已经解决] 关于彩虹神剑和动态扣血的问题。。。

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1238
在线时间
354 小时
注册时间
2009-9-14
帖子
328
跳转到指定楼层
1
发表于 2015-8-2 17:43:09 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
6星屑
RUBY 代码复制
  1. =begin
  2. ==============================================================================
  3.  
  4. 彩虹神剑(伤害分段显示)显示总伤害版 v1.0d
  5.  
  6. ==============================================================================
  7.  
  8. 彩虹神剑 -柳柳
  9.  
  10. 6-20-2006 v1.0 -叶子
  11. 在彩虹神剑的基础上增加了显示总伤害的功能,而且总伤害的数字是弹出伤害时逐渐增加的
  12.  
  13. v1.0a -叶子
  14. 修正了显示伤害和实际伤害有差别的问题
  15. 修正了miss的情况下显示miss混乱的问题
  16. 修正了对己方技能重复显示伤害的问题
  17. 未修正播放目标动画第一帧时目标有时无端跳动的BUG
  18.  
  19. v1.0b -叶子
  20. 修改了总伤害数字的位置和z坐标
  21. 未修正播放目标动画第一帧时目标有时无端跳动的BUG
  22.  
  23. v1.0c -柳柳
  24. ? ? ?
  25.  
  26. v1.0d -柳柳
  27. 1.0d最终解决了那个闪光问题,还有最末帧伤害多次的算法
  28.  
  29. 7-24-2006 v1.0e -叶子
  30. 修正全屏幕闪烁弹出伤害错误的问题
  31. 修正连续伤害不会弹出伤害的问题
  32. 仍然未修正播放目标动画第一帧时目标有时无端跳动的BUG
  33.  
  34. 我鼓起很大勇气才敢动偶像们的脚本的,不知道会不会出问题啊......  -cftx
  35. 修正了总伤害显示
  36. 增加了伤害美化和HIT数显示
  37. 修正了两次音效
  38.  
  39. ==============================================================================
  40. =end
  41. # 核心的说明:
  42. # damage_pop 不再附带damage()的功能,这个放到animation里面去了
  43.  
  44. module RPG
  45. #--------------------------------------------------------------------------
  46. # ● 常量设定
  47. #--------------------------------------------------------------------------
  48. # 是否显示总伤害
  49. SHOW_TOTAL_DAMAGE = true
  50. # 角色受攻击时是否跳一下
  51. BATTLER_JUMP = false
  52. # 连续伤害的动画ID
  53. SLIP_DAMAGE_ANIMATION_ID = 105
  54.  
  55. class Sprite < ::Sprite
  56.    #==========================================
  57.    # 修改说明:
  58.    # @flash_shake用来制作挨打时候跳跃
  59.    # @_damage    用来记录每次打击之后弹出数字
  60.    # @_total_damage 记录总伤害
  61.    # @_total_damage_duration 总伤害持续帧
  62.    #==========================================
  63.    #alias 66RPG_rainbow_initialize : initialize
  64.  
  65.    def initialize(viewport = nil)
  66.      #66RPG_rainbow_initialize(viewport)
  67.      super(viewport)
  68.      @_whiten_duration = 0
  69.      @_appear_duration = 0
  70.      @_escape_duration = 0
  71.      @_collapse_duration = 0
  72.      @_damage_duration = 0
  73.      @_animation_duration = 0
  74.      @_blink = false
  75.      # 挨打时候跳跃
  76.      @flash_shake = 0
  77.      # 伤害记录数组
  78.      @_damage = []
  79.      # 总伤害数字
  80.      @_total_damage = 0
  81.      # 总伤害持续帧
  82.      @_total_damage_duration = 0
  83.      #记录已经发生的伤害的变量★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  84.      @p_dam=0
  85.      @hits=0
  86.    end
  87. #美化的伤害处理★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  88. def damage(value, critical)
  89.       # 释放伤害,效果是伤害数字快速消失,觉得不如不消失好看......
  90.       #dispose_damage
  91.       #清除hit数
  92.       dispose_hit
  93.       # 如果伤害值是数值
  94.       if value.is_a?(Numeric)
  95.         # 绝对值转为字符串
  96.         damage_string = value.abs.to_s
  97.       else
  98.         # 转为字符串
  99.         damage_string = value.to_s
  100.       end
  101.       # 初始化位图
  102.       bitmap = Bitmap.new(162, 64)
  103.       bitmap.font.name = ["黑体","华文行楷", "宋体"]
  104.       bitmap.font.size = 32
  105.       # 伤害值是数值的情况下
  106.       if value.is_a?(Numeric)
  107.         # 分割伤害值字符串
  108.         damage_array = damage_string.scan(/./)
  109.         damage_x = 81 - damage_string.size * 9
  110.         # 伤害值为负的情况下
  111.         if value < 0
  112.           # 调用回复数字表
  113.           rect_y = 32
  114.         else
  115.           # 调用伤害数字表
  116.           rect_y = 0
  117.         end
  118.         # 循环伤害值字符串
  119.         for char in damage_array
  120.           number = char.to_i
  121.           # 显示伤害数字
  122.           bitmap.blt(damage_x, 32, RPG::Cache.picture("Damage"),
  123.           Rect.new(number * 18, rect_y, 18, 32))
  124.           # 后移一位
  125.           damage_x += 18
  126.         end
  127.       # 伤害值不是数值的情况
  128.       else
  129.         # 如果伤害值不是 Miss
  130.         unless value == "Miss"
  131.           # 系统默认描画字符串
  132.           bitmap.font.color.set(0, 0, 0)
  133.           bitmap.draw_text(-1, 27, 162, 36, damage_string, 1)
  134.           bitmap.draw_text(+1, 27, 162, 36, damage_string, 1)
  135.           bitmap.draw_text(-1, 29, 162, 36, damage_string, 1)
  136.           bitmap.draw_text(+1, 29, 162, 36, damage_string, 1)
  137.           bitmap.font.color.set(255, 255, 255)
  138.           bitmap.draw_text(0, 28, 162, 36, damage_string, 1)
  139.         # Miss 的情况下
  140.         else
  141.           # 显示未击中图画
  142.           bitmap.blt(36, 28, RPG::Cache.picture("Damage"), Rect.new(90, 64, 90, 32))
  143.         end
  144.       end
  145.       # 会心一击标志打开的情况
  146.       if critical
  147.         # 显示会心一击图画
  148.         bitmap.blt(36, 0, RPG::Cache.picture("Damage"), Rect.new(0, 64, 90, 32))
  149.       end
  150.       # 伤害值定位
  151.       @_damage_sprite = ::Sprite.new(self.viewport)
  152.       @_damage_sprite.bitmap = bitmap
  153.       @_damage_sprite.ox = 81
  154.       @_damage_sprite.oy = 20
  155.       @_damage_sprite.x = self.x
  156.       @_damage_sprite.y = self.y - self.oy / 2
  157.       @_damage_sprite.z = 3000
  158.       @_damage_duration = 40
  159.       @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  160.       make_total_damage(value)  
  161.  
  162.     end
  163.  
  164. #   ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  165. # hit数的美化描绘
  166.     def hit
  167.  
  168.       # 如果伤害值是数值
  169.       # 转为字符串
  170.       value=@hits
  171.         hits_string = value.to_s
  172.       # 初始化位图
  173.        bitmap = Bitmap.new(320, 64)
  174.        bitmap.font.name = "Arial Black"
  175.        bitmap.font.size = 32
  176.        # 分割伤害值字符串
  177.         hits_array = hits_string.scan(/./)
  178.         hits_x = 81 - hits_string.size * 18.1
  179.           rect_y = 0
  180.         # 循环伤害值字符串
  181.         for char in hits_array
  182.           number = char.to_i
  183.           # 显示伤害数字
  184.           bitmap.blt(hits_x, 0, RPG::Cache.picture("Number"),
  185.           Rect.new(number * 36.2, rect_y, 36.2, 50))
  186.           # 后移一位
  187.           hits_x += 36.2
  188.         end
  189.         bitmap.blt(hits_x, 0, RPG::Cache.picture("HITS"),
  190.         Rect.new(0, -21, 90, 50))
  191.  
  192.       # 伤害值定位
  193.       @_hits_sprite = ::Sprite.new(self.viewport)
  194.       @_hits_sprite.bitmap = bitmap
  195.       @_hits_sprite.ox = 81
  196.       @_hits_sprite.oy = 20
  197.       @_hits_sprite.x = 500
  198.       @_hits_sprite.y = 100
  199.       @_hits_sprite.z = 3000
  200.       @_hits_duration = 40
  201.     end
  202. #--------------------------------------------------------------------------
  203.    # ● 总伤害处理
  204.    #--------------------------------------------------------------------------
  205.    def make_total_damage(value)
  206.      if value.is_a?(Numeric) and SHOW_TOTAL_DAMAGE
  207.        @_total_damage += value
  208.         # 绝对值转为字符串
  209.         damage_string = @_total_damage.abs.to_s
  210.       else
  211.         return
  212.       end
  213.       # 初始化位图
  214.       bitmap = Bitmap.new(300, 150)
  215.       bitmap.font.name = "Arial Black"
  216.       bitmap.font.size = 32
  217.       # 伤害值是数值的情况下
  218.       if value.is_a?(Numeric)
  219.         # 分割伤害值字符串
  220.         damage_array = damage_string.scan(/./)
  221.         damage_x = 40 - damage_string.size * 9
  222.         # 伤害值为负的情况下
  223.         if value < 0
  224.           # 调用回复数字表
  225.           name="Number3"
  226.         else
  227.           # 调用伤害数字表
  228.           name="Number2"
  229.         end
  230.         # 循环伤害值字符串
  231.         for char in damage_array
  232.           number = char.to_i
  233.           # 显示伤害数字
  234.           bitmap.blt(damage_x, 0, RPG::Cache.picture(name),
  235.           Rect.new(number * 36.2, 0, 36.2, 50))
  236.           # 后移一位
  237.           damage_x += 36.2
  238.         end
  239.       end
  240.  
  241.  
  242.  
  243.  
  244. #     if value.is_a?(Numeric) and SHOW_TOTAL_DAMAGE
  245. #       @_total_damage += value
  246. #     else
  247. #       return
  248. #     end
  249. #     bitmap = Bitmap.new(300, 150)
  250. #     bitmap.font.name = "Arial Black"
  251. #     bitmap.font.size = 40
  252. #     bitmap.font.color.set(0, 0, 0)
  253. #     bitmap.draw_text(+2, 12+2, 160, 40, @_total_damage.abs.to_s, 1)
  254. #     if @_total_damage < 0
  255. #       bitmap.font.color.set(80, 255, 00)
  256. #    else
  257. #       bitmap.font.color.set(255, 140, 0)
  258. #     end
  259. #     bitmap.draw_text(0, 12, 160, 40, @_total_damage.abs.to_s, 1)
  260. #     bitmap.font.color.set(55, 55,255)
  261.  
  262.  
  263.      if @_total_damage_sprite.nil?
  264.        @_total_damage_sprite = ::Sprite.new(self.viewport)
  265.        @_total_damage_sprite.ox = 80
  266.        @_total_damage_sprite.oy = 20
  267.        @_total_damage_sprite.z = 3000
  268.  
  269.      end
  270.      @_total_damage_sprite.bitmap = bitmap
  271.      @_total_damage_sprite.zoom_x = 0.8
  272.      @_total_damage_sprite.zoom_y = 0.8
  273.      @_total_damage_sprite.x = self.x
  274.      @_total_damage_sprite.y = self.y  - self.oy / 2 - 64
  275.      @_total_damage_sprite.z = 3001
  276.      @_total_damage_duration = 80
  277.      #hit数描绘
  278.      @hits+=1
  279.     if @_total_damage > 0
  280.       hit
  281.     end
  282.    end
  283.  
  284.  
  285.    def animation(animation, hit, battler_damage="", battler_critical=false)
  286.      dispose_animation      
  287.      #=======================================
  288.      # 修改:记录伤害和critical
  289.      #=======================================
  290.      @battler_damage = battler_damage
  291.      @battler_critical = battler_critical
  292.      @_animation = animation
  293.      return if @_animation == nil
  294.      @_animation_hit = hit
  295.      @_animation_duration = @_animation.frame_max
  296.      animation_name = @_animation.animation_name
  297.      animation_hue = @_animation.animation_hue
  298.      bitmap = RPG::Cache.animation(animation_name, animation_hue)
  299.      #=======================================
  300.      # 修改:计算总闪光权限值
  301.      #=======================================
  302.      for timing in @_animation.timings
  303.        quanzhong = animation_process_timing(timing, @_animation_hit,true)
  304.        @all_quanzhong += quanzhong
  305.        # 记录最后一次闪光
  306.        @_last_frame = timing.frame if quanzhong != 0
  307.      end      
  308.      if @@_reference_count.include?(bitmap)
  309.        @@_reference_count[bitmap] += 1
  310.      else
  311.        @@_reference_count[bitmap] = 1
  312.      end
  313.      #=======================================
  314.      # 修改:行动方动画不显示伤害
  315.      #=======================================
  316.      if $scene.is_a?(Scene_Battle)
  317.        if $scene.animation1_id == @battler.animation_id
  318.          @battler_damage = ""
  319.        end
  320.      end
  321.      @_animation_sprites = []
  322.      if @_animation.position != 3 or not @@_animations.include?(animation)
  323.        for i in 0..15
  324.          sprite = ::Sprite.new(self.viewport)
  325.          sprite.bitmap = bitmap
  326.          sprite.visible = false
  327.          @_animation_sprites.push(sprite)
  328.        end
  329.        unless @@_animations.include?(animation)
  330.          @@_animations.push(animation)
  331.        end
  332.      end
  333.      update_animation
  334.   end
  335.    #=======================================
  336.    # 修改:更换清除伤害的算法,以防万一
  337.    #       本内容在脚本中没有使用过
  338.    #=======================================
  339.    def dispose_damage
  340.      for damage in @_damage.reverse
  341.        damage[0].bitmap.dispose
  342.        damage[0].dispose
  343.        @_damage.delete(damage)
  344.      end
  345.      @_total_damage = 0
  346.      @_last_frame = -1
  347.      if @_total_damage_sprite != nil
  348.        @_total_damage_duration = 0
  349.        @_total_damage_sprite.bitmap.dispose
  350.        @_total_damage_sprite.dispose
  351.        @_total_damage_sprite = nil
  352.      end
  353.    end
  354.    #=======================================
  355.    # 清除hit数★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  356.    #=======================================
  357.    def dispose_hit
  358.      if @_hits_sprite != nil
  359.        @_hits_sprite.bitmap.dispose
  360.        @_hits_sprite.dispose
  361.        @_hits_sprite = nil
  362.      end
  363.    end
  364.    def dispose_animation
  365.      #=======================================
  366.      # 修改:清除记录的伤害,清除权重记录
  367.      #=======================================
  368.      @battler_damage = nil
  369.      @battler_critical = nil
  370.      @all_quanzhong = 1
  371.      @_total_damage = 0
  372.      @_last_frame = -1
  373.      if @_animation_sprites != nil
  374.        sprite = @_animation_sprites[0]
  375.        if sprite != nil
  376.          @@_reference_count[sprite.bitmap] -= 1
  377.          if @@_reference_count[sprite.bitmap] == 0
  378.            sprite.bitmap.dispose
  379.          end
  380.        end
  381.        for sprite in @_animation_sprites
  382.          sprite.dispose
  383.        end
  384.        @_animation_sprites = nil
  385.        @_animation = nil
  386.      end
  387.    end
  388.    def update
  389.      super
  390.      if @_whiten_duration > 0
  391.        @_whiten_duration -= 1
  392.        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  393.      end
  394.      if @_appear_duration > 0
  395.        @_appear_duration -= 1
  396.        self.opacity = (16 - @_appear_duration) * 16
  397.      end
  398.      if @_escape_duration > 0
  399.        @_escape_duration -= 1
  400.        self.opacity = 256 - (32 - @_escape_duration) * 10
  401.      end
  402.      if @_collapse_duration > 0
  403.        @_collapse_duration -= 1
  404.        self.opacity = 256 - (48 - @_collapse_duration) * 6
  405.      end
  406.      #=======================================
  407.      # 修改:更新算法,更新弹出
  408.      #=======================================
  409.      if @_damage_duration > 0
  410.        @_damage_duration -= 1
  411.        for damage in @_damage
  412.          damage[0].x = self.x + self.viewport.rect.x -
  413.                        self.ox + self.src_rect.width / 2 +
  414.                        (40 - damage[1]) * damage[3] / 10
  415.          damage[0].y -= damage[4]+damage[1]/10
  416.          damage[0].opacity = damage[1]*20
  417.          damage[1] -= 1
  418.          if damage[1]==0
  419.            damage[0].bitmap.dispose
  420.            damage[0].dispose
  421.            @_damage.delete(damage)
  422.  
  423.            next
  424.          end
  425.        end
  426.      end
  427.      #=======================================
  428.      # 添加:弹出总伤害
  429.      #=======================================
  430.      if @_total_damage_duration > 0
  431.        @_total_damage_duration -= 1
  432.        @_total_damage_sprite.y -= 1 if @_total_damage_duration % 2 == 0
  433.        if @_total_damage_sprite.zoom_x > 1.0
  434.          @_total_damage_sprite.zoom_x -= 0.05
  435.        end
  436.        if @_total_damage_sprite.zoom_y > 1.0
  437.          @_total_damage_sprite.zoom_y -= 0.05
  438.        end
  439.        @_total_damage_sprite.opacity = 256 - (24 - @_total_damage_duration) * 16
  440.        if @_total_damage_duration <= 0
  441.          dispose_hit#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  442.          @_total_damage = 0
  443.          @_total_damage_duration = 0
  444.          @_total_damage_sprite.bitmap.dispose
  445.          @_total_damage_sprite.dispose
  446.          @_total_damage_sprite = nil
  447.        end
  448.      end
  449.      #=======================================
  450.      if @_animation != nil and (Graphics.frame_count % 2 == 0)
  451.        @_animation_duration -= 1
  452.        update_animation
  453.      end
  454.      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  455.        update_loop_animation
  456.        @_loop_animation_index += 1
  457.        @_loop_animation_index %= @_loop_animation.frame_max
  458.      end
  459.      if @_blink
  460.        @_blink_count = (@_blink_count + 1) % 32
  461.        if @_blink_count < 16
  462.          alpha = (16 - @_blink_count) * 6
  463.        else
  464.          alpha = (@_blink_count - 16) * 6
  465.        end
  466.        self.color.set(255, 255, 255, alpha)
  467.      end
  468.      @@_animations.clear
  469.    end
  470.    def update_animation
  471.     if @_animation_duration > 0
  472.        frame_index = @_animation.frame_max - @_animation_duration
  473.        cell_data = @_animation.frames[frame_index].cell_data
  474.        position = @_animation.position
  475.        animation_set_sprites(@_animation_sprites, cell_data, position)
  476.        #=======================================
  477.        # 修改:弹出伤害,权重计算
  478.        #=======================================
  479.        for timing in @_animation.timings
  480.          if timing.frame == frame_index
  481.            t = 1.0 * animation_process_timing(timing, @_animation_hit)  
  482.                    if timing.se.name != ""
  483.           se=timing.se
  484.           Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
  485.         end
  486.            #p t,"当前权重", @all_quanzhong,"总权重"
  487.            if @battler_damage.is_a?(Numeric) and t != 0
  488.              t *= @battler_damage
  489.              t /= @all_quanzhong
  490.              t = t.to_i
  491.              #在闪光不是最后一次的情况下,把这次伤害加入到已经发生的伤害中★★★★★★★★★★★★★★★★★★★★★★★★★★
  492.              if frame_index != @_last_frame
  493.              @p_dam+= t
  494.              end
  495.              #p @p_dam,"已发生伤害",@battler_damage,"总伤害"(调试用)★★★★★★★★★★★★★★★★★★★★★★★★★★
  496.              #闪光为最后一次的情况下,改变这次伤害的计算方法(总伤害-已经发生伤害)★★★★★★★★★★★★★★★★★★★★★★★★★★
  497.              if frame_index == @_last_frame
  498.                t=@battler_damage-@p_dam
  499.              end
  500.              #p t,"当前伤害",@battler_damage,"总伤害"
  501.              # 最后一次闪光的话,伤害修正
  502.              if frame_index == @_last_frame
  503.                @_total_damage = @battler_damage - t
  504.                @p_dam=0      #已经发生的伤害归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  505.             end
  506.              #p t,@battler_damage,@all_quanzhong
  507.              damage(t,@battler_critical)
  508.             #连击次数归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  509.             if frame_index == @_last_frame
  510.                       @hits=0  
  511.             end
  512.            # 防止重复播放miss
  513.            elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
  514.              damage(@battler_damage,@battler_critical)
  515.            end
  516.          end
  517.        end
  518.      else
  519.        dispose_animation
  520.      end
  521.    end
  522.    #=======================================
  523.    # 修改:敌人跳跃的功能 + 添加返回数值
  524.    #=======================================
  525.     def animation_process_timing(timing, hit,dontflash=false)
  526.       if (timing.condition == 0) or
  527.          (timing.condition == 1 and hit == true) or
  528.          (timing.condition == 2 and hit == false)
  529.         case timing.flash_scope
  530.         when 1
  531.           unless dontflash
  532.             self.flash(timing.flash_color, timing.flash_duration * 2)
  533.             if @_total_damage >0
  534.               @flash_shake_switch = true
  535.               @flash_shake = 10
  536.             end
  537.           end
  538.           return timing.flash_color.alpha * timing.flash_duration
  539.         when 2
  540.           unless dontflash
  541.             if self.viewport != nil
  542.               self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
  543.             end
  544.           end
  545.           return timing.flash_color.alpha * timing.flash_duration
  546.         when 3
  547.           unless dontflash
  548.             self.flash(nil, timing.flash_duration * 2)
  549.           end
  550.           return timing.flash_color.alpha * timing.flash_duration
  551.         end
  552.       end      
  553.       return 0
  554.     end   
  555. end
  556. end
  557. #==============================================================================
  558. # ■ Sprite_Battler
  559. #==============================================================================
  560. class Sprite_Battler < RPG::Sprite
  561. #--------------------------------------------------------------------------
  562. # ● 初始化对像
  563. #    添加跳跃记录
  564. #--------------------------------------------------------------------------
  565. def initialize(viewport, battler = nil)
  566.   super(viewport)
  567.   @battler = battler
  568.   @battler_visible = false
  569.   @flash_shake_switch = true
  570. end
  571. #--------------------------------------------------------------------------
  572. # ● 刷新画面
  573. #    增添跳跃功能
  574. #--------------------------------------------------------------------------
  575. def update
  576.   super
  577.   # 战斗者为 nil 的情况下
  578.   if @battler == nil
  579.     self.bitmap = nil
  580.     loop_animation(nil)
  581.     return
  582.   end
  583.   # 文件名和色相与当前情况有差异的情况下
  584.   if @battler.battler_name != @battler_name or
  585.      @battler.battler_hue != @battler_hue
  586.     # 获取、设置位图
  587.     @battler_name = @battler.battler_name
  588.     @battler_hue = @battler.battler_hue
  589.     self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  590.     @width = bitmap.width
  591.     @height = bitmap.height
  592.     self.ox = @width / 2
  593.     self.oy = @height
  594.     # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  595.     if @battler.dead? or @battler.hidden
  596.       self.opacity = 0
  597.     end
  598.   end
  599.   # 动画 ID 与当前的情况有差异的情况下
  600.   if @battler.damage == nil and
  601.      @battler.state_animation_id != @state_animation_id
  602.     @state_animation_id = @battler.state_animation_id
  603.     loop_animation($data_animations[@state_animation_id])
  604.   end
  605.   # 应该被显示的角色的情况下
  606.   if @battler.is_a?(Game_Actor) and @battler_visible
  607.     # 不是主状态的时候稍稍降低点透明度
  608.     if $game_temp.battle_main_phase
  609.       self.opacity += 3 if self.opacity < 255
  610.     else
  611.       self.opacity -= 3 if self.opacity > 207
  612.     end
  613.   end
  614.   # 明灭
  615.   if @battler.blink
  616.     blink_on
  617.   else
  618.     blink_off
  619.   end
  620.   # 不可见的情况下
  621.   unless @battler_visible
  622.     # 出现
  623.     if not @battler.hidden and not @battler.dead? and
  624.        (@battler.damage == nil or @battler.damage_pop)
  625.       appear
  626.       @battler_visible = true
  627.     end
  628.   end
  629.   # 可见的情况下
  630.   if @battler_visible
  631.     # 逃跑
  632.     if @battler.hidden
  633.       $game_system.se_play($data_system.escape_se)
  634.       escape
  635.       @battler_visible = false
  636.     end
  637.     # 白色闪烁
  638.     if @battler.white_flash
  639.       whiten
  640.       @battler.white_flash = false
  641.     end
  642.     # 动画
  643.     if @battler.animation_id != 0
  644.       animation = $data_animations[@battler.animation_id]
  645.       animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  646.       @battler.animation_id = 0
  647.     end
  648.     # 伤害
  649.     if @battler.damage_pop
  650.       @battler.damage = nil
  651.       @battler.critical = false
  652.       @battler.damage_pop = false
  653.     end
  654.     # korapusu
  655.     if @battler.damage == nil and @battler.dead?
  656.       if @battler.is_a?(Game_Enemy)
  657.         $game_system.se_play($data_system.enemy_collapse_se)
  658.       else
  659.         $game_system.se_play($data_system.actor_collapse_se)
  660.       end
  661.       collapse
  662.       @battler_visible = false
  663.     end
  664.   end
  665.   # 设置活动块的坐标
  666.   if @flash_shake_switch == true
  667.     self.x = @battler.screen_x
  668.     self.y = @battler.screen_y
  669.     self.z = @battler.screen_z
  670.     @flash_shake_switch = false
  671.   end
  672.   if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
  673.     case @flash_shake
  674.     when 9..10
  675.       self.x = @battler.screen_x
  676.       self.y -=4
  677.       self.z = @battler.screen_z
  678.     when 6..8
  679.       self.x = @battler.screen_x
  680.       self.y -=2
  681.       self.z = @battler.screen_z
  682.     when 3..5
  683.       self.x = @battler.screen_x
  684.       self.y +=2
  685.       self.z = @battler.screen_z
  686.     when 2
  687.       self.x = @battler.screen_x
  688.       self.y += 4
  689.       self.z = @battler.screen_z
  690.     when 1
  691.       self.x = @battler.screen_x
  692.       self.y = @battler.screen_y
  693.       self.z = @battler.screen_z
  694.     end
  695.     @flash_shake -= 1
  696.   end
  697. end
  698. end
  699.  
  700. #==============================================================================
  701. # ■ Scene_Battle
  702. #------------------------------------------------------------------------------
  703. #  处理战斗画面的类。
  704. #==============================================================================
  705.  
  706. class Scene_Battle
  707. #--------------------------------------------------------------------------
  708. # ● 定义实例变量
  709. #--------------------------------------------------------------------------
  710. attr_reader   :animation1_id                    # 行动方动画ID
  711. end
  712.  
  713. #==============================================================================
  714. # ■ Game_Battler
  715. #------------------------------------------------------------------------------
  716. #  处理战斗者的类。这个类作为 Game_Actor 类与 Game_Enemy 类的
  717. # 超级类来使用。
  718. #==============================================================================
  719.  
  720. #class Game_Battler
  721. #  #--------------------------------------------------------------------------
  722. #  # ● 应用连续伤害效果
  723. #  #--------------------------------------------------------------------------
  724. #  alias rainbow_sword_slip_damage_effect slip_damage_effect
  725. #  def slip_damage_effect
  726. #    self.animation_id = RPG::SLIP_DAMAGE_ANIMATION_ID
  727. #    self.animation_hit = true
  728. #    rainbow_sword_slip_damage_effect
  729. #  end
  730. #end
1:消除对象居然也算一次连击,,,如何让消除对象不算连击?
2:我记得以前有一个彩虹神剑和动态扣血整合的脚本。。。
就是本来伤害为90的技能,同等强度的闪烁了3次,就是三次连击,30+30+30=90
假设当前角色有100血,然后默认的扣血方式是

等技能结束后,100-90=HP直接显示成10

我想要的效果是。。。

在技能释放的途中每闪烁一次就刷新一次角色的HP。。。
效果就是 100-30=显示70,70-30=显示40,40-30=显示10

谢了,下面是我的那个彩虹神剑的脚本

最佳答案

查看完整内容

没有发现喝药不回血的情况啊,不信我喝给你看,咕嘟咕嘟咕嘟。。。。。 但是喝药的动画一定要有闪光,否则就真回不了血了! 其他问题不好意思了,请用下面这个我又修改过的: 看来我药不能停啊 这次在菜单里喝给你看 咕嘟咕嘟咕嘟 用下面这个:

点评

请看最后一层楼,我修改了一下  发表于 2015-8-15 20:12

Lv3.寻梦者

梦石
0
星屑
1095
在线时间
381 小时
注册时间
2010-10-9
帖子
386

开拓者

2
发表于 2015-8-2 17:43:10 | 只看该作者
本帖最后由 piaoy 于 2015-8-15 20:10 编辑

没有发现喝药不回血的情况啊,不信我喝给你看,咕嘟咕嘟咕嘟。。。。。
但是喝药的动画一定要有闪光,否则就真回不了血了!
其他问题不好意思了,请用下面这个我又修改过的:

看来我药不能停啊 这次在菜单里喝给你看 咕嘟咕嘟咕嘟
用下面这个:
Scripts.rxdata (233.22 KB, 下载次数: 59)

点评

CR~
十分感谢!!!  发表于 2015-8-15 20:42
CR~
在菜单的时候喝药只有音效没有效果。。。  发表于 2015-8-15 19:50
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1095
在线时间
381 小时
注册时间
2010-10-9
帖子
386

开拓者

3
发表于 2015-8-3 12:21:44 | 只看该作者
本帖最后由 piaoy 于 2015-8-4 18:41 编辑

大致做了一个,还有些地方不完善,比如加sp不会显示数字,而且如果用血槽脚本的肯定要对应着改的。
请试试能不能用:
RUBY 代码复制
  1. =begin
  2. ==============================================================================
  3.  
  4. 彩虹神剑(伤害分段显示)显示总伤害版 v1.0d
  5.  
  6. ==============================================================================
  7.  
  8. 彩虹神剑 -柳柳
  9.  
  10. 6-20-2006 v1.0 -叶子
  11. 在彩虹神剑的基础上增加了显示总伤害的功能,而且总伤害的数字是弹出伤害时逐渐增加的
  12.  
  13. v1.0a -叶子
  14. 修正了显示伤害和实际伤害有差别的问题
  15. 修正了miss的情况下显示miss混乱的问题
  16. 修正了对己方技能重复显示伤害的问题
  17. 未修正播放目标动画第一帧时目标有时无端跳动的BUG
  18.  
  19. v1.0b -叶子
  20. 修改了总伤害数字的位置和z坐标
  21. 未修正播放目标动画第一帧时目标有时无端跳动的BUG
  22.  
  23. v1.0c -柳柳
  24. ? ? ?
  25.  
  26. v1.0d -柳柳
  27. 1.0d最终解决了那个闪光问题,还有最末帧伤害多次的算法
  28.  
  29. 7-24-2006 v1.0e -叶子
  30. 修正全屏幕闪烁弹出伤害错误的问题
  31. 修正连续伤害不会弹出伤害的问题
  32. 仍然未修正播放目标动画第一帧时目标有时无端跳动的BUG
  33.  
  34. 我鼓起很大勇气才敢动偶像们的脚本的,不知道会不会出问题啊......  -cftx
  35. 修正了总伤害显示
  36. 增加了伤害美化和HIT数显示
  37. 修正了两次音效
  38.  
  39. ==============================================================================
  40. =end
  41. # 核心的说明:
  42. # damage_pop 不再附带damage()的功能,这个放到animation里面去了
  43.  
  44. module RPG
  45.         #--------------------------------------------------------------------------
  46.         # ● 常量设定
  47.         #--------------------------------------------------------------------------
  48.         # 是否显示总伤害
  49.         SHOW_TOTAL_DAMAGE = true
  50.         # 角色受攻击时是否跳一下
  51.         BATTLER_JUMP = false
  52.         # 连续伤害的动画ID
  53.         SLIP_DAMAGE_ANIMATION_ID = 105
  54.  
  55.         class Sprite < ::Sprite
  56.                 #==========================================
  57.                 # 修改说明:
  58.                 # @flash_shake用来制作挨打时候跳跃
  59.                 # @_damage    用来记录每次打击之后弹出数字
  60.                 # @_total_damage 记录总伤害
  61.                 # @_total_damage_duration 总伤害持续帧
  62.                 #==========================================
  63.                 #alias 66RPG_rainbow_initialize : initialize
  64.  
  65.                 def initialize(viewport = nil)
  66.                         #66RPG_rainbow_initialize(viewport)
  67.                         super(viewport)
  68.                         @_whiten_duration = 0
  69.                         @_appear_duration = 0
  70.                         @_escape_duration = 0
  71.                         @_collapse_duration = 0
  72.                         @_damage_duration = 0
  73.                         @_animation_duration = 0
  74.                         @_blink = false
  75.                         # 挨打时候跳跃
  76.                         @flash_shake = 0
  77.                         # 伤害记录数组
  78.                         @_damage = []
  79.                         # 总伤害数字
  80.                         @_total_damage = 0
  81.                         # 总伤害持续帧
  82.                         @_total_damage_duration = 0
  83.                         #记录已经发生的伤害的变量★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  84.                         @p_dam=0
  85.                         @hits=0
  86.                 end
  87.                 #美化的伤害处理★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  88.                 def damage(value, critical)
  89.                         # 释放伤害,效果是伤害数字快速消失,觉得不如不消失好看......
  90.                         #dispose_damage
  91.                         #清除hit数
  92.                         dispose_hit
  93.                         # 如果伤害值是数值
  94.                         if value.is_a?(Numeric)
  95.                                 # 绝对值转为字符串
  96.                                 damage_string = value.abs.to_s
  97.                         else
  98.                                 # 转为字符串
  99.                                 damage_string = value.to_s
  100.                         end
  101.                         # 初始化位图
  102.                         bitmap = Bitmap.new(162, 64)
  103.                         bitmap.font.name = ["黑体","华文行楷", "宋体"]
  104.                         bitmap.font.size = 32
  105.                         # 伤害值是数值的情况下
  106.                         if value.is_a?(Numeric)
  107.                                 # 分割伤害值字符串
  108.                                 damage_array = damage_string.scan(/./)
  109.                                 damage_x = 81 - damage_string.size * 9
  110.                                 # 伤害值为负的情况下
  111.                                 if value < 0
  112.                                         # 调用回复数字表
  113.                                         rect_y = 32
  114.                                 else
  115.                                         # 调用伤害数字表
  116.                                         rect_y = 0
  117.                                 end
  118.                                 # 循环伤害值字符串
  119.                                 for char in damage_array
  120.                                         number = char.to_i
  121.                                         # 显示伤害数字
  122.                                         bitmap.blt(damage_x, 32, RPG::Cache.picture("Damage"),
  123.                                                 Rect.new(number * 18, rect_y, 18, 32))
  124.                                         # 后移一位
  125.                                         damage_x += 18
  126.                                 end
  127.                                 # 伤害值不是数值的情况
  128.                         else
  129.                                 # 如果伤害值不是 Miss
  130.                                 unless value == "Miss"
  131.                                         # 系统默认描画字符串
  132.                                         bitmap.font.color.set(0, 0, 0)
  133.                                         bitmap.draw_text(-1, 27, 162, 36, damage_string, 1)
  134.                                         bitmap.draw_text(+1, 27, 162, 36, damage_string, 1)
  135.                                         bitmap.draw_text(-1, 29, 162, 36, damage_string, 1)
  136.                                         bitmap.draw_text(+1, 29, 162, 36, damage_string, 1)
  137.                                         bitmap.font.color.set(255, 255, 255)
  138.                                         bitmap.draw_text(0, 28, 162, 36, damage_string, 1)
  139.                                         # Miss 的情况下
  140.                                 else
  141.                                         # 显示未击中图画
  142.                                         bitmap.blt(36, 28, RPG::Cache.picture("Damage"), Rect.new(90, 64, 90, 32))
  143.                                 end
  144.                         end
  145.                         # 会心一击标志打开的情况
  146.                         if critical
  147.                                 # 显示会心一击图画
  148.                                 bitmap.blt(36, 0, RPG::Cache.picture("Damage"), Rect.new(0, 64, 90, 32))
  149.                         end
  150.                         # 伤害值定位
  151.                         @_damage_sprite = ::Sprite.new(self.viewport)
  152.                         @_damage_sprite.bitmap = bitmap
  153.                         @_damage_sprite.ox = 81
  154.                         @_damage_sprite.oy = 20
  155.                         @_damage_sprite.x = self.x
  156.                         @_damage_sprite.y = self.y - self.oy / 2
  157.                         @_damage_sprite.z = 3000
  158.                         @_damage_duration = 40
  159.                         @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  160.                         make_total_damage(value)  
  161.  
  162.                 end
  163.  
  164.                 #   ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  165.                 # hit数的美化描绘
  166.                 def hit
  167.  
  168.                         # 如果伤害值是数值
  169.                         # 转为字符串
  170.                         value=@hits
  171.                         hits_string = value.to_s
  172.                         # 初始化位图
  173.                         bitmap = Bitmap.new(320, 64)
  174.                         bitmap.font.name = "Arial Black"
  175.                         bitmap.font.size = 32
  176.                         # 分割伤害值字符串
  177.                         hits_array = hits_string.scan(/./)
  178.                         hits_x = 81 - hits_string.size * 18.1
  179.                         rect_y = 0
  180.                         # 循环伤害值字符串
  181.                         for char in hits_array
  182.                                 number = char.to_i
  183.                                 # 显示伤害数字
  184.                                 bitmap.blt(hits_x, 0, RPG::Cache.picture("Number"),
  185.                                         Rect.new(number * 36.2, rect_y, 36.2, 50))
  186.                                 # 后移一位
  187.                                 hits_x += 36.2
  188.                         end
  189.                         bitmap.blt(hits_x, 0, RPG::Cache.picture("HITS"),
  190.                                 Rect.new(0, -21, 90, 50))
  191.  
  192.                         # 伤害值定位
  193.                         @_hits_sprite = ::Sprite.new(self.viewport)
  194.                         @_hits_sprite.bitmap = bitmap
  195.                         @_hits_sprite.ox = 81
  196.                         @_hits_sprite.oy = 20
  197.                         @_hits_sprite.x = 500
  198.                         @_hits_sprite.y = 100
  199.                         @_hits_sprite.z = 3000
  200.                         @_hits_duration = 40
  201.                 end
  202.                 #--------------------------------------------------------------------------
  203.                 # ● 总伤害处理
  204.                 #--------------------------------------------------------------------------
  205.                 def make_total_damage(value)
  206.                         if value.is_a?(Numeric) and SHOW_TOTAL_DAMAGE
  207.                                 @_total_damage += value
  208.                                 # 绝对值转为字符串
  209.                                 damage_string = @_total_damage.abs.to_s
  210.                         else
  211.                                 return
  212.                         end
  213.                         # 初始化位图
  214.                         bitmap = Bitmap.new(300, 150)
  215.                         bitmap.font.name = "Arial Black"
  216.                         bitmap.font.size = 32
  217.                         # 伤害值是数值的情况下
  218.                         if value.is_a?(Numeric)
  219.                                 # 分割伤害值字符串
  220.                                 damage_array = damage_string.scan(/./)
  221.                                 damage_x = 40 - damage_string.size * 9
  222.                                 # 伤害值为负的情况下
  223.                                 if value < 0
  224.                                         # 调用回复数字表
  225.                                         name="Number3"
  226.                                 else
  227.                                         # 调用伤害数字表
  228.                                         name="Number2"
  229.                                 end
  230.                                 # 循环伤害值字符串
  231.                                 for char in damage_array
  232.                                         number = char.to_i
  233.                                         # 显示伤害数字
  234.                                         bitmap.blt(damage_x, 0, RPG::Cache.picture(name),
  235.                                                 Rect.new(number * 36.2, 0, 36.2, 50))
  236.                                         # 后移一位
  237.                                         damage_x += 36.2
  238.                                 end
  239.                         end
  240.  
  241.  
  242.  
  243.  
  244.                         #     if value.is_a?(Numeric) and SHOW_TOTAL_DAMAGE
  245.                         #       @_total_damage += value
  246.                         #     else
  247.                         #       return
  248.                         #     end
  249.                         #     bitmap = Bitmap.new(300, 150)
  250.                         #     bitmap.font.name = "Arial Black"
  251.                         #     bitmap.font.size = 40
  252.                         #     bitmap.font.color.set(0, 0, 0)
  253.                         #     bitmap.draw_text(+2, 12+2, 160, 40, @_total_damage.abs.to_s, 1)
  254.                         #     if @_total_damage < 0
  255.                         #       bitmap.font.color.set(80, 255, 00)
  256.                         #    else
  257.                         #       bitmap.font.color.set(255, 140, 0)
  258.                         #     end
  259.                         #     bitmap.draw_text(0, 12, 160, 40, @_total_damage.abs.to_s, 1)
  260.                         #     bitmap.font.color.set(55, 55,255)
  261.  
  262.  
  263.                         if @_total_damage_sprite.nil?
  264.                                 @_total_damage_sprite = ::Sprite.new(self.viewport)
  265.                                 @_total_damage_sprite.ox = 80
  266.                                 @_total_damage_sprite.oy = 20
  267.                                 @_total_damage_sprite.z = 3000
  268.  
  269.                         end
  270.                         @_total_damage_sprite.bitmap = bitmap
  271.                         @_total_damage_sprite.zoom_x = 0.8
  272.                         @_total_damage_sprite.zoom_y = 0.8
  273.                         @_total_damage_sprite.x = self.x
  274.                         @_total_damage_sprite.y = self.y  - self.oy / 2 - 64
  275.                         @_total_damage_sprite.z = 3001
  276.                         @_total_damage_duration = 80
  277.                         #hit数描绘
  278.                         @hits+=1
  279.                         if @_total_damage > 0
  280.                                 hit
  281.                         end
  282.                 end
  283.  
  284.  
  285.                 def animation(animation, hit, battler_damage="", battler_critical=false)
  286.                         dispose_animation      
  287.                         #=======================================
  288.                         # 修改:记录伤害和critical
  289.                         #=======================================
  290.                         @battler_damage = battler_damage
  291.                         @battler_critical = battler_critical
  292.                         @_animation = animation
  293.                         return if @_animation == nil
  294.                         @_animation_hit = hit
  295.                         @_animation_duration = @_animation.frame_max
  296.                         animation_name = @_animation.animation_name
  297.                         animation_hue = @_animation.animation_hue
  298.                         bitmap = RPG::Cache.animation(animation_name, animation_hue)
  299.                         #=======================================
  300.                         # 修改:计算总闪光权限值
  301.                         #=======================================
  302.                         for timing in @_animation.timings
  303.                                 quanzhong = animation_process_timing(timing, @_animation_hit,true)
  304.                                 @all_quanzhong += quanzhong
  305.                                 # 记录最后一次闪光
  306.                                 @_last_frame = timing.frame if quanzhong != 0
  307.                         end      
  308.                         if @@_reference_count.include?(bitmap)
  309.                                 @@_reference_count[bitmap] += 1
  310.                         else
  311.                                 @@_reference_count[bitmap] = 1
  312.                         end
  313.                         #=======================================
  314.                         # 修改:行动方动画不显示伤害
  315.                         #=======================================
  316.                         if $scene.is_a?(Scene_Battle)
  317.                                 if $scene.animation1_id == @battler.animation_id
  318.                                         @battler_damage = ""
  319.                                 end
  320.                         end
  321.                         @_animation_sprites = []
  322.                         if @_animation.position != 3 or not @@_animations.include?(animation)
  323.                                 for i in 0..15
  324.                                         sprite = ::Sprite.new(self.viewport)
  325.                                         sprite.bitmap = bitmap
  326.                                         sprite.visible = false
  327.                                         @_animation_sprites.push(sprite)
  328.                                 end
  329.                                 unless @@_animations.include?(animation)
  330.                                         @@_animations.push(animation)
  331.                                 end
  332.                         end
  333.                         update_animation
  334.                 end
  335.                 #=======================================
  336.                 # 修改:更换清除伤害的算法,以防万一
  337.                 #       本内容在脚本中没有使用过
  338.                 #=======================================
  339.                 def dispose_damage
  340.                         for damage in @_damage.reverse
  341.                                 damage[0].bitmap.dispose
  342.                                 damage[0].dispose
  343.                                 @_damage.delete(damage)
  344.                         end
  345.                         @_total_damage = 0
  346.                         @_last_frame = -1
  347.                         if @_total_damage_sprite != nil
  348.                                 @_total_damage_duration = 0
  349.                                 @_total_damage_sprite.bitmap.dispose
  350.                                 @_total_damage_sprite.dispose
  351.                                 @_total_damage_sprite = nil
  352.                         end
  353.                 end
  354.                 #=======================================
  355.                 # 清除hit数★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  356.                 #=======================================
  357.                 def dispose_hit
  358.                         if @_hits_sprite != nil
  359.                                 @_hits_sprite.bitmap.dispose
  360.                                 @_hits_sprite.dispose
  361.                                 @_hits_sprite = nil
  362.                         end
  363.                 end
  364.                 def dispose_animation
  365.                         #=======================================
  366.                         # 修改:清除记录的伤害,清除权重记录
  367.                         #=======================================
  368.                         @battler_damage = nil
  369.                         @battler_critical = nil
  370.                         @all_quanzhong = 1
  371.                         @_total_damage = 0
  372.                         @_last_frame = -1
  373.                         if @_animation_sprites != nil
  374.                                 sprite = @_animation_sprites[0]
  375.                                 if sprite != nil
  376.                                         @@_reference_count[sprite.bitmap] -= 1
  377.                                         if @@_reference_count[sprite.bitmap] == 0
  378.                                                 sprite.bitmap.dispose
  379.                                         end
  380.                                 end
  381.                                 for sprite in @_animation_sprites
  382.                                         sprite.dispose
  383.                                 end
  384.                                 @_animation_sprites = nil
  385.                                 @_animation = nil
  386.                         end
  387.                 end
  388.                 def update
  389.                         super
  390.                         if @_whiten_duration > 0
  391.                                 @_whiten_duration -= 1
  392.                                 self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  393.                         end
  394.                         if @_appear_duration > 0
  395.                                 @_appear_duration -= 1
  396.                                 self.opacity = (16 - @_appear_duration) * 16
  397.                         end
  398.                         if @_escape_duration > 0
  399.                                 @_escape_duration -= 1
  400.                                 self.opacity = 256 - (32 - @_escape_duration) * 10
  401.                         end
  402.                         if @_collapse_duration > 0
  403.                                 @_collapse_duration -= 1
  404.                                 self.opacity = 256 - (48 - @_collapse_duration) * 6
  405.                         end
  406.                         #=======================================
  407.                         # 修改:更新算法,更新弹出
  408.                         #=======================================
  409.                         if @_damage_duration > 0
  410.                                 @_damage_duration -= 1
  411.                                 for damage in @_damage
  412.                                         damage[0].x = self.x + self.viewport.rect.x -
  413.                                         self.ox + self.src_rect.width / 2 +
  414.                                         (40 - damage[1]) * damage[3] / 10
  415.                                         damage[0].y -= damage[4]+damage[1]/10
  416.                                         damage[0].opacity = damage[1]*20
  417.                                         damage[1] -= 1
  418.                                         if damage[1]==0
  419.                                                 damage[0].bitmap.dispose
  420.                                                 damage[0].dispose
  421.                                                 @_damage.delete(damage)
  422.  
  423.                                                 next
  424.                                         end
  425.                                 end
  426.                         end
  427.                         #=======================================
  428.                         # 添加:弹出总伤害
  429.                         #=======================================
  430.                         if @_total_damage_duration > 0
  431.                                 @_total_damage_duration -= 1
  432.                                 @_total_damage_sprite.y -= 1 if @_total_damage_duration % 2 == 0
  433.                                 if @_total_damage_sprite.zoom_x > 1.0
  434.                                         @_total_damage_sprite.zoom_x -= 0.05
  435.                                 end
  436.                                 if @_total_damage_sprite.zoom_y > 1.0
  437.                                         @_total_damage_sprite.zoom_y -= 0.05
  438.                                 end
  439.                                 @_total_damage_sprite.opacity = 256 - (24 - @_total_damage_duration) * 16
  440.                                 if @_total_damage_duration <= 0
  441.                                         dispose_hit#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  442.                                         @_total_damage = 0
  443.                                         @_total_damage_duration = 0
  444.                                         @_total_damage_sprite.bitmap.dispose
  445.                                         @_total_damage_sprite.dispose
  446.                                         @_total_damage_sprite = nil
  447.                                 end
  448.                         end
  449.                         #=======================================
  450.                         if @_animation != nil and (Graphics.frame_count % 2 == 0)
  451.                                 @_animation_duration -= 1
  452.                                 update_animation
  453.                         end
  454.                         if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  455.                                 update_loop_animation
  456.                                 @_loop_animation_index += 1
  457.                                 @_loop_animation_index %= @_loop_animation.frame_max
  458.                         end
  459.                         if @_blink
  460.                                 @_blink_count = (@_blink_count + 1) % 32
  461.                                 if @_blink_count < 16
  462.                                         alpha = (16 - @_blink_count) * 6
  463.                                 else
  464.                                         alpha = (@_blink_count - 16) * 6
  465.                                 end
  466.                                 self.color.set(255, 255, 255, alpha)
  467.                         end
  468.                         @@_animations.clear
  469.                 end
  470.                 def update_animation
  471.                         if @_animation_duration > 0
  472.                                 frame_index = @_animation.frame_max - @_animation_duration
  473.                                 cell_data = @_animation.frames[frame_index].cell_data
  474.                                 position = @_animation.position
  475.                                 animation_set_sprites(@_animation_sprites, cell_data, position)
  476.                                 #=======================================
  477.                                 # 修改:弹出伤害,权重计算
  478.                                 #=======================================
  479.                                 for timing in @_animation.timings
  480.                                         if timing.frame == frame_index
  481.                                                 t = 1.0 * animation_process_timing(timing, @_animation_hit)  
  482.                                                 if timing.se.name != ""
  483.                                                         se=timing.se
  484.                                                         Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
  485.                                                 end
  486.                                                 #p t,"当前权重", @all_quanzhong,"总权重"
  487.                                                 if @battler_damage.is_a?(Numeric) and t != 0
  488.                                                         t *= @battler_damage
  489.                                                         t /= @all_quanzhong
  490.                                                         t = t.to_i
  491.                                                         #在闪光不是最后一次的情况下,把这次伤害加入到已经发生的伤害中★★★★★★★★★★★★★★★★★★★★★★★★★★
  492.                                                         if frame_index != @_last_frame
  493.                                                                 @p_dam+= t
  494.                                                         end
  495.                                                         #p @p_dam,"已发生伤害",@battler_damage,"总伤害"(调试用)★★★★★★★★★★★★★★★★★★★★★★★★★★
  496.                                                         #闪光为最后一次的情况下,改变这次伤害的计算方法(总伤害-已经发生伤害)★★★★★★★★★★★★★★★★★★★★★★★★★★
  497.                                                         if frame_index == @_last_frame
  498.                                                                 t=@battler_damage-@p_dam
  499.                                                         end
  500.                                                         #p t,"当前伤害",@battler_damage,"总伤害"
  501.                                                         # 最后一次闪光的话,伤害修正
  502.                                                         if frame_index == @_last_frame
  503.                                                                 @_total_damage = @battler_damage - t
  504.                                                                 @p_dam=0      #已经发生的伤害归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  505.                                                         end
  506.                                                         #p t,@battler_damage,@all_quanzhong
  507.                                                         damage(t,@battler_critical)
  508.                                                         @battler.hp -= t
  509.                                                         #连击次数归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  510.                                                         if frame_index == @_last_frame
  511.                                                                 @hits=0  
  512.                                                         end
  513.                                                         # 防止重复播放miss
  514.                                                 elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
  515.                                                         damage(@battler_damage,@battler_critical)
  516.                                                 end
  517.                                         end
  518.                                 end
  519.                         else
  520.                                 dispose_animation
  521.                         end
  522.                 end
  523.                 #=======================================
  524.                 # 修改:敌人跳跃的功能 + 添加返回数值
  525.                 #=======================================
  526.                 def animation_process_timing(timing, hit,dontflash=false)
  527.                         if (timing.condition == 0) or
  528.                                 (timing.condition == 1 and hit == true) or
  529.                                 (timing.condition == 2 and hit == false)
  530.                                 case timing.flash_scope
  531.                                 when 1
  532.                                         unless dontflash
  533.                                                 self.flash(timing.flash_color, timing.flash_duration * 2)
  534.                                                 if @_total_damage >0
  535.                                                         @flash_shake_switch = true
  536.                                                         @flash_shake = 10
  537.                                                 end
  538.                                         end
  539.                                         return timing.flash_color.alpha * timing.flash_duration
  540.                                 when 2
  541.                                         unless dontflash
  542.                                                 if self.viewport != nil
  543.                                                         self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
  544.                                                 end
  545.                                         end
  546.                                         return timing.flash_color.alpha * timing.flash_duration
  547.                                 end
  548.                         end      
  549.                         return 0
  550.                 end   
  551.         end
  552. end
  553. #==============================================================================
  554. # ■ Sprite_Battler
  555. #==============================================================================
  556. class Sprite_Battler < RPG::Sprite
  557.         #--------------------------------------------------------------------------
  558.         # ● 初始化对像
  559.         #    添加跳跃记录
  560.         #--------------------------------------------------------------------------
  561.         def initialize(viewport, battler = nil)
  562.                 super(viewport)
  563.                 @battler = battler
  564.                 @battler_visible = false
  565.                 @flash_shake_switch = true
  566.         end
  567.         #--------------------------------------------------------------------------
  568.         # ● 刷新画面
  569.         #    增添跳跃功能
  570.         #--------------------------------------------------------------------------
  571.         def update
  572.                 super
  573.                 # 战斗者为 nil 的情况下
  574.                 if @battler == nil
  575.                         self.bitmap = nil
  576.                         loop_animation(nil)
  577.                         return
  578.                 end
  579.                 # 文件名和色相与当前情况有差异的情况下
  580.                 if @battler.battler_name != @battler_name or
  581.                         @battler.battler_hue != @battler_hue
  582.                         # 获取、设置位图
  583.                         @battler_name = @battler.battler_name
  584.                         @battler_hue = @battler.battler_hue
  585.                         self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  586.                         @width = bitmap.width
  587.                         @height = bitmap.height
  588.                         self.ox = @width / 2
  589.                         self.oy = @height
  590.                         # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  591.                         if @battler.dead? or @battler.hidden
  592.                                 self.opacity = 0
  593.                         end
  594.                 end
  595.                 # 动画 ID 与当前的情况有差异的情况下
  596.                 if @battler.damage == nil and
  597.                         @battler.state_animation_id != @state_animation_id
  598.                         @state_animation_id = @battler.state_animation_id
  599.                         loop_animation($data_animations[@state_animation_id])
  600.                 end
  601.                 # 应该被显示的角色的情况下
  602.                 if @battler.is_a?(Game_Actor) and @battler_visible
  603.                         # 不是主状态的时候稍稍降低点透明度
  604.                         if $game_temp.battle_main_phase
  605.                                 self.opacity += 3 if self.opacity < 255
  606.                         else
  607.                                 self.opacity -= 3 if self.opacity > 207
  608.                         end
  609.                 end
  610.                 # 明灭
  611.                 if @battler.blink
  612.                         blink_on
  613.                 else
  614.                         blink_off
  615.                 end
  616.                 # 不可见的情况下
  617.                 unless @battler_visible
  618.                         # 出现
  619.                         if not @battler.hidden and not @battler.dead? and
  620.                                 (@battler.damage == nil or @battler.damage_pop)
  621.                                 appear
  622.                                 @battler_visible = true
  623.                         end
  624.                 end
  625.                 # 可见的情况下
  626.                 if @battler_visible
  627.                         # 逃跑
  628.                         if @battler.hidden
  629.                                 $game_system.se_play($data_system.escape_se)
  630.                                 escape
  631.                                 @battler_visible = false
  632.                         end
  633.                         # 白色闪烁
  634.                         if @battler.white_flash
  635.                                 whiten
  636.                                 @battler.white_flash = false
  637.                         end
  638.                         # 动画
  639.                         if @battler.animation_id != 0
  640.                                 animation = $data_animations[@battler.animation_id]
  641.                                 animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  642.                                 @battler.animation_id = 0
  643.                         end
  644.                         # 伤害
  645.                         if @battler.damage_pop
  646.                                 @battler.damage = nil
  647.                                 @battler.critical = false
  648.                                 @battler.damage_pop = false
  649.                         end
  650.                         # korapusu
  651.                         if @battler.damage == nil and @battler.dead?
  652.                                 if @battler.is_a?(Game_Enemy)
  653.                                         $game_system.se_play($data_system.enemy_collapse_se)
  654.                                 else
  655.                                         $game_system.se_play($data_system.actor_collapse_se)
  656.                                 end
  657.                                 collapse
  658.                                 @battler_visible = false
  659.                         end
  660.                 end
  661.                 # 设置活动块的坐标
  662.                 if @flash_shake_switch == true
  663.                         self.x = @battler.screen_x
  664.                         self.y = @battler.screen_y
  665.                         self.z = @battler.screen_z
  666.                         @flash_shake_switch = false
  667.                 end
  668.                 if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
  669.                         case @flash_shake
  670.                         when 9..10
  671.                                 self.x = @battler.screen_x
  672.                                 self.y -=4
  673.                                 self.z = @battler.screen_z
  674.                         when 6..8
  675.                                 self.x = @battler.screen_x
  676.                                 self.y -=2
  677.                                 self.z = @battler.screen_z
  678.                         when 3..5
  679.                                 self.x = @battler.screen_x
  680.                                 self.y +=2
  681.                                 self.z = @battler.screen_z
  682.                         when 2
  683.                                 self.x = @battler.screen_x
  684.                                 self.y += 4
  685.                                 self.z = @battler.screen_z
  686.                         when 1
  687.                                 self.x = @battler.screen_x
  688.                                 self.y = @battler.screen_y
  689.                                 self.z = @battler.screen_z
  690.                         end
  691.                         @flash_shake -= 1
  692.                 end
  693.         end
  694. end
  695. #==============================================================================
  696. # ■ Game_Battler (分割定义 1)
  697. #------------------------------------------------------------------------------
  698. #  处理战斗者的类。这个类作为 Game_Actor 类与 Game_Enemy 类的
  699. # 超级类来使用。
  700. #==============================================================================
  701.  
  702. class Game_Battler
  703. #--------------------------------------------------------------------------
  704.   # ● 应用通常攻击效果
  705.   #     attacker : 攻击者 (battler)
  706.   #--------------------------------------------------------------------------
  707.   def attack_effect(attacker)
  708.     # 清除会心一击标志
  709.     self.critical = false
  710.     # 第一命中判定
  711.     hit_result = (rand(100) < attacker.hit)
  712.     # 命中的情况下
  713.     if hit_result == true
  714.       # 计算基本伤害
  715.       atk = [attacker.atk - self.pdef / 2, 0].max
  716.       self.damage = atk * (20 + attacker.str) / 20
  717.       # 属性修正
  718.       self.damage *= elements_correct(attacker.element_set)
  719.       self.damage /= 100
  720.       # 伤害符号正确的情况下
  721.       if self.damage > 0
  722.         # 会心一击修正
  723.         if rand(100) < 4 * attacker.dex / self.agi
  724.           self.damage *= 2
  725.           self.critical = true
  726.         end
  727.         # 防御修正
  728.         if self.guarding?
  729.           self.damage /= 2
  730.         end
  731.       end
  732.       # 分散
  733.       if self.damage.abs > 0
  734.         amp = [self.damage.abs * 15 / 100, 1].max
  735.         self.damage += rand(amp+1) + rand(amp+1) - amp
  736.       end
  737.       # 第二命中判定
  738.       eva = 8 * self.agi / attacker.dex + self.eva
  739.       hit = self.damage < 0 ? 100 : 100 - eva
  740.       hit = self.cant_evade? ? 100 : hit
  741.       hit_result = (rand(100) < hit)
  742.     end
  743.     # 命中的情况下
  744.     if hit_result == true
  745.       # 状态冲击解除
  746.       remove_states_shock
  747.       # HP 的伤害计算
  748.       #self.hp -= self.damage
  749.       # 状态变化
  750.       @state_changed = false
  751.       states_plus(attacker.plus_state_set)
  752.       states_minus(attacker.minus_state_set)
  753.     # Miss 的情况下
  754.     else
  755.       # 伤害设置为 "Miss"
  756.       self.damage = "Miss"
  757.       # 清除会心一击标志
  758.       self.critical = false
  759.     end
  760.     # 过程结束
  761.     return true
  762.   end
  763.   #--------------------------------------------------------------------------
  764.   # ● 应用特技效果
  765.   #     user  : 特技的使用者 (battler)
  766.   #     skill : 特技
  767.   #--------------------------------------------------------------------------
  768.   def skill_effect(user, skill)
  769.     # 清除会心一击标志
  770.     self.critical = false
  771.     # 特技的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
  772.     # 或者特技的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
  773.     if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
  774.        ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
  775.       # 过程结束
  776.       return false
  777.     end
  778.     # 清除有效标志
  779.     effective = false
  780.     # 公共事件 ID 是有效的情况下,设置为有效标志
  781.     effective |= skill.common_event_id > 0
  782.     # 第一命中判定
  783.     hit = skill.hit
  784.     if skill.atk_f > 0
  785.       hit *= user.hit / 100
  786.     end
  787.     hit_result = (rand(100) < hit)
  788.     # 不确定的特技的情况下设置为有效标志
  789.     effective |= hit < 100
  790.     # 命中的情况下
  791.     if hit_result == true
  792.       # 计算威力
  793.       power = skill.power + user.atk * skill.atk_f / 100
  794.       if power > 0
  795.         power -= self.pdef * skill.pdef_f / 200
  796.         power -= self.mdef * skill.mdef_f / 200
  797.         power = [power, 0].max
  798.       end
  799.       # 计算倍率
  800.       rate = 20
  801.       rate += (user.str * skill.str_f / 100)
  802.       rate += (user.dex * skill.dex_f / 100)
  803.       rate += (user.agi * skill.agi_f / 100)
  804.       rate += (user.int * skill.int_f / 100)
  805.       # 计算基本伤害
  806.       self.damage = power * rate / 20
  807.       # 属性修正
  808.       self.damage *= elements_correct(skill.element_set)
  809.       self.damage /= 100
  810.       # 伤害符号正确的情况下
  811.       if self.damage > 0
  812.         # 防御修正
  813.         if self.guarding?
  814.           self.damage /= 2
  815.         end
  816.       end
  817.       # 分散
  818.       if skill.variance > 0 and self.damage.abs > 0
  819.         amp = [self.damage.abs * skill.variance / 100, 1].max
  820.         self.damage += rand(amp+1) + rand(amp+1) - amp
  821.       end
  822.       # 第二命中判定
  823.       eva = 8 * self.agi / user.dex + self.eva
  824.       hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
  825.       hit = self.cant_evade? ? 100 : hit
  826.       hit_result = (rand(100) < hit)
  827.       # 不确定的特技的情况下设置为有效标志
  828.       effective |= hit < 100
  829.     end
  830.     # 命中的情况下
  831.     if hit_result == true
  832.       # 威力 0 以外的物理攻击的情况下
  833.       if skill.power != 0 and skill.atk_f > 0
  834.         # 状态冲击解除
  835.         remove_states_shock
  836.         # 设置有效标志
  837.         effective = true
  838.       end
  839.       # HP 的伤害减法运算
  840.       last_hp = self.hp
  841.                         new_hp = self.hp - self.damage  #piaoy
  842.       #self.hp -= self.damage #piaoy
  843.       effective |= new_hp != last_hp
  844.       # 状态变化
  845.       @state_changed = false
  846.       effective |= states_plus(skill.plus_state_set)
  847.       effective |= states_minus(skill.minus_state_set)
  848.       # 威力为 0 的场合
  849.       if skill.power == 0
  850.         # 伤害设置为空的字串
  851.         self.damage = ""
  852.         # 状态没有变化的情况下
  853.         unless @state_changed
  854.           # 伤害设置为 "Miss"
  855.           self.damage = "Miss"
  856.         end
  857.       end
  858.     # Miss 的情况下
  859.     else
  860.       # 伤害设置为 "Miss"
  861.       self.damage = "Miss"
  862.     end
  863.     # 不在战斗中的情况下
  864.     unless $game_temp.in_battle
  865.       # 伤害设置为 nil
  866.       self.damage = nil
  867.     end
  868.     # 过程结束
  869.     return effective
  870.   end
  871.   #--------------------------------------------------------------------------
  872.   # ● 应用物品效果
  873.   #     item : 物品
  874.   #--------------------------------------------------------------------------
  875.   def item_effect(item)
  876.     # 清除会心一击标志
  877.     self.critical = false
  878.     # 物品的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
  879.     # 或者物品的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
  880.     if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
  881.        ((item.scope == 5 or item.scope == 6) and self.hp >= 1)
  882.       # 过程结束
  883.       return false
  884.     end
  885.     # 清除有效标志
  886.     effective = false
  887.     # 公共事件 ID 是有效的情况下,设置为有效标志
  888.     effective |= item.common_event_id > 0
  889.     # 命中判定
  890.     hit_result = (rand(100) < item.hit)
  891.     # 不确定的特技的情况下设置为有效标志
  892.     effective |= item.hit < 100
  893.     # 命中的情况
  894.     if hit_result == true
  895.       # 计算回复量
  896.       recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp
  897.       recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp
  898.       if recover_hp < 0
  899.         recover_hp += self.pdef * item.pdef_f / 20
  900.         recover_hp += self.mdef * item.mdef_f / 20
  901.         recover_hp = [recover_hp, 0].min
  902.       end
  903.       # 属性修正
  904.       recover_hp *= elements_correct(item.element_set)
  905.       recover_hp /= 100
  906.       recover_sp *= elements_correct(item.element_set)
  907.       recover_sp /= 100
  908.       # 分散
  909.       if item.variance > 0 and recover_hp.abs > 0
  910.         amp = [recover_hp.abs * item.variance / 100, 1].max
  911.         recover_hp += rand(amp+1) + rand(amp+1) - amp
  912.       end
  913.       if item.variance > 0 and recover_sp.abs > 0
  914.         amp = [recover_sp.abs * item.variance / 100, 1].max
  915.         recover_sp += rand(amp+1) + rand(amp+1) - amp
  916.       end
  917.       # 回复量符号为负的情况下
  918.       if recover_hp < 0
  919.         # 防御修正
  920.         if self.guarding?
  921.           recover_hp /= 2
  922.         end
  923.       end
  924.       # HP 回复量符号的反转、设置伤害值
  925.       self.damage = -recover_hp
  926.       # HP 以及 SP 的回复
  927.       last_hp = self.hp
  928.       last_sp = self.sp
  929.      new_hp = self.hp + recover_hp
  930.       new_sp = self.sp + recover_sp   
  931.            #self.hp += recover_hp  #piaoy       
  932.       self.sp += recover_sp  #piaoy
  933.       effective |= new_hp != last_hp
  934.       effective |= new_sp != last_sp
  935.       # 状态变化
  936.       @state_changed = false
  937.       effective |= states_plus(item.plus_state_set)
  938.       effective |= states_minus(item.minus_state_set)
  939.       # 能力上升值有效的情况下
  940.       if item.parameter_type > 0 and item.parameter_points != 0
  941.         # 能力值的分支
  942.         case item.parameter_type
  943.         when 1  # MaxHP
  944.           @maxhp_plus += item.parameter_points
  945.         when 2  # MaxSP
  946.           @maxsp_plus += item.parameter_points
  947.         when 3  # 力量
  948.           @str_plus += item.parameter_points
  949.         when 4  # 灵巧
  950.           @dex_plus += item.parameter_points
  951.         when 5  # 速度
  952.           @agi_plus += item.parameter_points
  953.         when 6  # 魔力
  954.           @int_plus += item.parameter_points
  955.         end
  956.         # 设置有效标志
  957.         effective = true
  958.       end
  959.       # HP 回复率与回复量为 0 的情况下
  960.       if item.recover_hp_rate == 0 and item.recover_hp == 0
  961.         # 设置伤害为空的字符串
  962.         self.damage = ""
  963.         # SP 回复率与回复量为 0、能力上升值无效的情况下
  964.         if item.recover_sp_rate == 0 and item.recover_sp == 0 and
  965.            (item.parameter_type == 0 or item.parameter_points == 0)
  966.           # 状态没有变化的情况下
  967.           unless @state_changed
  968.             # 伤害设置为 "Miss"
  969.             self.damage = "Miss"
  970.           end
  971.         end
  972.       end
  973.     # Miss 的情况下
  974.     else
  975.       # 伤害设置为 "Miss"
  976.       self.damage = "Miss"
  977.     end
  978.     # 不在战斗中的情况下
  979.     unless $game_temp.in_battle
  980.       # 伤害设置为 nil
  981.       self.damage = nil
  982.     end
  983.     # 过程结束
  984.     return effective
  985.   end
  986. end
  987. #==============================================================================
  988. # ■ Scene_Battle
  989. #------------------------------------------------------------------------------
  990. #  处理战斗画面的类。
  991. #==============================================================================
  992.  
  993. class Scene_Battle
  994.         #--------------------------------------------------------------------------
  995.         # ● 定义实例变量
  996.         #--------------------------------------------------------------------------
  997.         attr_reader   :animation1_id                    # 行动方动画ID
  998. end
  999.  
  1000. #==============================================================================
  1001. # ■ Game_Battler
  1002. #------------------------------------------------------------------------------
  1003. #  处理战斗者的类。这个类作为 Game_Actor 类与 Game_Enemy 类的
  1004. # 超级类来使用。
  1005. #==============================================================================
  1006.  
  1007. #class Game_Battler
  1008. #  #--------------------------------------------------------------------------
  1009. #  # ● 应用连续伤害效果
  1010. #  #--------------------------------------------------------------------------
  1011. #  alias rainbow_sword_slip_damage_effect slip_damage_effect
  1012. #  def slip_damage_effect
  1013. #    self.animation_id = RPG::SLIP_DAMAGE_ANIMATION_ID
  1014. #    self.animation_hit = true
  1015. #    rainbow_sword_slip_damage_effect
  1016. #  end
  1017. #end
  

点评

CR~
BUG好多。。。  发表于 2015-8-12 12:37
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1095
在线时间
381 小时
注册时间
2010-10-9
帖子
386

开拓者

4
发表于 2015-8-12 18:32:25 | 只看该作者
@CR~
能不能发一下彩虹神剑默认的数字图片还有你用的和显示敌人/自己 HP、SP用的脚本?

点评

CR~
我把整个工程都给上传了,,,麻烦了啊,谢谢。 http://yun.baidu.com/share/link?shareid=2519252984&uk=165951  发表于 2015-8-13 00:41
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1095
在线时间
381 小时
注册时间
2010-10-9
帖子
386

开拓者

5
发表于 2015-8-13 12:09:44 | 只看该作者
替换Data下的原文件试试(千万要备份)
另外:虽然还有很多不足,但我不能再做进一步修改了,希望看到此贴的坛友热心帮助楼主吧。
Scripts.rxdata (234.81 KB, 下载次数: 62)
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1238
在线时间
354 小时
注册时间
2009-9-14
帖子
328
6
 楼主| 发表于 2015-8-13 21:09:04 | 只看该作者
piaoy 发表于 2015-8-13 12:09
替换Data下的原文件试试(千万要备份)
另外:虽然还有很多不足,但我不能再做进一步修改了,希望看到此贴 ...

额额,感觉已经够强大了!
就是有两个地方,,,
1,伤害公式跟原来的不一样了。。
2,动画中的隐藏对象不会隐藏对象了。。。
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1095
在线时间
381 小时
注册时间
2010-10-9
帖子
386

开拓者

7
发表于 2015-8-14 08:38:12 | 只看该作者
你说的BUG修完了。动画必须加闪光否则没有伤害,比如保镖的脚刀就没有动画,顺便说一下有些动画你忘了做对象消失。
另外在第二个脚本里面有个设置,你可以自己做一个会闪光的动画把它的ID写在上面(比如我写的是是2000),这个动画会在状态加减血的时候播放,否则不能显示伤害。
不过加MP还是不能显示数字(怨念)
https://rpg.blue/forum.php?mod=attachment&aid=Mjg2OTE1fGQ4OWU4OTViNTdjOGRiZTdhNjUyOWM4YjE1YjYxNjFlfDE3MTQ2MTc1ODQ%3D&request=yes&_f=.rxdata

点评

CR~
额。。。大神,,能顺便儿帮我看一下为什么喝药不回血了么。。。谢谢,,,  发表于 2015-8-14 23:57
CR~
又没有动态扣血了,,,  发表于 2015-8-14 18:44
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1238
在线时间
354 小时
注册时间
2009-9-14
帖子
328
8
 楼主| 发表于 2015-8-16 10:48:36 | 只看该作者
piaoy 发表于 2015-8-14 08:38
你说的BUG修完了。动画必须加闪光否则没有伤害,比如保镖的脚刀就没有动画,顺便说一下有些动画你忘了做对 ...



不知道这么设置的话会回60滴血。。。

点评

CR~
十分感谢!  发表于 2015-8-16 11:19
请把Interpreter 7的129行内容前加一个# 就像这样:#battler.hp -= value  发表于 2015-8-16 11:15
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 10:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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