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
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]