Lots of rubocop

This commit is contained in:
Maruno17
2023-01-28 15:21:12 +00:00
parent 2d056052ce
commit 13aab8d911
159 changed files with 1679 additions and 1931 deletions

View File

@@ -264,9 +264,7 @@ MultipleForms.register(:ROTOM, {
MultipleForms.register(:GIRATINA, {
"getForm" => proc { |pkmn|
next 1 if pkmn.hasItem?(:GRISEOUSORB)
if $game_map && $game_map.metadata&.has_flag?("DistortionWorld")
next 1
end
next 1 if $game_map&.metadata&.has_flag?("DistortionWorld")
next 0
}
})

View File

@@ -1,17 +1,15 @@
=begin
All types except Shadow have Shadow as a weakness.
Shadow has Shadow as a resistance.
On a side note, the Shadow moves in Colosseum will not be affected by Weaknesses
or Resistances, while in XD the Shadow-type is Super-Effective against all other
types.
2/5 - display nature
XD - Shadow Rush -- 55, 100 - Deals damage.
Colosseum - Shadow Rush -- 90, 100
If this attack is successful, user loses half of HP lost by opponent due to this
attack (recoil). If user is in Hyper Mode, this attack has a good chance for a
critical hit.
=end
# All types except Shadow have Shadow as a weakness.
# Shadow has Shadow as a resistance.
# On a side note, the Shadow moves in Colosseum will not be affected by
# Weaknesses or Resistances, while in XD the Shadow-type is Super-Effective
# against all other types.
# 2/5 - display nature
#
# XD - Shadow Rush -- 55, 100 - Deals damage.
# Colosseum - Shadow Rush -- 90, 100
# If this attack is successful, user loses half of HP lost by opponent due to
# this attack (recoil). If user is in Hyper Mode, this attack has a good chance
# for a critical hit.
#===============================================================================
# Purify a Shadow Pokémon.
@@ -63,8 +61,7 @@ end
# Relic Stone scene.
#===============================================================================
class RelicStoneScene
def pbPurify
end
def pbPurify; end
def pbUpdate
pbUpdateSpriteHash(@sprites)
@@ -136,11 +133,11 @@ end
#===============================================================================
def pbRelicStoneScreen(pkmn)
retval = true
pbFadeOutIn {
pbFadeOutIn do
scene = RelicStoneScene.new
screen = RelicStoneScreen.new(scene)
retval = screen.pbStartScreen(pkmn)
}
end
return retval
end
@@ -187,9 +184,7 @@ class Battle::Battler
alias __shadow__pbInitPokemon pbInitPokemon unless method_defined?(:__shadow__pbInitPokemon)
def pbInitPokemon(*arg)
if self.pokemonIndex > 0 && inHyperMode?
self.pokemon.hyper_mode = false
end
self.pokemon.hyper_mode = false if self.pokemonIndex > 0 && inHyperMode?
__shadow__pbInitPokemon(*arg)
# Called into battle
if shadowPokemon?

View File

@@ -284,9 +284,7 @@ class RegionalStorage
if @rgnmap < 0
raise _INTL("The current map has no region set. Please set the MapPosition metadata setting for this map.")
end
if !@storages[@rgnmap]
@storages[@rgnmap] = PokemonStorage.new
end
@storages[@rgnmap] = PokemonStorage.new if !@storages[@rgnmap]
return @storages[@rgnmap]
end

View File

@@ -974,49 +974,49 @@ class Pokemon
# Checks whether this Pokemon can evolve because of levelling up.
# @return [Symbol, nil] the ID of the species to evolve into
def check_evolution_on_level_up
return check_evolution_internal { |pkmn, new_species, method, parameter|
return check_evolution_internal do |pkmn, new_species, method, parameter|
success = GameData::Evolution.get(method).call_level_up(pkmn, parameter)
next (success) ? new_species : nil
}
end
end
# Checks whether this Pokemon can evolve because of using an item on it.
# @param item_used [Symbol, GameData::Item, nil] the item being used
# @return [Symbol, nil] the ID of the species to evolve into
def check_evolution_on_use_item(item_used)
return check_evolution_internal { |pkmn, new_species, method, parameter|
return check_evolution_internal do |pkmn, new_species, method, parameter|
success = GameData::Evolution.get(method).call_use_item(pkmn, parameter, item_used)
next (success) ? new_species : nil
}
end
end
# Checks whether this Pokemon can evolve because of being traded.
# @param other_pkmn [Pokemon] the other Pokémon involved in the trade
# @return [Symbol, nil] the ID of the species to evolve into
def check_evolution_on_trade(other_pkmn)
return check_evolution_internal { |pkmn, new_species, method, parameter|
return check_evolution_internal do |pkmn, new_species, method, parameter|
success = GameData::Evolution.get(method).call_on_trade(pkmn, parameter, other_pkmn)
next (success) ? new_species : nil
}
end
end
# Checks whether this Pokemon can evolve after a battle.
# @return [Symbol, nil] the ID of the species to evolve into
def check_evolution_after_battle(party_index)
return check_evolution_internal { |pkmn, new_species, method, parameter|
return check_evolution_internal do |pkmn, new_species, method, parameter|
success = GameData::Evolution.get(method).call_after_battle(pkmn, party_index, parameter)
next (success) ? new_species : nil
}
end
end
# Checks whether this Pokemon can evolve by a triggered event.
# @param value [Integer] a value that may be used by the evolution method
# @return [Symbol, nil] the ID of the species to evolve into
def check_evolution_by_event(value = 0)
return check_evolution_internal { |pkmn, new_species, method, parameter|
return check_evolution_internal do |pkmn, new_species, method, parameter|
success = GameData::Evolution.get(method).call_event(pkmn, parameter, value)
next (success) ? new_species : nil
}
end
end
# Called after this Pokémon evolves, to remove its held item (if the evolution
@@ -1047,12 +1047,12 @@ class Pokemon
def trigger_event_evolution(number)
new_species = check_evolution_by_event(number)
if new_species
pbFadeOutInWithMusic {
pbFadeOutInWithMusic do
evo = PokemonEvolutionScene.new
evo.pbStartScreen(self, new_species)
evo.pbEvolution
evo.pbEndScreen
}
end
return true
end
return false