more fixes for consistency

This commit is contained in:
PrabbyDD 2024-10-17 15:47:39 -07:00
parent 667ca3283d
commit 0a98aa56f6
3 changed files with 7 additions and 7 deletions

View File

@ -3596,8 +3596,10 @@ export class PostTurnStatStageChangeAbAttr extends PostTurnAbAttr {
if (!simulated) { if (!simulated) {
if (!pokemon.hasAbility(Abilities.SPEED_BOOST)) { if (!pokemon.hasAbility(Abilities.SPEED_BOOST)) {
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages));
this.showAbility = true;
} else if (pokemon.hasAbility(Abilities.SPEED_BOOST) && !pokemon.turnData.switchedInThisTurn && !pokemon.turnData.failedRunAway) { } else if (pokemon.hasAbility(Abilities.SPEED_BOOST) && !pokemon.turnData.switchedInThisTurn && !pokemon.turnData.failedRunAway) {
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages));
this.showAbility = true;
} else { } else {
this.showAbility = false; this.showAbility = false;
} }

View File

@ -238,10 +238,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
this.scene.unshiftPhase(new ShinySparklePhase(this.scene, pokemon.getBattlerIndex())); this.scene.unshiftPhase(new ShinySparklePhase(this.scene, pokemon.getBattlerIndex()));
} }
/** Switch in status is set before the pokemon is summoned and the new turn begins, so it is preserved from switch-summon-phase */
const switchedInStatus = pokemon.turnData?.switchedInThisTurn;
pokemon.resetTurnData(); pokemon.resetTurnData();
pokemon.turnData.switchedInThisTurn = switchedInStatus;
if (!this.loaded || [ BattleType.TRAINER, BattleType.MYSTERY_ENCOUNTER ].includes(this.scene.currentBattle.battleType) || (this.scene.currentBattle.waveIndex % 10) === 1) { if (!this.loaded || [ BattleType.TRAINER, BattleType.MYSTERY_ENCOUNTER ].includes(this.scene.currentBattle.battleType) || (this.scene.currentBattle.waveIndex % 10) === 1) {
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);

View File

@ -105,10 +105,6 @@ export class SwitchSummonPhase extends SummonPhase {
const party = this.player ? this.getParty() : this.scene.getEnemyParty(); const party = this.player ? this.getParty() : this.scene.getEnemyParty();
const switchedInPokemon = party[this.slotIndex]; const switchedInPokemon = party[this.slotIndex];
this.lastPokemon = this.getPokemon(); this.lastPokemon = this.getPokemon();
if (this.switchType !== SwitchType.INITIAL_SWITCH) {
switchedInPokemon.resetTurnData();
switchedInPokemon.turnData.switchedInThisTurn = true;
}
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, this.lastPokemon); applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, this.lastPokemon);
if (this.switchType === SwitchType.BATON_PASS && switchedInPokemon) { if (this.switchType === SwitchType.BATON_PASS && switchedInPokemon) {
(this.player ? this.scene.getEnemyField() : this.scene.getPlayerField()).forEach(enemyPokemon => enemyPokemon.transferTagsBySourceId(this.lastPokemon.id, switchedInPokemon.id)); (this.player ? this.scene.getEnemyField() : this.scene.getPlayerField()).forEach(enemyPokemon => enemyPokemon.transferTagsBySourceId(this.lastPokemon.id, switchedInPokemon.id));
@ -189,6 +185,11 @@ export class SwitchSummonPhase extends SummonPhase {
} }
} }
if (this.switchType !== SwitchType.INITIAL_SWITCH) {
pokemon.resetTurnData();
pokemon.turnData.switchedInThisTurn = true;
}
this.lastPokemon?.resetSummonData(); this.lastPokemon?.resetSummonData();
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);