mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixes issue with gym randomizer when wiping out in a gym
This commit is contained in:
@@ -154,7 +154,9 @@ module GameData
|
|||||||
end
|
end
|
||||||
if $game_switches[SWITCH_RANDOM_GYM_PERSIST_TEAMS] && $PokemonGlobal.randomGymTrainersHash != nil
|
if $game_switches[SWITCH_RANDOM_GYM_PERSIST_TEAMS] && $PokemonGlobal.randomGymTrainersHash != nil
|
||||||
if $PokemonGlobal.randomGymTrainersHash[trainerId] != nil && $PokemonGlobal.randomGymTrainersHash[trainerId].length >= $PokemonGlobal.randomTrainersHash[trainerId].length
|
if $PokemonGlobal.randomGymTrainersHash[trainerId] != nil && $PokemonGlobal.randomGymTrainersHash[trainerId].length >= $PokemonGlobal.randomTrainersHash[trainerId].length
|
||||||
return getSpecies($PokemonGlobal.randomGymTrainersHash[trainerId][pokemonIndex])
|
newSpecies = getSpecies($PokemonGlobal.randomGymTrainersHash[trainerId][pokemonIndex])
|
||||||
|
return newSpecies if newSpecies
|
||||||
|
return species
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
new_species = generateRandomGymSpecies(species)
|
new_species = generateRandomGymSpecies(species)
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ end
|
|||||||
# Blacking out animation
|
# Blacking out animation
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbStartOver(gameover=false)
|
def pbStartOver(gameover=false)
|
||||||
|
$game_variables[VAR_CURRENT_GYM_TYPE]=-1
|
||||||
if pbInBugContest?
|
if pbInBugContest?
|
||||||
pbBugContestStartOver
|
pbBugContestStartOver
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ def bstOk(newspecies, oldPokemonSpecies, bst_range = 50)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def gymLeaderOk(newspecies)
|
def gymLeaderOk(newspecies)
|
||||||
return true if $game_variables[152] == -1 #not in a gym
|
return true if $game_variables[VAR_CURRENT_GYM_TYPE] == -1 #not in a gym
|
||||||
leaderType = getLeaderType()
|
leaderType = getLeaderType()
|
||||||
if leaderType == nil
|
if leaderType == nil
|
||||||
return true
|
return true
|
||||||
@@ -138,7 +138,7 @@ def gymLeaderOk(newspecies)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def getLeaderType()
|
def getLeaderType()
|
||||||
currentGym = $game_variables[152]
|
currentGym = $game_variables[VAR_CURRENT_GYM_TYPE]
|
||||||
if currentGym > $game_variables[151].length
|
if currentGym > $game_variables[151].length
|
||||||
return nil
|
return nil
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ def playPokeFluteAnimation
|
|||||||
end
|
end
|
||||||
|
|
||||||
def restoreDefaultCharacterSprite(charset_number=0)
|
def restoreDefaultCharacterSprite(charset_number=0)
|
||||||
meta = GameData::Metadata.get_player($Trainer.character_ID)
|
|
||||||
$game_player.setDefaultCharName(nil, 0, false)
|
$game_player.setDefaultCharName(nil, 0, false)
|
||||||
Graphics.update
|
Graphics.update
|
||||||
Input.update
|
Input.update
|
||||||
|
|||||||
Reference in New Issue
Block a user