Fix bug with generating moves before form

This commit is contained in:
Flashfyre 2023-12-26 12:01:56 -05:00
parent 40439817ac
commit e265c1961f
3 changed files with 6 additions and 5 deletions

View File

@ -3087,14 +3087,14 @@ export class AttemptRunPhase extends PokemonPhase {
onComplete: () => enemyField.forEach(enemyPokemon => enemyPokemon.destroy())
});
this.scene.clearEnemyHeldItemModifiers();
enemyField.forEach(enemyPokemon => {
enemyPokemon.hideInfo().then(() => enemyPokemon.destroy());
enemyPokemon.hp = 0;
enemyPokemon.trySetStatus(StatusEffect.FAINT);
});
this.scene.clearEnemyHeldItemModifiers();
this.scene.pushPhase(new BattleEndPhase(this.scene));
this.scene.pushPhase(new NewBattlePhase(this.scene));
} else

View File

@ -1423,7 +1423,8 @@ export default class BattleScene extends Phaser.Scene {
updatePartyForModifiers(party: Pokemon[], instant?: boolean): Promise<void> {
return new Promise(resolve => {
Promise.allSettled(party.map(p => {
p.calculateStats();
if (p.scene)
p.calculateStats();
return p.updateInfo(instant);
})).then(() => resolve());
});

View File

@ -132,8 +132,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.fusionShiny = dataSource.fusionShiny;
this.fusionGender = dataSource.fusionGender;
} else {
this.generateAndPopulateMoveset();
this.id = Utils.randSeedInt(4294967295);
this.ivs = ivs || [
Utils.binToDec(Utils.decToBin(this.id).substring(0, 5)),
@ -167,6 +165,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (scene.gameMode === GameMode.SPLICED_ENDLESS)
this.generateFusionSpecies();
this.generateAndPopulateMoveset();
}
this.generateName();