randomizer - gift pokemon

This commit is contained in:
infinitefusion
2022-05-01 15:35:03 -04:00
parent 089975984e
commit 68d0e24ef4
5 changed files with 12 additions and 2 deletions

Binary file not shown.

View File

@@ -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)

View File

@@ -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

View File

@@ -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

Binary file not shown.