Skip to content

Commit

Permalink
Fixing that double trainer pokemon are not based on level (they shoul…
Browse files Browse the repository at this point in the history
…d now evolve/devolve based on level)
  • Loading branch information
CodeTappert committed May 29, 2024
1 parent afdb433 commit 599cc23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/field/trainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,17 @@ export default class Trainer extends Phaser.GameObjects.Container {
}

// If useNewSpeciesPool is true, we need to generate a new species from the new species pool, otherwise we generate a random species
const species = useNewSpeciesPool
let species = useNewSpeciesPool
? getPokemonSpecies(newSpeciesPool[Math.floor(Math.random() * newSpeciesPool.length)])
: template.isSameSpecies(index) && index > offset
? getPokemonSpecies(battle.enemyParty[offset].species.getTrainerSpeciesForLevel(level, false, template.getStrength(offset)))
: this.genNewPartyMemberSpecies(level, strength);

// If the species is from newSpeciesPool, we need to adjust it based on the level and strength
if (newSpeciesPool) {
species = getPokemonSpecies(species.getSpeciesForLevel(level, true, true, strength));
}

ret = this.scene.addEnemyPokemon(species, level, !this.isDouble() || !(index % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER);
}, this.config.hasStaticParty ? this.config.getDerivedType() + ((index + 1) << 8) : this.scene.currentBattle.waveIndex + (this.config.getDerivedType() << 10) + (((!this.config.useSameSeedForAllMembers ? index : 0) + 1) << 8));

Expand Down

0 comments on commit 599cc23

Please sign in to comment.