Fixes wrong ability index after fusing

This commit is contained in:
infinitefusion
2023-04-10 11:58:43 -04:00
parent 368d843fee
commit 222327481f
16 changed files with 25 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,7 +6,7 @@
module Settings module Settings
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format. # The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION = '5.0.0' GAME_VERSION = '5.0.0'
GAME_VERSION_NUMBER = "5.1.2" GAME_VERSION_NUMBER = "5.1.3"
POKERADAR_LIGHT_ANIMATION_RED_ID = 17 POKERADAR_LIGHT_ANIMATION_RED_ID = 17
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18 POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18

View File

@@ -42,6 +42,10 @@ class Pokemon
# defined at this index. Is recalculated (as 0 or 1) if made nil. # defined at this index. Is recalculated (as 0 or 1) if made nil.
# @param value [Integer, nil] forced ability index (nil if none is set) # @param value [Integer, nil] forced ability index (nil if none is set)
attr_writer :ability_index attr_writer :ability_index
attr_accessor :body_original_ability_index
attr_accessor :head_original_ability_index
# @return [Array<Pokemon::Move>] the moves known by this Pokémon # @return [Array<Pokemon::Move>] the moves known by this Pokémon
attr_accessor :moves attr_accessor :moves
# @return [Array<Integer>] the IDs of moves known by this Pokémon when it was obtained # @return [Array<Integer>] the IDs of moves known by this Pokémon when it was obtained

View File

@@ -801,7 +801,12 @@ def setAbilityAndNatureAndNickname(abilitiesList, naturesList)
screen = PokemonOptionScreen.new(scene) screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen screen.pbStartScreen
@pokemon1.body_original_ability_index = @pokemon1.ability_index
@pokemon1.head_original_ability_index = @pokemon2.ability_index
@pokemon1.ability = scene.selectedAbility @pokemon1.ability = scene.selectedAbility
@pokemon1.ability_index = locate_ability_index(@pokemon1,scene.selectedAbility)
@pokemon1.nature = scene.selectedNature @pokemon1.nature = scene.selectedNature
if scene.hasNickname if scene.hasNickname
@pokemon1.name = scene.nickname @pokemon1.name = scene.nickname
@@ -809,6 +814,17 @@ def setAbilityAndNatureAndNickname(abilitiesList, naturesList)
end end
def locate_ability_index(pokemon, ability)
abilityList = pokemon.getAbilityList
for possible_ability in abilityList
if possible_ability[0] == ability.id
return possible_ability[1]
end
end
return nil
end
def setFusionMoves(fusedPoke, poke2, selected2ndOption = false) def setFusionMoves(fusedPoke, poke2, selected2ndOption = false)
#NEW METHOD (not ready) #NEW METHOD (not ready)

View File

@@ -1479,6 +1479,10 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
end end
end end
end end
pokemon.ability_index = pokemon.body_original_ability_index if pokemon.body_original_ability_index
poke2.ability_index = pokemon.head_original_ability_index if pokemon.head_original_ability_index
pokemon.debug_shiny=true if pokemon.debug_shiny && pokemon.body_shiny pokemon.debug_shiny=true if pokemon.debug_shiny && pokemon.body_shiny
poke2.debug_shiny=true if pokemon.debug_shiny && poke2.head_shiny poke2.debug_shiny=true if pokemon.debug_shiny && poke2.head_shiny

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.