diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 09a1e962cf0..53d4b6c54d2 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1226,10 +1226,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { /** * Checks if the {@linkcode Pokemon} has is the specified {@linkcode Species} or is fused with it. * @param species the pokemon {@linkcode Species} to check + * @param formKey If provided, requires the species to be in that form * @returns `true` if the pokemon is the species or is fused with it, `false` otherwise */ - hasSpecies(species: Species): boolean { - return this.species.speciesId === species || this.fusionSpecies?.speciesId === species; + hasSpecies(species: Species, formKey?: string): boolean { + if (Utils.isNullOrUndefined(formKey)) { + return this.species.speciesId === species || this.fusionSpecies?.speciesId === species; + } + + return (this.species.speciesId === species && this.getFormKey() === formKey) || (this.fusionSpecies?.speciesId === species && this.getFusionFormKey() === formKey); } abstract isBoss(): boolean; diff --git a/src/ui/command-ui-handler.ts b/src/ui/command-ui-handler.ts index 5eb5588a9bf..20cffbbe30a 100644 --- a/src/ui/command-ui-handler.ts +++ b/src/ui/command-ui-handler.ts @@ -10,6 +10,7 @@ import { globalScene } from "#app/global-scene"; import { TerastallizeAccessModifier } from "#app/modifier/modifier"; import { Type } from "#app/enums/type"; import { getTypeRgb } from "#app/data/type"; +import { Species } from "#enums/species"; export enum Command { FIGHT = 0, @@ -180,7 +181,8 @@ export default class CommandUiHandler extends UiHandler { canTera(): boolean { const hasTeraMod = !!globalScene.getModifiers(TerastallizeAccessModifier).length; - const isBlockedForm = globalScene.getField()[this.fieldIndex].isMega() || globalScene.getField()[this.fieldIndex].isMax(); + const activePokemon = globalScene.getField()[this.fieldIndex]; + const isBlockedForm = activePokemon.isMega() || activePokemon.isMax() || activePokemon.hasSpecies(Species.NECROZMA, "ultra"); const currentTeras = globalScene.arena.playerTerasUsed; const plannedTera = globalScene.currentBattle.preTurnCommands[0]?.command === Command.TERA && this.fieldIndex > 0 ? 1 : 0; return hasTeraMod && !isBlockedForm && (currentTeras + plannedTera) < 1;