查看: 1591|回复: 3

[已经解决] 默认工程中的全体动画怎么同时的显示动画和伤害。

[复制链接]
梦石
0
星屑
381
在线时间
238 小时
注册时间
2013-8-20
回帖
410
发表于 2013-11-5 15:58:22 | 显示全部楼层 |阅读模式

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

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

×
这里的动画不是指那些全画面的位置动画
请问要怎么做?而且那个提示文字也是要跟上显示
不定期回来6R玩。
↓下方广告帖,欢迎点击
梦石
0
星屑
381
在线时间
238 小时
注册时间
2013-8-20
回帖
410
 楼主| 发表于 2013-11-7 20:01:06 | 显示全部楼层
容我继续求助
回复

使用道具 举报

梦石
0
星屑
782
在线时间
3431 小时
注册时间
2011-6-10
回帖
6325
发表于 2013-11-7 21:03:23 | 显示全部楼层
本帖最后由 上贺茂润 于 2013-11-7 21:06 编辑

用这个脚本,我注释了:
[pre lang="ruby" line="1"]#==============================================================================
# 伤害总和显示+连锁comb华丽脚本
# 原作 来自美站
# By Moghunter
# http://www.atelier-rgss.com/
# ■ Apresenta a quantidade de acertos no alvo e o dano maximo.
# 注释/图块扩张by 上贺茂润
# 本脚本来自66RPG主站
# 调用请保留此信息
#==============================================================================
# ---------------------------------------------------------------------------
# É necessário ter os arquivos imagens na pasta Graphics/Systems.
# Combo_Damage.png
# Combo_Hud.png
# Combo_Number.png
# ---------------------------------------------------------------------------
module MOG
  #Ativar tempo para fazer combo.
  TIME_COUNT = true
  # 多少时间内算连击? 【你填入的数字/60】 秒
  COMBO_TIME = 240
  # Cancelar a contagem de Combo caso o inimigo acertar o herói.
  ENEMY_CANCEL_COMBO = true
  # 以下显示图片位置!
  # Posição geral das imagens. X Y
  COMBO_POSITION = [10,80]
  # Posição do número de HITS. X Y
  HIT_POSITION = [15,23]
  # Posição do número de dano. X Y
  TOTAL_POSITION = [60,-17]
end  
#===============================================================================
# ■ Game_Temp
#===============================================================================
class Game_Temp
   attr_accessor :combo_hit
   attr_accessor :max_damage   
   attr_accessor :combo_time  
  #--------------------------------------------------------------------------
  # ● initialize
  #--------------------------------------------------------------------------   
   alias mog_combo_display_initialize initialize
   def initialize
       @combo_hit = 0
       @max_damage = 0  
       @combo_time = 0   
       mog_combo_display_initialize
   end
end
#===============================================================================
# ■ Game_Battler
#===============================================================================
class Game_Battler
  #--------------------------------------------------------------------------
  # ● execute_damage
  #--------------------------------------------------------------------------     
  alias mog_combo_display_execute_damage execute_damage
  def execute_damage(user)
      mog_combo_display_execute_damage(user)
      if @hp_damage > 0   
          if user.is_a?(Game_Actor)  
             $game_temp.combo_hit += 1
             $game_temp.max_damage += @hp_damage   
             $game_temp.combo_time = MOG::COMBO_TIME
           else
             $game_temp.combo_hit += 1
             $game_temp.max_damage += @hp_damage   
             $game_temp.combo_time = MOG::COMBO_TIME
             $game_temp.combo_time = 0 if MOG::ENEMY_CANCEL_COMBO == true
          end  
      end  
    end
end  
#===============================================================================
# Combo_Sprite_Hud
#===============================================================================
class Combo_Sprite_Hud < Sprite
   attr_accessor :combo_wait
   include MOG
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
  def initialize
     super  
     @combo_wait = false
     $game_temp.combo_time = 0
     $game_temp.combo_hit = 0
     $game_temp.max_damage = 0     
     @combo_hit_old = 0
     @animation_speed = 0
     @pos_x = COMBO_POSITION[0]
     @pos_x_fix = 0
     @pos_y = COMBO_POSITION[1]
     create_combo_sprite
     create_total_damage_sprite     
     create_hud_sprite     
   end      
#--------------------------------------------------------------------------
# create_hud_sprite   
#--------------------------------------------------------------------------
def create_hud_sprite   
     @hud = Sprite.new
     @hud.bitmap = Cache.system("Combo_HUD")
     @hud.z = 108
     @hud.x = COMBO_POSITION[0]
     @hud.y = COMBO_POSITION[1]
     @hud.opacity = 250
     @hud.visible = false
