赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 0 |
经验 | 0 |
最后登录 | 2013-2-19 |
在线时间 | 3 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 185
- 在线时间
- 3 小时
- 注册时间
- 2013-2-15
- 帖子
- 4
|
4楼
楼主 |
发表于 2013-2-17 14:40:55
|
只看该作者
#==============================================================================
# +++ 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 |
|