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")
# end
def self.egg_sprite_filename(species, form)
return "Graphics/Battlers/Eggs/000" if $PokemonSystem.use_custom_eggs
dexNum = getDexNumberForSpecies(species)
bitmapFileName = sprintf("Graphics/Battlers/Eggs/%03d", dexNum) rescue nil
if !pbResolveBitmap(bitmapFileName)
@@ -261,7 +262,6 @@ module GameData
end
end
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)
body_cry_filename = self.check_cry_file(body_id,nil)

View File

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

View File

@@ -50,7 +50,7 @@ class PokemonGameOption_Scene < PokemonOption_Scene
proc { $Trainer.selected_difficulty },
proc { |value|
setDifficulty(value)
@manually_changed_difficulty=true
@manually_changed_difficulty = true
}, ["All Pokémon in the team gain experience. Otherwise the same as Normal difficulty.",
"The default experience. Levels are similar to the official games.",
"Higher levels and smarter AI. All trainers have access to healing items."]
@@ -111,7 +111,7 @@ class PokemonGameOption_Scene < PokemonOption_Scene
"Automatically download missing custom sprites and Pokédex entries from the internet"
)
#
generated_entries_option_selected=$PokemonSystem.use_generated_dex_entries ? 1 : 0
generated_entries_option_selected = $PokemonSystem.use_generated_dex_entries ? 1 : 0
options << EnumOption.new(_INTL("Autogen dex entries"), [_INTL("Off"), _INTL("On")],
proc { generated_entries_option_selected },
proc { |value|
@@ -124,7 +124,17 @@ class PokemonGameOption_Scene < PokemonOption_Scene
]
)
if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) #beat the league
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
options <<
EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")],
proc { $PokemonSystem.battle_type },
@@ -183,15 +193,13 @@ class PokemonGameOption_Scene < PokemonOption_Scene
["Combines both Pokémon's party icons",
"Uses the same party icon for all fusions"]
)
battle_type_icon_option_selected=$PokemonSystem.type_icons ? 1 : 0
battle_type_icon_option_selected = $PokemonSystem.type_icons ? 1 : 0
options << EnumOption.new(_INTL("Battle Type Icons"), [_INTL("Off"), _INTL("On")],
proc { battle_type_icon_option_selected },
proc { |value| $PokemonSystem.type_icons = value == 1 },
"Display the enemy Pokémon type in battles."
)
end
options << EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
proc { [$PokemonSystem.screensize, 4].min },
@@ -215,7 +223,7 @@ class PokemonGameOption_Scene < PokemonOption_Scene
"Prevents leveling above the next gym leader's highest leveled Pokemon"
)
device_option_selected=$PokemonSystem.on_mobile ? 1 : 0
device_option_selected = $PokemonSystem.on_mobile ? 1 : 0
options << EnumOption.new(_INTL("Device"), [_INTL("PC"), _INTL("Mobile")],
proc { device_option_selected },
proc { |value| $PokemonSystem.on_mobile = value == 1 },

View File

@@ -46,6 +46,7 @@ def pbLoadPokemonBitmap(pokemon, species, back = false)
end
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
if !pbResolveBitmap(bitmapFileName)
if pokemon.species >= NUM_ZAPMOLCUNO