end     
#--------------------------------------------------------------------------
# create_total_damage_sprite
#--------------------------------------------------------------------------
def create_total_damage_sprite   
     @total_image = Cache.system("Combo_damage")
     @total_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
     @total = Sprite.new
     @total.bitmap = @total_bitmap
     @total_im_cw = @total_image.width / 10
     @total_im_ch = @total_image.height+100     
     @total_number_text = $game_temp.max_damage.abs.to_s.split(//)
     for r in 0..@total_number_text.size - 1
       @total_number_abs = @total_number_text[r].to_i
       @total_src_rect = Rect.new(@total_im_cw * @total_number_abs, 0, @total_im_cw, @total_im_ch)
       @total_bitmap.blt(40 + ((@total_im_cw - 12) *  r), 0, @total_image, @total_src_rect)        
     end      
     @total.z = 109
     @total_orig_x = COMBO_POSITION[0] + TOTAL_POSITION[0]
     @total_orig_y = COMBO_POSITION[1] + TOTAL_POSITION[1]
     @total.x = @total_orig_x
     @total.y = @total_orig_y
     @total.zoom_x = 1.00
     @total.zoom_y = 1.00
     @total.opacity = 250  
     @total.visible = false
end     
#--------------------------------------------------------------------------
# create_combo_number  
#--------------------------------------------------------------------------
def create_combo_sprite
     @combo_image = Cache.system("Combo_Number")
     @combo_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
     @combo = Sprite.new
     @combo.bitmap = @combo_bitmap
     @combo_im_cw = @combo_image.width / 10
     @combo_im_ch = @combo_image.height     
     @combo_number_text = $game_temp.combo_hit.abs.to_s.split(//)
     for r in 0..@combo_number_text.size - 1
       @combo_number_abs = @combo_number_text[r].to_i
       @combo_src_rect = Rect.new(@combo_im_cw * @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
       @combo_bitmap.blt(40 + ((@combo_im_cw - 12) *  r), 0, @combo_image, @combo_src_rect)        
     end      
     @combo.z = 109
     @combo_orig_x = COMBO_POSITION[0] + HIT_POSITION[0]
     @combo_orig_y = COMBO_POSITION[1] + HIT_POSITION[1]
     @pos_x_fix = (@combo_im_cw / 2 * @combo_number_text.size)
     @combo.x = @combo_orig_x - @pos_x_fix     
     @combo.y = @combo_orig_y
     @combo.zoom_x = 1.00
     @combo.zoom_y = 1.00
     @combo.opacity = 250
     @combo.visible = false
end  
#--------------------------------------------------------------------------
# Dispose
#--------------------------------------------------------------------------
   def dispose
       @combo_bitmap.dispose
       @combo.bitmap.dispose
       @combo.dispose
       @hud.bitmap.dispose
       @hud.dispose
       @total_bitmap.dispose
       @total.bitmap.dispose
       @total.dispose
       super
   end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------
   def refresh
     @combo_hit_old = $game_temp.combo_hit
     @combo.bitmap.clear
     @total.bitmap.clear
     @combo_number_text = $game_temp.combo_hit.abs.to_s.split(//)
     for r in 0..@combo_number_text.size - 1
       @combo_number_abs = @combo_number_text[r].to_i
       @combo_src_rect = Rect.new(@combo_im_cw * @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
       @combo_bitmap.blt(40 + ((@combo_im_cw - 12) *  r), 0, @combo_image, @combo_src_rect)        
     end            
     @total_number_text = $game_temp.max_damage.abs.to_s.split(//)
     for r in 0..@total_number_text.size - 1
       @total_number_abs = @total_number_text[r].to_i
       @total_src_rect = Rect.new(@total_im_cw * @total_number_abs, 0, @total_im_cw, @total_im_ch)
       @total_bitmap.blt(40 + ((@total_im_cw - 12) *  r), 20, @total_image, @total_src_rect)        
     end
       #Combo Position
       @pos_x_fix = (@combo_im_cw / 2 * @combo_number_text.size)
       @combo.x = @combo_orig_x - @pos_x_fix
       @combo.y = @combo_orig_y
       @combo.zoom_x = 2
       @combo.zoom_y = 2
       @combo.opacity = 70
       @combo.visible = true
       #Total Position      
       @total.x = @total_orig_x + 20
       @total.y = @total_orig_y     
       @total.opacity = 100
       @total.visible = true            
       #Hud Position
       @hud.x = COMBO_POSITION[0]
       @hud.y = COMBO_POSITION[1]
       @hud.opacity = 255
       @hud.visible = true
end   
#--------------------------------------------------------------------------
# Slide Update
#--------------------------------------------------------------------------
  def slide_update
    return if @combo.visible == false
    if $game_temp.combo_time > 0 and @combo_wait == false
       $game_temp.combo_time -= 1 if TIME_COUNT == true
    end
    if $game_temp.combo_time > 0 and $game_temp.combo_hit > 0   
         #Total Damage
         if @total.x > @total_orig_x
            @total.x -= 1
            @total.opacity += 8
         else   
            @total.x = @total_orig_x
            @total.opacity = 255
         end  
         #Combo
         if @combo.zoom_x > 1.00
            @combo.zoom_x -= 0.05
            @combo.zoom_y -= 0.05      
            @combo.opacity += 8
         else
            @combo.zoom_x = 1
            @combo.zoom_y = 1
            @combo.opacity = 255
            @combo.x = @combo_orig_x - @pos_x_fix
            @combo.y = @combo_orig_y
         end           
     elsif $game_temp.combo_time == 0 and @combo.visible == true
           @combo.x -= 5
           @combo.opacity -= 10
           @total.x -= 3
           @total.opacity -= 10
           @hud.x += 5
           @hud.opacity -= 10     
           $game_temp.combo_hit = 0
           @combo_hit_old = $game_temp.combo_hit
           $game_temp.max_damage = 0
           if @combo.opacity <= 0
              @combo.visible = false
              @total.visible = false
              @hud.visible = false
           end  
     end   
  end
#--------------------------------------------------------------------------
# Cancel
#--------------------------------------------------------------------------   
  def cancel
      $game_temp.combo_hit = 0
      $game_temp.max_damage = 0
      $game_temp.combo_time = 0      
      @combo_hit_old = $game_temp.combo_hit
  end  
#--------------------------------------------------------------------------
# Clear
#--------------------------------------------------------------------------     
  def clear
      $game_temp.combo_time = 0
  end      
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
  def update
    super
    refresh if $game_temp.combo_hit != @combo_hit_old
    slide_update
  end   
end

#===============================================================================
# Scene_Battle
#===============================================================================
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● start
  #--------------------------------------------------------------------------
  alias mog_combo_start start
  def start
    create_cb_sprite
    mog_combo_start
  end
  #--------------------------------------------------------------------------
  # ● create_cb_sprite
  #--------------------------------------------------------------------------  
  def create_cb_sprite
     @combo_sprite = Combo_Sprite_Hud.new
  end
  #--------------------------------------------------------------------------
  # ● dispose_info_viewport
  #--------------------------------------------------------------------------  
  alias mog_combo_dispose_info_viewport dispose_info_viewport  
  def dispose_info_viewport
     mog_combo_dispose_info_viewport
     @combo_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● update_basic
  #--------------------------------------------------------------------------
  alias mog_combo_update_basic update_basic
  def update_basic(main = false)
    mog_combo_update_basic(main)
    @combo_sprite.update      
  end      
  #--------------------------------------------------------------------------
  # ● wait_for_animation
  #--------------------------------------------------------------------------
  alias mog_combo_wait_for_animation wait_for_animation
  def wait_for_animation
    mog_combo_wait_for_animation
    while @spriteset.animation?
          @combo_sprite.combo_wait = true
    end
          @combo_sprite.combo_wait = false
  end   
  #--------------------------------------------------------------------------
  # ● mog_combo_process_victory
  #--------------------------------------------------------------------------   
  alias mog_combo_process_victory process_victory
  def process_victory
      @combo_sprite.clear  
      mog_combo_process_victory
  end   
end  

$mog_rgssvx_combo_display = true
[/pre]

显示伤害和连锁.zip (294.03 KB, 下载次数: 64)

无标题.jpg

另外LZ如果需要更改显示样式的话,就把文件导入PS,然后这样修正就行:
无标题.jpg 、
如果LZ不需要文字说明了,就把Window_Message里面的显示内容设置为空

评分

参与人数 1星屑 +100 梦石 +1 收起 理由
铃仙·优昙华院·因幡 + 100 + 1 认可答案

查看全部评分

长名公主玩家群:372588926 攻略娱乐应有尽有
了解更多新RM游戏,游戏制作请加入RPGmaker支援群:113622890
回复

使用道具 举报

梦石
0
星屑
381
在线时间
238 小时
注册时间
2013-8-20
回帖
410
 楼主| 发表于 2013-11-8 08:13:10 | 显示全部楼层
上贺茂润 发表于 2013-11-7 21:03
用这个脚本,我注释了:
#=================================================================== ...

多谢你,可是这脚本没有能让动画一同播放的功能啊
不定期回来6R玩。
↓下方广告帖,欢迎点击
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部