Made a set of PBS files for Shadow Pokémon data, grouped shadow_pokemon.txt with it

This commit is contained in:
Maruno17
2023-01-22 22:25:20 +00:00
parent 3d9c3e2c00
commit f6213057d8
8 changed files with 271 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ module GameData
SCHEMA = {
"SectionName" => [:id, "e", :Species],
"GaugeSize" => [:gauge_size, "v"],
"Moves" => [:moves, "*m"], # Not enumerated when compiled
"Moves" => [:moves, "*e", :Move],
"Flags" => [:flags, "*s"]
}
HEART_GAUGE_SIZE = 4000 # Default gauge size
@@ -21,6 +21,11 @@ module GameData
extend ClassMethodsSymbols
include InstanceMethods
alias __orig__load load unless private_method_defined?(:__orig__load)
def self.load
__orig__load if safeExists?("Data/#{self::DATA_FILENAME}")
end
def initialize(hash)
@id = hash[:id]
@gauge_size = hash[:gauge_size] || HEART_GAUGE_SIZE

View File

@@ -127,7 +127,7 @@ class Pokemon
# Record this Pokémon's Shadow moves
if data
data.moves.each do |m|
@shadow_moves.push(m.to_sym) if GameData::Move.exists?(m.to_sym)
@shadow_moves.push(m) if GameData::Move.exists?(m)
break if @shadow_moves.length >= MAX_MOVES
end
end

View File

@@ -542,6 +542,7 @@ module Compiler
# Compile Shadow Pokémon data
#=============================================================================
def compile_shadow_pokemon(*paths)
return if !safeExists?("PBS/shadow_pokemon.txt")
compile_PBS_file_generic(GameData::ShadowPokemon, *paths) do |final_validate, hash|
(final_validate) ? validate_all_compiled_shadow_pokemon : validate_compiled_shadow_pokemon(hash)
end

View File

@@ -354,6 +354,7 @@ module Compiler
# Save Shadow Pokémon data to PBS file
#=============================================================================
def write_shadow_pokemon
return if GameData::ShadowPokemon::DATA.empty?
write_PBS_file_generic(GameData::ShadowPokemon)
end