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

Project1

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

[已经解决] 求一个老物,彩虹神剑修改版用到的美化字

[复制链接]

Lv3.寻梦者

梦石
1
星屑
985
在线时间
231 小时
注册时间
2006-2-3
帖子
82
跳转到指定楼层
1
发表于 2019-10-26 11:05:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
用到的图片应该是
damage.png
number.png
number2.png
number3.png
HITS.png

论坛搜到了相关帖子,但是文件已经无法下载了,图片也无法显示。
另外,咱还有个很苦恼的问题,图片美化字的字体大小太小,如何扩大图片切割范围,我感觉至少提高1倍才够用.....


  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. #==============================================================================
  5. # ☆ 忧雪の伤整合,转载时请保留。
  6. #==============================================================================
  7. #==============================================================================
  8. # ■ 彩虹神剑新修改版与全状态动画整合版
  9. #------------------------------------------------------------------------------
  10. #   彩虹神剑 by 柳柳
  11. #   v1.0 -叶子
  12. #   v1.0a -叶子
  13. #   v1.0b -叶子
  14. #   v1.0c -柳柳
  15. #   v1.0d -柳柳
  16. #   v1.0e -叶子
  17. #   新修改版 -cftx
  18. #   同时显示多个状态动画原脚本 -后知后觉
  19. #   加入多状态动画显示 -忧雪之伤
  20. #==============================================================================

  21. # 一次最多显示多少个状态动画
  22. HZHJ_STATE_ANIMATION_ADD_NUMBER = 10

  23. class Game_Temp
  24.   attr_accessor :phase4step5
  25.   alias hzhj_ini initialize
  26.   def initialize
  27.     @phase4step5 = false
  28.     hzhj_ini
  29.   end
  30. end
  31. class Scene_Battle
  32.   alias hzhj_update_phase4_step2 update_phase4_step2
  33.   def update_phase4_step2
  34.     $game_temp.phase4step5 = false
  35.     hzhj_update_phase4_step2
  36.   end
  37.   alias hzhj_update_phase4_step5 update_phase4_step5
  38.   def update_phase4_step5
  39.     $game_temp.phase4step5 = true
  40.     hzhj_update_phase4_step5
  41.   end
  42. end

  43. module RPG
  44. #--------------------------------------------------------------------------
  45. # ● 常量设定
  46. #--------------------------------------------------------------------------
  47. # 是否显示总伤害
  48. SHOW_TOTAL_DAMAGE = true
  49. # 角色受攻击时是否跳一下
  50. BATTLER_JUMP = true
  51. # 连续伤害的动画ID
  52. SLIP_DAMAGE_ANIMATION_ID = 4

  53. class Sprite < ::Sprite
  54.    #==========================================
  55.    # 修改说明:
  56.    # @flash_shake用来制作挨打时候跳跃
  57.    # @_damage    用来记录每次打击之后弹出数字
  58.    # @_total_damage 记录总伤害
  59.    # @_total_damage_duration 总伤害持续帧
  60.    #==========================================
  61.    #alias 66RPG_rainbow_initialize : initialize
  62.    
  63.    def initialize(viewport = nil)
  64.      #66RPG_rainbow_initialize(viewport)
  65.      super(viewport)
  66.      @_whiten_duration = 0
  67.      @_appear_duration = 0
  68.      @_escape_duration = 0
  69.      @_collapse_duration = 0
  70.      @_damage_duration = 0
  71.      @_animation_duration = 0
  72.      @_blink = false
  73.      # 挨打时候跳跃
  74.      @flash_shake = 0
  75.      # 伤害记录数组
  76.      @_damage = []
  77.      # 总伤害数字
  78.      @_total_damage = 0
  79.      # 总伤害持续帧
  80.      @_total_damage_duration = 0
  81.      #记录已经发生的伤害的变量★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  82.      @p_dam=0
  83.      @hits=0
  84.    end
  85. #美化的伤害处理★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  86. def damage(value, critical)
  87.       # 释放伤害,效果是伤害数字快速消失,觉得不如不消失好看......
  88.       #dispose_damage
  89.       #清除hit数
  90.       dispose_hit
  91.       # 如果伤害值是数值
  92.       if value.is_a?(Numeric)
  93.         # 绝对值转为字符串
  94.         damage_string = value.abs.to_s
  95.       else
  96.         # 转为字符串
  97.         damage_string = value.to_s
  98.       end
  99.       # 初始化位图
  100.       bitmap = Bitmap.new(162, 64)
  101.       bitmap.font.name = ["黑体","华文行楷", "宋体"]
  102.       bitmap.font.size = 32
  103.       # 伤害值是数值的情况下
  104.       if value.is_a?(Numeric)
  105.         # 分割伤害值字符串
  106.         damage_array = damage_string.scan(/./)
  107.         damage_x = 81 - damage_string.size * 9
  108.         # 伤害值为负的情况下
  109.         if value < 0
  110.           # 调用回复数字表
  111.           rect_y = 32
  112.         else
  113.           # 调用伤害数字表
  114.           rect_y = 0
  115.         end
  116.         # 循环伤害值字符串
  117.         for char in damage_array
  118.           number = char.to_i
  119.           # 显示伤害数字
  120.           bitmap.blt(damage_x, 32, RPG::Cache.picture("Damage"),
  121.           Rect.new(number * 18, rect_y, 18, 32))
  122.           # 后移一位
  123.           damage_x += 18
  124.         end
  125.       # 伤害值不是数值的情况
  126.       else
  127.         # 如果伤害值不是 Miss
  128.         unless value == "Miss"
  129.           # 系统默认描画字符串
  130.           bitmap.font.color.set(0, 0, 0)
  131.           bitmap.draw_text(-1, 27, 162, 36, damage_string, 1)
  132.           bitmap.draw_text(+1, 27, 162, 36, damage_string, 1)
  133.           bitmap.draw_text(-1, 29, 162, 36, damage_string, 1)
  134.           bitmap.draw_text(+1, 29, 162, 36, damage_string, 1)
  135.           bitmap.font.color.set(255, 255, 255)
  136.           bitmap.draw_text(0, 28, 162, 36, damage_string, 1)
  137.         # Miss 的情况下
  138.         else
  139.           # 显示未击中图画
  140.           bitmap.blt(36, 28, RPG::Cache.picture("Damage"), Rect.new(90, 64, 90, 32))
  141.         end
  142.       end
  143.       # 会心一击标志打开的情况
  144.       if critical
  145.         # 显示会心一击图画
  146.         bitmap.blt(36, 0, RPG::Cache.picture("Damage"), Rect.new(0, 64, 90, 32))
  147.       end
  148.       # 伤害值定位
  149.       @_damage_sprite = ::Sprite.new(self.viewport)
  150.       @_damage_sprite.bitmap = bitmap
  151.       @_damage_sprite.ox = 81
  152.       @_damage_sprite.oy = 20
  153.       @_damage_sprite.x = self.x
  154.       @_damage_sprite.y = self.y - self.oy / 2
  155.       @_damage_sprite.z = 3000
  156.       @_damage_duration = 40
  157.       @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
  158.       make_total_damage(value)  

  159.     end

  160. #   ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  161. # hit数的美化描绘
  162.     def hit

  163.       # 如果伤害值是数值
  164.       # 转为字符串
  165.       value=@hits
  166.         hits_string = value.to_s
  167.       # 初始化位图
  168.        bitmap = Bitmap.new(320, 64)
  169.        bitmap.font.name = "Arial Black"
  170.        bitmap.font.size = 32
  171.        # 分割伤害值字符串
  172.         hits_array = hits_string.scan(/./)
  173.         hits_x = 81 - hits_string.size * 18.1
  174.           rect_y = 0
  175.         # 循环伤害值字符串
  176.         for char in hits_array
  177.           number = char.to_i
  178.           # 显示伤害数字
  179.           bitmap.blt(hits_x, 0, RPG::Cache.picture("Number"),
  180.           Rect.new(number * 36.2, rect_y, 36.2, 50))
  181.           # 后移一位
  182.           hits_x += 36.2
  183.         end
  184.         bitmap.blt(hits_x, 0, RPG::Cache.picture("HITS"),
  185.         Rect.new(0, -21, 90, 50))

  186.       # 伤害值定位
  187.       @_hits_sprite = ::Sprite.new(self.viewport)
  188.       @_hits_sprite.bitmap = bitmap
  189.       @_hits_sprite.ox = 81
  190.       @_hits_sprite.oy = 20
  191.       @_hits_sprite.x = 500
  192.       @_hits_sprite.y = 100
  193.       @_hits_sprite.z = 3000
  194.       @_hits_duration = 40
  195.     end
  196. #--------------------------------------------------------------------------
  197.    # ● 总伤害处理
  198.    #--------------------------------------------------------------------------
  199.    def make_total_damage(value)
  200.      if value.is_a?(Numeric) and SHOW_TOTAL_DAMAGE
  201.        @_total_damage += value
  202.         # 绝对值转为字符串
  203.         damage_string = @_total_damage.abs.to_s
  204.       else
  205.         return
  206.       end
  207.       # 初始化位图
  208.       bitmap = Bitmap.new(300, 150)
  209.       bitmap.font.name = "Arial Black"
  210.       bitmap.font.size = 32
  211.       # 伤害值是数值的情况下
  212.       if value.is_a?(Numeric)
  213.         # 分割伤害值字符串
  214.         damage_array = damage_string.scan(/./)
  215.         damage_x = 40 - damage_string.size * 9
  216.         # 伤害值为负的情况下
  217.         if value < 0
  218.           # 调用回复数字表
  219.           name="Number3"
  220.         else
  221.           # 调用伤害数字表
  222.           name="Number2"
  223.         end
  224.         # 循环伤害值字符串
  225.         for char in damage_array
  226.           number = char.to_i
  227.           # 显示伤害数字
  228.           bitmap.blt(damage_x, 0, RPG::Cache.picture(name),
  229.           Rect.new(number * 36.2, 0, 36.2, 50))
  230.           # 后移一位
  231.           damage_x += 36.2
  232.         end
  233.       end
  234.       
  235.       
  236.         
  237.         
  238. #     if value.is_a?(Numeric) and SHOW_TOTAL_DAMAGE
  239. #       @_total_damage += value
  240. #     else
  241. #       return
  242. #     end
  243. #     bitmap = Bitmap.new(300, 150)
  244. #     bitmap.font.name = "Arial Black"
  245. #     bitmap.font.size = 40
  246. #     bitmap.font.color.set(0, 0, 0)
  247. #     bitmap.draw_text(+2, 12+2, 160, 40, @_total_damage.abs.to_s, 1)
  248. #     if @_total_damage < 0
  249. #       bitmap.font.color.set(80, 255, 00)
  250. #    else
  251. #       bitmap.font.color.set(255, 140, 0)
  252. #     end
  253. #     bitmap.draw_text(0, 12, 160, 40, @_total_damage.abs.to_s, 1)
  254. #     bitmap.font.color.set(55, 55,255)
  255.      
  256.      
  257.      if @_total_damage_sprite.nil?
  258.        @_total_damage_sprite = ::Sprite.new(self.viewport)
  259.        @_total_damage_sprite.ox = 80
  260.        @_total_damage_sprite.oy = 20
  261.        @_total_damage_sprite.z = 3000

  262.      end
  263.      @_total_damage_sprite.bitmap = bitmap
  264.      @_total_damage_sprite.zoom_x = 0.8
  265.      @_total_damage_sprite.zoom_y = 0.8
  266.      @_total_damage_sprite.x = self.x
  267.      @_total_damage_sprite.y = self.y  - self.oy / 2 - 64
  268.      @_total_damage_sprite.z = 3001
  269.      @_total_damage_duration = 80
  270.      #hit数描绘
  271.      @hits+=1
  272.     if @_total_damage > 0
  273.       hit
  274.     end
  275.    end


  276.    def animation(animation, hit, battler_damage="", battler_critical=false)
  277.      dispose_animation      
  278.      #=======================================
  279.      # 修改:记录伤害和critical
  280.      #=======================================
  281.      @battler_damage = battler_damage
  282.      @battler_critical = battler_critical
  283.      @_animation = animation
  284.      return if @_animation == nil
  285.      @_animation_hit = hit
  286.      @_animation_duration = @_animation.frame_max
  287.      animation_name = @_animation.animation_name
  288.      animation_hue = @_animation.animation_hue
  289.      bitmap = RPG::Cache.animation(animation_name, animation_hue)
  290.      #=======================================
  291.      # 修改:计算总闪光权限值
  292.      #=======================================
  293.      for timing in @_animation.timings
  294.        quanzhong = animation_process_timing(timing, @_animation_hit,true)
  295.        @all_quanzhong += quanzhong
  296.        # 记录最后一次闪光
  297.        @_last_frame = timing.frame if quanzhong != 0
  298.      end      
  299.      if @@_reference_count.include?(bitmap)
  300.        @@_reference_count[bitmap] += 1
  301.      else
  302.        @@_reference_count[bitmap] = 1
  303.      end
  304.      #=======================================
  305.      # 修改:行动方动画不显示伤害
  306.      #=======================================
  307.      if $scene.is_a?(Scene_Battle)
  308.        if $scene.animation1_id == @battler.animation_id
  309.          @battler_damage = ""
  310.        end
  311.      end
  312.      @_animation_sprites = []
  313.      if @_animation.position != 3 or not @@_animations.include?(animation)
  314.        for i in 0..15
  315.          sprite = ::Sprite.new(self.viewport)
  316.          sprite.bitmap = bitmap
  317.          sprite.visible = false
  318.          @_animation_sprites.push(sprite)
  319.        end
  320.        unless @@_animations.include?(animation)
  321.          @@_animations.push(animation)
  322.        end
  323.      end
  324.      update_animation
  325.   end
  326.    #=======================================
  327.    # 修改:更换清除伤害的算法,以防万一
  328.    #       本内容在脚本中没有使用过
  329.    #=======================================
  330.    def dispose_damage
  331.      for damage in @_damage.reverse
  332.        damage[0].bitmap.dispose
  333.        damage[0].dispose
  334.        @_damage.delete(damage)
  335.      end
  336.      @_total_damage = 0
  337.      @_last_frame = -1
  338.      if @_total_damage_sprite != nil
  339.        @_total_damage_duration = 0
  340.        @_total_damage_sprite.bitmap.dispose
  341.        @_total_damage_sprite.dispose
  342.        @_total_damage_sprite = nil
  343.      end
  344.    end
  345.    #=======================================
  346.    # 清除hit数★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  347.    #=======================================
  348.    def dispose_hit
  349.      if @_hits_sprite != nil
  350.        @_hits_sprite.bitmap.dispose
  351.        @_hits_sprite.dispose
  352.        @_hits_sprite = nil
  353.      end
  354.    end
  355.    def dispose_animation
  356.      #=======================================
  357.      # 修改:清除记录的伤害,清除权重记录
  358.      #=======================================
  359.      @battler_damage = nil
  360.      @battler_critical = nil
  361.      @all_quanzhong = 1
  362.      @_total_damage = 0
  363.      @_last_frame = -1
  364.      if @_animation_sprites != nil
  365.        sprite = @_animation_sprites[0]
  366.        if sprite != nil
  367.          @@_reference_count[sprite.bitmap] -= 1
  368.          if @@_reference_count[sprite.bitmap] == 0
  369.            sprite.bitmap.dispose
  370.          end
  371.        end
  372.        for sprite in @_animation_sprites
  373.          sprite.dispose
  374.        end
  375.        @_animation_sprites = nil
  376.        @_animation = nil
  377.      end
  378.    end
  379.    def update
  380.      super
  381.      if @_whiten_duration > 0
  382.        @_whiten_duration -= 1
  383.        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  384.      end
  385.      if @_appear_duration > 0
  386.        @_appear_duration -= 1
  387.        self.opacity = (16 - @_appear_duration) * 16
  388.      end
  389.      if @_escape_duration > 0
  390.        @_escape_duration -= 1
  391.        self.opacity = 256 - (32 - @_escape_duration) * 10
  392.      end
  393.      if @_collapse_duration > 0
  394.        @_collapse_duration -= 1
  395.        self.opacity = 256 - (48 - @_collapse_duration) * 6
  396.      end
  397.      #=======================================
  398.      # 修改:更新算法,更新弹出
  399.      #=======================================
  400.      if @_damage_duration > 0
  401.        @_damage_duration -= 1
  402.        for damage in @_damage
  403.          damage[0].x = self.x + self.viewport.rect.x -
  404.                        self.ox + self.src_rect.width / 2 +
  405.                        (40 - damage[1]) * damage[3] / 10
  406.          damage[0].y -= damage[4]+damage[1]/10
  407.          damage[0].opacity = damage[1]*20
  408.          damage[1] -= 1
  409.          if damage[1]==0
  410.            damage[0].bitmap.dispose
  411.            damage[0].dispose
  412.            @_damage.delete(damage)

  413.            next
  414.          end
  415.        end
  416.      end
  417.      #=======================================
  418.      # 添加:弹出总伤害
  419.      #=======================================
  420.      if @_total_damage_duration > 0
  421.        @_total_damage_duration -= 1
  422.        @_total_damage_sprite.y -= 1 if @_total_damage_duration % 2 == 0
  423.        if @_total_damage_sprite.zoom_x > 1.0
  424.          @_total_damage_sprite.zoom_x -= 0.05
  425.        end
  426.        if @_total_damage_sprite.zoom_y > 1.0
  427.          @_total_damage_sprite.zoom_y -= 0.05
  428.        end
  429.        @_total_damage_sprite.opacity = 256 - (24 - @_total_damage_duration) * 16
  430.        if @_total_damage_duration <= 0
  431.          dispose_hit#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  432.          @_total_damage = 0
  433.          @_total_damage_duration = 0
  434.          @_total_damage_sprite.bitmap.dispose
  435.          @_total_damage_sprite.dispose
  436.          @_total_damage_sprite = nil
  437.        end
  438.      end
  439.      #=======================================
  440.      if @_animation != nil and (Graphics.frame_count % 2 == 0)
  441.        @_animation_duration -= 1
  442.        update_animation
  443.      end
  444.      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  445.        update_loop_animation
  446.        @_loop_animation_index += 1
  447.        @_loop_animation_index %= @_loop_animation.frame_max
  448.      end
  449.      if @_blink
  450.        @_blink_count = (@_blink_count + 1) % 32
  451.        if @_blink_count < 16
  452.          alpha = (16 - @_blink_count) * 6
  453.        else
  454.          alpha = (@_blink_count - 16) * 6
  455.        end
  456.        self.color.set(255, 255, 255, alpha)
  457.      end
  458.      @@_animations.clear
  459.    end
  460.    def update_animation
  461.     if @_animation_duration > 0
  462.        frame_index = @_animation.frame_max - @_animation_duration
  463.        cell_data = @_animation.frames[frame_index].cell_data
  464.        position = @_animation.position
  465.        animation_set_sprites(@_animation_sprites, cell_data, position)
  466.        #=======================================
  467.        # 修改:弹出伤害,权重计算
  468.        #=======================================
  469.        for timing in @_animation.timings
  470.          if timing.frame == frame_index
  471.            t = 1.0 * animation_process_timing(timing, @_animation_hit)  
  472.                    if timing.se.name != ""
  473.           se=timing.se
  474.           Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
  475.         end
  476.            #p t,"当前权重", @all_quanzhong,"总权重"
  477.            if @battler_damage.is_a?(Numeric) and t != 0
  478.              t *= @battler_damage
  479.              t /= @all_quanzhong
  480.              t = t.to_i
  481.              #在闪光不是最后一次的情况下,把这次伤害加入到已经发生的伤害中★★★★★★★★★★★★★★★★★★★★★★★★★★
  482.              if frame_index != @_last_frame
  483.              @p_dam+= t
  484.              end
  485.              #p @p_dam,"已发生伤害",@battler_damage,"总伤害"(调试用)★★★★★★★★★★★★★★★★★★★★★★★★★★
  486.              #闪光为最后一次的情况下,改变这次伤害的计算方法(总伤害-已经发生伤害)★★★★★★★★★★★★★★★★★★★★★★★★★★
  487.              if frame_index == @_last_frame
  488.                t=@battler_damage-@p_dam
  489.              end
  490.              #p t,"当前伤害",@battler_damage,"总伤害"
  491.              # 最后一次闪光的话,伤害修正
  492.              if frame_index == @_last_frame
  493.                @_total_damage = @battler_damage - t
  494.                @p_dam=0      #已经发生的伤害归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  495.             end
  496.              #p t,@battler_damage,@all_quanzhong
  497.              damage(t,@battler_critical)
  498.             #连击次数归0★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  499.             if frame_index == @_last_frame
  500.                       @hits=0  
  501.             end
  502.            # 防止重复播放miss
  503.            elsif !@battler_damage.is_a?(Numeric) and timing.flash_scope != 0
  504.              damage(@battler_damage,@battler_critical)
  505.            end
  506.          end
  507.        end
  508.      else
  509.        dispose_animation
  510.      end
  511.    end
  512.    #=======================================
  513.    # 修改:敌人跳跃的功能 + 添加返回数值
  514.    #=======================================
  515.     def animation_process_timing(timing, hit,dontflash=false)
  516.       if (timing.condition == 0) or
  517.          (timing.condition == 1 and hit == true) or
  518.          (timing.condition == 2 and hit == false)
  519.         case timing.flash_scope
  520.         when 1
  521.           unless dontflash
  522.             self.flash(timing.flash_color, timing.flash_duration * 2)
  523.             if @_total_damage >0
  524.               @flash_shake_switch = true
  525.               @flash_shake = 10
  526.             end
  527.           end
  528.           return timing.flash_color.alpha * timing.flash_duration
  529.         when 2
  530.           unless dontflash
  531.             if self.viewport != nil
  532.               self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
  533.             end
  534.           end
  535.           return timing.flash_color.alpha * timing.flash_duration
  536.         when 3
  537.           unless dontflash
  538.             self.flash(nil, timing.flash_duration * 2)
  539.           end
  540.           return timing.flash_color.alpha * timing.flash_duration
  541.         end
  542.       end      
  543.       return 0
  544.     end   
  545. end
  546. end
  547. #==============================================================================
  548. # ■ Sprite_Battler
  549. #==============================================================================
  550. class Sprite_Battler < RPG::Sprite
  551.   attr_accessor :battler   
  552. #--------------------------------------------------------------------------
  553. # ● 初始化对像
  554. #    添加跳跃记录
  555. #--------------------------------------------------------------------------
  556. def initialize(viewport, battler = nil)
  557.   super(viewport)
  558.   @battler = battler
  559.   @battler_visible = false
  560.   @flash_shake_switch = true
  561. # 多状态动画 1/8
  562.     @state_sprites = []
  563.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  564.     @state_sprites.push(RPG::Sprite.new(viewport))
  565.     end
  566.   end
  567.   def dispose
  568. #####################################################################
  569. # 多状态动画 2/8
  570.     for hzhj in @state_sprites
  571.       hzhj.dispose
  572.     end
  573.     if self.bitmap != nil
  574.       self.bitmap.dispose
  575.     end
  576.     super
  577.   end
  578. #--------------------------------------------------------------------------
  579. # ● 刷新画面
  580. #    增添跳跃功能
  581. #--------------------------------------------------------------------------
  582. def update
  583.   super
  584.     for hzhj in @state_sprites
  585.       hzhj.update
  586.     end
  587.   # 战斗者为 nil 的情况下
  588.   if @battler == nil
  589.     self.bitmap = nil
  590.     loop_animation(nil)
  591.       for hzhj in @state_sprites
  592.         hzhj.loop_animation(nil)
  593.       end
  594.     return
  595.   end
  596.   # 文件名和色相与当前情况有差异的情况下
  597.   if @battler.battler_name != @battler_name or
  598.      @battler.battler_hue != @battler_hue
  599.     # 获取、设置位图
  600.     @battler_name = @battler.battler_name
  601.     @battler_hue = @battler.battler_hue
  602.     self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  603.     @width = bitmap.width
  604.     @height = bitmap.height
  605.     self.ox = @width / 2
  606.     self.oy = @height
  607.     # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  608.     if @battler.dead? or @battler.hidden
  609.       self.opacity = 0
  610.     end
  611.   end
  612.   # 动画 ID 与当前的情况有差异的情况下
  613.   if @battler.damage == nil and
  614.      @battler.state_animation_id != @state_animation_id
  615.     @state_animation_id = @battler.state_animation_id
  616.     loop_animation($data_animations[@state_animation_id])
  617.   end
  618.   if @battler.damage == nil and $game_temp.phase4step5
  619.       for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  620.         if @battler.states[i+1] != nil
  621.           @state_sprites[i].loop_animation($data_animations[$data_states[@battler.states[i+1]].animation_id])
  622.           @state_sprites[i].x = self.x
  623.           @state_sprites[i].y = self.y
  624.           @state_sprites[i].z = self.z
  625.           @state_sprites[i].ox = self.ox
  626.           @state_sprites[i].oy = self.oy
  627.           @state_sprites[i].opacity = self.opacity
  628.           @state_sprites[i].visible = self.visible
  629.           @state_sprites[i].src_rect = self.src_rect
  630.         else
  631.           @state_sprites[i].loop_animation($data_animations[0])
  632.         end
  633.       end
  634.     end
  635.   # 应该被显示的角色的情况下
  636.   if @battler.is_a?(Game_Actor) and @battler_visible
  637.     # 不是主状态的时候稍稍降低点透明度
  638.     if $game_temp.battle_main_phase
  639.       self.opacity += 3 if self.opacity < 255
  640.     else
  641.       self.opacity -= 3 if self.opacity > 207
  642.     end
  643.   end
  644.   # 明灭
  645.   if @battler.blink
  646.     blink_on
  647.   else
  648.     blink_off
  649.   end
  650.   # 不可见的情况下
  651.   unless @battler_visible
  652.     # 出现
  653.     if not @battler.hidden and not @battler.dead? and
  654.        (@battler.damage == nil or @battler.damage_pop)
  655.        # 多状态动画 6/8
  656.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  657.       if @battler.states[i+1] != nil
  658.         @state_sprites[i].loop_animation($data_animations[$data_states[@battler.states[i+1]].animation_id])
  659.         @state_sprites[i].x = self.x
  660.         @state_sprites[i].y = self.y
  661.         @state_sprites[i].z = self.z
  662.         @state_sprites[i].ox = self.ox
  663.         @state_sprites[i].oy = self.oy
  664.         @state_sprites[i].opacity = self.opacity
  665.         @state_sprites[i].visible = self.visible
  666.         @state_sprites[i].src_rect = self.src_rect
  667.       else
  668.         @state_sprites[i].loop_animation($data_animations[0])
  669.       end
  670.     end
  671.       appear
  672.       @battler_visible = true
  673.     end
  674.   end
  675.   # 可见的情况下
  676.   if @battler_visible
  677.     # 逃跑
  678.     if @battler.hidden
  679.       $game_system.se_play($data_system.escape_se)
  680.       # 多状态动画 7/8
  681.     for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  682.       if @battler.states[i+1] != nil
  683.         @state_sprites[i].loop_animation($data_animations[$data_states[@battler.states[i+1]].animation_id])
  684.         @state_sprites[i].x = self.x
  685.         @state_sprites[i].y = self.y
  686.         @state_sprites[i].z = self.z
  687.         @state_sprites[i].ox = self.ox
  688.         @state_sprites[i].oy = self.oy
  689.         @state_sprites[i].opacity = self.opacity
  690.         @state_sprites[i].visible = self.visible
  691.         @state_sprites[i].src_rect = self.src_rect
  692.       else
  693.         @state_sprites[i].loop_animation($data_animations[0])
  694.       end
  695.     end
  696.       escape
  697.       @battler_visible = false
  698.     end
  699.     # 白色闪烁
  700.     if @battler.white_flash
  701.       whiten
  702.       @battler.white_flash = false
  703.     end
  704.     # 动画
  705.     if @battler.animation_id != 0
  706.       animation = $data_animations[@battler.animation_id]
  707.       animation(animation, @battler.animation_hit,@battler.damage, @battler.critical)
  708.       @battler.animation_id = 0
  709.     end
  710.     # 伤害
  711.     if @battler.damage_pop
  712.       @battler.damage = nil
  713.       @battler.critical = false
  714.       @battler.damage_pop = false
  715.     end
  716.     # korapusu
  717.     if @battler.damage == nil and @battler.dead?
  718.       if @battler.is_a?(Game_Enemy)
  719.         $game_system.se_play($data_system.enemy_collapse_se)
  720.       else
  721.         $game_system.se_play($data_system.actor_collapse_se)
  722.       end
  723.       # 多状态动画 8/8
  724.       for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
  725.         if @battler.states[i+1] != nil
  726.           @state_sprites[i].loop_animation($data_animations[$data_states[@battler.states[i+1]].animation_id])
  727.           @state_sprites[i].x = self.x
  728.           @state_sprites[i].y = self.y
  729.           @state_sprites[i].z = self.z
  730.           @state_sprites[i].ox = self.ox
  731.           @state_sprites[i].oy = self.oy
  732.           @state_sprites[i].opacity = self.opacity
  733.           @state_sprites[i].visible = self.visible
  734.           @state_sprites[i].src_rect = self.src_rect
  735.         else
  736.           @state_sprites[i].loop_animation($data_animations[0])
  737.         end
  738.       end
  739.       collapse
  740.       @battler_visible = false
  741.     end
  742.   end
  743.   # 设置活动块的坐标
  744.   if @flash_shake_switch == true
  745.     self.x = @battler.screen_x
  746.     self.y = @battler.screen_y
  747.     self.z = @battler.screen_z
  748.     @flash_shake_switch = false
  749.   end
  750.   if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
  751.     case @flash_shake
  752.     when 9..10
  753.       self.x = @battler.screen_x
  754.       self.y -=4
  755.       self.z = @battler.screen_z
  756.     when 6..8
  757.       self.x = @battler.screen_x
  758.       self.y -=2
  759.       self.z = @battler.screen_z
  760.     when 3..5
  761.       self.x = @battler.screen_x
  762.       self.y +=2
  763.       self.z = @battler.screen_z
  764.     when 2
  765.       self.x = @battler.screen_x
  766.       self.y += 4
  767.       self.z = @battler.screen_z
  768.     when 1
  769.       self.x = @battler.screen_x
  770.       self.y = @battler.screen_y
  771.       self.z = @battler.screen_z
  772.     end
  773.     @flash_shake -= 1
  774.   end
  775. end
  776. end

  777. #==============================================================================
  778. # ■ Scene_Battle
  779. #------------------------------------------------------------------------------
  780. #  处理战斗画面的类。
  781. #==============================================================================

  782. class Scene_Battle
  783. #--------------------------------------------------------------------------
  784. # ● 定义实例变量
  785. #--------------------------------------------------------------------------
  786. attr_reader   :animation1_id                    # 行动方动画ID
  787. end

  788. #==============================================================================
  789. # ■ Game_Battler
  790. #------------------------------------------------------------------------------
  791. #  处理战斗者的类。这个类作为 Game_Actor 类与 Game_Enemy 类的
  792. # 超级类来使用。
  793. #==============================================================================

  794. class Game_Battler
  795. #  #--------------------------------------------------------------------------
  796. #  # ● 应用连续伤害效果
  797. #  #--------------------------------------------------------------------------
  798.   alias rainbow_sword_slip_damage_effect slip_damage_effect
  799.   def slip_damage_effect
  800.     self.animation_id = RPG::SLIP_DAMAGE_ANIMATION_ID
  801.     self.animation_hit = true
  802.     rainbow_sword_slip_damage_effect
  803.   end
  804. end
  805. #==============================================================================
  806. # ☆ 忧雪の伤制作,转载时请保留。
  807. #==============================================================================
  808. #==============================================================================
  809. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  810. #==============================================================================
复制代码

Lv3.寻梦者

梦石
1
星屑
985
在线时间
231 小时
注册时间
2006-2-3
帖子
82
2
 楼主| 发表于 2019-10-26 15:50:03 | 只看该作者
自己研究了下,搞定了.......
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
7
星屑
650
在线时间
130 小时
注册时间
2011-5-12
帖子
135
3
发表于 2020-1-16 15:47:39 | 只看该作者
zsefvv 发表于 2019-10-26 15:50
自己研究了下,搞定了.......

请问是怎么搞定的, 我现在需要这东西了呜呜呜
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 23:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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