等等喔~~~作者: 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
#--------------------------------------------------------------------------
# ● 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