This commit is contained in:
Wlowscha 2025-08-16 16:26:12 +02:00 committed by GitHub
commit 248c526392
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -376,7 +376,6 @@ export class CommandPhase extends FieldPhase {
* - It is a trainer battle * - It is a trainer battle
* - The player is in the {@linkcode BiomeId.END | End} biome and * - The player is in the {@linkcode BiomeId.END | End} biome and
* - it is not classic mode; or * - it is not classic mode; or
* - the fresh start challenge is active; or
* - the player has not caught the target before and the player is still missing more than one starter * - the player has not caught the target before and the player is still missing more than one starter
* - The player is in a mystery encounter that disallows catching the pokemon * - The player is in a mystery encounter that disallows catching the pokemon
* @returns Whether a pokeball can be thrown * @returns Whether a pokeball can be thrown
@ -385,19 +384,27 @@ export class CommandPhase extends FieldPhase {
const { arena, currentBattle, gameData, gameMode } = globalScene; const { arena, currentBattle, gameData, gameMode } = globalScene;
const { battleType } = currentBattle; const { battleType } = currentBattle;
const { biomeType } = arena; const { biomeType } = arena;
const { isClassic } = gameMode; const { isClassic, isEndless, isDaily } = gameMode;
const { dexData } = gameData; const { dexData } = gameData;
const isClassicFinalBoss = globalScene.gameMode.isBattleClassicFinalBoss(globalScene.currentBattle.waveIndex);
const isEndlessMinorBoss = globalScene.gameMode.isEndlessMinorBoss(globalScene.currentBattle.waveIndex);
const someUncaughtSpeciesOnField = globalScene const someUncaughtSpeciesOnField = globalScene
.getEnemyField() .getEnemyField()
.some(p => p.isActive() && !dexData[p.species.speciesId].caughtAttr); .some(p => p.isActive() && !dexData[p.species.speciesId].caughtAttr);
const missingMultipleStarters = const missingMultipleStarters =
gameData.getStarterCount(d => !!d.caughtAttr) < Object.keys(speciesStarterCosts).length - 1; gameData.getStarterCount(d => !!d.caughtAttr) < Object.keys(speciesStarterCosts).length - 1;
if ( if (biomeType === BiomeId.END) {
biomeType === BiomeId.END && if ((isClassic && !isClassicFinalBoss && someUncaughtSpeciesOnField) || (isEndless && !isEndlessMinorBoss)) {
(!isClassic || gameMode.isFreshStartChallenge() || (someUncaughtSpeciesOnField && missingMultipleStarters)) // Uncatchable paradox mons in classic and endless
) { this.queueShowText("battle:noPokeballForce");
this.queueShowText("battle:noPokeballForce"); } else if ((isClassic && missingMultipleStarters) || (isEndless && isEndlessMinorBoss) || isDaily) {
// Uncatchable final boss in classic and endless
this.queueShowText("battle:noPokeballForceFinalBoss");
} else {
return true;
}
} else if (battleType === BattleType.TRAINER) { } else if (battleType === BattleType.TRAINER) {
this.queueShowText("battle:noPokeballTrainer"); this.queueShowText("battle:noPokeballTrainer");
} else if (currentBattle.isBattleMysteryEncounter() && !currentBattle.mysteryEncounter!.catchAllowed) { } else if (currentBattle.isBattleMysteryEncounter() && !currentBattle.mysteryEncounter!.catchAllowed) {
@ -429,6 +436,11 @@ export class CommandPhase extends FieldPhase {
return false; return false;
} }
// Restricts use of Master Ball against final boss in challenges
const restrictMasterBall =
globalScene.gameMode.isChallenge &&
globalScene.gameMode.isBattleClassicFinalBoss(globalScene.currentBattle.waveIndex);
const numBallTypes = 5; const numBallTypes = 5;
if (cursor < numBallTypes) { if (cursor < numBallTypes) {
const targetPokemon = globalScene.getEnemyPokemon(); const targetPokemon = globalScene.getEnemyPokemon();
@ -436,11 +448,16 @@ export class CommandPhase extends FieldPhase {
targetPokemon?.isBoss() && targetPokemon?.isBoss() &&
targetPokemon?.bossSegmentIndex >= 1 && targetPokemon?.bossSegmentIndex >= 1 &&
// TODO: Decouple this hardcoded exception for wonder guard and just check the target... // TODO: Decouple this hardcoded exception for wonder guard and just check the target...
!targetPokemon?.hasAbility(AbilityId.WONDER_GUARD, false, true) && !targetPokemon?.hasAbility(AbilityId.WONDER_GUARD, false, true)
cursor < PokeballType.MASTER_BALL
) { ) {
this.queueShowText("battle:noPokeballStrong"); if (restrictMasterBall) {
return false; this.queueShowText("battle:noPokeballStrongFinalBossCatchable");
return false;
}
if (cursor < PokeballType.MASTER_BALL) {
this.queueShowText("battle:noPokeballStrong");
return false;
}
} }
globalScene.currentBattle.turnCommands[this.fieldIndex] = { globalScene.currentBattle.turnCommands[this.fieldIndex] = {