From 541c98ba6b096b900a593924b55e66676ec223d3 Mon Sep 17 00:00:00 2001 From: chardub Date: Sun, 16 Feb 2025 16:16:32 -0500 Subject: [PATCH] Adds option for toggling custom eggs --- .../002_PBS data/009_Species_Files.rb | 2 +- Data/Scripts/016_UI/015_UI_Options.rb | 2 ++ Data/Scripts/052_AddOns/GameOptions.rb | 22 +++++++++++++------ Data/Scripts/052_AddOns/Gen 2.rb | 1 + 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb b/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb index ec136fa7f..d473ffc28 100644 --- a/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb +++ b/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb @@ -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) diff --git a/Data/Scripts/016_UI/015_UI_Options.rb b/Data/Scripts/016_UI/015_UI_Options.rb index 9b0c07c6e..f3605fa88 100644 --- a/Data/Scripts/016_UI/015_UI_Options.rb +++ b/Data/Scripts/016_UI/015_UI_Options.rb @@ -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 diff --git a/Data/Scripts/052_AddOns/GameOptions.rb b/Data/Scripts/052_AddOns/GameOptions.rb index d290b9d1a..4971fee56 100644 --- a/Data/Scripts/052_AddOns/GameOptions.rb +++ b/Data/Scripts/052_AddOns/GameOptions.rb @@ -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 }, diff --git a/Data/Scripts/052_AddOns/Gen 2.rb b/Data/Scripts/052_AddOns/Gen 2.rb index de40ac466..6edf24ec2 100644 --- a/Data/Scripts/052_AddOns/Gen 2.rb +++ b/Data/Scripts/052_AddOns/Gen 2.rb @@ -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