Project1

标题: VA技能特寫的問題 [打印本页]

作者: william0937    时间: 2013-2-17 14:18
标题: VA技能特寫的問題
本帖最后由 william0937 于 2013-2-17 14:19 编辑

我在一個國外網站找到一個腳本>>atelier-rgss的OUGI ANIMATION (V1.0)
它的功用是有絕招的人物特寫  
不過一個角色只能用一個....(它是以名字當CALL...
有沒有大大可以教教我一個角色可以用N個特寫圖{:2_262:}
作者: 布里蓝    时间: 2013-2-17 14:24
好歹把脚本放上来啊
作者: william0937    时间: 2013-2-17 14:38
标题: VA技能特寫的問題
本帖最后由 william0937 于 2013-2-17 14:58 编辑

等等喔~~~
作者: william0937    时间: 2013-2-17 14:40
#==============================================================================
# +++ MOG - Ougi Animation  (v1.0) +++
#==============================================================================
# By Moghunter
#
#==============================================================================
# Apresenta uma animação em pictures antes de ativar alguma ação.
#==============================================================================
# Serão necessários os seguintes arquivos na pasta Graphics/Battler/.
#
# BATTLER_NAME_ougi1.png
# BATTLER_NAME_ougi2.png
#
#==============================================================================
# Para ativar a animação basta colocar o seguinte comentário na caixa de notas
# da skill ou itens.
#
# <Ougi Animation>
#
#==============================================================================
module MOG_OUGI_ANIMATION
  #Definição do som ao ativar a animação.  
  SOUND_FILE = "Flash2"  
end

#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
  
  #--------------------------------------------------------------------------
  # ● Use Item
  #--------------------------------------------------------------------------
  alias mog_sp_animation_use_item use_item
  def use_item
      update_sp_animation
      mog_sp_animation_use_item
  end
  
  #--------------------------------------------------------------------------
  # ● Can SP Animation?
  #--------------------------------------------------------------------------   
  def can_sp_animation?
      skill = @subject.current_action.item
      return true if skill.note =~ /<Ougi Animation>/
      return false
  end
  
  #--------------------------------------------------------------------------
  # ● Update SP Animation
  #--------------------------------------------------------------------------  
  def update_sp_animation
      return unless can_sp_animation?
      special_animation = Ougi_Animation.new(@subject)
      loop do
          special_animation.update
          Graphics.update
          break if special_animation.phase == 3
      end
      special_animation.dispose
  end

end

#==============================================================================
# ■ Ougi Animation
#==============================================================================
class Ougi_Animation
  
  include MOG_OUGI_ANIMATION
  attr_accessor :phase
  
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------   
  def initialize(subject)
      @phase = 0
      create_battler_sprite(subject)
      create_background_sprite(subject)
      if @phase != 3
         Audio.se_play("Audio/SE/" + SOUND_FILE.to_s, 100, 100) rescue nil
      end         
  end   
  
  #--------------------------------------------------------------------------
  # ● Create Background
  #--------------------------------------------------------------------------      
  def create_background_sprite(subject)
      @background_sprite = Sprite.new
      bname = subject.name + "_ougi2"
      @background_sprite.bitmap = Cache.battler(bname,0) rescue nil      
      @background_sprite.z = 1000
      @background_sprite.opacity = 0
      @background_sprite.zoom_x = 1.00
      @background_sprite.zoom_y = 1.00
      if @background_sprite.bitmap != nil
         @background_sprite.ox = @background_sprite.bitmap.width / 2
         @background_sprite.oy = @background_sprite.bitmap.height / 2
         @background_sprite.x = @background_sprite.ox
         @background_sprite.y = @background_sprite.oy
      end
      @phase = @background_sprite.bitmap != nil ? 0 : 3
  end
  
  #--------------------------------------------------------------------------
  # ● Create Battler Sprite
  #--------------------------------------------------------------------------      
  def create_battler_sprite(subject)
      @battler_sprite = Sprite.new
      bname = subject.name + "_ougi1"
      @battler_sprite.bitmap = Cache.battler(bname,0) rescue nil
      @battler_sprite.z = 1001
      @battler_org = [0,0]
      if @battler_sprite.bitmap != nil
         @battler_sprite.ox = @battler_sprite.bitmap.width / 2
         @battler_sprite.oy = @battler_sprite.bitmap.height / 2
         px = @battler_sprite.ox  + ((Graphics.width / 2) - (@battler_sprite.bitmap.width / 2))
         @battler_sprite.y = @battler_sprite.oy + (Graphics.height - @battler_sprite.bitmap.height)
         @battler_org = [px - 130,px]
         @battler_sprite.x = @battler_org[0]
     end
     @battler_sprite.zoom_x = 2
     @battler_sprite.zoom_y = 2
     @battler_sprite.opacity = 0
     @phase = @battler_sprite.bitmap != nil ? 0 : 3     
  end      
  
  #--------------------------------------------------------------------------
  # ● Dispose
  #--------------------------------------------------------------------------   
  def dispose
      dispose_battler_sprite
      dispose_background_sprite
  end
  
  #--------------------------------------------------------------------------
  # ● Dispose Battler Sprite
  #--------------------------------------------------------------------------      
  def dispose_battler_sprite
      return if @battler_sprite == nil
      if @battler_sprite.bitmap != nil
         @battler_sprite.bitmap.dispose
         @battler_sprite.bitmap = nil
      end
      @battler_sprite.dispose
      @battler_sprite = nil   
  end  
  
  #--------------------------------------------------------------------------
  # ● Dispose Background Sprite
  #--------------------------------------------------------------------------        
  def dispose_background_sprite
      return if @background_sprite == nil
      if @background_sprite.bitmap != nil
         @background_sprite.bitmap.dispose
         @background_sprite.bitmap = nil
      end  
      @background_sprite.dispose
      @background_sprite = nil
  end  
  
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------   
  def update   
      return if @phase == 3
      case @phase
        when 0; update_start
        when 1; update_slide
        when 2; update_end  
     end
     @background_sprite.zoom_x += 0.004
     @background_sprite.zoom_y = @background_sprite.zoom_x
  end  
  
  #--------------------------------------------------------------------------
  # ● Update Start
  #--------------------------------------------------------------------------      
  def update_start
      @battler_sprite.zoom_x -= 0.03
      @battler_sprite.opacity += 5
      @background_sprite.opacity += 10
      @battler_sprite.x += 3
      if @battler_sprite.zoom_x <= 1.00
         @battler_sprite.zoom_x = 1.00
         @battler_sprite.opacity = 255
         @background_sprite.opacity = 255
         @phase = 1
      end   
      @battler_sprite.zoom_y = @battler_sprite.zoom_x
  end  
      
  #--------------------------------------------------------------------------
  # ● Update Slide
  #--------------------------------------------------------------------------        
  def update_slide
      @battler_sprite.x += 1
      @phase = 2 if @battler_sprite.x >= @battler_org[1]
  end

  #--------------------------------------------------------------------------
  # ● Update End
  #--------------------------------------------------------------------------        
  def update_end
      @battler_sprite.zoom_x += 0.03
      @battler_sprite.zoom_y = @battler_sprite.zoom_x
      @battler_sprite.opacity -= 5
      @background_sprite.opacity -= 5
      @phase = 3 if @battler_sprite.opacity <= 0
  end  
  
end

$mog_rgss_ougi_animation = true
作者: william0937    时间: 2013-2-17 14:43
本帖最后由 william0937 于 2013-2-17 14:45 编辑

不好意思~~~~




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1