fixed abilities and rival evolution

This commit is contained in:
infinitefusion
2021-09-05 11:00:51 -04:00
parent 39714c97ef
commit a62ab706c5
30 changed files with 55 additions and 54 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.

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.

Binary file not shown.

View File

@@ -701,7 +701,7 @@ end
#=============================================================================== #===============================================================================
# Picking up an item found on the ground # Picking up an item found on the ground
#=============================================================================== #===============================================================================
def pbItemBall(item,quantity=1) def pbItemBall(item,quantity=1,item_name="",canRandom=true)
item = GameData::Item.get(item) item = GameData::Item.get(item)
return false if !item || quantity<1 return false if !item || quantity<1
itemname = (quantity>1) ? item.name_plural : item.name itemname = (quantity>1) ? item.name_plural : item.name
@@ -745,7 +745,8 @@ end
#=============================================================================== #===============================================================================
# Being given an item # Being given an item
#=============================================================================== #===============================================================================
def pbReceiveItem(item,quantity=1) def pbReceiveItem(item,quantity=1,item_name="",music=nil)
#item_name -> pour donner un autre nom à l'item. Pas encore réimplémenté et surtout là pour éviter que ça plante quand des events essaient de le faire
item = GameData::Item.get(item) item = GameData::Item.get(item)
return false if !item || quantity<1 return false if !item || quantity<1
itemname = (quantity>1) ? item.name_plural : item.name itemname = (quantity>1) ? item.name_plural : item.name

View File

@@ -154,7 +154,7 @@ class PokemonIconSprite < SpriteWrapper
end end
def useRegularIcon(species) def useRegularIcon(species)
dexNum = convertSpeciesSymbolToDexNumber(species) dexNum = getDexNumberForSpecies(species)
return true if dexNum <= Settings::NB_POKEMON return true if dexNum <= Settings::NB_POKEMON
return false if $game_variables == nil return false if $game_variables == nil
return true if $game_variables[220] != 0 return true if $game_variables[220] != 0

View File

@@ -15,7 +15,7 @@ class PokemonBoxIcon < IconSprite
end end
def useRegularIcon(species) def useRegularIcon(species)
dexNum = convertSpeciesSymbolToDexNumber(species) dexNum = getDexNumberForSpecies(species)
return true if dexNum <= Settings::NB_POKEMON return true if dexNum <= Settings::NB_POKEMON
return false if $game_variables == nil return false if $game_variables == nil
return true if $game_variables[220] != 0 return true if $game_variables[220] != 0

View File

@@ -475,6 +475,7 @@ module PBItems
XDEFENSE3 = 471 XDEFENSE3 = 471
XDEFENSE6 = 472 XDEFENSE6 = 472
XSPATK = 473 XSPATK = 473
XSPECIAL = 473
XSPATK2 = 474 XSPATK2 = 474
XSPATK3 = 475 XSPATK3 = 475
XSPATK6 = 476 XSPATK6 = 476

View File

@@ -130,8 +130,8 @@ end
#in: pokemon number #in: pokemon number
def Kernel.isPartPokemon(src, target) def Kernel.isPartPokemon(src, target)
src = convertSpeciesSymbolToDexNumber(src) src = getDexNumberForSpecies(src)
target = convertSpeciesSymbolToDexNumber(target) target = getDexNumberForSpecies(target)
return true if src == target return true if src == target
return false if src <= NB_POKEMON return false if src <= NB_POKEMON
bod = getBasePokemonID(src, true) bod = getBasePokemonID(src, true)
@@ -152,8 +152,6 @@ def getBasePokemonID(pokemon, body = true)
# cname = getConstantName(PBSpecies, pokemon) rescue nil # cname = getConstantName(PBSpecies, pokemon) rescue nil
cname = GameData::Species.get(pokemon).id.to_s cname = GameData::Species.get(pokemon).id.to_s
return pokemon if pokemon <= NB_POKEMON return pokemon if pokemon <= NB_POKEMON
return pokemon if cname == nil return pokemon if cname == nil

View File

