Skip to content

Commit

Permalink
Fix bug in moveset code (pagefaultgames#735)
Browse files Browse the repository at this point in the history
Pokemon with very limited movepools could sometimes generate with no moves
  • Loading branch information
Xavion3 authored May 11, 2024
1 parent 168869d commit d24762b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/field/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
}

while (movePool.length > 1 && this.moveset.length < 4) {
while (baseWeights.length > this.moveset.length && this.moveset.length < 4) {
if (this.hasTrainer()) {
// Sqrt the weight of any damaging moves with overlapping types. This is about a 0.05 - 0.1 multiplier.
// Other damaging moves 2x weight if 0-1 damaging moves, 0.5x if 2, 0.125x if 3. These weights double if STAB.
Expand Down

0 comments on commit d24762b

Please sign in to comment.