diff --git a/Data/Scripts/001_Technical/006_RPG_Sprite.rb b/Data/Scripts/001_Technical/006_RPG_Sprite.rb index 0b5c0cf81..eb535d402 100644 --- a/Data/Scripts/001_Technical/006_RPG_Sprite.rb +++ b/Data/Scripts/001_Technical/006_RPG_Sprite.rb @@ -204,8 +204,8 @@ class SpriteAnimation sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192) case @_animation_height when 0 then sprite.z = 1 - when 1 then sprite.z = sprite.y + 32 + 17 - when 2 then sprite.z = sprite.y + 32 + 32 + 17 + when 1 then sprite.z = sprite.y + (Game_Map::TILE_HEIGHT * 3 / 2) + 1 + when 2 then sprite.z = sprite.y + (Game_Map::TILE_HEIGHT * 3) + 1 else sprite.z = 2000 end sprite.ox = 96 diff --git a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb index 5a081d40b..23d0bdde1 100644 --- a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb +++ b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb @@ -265,10 +265,10 @@ module Battle::Scene::Animation::BallAnimationMixin def battlerAbsorb(battler, delay, battlerX, battlerY, color) color.alpha = 255 - battler.moveColor(delay, 10, color) + battler.moveColor(delay, 10, color) # Change color of battler to a solid shade delay = battler.totalDuration battler.moveXY(delay, 5, battlerX, battlerY) - battler.moveZoom(delay, 5, 0) + battler.moveZoom(delay, 5, 0) # Shrink battler into Poké Ball battler.setVisible(delay + 5, false) end @@ -292,7 +292,61 @@ module Battle::Scene::Animation::BallAnimationMixin # The Poké Ball burst animation used when recalling a Pokémon. def ballBurstRecall(delay, ball, ballX, ballY, poke_ball) - ball.setDelta(delay, 0, 0, [@battler.battle.scene, :pbBallBurstCommonAnimation, - [getBallBurstAnimationName(poke_ball, :recall), @battler, ballX, ballY]]) + color_duration = 10 # Change color of battler to a solid shade - see def battlerAbsorb + shrink_duration = 5 # Shrink battler into Poké Ball - see def battlerAbsorb + burst_duration = color_duration + shrink_duration + # Burst particles + num_particles = 5 + base_angle = 55 + base_radius = 64 # How far out from the Poké Ball the particles go + num_particles.times do |i| + # Set up particle + particle = addNewSprite(ballX, ballY, + "Graphics/Battle animations/ballBurst_particle", PictureOrigin::CENTER) + particle.setZ(0, 110) + particle.setZoom(0, 150) + particle.setOpacity(0, 0) + particle.setVisible(0, false) + # Particle animation + particle.setVisible(delay, true) + particle.moveOpacity(delay, 2, 255) # Fade in quickly + burst_duration.times do |j| + angle = base_angle + (i * 360 / num_particles) + (135.0 * j / burst_duration) + radian = angle * Math::PI / 180 + radius = base_radius + if j < burst_duration / 5 + prop = j.to_f / (color_duration / 3) + radius *= 0.75 + (prop / 4) + elsif j >= burst_duration / 2 + prop = (j.to_f - burst_duration / 2) / (burst_duration / 2) + radius *= 1 - prop + end + if j == 0 + particle.setXY(delay + j, ballX + radius * Math.cos(radian), ballY - radius * Math.sin(radian)) + else + particle.moveXY(delay + j, 1, ballX + radius * Math.cos(radian), ballY - radius * Math.sin(radian)) + end + end + particle.moveZoom(delay, burst_duration, 0.75) + particle.moveTone(delay + color_duration / 2, color_duration / 2, Tone.new(0, 0, -192, -64)) # Yellow + particle.moveTone(delay + color_duration, shrink_duration, Tone.new(0, -128, -248, -224)) # Dark orange + particle.moveOpacity(delay + color_duration, shrink_duration, 0) # Fade out at end + particle.setVisible(delay + burst_duration, false) + end + # Ring particles + ring1 = addNewSprite(ballX, ballY, "Graphics/Battle animations/ballBurst_ring1", PictureOrigin::CENTER) + ring1.setZ(0, 110) + ring1.setZoom(0, 0) + ring1.setVisible(0, false) + ring2 = addNewSprite(ballX, ballY, "Graphics/Battle animations/ballBurst_ring2", PictureOrigin::CENTER) + ring2.setZ(0, 110) + ring2.setVisible(0, false) + # Ring particle animations + ring1.setVisible(delay + burst_duration - 2, true) + ring1.moveZoom(delay + burst_duration - 2, 4, 100) + ring1.setVisible(delay + burst_duration + 2, false) + ring2.setVisible(delay + burst_duration + 2, true) + ring2.moveZoom(delay + burst_duration + 2, 4, 200) + ring2.moveOpacity(delay + burst_duration + 2, 4, 0) end end diff --git a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb index 1e63b4df9..8a99522f9 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb @@ -964,7 +964,7 @@ def animationEditorMain(animation) viewport = Viewport.new(0, 0, Settings::SCREEN_WIDTH + 288, Settings::SCREEN_HEIGHT + 288) viewport.z = 99999 # Canvas - canvas = AnimationCanvas.new(animation[animation.selected], viewport) + canvas = AnimationCanvas.new(animation[animation.selected] || animation[0], viewport) # Right hand menu sidewin = ControlWindow.new(512 + 128, 0, 160, 384 + 128) sidewin.addButton(_INTL("SE and BG..."))