赞 | 0 |
VIP | 208 |
好人卡 | 0 |
积分 | 31 |
经验 | 35012 |
最后登录 | 2016-3-14 |
在线时间 | 177 小时 |
Lv3.寻梦者
- 梦石
- 3
- 星屑
- 50
- 在线时间
- 177 小时
- 注册时间
- 2008-3-21
- 帖子
- 939
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 slick 于 2010-8-24 20:39 编辑
你是否为了出招的启动、收招的倒回而烦恼?
你是否想表现一种“时光倒流”的效果?
你是否想制作出“收回”法术的特效?
那么,现在你不用分别为两种效果单独制作动画了,一个开关就搞定!
外挂脚本如下:
$正反控制开关 = 1
module RPG
class Sprite < ::Sprite
def animation(animation, hit)
dispose_animation
@_animation = animation
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = $game_switches[$正反控制开关] ? 1 : @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new(self.viewport)
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def loop_animation(animation)
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = $game_switches[$正反控制开关] ? @_loop_animation.frame_max : 1
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new(self.viewport)
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
def update
super
if @_whiten_duration > 0
@_whiten_duration -= 1
self.color.alpha = 128 - (16 - @_whiten_duration) * 10
end
if @_appear_duration > 0
@_appear_duration -= 1
self.opacity = (16 - @_appear_duration) * 16
end
if @_escape_duration > 0
@_escape_duration -= 1
self.opacity = 256 - (32 - @_escape_duration) * 10
end
if @_collapse_duration > 0
@_collapse_duration -= 1
self.opacity = 256 - (48 - @_collapse_duration) * 6
end
if @_damage_duration > 0
@_damage_duration -= 1
case @_damage_duration
when 38..39
@_damage_sprite.y -= 4
when 36..37
@_damage_sprite.y -= 2
when 34..35
@_damage_sprite.y += 2
when 28..33
@_damage_sprite.y += 4
end
@_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
if @_damage_duration == 0
dispose_damage
end
end
if @_animation != nil and (Graphics.frame_count % 2 == 0)
if $game_switches[$正反控制开关]
@_animation_duration += 1
else
@_animation_duration -= 1
end
update_animation
end
if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
update_loop_animation
if $game_switches[$正反控制开关]
@_loop_animation_index -= 1
if @_loop_animation_index < 0
@_loop_animation_index = @_loop_animation.frame_max - 1
end
else
@_loop_animation_index += 1
@_loop_animation_index %= @_loop_animation.frame_max
end
end
if @_blink
@_blink_count = (@_blink_count + 1) % 32
if @_blink_count < 16
alpha = (16 - @_blink_count) * 6
else
alpha = (@_blink_count - 16) * 6
end
self.color.set(255, 255, 255, alpha)
end
@@_animations.clear
end
def update_animation
continueflag = true
if $game_switches[$正反控制开关]
if @_animation_duration > @_animation.frame_max
continueflag = false
end
else
if @_animation_duration <= 0
continueflag = false
end
end
if continueflag
frame_index = @_animation.frame_max - @_animation_duration
cell_data = @_animation.frames[frame_index].cell_data
position = @_animation.position
animation_set_sprites(@_animation_sprites, cell_data, position)
for timing in @_animation.timings
if timing.frame == frame_index
animation_process_timing(timing, @_animation_hit)
end
end
else
dispose_animation
end
end
end
end
范例工程:
动画倒放.rar
(315.83 KB, 下载次数: 178)
|
评分
-
查看全部评分
|