mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
multitype ABILITY
This commit is contained in:
@@ -312,11 +312,17 @@ class Pokemon
|
|||||||
|
|
||||||
# @return [Symbol] this Pokémon's first type
|
# @return [Symbol] this Pokémon's first type
|
||||||
def type1
|
def type1
|
||||||
|
if @ability == :MULTITYPE && species_data.type1 == :NORMAL
|
||||||
|
return getHeldPlateType()
|
||||||
|
end
|
||||||
return species_data.type1
|
return species_data.type1
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [Symbol] this Pokémon's second type, or the first type if none is defined
|
# @return [Symbol] this Pokémon's second type, or the first type if none is defined
|
||||||
def type2
|
def type2
|
||||||
|
if @ability == :MULTITYPE && species_data.type2 == :NORMAL
|
||||||
|
return getHeldPlateType()
|
||||||
|
end
|
||||||
sp_data = species_data
|
sp_data = species_data
|
||||||
return sp_data.type2 || sp_data.type1
|
return sp_data.type2 || sp_data.type1
|
||||||
end
|
end
|
||||||
@@ -336,6 +342,10 @@ class Pokemon
|
|||||||
return self.types.include?(type)
|
return self.types.include?(type)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def getHeldPlateType()
|
||||||
|
return getArceusPlateType(@item)
|
||||||
|
end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Gender
|
# Gender
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|||||||
@@ -69,25 +69,24 @@ def CanLearnMove(pokemon, move)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbPokemonIconFile(pokemon)
|
def pbPokemonIconFile(pokemon)
|
||||||
bitmapFileName=pbCheckPokemonIconFiles(pokemon.species, pokemon.isEgg?)
|
bitmapFileName = pbCheckPokemonIconFiles(pokemon.species, pokemon.isEgg?)
|
||||||
return bitmapFileName
|
return bitmapFileName
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbCheckPokemonIconFiles(speciesNum,egg=false, dna=false)
|
def pbCheckPokemonIconFiles(speciesNum, egg = false, dna = false)
|
||||||
if egg
|
if egg
|
||||||
bitmapFileName=sprintf("Graphics/Icons/iconEgg")
|
bitmapFileName = sprintf("Graphics/Icons/iconEgg")
|
||||||
return pbResolveBitmap(bitmapFileName)
|
return pbResolveBitmap(bitmapFileName)
|
||||||
else
|
else
|
||||||
bitmapFileName=sprintf("Graphics/Icons/icon%03d",speciesNum)
|
bitmapFileName = sprintf("Graphics/Icons/icon%03d", speciesNum)
|
||||||
ret=pbResolveBitmap(bitmapFileName)
|
ret = pbResolveBitmap(bitmapFileName)
|
||||||
return ret if ret
|
return ret if ret
|
||||||
end
|
end
|
||||||
ret=pbResolveBitmap("Graphics/Icons/iconDNA.png")
|
ret = pbResolveBitmap("Graphics/Icons/iconDNA.png")
|
||||||
return ret if ret
|
return ret if ret
|
||||||
return pbResolveBitmap("Graphics/Icons/iconDNA.png")
|
return pbResolveBitmap("Graphics/Icons/iconDNA.png")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def getDexNumberForSpecies(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)
|
||||||
@@ -109,29 +108,29 @@ def dexNum(species)
|
|||||||
return getDexNumberForSpecies(species)
|
return getDexNumberForSpecies(species)
|
||||||
end
|
end
|
||||||
|
|
||||||
def getRandomCustomFusion(returnRandomPokemonIfNoneFound=true,customPokeList=[],maxPoke=-1,recursionLimit=3)
|
def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3)
|
||||||
if customPokeList.length==0
|
if customPokeList.length == 0
|
||||||
customPokeList = getCustomSpeciesList()
|
customPokeList = getCustomSpeciesList()
|
||||||
end
|
end
|
||||||
randPoke = []
|
randPoke = []
|
||||||
if customPokeList.length >= 5000
|
if customPokeList.length >= 5000
|
||||||
chosen=false
|
chosen = false
|
||||||
i=0 #loop pas plus que 3 fois pour pas lag
|
i = 0 #loop pas plus que 3 fois pour pas lag
|
||||||
while chosen == false
|
while chosen == false
|
||||||
fusedPoke = customPokeList[rand(customPokeList.length)]
|
fusedPoke = customPokeList[rand(customPokeList.length)]
|
||||||
poke1 = getBasePokemonID(fusedPoke,false)
|
poke1 = getBasePokemonID(fusedPoke, false)
|
||||||
poke2 = getBasePokemonID(fusedPoke,true)
|
poke2 = getBasePokemonID(fusedPoke, true)
|
||||||
|
|
||||||
if ((poke1 <= maxPoke && poke2 <= maxPoke) || i >= recursionLimit) || maxPoke == -1
|
if ((poke1 <= maxPoke && poke2 <= maxPoke) || i >= recursionLimit) || maxPoke == -1
|
||||||
randPoke << getBasePokemonID(fusedPoke,false)
|
randPoke << getBasePokemonID(fusedPoke, false)
|
||||||
randPoke << getBasePokemonID(fusedPoke,true)
|
randPoke << getBasePokemonID(fusedPoke, true)
|
||||||
chosen = true
|
chosen = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if returnRandomPokemonIfNoneFound
|
if returnRandomPokemonIfNoneFound
|
||||||
randPoke << rand(maxPoke)+1
|
randPoke << rand(maxPoke) + 1
|
||||||
randPoke << rand(maxPoke)+1
|
randPoke << rand(maxPoke) + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -180,7 +179,7 @@ def getAllNonLegendaryPokemon()
|
|||||||
end
|
end
|
||||||
|
|
||||||
def getPokemonEggGroups(species)
|
def getPokemonEggGroups(species)
|
||||||
return GameData::Species.get(species).egg_groups
|
return GameData::Species.get(species).egg_groups
|
||||||
end
|
end
|
||||||
|
|
||||||
def generateEggGroupTeam(eggGroup)
|
def generateEggGroupTeam(eggGroup)
|
||||||
@@ -204,8 +203,6 @@ def obtainBadgeMessage(badgeName)
|
|||||||
Kernel.pbMessage(_INTL("\\me[Badge get]{1} obtained the {2}!", $Trainer.name, badgeName))
|
Kernel.pbMessage(_INTL("\\me[Badge get]{1} obtained the {2}!", $Trainer.name, badgeName))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def getAllNonLegendaryPokemon()
|
def getAllNonLegendaryPokemon()
|
||||||
list = []
|
list = []
|
||||||
for i in 1..143
|
for i in 1..143
|
||||||
@@ -276,36 +273,35 @@ end
|
|||||||
|
|
||||||
def Kernel.setRocketPassword(variableNum)
|
def Kernel.setRocketPassword(variableNum)
|
||||||
abilityIndex = rand(233)
|
abilityIndex = rand(233)
|
||||||
speciesIndex =rand(PBSpecies.maxValue-1)
|
speciesIndex = rand(PBSpecies.maxValue - 1)
|
||||||
|
|
||||||
word1 = PBSpecies.getName(speciesIndex)
|
word1 = PBSpecies.getName(speciesIndex)
|
||||||
word2 = GameData::Ability.get(abilityIndex).name
|
word2 = GameData::Ability.get(abilityIndex).name
|
||||||
password = _INTL("{1}'s {2}",word1,word2)
|
password = _INTL("{1}'s {2}", word1, word2)
|
||||||
pbSet(variableNum,password)
|
pbSet(variableNum, password)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def getGenericPokemonCryText(pokemonSpecies)
|
def getGenericPokemonCryText(pokemonSpecies)
|
||||||
case pokemonSpecies
|
case pokemonSpecies
|
||||||
when 25
|
when 25
|
||||||
return "Pika!"
|
return "Pika!"
|
||||||
when 16,17,18,21,22,144,145,146,227,417,418,372 #birds
|
when 16, 17, 18, 21, 22, 144, 145, 146, 227, 417, 418, 372 #birds
|
||||||
return "Squawk!"
|
return "Squawk!"
|
||||||
when 163,164
|
when 163, 164
|
||||||
return "Hoot!" #owl
|
return "Hoot!" #owl
|
||||||
else
|
else
|
||||||
return "Guaugh!"
|
return "Guaugh!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def obtainPokemonSpritePath(id,includeCustoms=true)
|
def obtainPokemonSpritePath(id, includeCustoms = true)
|
||||||
head=getBasePokemonID(param.to_i,false)
|
head = getBasePokemonID(param.to_i, false)
|
||||||
body=getBasePokemonID(param.to_i,true)
|
body = getBasePokemonID(param.to_i, true)
|
||||||
return obtainPokemonSpritePath(body,head,includeCustoms)
|
return obtainPokemonSpritePath(body, head, includeCustoms)
|
||||||
end
|
end
|
||||||
|
|
||||||
def obtainPokemonSpritePath(bodyId, headId,include_customs=true)
|
def obtainPokemonSpritePath(bodyId, headId, include_customs = true)
|
||||||
hasCustom=false
|
hasCustom = false
|
||||||
picturePath = _INTL("Graphics/Battlers/{1}/{1}.{2}.png", headId, bodyId)
|
picturePath = _INTL("Graphics/Battlers/{1}/{1}.{2}.png", headId, bodyId)
|
||||||
|
|
||||||
if include_customs
|
if include_customs
|
||||||
@@ -318,5 +314,47 @@ def obtainPokemonSpritePath(bodyId, headId,include_customs=true)
|
|||||||
return picturePath
|
return picturePath
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def getArceusPlateType(heldItem)
|
||||||
|
return :NORMAL if heldItem == nil
|
||||||
|
case heldItem
|
||||||
|
when :FISTPLATE
|
||||||
|
return :FIGHTING
|
||||||
|
when :SKYPLATE
|
||||||
|
return :FLYING
|
||||||
|
when :TOXICPLATE
|
||||||
|
return :POISON
|
||||||
|
when :EARTHPLATE
|
||||||
|
return :GROUND
|
||||||
|
when :STONEPLATE
|
||||||
|
return :ROCK
|
||||||
|
when :INSECTPLATE
|
||||||
|
return :BUG
|
||||||
|
when :SPOOKYPLATE
|
||||||
|
return :GHOST
|
||||||
|
when :IRONPLATE
|
||||||
|
return :STEEL
|
||||||
|
when :FLAMEPLATE
|
||||||
|
return :FIRE
|
||||||
|
when :SPLASHPLATE
|
||||||
|
return :WATER
|
||||||
|
when :MEADOWPLATE
|
||||||
|
return :GRASS
|
||||||
|
when :ZAPPLATE
|
||||||
|
return :ELECTRIC
|
||||||
|
when :MINDPLATE
|
||||||
|
return :PSYCHIC
|
||||||
|
when :ICICLEPLATE
|
||||||
|
return :ICE
|
||||||
|
when :DRACOPLATE
|
||||||
|
return :DRAGON
|
||||||
|
when :DREADPLATE
|
||||||
|
return :DARK
|
||||||
|
when :PIXIEPLATE
|
||||||
|
return :FAIRY
|
||||||
|
else
|
||||||
|
return :NORMAL
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user