mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
Adjust tera blast's getTypesForItemSpawn method
This commit is contained in:
parent
6bc927a207
commit
002397bee6
@ -94,7 +94,7 @@ import i18next from "i18next";
|
||||
import { applyChallenges } from "#utils/challenge-utils";
|
||||
import { MovePhaseTimingModifier } from "#enums/move-phase-timing-modifier";
|
||||
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}.
|
||||
@ -5320,20 +5320,15 @@ export class TeraBlastTypeAttr extends VariableMoveTypeAttr {
|
||||
const coreType = move.type;
|
||||
const teraType = user.getTeraType();
|
||||
/** 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 (
|
||||
// tera type matches the move's type; no change
|
||||
teraType === coreType
|
||||
!hasTeraAccess
|
||||
|| teraType === coreType
|
||||
|| teraType === PokemonType.STELLAR
|
||||
|| teraType === PokemonType.UNKNOWN
|
||||
|| user.isMega()
|
||||
|| user.isMax()
|
||||
|| user.hasSpecies(SpeciesId.NECROZMA, "ultra")
|
||||
|| (!hasTeraAccess)
|
||||
) {
|
||||
return [coreType];
|
||||
} else {
|
||||
|
||||
}
|
||||
return [coreType, teraType];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user