Add logic for evolution-only moves
parent
e2a6a93209
commit
79a2f4637c
|
@ -104,7 +104,7 @@ export class EvolutionPhase extends BattlePhase {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const levelMoves = pokemon.getLevelMoves(this.lastLevel + 1);
|
const levelMoves = pokemon.getLevelMoves(this.lastLevel + 1, true);
|
||||||
for (let lm of levelMoves)
|
for (let lm of levelMoves)
|
||||||
this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, lm));
|
this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, lm));
|
||||||
this.scene.unshiftPhase(new EndEvolutionPhase(this.scene));
|
this.scene.unshiftPhase(new EndEvolutionPhase(this.scene));
|
||||||
|
|
|
@ -524,7 +524,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
}
|
}
|
||||||
|
|
||||||
getLearnableLevelMoves(): Moves[] {
|
getLearnableLevelMoves(): Moves[] {
|
||||||
return this.getLevelMoves(1).filter(lm => !this.moveset.filter(m => m.moveId === lm).length).filter((move: Moves, i: integer, array: Moves[]) => array.indexOf(move) === i);
|
return this.getLevelMoves(1, true).filter(lm => !this.moveset.filter(m => m.moveId === lm).length).filter((move: Moves, i: integer, array: Moves[]) => array.indexOf(move) === i);
|
||||||
}
|
}
|
||||||
|
|
||||||
getTypes(ignoreOverride?: boolean): Type[] {
|
getTypes(ignoreOverride?: boolean): Type[] {
|
||||||
|
@ -614,7 +614,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
getLevelMoves(startingLevel?: integer): Moves[] {
|
getLevelMoves(startingLevel?: integer, includeEvolutionMoves?: boolean): Moves[] {
|
||||||
const ret: Moves[] = [];
|
const ret: Moves[] = [];
|
||||||
let levelMoves = this.getSpeciesForm().getLevelMoves();
|
let levelMoves = this.getSpeciesForm().getLevelMoves();
|
||||||
if (!startingLevel)
|
if (!startingLevel)
|
||||||
|
@ -626,7 +626,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
levelMoves.shift();
|
levelMoves.shift();
|
||||||
while (fusionLevelMoves.length && fusionLevelMoves[0][0] < startingLevel)
|
while (fusionLevelMoves.length && fusionLevelMoves[0][0] < startingLevel)
|
||||||
fusionLevelMoves.shift();
|
fusionLevelMoves.shift();
|
||||||
for (let l = startingLevel; l <= this.level; l++) {
|
for (let l = includeEvolutionMoves ? 0 : startingLevel; l <= this.level; l++) {
|
||||||
|
if (l === 1 && startingLevel > 1)
|
||||||
|
l = startingLevel;
|
||||||
while (levelMoves.length && levelMoves[0][0] === l) {
|
while (levelMoves.length && levelMoves[0][0] === l) {
|
||||||
const levelMove = levelMoves.shift();
|
const levelMove = levelMoves.shift();
|
||||||
if (!newLevelMoves.find(lm => lm[1] === levelMove[1]))
|
if (!newLevelMoves.find(lm => lm[1] === levelMove[1]))
|
||||||
|
|
Loading…
Reference in New Issue