mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Many more Rubocop-inspired code improvements
This commit is contained in:
@@ -573,7 +573,7 @@ def pbAfterBattle(decision, canLose)
|
||||
pkmn.makeUnprimal
|
||||
end
|
||||
end
|
||||
if decision == 2 || decision == 5 # if loss or draw
|
||||
if [2, 5].include?(decision) # if loss or draw
|
||||
if canLose
|
||||
$player.party.each { |pkmn| pkmn.heal }
|
||||
(Graphics.frame_rate / 4).times { Graphics.update }
|
||||
|
||||
@@ -180,7 +180,7 @@ end
|
||||
##### VS. animation, by Luka S.J. #####
|
||||
##### Tweaked by Maruno #####
|
||||
SpecialBattleIntroAnimations.register("vs_animation", 50, # Priority 50
|
||||
Proc.new { |battle_type, foe| # Condition
|
||||
proc { |battle_type, foe| # Condition
|
||||
next false unless [1, 3].include?(battle_type) && foe.length == 1 # Only if a single trainer
|
||||
tr_type = foe[0].trainer_type
|
||||
next false if !tr_type
|
||||
@@ -189,7 +189,7 @@ SpecialBattleIntroAnimations.register("vs_animation", 50, # Priority 50
|
||||
next pbResolveBitmap("Graphics/Transitions/" + trainer_bar_graphic) &&
|
||||
pbResolveBitmap("Graphics/Transitions/" + trainer_graphic)
|
||||
},
|
||||
Proc.new { |viewport, battle_type, foe| # Animation
|
||||
proc { |viewport, battle_type, foe| # Animation
|
||||
# Determine filenames of graphics to be used
|
||||
tr_type = foe[0].trainer_type
|
||||
trainer_bar_graphic = sprintf("vsBar_%s", tr_type.to_s) rescue nil
|
||||
|
||||
@@ -208,7 +208,7 @@ def pbRoamingPokemonBattle(species, level)
|
||||
# Perform the battle
|
||||
decision = pbWildBattleCore($PokemonGlobal.roamPokemon[idxRoamer])
|
||||
# Update Roaming Pokémon data based on result of battle
|
||||
if decision == 1 || decision == 4 # Defeated or caught
|
||||
if [1, 4].include?(decision) # Defeated or caught
|
||||
$PokemonGlobal.roamPokemon[idxRoamer] = true
|
||||
$PokemonGlobal.roamPokemonCaught[idxRoamer] = (decision == 4)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user