Lots of rubocop

This commit is contained in:
Maruno17
2023-01-28 15:21:12 +00:00
parent 2d056052ce
commit 13aab8d911
159 changed files with 1679 additions and 1931 deletions

View File

@@ -211,9 +211,7 @@ class Battle
oldSpAtk = pkmn.spatk
oldSpDef = pkmn.spdef
oldSpeed = pkmn.speed
if battler&.pokemon
battler.pokemon.changeHappiness("levelup")
end
battler.pokemon.changeHappiness("levelup") if battler&.pokemon
pkmn.calc_stats
battler&.pbUpdate(false)
@scene.pbRefreshOne(battler.index) if battler

View File

@@ -227,7 +227,7 @@ class Battle
end
# Reorder the priority array
if needRearranging
@priority.sort! { |a, b|
@priority.sort! do |a, b|
if a[5] != b[5]
# Sort by priority (highest value first)
b[5] <=> a[5]
@@ -241,7 +241,7 @@ class Battle
# Sort by speed (highest first), and use tie-breaker if necessary
(a[1] == b[1]) ? b[6] <=> a[6] : b[1] <=> a[1]
end
}
end
# Write the priority order to the debug log
logMsg = (fullCalc) ? "[Round order] " : "[Round order recalculated] "
comma = false

View File

@@ -111,7 +111,7 @@ class Battle
# all instances where the party screen is opened.
def pbPartyScreen(idxBattler, checkLaxOnly = false, canCancel = false, shouldRegister = false)
ret = -1
@scene.pbPartyScreen(idxBattler, canCancel) { |idxParty, partyScene|
@scene.pbPartyScreen(idxBattler, canCancel) do |idxParty, partyScene|
if checkLaxOnly
next false if !pbCanSwitchLax?(idxBattler, idxParty, partyScene)
elsif !pbCanSwitch?(idxBattler, idxParty, partyScene)
@@ -122,7 +122,7 @@ class Battle
end
ret = idxParty
next true
}
end
return ret
end

View File

@@ -64,7 +64,7 @@ class Battle
return true if pbAutoFightMenu(idxBattler)
# Regular move selection
ret = false
@scene.pbFightMenu(idxBattler, pbCanMegaEvolve?(idxBattler)) { |cmd|
@scene.pbFightMenu(idxBattler, pbCanMegaEvolve?(idxBattler)) do |cmd|
case cmd
when -1 # Cancel
when -2 # Toggle Mega Evolution
@@ -83,7 +83,7 @@ class Battle
ret = true
end
next true
}
end
return ret
end
@@ -103,7 +103,7 @@ class Battle
return false
end
ret = false
@scene.pbItemMenu(idxBattler, firstAction) { |item, useType, idxPkmn, idxMove, itemScene|
@scene.pbItemMenu(idxBattler, firstAction) do |item, useType, idxPkmn, idxMove, itemScene|
next false if !item
battler = pkmn = nil
case useType
@@ -133,7 +133,7 @@ class Battle
next false if !pbRegisterItem(idxBattler, item, idxPkmn, idxMove)
ret = true
next true
}
end
return ret
end

View File

@@ -57,9 +57,9 @@ class Battle
pbPursuit(b.index)
return if @decision > 0
# Switch Pokémon
allBattlers.each do |b|
b.droppedBelowHalfHP = false
b.statsDropped = false
allBattlers.each do |b2|
b2.droppedBelowHalfHP = false
b2.statsDropped = false
end
pbRecallAndReplace(b.index, idxNewPkmn)
pbOnBattlerEnteringBattle(b.index, true)

View File

