mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Replace all usage of pbNewPkmn with Pokemon.new
This commit is contained in:
@@ -404,7 +404,7 @@ end
|
||||
#===============================================================================
|
||||
# Returns a Pokémon generated by a wild encounter, given its species and level.
|
||||
def pbGenerateWildPokemon(species,level,isRoamer=false)
|
||||
genwildpoke = pbNewPkmn(species,level)
|
||||
genwildpoke = Pokemon.new(species,level)
|
||||
# Give the wild Pokémon a held item
|
||||
items = genwildpoke.wildHoldItems
|
||||
firstPkmn = $Trainer.firstPokemon
|
||||
|
||||
@@ -205,7 +205,7 @@ def pbDayCareGenerateEgg
|
||||
getConst(PBSpecies,:ILLUMISE)][rand(2)]
|
||||
end
|
||||
# Generate egg
|
||||
egg = pbNewPkmn(babyspecies,EGG_LEVEL)
|
||||
egg = Pokemon.new(babyspecies,EGG_LEVEL)
|
||||
# Randomise personal ID
|
||||
pid = rand(65536)
|
||||
pid |= (rand(65536)<<16)
|
||||
|
||||
@@ -76,7 +76,7 @@ def pbLoadTrainer(trainerid,trainername,partyid=0)
|
||||
for poke in trainer[3]
|
||||
species = pbGetSpeciesFromFSpecies(poke[TPSPECIES])[0]
|
||||
level = poke[TPLEVEL]
|
||||
pokemon = pbNewPkmn(species,level,opponent,false)
|
||||
pokemon = Pokemon.new(species,level,opponent,false)
|
||||
if poke[TPFORM]
|
||||
pokemon.forcedForm = poke[TPFORM] if MultipleForms.hasFunction?(pokemon.species,"getForm")
|
||||
pokemon.formSimple = poke[TPFORM]
|
||||
|
||||
@@ -206,7 +206,7 @@ def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
||||
raise _INTL("Species does not exist ({1}).",newpoke) if !hasConst?(PBSpecies,newpoke)
|
||||
newpoke = getID(PBSpecies,newpoke)
|
||||
end
|
||||
yourPokemon = pbNewPkmn(newpoke,myPokemon.level,opponent)
|
||||
yourPokemon = Pokemon.new(newpoke,myPokemon.level,opponent)
|
||||
end
|
||||
yourPokemon.name = nickname
|
||||
yourPokemon.obtainMode = 2 # traded
|
||||
|
||||
@@ -212,14 +212,14 @@ class PurifyChamber # German: der Kryptorbis
|
||||
|
||||
def debugAddShadow(set,species)
|
||||
species=getID(PBSpecies,species)
|
||||
pkmn=pbNewPkmn(species,1)
|
||||
pkmn=Pokemon.new(species,1)
|
||||
pkmn.makeShadow
|
||||
setShadow(set,pkmn)
|
||||
end
|
||||
|
||||
def debugAddNormal(set,species)
|
||||
species=getID(PBSpecies,species)
|
||||
pkmn=pbNewPkmn(species,1)
|
||||
pkmn=Pokemon.new(species,1)
|
||||
insertAfter(set,setCount(set),pkmn)
|
||||
end
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class BugContestState
|
||||
if !enc
|
||||
raise _INTL("No encounters for map {1}, so can't judge contest",@contestMap)
|
||||
end
|
||||
pokemon=pbNewPkmn(enc[0],enc[1])
|
||||
pokemon=Pokemon.new(enc[0],enc[1])
|
||||
pokemon.hp=1+rand(pokemon.totalhp-1)
|
||||
score=pbBugContestScore(pokemon)
|
||||
judgearray.push([cont,pokemon.species,score])
|
||||
|
||||
@@ -159,7 +159,7 @@ class PBPokemon
|
||||
end
|
||||
|
||||
def createPokemon(level,iv,trainer)
|
||||
pokemon=pbNewPkmn(@species,level,trainer,false)
|
||||
pokemon=Pokemon.new(@species,level,trainer,false)
|
||||
pokemon.setItem(@item)
|
||||
pokemon.personalID=rand(65536)
|
||||
pokemon.personalID|=rand(65536)<<8
|
||||
|
||||
@@ -74,7 +74,7 @@ def pbAddPokemon(pokemon,level=nil,seeform=true)
|
||||
end
|
||||
pokemon = getID(PBSpecies,pokemon)
|
||||
if pokemon.is_a?(Integer) && level.is_a?(Integer)
|
||||
pokemon = pbNewPkmn(pokemon,level)
|
||||
pokemon = Pokemon.new(pokemon,level)
|
||||
end
|
||||
speciesname = PBSpecies.getName(pokemon.species)
|
||||
pbMessage(_INTL("\\me[Pkmn get]{1} obtained {2}!\1",$Trainer.name,speciesname))
|
||||
@@ -87,7 +87,7 @@ def pbAddPokemonSilent(pokemon,level=nil,seeform=true)
|
||||
return false if !pokemon || pbBoxesFull?
|
||||
pokemon = getID(PBSpecies,pokemon)
|
||||
if pokemon.is_a?(Integer) && level.is_a?(Integer)
|
||||
pokemon = pbNewPkmn(pokemon,level)
|
||||
pokemon = Pokemon.new(pokemon,level)
|
||||
end
|
||||
$Trainer.seen[pokemon.species] = true
|
||||
$Trainer.owned[pokemon.species] = true
|
||||
@@ -110,7 +110,7 @@ def pbAddToParty(pokemon,level=nil,seeform=true)
|
||||
return false if !pokemon || $Trainer.party.length>=6
|
||||
pokemon = getID(PBSpecies,pokemon)
|
||||
if pokemon.is_a?(Integer) && level.is_a?(Integer)
|
||||
pokemon = pbNewPkmn(pokemon,level)
|
||||
pokemon = Pokemon.new(pokemon,level)
|
||||
end
|
||||
speciesname = PBSpecies.getName(pokemon.species)
|
||||
pbMessage(_INTL("\\me[Pkmn get]{1} obtained {2}!\1",$Trainer.name,speciesname))
|
||||
@@ -123,7 +123,7 @@ def pbAddToPartySilent(pokemon,level=nil,seeform=true)
|
||||
return false if !pokemon || $Trainer.party.length>=6
|
||||
pokemon = getID(PBSpecies,pokemon)
|
||||
if pokemon.is_a?(Integer) && level.is_a?(Integer)
|
||||
pokemon = pbNewPkmn(pokemon,level)
|
||||
pokemon = Pokemon.new(pokemon,level)
|
||||
end
|
||||
$Trainer.seen[pokemon.species] = true
|
||||
$Trainer.owned[pokemon.species] = true
|
||||
@@ -137,7 +137,7 @@ def pbAddForeignPokemon(pokemon,level=nil,ownerName=nil,nickname=nil,ownerGender
|
||||
return false if !pokemon || $Trainer.party.length>=6
|
||||
pokemon = getID(PBSpecies,pokemon)
|
||||
if pokemon.is_a?(Integer) && level.is_a?(Integer)
|
||||
pokemon = pbNewPkmn(pokemon,level)
|
||||
pokemon = Pokemon.new(pokemon,level)
|
||||
end
|
||||
# Set original trainer to a foreign one (if ID isn't already foreign)
|
||||
if pokemon.trainerID==$Trainer.id
|
||||
@@ -165,7 +165,7 @@ def pbGenerateEgg(pokemon,text="")
|
||||
return false if !pokemon || $Trainer.party.length>=6
|
||||
pokemon = getID(PBSpecies,pokemon)
|
||||
if pokemon.is_a?(Integer)
|
||||
pokemon = pbNewPkmn(pokemon,EGG_LEVEL)
|
||||
pokemon = Pokemon.new(pokemon,EGG_LEVEL)
|
||||
end
|
||||
# Get egg steps
|
||||
eggSteps = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesStepsToHatch)
|
||||
|
||||
@@ -348,7 +348,7 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil)
|
||||
params.setCancelValue(0)
|
||||
level = pbMessageChooseNumber(_INTL("Set the wild {1}'s level.",PBSpecies.getName(species)),params)
|
||||
if level>0
|
||||
pkmn.push(pbNewPkmn(species,level))
|
||||
pkmn.push(Pokemon.new(species,level))
|
||||
end
|
||||
end
|
||||
else # Edit a Pokémon
|
||||
@@ -563,7 +563,7 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil)
|
||||
end
|
||||
cname = getConstantName(PBSpecies,i) rescue nil
|
||||
next if !cname
|
||||
pkmn = pbNewPkmn(i,50)
|
||||
pkmn = Pokemon.new(i,50)
|
||||
$PokemonStorage[(i-1)/$PokemonStorage.maxPokemon(0),
|
||||
(i-1)%$PokemonStorage.maxPokemon(0)] = pkmn
|
||||
# Record all forms of this Pokémon as seen and owned
|
||||
|
||||
@@ -527,7 +527,7 @@ def pbCreatePokemon
|
||||
for i in 0...party.length
|
||||
species = party[i]
|
||||
# Generate Pokémon with species and level 20
|
||||
$Trainer.party[i] = pbNewPkmn(species,20)
|
||||
$Trainer.party[i] = Pokemon.new(species,20)
|
||||
$Trainer.seen[species] = true # Set this species to seen and owned
|
||||
$Trainer.owned[species] = true
|
||||
pbSeenForm($Trainer.party[i])
|
||||
|
||||
Reference in New Issue
Block a user