mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-21 07:42:25 +02:00
Also no ultra necrozma
This commit is contained in:
parent
32483fcd0e
commit
5cf77ff2c3
@ -1226,12 +1226,17 @@ 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.
|
* 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 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
|
* @returns `true` if the pokemon is the species or is fused with it, `false` otherwise
|
||||||
*/
|
*/
|
||||||
hasSpecies(species: Species): boolean {
|
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.fusionSpecies?.speciesId === species;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return (this.species.speciesId === species && this.getFormKey() === formKey) || (this.fusionSpecies?.speciesId === species && this.getFusionFormKey() === formKey);
|
||||||
|
}
|
||||||
|
|
||||||
abstract isBoss(): boolean;
|
abstract isBoss(): boolean;
|
||||||
|
|
||||||
getMoveset(ignoreOverride?: boolean): (PokemonMove | null)[] {
|
getMoveset(ignoreOverride?: boolean): (PokemonMove | null)[] {
|
||||||
|
@ -10,6 +10,7 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import { TerastallizeAccessModifier } from "#app/modifier/modifier";
|
import { TerastallizeAccessModifier } from "#app/modifier/modifier";
|
||||||
import { Type } from "#app/enums/type";
|
import { Type } from "#app/enums/type";
|
||||||
import { getTypeRgb } from "#app/data/type";
|
import { getTypeRgb } from "#app/data/type";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
|
||||||
export enum Command {
|
export enum Command {
|
||||||
FIGHT = 0,
|
FIGHT = 0,
|
||||||
@ -180,7 +181,8 @@ export default class CommandUiHandler extends UiHandler {
|
|||||||
|
|
||||||
canTera(): boolean {
|
canTera(): boolean {
|
||||||
const hasTeraMod = !!globalScene.getModifiers(TerastallizeAccessModifier).length;
|
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 currentTeras = globalScene.arena.playerTerasUsed;
|
||||||
const plannedTera = globalScene.currentBattle.preTurnCommands[0]?.command === Command.TERA && this.fieldIndex > 0 ? 1 : 0;
|
const plannedTera = globalScene.currentBattle.preTurnCommands[0]?.command === Command.TERA && this.fieldIndex > 0 ? 1 : 0;
|
||||||
return hasTeraMod && !isBlockedForm && (currentTeras + plannedTera) < 1;
|
return hasTeraMod && !isBlockedForm && (currentTeras + plannedTera) < 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user