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

Project1

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

[已经解决] 请求为这个连段脚本添加时间槽

[复制链接]

Lv1.梦旅人

梦石
0
星屑
46
在线时间
1502 小时
注册时间
2010-8-27
帖子
392
跳转到指定楼层
1
发表于 2013-10-23 08:06:28 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
4星屑
  1. #==============================================================================
  2. # +++ MOG XP - Combo Display V1.0 +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com/
  6. #==============================================================================
  7. # ■ Apresenta a quantidade de acertos no alvo e o dano maximo.
  8. # ---------------------------------------------------------------------------
  9. # É necessário ter os arquivos imagens na pasta Graphics/Windoskins.
  10. # Combo_Damage.png
  11. # Combo_Hud.png
  12. # Combo_Number.png
  13. #==============================================================================
  14. module MOG_COMBO_DISPLAY
  15.   #Ativar tempo para fazer combo.
  16.   TIME_COUNT = true
  17.   # Tempo para fazer um combo. (40 = 1s)
  18.   COMBO_TIME = 200#★连段的等待时间,请增加一个值槽表示等待时间的减少,等待时间为0时值槽不显示
  19.   # Cancelar a contagem de Combo caso o inimigo acertar o herói.
  20.   ENEMY_CANCEL_COMBO = true
  21.   # Posição geral das imagens. X Y
  22.   COMBO_POSITION = [10,80]
  23.   # Posição do número de HITS. X Y
  24.   HIT_POSITION = [15,20]
  25.   # Posição do número de dano. X Y
  26.   TOTAL_POSITION = [60,-20]
  27.   # Prioridade das imagens.
  28.   PRIORITY_Z = 50
  29. end

  30. #===============================================================================
  31. # ■ Game_Temp
  32. #===============================================================================
  33. class Game_Temp
  34.    attr_accessor :combo_hit
  35.    attr_accessor :max_damage   
  36.    attr_accessor :combo_time  
  37.   #--------------------------------------------------------------------------
  38.   # ● initialize
  39.   #--------------------------------------------------------------------------   
  40.    alias mog_combo_display_initialize initialize
  41.    def initialize
  42.        @combo_hit = 0
  43.        @max_damage = 0  
  44.        @combo_time = 0   
  45.        mog_combo_display_initialize
  46.    end
  47. end

  48. #===============================================================================
  49. # ■ Combo_Sprite_Hud
  50. #===============================================================================
  51. class Combo_Sprite_Hud < Sprite
  52.    attr_accessor :combo_wait
  53.    include MOG_COMBO_DISPLAY
  54.    
  55.   #--------------------------------------------------------------------------
  56.   # ● Initialize
  57.   #--------------------------------------------------------------------------
  58.   def initialize
  59.      super  
  60.      @combo_wait = false
  61.      $game_temp.combo_time = 0
  62.      $game_temp.combo_hit = 0
  63.      $game_temp.max_damage = 0     
  64.      @combo_hit_old = 0
  65.      @animation_speed = 0
  66.      @pos_x = COMBO_POSITION[0]
  67.      @pos_x_fix = 0
  68.      @pos_y = COMBO_POSITION[1]
  69.      create_combo_sprite
  70.      create_total_damage_sprite     
  71.      create_hud_sprite     
  72.    end      

  73.   #--------------------------------------------------------------------------
  74.   # ● Create Hud Sprite   
  75.   #--------------------------------------------------------------------------
  76.   def create_hud_sprite   
  77.        @hud = Sprite.new
  78.        @hud.bitmap = RPG::Cache.windowskin("Combo_HUD")
  79.        @hud.z = PRIORITY_Z
  80.        @hud.x = COMBO_POSITION[0]
  81.        @hud.y = COMBO_POSITION[1]
  82.        @hud.opacity = 250
  83.        @hud.visible = false
  84.   end     

  85.   #--------------------------------------------------------------------------
  86.   # ● Create Total Damage Sprite
  87.   #--------------------------------------------------------------------------
  88.   def create_total_damage_sprite   
  89.        @total_image = RPG::Cache.windowskin("Combo_damage")
  90.        @total_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
  91.        @total = Sprite.new
  92.        @total.bitmap = @total_bitmap
  93.        @total_im_cw = @total_image.width / 10
  94.        @total_im_ch = @total_image.height     
  95.        @total_number_text = $game_temp.max_damage.abs.to_s.split(//)
  96.        for r in 0..@total_number_text.size - 1
  97.          @total_number_abs = @total_number_text[r].to_i
  98.          @total_src_rect = Rect.new(@total_im_cw * @total_number_abs, 0, @total_im_cw, @total_im_ch)
  99.          @total_bitmap.blt(40 + ((@total_im_cw - 12) *  r), 0, @total_image, @total_src_rect)        
  100.        end      
  101.        @total.z = PRIORITY_Z + 1
  102.        @total_orig_x = COMBO_POSITION[0] + TOTAL_POSITION[0]
  103.        @total_orig_y = COMBO_POSITION[1] + TOTAL_POSITION[1]
  104.        @total.x = @total_orig_x
  105.        @total.y = @total_orig_y
  106.        @total.zoom_x = 1.00
  107.        @total.zoom_y = 1.00
  108.        @total.opacity = 250  
  109.        @total.visible = false
  110.   end     

  111.   #--------------------------------------------------------------------------
  112.   # ● Create Combo Number  
  113.   #--------------------------------------------------------------------------
  114.   def create_combo_sprite
  115.        @combo_image = RPG::Cache.windowskin("Combo_Number")
  116.        @combo_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
  117.        @combo = Sprite.new
  118.        @combo.bitmap = @combo_bitmap
  119.        @combo_im_cw = @combo_image.width / 10
  120.        @combo_im_ch = @combo_image.height     
  121.        @combo_number_text = $game_temp.combo_hit.abs.to_s.split(//)
  122.        for r in 0..@combo_number_text.size - 1
  123.          @combo_number_abs = @combo_number_text[r].to_i
  124.          @combo_src_rect = Rect.new(@combo_im_cw * @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
  125.          @combo_bitmap.blt(40 + ((@combo_im_cw - 12) *  r), 0, @combo_image, @combo_src_rect)        
  126.        end      
  127.        @combo.z = PRIORITY_Z + 2
  128.        @combo_orig_x = COMBO_POSITION[0] + HIT_POSITION[0]
  129.        @combo_orig_y = COMBO_POSITION[1] + HIT_POSITION[1]
  130.        @pos_x_fix = (@combo_im_cw / 2 * @combo_number_text.size)
  131.        @combo.x = @combo_orig_x - @pos_x_fix     
  132.        @combo.y = @combo_orig_y
  133.        @combo.zoom_x = 1.00
  134.        @combo.zoom_y = 1.00
  135.        @combo.opacity = 250
  136.        @combo.visible = false
  137.   end  
  138.      
  139.   #--------------------------------------------------------------------------
  140.   # ● Dispose
  141.   #--------------------------------------------------------------------------
  142.   def dispose
  143.       @combo_bitmap.dispose
  144.       @combo.bitmap.dispose
  145.       @combo.dispose
  146.       @hud.bitmap.dispose
  147.       @hud.dispose
  148.       @total_bitmap.dispose
  149.       @total.bitmap.dispose
  150.       @total.dispose
  151.       super
  152.   end
  153.    
  154.   #--------------------------------------------------------------------------
  155.   # ● Refresh
  156.   #--------------------------------------------------------------------------
  157.   def refresh
  158.       @combo_hit_old = $game_temp.combo_hit
  159.       @combo.bitmap.clear
  160.       @total.bitmap.clear
  161.       @combo_number_text = $game_temp.combo_hit.abs.to_s.split(//)
  162.       for r in 0..@combo_number_text.size - 1
  163.          @combo_number_abs = @combo_number_text[r].to_i
  164.          @combo_src_rect = Rect.new(@combo_im_cw * @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
  165.          @combo_bitmap.blt(40 + ((@combo_im_cw - 12) *  r), 0, @combo_image, @combo_src_rect)        
  166.        end            
  167.        @total_number_text = $game_temp.max_damage.abs.to_s.split(//)
  168.        for r in 0..@total_number_text.size - 1
  169.          @total_number_abs = @total_number_text[r].to_i
  170.          @total_src_rect = Rect.new(@total_im_cw * @total_number_abs, 0, @total_im_cw, @total_im_ch)
  171.          @total_bitmap.blt(40 + ((@total_im_cw - 12) *  r), 20, @total_image, @total_src_rect)        
  172.        end
  173.        #Combo Position
  174.        @pos_x_fix = (@combo_im_cw / 2 * @combo_number_text.size)
  175.        @combo.x = @combo_orig_x - @pos_x_fix
  176.        @combo.y = @combo_orig_y
  177.        @combo.zoom_x = 2
  178.        @combo.zoom_y = 2
  179.        @combo.opacity = 70
  180.        @combo.visible = true
  181.        #Total Position      
  182.        @total.x = @total_orig_x + 20
  183.        @total.y = @total_orig_y     
  184.        @total.opacity = 100
  185.        @total.visible = true            
  186.        #Hud Position
  187.        @hud.x = COMBO_POSITION[0]
  188.        @hud.y = COMBO_POSITION[1]
  189.        @hud.opacity = 255
  190.        @hud.visible = true
  191.    end   
  192.   
  193.   #--------------------------------------------------------------------------
  194.   # ● Slide Update
  195.   #--------------------------------------------------------------------------
  196.   def slide_update
  197.     return if @combo.visible == false
  198.     if $game_temp.combo_time > 0 and @combo_wait == false
  199.        $game_temp.combo_time -= 1 if TIME_COUNT == true
  200.     end
  201.     if $game_temp.combo_time > 0 and $game_temp.combo_hit > 0   
  202.          #Total Damage
  203.          if @total.x > @total_orig_x
  204.             @total.x -= 1
  205.             @total.opacity += 8
  206.          else   
  207.             @total.x = @total_orig_x
  208.             @total.opacity = 255
  209.          end  
  210.          #Combo
  211.          if @combo.zoom_x > 1.00
  212.             @combo.zoom_x -= 0.05
  213.             @combo.zoom_y -= 0.05      
  214.             @combo.opacity += 8
  215.          else
  216.             @combo.zoom_x = 1
  217.             @combo.zoom_y = 1
  218.             @combo.opacity = 255
  219.             @combo.x = @combo_orig_x - @pos_x_fix
  220.             @combo.y = @combo_orig_y
  221.          end           
  222.      elsif $game_temp.combo_time == 0 and @combo.visible == true
  223.            @combo.x -= 5
  224.            @combo.opacity -= 10
  225.            @total.x -= 3
  226.            @total.opacity -= 10
  227.            @hud.x += 5
  228.            @hud.opacity -= 10     
  229.            $game_temp.combo_hit = 0
  230.            @combo_hit_old = $game_temp.combo_hit
  231.            $game_temp.max_damage = 0
  232.            if @combo.opacity <= 0
  233.               @combo.visible = false
  234.               @total.visible = false
  235.               @hud.visible = false
  236.            end  
  237.      end   
  238.   end
  239.    
  240.   #--------------------------------------------------------------------------
  241.   # ● Cancel
  242.   #--------------------------------------------------------------------------   
  243.   def cancel
  244.       $game_temp.combo_hit = 0
  245.       $game_temp.max_damage = 0
  246.       $game_temp.combo_time = 0      
  247.       @combo_hit_old = $game_temp.combo_hit
  248.   end  

  249.   #--------------------------------------------------------------------------
  250.   # ● Clear
  251.   #--------------------------------------------------------------------------     
  252.   def clear
  253.       $game_temp.combo_time = 0
  254.   end      

  255.   #--------------------------------------------------------------------------
  256.   # ● Update
  257.   #--------------------------------------------------------------------------
  258.   def update
  259.     super
  260.     refresh if $game_temp.combo_hit != @combo_hit_old
  261.     slide_update
  262.   end   
  263. end

  264. #===============================================================================
  265. # ■ Scene_Battle
  266. #===============================================================================
  267. class Scene_Battle
  268.   include MOG_COMBO_DISPLAY
  269.   
  270.   #--------------------------------------------------------------------------
  271.   # ● main
  272.   #--------------------------------------------------------------------------
  273.   alias mog_combo_main main
  274.   def main
  275.     create_cb_sprite
  276.     mog_combo_main
  277.     dispose_cb_sprite
  278.   end
  279.   
  280.   #--------------------------------------------------------------------------
  281.   # ● create_cb_sprite
  282.   #--------------------------------------------------------------------------  
  283.   def create_cb_sprite
  284.      @combo_sprite = Combo_Sprite_Hud.new
  285.   end
  286.    
  287.   #--------------------------------------------------------------------------
  288.   # ● dispose_cb_sprite
  289.   #--------------------------------------------------------------------------
  290.   def dispose_cb_sprite
  291.      @combo_sprite.dispose
  292.   end  
  293.   
  294.   #--------------------------------------------------------------------------
  295.   # ● update
  296.   #--------------------------------------------------------------------------
  297.   alias mog_combo_update update
  298.   def update
  299.     mog_combo_update
  300.     @combo_sprite.update      
  301.   end      
  302.   
  303.   #--------------------------------------------------------------------------
  304.   # ● mog_combo_start_phase1
  305.   #--------------------------------------------------------------------------
  306.   alias mog_combo_start_phase2 start_phase2
  307.   def start_phase2
  308.       @combo_sprite.combo_wait = false
  309.       mog_combo_start_phase2
  310.   end  
  311.   
  312.   #--------------------------------------------------------------------------
  313.   # ● start_phase4  
  314.   #--------------------------------------------------------------------------
  315.   alias mog_combo_display_start_phase4 start_phase4
  316.   def start_phase4  
  317.       @combo_sprite.combo_wait = true
  318.       mog_combo_display_start_phase4
  319.   end  
  320.   
  321.   #--------------------------------------------------------------------------
  322.   # ● update_phase4_step5
  323.   #--------------------------------------------------------------------------
  324.   alias mog_combo_display_update_phase4_step5 update_phase4_step5
  325.   def update_phase4_step5   
  326.       for target in @target_battlers         
  327.         if target.damage != nil and target.damage.is_a?(Numeric) and
  328.            target.damage.to_i > 0
  329.           if target.is_a?(Game_Enemy)
  330.              $game_temp.combo_hit += 1
  331.              $game_temp.max_damage += target.damage.to_i
  332.              $game_temp.combo_time = COMBO_TIME
  333.           else
  334.              $game_temp.combo_time = 0 if ENEMY_CANCEL_COMBO == true
  335.           end            
  336.         end
  337.       end   
  338.       mog_combo_display_update_phase4_step5      
  339.    end  
  340.   
  341.   #--------------------------------------------------------------------------
  342.   # ● Start After Battle Phase
  343.   #--------------------------------------------------------------------------
  344.   alias mog_combo_start_phase5 start_phase5
  345.   def start_phase5
  346.       @combo_sprite.clear  
  347.       mog_combo_start_phase5
  348.   end   
  349. end  

  350. $mog_rgssxp_combo_display = true
复制代码
以上脚本注释有★的即为要求内容
这个脚本的连段显示可以设定时间,时间过后连段显示消失。
我希望的是能添加一个值槽,在触发连段的时候值槽出现且满格,然后随着等待时间减少缩短,当连段图片消失后值槽也跟着消失
值槽外观没有什么要求:红色,简单不需要占太多机能即可

随便附上需要的图片,都是放在Windowskins文件夹里的:



最佳答案

查看完整内容

这个脚本本身就有bug,害我搞了好久==

Lv1.梦旅人

路人党员

梦石
0
星屑
51
在线时间
2276 小时
注册时间
2010-12-30
帖子
3225
2
发表于 2013-10-23 08:06:29 | 只看该作者
这个脚本本身就有bug,害我搞了好久==
  1. #==============================================================================
  2. # +++ MOG XP - Combo Display V1.0 +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com/
  6. #==============================================================================
  7. # ■ Apresenta a quantidade de acertos no alvo e o dano maximo.
  8. # ---------------------------------------------------------------------------
  9. # É necessário ter os arquivos imagens na pasta Graphics/Windoskins.
  10. # Combo_Damage.png
  11. # Combo_Hud.png
  12. # Combo_Number.png
  13. #==============================================================================
  14. module MOG_COMBO_DISPLAY
  15.   #Ativar tempo para fazer combo.
  16.   TIME_COUNT = true
  17.   # Tempo para fazer um combo. (40 = 1s)
  18.   COMBO_TIME = 200#★连段的等待时间,请增加一个值槽表示等待时间的减少,等待时间为0时值槽不显示
  19.   # Cancelar a contagem de Combo caso o inimigo acertar o herói.
  20.   ENEMY_CANCEL_COMBO = false
  21.   # Posição geral das imagens. X Y
  22.   COMBO_POSITION = [10,80]
  23.   # Posição do número de HITS. X Y
  24.   HIT_POSITION = [15,20]
  25.   # Posição do número de dano. X Y
  26.   TOTAL_POSITION = [60,-20]
  27.   # Prioridade das imagens.
  28.   PRIORITY_Z = 50
  29.   # 时间槽颜色
  30.   TIME_COLOR = Color.new(255,0,0,160)
  31. end

  32. #===============================================================================
  33. # ■ Game_Temp
  34. #===============================================================================
  35. class Game_Temp
  36.    attr_accessor :combo_hit
  37.    attr_accessor :max_damage   
  38.    attr_accessor :combo_time  
  39.   #--------------------------------------------------------------------------
  40.   # ● initialize
  41.   #--------------------------------------------------------------------------   
  42.    alias mog_combo_display_initialize initialize
  43.    def initialize
  44.        @combo_hit = 0
  45.        @max_damage = 0  
  46.        @combo_time = 0   
  47.        mog_combo_display_initialize
  48.    end
  49. end

  50. #===============================================================================
  51. # ■ Combo_Sprite_Hud
  52. #===============================================================================
  53. class Combo_Sprite_Hud < Sprite
  54.    attr_accessor :combo_wait
  55.    include MOG_COMBO_DISPLAY
  56.    
  57.   #--------------------------------------------------------------------------
  58.   # ● Initialize
  59.   #--------------------------------------------------------------------------
  60.   def initialize
  61.      super  
  62.      @combo_wait = false
  63.      $game_temp.combo_time = 0
  64.      $game_temp.combo_hit = 0
  65.      $game_temp.max_damage = 0     
  66.      @combo_hit_old = 0
  67.      @animation_speed = 0
  68.      @pos_x = COMBO_POSITION[0]
  69.      @pos_x_fix = 0
  70.      @pos_y = COMBO_POSITION[1]
  71.      create_combo_sprite
  72.      create_total_damage_sprite     
  73.      create_hud_sprite   
  74.      create_time_sprite
  75.    end      

  76.   #--------------------------------------------------------------------------
  77.   # ● Create Hud Sprite   
  78.   #--------------------------------------------------------------------------
  79.   def create_hud_sprite   
  80.        @hud = Sprite.new
  81.        @hud.bitmap = RPG::Cache.windowskin("Combo_HUD")
  82.        @hud.z = PRIORITY_Z
  83.        @hud.x = COMBO_POSITION[0]
  84.        @hud.y = COMBO_POSITION[1]
  85.        @hud.opacity = 250
  86.        @hud.visible = false
  87.   end     

  88.   #--------------------------------------------------------------------------
  89.   # ● Create Total Damage Sprite
  90.   #--------------------------------------------------------------------------
  91.   def create_total_damage_sprite   
  92.        @total_image = RPG::Cache.windowskin("Combo_damage")
  93.        @total_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
  94.        @total = Sprite.new
  95.        @total.bitmap = @total_bitmap
  96.        @total_im_cw = @total_image.width / 10
  97.        @total_im_ch = @total_image.height     
  98.        @total_number_text = $game_temp.max_damage.abs.to_s.split(//)
  99.        for r in 0..@total_number_text.size - 1
  100.          @total_number_abs = @total_number_text[r].to_i
  101.          @total_src_rect = Rect.new(@total_im_cw * @total_number_abs, 0, @total_im_cw, @total_im_ch)
  102.          @total_bitmap.blt(40 + ((@total_im_cw - 12) *  r), 0, @total_image, @total_src_rect)        
  103.        end      
  104.        @total.z = PRIORITY_Z + 1
  105.        @total_orig_x = COMBO_POSITION[0] + TOTAL_POSITION[0]
  106.        @total_orig_y = COMBO_POSITION[1] + TOTAL_POSITION[1]
  107.        @total.x = @total_orig_x
  108.        @total.y = @total_orig_y
  109.        @total.zoom_x = 1.00
  110.        @total.zoom_y = 1.00
  111.        @total.opacity = 250  
  112.        @total.visible = false
  113.   end     

  114.   #--------------------------------------------------------------------------
  115.   # ● Create Combo Number  
  116.   #--------------------------------------------------------------------------
  117.   def create_combo_sprite
  118.        @combo_image = RPG::Cache.windowskin("Combo_Number")
  119.        @combo_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
  120.        @combo = Sprite.new
  121.        @combo.bitmap = @combo_bitmap
  122.        @combo_im_cw = @combo_image.width / 10
  123.        @combo_im_ch = @combo_image.height     
  124.        @combo_number_text = $game_temp.combo_hit.abs.to_s.split(//)
  125.        for r in 0..@combo_number_text.size - 1
  126.          @combo_number_abs = @combo_number_text[r].to_i
  127.          @combo_src_rect = Rect.new(@combo_im_cw * @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
  128.          @combo_bitmap.blt(40 + ((@combo_im_cw - 12) *  r), 0, @combo_image, @combo_src_rect)        
  129.        end      
  130.        @combo.z = PRIORITY_Z + 2
  131.        @combo_orig_x = COMBO_POSITION[0] + HIT_POSITION[0]
  132.        @combo_orig_y = COMBO_POSITION[1] + HIT_POSITION[1]
  133.        @pos_x_fix = (@combo_im_cw / 2 * @combo_number_text.size)
  134.        @combo.x = @combo_orig_x - @pos_x_fix     
  135.        @combo.y = @combo_orig_y
  136.        @combo.zoom_x = 1.00
  137.        @combo.zoom_y = 1.00
  138.        @combo.opacity = 250
  139.        @combo.visible = false
  140.   end  
  141.    
  142.   #--------------------------------------------------------------------------
  143.   # ● 创造时间槽
  144.   #--------------------------------------------------------------------------
  145.   def create_time_sprite
  146.     [url=home.php?mod=space&uid=134219]@Time[/url] = Sprite.new
  147.     @time.z = PRIORITY_Z
  148.     @time.x = COMBO_POSITION[0] + 1
  149.     @time.y = COMBO_POSITION[1] + @hud.bitmap.height + 5
  150.     @time.bitmap = Bitmap.new(@hud.bitmap.width - 2, 10)
  151.     @time.bitmap.fill_rect(0,0,@hud.bitmap.width - 2, 10,TIME_COLOR)
  152.     @time.visible = false
  153.   end
  154.   
  155.   #--------------------------------------------------------------------------
  156.   # ● Dispose
  157.   #--------------------------------------------------------------------------
  158.   def dispose
  159.       @combo_bitmap.dispose
  160.       @combo.bitmap.dispose
  161.       @combo.dispose
  162.       @hud.bitmap.dispose
  163.       @hud.dispose
  164.       @total_bitmap.dispose
  165.       @total.bitmap.dispose
  166.       @total.dispose
  167.       @time.bitmap.dispose
  168.       @time.dispose
  169.       super
  170.   end
  171.    
  172.   #--------------------------------------------------------------------------
  173.   # ● Refresh
  174.   #--------------------------------------------------------------------------
  175.   def refresh
  176.       @combo_hit_old = $game_temp.combo_hit
  177.       @combo.bitmap.clear
  178.       @total.bitmap.clear
  179.       @combo_number_text = $game_temp.combo_hit.abs.to_s.split(//)
  180.       for r in 0..@combo_number_text.size - 1
  181.          @combo_number_abs = @combo_number_text[r].to_i
  182.          @combo_src_rect = Rect.new(@combo_im_cw * @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
  183.          @combo_bitmap.blt(40 + ((@combo_im_cw - 12) *  r), 0, @combo_image, @combo_src_rect)        
  184.        end            
  185.        @total_number_text = $game_temp.max_damage.abs.to_s.split(//)
  186.        for r in 0..@total_number_text.size - 1
  187.          @total_number_abs = @total_number_text[r].to_i
  188.          @total_src_rect = Rect.new(@total_im_cw * @total_number_abs, 0, @total_im_cw, @total_im_ch)
  189.          @total_bitmap.blt(40 + ((@total_im_cw - 12) *  r), 20, @total_image, @total_src_rect)        
  190.        end
  191.        #Combo Position
  192.        @pos_x_fix = (@combo_im_cw / 2 * @combo_number_text.size)
  193.        @combo.x = @combo_orig_x - @pos_x_fix
  194.        @combo.y = @combo_orig_y
  195.        @combo.zoom_x = 2
  196.        @combo.zoom_y = 2
  197.        @combo.opacity = 70
  198.        @combo.visible = true
  199.        #Total Position      
  200.        @total.x = @total_orig_x + 20
  201.        @total.y = @total_orig_y     
  202.        @total.opacity = 100
  203.        @total.visible = true            
  204.        #Hud Position
  205.        @hud.x = COMBO_POSITION[0]
  206.        @hud.y = COMBO_POSITION[1]
  207.        @hud.opacity = 255
  208.        @hud.visible = true
  209.        @time.visible = true
  210.    end   
  211.   
  212.   #--------------------------------------------------------------------------
  213.   # ● Slide Update
  214.   #--------------------------------------------------------------------------
  215.   def slide_update
  216.     return if @combo.visible == false
  217.     if $game_temp.combo_time > 0 # and !@combo_wait
  218.        $game_temp.combo_time -= 1 if TIME_COUNT
  219.        @time.zoom_x = ($game_temp.combo_time/COMBO_TIME.to_f)
  220.     end
  221.     if $game_temp.combo_time > 0 and $game_temp.combo_hit > 0   
  222.          #Total Damage
  223.          if @total.x > @total_orig_x
  224.             @total.x -= 1
  225.             @total.opacity += 8
  226.          else   
  227.             @total.x = @total_orig_x
  228.             @total.opacity = 255
  229.          end  
  230.          #Combo
  231.          if @combo.zoom_x > 1.00
  232.             @combo.zoom_x -= 0.05
  233.             @combo.zoom_y -= 0.05      
  234.             @combo.opacity += 8
  235.          else
  236.             @combo.zoom_x = 1
  237.             @combo.zoom_y = 1
  238.             @combo.opacity = 255
  239.             @combo.x = @combo_orig_x - @pos_x_fix
  240.             @combo.y = @combo_orig_y
  241.          end           
  242.        elsif $game_temp.combo_time == 0 and @combo.visible == true
  243.            @time.visible = false
  244.            @combo.x -= 5
  245.            @combo.opacity -= 10
  246.            @total.x -= 3
  247.            @total.opacity -= 10
  248.            @hud.x += 5
  249.            @hud.opacity -= 10     
  250.            $game_temp.combo_hit = 0
  251.            @combo_hit_old = $game_temp.combo_hit
  252.            $game_temp.max_damage = 0
  253.            if @combo.opacity <= 0
  254.               @combo.visible = false
  255.               @total.visible = false
  256.               @hud.visible = false
  257.            end  
  258.      end   
  259.   end
  260.    
  261.   #--------------------------------------------------------------------------
  262.   # ● Cancel
  263.   #--------------------------------------------------------------------------   
  264.   def cancel
  265.       $game_temp.combo_hit = 0
  266.       $game_temp.max_damage = 0
  267.       $game_temp.combo_time = 0      
  268.       @combo_hit_old = $game_temp.combo_hit
  269.   end  

  270.   #--------------------------------------------------------------------------
  271.   # ● Clear
  272.   #--------------------------------------------------------------------------     
  273.   def clear
  274.       $game_temp.combo_time = 0
  275.   end      

  276.   #--------------------------------------------------------------------------
  277.   # ● Update
  278.   #--------------------------------------------------------------------------
  279.   def update
  280.     super
  281.     refresh if $game_temp.combo_hit != @combo_hit_old
  282.     slide_update
  283.   end   
  284. end

  285. #===============================================================================
  286. # ■ Scene_Battle
  287. #===============================================================================
  288. class Scene_Battle
  289.   include MOG_COMBO_DISPLAY
  290.   
  291.   #--------------------------------------------------------------------------
  292.   # ● main
  293.   #--------------------------------------------------------------------------
  294.   alias mog_combo_main main
  295.   def main
  296.     create_cb_sprite
  297.     mog_combo_main
  298.     dispose_cb_sprite
  299.   end
  300.   
  301.   #--------------------------------------------------------------------------
  302.   # ● create_cb_sprite
  303.   #--------------------------------------------------------------------------  
  304.   def create_cb_sprite
  305.      @combo_sprite = Combo_Sprite_Hud.new
  306.   end
  307.    
  308.   #--------------------------------------------------------------------------
  309.   # ● dispose_cb_sprite
  310.   #--------------------------------------------------------------------------
  311.   def dispose_cb_sprite
  312.      @combo_sprite.dispose
  313.   end  
  314.   
  315.   #--------------------------------------------------------------------------
  316.   # ● update
  317.   #--------------------------------------------------------------------------
  318.   alias mog_combo_update update
  319.   def update
  320.     mog_combo_update
  321.     @combo_sprite.update      
  322.   end      
  323.   
  324.   #--------------------------------------------------------------------------
  325.   # ● mog_combo_start_phase1
  326.   #--------------------------------------------------------------------------
  327.   alias mog_combo_start_phase2 start_phase2
  328.   def start_phase2
  329.       @combo_sprite.combo_wait = false
  330.       mog_combo_start_phase2
  331.   end  
  332.   
  333.   #--------------------------------------------------------------------------
  334.   # ● start_phase4  
  335.   #--------------------------------------------------------------------------
  336.   alias mog_combo_display_start_phase4 start_phase4
  337.   def start_phase4  
  338.       @combo_sprite.combo_wait = true
  339.       mog_combo_display_start_phase4
  340.   end  
  341.   
  342.   #--------------------------------------------------------------------------
  343.   # ● update_phase4_step5
  344.   #--------------------------------------------------------------------------
  345.   alias mog_combo_display_update_phase4_step5 update_phase4_step5
  346.   def update_phase4_step5   
  347.       for target in @target_battlers         
  348.         if target.damage != nil and target.damage.is_a?(Numeric) and
  349.            target.damage.to_i > 0
  350.           if target.is_a?(Game_Enemy)
  351.              $game_temp.combo_hit += 1
  352.              $game_temp.max_damage += target.damage.to_i
  353.              $game_temp.combo_time = COMBO_TIME
  354.           else
  355.              $game_temp.combo_time = 0 if ENEMY_CANCEL_COMBO == true
  356.           end            
  357.         end
  358.       end   
  359.       mog_combo_display_update_phase4_step5      
  360.    end  
  361.   
  362.   #--------------------------------------------------------------------------
  363.   # ● Start After Battle Phase
  364.   #--------------------------------------------------------------------------
  365.   alias mog_combo_start_phase5 start_phase5
  366.   def start_phase5
  367.       @combo_sprite.clear  
  368.       mog_combo_start_phase5
  369.   end   
  370. end  

  371. $mog_rgssxp_combo_display = true
复制代码

评分

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

查看全部评分

本人擅长XP,如果有脚本或者Ruby方面的问题欢迎发电邮到[email protected]咨询,本人很少检查电邮所以不一定会及时回复,本人不会直接出手解决问题只会提供一个方向,所以谢绝伸手党
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
46
在线时间
1502 小时
注册时间
2010-8-27
帖子
392
3
 楼主| 发表于 2013-10-24 07:53:04 | 只看该作者
英顺的马甲 发表于 2013-10-23 21:17
这个脚本本身就有bug,害我搞了好久==

这个不错,不过我看了一下,用这种方法也可以很容易地用图片替换,然后通过刷新zoom_x也能达到我要的效果。
总之,收下了,顺便问一下这脚本有什么bug啊?我测试的时候没发现啊。

点评

也不算bug啦,其实是设定没设好,在没时间条的情况下影响微乎其微,所以你没发现==  发表于 2013-10-24 22:43
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 02:52

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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