Adds option for toggling custom eggs

This commit is contained in:
chardub
2025-02-16 16:16:32 -05:00
parent 28a982ce15
commit 541c98ba6b
4 changed files with 19 additions and 8 deletions

View File

@@ -63,6 +63,7 @@ module GameData
# return (ret) ? ret : pbResolveBitmap("Graphics/Pokemon/Eggs/000") # return (ret) ? ret : pbResolveBitmap("Graphics/Pokemon/Eggs/000")
# end # end
def self.egg_sprite_filename(species, form) def self.egg_sprite_filename(species, form)
return "Graphics/Battlers/Eggs/000" if $PokemonSystem.use_custom_eggs
dexNum = getDexNumberForSpecies(species) dexNum = getDexNumberForSpecies(species)
bitmapFileName = sprintf("Graphics/Battlers/Eggs/%03d", dexNum) rescue nil bitmapFileName = sprintf("Graphics/Battlers/Eggs/%03d", dexNum) rescue nil
if !pbResolveBitmap(bitmapFileName) if !pbResolveBitmap(bitmapFileName)
@@ -261,7 +262,6 @@ module GameData
end end
end end
def self.play_fusion_cry(head_id,body_id, volume = 90, pitch = 100) def self.play_fusion_cry(head_id,body_id, volume = 90, pitch = 100)
echoln "fusion"
head_cry_filename = self.check_cry_file(head_id,nil) head_cry_filename = self.check_cry_file(head_id,nil)
body_cry_filename = self.check_cry_file(body_id,nil) body_cry_filename = self.check_cry_file(body_id,nil)

View File

@@ -23,6 +23,7 @@ class PokemonSystem
attr_accessor :on_mobile attr_accessor :on_mobile
attr_accessor :type_icons attr_accessor :type_icons
attr_accessor :use_generated_dex_entries attr_accessor :use_generated_dex_entries
attr_accessor :use_custom_eggs
def initialize def initialize
@textspeed = 1 # Text speed (0=slow, 1=normal, 2=fast) @textspeed = 1 # Text speed (0=slow, 1=normal, 2=fast)
@@ -45,6 +46,7 @@ class PokemonSystem
@on_mobile = false @on_mobile = false
@type_icons = true @type_icons = true
@use_generated_dex_entries = true @use_generated_dex_entries = true
@use_custom_eggs = true
end end
end end

View File

@@ -124,6 +124,16 @@ class PokemonGameOption_Scene < PokemonOption_Scene
] ]
) )
custom_eggs_option_selected = $PokemonSystem.use_custom_eggs ? 1 : 0
options << EnumOption.new(_INTL("Custom Eggs"), [_INTL("On"), _INTL("Off")],
proc { custom_eggs_option_selected },
proc { |value|
$PokemonSystem.use_custom_eggs = value == 1
},
["Eggs have different sprites for each Pokémon.",
"Eggs all use the same sprite."]
)
if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) # beat the league if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) # beat the league
options << options <<
EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")], EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")],
@@ -190,8 +200,6 @@ class PokemonGameOption_Scene < PokemonOption_Scene
"Display the enemy Pokémon type in battles." "Display the enemy Pokémon type in battles."
) )
end end
options << EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")], options << EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
proc { [$PokemonSystem.screensize, 4].min }, proc { [$PokemonSystem.screensize, 4].min },

View File

@@ -46,6 +46,7 @@ def pbLoadPokemonBitmap(pokemon, species, back = false)
end end
def getEggBitmapPath(pokemon) def getEggBitmapPath(pokemon)
return "Graphics/Battlers/Eggs/000" if $PokemonSystem.use_custom_eggs
bitmapFileName = sprintf("Graphics/Battlers/Eggs/%s", getConstantName(PBSpecies, pokemon.species)) rescue nil bitmapFileName = sprintf("Graphics/Battlers/Eggs/%s", getConstantName(PBSpecies, pokemon.species)) rescue nil
if !pbResolveBitmap(bitmapFileName) if !pbResolveBitmap(bitmapFileName)
if pokemon.species >= NUM_ZAPMOLCUNO if pokemon.species >= NUM_ZAPMOLCUNO