module MINTO
RGSS = {}
RGSS["残像スクリプト"] = true
end
if MINTO::RGSS["残像スクリプト"] == true then
class Sprite
def blink
sprite = Sprite.new(self.viewport)
sprite.bitmap = self.bitmap#.dup if self.bitmap
sprite.bitmap = RPG::Cache.character(@character.character_name,@character.character_hue)
sprite.x = self.x
sprite.y = self.y
sprite.z = self.z + 1
sprite.visible = false
sprite.ox = 0#self.ox
sprite.oy = 0#self.oy
sprite.angle = self.angle
sprite.mirror = self.mirror
sprite.opacity = self.opacity * 80 / 255
sprite.blend_type = 0
sprite.color = self.color.dup
sprite.src_rect = self.src_rect.dup
sprite.zoom_x = self.zoom_x
sprite.zoom_y = self.zoom_y
return sprite
end
def data_copy(data)
return if data.disposed? or self.disposed?
# 各データをコピー
self.x = data.x
self.y = data.y
self.z = data.z - 1
self.visible = data.visible
self.ox = data.ox
self.oy = data.oy
self.angle = data.angle
self.mirror = data.mirror
self.src_rect = data.src_rect
self.zoom_x = 1.1#data.zoom_x
self.zoom_y = 1.1#data.zoom_y
self.opacity = data.opacity * 190 / 255
end
end
class Blink_Sprite
def initialize(sprite, size)
@dx = -100000#$game_map.display_x / 8
@dy = -100000#$game_map.display_y / 8
@size = 10#size
@blink = []
(0...@size).each do |i|
@blink[i] = sprite.blink
end
end
def visible=(flag)
for sprite in @blink do
sprite.visible = flag
end
end
def color_set(color)
for sprite in @blink do
sprite.color = color.dup
end
end
def dispose
for sprite in @blink do
unless sprite.nil? then
unless sprite.disposed? then
sprite.dispose
end
end
end
end
def update(sprite)
if @blink[0].visible == false then
return
end
(0...@size).each do |i|
s = @blink[(@size - 1) - i]
s.data_copy(@blink[(@size - 1) - (i + 1)])
s.ox = s.ox + $game_map.display_x / 4 - @dx
s.oy = s.oy + $game_map.display_y / 4 - @dy
end
@dx = $game_map.display_x / 4
@dy = $game_map.display_y / 4
@blink[0].data_copy(sprite)
end
end
module MINTO_Sprite_Battler_02
def dispose
dispose_blink
super
end
def dispose_blink
unless @blink_anime.nil? then
@blink_anime.dispose
@blink_anime = nil
end
end
def animation_process_timing_new(timing, hit)
if timing.se.name == "幻影开始" then
dispose_blink
@blink_anime = Blink_Sprite.new(self, timing.flash_duration)
@blink_anime.visible = true
@blink_anime.color_set(timing.flash_color)
return
elsif timing.se.name == "幻影结束" then
dispose_blink
return
end
super(timing, hit)
end
def update
unless @blink_anime.nil? then
@blink_anime.update(self)
end
super
end
end
class Sprite_Character < RPG::Sprite
include MINTO_Sprite_Battler_02
end
end