mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-25 00:39:27 +02:00
Merge branch 'main' into french-me-hotfix
This commit is contained in:
commit
6baf568606
@ -5226,6 +5226,9 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||||||
*/
|
*/
|
||||||
const switchOutTarget = this.selfSwitch ? user : target;
|
const switchOutTarget = this.selfSwitch ? user : target;
|
||||||
if (switchOutTarget instanceof PlayerPokemon) {
|
if (switchOutTarget instanceof PlayerPokemon) {
|
||||||
|
if (switchOutTarget.scene.getParty().filter((p) => p.isAllowedInBattle() && !p.isOnField()).length < 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
switchOutTarget.leaveField(this.switchType === SwitchType.SWITCH);
|
switchOutTarget.leaveField(this.switchType === SwitchType.SWITCH);
|
||||||
|
|
||||||
if (switchOutTarget.hp > 0) {
|
if (switchOutTarget.hp > 0) {
|
||||||
@ -5234,6 +5237,9 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else if (user.scene.currentBattle.battleType !== BattleType.WILD) {
|
} else if (user.scene.currentBattle.battleType !== BattleType.WILD) {
|
||||||
|
if (switchOutTarget.scene.getEnemyParty().filter((p) => p.isAllowedInBattle() && !p.isOnField()).length < 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Switch out logic for trainer battles
|
// Switch out logic for trainer battles
|
||||||
switchOutTarget.leaveField(this.switchType === SwitchType.SWITCH);
|
switchOutTarget.leaveField(this.switchType === SwitchType.SWITCH);
|
||||||
|
|
||||||
@ -5244,6 +5250,9 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||||||
false, false), MoveEndPhase);
|
false, false), MoveEndPhase);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (switchOutTarget.isBoss()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Switch out logic for everything else (eg: WILD battles)
|
// Switch out logic for everything else (eg: WILD battles)
|
||||||
switchOutTarget.leaveField(false);
|
switchOutTarget.leaveField(false);
|
||||||
|
|
||||||
|
@ -558,6 +558,10 @@ function onGameOver(scene: BattleScene) {
|
|||||||
// Revert BGM
|
// Revert BGM
|
||||||
scene.playBgm(scene.arena.bgm);
|
scene.playBgm(scene.arena.bgm);
|
||||||
|
|
||||||
|
// Clear any leftover battle phases
|
||||||
|
scene.clearPhaseQueue();
|
||||||
|
scene.clearPhaseQueueSplice();
|
||||||
|
|
||||||
// Return enemy Pokemon
|
// Return enemy Pokemon
|
||||||
const pokemon = scene.getEnemyPokemon();
|
const pokemon = scene.getEnemyPokemon();
|
||||||
if (pokemon) {
|
if (pokemon) {
|
||||||
|
@ -25,6 +25,7 @@ import { GameOverPhase } from "#app/phases/game-over-phase";
|
|||||||
import { SwitchPhase } from "#app/phases/switch-phase";
|
import { SwitchPhase } from "#app/phases/switch-phase";
|
||||||
import { SeenEncounterData } from "#app/data/mystery-encounters/mystery-encounter-save-data";
|
import { SeenEncounterData } from "#app/data/mystery-encounters/mystery-encounter-save-data";
|
||||||
import { SwitchType } from "#enums/switch-type";
|
import { SwitchType } from "#enums/switch-type";
|
||||||
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will handle (in order):
|
* Will handle (in order):
|
||||||
@ -218,9 +219,17 @@ export class MysteryEncounterBattleStartCleanupPhase extends Phase {
|
|||||||
start() {
|
start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
|
// Lapse any residual flinches/endures but ignore all other turn-end battle tags
|
||||||
|
const includedLapseTags = [BattlerTagType.FLINCHED, BattlerTagType.ENDURING];
|
||||||
const field = this.scene.getField(true).filter(p => p.summonData);
|
const field = this.scene.getField(true).filter(p => p.summonData);
|
||||||
field.forEach(pokemon => {
|
field.forEach(pokemon => {
|
||||||
pokemon.lapseTags(BattlerTagLapseType.TURN_END);
|
const tags = pokemon.summonData.tags;
|
||||||
|
tags.filter(t => includedLapseTags.includes(t.tagType)
|
||||||
|
&& t.lapseTypes.includes(BattlerTagLapseType.TURN_END)
|
||||||
|
&& !(t.lapse(pokemon, BattlerTagLapseType.TURN_END))).forEach(t => {
|
||||||
|
t.onRemove(pokemon);
|
||||||
|
tags.splice(tags.indexOf(t), 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Remove any status tick phases
|
// Remove any status tick phases
|
||||||
|
Loading…
Reference in New Issue
Block a user