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

@@ -53,7 +53,7 @@ module GameData
end
def call_after_evolution(*args)
@after_evolution_proc.call(*args) if @after_evolution_proc
@after_evolution_proc&.call(*args)
end
end
end
@@ -500,8 +500,7 @@ GameData::Evolution.register({
:minimum_level => 1, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
map_metadata = $game_map.metadata
next map_metadata && map_metadata.town_map_position &&
map_metadata.town_map_position[0] == parameter
next map_metadata&.town_map_position && map_metadata.town_map_position[0] == parameter
}
})

View File

@@ -42,10 +42,8 @@ end
#===============================================================================
def pbLoadPhoneData
$game_temp = Game_Temp.new if !$game_temp
if !$game_temp.phone_messages_data
if pbRgssExists?("Data/phone.dat")
$game_temp.phone_messages_data = load_data("Data/phone.dat")
end
if !$game_temp.phone_messages_data && pbRgssExists?("Data/phone.dat")
$game_temp.phone_messages_data = load_data("Data/phone.dat")
end
return $game_temp.phone_messages_data
end
@@ -66,10 +64,8 @@ end
#===============================================================================
def pbLoadBattleAnimations
$game_temp = Game_Temp.new if !$game_temp
if !$game_temp.battle_animations_data
if pbRgssExists?("Data/PkmnAnimations.rxdata")
$game_temp.battle_animations_data = load_data("Data/PkmnAnimations.rxdata")
end
if !$game_temp.battle_animations_data && pbRgssExists?("Data/PkmnAnimations.rxdata")
$game_temp.battle_animations_data = load_data("Data/PkmnAnimations.rxdata")
end
return $game_temp.battle_animations_data
end

View File

@@ -188,7 +188,7 @@ module GameData
:KYOGRE => [:BLUEORB],
:GROUDON => [:REDORB]
}
return combos[species] && combos[species].include?(@id)
return combos[species]&.include?(@id)
end
end
end

View File

@@ -51,8 +51,8 @@ module GameData
def self.each_of_version(version = 0)
self.each do |data|
yield data if data.version == version
if version > 0
yield data if data.version == 0 && !self::DATA.has_key?([data.map, version])
if version > 0 && data.version == 0 && !self::DATA.has_key?([data.map, version])
yield data
end
end
end

View File

@@ -48,7 +48,7 @@ module GameData
def self.charset_filename_brief(tr_type)
ret = self.charset_filename(tr_type)
ret.slice!("Graphics/Characters/") if ret
ret&.slice!("Graphics/Characters/")
return ret
end