mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Resolved many Rubocop warnings
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
class PokeBattle_Trainer
|
||||
attr_accessor(:name)
|
||||
attr_accessor(:id)
|
||||
attr_accessor(:metaID)
|
||||
attr_accessor(:trainertype)
|
||||
attr_accessor(:outfit)
|
||||
attr_accessor(:badges)
|
||||
attr_accessor(:money)
|
||||
attr_accessor(:seen)
|
||||
attr_accessor(:owned)
|
||||
attr_accessor(:formseen)
|
||||
attr_accessor(:formlastseen)
|
||||
attr_accessor(:shadowcaught)
|
||||
attr_accessor(:party)
|
||||
attr_accessor(:pokedex) # Whether the Pokédex was obtained
|
||||
attr_accessor(:pokegear) # Whether the Pokégear was obtained
|
||||
attr_accessor(:language)
|
||||
attr_accessor :name
|
||||
attr_accessor :id
|
||||
attr_writer :metaID
|
||||
attr_accessor :trainertype
|
||||
attr_writer :outfit
|
||||
attr_accessor :badges
|
||||
attr_reader :money
|
||||
attr_accessor :seen
|
||||
attr_accessor :owned
|
||||
attr_accessor :formseen
|
||||
attr_accessor :formlastseen
|
||||
attr_accessor :shadowcaught
|
||||
attr_accessor :party
|
||||
attr_accessor :pokedex # Whether the Pokédex was obtained
|
||||
attr_accessor :pokegear # Whether the Pokégear was obtained
|
||||
attr_writer :language
|
||||
|
||||
def trainerTypeName # Name of this trainer type (localized)
|
||||
return PBTrainers.getName(@trainertype) rescue _INTL("PkMn Trainer")
|
||||
@@ -55,13 +55,11 @@ class PokeBattle_Trainer
|
||||
end
|
||||
|
||||
def outfit
|
||||
@outfit=0 if !@outfit
|
||||
return @outfit
|
||||
return @outfit || 0
|
||||
end
|
||||
|
||||
def language
|
||||
@language=pbGetLanguage() if !@language
|
||||
return @language
|
||||
return @language || pbGetLanguage
|
||||
end
|
||||
|
||||
def money=(value)
|
||||
|
||||
@@ -126,7 +126,6 @@ def pbNewTrainer(trainerid,trainername,trainerparty,savechanges=true)
|
||||
params.setDefaultValue(10)
|
||||
level = pbMessageChooseNumber(_INTL("Set the level for {1} (max. #{PBExperience.maxLevel}).",
|
||||
PBSpecies.getName(species)),params)
|
||||
tempPoke = pbNewPkmn(species,level)
|
||||
pokemon.push([species,level])
|
||||
break
|
||||
end
|
||||
@@ -136,7 +135,7 @@ def pbNewTrainer(trainerid,trainername,trainerparty,savechanges=true)
|
||||
if savechanges
|
||||
data = pbLoadTrainersData
|
||||
data.push(trainer)
|
||||
data = save_data(data,"Data/trainers.dat")
|
||||
save_data(data,"Data/trainers.dat")
|
||||
$PokemonTemp.trainersData = nil
|
||||
pbConvertTrainerData
|
||||
pbMessage(_INTL("The Trainer's data was added to the list of battles and in PBS/trainers.txt."))
|
||||
@@ -168,7 +167,6 @@ def pbGetFreeTrainerParty(trainerid,trainername)
|
||||
end
|
||||
trainerid = getID(PBTrainers,trainerid)
|
||||
end
|
||||
ret = -1
|
||||
trainers = pbLoadTrainersData
|
||||
usedparties = []
|
||||
for trainer in trainers
|
||||
@@ -213,8 +211,7 @@ def pbMissingTrainer(trainerid, trainername, trainerparty)
|
||||
end
|
||||
trainerid = getID(PBTrainers,trainerid)
|
||||
end
|
||||
traineridstring = "#{trainerid}"
|
||||
traineridstring = getConstantName(PBTrainers,trainerid) rescue "-"
|
||||
traineridstring = getConstantName(PBTrainers,trainerid) rescue "#{trainerid}"
|
||||
if !$DEBUG
|
||||
raise _INTL("Can't find trainer ({1}, {2}, ID {3})",traineridstring,trainername,trainerparty)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user