Misc. Changes

This commit is contained in:
xsn34kzx 2025-08-01 12:12:16 -04:00
parent 5c2c7cf3d1
commit 809a981893
4 changed files with 14 additions and 14 deletions

View File

@ -124,7 +124,7 @@ export abstract class Move implements Localizable {
/** /**
* Check if the move is of the given subclass without requiring `instanceof`. * Check if the move is of the given subclass without requiring `instanceof`.
* *
* ! Does _not_ work for {@linkcode ChargingAttackMove} and {@linkcode ChargingSelfStatusMove} subclasses. For those, * Does _not_ work for {@linkcode ChargingAttackMove} and {@linkcode ChargingSelfStatusMove} subclasses. For those,
* use {@linkcode isChargingMove} instead. * use {@linkcode isChargingMove} instead.
* *
* @param moveKind - The string name of the move to check against * @param moveKind - The string name of the move to check against

View File

@ -1,9 +1,7 @@
import { allMoves } from "#data/data-lists"; import { allMoves } from "#data/data-lists";
import { ChallengeType } from "#enums/challenge-type";
import type { MoveId } from "#enums/move-id"; import type { MoveId } from "#enums/move-id";
import type { Pokemon } from "#field/pokemon"; import type { Pokemon } from "#field/pokemon";
import type { Move } from "#moves/move"; import type { Move } from "#moves/move";
import { applyChallenges } from "#utils/challenge-utils";
import { toDmgValue } from "#utils/common"; import { toDmgValue } from "#utils/common";
/** /**
@ -47,12 +45,14 @@ export class PokemonMove {
* @returns Whether this {@linkcode PokemonMove} can be selected by this Pokemon. * @returns Whether this {@linkcode PokemonMove} can be selected by this Pokemon.
*/ */
isUsable(pokemon: Pokemon, ignorePp = false, ignoreRestrictionTags = false): boolean { isUsable(pokemon: Pokemon, ignorePp = false, ignoreRestrictionTags = false): boolean {
const move = this.getMove();
// TODO: Add Sky Drop's 1 turn stall // TODO: Add Sky Drop's 1 turn stall
return ( return (
!(this.moveId && !ignoreRestrictionTags && pokemon.isMoveRestricted(this.moveId, pokemon)) && !(this.moveId && !ignoreRestrictionTags && pokemon.isMoveRestricted(this.moveId, pokemon)) &&
(ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1) && (ignorePp || this.ppUsed < this.getMovePp() || move.pp === -1) &&
(!pokemon.isPlayer() || applyChallenges(ChallengeType.POKEMON_MOVE, this.moveId)) && // TODO: Fix apply calls
!this.getMove().name.endsWith(" (N)") //(!pokemon.isPlayer() || applyChallenges(ChallengeType.POKEMON_MOVE, this.moveId)) &&
!move.name.endsWith(" (N)")
); );
} }

View File

@ -213,24 +213,24 @@ export class CommandPhase extends FieldPhase {
globalScene.ui.setMode(UiMode.MESSAGE); globalScene.ui.setMode(UiMode.MESSAGE);
// Set the translation key for why the move cannot be selected // Set the translation key for why the move cannot be selected
let cannotUseKey: string; let cannotSelectKey: string;
if (user.isMoveRestricted(move.moveId, user)) { if (user.isMoveRestricted(move.moveId, user)) {
cannotUseKey = user.getRestrictingTag(move.moveId, user)!.selectionDeniedText(user, move.moveId); cannotSelectKey = user.getRestrictingTag(move.moveId, user)!.selectionDeniedText(user, move.moveId);
} else if (move.getPpRatio() === 0) { } else if (move.getPpRatio() === 0) {
cannotUseKey = "battle:moveNoPP"; cannotSelectKey = "battle:moveNoPP";
} else if (!applyChallenges(ChallengeType.POKEMON_MOVE, move.moveId)) { } else if (!applyChallenges(ChallengeType.POKEMON_MOVE, move.moveId)) {
cannotUseKey = "battle:moveCannotUseChallenge"; cannotSelectKey = "battle:moveCannotUseChallenge";
} else if (move.getName().endsWith(" (N)")) { } else if (move.getName().endsWith(" (N)")) {
cannotUseKey = "battle:moveNotImplemented"; cannotSelectKey = "battle:moveNotImplemented";
} else { } else {
// TODO: Consider a message that signals a being unusable for an unknown reason // TODO: Consider a message that signals a being unusable for an unknown reason
cannotUseKey = ""; cannotSelectKey = "";
} }
const moveName = move.getName().replace(" (N)", ""); // Trims off the indicator const moveName = move.getName().replace(" (N)", ""); // Trims off the indicator
globalScene.ui.showText( globalScene.ui.showText(
i18next.t(cannotUseKey, { moveName: moveName }), i18next.t(cannotSelectKey, { moveName: moveName }),
null, null,
() => { () => {
globalScene.ui.clearText(); globalScene.ui.clearText();

View File

@ -65,7 +65,7 @@ export class VictoryPhase extends PokemonPhase {
break; break;
} }
} }
if (globalScene.currentBattle.waveIndex % 10 !== 0 || !applyChallenges(ChallengeType.PARTY_HEAL)) { if (globalScene.currentBattle.waveIndex % 10 || !applyChallenges(ChallengeType.PARTY_HEAL)) {
globalScene.phaseManager.pushNew( globalScene.phaseManager.pushNew(
"SelectModifierPhase", "SelectModifierPhase",
undefined, undefined,