Yet more Rubocopping

This commit is contained in:
Maruno17
2021-12-23 00:27:17 +00:00
parent 514fe13ca2
commit 132a16950d
171 changed files with 1455 additions and 1647 deletions

View File

@@ -573,11 +573,9 @@ def pbAfterBattle(decision, canLose)
pkmn.makeUnprimal
end
end
if [2, 5].include?(decision) # if loss or draw
if canLose
$player.party.each { |pkmn| pkmn.heal }
(Graphics.frame_rate / 4).times { Graphics.update }
end
if [2, 5].include?(decision) && canLose # if loss or draw
$player.party.each { |pkmn| pkmn.heal }
(Graphics.frame_rate / 4).times { Graphics.update }
end
Events.onEndBattle.trigger(nil, decision, canLose)
$game_player.straighten

View File

@@ -32,11 +32,11 @@ end
# Battle intro animation
#===============================================================================
def pbSceneStandby
$scene.disposeSpritesets if $scene && $scene.is_a?(Scene_Map)
$scene.disposeSpritesets if $scene.is_a?(Scene_Map)
RPG::Cache.clear
Graphics.frame_reset
yield
$scene.createSpritesets if $scene && $scene.is_a?(Scene_Map)
$scene.createSpritesets if $scene.is_a?(Scene_Map)
end
def pbBattleAnimation(bgm = nil, battletype = 0, foe = nil)
@@ -46,7 +46,7 @@ def pbBattleAnimation(bgm = nil, battletype = 0, foe = nil)
# Set up audio
playingBGS = nil
playingBGM = nil
if $game_system && $game_system.is_a?(Game_System)
if $game_system.is_a?(Game_System)
playingBGS = $game_system.getPlayingBGS
playingBGM = $game_system.getPlayingBGM
$game_system.bgm_pause
@@ -120,7 +120,7 @@ def pbBattleAnimation(bgm = nil, battletype = 0, foe = nil)
end
end
# Take screenshot of game, for use in some animations
$game_temp.background_bitmap.dispose if $game_temp.background_bitmap
$game_temp.background_bitmap&.dispose
$game_temp.background_bitmap = Graphics.snap_to_bitmap
# Play main animation
Graphics.freeze
@@ -138,7 +138,7 @@ def pbBattleAnimation(bgm = nil, battletype = 0, foe = nil)
yield if block_given?
# After the battle
pbPopFade
if $game_system && $game_system.is_a?(Game_System)
if $game_system.is_a?(Game_System)
$game_system.bgm_resume(playingBGM)
$game_system.bgs_resume(playingBGS)
end

View File

@@ -281,25 +281,21 @@ class PokemonEncounters
favored_type = nil
case first_pkmn.ability_id
when :FLASHFIRE
if Settings::MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS
favored_type = :FIRE if GameData::Type.exists?(:FIRE) && rand(100) < 50
end
favored_type = :FIRE if Settings::MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS &&
GameData::Type.exists?(:FIRE) && rand(100) < 50
when :HARVEST
if Settings::MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS
favored_type = :GRASS if GameData::Type.exists?(:GRASS) && rand(100) < 50
end
favored_type = :GRASS if Settings::MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS &&
GameData::Type.exists?(:GRASS) && rand(100) < 50
when :LIGHTNINGROD
if Settings::MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS
favored_type = :ELECTRIC if GameData::Type.exists?(:ELECTRIC) && rand(100) < 50
end
favored_type = :ELECTRIC if Settings::MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS &&
GameData::Type.exists?(:ELECTRIC) && rand(100) < 50
when :MAGNETPULL
favored_type = :STEEL if GameData::Type.exists?(:STEEL) && rand(100) < 50
when :STATIC
favored_type = :ELECTRIC if GameData::Type.exists?(:ELECTRIC) && rand(100) < 50
when :STORMDRAIN
if Settings::MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS
favored_type = :WATER if GameData::Type.exists?(:WATER) && rand(100) < 50
end
favored_type = :WATER if Settings::MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS &&
GameData::Type.exists?(:WATER) && rand(100) < 50
end
if favored_type
new_enc_list = []
@@ -433,7 +429,7 @@ def pbGenerateWildPokemon(species, level, isRoamer = false)
end
end
# Give Pokérus
genwildpoke.givePokerus if rand(65536) < Settings::POKERUS_CHANCE
genwildpoke.givePokerus if rand(65_536) < Settings::POKERUS_CHANCE
# Change wild Pokémon's gender/nature depending on the lead party Pokémon's
# ability
if first_pkmn