@@ -141,9 +141,9 @@ class Battle
next if battler.opposes?(side)
next if !battler.takesIndirectDamage? || battler.pbHasType?(:FIRE)
@scene.pbDamageAnimation(battler)
battler.pbTakeEffectDamage(battler.totalhp / 8, false) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 8, false) do |hp_lost|
pbDisplay(_INTL("{1} is hurt by the sea of fire!", battler.pbThis))
}
end
end
end
end
@@ -190,11 +190,11 @@ class Battle
recipient = @battlers[battler.effects[PBEffects::LeechSeed]]
next if !recipient || recipient.fainted?
pbCommonAnimation("LeechSeed", recipient, battler)
battler.pbTakeEffectDamage(battler.totalhp / 8) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 8) do |hp_lost|
recipient.pbRecoverHPFromDrain(hp_lost, battler,
_INTL("{1}'s health is sapped by Leech Seed!", battler.pbThis))
recipient.pbAbilitiesOnDamageTaken
}
end
recipient.pbFaint if recipient.fainted?
end
end
@@ -257,16 +257,16 @@ class Battle
priority.each do |battler|
battler.effects[PBEffects::Nightmare] = false if !battler.asleep?
next if !battler.effects[PBEffects::Nightmare] || !battler.takesIndirectDamage?
battler.pbTakeEffectDamage(battler.totalhp / 4) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 4) do |hp_lost|
pbDisplay(_INTL("{1} is locked in a nightmare!", battler.pbThis))
}
end
end
# Curse
priority.each do |battler|
next if !battler.effects[PBEffects::Curse] || !battler.takesIndirectDamage?
battler.pbTakeEffectDamage(battler.totalhp / 4) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 4) do |hp_lost|
pbDisplay(_INTL("{1} is afflicted by the curse!", battler.pbThis))
}
end
end
end
@@ -299,9 +299,9 @@ class Battle
hpLoss = (Settings::MECHANICS_GENERATION >= 6) ? battler.totalhp / 6 : battler.totalhp / 8
end
@scene.pbDamageAnimation(battler)
battler.pbTakeEffectDamage(hpLoss, false) { |hp_lost|
battler.pbTakeEffectDamage(hpLoss, false) do |hp_lost|
pbDisplay(_INTL("{1} is hurt by {2}!", battler.pbThis, move_name))
}
end
end
#=============================================================================
@@ -317,9 +317,9 @@ class Battle
def pbEOREndBattlerEffects(priority)
# Taunt
pbEORCountDownBattlerEffect(priority, PBEffects::Taunt) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Taunt) do |battler|
pbDisplay(_INTL("{1}'s taunt wore off!", battler.pbThis))
}
end
# Encore
priority.each do |battler|
next if battler.fainted? || battler.effects[PBEffects::Encore] == 0
@@ -337,34 +337,34 @@ class Battle
end
end
# Disable/Cursed Body
pbEORCountDownBattlerEffect(priority, PBEffects::Disable) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Disable) do |battler|
battler.effects[PBEffects::DisableMove] = nil
pbDisplay(_INTL("{1} is no longer disabled!", battler.pbThis))
}
end
# Magnet Rise
pbEORCountDownBattlerEffect(priority, PBEffects::MagnetRise) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::MagnetRise) do |battler|
pbDisplay(_INTL("{1}'s electromagnetism wore off!", battler.pbThis))
}
end
# Telekinesis
pbEORCountDownBattlerEffect(priority, PBEffects::Telekinesis) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Telekinesis) do |battler|
pbDisplay(_INTL("{1} was freed from the telekinesis!", battler.pbThis))
}
end
# Heal Block
pbEORCountDownBattlerEffect(priority, PBEffects::HealBlock) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::HealBlock) do |battler|
pbDisplay(_INTL("{1}'s Heal Block wore off!", battler.pbThis))
}
end
# Embargo
pbEORCountDownBattlerEffect(priority, PBEffects::Embargo) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Embargo) do |battler|
pbDisplay(_INTL("{1} can use items again!", battler.pbThis))
battler.pbItemTerrainStatBoostCheck
}
end
# Yawn
pbEORCountDownBattlerEffect(priority, PBEffects::Yawn) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Yawn) do |battler|
if battler.pbCanSleepYawn?
PBDebug.log("[Lingering effect] #{battler.pbThis} fell asleep because of Yawn")
battler.pbSleep
end
}
end
# Perish Song
perishSongUsers = []
priority.each do |battler|

View File

@@ -72,10 +72,10 @@ class Battle::Battler
# in and not at any later times, even if a traceable ability turns
# up later. Essentials ignores this, and allows Trace to trigger
# whenever it can even in Gen 5 battle mechanics.
choices = @battle.allOtherSideBattlers(@index).select { |b|
choices = @battle.allOtherSideBattlers(@index).select do |b|
next !b.ungainableAbility? &&
![:POWEROFALCHEMY, :RECEIVER, :TRACE].include?(b.ability_id)
}
end
if choices.length > 0
choice = choices[@battle.pbRandom(choices.length)]
@battle.pbShowAbilitySplash(self)

View File

