Power Trick Interaction with transfer summon & changeForm

This commit is contained in:
cadi 2024-06-28 18:38:03 +09:00
parent 8becfdfc4e
commit 8a5a8ebd2c

View File

@ -2247,6 +2247,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (this instanceof PlayerPokemon && source.summonData.battleStats.find(bs => bs === 6)) { if (this instanceof PlayerPokemon && source.summonData.battleStats.find(bs => bs === 6)) {
this.scene.validateAchv(achvs.TRANSFER_MAX_BATTLE_STAT); this.scene.validateAchv(achvs.TRANSFER_MAX_BATTLE_STAT);
} }
if (this.getTag(BattlerTagType.POWER_TRICK)) {
[this.stats[Stat.ATK], this.stats[Stat.DEF]] = [this.stats[Stat.DEF], this.stats[Stat.ATK]];
}
this.updateInfo(); this.updateInfo();
} }
@ -2292,6 +2297,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.loadAssets().then(() => { this.loadAssets().then(() => {
this.calculateStats(); this.calculateStats();
this.scene.updateModifiers(this.isPlayer(), true); this.scene.updateModifiers(this.isPlayer(), true);
if (this.getTag(BattlerTagType.POWER_TRICK)) {
[this.stats[Stat.ATK], this.stats[Stat.DEF]] = [this.stats[Stat.DEF], this.stats[Stat.ATK]];
}
Promise.all([ this.updateInfo(), this.scene.updateFieldScale() ]).then(() => resolve()); Promise.all([ this.updateInfo(), this.scene.updateFieldScale() ]).then(() => resolve());
}); });
}); });
@ -3303,6 +3313,11 @@ export class PlayerPokemon extends Pokemon {
this.loadAssets().then(() => { this.loadAssets().then(() => {
this.calculateStats(); this.calculateStats();
this.scene.updateModifiers(true, true); this.scene.updateModifiers(true, true);
if (this.getTag(BattlerTagType.POWER_TRICK)) {
[this.stats[Stat.ATK], this.stats[Stat.DEF]] = [this.stats[Stat.DEF], this.stats[Stat.ATK]];
}
this.updateInfo(true).then(() => resolve()); this.updateInfo(true).then(() => resolve());
}); });
}; };