More or less standardised separator comments in the code

This commit is contained in:
Maruno17
2024-06-27 21:21:26 +01:00
parent 225549bfce
commit 509a414f37
198 changed files with 1907 additions and 1263 deletions

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
#=============================================================================
# A mixin module for data classes which provides common class methods (called

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class GrowthRate
attr_reader :id
@@ -24,6 +27,8 @@ module GameData
return Settings::MAXIMUM_LEVEL
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -72,6 +77,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::GrowthRate.register({

View File

@@ -1,7 +1,9 @@
#===============================================================================
# If a Pokémon's gender ratio is none of :AlwaysMale, :AlwaysFemale or
# :Genderless, then it will choose a random number between 0 and 255 inclusive,
# and compare it to the @female_chance. If the random number is lower than this
# chance, it will be female; otherwise, it will be male.
#===============================================================================
module GameData
class GenderRatio
attr_reader :id
@@ -16,6 +18,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -35,6 +39,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::GenderRatio.register({

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class EggGroup
attr_reader :id
@@ -11,6 +14,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -23,6 +28,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::EggGroup.register({

View File

@@ -1,7 +1,9 @@
#===============================================================================
# NOTE: The order these shapes are registered are the order they are listed in
# the Pokédex search screen.
# "Graphics/UI/Pokedex/icon_shapes.png" contains icons for these
# shapes.
#===============================================================================
module GameData
class BodyShape
attr_reader :id
@@ -16,6 +18,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -29,6 +33,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::BodyShape.register({

View File

@@ -1,5 +1,7 @@
#===============================================================================
# NOTE: The order these colors are registered are the order they are listed in
# the Pokédex search screen.
#===============================================================================
module GameData
class BodyColor
attr_reader :id
@@ -13,6 +15,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -25,6 +29,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::BodyColor.register({

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Habitat
attr_reader :id
@@ -11,6 +14,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -23,6 +28,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::Habitat.register({

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Evolution
attr_reader :id
@@ -20,6 +23,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:id].to_s || "Unnamed"
@@ -71,12 +76,18 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::Evolution.register({
:id => :None
})
#===============================================================================
#
#===============================================================================
GameData::Evolution.register({
:id => :Level,
:parameter => Integer,
@@ -545,6 +556,7 @@ GameData::Evolution.register({
#===============================================================================
# Evolution methods that trigger when levelling up in battle.
#===============================================================================
GameData::Evolution.register({
:id => :LevelBattle,
:parameter => Integer,
@@ -556,6 +568,7 @@ GameData::Evolution.register({
#===============================================================================
# Evolution methods that trigger when using an item on the Pokémon.
#===============================================================================
GameData::Evolution.register({
:id => :Item,
:parameter => :Item,
@@ -607,6 +620,7 @@ GameData::Evolution.register({
#===============================================================================
# Evolution methods that trigger when the Pokémon is obtained in a trade.
#===============================================================================
GameData::Evolution.register({
:id => :Trade,
:on_trade_proc => proc { |pkmn, parameter, other_pkmn|
@@ -666,6 +680,7 @@ GameData::Evolution.register({
#===============================================================================
# Evolution methods that are triggered after any battle.
#===============================================================================
GameData::Evolution.register({
:id => :AfterBattleCounter,
:parameter => Integer,

View File

@@ -1,8 +1,10 @@
#===============================================================================
# The pbs_order value determines the order in which the stats are written in
# several PBS files, where base stats/IVs/EVs/EV yields are defined. Only stats
# which are yielded by the "each_main" method can have stat numbers defined in
# those places. The values of pbs_order defined below should start with 0 and
# increase without skipping any numbers.
#===============================================================================
module GameData
class Stat
attr_reader :id
@@ -34,6 +36,8 @@ module GameData
self.each { |s| yield s if [:main_battle, :battle].include?(s.type) }
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -54,6 +58,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::Stat.register({

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Nature
attr_reader :id
@@ -12,6 +15,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -25,6 +30,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::Nature.register({

View File

@@ -1,9 +1,11 @@
#===============================================================================
# NOTE: "Graphics/UI/statuses.png" also contains icons for being fainted and for
# having Pokérus, in that order, at the bottom of the graphic.
# "Graphics/UI/Battle/icon_statuses.png" also contains an icon for bad
# poisoning (toxic), at the bottom of the graphic.
# Both graphics automatically handle varying numbers of defined statuses,
# as long as their extra icons remain at the bottom of them.
#===============================================================================
module GameData
class Status
attr_reader :id
@@ -21,6 +23,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -35,6 +39,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::Status.register({

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class TerrainTag
attr_reader :id
@@ -40,6 +43,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@id_number = hash[:id_number]
@@ -72,6 +77,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::TerrainTag.register({

View File

@@ -1,3 +1,4 @@
#===============================================================================
# Category has the following effects:
# - Determines the in-battle weather.
# - Some abilities reduce the encounter rate in certain categories of weather.
@@ -8,6 +9,7 @@
# Delta values are per second.
# For the tone_proc, strength goes from 0 to RPG::Weather::MAX_SPRITES (60) and
# will typically be the maximum.
#===============================================================================
module GameData
class Weather
attr_reader :id
@@ -30,6 +32,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@id_number = hash[:id_number]
@@ -60,6 +64,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::Weather.register({

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class EncounterType
attr_reader :id
@@ -13,6 +16,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:id].to_s || "Unnamed"
@@ -24,6 +29,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::EncounterType.register({

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Environment
attr_reader :id
@@ -12,6 +15,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -25,6 +30,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::Environment.register({

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class BattleWeather
attr_reader :id
@@ -12,6 +15,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -25,6 +30,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::BattleWeather.register({

View File

@@ -1,4 +1,6 @@
#===============================================================================
# These are in-battle terrain effects caused by moves like Electric Terrain.
#===============================================================================
module GameData
class BattleTerrain
attr_reader :id
@@ -13,6 +15,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -26,6 +30,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
GameData::BattleTerrain.register({

View File

@@ -1,3 +1,4 @@
#===============================================================================
# NOTE: If adding a new target, you will need to add code in several places to
# make them work properly:
# - def pbFindTargets
@@ -5,6 +6,7 @@
# - def pbCreateTargetTexts
# - def pbFirstTarget
# - def pbTargetsMultiple?
#===============================================================================
module GameData
class Target
attr_reader :id
@@ -23,6 +25,8 @@ module GameData
def self.load; end
def self.save; end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@@ -48,6 +52,8 @@ module GameData
end
end
#===============================================================================
#
#===============================================================================
# Bide, Counter, Metal Burst, Mirror Coat (calculate a target)

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class TownMap
attr_reader :id
@@ -10,7 +13,6 @@ module GameData
DATA = {}
DATA_FILENAME = "town_map.dat"
PBS_BASE_FILENAME = "town_map"
SCHEMA = {
"SectionName" => [:id, "u"],
"Name" => [:real_name, "s"],
@@ -22,6 +24,8 @@ module GameData
extend ClassMethodsIDNumbers
include InstanceMethods
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:real_name] || "???"

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Type
attr_reader :id
@@ -14,7 +17,6 @@ module GameData
DATA = {}
DATA_FILENAME = "types.dat"
PBS_BASE_FILENAME = "types"
SCHEMA = {
"SectionName" => [:id, "m"],
"Name" => [:real_name, "s"],
@@ -26,12 +28,13 @@ module GameData
"Immunities" => [:immunities, "*m"],
"Flags" => [:flags, "*s"]
}
ICON_SIZE = [64, 28]
extend ClassMethodsSymbols
include InstanceMethods
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:real_name] || "Unnamed"
@@ -71,7 +74,8 @@ module GameData
end
#===============================================================================
#
#===============================================================================
module Effectiveness
INEFFECTIVE = 0
NOT_VERY_EFFECTIVE = 1

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Ability
attr_reader :id
@@ -9,10 +12,6 @@ module GameData
DATA = {}
DATA_FILENAME = "abilities.dat"
PBS_BASE_FILENAME = "abilities"
extend ClassMethodsSymbols
include InstanceMethods
SCHEMA = {
"SectionName" => [:id, "m"],
"Name" => [:real_name, "s"],
@@ -20,6 +19,11 @@ module GameData
"Flags" => [:flags, "*s"]
}
extend ClassMethodsSymbols
include InstanceMethods
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:real_name] || "Unnamed"

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Move
attr_reader :id
@@ -18,7 +21,6 @@ module GameData
DATA = {}
DATA_FILENAME = "moves.dat"
PBS_BASE_FILENAME = "moves"
SCHEMA = {
"SectionName" => [:id, "m"],
"Name" => [:real_name, "s"],
@@ -34,12 +36,13 @@ module GameData
"EffectChance" => [:effect_chance, "u"],
"Description" => [:real_description, "q"]
}
CATEGORY_ICON_SIZE = [64, 28]
extend ClassMethodsSymbols
include InstanceMethods
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:real_name] || "Unnamed"

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Item
attr_reader :id
@@ -21,7 +24,6 @@ module GameData
DATA = {}
DATA_FILENAME = "items.dat"
PBS_BASE_FILENAME = "items"
SCHEMA = {
"SectionName" => [:id, "m"],
"Name" => [:real_name, "s"],
@@ -116,6 +118,8 @@ module GameData
return pbResolveBitmap(ret) ? ret : nil
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:real_name] || "Unnamed"

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class BerryPlant
attr_reader :id
@@ -9,14 +12,12 @@ module GameData
DATA = {}
DATA_FILENAME = "berry_plants.dat"
PBS_BASE_FILENAME = "berry_plants"
SCHEMA = {
"SectionName" => [:id, "m"],
"HoursPerStage" => [:hours_per_stage, "v"],
"DryingPerHour" => [:drying_per_hour, "u"],
"Yield" => [:yield, "uv"]
}
NUMBER_OF_REPLANTS = 9
NUMBER_OF_GROWTH_STAGES = 4
NUMBER_OF_FULLY_GROWN_STAGES = 4
@@ -25,6 +26,8 @@ module GameData
extend ClassMethodsSymbols
include InstanceMethods
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@hours_per_stage = hash[:hours_per_stage] || 3

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Species
attr_reader :id
@@ -176,6 +179,8 @@ module GameData
return ret
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@species = hash[:species] || @id

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Species
def self.check_graphic_file(path, species, form = 0, gender = 0, shiny = false, shadow = false, subfolder = "")
@@ -108,7 +111,7 @@ module GameData
return ret
end
#===========================================================================
#---------------------------------------------------------------------------
def self.egg_icon_filename(species, form)
ret = self.check_egg_graphic_file("Graphics/Pokemon/Eggs/", species, form, "_icon")
@@ -139,7 +142,7 @@ module GameData
return self.icon_bitmap(pkmn.species, pkmn.form, pkmn.gender, pkmn.shiny?, pkmn.shadowPokemon?, pkmn.egg?)
end
#===========================================================================
#---------------------------------------------------------------------------
def self.footprint_filename(species, form = 0)
species_data = self.get_species_form(species, form)
@@ -151,7 +154,7 @@ module GameData
return pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%s", species_data.species))
end
#===========================================================================
#---------------------------------------------------------------------------
def self.shadow_filename(species, form = 0)
species_data = self.get_species_form(species, form)
@@ -178,7 +181,7 @@ module GameData
return (filename) ? AnimatedBitmap.new(filename) : nil
end
#===========================================================================
#---------------------------------------------------------------------------
def self.check_cry_file(species, form, suffix = "")
species_data = self.get_species_form(species, form)

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class SpeciesMetrics
attr_reader :id
@@ -13,7 +16,6 @@ module GameData
DATA = {}
DATA_FILENAME = "species_metrics.dat"
PBS_BASE_FILENAME = "pokemon_metrics"
SCHEMA = {
"SectionName" => [:id, "eV", :Species],
"BackSprite" => [:back_sprite, "ii"],
@@ -56,6 +58,8 @@ module GameData
return DATA[species]
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@species = hash[:species] || @id

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class ShadowPokemon
attr_reader :id
@@ -12,7 +15,6 @@ module GameData
DATA_FILENAME = "shadow_pokemon.dat"
PBS_BASE_FILENAME = "shadow_pokemon"
OPTIONAL = true
SCHEMA = {
"SectionName" => [:id, "eV", :Species],
"GaugeSize" => [:gauge_size, "v"],
@@ -43,6 +45,8 @@ module GameData
return (DATA.has_key?(species_form)) ? DATA[species_form] : nil
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@species = hash[:species] || @id

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Ribbon
attr_reader :id
@@ -10,7 +13,6 @@ module GameData
DATA = {}
DATA_FILENAME = "ribbons.dat"
PBS_BASE_FILENAME = "ribbons"
SCHEMA = {
"SectionName" => [:id, "m"],
"Name" => [:real_name, "s"],
@@ -22,6 +24,8 @@ module GameData
extend ClassMethodsSymbols
include InstanceMethods
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:real_name] || "Unnamed"

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Encounter
attr_accessor :id
@@ -59,6 +62,8 @@ module GameData
end
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@map = hash[:map]

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class TrainerType
attr_reader :id
@@ -15,7 +18,6 @@ module GameData
DATA = {}
DATA_FILENAME = "trainer_types.dat"
PBS_BASE_FILENAME = "trainer_types"
SCHEMA = {
"SectionName" => [:id, "m"],
"Name" => [:real_name, "s"],
@@ -101,6 +103,8 @@ module GameData
return self.check_file(tr_type, "Graphics/UI/Town Map/player_", sprintf("_%d", outfit))
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:real_name] || "Unnamed"

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Trainer
attr_reader :id
@@ -12,7 +15,6 @@ module GameData
DATA = {}
DATA_FILENAME = "trainers.dat"
PBS_BASE_FILENAME = "trainers"
# "Pokemon" is specially mentioned in def compile_trainers and def
# write_trainers, and acts as a subheading for a particular Pokémon.
SCHEMA = {
@@ -83,6 +85,8 @@ module GameData
return (self::DATA.has_key?(key)) ? self::DATA[key] : nil
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@trainer_type = hash[:trainer_type]

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class Metadata
attr_reader :id
@@ -17,7 +20,6 @@ module GameData
DATA = {}
DATA_FILENAME = "metadata.dat"
PBS_BASE_FILENAME = "metadata"
SCHEMA = {
"SectionName" => [:id, "u"],
"StartMoney" => [:start_money, "u"],
@@ -56,6 +58,8 @@ module GameData
return DATA[0]
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id] || 0
@start_money = hash[:start_money] || 3000

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class PlayerMetadata
attr_reader :id
@@ -8,7 +11,6 @@ module GameData
DATA = {}
DATA_FILENAME = "player_metadata.dat"
SCHEMA = {
"SectionName" => [:id, "u"],
"TrainerType" => [:trainer_type, "e", :TrainerType],
@@ -48,6 +50,8 @@ module GameData
return self::DATA[1]
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@trainer_type = hash[:trainer_type]

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class MapMetadata
attr_reader :id
@@ -29,7 +32,6 @@ module GameData
DATA = {}
DATA_FILENAME = "map_metadata.dat"
PBS_BASE_FILENAME = "map_metadata"
SCHEMA = {
"SectionName" => [:id, "u"],
"Name" => [:real_name, "s"],
@@ -89,6 +91,8 @@ module GameData
]
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@real_name = hash[:real_name]

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class DungeonTileset
attr_reader :id
@@ -15,7 +18,6 @@ module GameData
DATA = {}
DATA_FILENAME = "dungeon_tilesets.dat"
PBS_BASE_FILENAME = "dungeon_tilesets"
SCHEMA = {
"SectionName" => [:id, "u"],
"Autotile" => [:autotile, "^um"],
@@ -41,6 +43,8 @@ module GameData
return (self::DATA.has_key?(other)) ? self::DATA[other] : self.get(self::DATA.keys.first)
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@snap_to_large_grid = hash[:snap_to_large_grid] || false

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class DungeonParameters
attr_reader :id, :area, :version
@@ -29,7 +32,6 @@ module GameData
DATA = {}
DATA_FILENAME = "dungeon_parameters.dat"
PBS_BASE_FILENAME = "dungeon_parameters"
SCHEMA = {
"SectionName" => [:id, "mV"],
"DungeonSize" => [:dungeon_size, "vv"],
@@ -65,6 +67,8 @@ module GameData
return (DATA.has_key?(area_version)) ? DATA[area_version] : self.new({})
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@area = hash[:area]

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
module GameData
class PhoneMessage
attr_reader :id
@@ -11,7 +14,6 @@ module GameData
DATA = {}
DATA_FILENAME = "phone.dat"
PBS_BASE_FILENAME = "phone"
SCHEMA = {
"SectionName" => [:id, "q"],
"Intro" => [:intro, "^q"],
@@ -69,6 +71,8 @@ module GameData
return (self::DATA.has_key?(key)) ? self::DATA[key] : nil
end
#---------------------------------------------------------------------------
def initialize(hash)
@id = hash[:id]
@trainer_type = hash[:trainer_type]