Block catching bosses in nuzlockes

This commit is contained in:
Wlowscha 2025-08-15 20:06:35 +02:00
parent 19af9bdb8b
commit 8250879324
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -22,7 +22,7 @@ import type { MoveTargetSet } from "#moves/move";
import { getMoveTargets } from "#moves/move-utils"; import { getMoveTargets } from "#moves/move-utils";
import { FieldPhase } from "#phases/field-phase"; import { FieldPhase } from "#phases/field-phase";
import type { TurnMove } from "#types/turn-move"; import type { TurnMove } from "#types/turn-move";
import { applyChallenges } from "#utils/challenge-utils"; import { applyChallenges, isNuzlockeChallenge } from "#utils/challenge-utils";
import { BooleanHolder } from "#utils/common"; import { BooleanHolder } from "#utils/common";
import i18next from "i18next"; import i18next from "i18next";
@ -429,6 +429,8 @@ export class CommandPhase extends FieldPhase {
return false; return false;
} }
const restrictMasterBall = isNuzlockeChallenge();
const numBallTypes = 5; const numBallTypes = 5;
if (cursor < numBallTypes) { if (cursor < numBallTypes) {
const targetPokemon = globalScene.getEnemyPokemon(); const targetPokemon = globalScene.getEnemyPokemon();
@ -437,7 +439,7 @@ export class CommandPhase extends FieldPhase {
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 (cursor < PokeballType.MASTER_BALL || restrictMasterBall)
) { ) {
this.queueShowText("battle:noPokeballStrong"); this.queueShowText("battle:noPokeballStrong");
return false; return false;