Consolidated if statement regarding isTransformed

This commit is contained in:
jnotsknab 2025-06-20 02:32:13 -05:00
parent eab4f6e01f
commit e3ebeb9471
2 changed files with 9 additions and 7 deletions

View File

@ -3903,12 +3903,7 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
const targets = pokemon.getOpponents();
const target = this.getTarget(targets);
//Prevents Imposter from triggering on a transformed target or if the user is already transformed
if (pokemon?.isTransformed() || target?.isTransformed()) {
return false;
}
if (target?.summonData?.illusion) {
if (target?.summonData?.illusion || pokemon?.isTransformed() || target?.isTransformed()) {
return false;
}

View File

@ -43,7 +43,14 @@ import { WeatherType } from "#enums/weather-type";
* }
* ```
*/
const overrides = {} satisfies Partial<InstanceType<OverridesType>>;
const overrides = {
OPP_SPECIES_OVERRIDE: SpeciesId.DITTO,
OPP_MOVESET_OVERRIDE: MoveId.TRANSFORM,
OPP_ABILITY_OVERRIDE: AbilityId.IMPOSTER,
ABILITY_OVERRIDE: AbilityId.IMPOSTER,
STARTER_SPECIES_OVERRIDE: SpeciesId.MEW,
MOVESET_OVERRIDE: MoveId.TRANSFORM,
} satisfies Partial<InstanceType<OverridesType>>;
/**
* If you need to add Overrides values for local testing do that inside {@linkcode overrides}