@@ -116,7 +116,7 @@ def pbCheckPokemonIconFiles(speciesNum,egg=false, dna=false)
end end
def convertSpeciesSymbolToDexNumber(species) def getDexNumberForSpecies(species)
return species if species.is_a?(Integer) return species if species.is_a?(Integer)
if species.is_a?(Symbol) if species.is_a?(Symbol)
dexNum = GameData::Species.get(species).id_number dexNum = GameData::Species.get(species).id_number
@@ -158,13 +158,13 @@ def getRandomCustomFusion(returnRandomPokemonIfNoneFound=true,customPokeList=[],
end end
def getBodyID(species) def getBodyID(species)
dexNum = convertSpeciesSymbolToDexNumber(species) dexNum = getDexNumberForSpecies(species)
return (dexNum / NB_POKEMON).round return (dexNum / NB_POKEMON).round
end end
def getHeadID(species, bodyId) def getHeadID(species, bodyId)
head_dexNum = convertSpeciesSymbolToDexNumber(species) head_dexNum = getDexNumberForSpecies(species)
body_dexNum = convertSpeciesSymbolToDexNumber(bodyId) body_dexNum = getDexNumberForSpecies(bodyId)
calculated_number = (head_dexNum - (body_dexNum * NB_POKEMON)).round calculated_number = (head_dexNum - (body_dexNum * NB_POKEMON)).round
return calculated_number == 0 ? 420 : calculated_number return calculated_number == 0 ? 420 : calculated_number
end end

View File

@@ -788,9 +788,9 @@ def pbChooseAbility(poke, hidden1 = false, hidden2 = false)
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 hidden1 ? 4 : 0 return abID1#hidden1 ? 4 : 0
end end
return hidden2 ? 5 : 1 return abID2#hidden2 ? 5 : 1
end end
def pbChooseNature(species1_nature, species2_nature) def pbChooseNature(species1_nature, species2_nature)

View File

@@ -148,17 +148,15 @@ def getEvolution(species)
head = getBasePokemonID(species,false) head = getBasePokemonID(species,false)
ret_evoB = pbGetEvolvedFormData(body) ret_evoB = pbGetEvolvedFormData(body)
ret_evoH = pbGetEvolvedFormData(head) ret_evoH = pbGetEvolvedFormData(head)
evoBody = ret_evoB.any? ? ret_evoB[0][2] : -1 evoBody = ret_evoB.any? ? ret_evoB[0][2] : -1
evoHead = ret_evoH.any? ? ret_evoH[0][2] : -1 evoHead = ret_evoH.any? ? ret_evoH[0][2] : -1
return -1 if isNegativeOrNull(evoBody) && isNegativeOrNull(evoHead) return -1 if isNegativeOrNull(evoBody) && isNegativeOrNull(evoHead)
return body*Settings::NB_POKEMON+evoHead if isNegativeOrNull(evoBody) #only head evolves return body*Settings::NB_POKEMON+evoHead if isNegativeOrNull(evoBody) #only head evolves
return evoBody*Settings::NB_POKEMON + head if isNegativeOrNull(evoHead) #only body evolves return evoBody*Settings::NB_POKEMON + head if isNegativeOrNull(evoHead) #only body evolves
return evoBody*Settings::NB_POKEMON+evoHead #both evolve return evoBody*Settings::NB_POKEMON+evoHead #both evolve
else else
evo = pbGetEvolvedFormData(species) evo = pbGetEvolvedFormData(species)
return evo.any? ? evo[0][2] : -1 return evo.any? ? getDexNumberForSpecies(evo[0][0]) : -1
end end
end end
@@ -169,25 +167,27 @@ def getFusionSpecies(body,head)
end end
# #
def evolveHead(species) def evolveHead(species)
if species <= Settings::NB_POKEMON species_id = getDexNumberForSpecies(species)
evo = getEvolution(species) if species_id <= Settings::NB_POKEMON
return evo == -1 ? species : evo evo = getEvolution(species_id)
return evo == -1 ? species_id : evo
end end
head = getBasePokemonID(species,false) head = getBasePokemonID(species_id,false)
body = getBasePokemonID(species) body = getBasePokemonID(species_id)
headEvo = getEvolution(head) headEvo = getEvolution(head)
return headEvo == -1 ? species : getFusionSpecies(body,headEvo) return headEvo == -1 ? species_id : getFusionSpecies(body,headEvo)
end end
def evolveBody(species) def evolveBody(species)
if species <= Settings::NB_POKEMON species_id = getDexNumberForSpecies(species)
evo = getEvolution(species) if species_id <= Settings::NB_POKEMON
return evo == -1 ? species : evo evo = getEvolution(species_id)
return evo == -1 ? species_id : evo
end end
head = getBasePokemonID(species,false) head = getBasePokemonID(species_id,false)
body = getBasePokemonID(species) body = getBasePokemonID(species_id)
bodyEvo = getEvolution(body) bodyEvo = getEvolution(body)
return bodyEvo == -1 ? species : getFusionSpecies(bodyEvo,head) return bodyEvo == -1 ? species_id : getFusionSpecies(bodyEvo,head)
end end

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

@@ -107,7 +107,7 @@ Removed features that probably won't be coming back
############ KNOWN ISSUES ############## ############ KNOWN ISSUES ##############
- Some areas might have abnormal lag (please tell me in the discord if you find one that's unreasonably laggy) - Some areas might have abnormal lag - please tell me in the discord if you find one that's unreasonably laggy (you will know if you see one)
- Some side-stairs might act strange - Some side-stairs might act strange
- The Pokedex is currently all sorts of messed up - The Pokedex is currently all sorts of messed up
- Long loading time when starting up the game - Long loading time when starting up the game
@@ -116,4 +116,5 @@ Removed features that probably won't be coming back
- Significant stutter in the overworld when playing the game on an AMD CPU - Significant stutter in the overworld when playing the game on an AMD CPU
- Several custom items have not yet been reimplemented - Several custom items have not yet been reimplemented
- Some battle backgrounds might be missing - Some battle backgrounds might be missing
- Erika's backsprite uses's May's backsprite from RSE
- Some NPC trades likely to crash the game - Some NPC trades likely to crash the game