mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
Teak to animation in previous commit
This commit is contained in:
@@ -1255,18 +1255,28 @@ module Transitions
|
|||||||
@flash_viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
@flash_viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
||||||
@flash_viewport.z = 99999
|
@flash_viewport.z = 99999
|
||||||
@flash_viewport.color = Color.new(255, 255, 255, 0)
|
@flash_viewport.color = Color.new(255, 255, 255, 0)
|
||||||
|
# Background black
|
||||||
|
@rear_black_sprite = new_sprite(0, 0, @black_bitmap)
|
||||||
|
@rear_black_sprite.z = 1
|
||||||
|
@rear_black_sprite.zoom_y = 2.0
|
||||||
|
@rear_black_sprite.opacity = 224
|
||||||
|
@rear_black_sprite.visible = false
|
||||||
# Bar sprites (need 2 of them to make them loop around)
|
# Bar sprites (need 2 of them to make them loop around)
|
||||||
@sprites = []
|
@sprites = []
|
||||||
((Graphics.width.to_f / @bar_bitmap.width).ceil + 1).times do |i|
|
((Graphics.width.to_f / @bar_bitmap.width).ceil + 1).times do |i|
|
||||||
spr = new_sprite(Graphics.width * i, BAR_Y, @bar_bitmap)
|
spr = new_sprite(Graphics.width * i, BAR_Y, @bar_bitmap)
|
||||||
|
spr.z = 2
|
||||||
@sprites.push(spr)
|
@sprites.push(spr)
|
||||||
end
|
end
|
||||||
# Overworld sprite
|
# Overworld sprite
|
||||||
@bar_mask_sprite = new_sprite(0, 0, @overworld_bitmap.clone)
|
@bar_mask_sprite = new_sprite(0, 0, @overworld_bitmap.clone)
|
||||||
@bar_mask_sprite.z = 1
|
@bar_mask_sprite.z = 3
|
||||||
# VS logo
|
# VS logo
|
||||||
@vs_x = 144
|
@vs_x = 144
|
||||||
@vs_y = @sprites[0].y + (@sprites[0].height / 2)
|
@vs_y = @sprites[0].y + (@sprites[0].height / 2)
|
||||||
|
@vs_main_sprite = new_sprite(@vs_x, @vs_y, @vs_1_bitmap, @vs_1_bitmap.width / 2, @vs_1_bitmap.height / 2)
|
||||||
|
@vs_main_sprite.visible = false
|
||||||
|
@vs_main_sprite.z = 4
|
||||||
@vs_1_sprite = new_sprite(@vs_x, @vs_y, @vs_2_bitmap, @vs_2_bitmap.width / 2, @vs_2_bitmap.height / 2)
|
@vs_1_sprite = new_sprite(@vs_x, @vs_y, @vs_2_bitmap, @vs_2_bitmap.width / 2, @vs_2_bitmap.height / 2)
|
||||||
@vs_1_sprite.visible = false
|
@vs_1_sprite.visible = false
|
||||||
@vs_1_sprite.z = 5
|
@vs_1_sprite.z = 5
|
||||||
@@ -1274,20 +1284,18 @@ module Transitions
|
|||||||
@vs_1_sprite.zoom_y = @vs_1_sprite.zoom_x
|
@vs_1_sprite.zoom_y = @vs_1_sprite.zoom_x
|
||||||
@vs_2_sprite = new_sprite(@vs_x, @vs_y, @vs_2_bitmap, @vs_2_bitmap.width / 2, @vs_2_bitmap.height / 2)
|
@vs_2_sprite = new_sprite(@vs_x, @vs_y, @vs_2_bitmap, @vs_2_bitmap.width / 2, @vs_2_bitmap.height / 2)
|
||||||
@vs_2_sprite.visible = false
|
@vs_2_sprite.visible = false
|
||||||
@vs_2_sprite.z = 4
|
@vs_2_sprite.z = 6
|
||||||
@vs_2_sprite.zoom_x = 2.0
|
@vs_2_sprite.zoom_x = 2.0
|
||||||
@vs_2_sprite.zoom_y = @vs_2_sprite.zoom_x
|
@vs_2_sprite.zoom_y = @vs_2_sprite.zoom_x
|
||||||
@vs_main_sprite = new_sprite(@vs_x, @vs_y, @vs_1_bitmap, @vs_1_bitmap.width / 2, @vs_1_bitmap.height / 2)
|
|
||||||
@vs_main_sprite.visible = false
|
|
||||||
@vs_main_sprite.z = 2
|
|
||||||
# Foe sprite
|
# Foe sprite
|
||||||
@foe_sprite = new_sprite(Graphics.width + @foe_bitmap.width, @sprites[0].y + @sprites[0].height - 12,
|
@foe_sprite = new_sprite(Graphics.width + @foe_bitmap.width, @sprites[0].y + @sprites[0].height - 12,
|
||||||
@foe_bitmap, @foe_bitmap.width / 2, @foe_bitmap.height)
|
@foe_bitmap, @foe_bitmap.width / 2, @foe_bitmap.height)
|
||||||
@foe_sprite.color = Color.new(0, 0, 0)
|
@foe_sprite.color = Color.new(0, 0, 0)
|
||||||
|
@foe_sprite.z = 7
|
||||||
# Sprite with foe's name written in it
|
# Sprite with foe's name written in it
|
||||||
@text_sprite = BitmapSprite.new(Graphics.width, @bar_bitmap.height, @viewport)
|
@text_sprite = BitmapSprite.new(Graphics.width, @bar_bitmap.height, @viewport)
|
||||||
@text_sprite.y = BAR_Y
|
@text_sprite.y = BAR_Y
|
||||||
@text_sprite.z = 6
|
@text_sprite.z = 8
|
||||||
@text_sprite.visible = false
|
@text_sprite.visible = false
|
||||||
pbSetSystemFont(@text_sprite.bitmap)
|
pbSetSystemFont(@text_sprite.bitmap)
|
||||||
pbDrawTextPositions(@text_sprite.bitmap,
|
pbDrawTextPositions(@text_sprite.bitmap,
|
||||||
@@ -1318,12 +1326,13 @@ module Transitions
|
|||||||
|
|
||||||
def dispose_all
|
def dispose_all
|
||||||
# Dispose sprites
|
# Dispose sprites
|
||||||
|
@rear_black_sprite&.dispose
|
||||||
@sprites.each { |s| s&.dispose }
|
@sprites.each { |s| s&.dispose }
|
||||||
@sprites.clear
|
@sprites.clear
|
||||||
@bar_mask_sprite&.dispose
|
@bar_mask_sprite&.dispose
|
||||||
|
@vs_main_sprite&.dispose
|
||||||
@vs_1_sprite&.dispose
|
@vs_1_sprite&.dispose
|
||||||
@vs_2_sprite&.dispose
|
@vs_2_sprite&.dispose
|
||||||
@vs_main_sprite&.dispose
|
|
||||||
@foe_sprite&.dispose
|
@foe_sprite&.dispose
|
||||||
@text_sprite&.dispose
|
@text_sprite&.dispose
|
||||||
@black_sprite&.dispose
|
@black_sprite&.dispose
|
||||||
@@ -1361,6 +1370,7 @@ module Transitions
|
|||||||
proportion = (@timer - @flash_start) / @flash_duration
|
proportion = (@timer - @flash_start) / @flash_duration
|
||||||
if proportion >= 0.5
|
if proportion >= 0.5
|
||||||
@flash_viewport.color.alpha = 320 * 2 * (1 - proportion)
|
@flash_viewport.color.alpha = 320 * 2 * (1 - proportion)
|
||||||
|
@rear_black_sprite.visible = true
|
||||||
@foe_sprite.color.alpha = 0
|
@foe_sprite.color.alpha = 0
|
||||||
@text_sprite.visible = true
|
@text_sprite.visible = true
|
||||||
else
|
else
|
||||||
@@ -1374,28 +1384,28 @@ module Transitions
|
|||||||
start_x = Graphics.width + (@foe_bitmap.width / 2)
|
start_x = Graphics.width + (@foe_bitmap.width / 2)
|
||||||
@foe_sprite.x = start_x + (FOE_SPRITE_X_LIMIT - start_x) * proportion
|
@foe_sprite.x = start_x + (FOE_SPRITE_X_LIMIT - start_x) * proportion
|
||||||
elsif @timer >= @vs_appear_final
|
elsif @timer >= @vs_appear_final
|
||||||
@vs_2_sprite.visible = false
|
@vs_1_sprite.visible = false
|
||||||
elsif @timer >= @vs_appear_start_2
|
elsif @timer >= @vs_appear_start_2
|
||||||
# Temp VS sprites enlarge and shrink again
|
# Temp VS sprites enlarge and shrink again
|
||||||
if @vs_1_sprite.visible
|
if @vs_2_sprite.visible
|
||||||
@vs_1_sprite.zoom_x = 1.6 - 0.8 * (@timer - @vs_appear_start_2) / @vs_shrink_time
|
@vs_2_sprite.zoom_x = 1.6 - 0.8 * (@timer - @vs_appear_start_2) / @vs_shrink_time
|
||||||
@vs_1_sprite.zoom_y = @vs_1_sprite.zoom_x
|
@vs_2_sprite.zoom_y = @vs_2_sprite.zoom_x
|
||||||
if @vs_1_sprite.zoom_x <= 1.2
|
if @vs_2_sprite.zoom_x <= 1.2
|
||||||
@vs_1_sprite.visible = false
|
@vs_2_sprite.visible = false
|
||||||
@vs_main_sprite.visible = true
|
@vs_main_sprite.visible = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@vs_2_sprite.zoom_x = 2.0 - 0.8 * (@timer - @vs_appear_start_2) / @vs_shrink_time
|
@vs_1_sprite.zoom_x = 2.0 - 0.8 * (@timer - @vs_appear_start_2) / @vs_shrink_time
|
||||||
@vs_2_sprite.zoom_y = @vs_2_sprite.zoom_x
|
@vs_1_sprite.zoom_y = @vs_1_sprite.zoom_x
|
||||||
elsif @timer >= @vs_appear_start
|
elsif @timer >= @vs_appear_start
|
||||||
# Temp VS sprites appear and start shrinking
|
# Temp VS sprites appear and start shrinking
|
||||||
@vs_1_sprite.visible = true
|
@vs_2_sprite.visible = true
|
||||||
@vs_1_sprite.zoom_x = 2.0 - 0.8 * (@timer - @vs_appear_start) / @vs_shrink_time
|
@vs_2_sprite.zoom_x = 2.0 - 0.8 * (@timer - @vs_appear_start) / @vs_shrink_time
|
||||||
@vs_1_sprite.zoom_y = @vs_1_sprite.zoom_x
|
@vs_2_sprite.zoom_y = @vs_2_sprite.zoom_x
|
||||||
if @vs_2_sprite.visible || @vs_1_sprite.zoom_x <= 1.6 # Halfway between 2.0 and 1.2
|
if @vs_1_sprite.visible || @vs_2_sprite.zoom_x <= 1.6 # Halfway between 2.0 and 1.2
|
||||||
@vs_2_sprite.visible = true
|
@vs_1_sprite.visible = true
|
||||||
@vs_2_sprite.zoom_x = 2.0 - 0.8 * (@timer - @vs_appear_start - (@vs_shrink_time / 2)) / @vs_shrink_time
|
@vs_1_sprite.zoom_x = 2.0 - 0.8 * (@timer - @vs_appear_start - (@vs_shrink_time / 2)) / @vs_shrink_time
|
||||||
@vs_2_sprite.zoom_y = @vs_2_sprite.zoom_x
|
@vs_1_sprite.zoom_y = @vs_1_sprite.zoom_x
|
||||||
end
|
end
|
||||||
elsif @timer >= @bar_appear_end
|
elsif @timer >= @bar_appear_end
|
||||||
@bar_mask_sprite.visible = false
|
@bar_mask_sprite.visible = false
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ def pbBattleAnimationCore(anim, viewport, location, num_flashes = 2)
|
|||||||
break if timer >= half_flash_time * 2
|
break if timer >= half_flash_time * 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
viewport.color.alpha = 0
|
||||||
end
|
end
|
||||||
# Take screenshot of game, for use in some animations
|
# Take screenshot of game, for use in some animations
|
||||||
$game_temp.background_bitmap&.dispose
|
$game_temp.background_bitmap&.dispose
|
||||||
|
|||||||
Reference in New Issue
Block a user