@@ -48,9 +48,7 @@ class Battle::Battler
end
# Use the move
PBDebug.log("[Move usage] #{pbThis} started using #{choice[2].name}")
PBDebug.logonerr {
pbUseMove(choice, choice[2] == @battle.struggle)
}
PBDebug.logonerr { pbUseMove(choice, choice[2] == @battle.struggle) }
@battle.pbJudge
# Update priority order
@battle.pbCalculatePriority if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
@@ -315,9 +313,9 @@ class Battle::Battler
@battle.pbDisplay(_INTL("When the flame touched the powder on the Pokémon, it exploded!"))
user.lastMoveFailed = true
if ![:Rain, :HeavyRain].include?(user.effectiveWeather) && user.takesIndirectDamage?
user.pbTakeEffectDamage((user.totalhp / 4.0).round, false) { |hp_lost|
user.pbTakeEffectDamage((user.totalhp / 4.0).round, false) do |hp_lost|
@battle.pbDisplay(_INTL("{1} is hurt by its {2}!", battler.pbThis, battler.itemName))
}
end
@battle.pbGainExp # In case user is KO'd by this
end
pbCancelMoves
@@ -531,9 +529,9 @@ class Battle::Battler
@battle.pbDisplay(_INTL("{1} used the move instructed by {2}!", b.pbThis, user.pbThis(true)))
b.effects[PBEffects::Instructed] = true
if b.pbCanChooseMove?(@moves[idxMove], false)
PBDebug.logonerr {
PBDebug.logonerr do
b.pbUseMoveSimple(b.lastMoveUsed, b.lastRegularMoveTarget, idxMove, false)
}
end
b.lastRoundMoved = oldLastRoundMoved
@battle.pbJudge
return if @battle.decision > 0
@@ -567,9 +565,7 @@ class Battle::Battler
end
nextUser.effects[PBEffects::Dancer] = true
if nextUser.pbCanChooseMove?(move, false)
PBDebug.logonerr {
nextUser.pbUseMoveSimple(move.id, preTarget)
}
PBDebug.logonerr { nextUser.pbUseMoveSimple(move.id, preTarget) }
nextUser.lastRoundMoved = oldLastRoundMoved
nextUser.effects[PBEffects::Outrage] = oldOutrage
nextUser.currentMove = oldCurrentMove
@@ -716,9 +712,7 @@ class Battle::Battler
next if b.damageState.calcDamage == 0
chance = move.pbAdditionalEffectChance(user, b)
next if chance <= 0
if @battle.pbRandom(100) < chance
move.pbAdditionalEffect(user, b)
end
move.pbAdditionalEffect(user, b) if @battle.pbRandom(100) < chance
end
end
# Make the target flinch (because of an item/ability)

View File

@@ -104,11 +104,11 @@ class Battle::Move
def pbFailsAgainstTarget?(user, target, show_message); return false; end
def pbMoveFailedLastInRound?(user, showMessage = true)
unmoved = @battle.allBattlers.any? { |b|
unmoved = @battle.allBattlers.any? do |b|
next b.index != user.index &&
[:UseMove, :Shift].include?(@battle.choices[b.index][0]) &&
!b.movedThisRound?
}
end
if !unmoved
@battle.pbDisplay(_INTL("But it failed!")) if showMessage
return true

View File

@@ -226,16 +226,12 @@ class Battle::Move
def pbModifyDamage(damageMult, user, target); return damageMult; end
def pbGetAttackStats(user, target)
if specialMove?
return user.spatk, user.stages[:SPECIAL_ATTACK] + 6
end
return user.spatk, user.stages[:SPECIAL_ATTACK] + 6 if specialMove?
return user.attack, user.stages[:ATTACK] + 6
end
def pbGetDefenseStats(user, target)
if specialMove?
return target.spdef, target.stages[:SPECIAL_DEFENSE] + 6
end
return target.spdef, target.stages[:SPECIAL_DEFENSE] + 6 if specialMove?
return target.defense, target.stages[:DEFENSE] + 6
end
@@ -396,9 +392,7 @@ class Battle::Move
end
end
# Multi-targeting attacks
if numTargets > 1
multipliers[:final_damage_multiplier] *= 0.75
end
multipliers[:final_damage_multiplier] *= 0.75 if numTargets > 1
# Weather
case user.effectiveWeather
when :Sun, :HarshSun

View File

@@ -356,8 +356,7 @@ class Battle::Move::TwoTurnMove < Battle::Move
@battle.pbDisplay(_INTL("{1} began charging up!", user.pbThis))
end
def pbAttackingTurnMessage(user, targets)
end
def pbAttackingTurnMessage(user, targets); end
def pbEffectAgainstTarget(user, target)
if @damagingTurn
@@ -372,8 +371,7 @@ class Battle::Move::TwoTurnMove < Battle::Move
# the latter just records the target is being Sky Dropped
end
def pbAttackingTurnEffect(user, target)
end
def pbAttackingTurnEffect(user, target); end
def pbShowAnimation(id, user, targets, hitNum = 0, showAnimation = true)
hitNum = 1 if @chargingTurn && !@damagingTurn # Charging anim

