Wild spliced Pokemon generate shared movesets

This commit is contained in:
Flashfyre 2024-03-01 16:21:28 -05:00
parent 1f67e2d870
commit 32f4d69041
4 changed files with 9 additions and 9 deletions

View File

@ -1699,7 +1699,7 @@ export class EndureAttr extends ProtectAttr {
export class IgnoreAccuracyAttr extends AddBattlerTagAttr { export class IgnoreAccuracyAttr extends AddBattlerTagAttr {
constructor() { constructor() {
super(BattlerTagType.IGNORE_ACCURACY, true, false, 1); super(BattlerTagType.IGNORE_ACCURACY, true, false, 2);
} }
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {

View File

@ -207,7 +207,7 @@ export class EvolutionPhase extends Phase {
this.pokemon.evolve(this.evolution).then(() => { this.pokemon.evolve(this.evolution).then(() => {
const levelMoves = this.pokemon.getLevelMoves(this.lastLevel + 1, true); const levelMoves = this.pokemon.getLevelMoves(this.lastLevel + 1, true);
for (let lm of levelMoves) for (let lm of levelMoves)
this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.scene.getParty().indexOf(this.pokemon), lm)); this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.scene.getParty().indexOf(this.pokemon), lm[1]));
this.scene.unshiftPhase(new EndEvolutionPhase(this.scene)); this.scene.unshiftPhase(new EndEvolutionPhase(this.scene));
this.scene.playSound('shine'); this.scene.playSound('shine');

View File

@ -619,7 +619,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
getLearnableLevelMoves(): Moves[] { getLearnableLevelMoves(): Moves[] {
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); return this.getLevelMoves(1, true).map(lm => lm[1]).filter(lm => !this.moveset.filter(m => m.moveId === lm).length).filter((move: Moves, i: integer, array: Moves[]) => array.indexOf(move) === i);
} }
getTypes(includeTeraType = false, ignoreOverride?: boolean): Type[] { getTypes(includeTeraType = false, ignoreOverride?: boolean): Type[] {
@ -755,11 +755,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return null; return null;
} }
getLevelMoves(startingLevel?: integer, includeEvolutionMoves?: boolean): Moves[] { getLevelMoves(startingLevel?: integer, includeEvolutionMoves?: boolean): LevelMoves {
const ret: Moves[] = []; const ret: LevelMoves = [];
let levelMoves = this.getSpeciesForm().getLevelMoves(); let levelMoves = this.getSpeciesForm().getLevelMoves();
if (!startingLevel) if (!startingLevel)
startingLevel = this.level; startingLevel = this.level;
if (this.fusionSpecies) { if (this.fusionSpecies) {
const evolutionLevelMoves = levelMoves.slice(0, Math.max(levelMoves.findIndex(lm => !!lm[0]), 0)); const evolutionLevelMoves = levelMoves.slice(0, Math.max(levelMoves.findIndex(lm => !!lm[0]), 0));
const fusionLevelMoves = this.getFusionSpeciesForm().getLevelMoves(); const fusionLevelMoves = this.getFusionSpeciesForm().getLevelMoves();
@ -795,7 +795,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
continue; continue;
else if (level > this.level) else if (level > this.level)
break; break;
ret.push(lm[1]); ret.push(lm);
} }
} }
@ -884,7 +884,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
generateAndPopulateMoveset(): void { generateAndPopulateMoveset(): void {
this.moveset = []; this.moveset = [];
const movePool = []; const movePool = [];
const allLevelMoves = this.getSpeciesForm().getLevelMoves(); const allLevelMoves = this.getLevelMoves(1);
if (!allLevelMoves) { if (!allLevelMoves) {
console.log(this.species.speciesId, 'ERROR') console.log(this.species.speciesId, 'ERROR')
return; return;

View File

@ -3166,7 +3166,7 @@ export class LevelUpPhase extends PlayerPartyMemberPokemonPhase {
if (this.level <= 100) { if (this.level <= 100) {
const levelMoves = this.getPokemon().getLevelMoves(this.lastLevel + 1); const levelMoves = this.getPokemon().getLevelMoves(this.lastLevel + 1);
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[1]));
} }
if (!pokemon.pauseEvolutions) { if (!pokemon.pauseEvolutions) {
const evolution = pokemon.getEvolution(); const evolution = pokemon.getEvolution();