mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
More Rubocopping
This commit is contained in:
@@ -241,7 +241,7 @@ class Battle::Move
|
||||
def pbAnimateHitAndHPLost(user, targets)
|
||||
# Animate allies first, then foes
|
||||
animArray = []
|
||||
for side in 0...2 # side here means "allies first, then foes"
|
||||
2.times do |side| # side here means "allies first, then foes"
|
||||
targets.each do |b|
|
||||
next if b.damageState.unaffected || b.damageState.hpLost == 0
|
||||
next if (side == 0 && b.opposes?(user)) || (side == 1 && !b.opposes?(user))
|
||||
|
||||
@@ -113,7 +113,7 @@ class Battle::Move::MultiStatUpMove < Battle::Move
|
||||
def pbMoveFailed?(user, targets)
|
||||
return false if damagingMove?
|
||||
failed = true
|
||||
for i in 0...@statUp.length / 2
|
||||
(@statUp.length / 2).times do |i|
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
@@ -128,7 +128,7 @@ class Battle::Move::MultiStatUpMove < Battle::Move
|
||||
def pbEffectGeneral(user)
|
||||
return if damagingMove?
|
||||
showAnim = true
|
||||
for i in 0...@statUp.length / 2
|
||||
(@statUp.length / 2).times do |i|
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
@@ -138,7 +138,7 @@ class Battle::Move::MultiStatUpMove < Battle::Move
|
||||
|
||||
def pbAdditionalEffect(user, target)
|
||||
showAnim = true
|
||||
for i in 0...@statUp.length / 2
|
||||
(@statUp.length / 2).times do |i|
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
@@ -154,7 +154,7 @@ class Battle::Move::StatDownMove < Battle::Move
|
||||
def pbEffectWhenDealingDamage(user, target)
|
||||
return if @battle.pbAllFainted?(target.idxOwnSide)
|
||||
showAnim = true
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
@@ -195,7 +195,7 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move
|
||||
def pbFailsAgainstTarget?(user, target, show_message)
|
||||
return false if damagingMove?
|
||||
failed = true
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
@@ -205,14 +205,14 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move
|
||||
# is shown here, I know.
|
||||
canLower = false
|
||||
if target.hasActiveAbility?(:CONTRARY) && !@battle.moldBreaker
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if target.statStageAtMax?(@statDown[i * 2])
|
||||
canLower = true
|
||||
break
|
||||
end
|
||||
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!", user.pbThis)) if !canLower && show_message
|
||||
else
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if target.statStageAtMin?(@statDown[i * 2])
|
||||
canLower = true
|
||||
break
|
||||
@@ -230,7 +230,7 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move
|
||||
def pbCheckForMirrorArmor(user, target)
|
||||
if target.hasActiveAbility?(:MIRRORARMOR) && user.index != target.index
|
||||
failed = true
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if target.statStageAtMin?(@statDown[i * 2])
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], target, self, false, false, true)
|
||||
failed = false
|
||||
@@ -253,7 +253,7 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move
|
||||
return if !pbCheckForMirrorArmor(user, target)
|
||||
showAnim = true
|
||||
showMirrorArmorSplash = true
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user,
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
|
||||
@@ -482,7 +482,7 @@ class Battle::Move::SwapSideEffects < Battle::Move
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
has_effect = false
|
||||
for side in 0...2
|
||||
2.times do |side|
|
||||
effects = @battle.sides[side].effects
|
||||
@number_effects.each do |e|
|
||||
next if effects[e] == 0
|
||||
|
||||
@@ -417,13 +417,13 @@ class Battle::Move::LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2 < Battle::Move
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
failed = true
|
||||
for i in 0...@statUp.length / 2
|
||||
(@statUp.length / 2).times do |i|
|
||||
if user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
end
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
if user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
@@ -438,14 +438,14 @@ class Battle::Move::LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2 < Battle::Move
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
showAnim = true
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
showAnim = true
|
||||
for i in 0...@statUp.length / 2
|
||||
(@statUp.length / 2).times do |i|
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
@@ -1359,7 +1359,7 @@ class Battle::Move::LowerPoisonedTargetAtkSpAtkSpd1 < Battle::Move
|
||||
def pbCheckForMirrorArmor(user, target)
|
||||
if target.hasActiveAbility?(:MIRRORARMOR) && user.index != target.index
|
||||
failed = true
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if target.statStageAtMin?(@statDown[i * 2])
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], target, self, false, false, true)
|
||||
failed = false
|
||||
@@ -1383,7 +1383,7 @@ class Battle::Move::LowerPoisonedTargetAtkSpAtkSpd1 < Battle::Move
|
||||
return if !pbCheckForMirrorArmor(user, target)
|
||||
showAnim = true
|
||||
showMirrorArmorSplash = true
|
||||
for i in 0...@statDown.length / 2
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user,
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
|
||||
Reference in New Issue
Block a user