Adds factory for Pokemon class

This commit is contained in:
infinitefusion
2023-08-05 11:03:37 -04:00
parent 178d61eec0
commit d304d223bd
33 changed files with 54 additions and 43 deletions

View File

@@ -549,7 +549,7 @@ def customTrainerBattle(trainerName, trainerType, party_array, default_level=50,
if pokemon.is_a?(Pokemon)
party << pokemon
elsif pokemon.is_a?(Symbol)
party << Pokemon.new(pokemon,default_level,trainer)
party << Pokemon.create(pokemon,default_level,trainer)
end
}
trainer.party=party

View File

@@ -394,7 +394,7 @@ end
# Applies wild Pokémon modifiers (wild held item, shiny chance modifiers,
# Pokérus, gender/nature forcing because of player's lead Pokémon).
def pbGenerateWildPokemon(species,level,isRoamer=false)
genwildpoke = Pokemon.new(species,level)
genwildpoke = Pokemon.create(species,level)
# Give the wild Pokémon a held item
items = genwildpoke.wildHoldItems
first_pkmn = $Trainer.first_pokemon

View File

@@ -186,7 +186,7 @@ def pbDayCareGenerateEgg
end
end
# Generate egg
egg = Pokemon.new(babyspecies, Settings::EGG_LEVEL)
egg = Pokemon.create(babyspecies, Settings::EGG_LEVEL)
# Randomise personal ID
pid = rand(65536)
pid |= (rand(65536)<<16)