mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
Lots of rubocop
This commit is contained in:
@@ -363,8 +363,7 @@ class Battle::Scene
|
||||
pbShowWindow(MESSAGE_BOX)
|
||||
end
|
||||
|
||||
def pbBeginEndOfRoundPhase
|
||||
end
|
||||
def pbBeginEndOfRoundPhase; end
|
||||
|
||||
def pbEndBattle(_result)
|
||||
@abortable = false
|
||||
|
||||
@@ -98,15 +98,11 @@ class Battle::Scene
|
||||
if Input.trigger?(Input::LEFT)
|
||||
cw.index -= 1 if (cw.index & 1) == 1
|
||||
elsif Input.trigger?(Input::RIGHT)
|
||||
if battler.moves[cw.index + 1]&.id && (cw.index & 1) == 0
|
||||
cw.index += 1
|
||||
end
|
||||
cw.index += 1 if battler.moves[cw.index + 1]&.id && (cw.index & 1) == 0
|
||||
elsif Input.trigger?(Input::UP)
|
||||
cw.index -= 2 if (cw.index & 2) == 2
|
||||
elsif Input.trigger?(Input::DOWN)
|
||||
if battler.moves[cw.index + 2]&.id && (cw.index & 2) == 0
|
||||
cw.index += 2
|
||||
end
|
||||
cw.index += 2 if battler.moves[cw.index + 2]&.id && (cw.index & 2) == 0
|
||||
end
|
||||
pbPlayCursorSE if cw.index != oldIndex
|
||||
# Actions
|
||||
@@ -449,11 +445,11 @@ class Battle::Scene
|
||||
# not allow HM moves to be forgotten.
|
||||
def pbForgetMove(pkmn, moveToLearn)
|
||||
ret = -1
|
||||
pbFadeOutIn {
|
||||
pbFadeOutIn do
|
||||
scene = PokemonSummary_Scene.new
|
||||
screen = PokemonSummaryScreen.new(scene)
|
||||
ret = screen.pbStartForgetScreen([pkmn], 0, moveToLearn)
|
||||
}
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
@@ -468,10 +464,10 @@ class Battle::Scene
|
||||
# Shows the Pokédex entry screen for a newly caught Pokémon
|
||||
#=============================================================================
|
||||
def pbShowPokedex(species)
|
||||
pbFadeOutIn {
|
||||
pbFadeOutIn do
|
||||
scene = PokemonPokedexInfo_Scene.new
|
||||
screen = PokemonPokedexInfoScreen.new(scene)
|
||||
screen.pbDexEntry(species)
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -137,9 +137,7 @@ class Battle::Scene
|
||||
a[2] = true if a[1].animDone?
|
||||
end
|
||||
pbUpdate
|
||||
if !inPartyAnimation? && sendOutAnims.none? { |a| !a[2] }
|
||||
break
|
||||
end
|
||||
break if !inPartyAnimation? && sendOutAnims.none? { |a| !a[2] }
|
||||
end
|
||||
fadeAnim.dispose
|
||||
sendOutAnims.each do |a|
|
||||
@@ -498,13 +496,13 @@ class Battle::Scene
|
||||
target = (targets.is_a?(Array)) ? targets[0] : targets
|
||||
animations = pbLoadBattleAnimations
|
||||
return if !animations
|
||||
pbSaveShadows {
|
||||
pbSaveShadows do
|
||||
if animID[1] # On opposing side and using OppMove animation
|
||||
pbAnimationCore(animations[anim], target, user, true)
|
||||
else # On player's side, and/or using Move animation
|
||||
pbAnimationCore(animations[anim], user, target)
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
# Plays a common animation.
|
||||
|
||||
@@ -401,8 +401,8 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
angle = rand(360)
|
||||
radian = (angle + 90) * Math::PI / 180
|
||||
start_zoom = rand(50...100)
|
||||
ray = addNewSprite(ballX + ray_min_radius * Math.cos(radian),
|
||||
ballY - ray_min_radius * Math.sin(radian),
|
||||
ray = addNewSprite(ballX + (ray_min_radius * Math.cos(radian)),
|
||||
ballY - (ray_min_radius * Math.sin(radian)),
|
||||
"Graphics/Battle animations/ballBurst_ray", PictureOrigin::BOTTOM)
|
||||
ray.setZ(0, 100)
|
||||
ray.setZoomXY(0, 200, start_zoom)
|
||||
@@ -411,7 +411,7 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
ray.setVisible(0, false)
|
||||
ray.setAngle(0, angle)
|
||||
# Animate ray
|
||||
start = delay + i / 2
|
||||
start = delay + (i / 2)
|
||||
ray.setVisible(start, true)
|
||||
ray.moveZoomXY(start, ray_lifetime, 200, start_zoom * 6)
|
||||
ray.moveOpacity(start, 2, 255) # Quickly fade in
|
||||
@@ -437,7 +437,7 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
particle.setVisible(0, false)
|
||||
end
|
||||
# Animate particles
|
||||
start = delay + i / 4
|
||||
start = delay + (i / 4)
|
||||
max_radius = rand(256...384)
|
||||
angle = rand(360)
|
||||
radian = angle * Math::PI / 180
|
||||
@@ -596,7 +596,7 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
else
|
||||
glare1.moveZoom(delay, particle_duration, 600)
|
||||
end
|
||||
glare1.moveOpacity(delay + particle_duration / 2, particle_duration / 2, 0)
|
||||
glare1.moveOpacity(delay + (particle_duration / 2), particle_duration / 2, 0)
|
||||
[glare1, glare2, glare3].each_with_index do |particle, num|
|
||||
particle.moveTone(delay, particle_duration, variances[8 - (3 * num)])
|
||||
end
|
||||
@@ -604,13 +604,13 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
glare2.moveZoom(delay, particle_duration, 350)
|
||||
glare3.moveZoom(delay, particle_duration, 500)
|
||||
[glare2, glare3].each_with_index do |particle, num|
|
||||
particle.moveOpacity(delay + particle_duration / 2, particle_duration / 2, 0)
|
||||
particle.moveOpacity(delay + (particle_duration / 2), particle_duration / 2, 0)
|
||||
end
|
||||
else
|
||||
glare2.moveZoom(delay, particle_duration, (poke_ball == :MASTERBALL) ? 400 : 250)
|
||||
glare2.moveOpacity(delay + particle_duration / 2, particle_duration / 3, 0)
|
||||
glare2.moveOpacity(delay + (particle_duration / 2), particle_duration / 3, 0)
|
||||
glare3.moveZoom(delay, particle_duration, (poke_ball == :MASTERBALL) ? 800 : 500)
|
||||
glare3.moveOpacity(delay + particle_duration / 2, particle_duration / 3, 0)
|
||||
glare3.moveOpacity(delay + (particle_duration / 2), particle_duration / 3, 0)
|
||||
end
|
||||
[glare1, glare2, glare3].each { |p| p.setVisible(delay + particle_duration, false) }
|
||||
# Burst particles
|
||||
@@ -647,12 +647,12 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
prop = 2 - prop if index > particle_duration / 2
|
||||
radius *= prop
|
||||
particle1.moveXY(delay + j, 1,
|
||||
ballX + p1_x_offset * index * 2 / particle_duration,
|
||||
ballY - p1_y_offset * index * 2 / particle_duration)
|
||||
ballX + (p1_x_offset * index * 2 / particle_duration),
|
||||
ballY - (p1_y_offset * index * 2 / particle_duration))
|
||||
[particle2, particle3].each do |particle|
|
||||
particle.moveXY(delay + j, 1,
|
||||
ballX + radius * Math.cos(radian),
|
||||
ballY - radius * Math.sin(radian))
|
||||
ballX + (radius * Math.cos(radian)),
|
||||
ballY - (radius * Math.sin(radian)))
|
||||
end
|
||||
end
|
||||
particle1.moveZoom(delay, particle_duration, 0)
|
||||
@@ -674,14 +674,14 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
end
|
||||
# Zoom out
|
||||
if ["particle", "dazzle", "ring3", "ring4", "diamond"].include?(variances[12 - (3 * num)])
|
||||
particle.moveZoom(delay + particle_duration * 2 / 3, particle_duration / 3, 10)
|
||||
particle.moveZoom(delay + (particle_duration * 2 / 3), particle_duration / 3, 10)
|
||||
else
|
||||
particle.moveZoom(delay + particle_duration * 2 / 3, particle_duration / 3, 25)
|
||||
particle.moveZoom(delay + (particle_duration * 2 / 3), particle_duration / 3, 25)
|
||||
end
|
||||
# Rotate (for Premier Ball)
|
||||
particle.moveAngle(delay, particle_duration, -180) if poke_ball == :PREMIERBALL
|
||||
# Change tone, fade out
|
||||
particle.moveTone(delay + particle_duration / 3, (particle_duration.to_f / 3).ceil, variances[14 - (3 * num)])
|
||||
particle.moveTone(delay + (particle_duration / 3), (particle_duration.to_f / 3).ceil, variances[14 - (3 * num)])
|
||||
particle.moveOpacity(delay + particle_duration - 3, 3, 128) # Fade out at end
|
||||
end
|
||||
[particle1, particle2, particle3].each { |p| p.setVisible(delay + particle_duration, false) }
|
||||
@@ -702,7 +702,7 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
web.moveZoom(delay + start + (i * 4), 2, 150)
|
||||
web.moveZoom(delay + start + (i * 4) + 2, 2, 120)
|
||||
end
|
||||
now = start + (web_duration / 4) * 4
|
||||
now = start + ((web_duration / 4) * 4)
|
||||
web.moveZoom(delay + now, particle_duration + ring_duration - now, 150)
|
||||
web.moveOpacity(delay + particle_duration, ring_duration, 0)
|
||||
web.setVisible(delay + particle_duration + ring_duration, false)
|
||||
@@ -747,10 +747,10 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
index = j + 1
|
||||
x = 72 * index / star_duration
|
||||
proportion = index.to_f / star_duration
|
||||
a = (2 * y_pos[2]) - 4 * y_pos[1]
|
||||
a = (2 * y_pos[2]) - (4 * y_pos[1])
|
||||
b = y_pos[2] - a
|
||||
y = ((a * proportion) + b) * proportion
|
||||
star.moveXY(delay + j, 1, ballX + [-1, 0, 1][i] * x, ballY - y)
|
||||
star.moveXY(delay + j, 1, ballX + ([-1, 0, 1][i] * x), ballY - y)
|
||||
end
|
||||
star.moveAngle(delay, star_duration, start_angle + [144, 0, 45][i]) if i.even?
|
||||
star.moveOpacity(delay, 4, 255) # Fade in
|
||||
@@ -789,17 +789,17 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
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)
|
||||
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))
|
||||
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))
|
||||
particle.moveXY(delay + j, 1, ballX + (radius * Math.cos(radian)), ballY - (radius * Math.sin(radian)))
|
||||
end
|
||||
end
|
||||
particle.moveZoom(delay, burst_duration, 0)
|
||||
particle.moveTone(delay + color_duration / 2, color_duration / 2, Tone.new(0, 0, -192)) # Yellow
|
||||
particle.moveTone(delay + (color_duration / 2), color_duration / 2, Tone.new(0, 0, -192)) # Yellow
|
||||
particle.moveTone(delay + color_duration, shrink_duration, Tone.new(0, -128, -248)) # Dark orange
|
||||
particle.moveOpacity(delay + color_duration, shrink_duration, 0) # Fade out at end
|
||||
particle.setVisible(delay + burst_duration, false)
|
||||
|
||||
@@ -323,10 +323,10 @@ class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation
|
||||
partyBar.setVisible(delay + 12, false)
|
||||
partyBar.setOpacity(delay + 12, 255)
|
||||
end
|
||||
Battle::Scene::NUM_BALLS.times do |i|
|
||||
next if !@sprites["partyBall_0_#{i}"] || !@sprites["partyBall_0_#{i}"].visible
|
||||
partyBall = addSprite(@sprites["partyBall_0_#{i}"])
|
||||
partyBall.moveDelta(delay + (2 * i), 16, -Graphics.width, 0) if @fullAnim
|
||||
Battle::Scene::NUM_BALLS.times do |j|
|
||||
next if !@sprites["partyBall_0_#{j}"] || !@sprites["partyBall_0_#{j}"].visible
|
||||
partyBall = addSprite(@sprites["partyBall_0_#{j}"])
|
||||
partyBall.moveDelta(delay + (2 * j), 16, -Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveOpacity(delay, 12, 0)
|
||||
partyBall.setVisible(delay + 12, false)
|
||||
partyBall.setOpacity(delay + 12, 255)
|
||||
@@ -366,10 +366,10 @@ class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
|
||||
partyBar.setVisible(delay + 12, false)
|
||||
partyBar.setOpacity(delay + 12, 255)
|
||||
end
|
||||
Battle::Scene::NUM_BALLS.times do |i|
|
||||
next if !@sprites["partyBall_1_#{i}"] || !@sprites["partyBall_1_#{i}"].visible
|
||||
partyBall = addSprite(@sprites["partyBall_1_#{i}"])
|
||||
partyBall.moveDelta(delay + (2 * i), 16, Graphics.width, 0) if @fullAnim
|
||||
Battle::Scene::NUM_BALLS.times do |j|
|
||||
next if !@sprites["partyBall_1_#{j}"] || !@sprites["partyBall_1_#{j}"].visible
|
||||
partyBall = addSprite(@sprites["partyBall_1_#{j}"])
|
||||
partyBall.moveDelta(delay + (2 * j), 16, Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveOpacity(delay, 12, 0)
|
||||
partyBall.setVisible(delay + 12, false)
|
||||
partyBall.setOpacity(delay + 12, 255)
|
||||
|
||||
Reference in New Issue
Block a user