View File

@@ -100,9 +100,7 @@ class Battle::Move::OHKO < Battle::Move::FixedDamageMove
def pbHitEffectivenessMessages(user, target, numTargets = 1)
super
if target.fainted?
@battle.pbDisplay(_INTL("It's a one-hit KO!"))
end
@battle.pbDisplay(_INTL("It's a one-hit KO!")) if target.fainted?
end
end
@@ -1211,9 +1209,7 @@ end
#===============================================================================
class Battle::Move::UseTargetAttackInsteadOfUserAttack < Battle::Move
def pbGetAttackStats(user, target)
if specialMove?
return target.spatk, target.stages[:SPECIAL_ATTACK] + 6
end
return target.spatk, target.stages[:SPECIAL_ATTACK] + 6 if specialMove?
return target.attack, target.stages[:ATTACK] + 6
end
end

View File

@@ -363,8 +363,7 @@ class Battle::Scene
pbShowWindow(MESSAGE_BOX)
end
def pbBeginEndOfRoundPhase
end
def pbBeginEndOfRoundPhase; end
def pbEndBattle(_result)
@abortable = false

View File

@@ -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

View File

@@ -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.

View File

@@ -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)

View File

@@ -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)

View File

@@ -26,10 +26,10 @@ module Battle::CatchAndStoreMixin
when 0 # Add to your party
pbDisplay(_INTL("Choose a Pokémon in your party to send to your Boxes."))
party_index = -1
@scene.pbPartyScreen(0, (@sendToBoxes != 2), 1) { |idxParty, _partyScene|
@scene.pbPartyScreen(0, (@sendToBoxes != 2), 1) do |idxParty, _partyScene|
party_index = idxParty
next true
}
end
next if party_index < 0 # Cancelled
party_size = pbPlayer.party.length
# Send chosen Pokémon to storage
@@ -56,11 +56,11 @@ module Battle::CatchAndStoreMixin
when 1 # Send to a Box
break
when 2 # See X's summary
pbFadeOutIn {
pbFadeOutIn do
summary_scene = PokemonSummary_Scene.new
summary_screen = PokemonSummaryScreen.new(summary_scene, true)
summary_screen.pbStartScreen([pkmn], 0)
}
end
when 3 # Check party
@scene.pbPartyScreen(0, true, 2)
end

View File

