Implemented new can't catch messages

This commit is contained in:
Wlowscha 2025-08-16 00:14:23 +02:00
parent 74f348a25e
commit bd3a49c888
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

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,25 @@ 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 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) {
@ -441,10 +446,13 @@ 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 || restrictMasterBall)
) { ) {
this.queueShowText("battle:noPokeballStrong"); if (restrictMasterBall) {
this.queueShowText("battle:noPokeballStrongFinalBossCatchable");
} else if (cursor < PokeballType.MASTER_BALL) {
this.queueShowText("battle:noPokeballStrong");
}
return false; return false;
} }