mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-26 02:02:20 +02:00
Using leaveField(true) so that stat changes are correctly applied by Baton Pass
This commit is contained in:
parent
abee0a696f
commit
f2d7bcb29f
@ -146,7 +146,8 @@ export class SwitchSummonPhase extends SummonPhase {
|
|||||||
} else {
|
} else {
|
||||||
switchedInPokemon.resetSummonData();
|
switchedInPokemon.resetSummonData();
|
||||||
}
|
}
|
||||||
this.lastPokemon.leaveField();
|
// We cannot clear stat changes yet because they are applied after the new mon is summoned
|
||||||
|
this.lastPokemon.leaveField(this.switchType === SwitchType.BATON_PASS || this.switchType === SwitchType.SHED_TAIL ? false : true);
|
||||||
this.summon();
|
this.summon();
|
||||||
};
|
};
|
||||||
if (this.player) {
|
if (this.player) {
|
||||||
@ -184,11 +185,13 @@ export class SwitchSummonPhase extends SummonPhase {
|
|||||||
|
|
||||||
if (this.switchType === SwitchType.BATON_PASS && pokemon) {
|
if (this.switchType === SwitchType.BATON_PASS && pokemon) {
|
||||||
pokemon.transferSummon(this.lastPokemon);
|
pokemon.transferSummon(this.lastPokemon);
|
||||||
|
this.lastPokemon.resetSummonData();
|
||||||
} else if (this.switchType === SwitchType.SHED_TAIL && pokemon) {
|
} else if (this.switchType === SwitchType.SHED_TAIL && pokemon) {
|
||||||
const subTag = this.lastPokemon.getTag(SubstituteTag);
|
const subTag = this.lastPokemon.getTag(SubstituteTag);
|
||||||
if (subTag) {
|
if (subTag) {
|
||||||
pokemon.summonData.tags.push(subTag);
|
pokemon.summonData.tags.push(subTag);
|
||||||
}
|
}
|
||||||
|
this.lastPokemon.resetSummonData();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.switchType !== SwitchType.INITIAL_SWITCH) {
|
if (this.switchType !== SwitchType.INITIAL_SWITCH) {
|
||||||
|
Loading…
Reference in New Issue
Block a user