Converted Shadow Pokémon PBS file to a section-based format, improved Shadow Pokémon mechanics

This commit is contained in:
Maruno17
2021-11-21 00:44:41 +00:00
parent 048a18b415
commit b445f26a88
25 changed files with 761 additions and 204 deletions

View File

@@ -4,7 +4,6 @@
class Game_Temp
attr_accessor :town_map_data
attr_accessor :phone_messages_data
attr_accessor :shadow_movesets_data
attr_accessor :regional_dexes_data
attr_accessor :battle_animations_data
attr_accessor :move_to_battle_animation_data
@@ -15,7 +14,6 @@ def pbClearData
if $game_temp
$game_temp.town_map_data = nil
$game_temp.phone_messages_data = nil
$game_temp.shadow_movesets_data = nil
$game_temp.regional_dexes_data = nil
$game_temp.battle_animations_data = nil
$game_temp.move_to_battle_animation_data = nil
@@ -52,17 +50,6 @@ def pbLoadPhoneData
return $game_temp.phone_messages_data
end
#===============================================================================
# Method to get Shadow Pokémon moveset data.
#===============================================================================
def pbLoadShadowMovesets
$game_temp = Game_Temp.new if !$game_temp
if !$game_temp.shadow_movesets_data
$game_temp.shadow_movesets_data = load_data("Data/shadow_movesets.dat") || []
end
return $game_temp.shadow_movesets_data
end
#===============================================================================
# Method to get Regional Dexes data.
#===============================================================================

View File

@@ -0,0 +1,32 @@
module GameData
class ShadowPokemon
attr_reader :id
attr_reader :moves
attr_reader :gauge_size
attr_reader :flags
DATA = {}
DATA_FILENAME = "shadow_pokemon.dat"
SCHEMA = {
"GaugeSize" => [:gauge_size, "v"],
"Moves" => [:moves, "*s"], # Not enumerated when compiled
"Flags" => [:flags, "*s"]
}
HEART_GAUGE_SIZE = 4000 # Default gauge size
extend ClassMethodsSymbols
include InstanceMethods
def initialize(hash)
@id = hash[:id]
@moves = hash[:moves] || []
@gauge_size = hash[:gauge_size] || HEART_GAUGE_SIZE
@flags = hash[:flags] || []
end
def has_flag?(flag)
return @flags.any? { |f| f.downcase == flag.downcase }
end
end
end