mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
[wip] pokedex refactor for fusions
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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.0.18 - beta"
|
GAME_VERSION_NUMBER = "5.0.18.1 - beta"
|
||||||
|
|
||||||
POKERADAR_LIGHT_ANIMATION_RED_ID = 17
|
POKERADAR_LIGHT_ANIMATION_RED_ID = 17
|
||||||
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18
|
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18
|
||||||
|
|||||||
@@ -24,41 +24,88 @@ class Player < Trainer
|
|||||||
def clear
|
def clear
|
||||||
@seen = {}
|
@seen = {}
|
||||||
@owned = {}
|
@owned = {}
|
||||||
|
|
||||||
|
@seen_fusion = {}
|
||||||
|
@owned_fusion = {}
|
||||||
|
|
||||||
@seen_forms = {}
|
@seen_forms = {}
|
||||||
@last_seen_forms = {}
|
@last_seen_forms = {}
|
||||||
@owned_shadow = {}
|
@owned_shadow = {}
|
||||||
self.refresh_accessible_dexes
|
self.refresh_accessible_dexes
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def isFusion(species)
|
||||||
|
num = getDexNumberForSpecies(species)
|
||||||
|
return num > Settings::NB_POKEMON && num < Settings::ZAPMOLCUNO_NB
|
||||||
|
end
|
||||||
#===========================================================================
|
#===========================================================================
|
||||||
|
|
||||||
# Sets the given species as seen in the Pokédex.
|
# Sets the given species as seen in the Pokédex.
|
||||||
# @param species [Symbol, GameData::Species] species to set as seen
|
# @param species [Symbol, GameData::Species] species to set as seen
|
||||||
# @param should_refresh_dexes [Boolean] whether Dex accessibility should be recalculated
|
# @param should_refresh_dexes [Boolean] whether Dex accessibility should be recalculated
|
||||||
def set_seen(species, should_refresh_dexes = true)
|
def set_seen_fusion(species)
|
||||||
|
bodyId = getBodyID(species)
|
||||||
|
headId = getHeadID(species,bodyId)
|
||||||
|
@seen_fusion[headId][bodyId] = true
|
||||||
|
p @seen_fusion
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_seen_normalDex(species)
|
||||||
species_id = GameData::Species.try_get(species)&.species
|
species_id = GameData::Species.try_get(species)&.species
|
||||||
return if species_id.nil?
|
return if species_id.nil?
|
||||||
@seen[species_id] = true
|
@seen[species_id] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_seen(species, should_refresh_dexes = true)
|
||||||
|
return #TODO
|
||||||
|
|
||||||
|
|
||||||
|
if isFusion(species)
|
||||||
|
set_seen_fusion(species)
|
||||||
|
else
|
||||||
|
set_seen_normalDex(species)
|
||||||
|
end
|
||||||
self.refresh_accessible_dexes if should_refresh_dexes
|
self.refresh_accessible_dexes if should_refresh_dexes
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param species [Symbol, GameData::Species] species to check
|
# @param species [Symbol, GameData::Species] species to check
|
||||||
# @return [Boolean] whether the species is seen
|
# @return [Boolean] whether the species is seen
|
||||||
def seen?(species)
|
|
||||||
|
def seen_fusion?(species)
|
||||||
|
bodyId = getBodyID(species)
|
||||||
|
headId = getHeadID(species,bodyId)
|
||||||
|
return @seen_fusion[headId][bodyId]
|
||||||
|
end
|
||||||
|
|
||||||
|
def seen_normalDex?(species)
|
||||||
species_id = GameData::Species.try_get(species)&.species
|
species_id = GameData::Species.try_get(species)&.species
|
||||||
return false if species_id.nil?
|
return false if species_id.nil?
|
||||||
return @seen[species_id] == true
|
return @seen[species_id] == true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def seen?(species)
|
||||||
|
return false#TODO
|
||||||
|
|
||||||
|
|
||||||
|
if isFusion(species)
|
||||||
|
return seen_fusion?(species)
|
||||||
|
else
|
||||||
|
return seen_normalDex?(species)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# @param species [Symbol, GameData::Species] species to check
|
# @param species [Symbol, GameData::Species] species to check
|
||||||
# @param gender [Integer] gender to check
|
# @param gender [Integer] gender to check
|
||||||
# @param form [Integer] form to check
|
# @param form [Integer] form to check
|
||||||
# @return [Boolean] whether the species of the given gender and form is seen
|
# @return [Boolean] whether the species of the given gender and form is seen
|
||||||
def seen_form?(species, gender, form)
|
def seen_form?(species, gender, form)
|
||||||
species_id = GameData::Species.try_get(species)&.species
|
return true
|
||||||
return false if species_id.nil?
|
# species_id = GameData::Species.try_get(species)&.species
|
||||||
@seen_forms[species_id] ||= [[], []]
|
# return false if species_id.nil?
|
||||||
return @seen_forms[species_id][gender][form] == true
|
# @seen_forms[species_id] ||= [[], []]
|
||||||
|
# return @seen_forms[species_id][gender][form] == true
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the amount of seen Pokémon.
|
# Returns the amount of seen Pokémon.
|
||||||
@@ -118,25 +165,70 @@ class Player < Trainer
|
|||||||
# Sets the given species as owned in the Pokédex.
|
# Sets the given species as owned in the Pokédex.
|
||||||
# @param species [Symbol, GameData::Species] species to set as owned
|
# @param species [Symbol, GameData::Species] species to set as owned
|
||||||
# @param should_refresh_dexes [Boolean] whether Dex accessibility should be recalculated
|
# @param should_refresh_dexes [Boolean] whether Dex accessibility should be recalculated
|
||||||
def set_owned(species, should_refresh_dexes = true)
|
def set_owned_fusion(species)
|
||||||
|
bodyId = getBodyID(species)
|
||||||
|
headId = getHeadID(species,bodyId)
|
||||||
|
@owned_fusion[headId][bodyId]=true
|
||||||
|
|
||||||
|
p @owned_fusion
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def set_owned_normalDex(species)
|
||||||
species_id = GameData::Species.try_get(species)&.species
|
species_id = GameData::Species.try_get(species)&.species
|
||||||
return if species_id.nil?
|
return if species_id.nil?
|
||||||
@owned[species_id] = true
|
@owned[species_id] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_owned(species, should_refresh_dexes = true)
|
||||||
|
return #TODO
|
||||||
|
|
||||||
|
if isFusion(species)
|
||||||
|
set_owned_fusion(species)
|
||||||
|
else
|
||||||
|
set_owned_normalDex(species)
|
||||||
|
end
|
||||||
self.refresh_accessible_dexes if should_refresh_dexes
|
self.refresh_accessible_dexes if should_refresh_dexes
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sets the given species as owned in the Pokédex.
|
# Sets the given species as owned in the Pokédex.
|
||||||
# @param species [Symbol, GameData::Species] species to set as owned
|
# @param species [Symbol, GameData::Species] species to set as owned
|
||||||
def set_shadow_pokemon_owned(species)
|
def set_shadow_pokemon_owned(species)
|
||||||
species_id = GameData::Species.try_get(species)&.species
|
return
|
||||||
return if species_id.nil?
|
# species_id = GameData::Species.try_get(species)&.species
|
||||||
@owned_shadow[species_id] = true
|
# return if species_id.nil?
|
||||||
self.refresh_accessible_dexes
|
# @owned_shadow[species_id] = true
|
||||||
|
# self.refresh_accessible_dexes
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param species [Symbol, GameData::Species] species to check
|
# @param species [Symbol, GameData::Species] species to check
|
||||||
# @return [Boolean] whether the species is owned
|
# @return [Boolean] whether the species is owned
|
||||||
|
def owned_fusion?(species)
|
||||||
|
bodyId = getBodyID(species)
|
||||||
|
headId = getHeadID(species,bodyId)
|
||||||
|
|
||||||
|
p @owned
|
||||||
|
p @owned[headId]
|
||||||
|
|
||||||
|
return @owned[headId][bodyId] == true
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def owned?(species)
|
def owned?(species)
|
||||||
|
return false #TODO
|
||||||
|
|
||||||
|
|
||||||
|
if isFusion(species)
|
||||||
|
return owned_fusion?(species)
|
||||||
|
else
|
||||||
|
return owned_normalDex?(species)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def owned_normalDex?(species)
|
||||||
species_id = GameData::Species.try_get(species)&.species
|
species_id = GameData::Species.try_get(species)&.species
|
||||||
return false if species_id.nil?
|
return false if species_id.nil?
|
||||||
return @owned[species_id] == true
|
return @owned[species_id] == true
|
||||||
@@ -145,9 +237,10 @@ class Player < Trainer
|
|||||||
# @param species [Symbol, GameData::Species] species to check
|
# @param species [Symbol, GameData::Species] species to check
|
||||||
# @return [Boolean] whether a Shadow Pokémon of the species is owned
|
# @return [Boolean] whether a Shadow Pokémon of the species is owned
|
||||||
def owned_shadow_pokemon?(species)
|
def owned_shadow_pokemon?(species)
|
||||||
species_id = GameData::Species.try_get(species)&.species
|
return
|
||||||
return false if species_id.nil?
|
# species_id = GameData::Species.try_get(species)&.species
|
||||||
return @owned_shadow[species_id] == true
|
# return false if species_id.nil?
|
||||||
|
# return @owned_shadow[species_id] == true
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the amount of owned Pokémon.
|
# Returns the amount of owned Pokémon.
|
||||||
@@ -165,16 +258,18 @@ class Player < Trainer
|
|||||||
# @param gender [Integer] gender to register (0=male, 1=female, 2=genderless)
|
# @param gender [Integer] gender to register (0=male, 1=female, 2=genderless)
|
||||||
# @param form [Integer] form to register
|
# @param form [Integer] form to register
|
||||||
def register(species, gender = 0, form = 0, should_refresh_dexes = true)
|
def register(species, gender = 0, form = 0, should_refresh_dexes = true)
|
||||||
return
|
set_owned(species,should_refresh_dexes)
|
||||||
if species.is_a?(Pokemon)
|
set_seen(species,should_refresh_dexes)
|
||||||
species_data = species.species_data
|
# return
|
||||||
#gender = species.gender
|
# if species.is_a?(Pokemon)
|
||||||
else
|
# species_data = species.species_data
|
||||||
species_data = GameData::Species.get(species)
|
# #gender = species.gender
|
||||||
end
|
# else
|
||||||
species = species_data.species
|
# species_data = GameData::Species.get(species)
|
||||||
@seen[species] = true
|
# end
|
||||||
self.refresh_accessible_dexes if should_refresh_dexes
|
# species = species_data.species
|
||||||
|
# @seen[species] = true
|
||||||
|
# self.refresh_accessible_dexes if should_refresh_dexes
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param pkmn [Pokemon] Pokemon to register as most recently seen
|
# @param pkmn [Pokemon] Pokemon to register as most recently seen
|
||||||
|
|||||||
@@ -692,9 +692,9 @@ class PokemonFusionScene
|
|||||||
_INTL("\\se[]Congratulations! Your Pokémon were fused into {2}!\\wt[80]", @pokemon1.name, newspeciesname))
|
_INTL("\\se[]Congratulations! Your Pokémon were fused into {2}!\\wt[80]", @pokemon1.name, newspeciesname))
|
||||||
|
|
||||||
#exp
|
#exp
|
||||||
@pokemon1.exp_when_fused_head = @pokemon2.exp #peut-être l'inverse
|
@pokemon1.exp_when_fused_head = @pokemon2.exp #peut-être l'inverse
|
||||||
@pokemon1.exp_when_fused_body = @pokemon1.exp #peut-être l'inverse
|
@pokemon1.exp_when_fused_body = @pokemon1.exp #peut-être l'inverse
|
||||||
@pokemon1.exp_gained_since_fused=0
|
@pokemon1.exp_gained_since_fused = 0
|
||||||
|
|
||||||
averageFusionIvs()
|
averageFusionIvs()
|
||||||
#add to pokedex
|
#add to pokedex
|
||||||
@@ -708,17 +708,21 @@ class PokemonFusionScene
|
|||||||
#first check if hidden ability
|
#first check if hidden ability
|
||||||
hiddenAbility1 = @pokemon1.ability == @pokemon1.getAbilityList[0][-1]
|
hiddenAbility1 = @pokemon1.ability == @pokemon1.getAbilityList[0][-1]
|
||||||
hiddenAbility2 = @pokemon2.ability == @pokemon2.getAbilityList[0][-1]
|
hiddenAbility2 = @pokemon2.ability == @pokemon2.getAbilityList[0][-1]
|
||||||
|
@pokemon1.ability = pbChooseAbility(@pokemon1, hiddenAbility1, hiddenAbility2)
|
||||||
|
if superSplicer
|
||||||
|
@pokemon1.nature = pbChooseNature(@pokemon1.nature, @pokemon2.nature)
|
||||||
|
end
|
||||||
|
setFusionMoves(@pokemon1, @pokemon2) if !noMoves
|
||||||
#change species
|
#change species
|
||||||
@pokemon1.species = newSpecies
|
@pokemon1.species = newSpecies
|
||||||
|
|
||||||
#Check moves for new species
|
#Check moves for new species
|
||||||
movelist = @pokemon1.getMoveList
|
# movelist = @pokemon1.getMoveList
|
||||||
for i in movelist
|
# for i in movelist
|
||||||
if i[0] == @pokemon1.level
|
# if i[0] == @pokemon1.level
|
||||||
pbLearnMove(@pokemon1, i[1]) if !noMoves #(pokemon,move,ignoreifknown=true, byTM=false , quick =true)
|
# pbLearnMove(@pokemon1, i[1]) if !noMoves #(pokemon,move,ignoreifknown=true, byTM=false , quick =true)
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
#@pokemon1.ability = pbChooseAbility(@pokemon1,@pokemon2)
|
#@pokemon1.ability = pbChooseAbility(@pokemon1,@pokemon2)
|
||||||
removeItem = false
|
removeItem = false
|
||||||
if @pokemon2.isShiny? || @pokemon1.isShiny?
|
if @pokemon2.isShiny? || @pokemon1.isShiny?
|
||||||
@@ -730,21 +734,8 @@ class PokemonFusionScene
|
|||||||
@pokemon1.owner = Pokemon::Owner.new_from_trainer($Trainer)
|
@pokemon1.owner = Pokemon::Owner.new_from_trainer($Trainer)
|
||||||
|
|
||||||
|
|
||||||
@pokemon1.ability = pbChooseAbility(@pokemon1, hiddenAbility1, hiddenAbility2)
|
|
||||||
if superSplicer
|
|
||||||
@pokemon1.nature = pbChooseNature(@pokemon1.nature, @pokemon2.nature)
|
|
||||||
end
|
|
||||||
|
|
||||||
movelist = @pokemon2.moves
|
|
||||||
for k in movelist
|
|
||||||
if k.id != 0
|
|
||||||
pbLearnMove(@pokemon1, k.id, true, false,true) if !noMoves #todo: learn moves faster
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
pbSEPlay("Voltorb Flip Point")
|
pbSEPlay("Voltorb Flip Point")
|
||||||
|
|
||||||
#@pokemon1.firstmoves = []
|
|
||||||
@pokemon1.name = newspeciesname if @pokemon1.name == oldspeciesname
|
@pokemon1.name = newspeciesname if @pokemon1.name == oldspeciesname
|
||||||
|
|
||||||
@pokemon1.level = setPokemonLevel(@pokemon1.level, @pokemon2.level, superSplicer)
|
@pokemon1.level = setPokemonLevel(@pokemon1.level, @pokemon2.level, superSplicer)
|
||||||
@@ -755,6 +746,24 @@ class PokemonFusionScene
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def setFusionMoves(fusedPoke, poke2)
|
||||||
|
choice = Kernel.pbMessage("What to do with the moveset?", [_INTL("Learn moves"), _INTL("Keep {1}'s moveset", fusedPoke.name), _INTL("Keep {1}'s moveset", poke2.name)], 2)
|
||||||
|
if choice == 1
|
||||||
|
return
|
||||||
|
elsif choice == 2
|
||||||
|
fusedPoke.moves = poke2.moves
|
||||||
|
return
|
||||||
|
else
|
||||||
|
#Learn moves
|
||||||
|
movelist = poke2.moves
|
||||||
|
for move in movelist
|
||||||
|
if move.id != 0
|
||||||
|
pbLearnMove(fusedPoke, move.id, true, false, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def setPokemonLevel(pokemon1, pokemon2, superSplicers)
|
def setPokemonLevel(pokemon1, pokemon2, superSplicers)
|
||||||
lv1 = @pokemon1.level
|
lv1 = @pokemon1.level
|
||||||
lv2 = @pokemon2.level
|
lv2 = @pokemon2.level
|
||||||
@@ -794,14 +803,13 @@ def pbChooseAbility(poke, hidden1 = false, hidden2 = false)
|
|||||||
abID1 = hidden1 ? abilityList[4][0] : abilityList[0][0]
|
abID1 = hidden1 ? abilityList[4][0] : abilityList[0][0]
|
||||||
abID2 = hidden2 ? abilityList[5][0] : abilityList[1][0]
|
abID2 = hidden2 ? abilityList[5][0] : abilityList[1][0]
|
||||||
|
|
||||||
|
|
||||||
ability1_name = GameData::Ability.get(abID1).name
|
ability1_name = GameData::Ability.get(abID1).name
|
||||||
ability2_name = GameData::Ability.get(abID2).name
|
ability2_name = GameData::Ability.get(abID2).name
|
||||||
|
|
||||||
if (Kernel.pbMessage("Choose an ability.", [_INTL("{1}", ability1_name), _INTL("{1}", ability2_name)], 2)) == 0
|
if (Kernel.pbMessage("Choose an ability.", [_INTL("{1}", ability1_name), _INTL("{1}", ability2_name)], 2)) == 0
|
||||||
return abID1#hidden1 ? 4 : 0
|
return abID1 #hidden1 ? 4 : 0
|
||||||
end
|
end
|
||||||
return abID2#hidden2 ? 5 : 1
|
return abID2 #hidden2 ? 5 : 1
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbChooseNature(species1_nature, species2_nature)
|
def pbChooseNature(species1_nature, species2_nature)
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user