mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 22:54:59 +00:00
Lots of rubocop
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user