real fix to Fun and Games force switch issues

This commit is contained in:
ImperialSympathizer 2024-09-26 15:49:35 -04:00
parent a9645b80fc
commit 5ce9ab4855
2 changed files with 6 additions and 3 deletions

View File

@ -5290,6 +5290,11 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
return false; return false;
} }
if (!player && user.scene.currentBattle.battleType === BattleType.MYSTERY_ENCOUNTER && !user.scene.currentBattle.mysteryEncounter?.fleeAllowed) {
// Don't allow wild opponents to be force switched during MEs with flee disabled
return false;
}
const blockedByAbility = new Utils.BooleanHolder(false); const blockedByAbility = new Utils.BooleanHolder(false);
applyAbAttrs(ForceSwitchOutImmunityAbAttr, target, blockedByAbility); applyAbAttrs(ForceSwitchOutImmunityAbAttr, target, blockedByAbility);
return !blockedByAbility.value; return !blockedByAbility.value;

View File

@ -23,7 +23,6 @@ import { modifierTypes } from "#app/modifier/modifier-type";
import { Nature } from "#enums/nature"; import { Nature } from "#enums/nature";
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode";
import { isPokemonValidForEncounterOptionSelection } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; import { isPokemonValidForEncounterOptionSelection } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
import { Abilities } from "#enums/abilities";
/** the i18n namespace for the encounter */ /** the i18n namespace for the encounter */
const namespace = "mysteryEncounter:funAndGames"; const namespace = "mysteryEncounter:funAndGames";
@ -45,6 +44,7 @@ export const FunAndGamesEncounter: MysteryEncounter =
.withSkipEnemyBattleTurns(true) .withSkipEnemyBattleTurns(true)
// Will skip COMMAND selection menu and go straight to FIGHT (move select) menu // Will skip COMMAND selection menu and go straight to FIGHT (move select) menu
.withSkipToFightInput(true) .withSkipToFightInput(true)
.withFleeAllowed(false)
.withIntroSpriteConfigs([ .withIntroSpriteConfigs([
{ {
spriteKey: "fun_and_games_game", spriteKey: "fun_and_games_game",
@ -202,8 +202,6 @@ async function summonPlayerPokemon(scene: BattleScene) {
wobbuffet.setAlpha(0); wobbuffet.setAlpha(0);
wobbuffet.setVisible(false); wobbuffet.setVisible(false);
wobbuffet.calculateStats(); wobbuffet.calculateStats();
// Workaround to Roar/Dragon Tail/etc.
wobbuffet.mysteryEncounterPokemonData.passive = Abilities.SUCTION_CUPS;
scene.currentBattle.enemyParty[0] = wobbuffet; scene.currentBattle.enemyParty[0] = wobbuffet;
scene.gameData.setPokemonSeen(wobbuffet, true); scene.gameData.setPokemonSeen(wobbuffet, true);
await wobbuffet.loadAssets(); await wobbuffet.loadAssets();