@@ -1240,9 +1240,7 @@ Battle::AbilityEffects::DamageCalcFromUser.add(:DRAGONSMAW,
Battle::AbilityEffects::DamageCalcFromUser.add(:FLAREBOOST,
proc { |ability, user, target, move, mults, baseDmg, type|
if user.burned? && move.specialMove?
mults[:base_damage_multiplier] *= 1.5
end
mults[:base_damage_multiplier] *= 1.5 if user.burned? && move.specialMove?
}
)
@@ -1384,9 +1382,7 @@ Battle::AbilityEffects::DamageCalcFromUser.add(:SOLARPOWER,
Battle::AbilityEffects::DamageCalcFromUser.add(:SNIPER,
proc { |ability, user, target, move, mults, baseDmg, type|
if target.damageState.critical
mults[:final_damage_multiplier] *= 1.5
end
mults[:final_damage_multiplier] *= 1.5 if target.damageState.critical
}
)
@@ -1546,9 +1542,7 @@ Battle::AbilityEffects::DamageCalcFromTarget.add(:FURCOAT,
Battle::AbilityEffects::DamageCalcFromTarget.add(:GRASSPELT,
proc { |ability, user, target, move, mults, baseDmg, type|
if user.battle.field.terrain == :Grassy
mults[:defense_multiplier] *= 1.5
end
mults[:defense_multiplier] *= 1.5 if user.battle.field.terrain == :Grassy
}
)
@@ -1610,9 +1604,7 @@ Battle::AbilityEffects::DamageCalcFromTargetNonIgnorable.add(:PRISMARMOR,
Battle::AbilityEffects::DamageCalcFromTargetNonIgnorable.add(:SHADOWSHIELD,
proc { |ability, user, target, move, mults, baseDmg, type|
if target.hp == target.totalhp
mults[:final_damage_multiplier] /= 2
end
mults[:final_damage_multiplier] /= 2 if target.hp == target.totalhp
}
)
@@ -2425,7 +2417,7 @@ Battle::AbilityEffects::EndOfRoundEffect.add(:BADDREAMS,
next if !b.near?(battler) || !b.asleep?
battle.pbShowAbilitySplash(battler)
next if !b.takesIndirectDamage?(Battle::Scene::USE_ABILITY_SPLASH)
b.pbTakeEffectDamage(b.totalhp / 8) { |hp_lost|
b.pbTakeEffectDamage(b.totalhp / 8) do |hp_lost|
if Battle::Scene::USE_ABILITY_SPLASH
battle.pbDisplay(_INTL("{1} is tormented!", b.pbThis))
else
@@ -2433,7 +2425,7 @@ Battle::AbilityEffects::EndOfRoundEffect.add(:BADDREAMS,
b.pbThis, battler.pbThis(true), battler.abilityName))
end
battle.pbHideAbilitySplash(battler)
}
end
end
}
)

View File

@@ -889,9 +889,7 @@ Battle::ItemEffects::DamageCalcFromUser.add(:LIFEORB,
Battle::ItemEffects::DamageCalcFromUser.add(:LIGHTBALL,
proc { |item, user, target, move, mults, baseDmg, type|
if user.isSpecies?(:PIKACHU)
mults[:attack_multiplier] *= 2
end
mults[:attack_multiplier] *= 2 if user.isSpecies?(:PIKACHU)
}
)
@@ -1844,9 +1842,9 @@ Battle::ItemEffects::EndOfRoundHealing.add(:BLACKSLUDGE,
battler.pbThis, battler.itemName))
elsif battler.takesIndirectDamage?
battle.pbCommonAnimation("UseItem", battler)
battler.pbTakeEffectDamage(battler.totalhp / 8) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 8) do |hp_lost|
battle.pbDisplay(_INTL("{1} is hurt by its {2}!", battler.pbThis, battler.itemName))
}
end
end
}
)
@@ -1876,9 +1874,9 @@ Battle::ItemEffects::EndOfRoundEffect.add(:STICKYBARB,
proc { |item, battler, battle|
next if !battler.takesIndirectDamage?
battle.scene.pbDamageAnimation(battler)
battler.pbTakeEffectDamage(battler.totalhp / 8, false) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 8, false) do |hp_lost|
battle.pbDisplay(_INTL("{1} is hurt by its {2}!", battler.pbThis, battler.itemName))
}
end
}
)

View File

@@ -271,10 +271,10 @@ class Battle::Scene
msgwindow = pbCreateMessageWindow
dimmingvp = Viewport.new(0, 0, Graphics.width, Graphics.height - msgwindow.height)
pbMessageDisplay(msgwindow,
_INTL("REFEREE: That's it! We will now go to judging to determine the winner!\\wtnp[20]")) {
_INTL("REFEREE: That's it! We will now go to judging to determine the winner!\\wtnp[20]")) do
pbBattleArenaUpdate
dimmingvp.update
}
end
dimmingvp.z = 99999
infowindow = SpriteWindow_Base.new(80, 0, 320, 224)
infowindow.contents = Bitmap.new(infowindow.width - infowindow.borderX,
@@ -299,25 +299,25 @@ class Battle::Scene
end
updateJudgment(infowindow, 1, battler1, battler2, ratings1, ratings2)
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) {
_INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) do
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
end
updateJudgment(infowindow, 2, battler1, battler2, ratings1, ratings2)
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judging category 2, Skill!\nThe Pokémon using moves the best!\\wtnp[40]")) {
_INTL("REFEREE: Judging category 2, Skill!\nThe Pokémon using moves the best!\\wtnp[40]")) do
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
end
updateJudgment(infowindow, 3, battler1, battler2, ratings1, ratings2)
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judging category 3, Body!\nThe Pokémon with the most vitality!\\wtnp[40]")) {
_INTL("REFEREE: Judging category 3, Body!\nThe Pokémon with the most vitality!\\wtnp[40]")) do
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
end
total1 = 0
total2 = 0
3.times do |i|
@@ -326,27 +326,27 @@ class Battle::Scene
end
if total1 == total2
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]", total1, total2)) {
_INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]", total1, total2)) do
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
end
elsif total1 > total2
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]",
total1, total2, @battle.pbGetOwnerName(battler1.index), battler1.name)) {
total1, total2, @battle.pbGetOwnerName(battler1.index), battler1.name)) do
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
end
else
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]",
total1, total2, battler2.name)) {
total1, total2, battler2.name)) do
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
end
end
infowindow.visible = false
msgwindow.visible = false