Created and implemented GameData::TrainerType, fixed free text entry text mispositioning

This commit is contained in:
Maruno17
2020-12-06 19:21:18 +00:00
parent c9c6c2bb96
commit c8790bafc9
27 changed files with 582 additions and 683 deletions

View File

@@ -120,9 +120,10 @@ module GameData
def self.load_all
Ability.load
Item.load
Move.load
BerryPlant.load
Metadata.load
MapMetadata.load
Move.load
TrainerType.load
end
end

View File

@@ -30,14 +30,14 @@ module GameData
"WildCaptureME" => [6, "s"],
"SurfBGM" => [7, "s"],
"BicycleBGM" => [8, "s"],
"PlayerA" => [9, "esssssss", :PBTrainers],
"PlayerB" => [10, "esssssss", :PBTrainers],
"PlayerC" => [11, "esssssss", :PBTrainers],
"PlayerD" => [12, "esssssss", :PBTrainers],
"PlayerE" => [13, "esssssss", :PBTrainers],
"PlayerF" => [14, "esssssss", :PBTrainers],
"PlayerG" => [15, "esssssss", :PBTrainers],
"PlayerH" => [16, "esssssss", :PBTrainers]
"PlayerA" => [9, "esssssss", :TrainerType],
"PlayerB" => [10, "esssssss", :TrainerType],
"PlayerC" => [11, "esssssss", :TrainerType],
"PlayerD" => [12, "esssssss", :TrainerType],
"PlayerE" => [13, "esssssss", :TrainerType],
"PlayerF" => [14, "esssssss", :TrainerType],
"PlayerG" => [15, "esssssss", :TrainerType],
"PlayerH" => [16, "esssssss", :TrainerType]
}
extend ClassMethodsIDNumbers

View File

@@ -0,0 +1,49 @@
module GameData
class TrainerType
attr_reader :id
attr_reader :id_number
attr_reader :real_name
attr_reader :base_money
attr_reader :battle_BGM
attr_reader :victory_ME
attr_reader :intro_ME
attr_reader :gender
attr_reader :skill_level
attr_reader :skill_code
DATA = {}
DATA_FILENAME = "trainer_types.dat"
extend ClassMethods
include InstanceMethods
def initialize(hash)
@id = hash[:id]
@id_number = hash[:id_number] || -1
@real_name = hash[:name] || "Unnamed"
@base_money = hash[:base_money] || 30
@battle_BGM = hash[:battle_BGM]
@victory_ME = hash[:victory_ME]
@intro_ME = hash[:intro_ME]
@gender = hash[:gender] || 2
@skill_level = hash[:skill_level] || @base_money
@skill_code = hash[:skill_code]
end
# @return [String] the translated name of this trainer type
def name
return pbGetMessage(MessageTypes::TrainerTypes, @id_number)
end
def male?; return @gender == 0; end
def female?; return @gender == 1; end
end
end
#===============================================================================
# Deprecated methods
#===============================================================================
def pbGetTrainerTypeData(trainer_type)
Deprecation.warn_method('pbGetTrainerTypeData', 'v20', 'GameData::TrainerType.get(trainer_type)')
return GameData::TrainerType.get(trainer_type)
end