diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata index 5e7108e88..5562facb8 100644 Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ diff --git a/Data/Scripts/019_Utilities/002_Utilities_Pokemon.rb b/Data/Scripts/019_Utilities/002_Utilities_Pokemon.rb index 9d5d5c55f..0b5c10358 100644 --- a/Data/Scripts/019_Utilities/002_Utilities_Pokemon.rb +++ b/Data/Scripts/019_Utilities/002_Utilities_Pokemon.rb @@ -62,7 +62,7 @@ end #=============================================================================== # Giving Pokémon to the player (will send to storage if party is full) #=============================================================================== -def pbAddPokemon(pkmn, level = 1, see_form = true) +def pbAddPokemon(pkmn, level = 1, see_form = true, dontRandomize=false) return false if !pkmn if pbBoxesFull? pbMessage(_INTL("There's no more room for Pokémon!\1")) @@ -70,6 +70,7 @@ def pbAddPokemon(pkmn, level = 1, see_form = true) return false end pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon) + tryRandomizeGiftPokemon(pkmn,dontRandomize) species_name = pkmn.speciesName pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $Trainer.name, species_name)) pbNicknameAndStore(pkmn) @@ -94,9 +95,10 @@ end #=============================================================================== # Giving Pokémon/eggs to the player (can only add to party) #=============================================================================== -def pbAddToParty(pkmn, level = 1, see_form = true) +def pbAddToParty(pkmn, level = 1, see_form = true, dontRandomize=false) return false if !pkmn || $Trainer.party_full? pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon) + tryRandomizeGiftPokemon(pkmn,dontRandomize) species_name = pkmn.speciesName pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $Trainer.name, species_name)) pbNicknameAndStore(pkmn) diff --git a/Data/Scripts/025-Randomizer/randomizer.rb b/Data/Scripts/025-Randomizer/randomizer.rb index 3ac7610e2..8d5ca0036 100644 --- a/Data/Scripts/025-Randomizer/randomizer.rb +++ b/Data/Scripts/025-Randomizer/randomizer.rb @@ -188,3 +188,10 @@ def getRandomizedTo(species) return $PokemonGlobal.psuedoBSTHash[dexNum(species)] # code here end + +def tryRandomizeGiftPokemon(pokemon,dontRandomize=false) + if $game_switches[SWITCH_RANDOM_GIFT_POKEMON] && $game_switches[SWITCH_RANDOM_WILD] && !dontRandomize + oldSpecies = dexNum(pokemon.species) + pokemon.species = getSpecies($PokemonGlobal.psuedoBSTHash[oldSpecies]) + end +end \ No newline at end of file diff --git a/Data/Scripts/049_Compatibility/Constants.rb b/Data/Scripts/049_Compatibility/Constants.rb index 1897fd5e5..98531623e 100644 --- a/Data/Scripts/049_Compatibility/Constants.rb +++ b/Data/Scripts/049_Compatibility/Constants.rb @@ -55,6 +55,7 @@ SWITCH_GYM_RANDOM_EACH_BATTLE = 668 SWITCH_RANDOM_GYM_CUSTOMS=662 SWITCH_RANDOMIZE_GYMS_SEPARATELY = 667 SWITCH_RANDOMIZED_GYM_TYPES=921 +SWITCH_RANDOM_GIFT_POKEMON = 780 #Other switches SWITCH_RACE_BIKE = 984 diff --git a/Data/System.rxdata b/Data/System.rxdata index 6622ee1aa..f35e02f6a 100644 Binary files a/Data/System.rxdata and b/Data/System.rxdata differ