Many more Rubocop-inspired code improvements

This commit is contained in:
Maruno17
2021-12-18 19:06:22 +00:00
parent d17fc40a47
commit 13a238cc6a
107 changed files with 651 additions and 652 deletions

View File

@@ -11,8 +11,8 @@ class Battle
when 2
idxOther = (idxBattler + 2) % 4
when 3
return false if idxBattler == 2 || idxBattler == 3 # In middle spot already
idxOther = ((idxBattler % 2) == 0) ? 2 : 3
return false if [2, 3].include?(idxBattler) # In middle spot already
idxOther = (idxBattler.even?) ? 2 : 3
end
return false if pbGetOwnerIndexFromBattlerIndex(idxBattler) != pbGetOwnerIndexFromBattlerIndex(idxOther)
return true

View File

@@ -162,8 +162,10 @@ class Battle
allBattlers.each { |b| b.pbCheckFormOnWeatherChange }
pbEndPrimordialWeather
allBattlers.each { |b| b.pbAbilityOnTerrainChange }
allBattlers.each { |b| b.pbCheckFormOnMovesetChange }
allBattlers.each { |b| b.pbCheckFormOnStatusChange }
allBattlers.each do |b|
b.pbCheckFormOnMovesetChange
b.pbCheckFormOnStatusChange
end
end
#=============================================================================