Adjust tera blast's getTypesForItemSpawn method

This commit is contained in:
Sirz Benjie 2025-09-20 22:59:48 -05:00
parent 6bc927a207
commit 002397bee6
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -94,7 +94,7 @@ import i18next from "i18next";
import { applyChallenges } from "#utils/challenge-utils"; import { applyChallenges } from "#utils/challenge-utils";
import { MovePhaseTimingModifier } from "#enums/move-phase-timing-modifier"; import { MovePhaseTimingModifier } from "#enums/move-phase-timing-modifier";
import type { AbstractConstructor } from "#types/type-helpers"; import type { AbstractConstructor } from "#types/type-helpers";
import { willTerastallize } from "#utils/pokemon-utils"; import { canTerastallize, willTerastallize } from "#utils/pokemon-utils";
/** /**
* A function used to conditionally determine execution of a given {@linkcode MoveAttr}. * A function used to conditionally determine execution of a given {@linkcode MoveAttr}.
@ -5320,20 +5320,15 @@ export class TeraBlastTypeAttr extends VariableMoveTypeAttr {
const coreType = move.type; const coreType = move.type;
const teraType = user.getTeraType(); const teraType = user.getTeraType();
/** Whether the user is allowed to tera. In the case of an enemy Pokémon, whether it *will* tera. */ /** Whether the user is allowed to tera. In the case of an enemy Pokémon, whether it *will* tera. */
const hasTeraAccess = user.isPlayer() ? globalScene.findModifier(m => m.is("TerastallizeAccessModifier")) != null : willTerastallize(user); const hasTeraAccess = user.isPlayer() ? canTerastallize(user) : willTerastallize(user);
if ( if (
// tera type matches the move's type; no change // tera type matches the move's type; no change
teraType === coreType !hasTeraAccess
|| teraType === coreType
|| teraType === PokemonType.STELLAR || teraType === PokemonType.STELLAR
|| teraType === PokemonType.UNKNOWN || teraType === PokemonType.UNKNOWN
|| user.isMega()
|| user.isMax()
|| user.hasSpecies(SpeciesId.NECROZMA, "ultra")
|| (!hasTeraAccess)
) { ) {
return [coreType]; return [coreType];
} else {
} }
return [coreType, teraType]; return [coreType, teraType];
} }