Update moveset generation logic
parent
f87dbcbac3
commit
b9805ceabf
|
@ -932,17 +932,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (attackMovePool.length) {
|
if (attackMovePool.length) {
|
||||||
const moveIndex = Utils.randSeedInt(attackMovePool.length);
|
const randomAttackMove = Utils.randSeedWeightedItem(attackMovePool.reverse());
|
||||||
this.moveset.push(new PokemonMove(attackMovePool[moveIndex], 0, 0));
|
this.moveset.push(new PokemonMove(randomAttackMove, 0, 0));
|
||||||
console.log(allMoves[attackMovePool[moveIndex]]);
|
movePool.splice(movePool.findIndex(m => m === randomAttackMove), 1);
|
||||||
movePool.splice(movePool.findIndex(m => m === attackMovePool[moveIndex]), 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (movePool.length && this.moveset.length < 4) {
|
while (movePool.length && this.moveset.length < 4) {
|
||||||
const moveIndex = Utils.randSeedInt(movePool.length);
|
const randomMove = Utils.randSeedWeightedItem(movePool.reverse());
|
||||||
this.moveset.push(new PokemonMove(movePool[moveIndex], 0, 0));
|
this.moveset.push(new PokemonMove(randomMove, 0, 0));
|
||||||
console.log(allMoves[movePool[moveIndex]]);
|
console.log(allMoves[randomMove]);
|
||||||
movePool.splice(moveIndex, 1);
|
movePool.splice(movePool.indexOf(randomMove), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.scene.triggerPokemonFormChange(this, SpeciesFormChangeMoveLearnedTrigger);
|
this.scene.triggerPokemonFormChange(this, SpeciesFormChangeMoveLearnedTrigger);
|
||||||
|
|
Loading…
Reference in New Issue