More Rubocop changes

This commit is contained in:
Maruno17
2022-02-13 00:57:54 +00:00
parent cca5989746
commit f68e699cc9
108 changed files with 708 additions and 808 deletions

View File

@@ -40,21 +40,20 @@ def drawSpot(bitmap, spotpattern, x, y, red, green, blue)
height.times do |yy|
spot = spotpattern[yy]
width.times do |xx|
if spot[xx] == 1
xOrg = (x + xx) << 1
yOrg = (y + yy) << 1
color = bitmap.get_pixel(xOrg, yOrg)
r = color.red + red
g = color.green + green
b = color.blue + blue
color.red = [[r, 0].max, 255].min
color.green = [[g, 0].max, 255].min
color.blue = [[b, 0].max, 255].min
bitmap.set_pixel(xOrg, yOrg, color)
bitmap.set_pixel(xOrg + 1, yOrg, color)
bitmap.set_pixel(xOrg, yOrg + 1, color)
bitmap.set_pixel(xOrg + 1, yOrg + 1, color)
end
next if spot[xx] != 1
xOrg = (x + xx) << 1
yOrg = (y + yy) << 1
color = bitmap.get_pixel(xOrg, yOrg)
r = color.red + red
g = color.green + green
b = color.blue + blue
color.red = [[r, 0].max, 255].min
color.green = [[g, 0].max, 255].min
color.blue = [[b, 0].max, 255].min
bitmap.set_pixel(xOrg, yOrg, color)
bitmap.set_pixel(xOrg + 1, yOrg, color)
bitmap.set_pixel(xOrg, yOrg + 1, color)
bitmap.set_pixel(xOrg + 1, yOrg + 1, color)
end
end
end

View File

@@ -149,7 +149,7 @@ end
#
#===============================================================================
def pbRelicStone
if !$player.party.any? { |pkmn| pkmn.purifiable? }
if $player.party.none? { |pkmn| pkmn.purifiable? }
pbMessage(_INTL("You have no Pokémon that can be purified."))
return
end
@@ -421,17 +421,16 @@ EventHandlers.add(:on_player_step_taken, :lower_heart_gauges,
next if pkmn.heart_gauge == 0
pkmn.heart_gauge_step_counter = 0 if !pkmn.heart_gauge_step_counter
pkmn.heart_gauge_step_counter += 1
if pkmn.heart_gauge_step_counter >= 256
old_stage = pkmn.heartStage
pkmn.change_heart_gauge("walking")
new_stage = pkmn.heartStage
if new_stage == 0
pkmn.check_ready_to_purify
elsif new_stage != old_stage
pkmn.update_shadow_moves
end
pkmn.heart_gauge_step_counter = 0
next if pkmn.heart_gauge_step_counter < 256
old_stage = pkmn.heartStage
pkmn.change_heart_gauge("walking")
new_stage = pkmn.heartStage
if new_stage == 0
pkmn.check_ready_to_purify
elsif new_stage != old_stage
pkmn.update_shadow_moves
end
pkmn.heart_gauge_step_counter = 0
end
$PokemonGlobal.purifyChamber&.update
}

View File

@@ -212,15 +212,14 @@ class PokemonStorage
def pbMoveCaughtToBox(pkmn, box)
maxPokemon(box).times do |i|
if self[box, i].nil?
if Settings::HEAL_STORED_POKEMON && box >= 0
old_ready_evo = pkmn.ready_to_evolve
pkmn.heal
pkmn.ready_to_evolve = old_ready_evo
end
self[box, i] = pkmn
return true
next unless self[box, i].nil?
if Settings::HEAL_STORED_POKEMON && box >= 0
old_ready_evo = pkmn.ready_to_evolve
pkmn.heal
pkmn.ready_to_evolve = old_ready_evo
end
self[box, i] = pkmn
return true
end
return false
end
@@ -239,11 +238,10 @@ class PokemonStorage
end
self.maxBoxes.times do |j|
maxPokemon(j).times do |i|
if self[j, i].nil?
self[j, i] = pkmn
@currentBox = j
return @currentBox
end
next unless self[j, i].nil?
self[j, i] = pkmn
@currentBox = j
return @currentBox
end
end
return -1