mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
More tweaks from the Rubocop overlord
This commit is contained in:
@@ -34,7 +34,7 @@ class Trainer
|
||||
# Random ID other than this Trainer's ID
|
||||
def make_foreign_ID
|
||||
loop do
|
||||
ret = rand(2**16) | rand(2**16) << 16
|
||||
ret = rand(2**16) | (rand(2**16) << 16)
|
||||
return ret if ret != @id
|
||||
end
|
||||
return 0
|
||||
@@ -168,7 +168,7 @@ class Trainer
|
||||
def initialize(name, trainer_type)
|
||||
@trainer_type = GameData::TrainerType.get(trainer_type).id
|
||||
@name = name
|
||||
@id = rand(2**16) | rand(2**16) << 16
|
||||
@id = rand(2**16) | (rand(2**16) << 16)
|
||||
@language = pbGetLanguage
|
||||
@party = []
|
||||
end
|
||||
|
||||
@@ -14,8 +14,8 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
|
||||
for i in 0...Settings::MAX_PARTY_SIZE
|
||||
if i == 0
|
||||
pbMessage(_INTL("Please enter the first Pokémon.", i))
|
||||
else
|
||||
break if !pbConfirmMessage(_INTL("Add another Pokémon?"))
|
||||
elsif !pbConfirmMessage(_INTL("Add another Pokémon?"))
|
||||
break
|
||||
end
|
||||
loop do
|
||||
species = pbChooseSpeciesList
|
||||
@@ -42,10 +42,12 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
|
||||
:pokemon => []
|
||||
}
|
||||
party.each do |pkmn|
|
||||
trainer_hash[:pokemon].push({
|
||||
:species => pkmn[0],
|
||||
:level => pkmn[1]
|
||||
})
|
||||
trainer_hash[:pokemon].push(
|
||||
{
|
||||
:species => pkmn[0],
|
||||
:level => pkmn[1]
|
||||
}
|
||||
)
|
||||
end
|
||||
# Add trainer's data to records
|
||||
trainer_hash[:id] = [trainer_hash[:trainer_type], trainer_hash[:name], trainer_hash[:version]]
|
||||
|
||||
Reference in New Issue
Block a user