[Misc] Removed cases of a ? true : false and useless super calls from subclasses (#5943)

* Removed cases of `if (a) {return true}' return false`

* Removed useless `super.xyz` calls from functions

* Fixde missing issur

* Use early return in `Pokemon#isOffsetBySubstitute`

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Bertie690 2025-06-06 20:00:09 -04:00 committed by GitHub
parent 3ca11e83a6
commit 88e4ab978b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 50 additions and 161 deletions

View File

@ -3566,21 +3566,18 @@ export default class BattleScene extends SceneBase {
gameMode: this.currentBattle ? this.gameMode.getName() : "Title", gameMode: this.currentBattle ? this.gameMode.getName() : "Title",
biome: this.currentBattle ? getBiomeName(this.arena.biomeType) : "", biome: this.currentBattle ? getBiomeName(this.arena.biomeType) : "",
wave: this.currentBattle?.waveIndex ?? 0, wave: this.currentBattle?.waveIndex ?? 0,
party: this.party party:
? this.party.map(p => { this.party?.map(p => ({
return { name: p.name,
name: p.name, form: p.getFormKey(),
form: p.getFormKey(), types: p.getTypes().map(type => PokemonType[type]),
types: p.getTypes().map(type => PokemonType[type]), teraType: PokemonType[p.getTeraType()],
teraType: PokemonType[p.getTeraType()], isTerastallized: p.isTerastallized,
isTerastallized: p.isTerastallized, level: p.level,
level: p.level, currentHP: p.hp,
currentHP: p.hp, maxHP: p.getMaxHp(),
maxHP: p.getMaxHp(), status: p.status?.effect ? StatusEffect[p.status.effect] : "",
status: p.status?.effect ? StatusEffect[p.status.effect] : "", })) ?? [], // TODO: review if this can be nullish
};
})
: [],
modeChain: this.ui?.getModeChain() ?? [], modeChain: this.ui?.getModeChain() ?? [],
}; };
(window as any).gameInfo = gameInfo; (window as any).gameInfo = gameInfo;
@ -3963,16 +3960,13 @@ export default class BattleScene extends SceneBase {
if (previousEncounter !== null && encounterType === previousEncounter) { if (previousEncounter !== null && encounterType === previousEncounter) {
return false; return false;
} }
if ( return !(
this.mysteryEncounterSaveData.encounteredEvents.length > 0 && this.mysteryEncounterSaveData.encounteredEvents.length > 0 &&
encounterCandidate.maxAllowedEncounters && encounterCandidate.maxAllowedEncounters &&
encounterCandidate.maxAllowedEncounters > 0 && encounterCandidate.maxAllowedEncounters > 0 &&
this.mysteryEncounterSaveData.encounteredEvents.filter(e => e.type === encounterType).length >= this.mysteryEncounterSaveData.encounteredEvents.filter(e => e.type === encounterType).length >=
encounterCandidate.maxAllowedEncounters encounterCandidate.maxAllowedEncounters
) { );
return false;
}
return true;
}) })
.map(m => allMysteryEncounters[m]); .map(m => allMysteryEncounters[m]);
// Decrement tier // Decrement tier

View File

@ -197,10 +197,7 @@ export function canIAssignThisKey(config, key) {
export function canIOverrideThisSetting(config, settingName) { export function canIOverrideThisSetting(config, settingName) {
const key = getKeyWithSettingName(config, settingName); const key = getKeyWithSettingName(config, settingName);
// || isTheLatestBind(config, settingName) no longer needed since action and cancel are protected // || isTheLatestBind(config, settingName) no longer needed since action and cancel are protected
if (config.blacklist?.includes(key)) { return !config.blacklist?.includes(key);
return false;
}
return true;
} }
export function canIDeleteThisKey(config, key) { export function canIDeleteThisKey(config, key) {

View File

@ -1246,7 +1246,7 @@ export class MoveTypeChangeAbAttr extends PreAttackAbAttr {
/** /**
* Determine if the move type change attribute can be applied * Determine if the move type change attribute can be applied
* *
* Can be applied if: * Can be applied if:
* - The ability's condition is met, e.g. pixilate only boosts normal moves, * - The ability's condition is met, e.g. pixilate only boosts normal moves,
* - The move is not forbidden from having its type changed by an ability, e.g. {@linkcode MoveId.MULTI_ATTACK} * - The move is not forbidden from having its type changed by an ability, e.g. {@linkcode MoveId.MULTI_ATTACK}
@ -1262,7 +1262,7 @@ export class MoveTypeChangeAbAttr extends PreAttackAbAttr {
*/ */
override canApplyPreAttack(pokemon: Pokemon, _passive: boolean, _simulated: boolean, _defender: Pokemon | null, move: Move, _args: [NumberHolder?, NumberHolder?, ...any]): boolean { override canApplyPreAttack(pokemon: Pokemon, _passive: boolean, _simulated: boolean, _defender: Pokemon | null, move: Move, _args: [NumberHolder?, NumberHolder?, ...any]): boolean {
return (!this.condition || this.condition(pokemon, _defender, move)) && return (!this.condition || this.condition(pokemon, _defender, move)) &&
!noAbilityTypeOverrideMoves.has(move.id) && !noAbilityTypeOverrideMoves.has(move.id) &&
(!pokemon.isTerastallized || (!pokemon.isTerastallized ||
(move.id !== MoveId.TERA_BLAST && (move.id !== MoveId.TERA_BLAST &&
(move.id !== MoveId.TERA_STARSTORM || pokemon.getTeraType() !== PokemonType.STELLAR || !pokemon.hasSpecies(SpeciesId.TERAPAGOS)))); (move.id !== MoveId.TERA_STARSTORM || pokemon.getTeraType() !== PokemonType.STELLAR || !pokemon.hasSpecies(SpeciesId.TERAPAGOS))));
@ -2653,11 +2653,7 @@ export class PostSummonCopyAllyStatsAbAttr extends PostSummonAbAttr {
} }
const ally = pokemon.getAlly(); const ally = pokemon.getAlly();
if (isNullOrUndefined(ally) || ally.getStatStages().every(s => s === 0)) { return !(isNullOrUndefined(ally) || ally.getStatStages().every(s => s === 0));
return false;
}
return true;
} }
override applyPostSummon(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): void { override applyPostSummon(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): void {
@ -2723,11 +2719,7 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
} }
// transforming from or into fusion pokemon causes various problems (including crashes and save corruption) // transforming from or into fusion pokemon causes various problems (including crashes and save corruption)
if (this.getTarget(targets).fusionSpecies || pokemon.fusionSpecies) { return !(this.getTarget(targets).fusionSpecies || pokemon.fusionSpecies);
return false;
}
return true;
} }
override applyPostSummon(pokemon: Pokemon, _passive: boolean, simulated: boolean, _args: any[]): void { override applyPostSummon(pokemon: Pokemon, _passive: boolean, simulated: boolean, _args: any[]): void {
@ -3544,10 +3536,7 @@ export class BlockStatusDamageAbAttr extends AbAttr {
} }
override canApply(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { override canApply(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean {
if (pokemon.status && this.effects.includes(pokemon.status.effect)) { return !!pokemon.status?.effect && this.effects.includes(pokemon.status.effect);
return true;
}
return false;
} }
/** /**
@ -4803,11 +4792,7 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
const diedToDirectDamage = move !== undefined && attacker !== undefined && move.doesFlagEffectApply({flag: MoveFlags.MAKES_CONTACT, user: attacker, target: pokemon}); const diedToDirectDamage = move !== undefined && attacker !== undefined && move.doesFlagEffectApply({flag: MoveFlags.MAKES_CONTACT, user: attacker, target: pokemon});
const cancelled = new BooleanHolder(false); const cancelled = new BooleanHolder(false);
globalScene.getField(true).map(p => applyAbAttrs(FieldPreventExplosiveMovesAbAttr, p, cancelled, simulated)); globalScene.getField(true).map(p => applyAbAttrs(FieldPreventExplosiveMovesAbAttr, p, cancelled, simulated));
if (!diedToDirectDamage || cancelled.value || attacker!.hasAbilityWithAttr(BlockNonDirectDamageAbAttr)) { return !(!diedToDirectDamage || cancelled.value || attacker!.hasAbilityWithAttr(BlockNonDirectDamageAbAttr));
return false;
}
return true;
} }
override applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): void { override applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): void {
@ -6508,12 +6493,7 @@ export function initAbilities() {
new Ability(AbilityId.INTIMIDATE, 3) new Ability(AbilityId.INTIMIDATE, 3)
.attr(PostSummonStatStageChangeAbAttr, [ Stat.ATK ], -1, false, true), .attr(PostSummonStatStageChangeAbAttr, [ Stat.ATK ], -1, false, true),
new Ability(AbilityId.SHADOW_TAG, 3) new Ability(AbilityId.SHADOW_TAG, 3)
.attr(ArenaTrapAbAttr, (user, target) => { .attr(ArenaTrapAbAttr, (_user, target) => !target.hasAbility(AbilityId.SHADOW_TAG)),
if (target.hasAbility(AbilityId.SHADOW_TAG)) {
return false;
}
return true;
}),
new Ability(AbilityId.ROUGH_SKIN, 3) new Ability(AbilityId.ROUGH_SKIN, 3)
.attr(PostDefendContactDamageAbAttr, 8) .attr(PostDefendContactDamageAbAttr, 8)
.bypassFaint(), .bypassFaint(),
@ -6573,10 +6553,7 @@ export function initAbilities() {
.ignorable(), .ignorable(),
new Ability(AbilityId.MAGNET_PULL, 3) new Ability(AbilityId.MAGNET_PULL, 3)
.attr(ArenaTrapAbAttr, (user, target) => { .attr(ArenaTrapAbAttr, (user, target) => {
if (target.getTypes(true).includes(PokemonType.STEEL) || (target.getTypes(true).includes(PokemonType.STELLAR) && target.getTypes().includes(PokemonType.STEEL))) { return target.getTypes(true).includes(PokemonType.STEEL) || (target.getTypes(true).includes(PokemonType.STELLAR) && target.getTypes().includes(PokemonType.STEEL));
return true;
}
return false;
}), }),
new Ability(AbilityId.SOUNDPROOF, 3) new Ability(AbilityId.SOUNDPROOF, 3)
.attr(MoveImmunityAbAttr, (pokemon, attacker, move) => pokemon !== attacker && move.hasFlag(MoveFlags.SOUND_BASED)) .attr(MoveImmunityAbAttr, (pokemon, attacker, move) => pokemon !== attacker && move.hasFlag(MoveFlags.SOUND_BASED))
@ -6654,12 +6631,7 @@ export function initAbilities() {
.attr(PostSummonWeatherChangeAbAttr, WeatherType.SUNNY) .attr(PostSummonWeatherChangeAbAttr, WeatherType.SUNNY)
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SUNNY), .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SUNNY),
new Ability(AbilityId.ARENA_TRAP, 3) new Ability(AbilityId.ARENA_TRAP, 3)
.attr(ArenaTrapAbAttr, (user, target) => { .attr(ArenaTrapAbAttr, (user, target) => target.isGrounded())
if (target.isGrounded()) {
return true;
}
return false;
})
.attr(DoubleBattleChanceAbAttr), .attr(DoubleBattleChanceAbAttr),
new Ability(AbilityId.VITAL_SPIRIT, 3) new Ability(AbilityId.VITAL_SPIRIT, 3)
.attr(StatusEffectImmunityAbAttr, StatusEffect.SLEEP) .attr(StatusEffectImmunityAbAttr, StatusEffect.SLEEP)

View File

@ -1203,10 +1203,7 @@ export class EncoreTag extends MoveRestrictionBattlerTag {
override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
if (lapseType === BattlerTagLapseType.CUSTOM) { if (lapseType === BattlerTagLapseType.CUSTOM) {
const encoredMove = pokemon.getMoveset().find(m => m.moveId === this.moveId); const encoredMove = pokemon.getMoveset().find(m => m.moveId === this.moveId);
if (encoredMove && encoredMove?.getPpRatio() > 0) { return !isNullOrUndefined(encoredMove) && encoredMove.getPpRatio() > 0;
return true;
}
return false;
} }
return super.lapse(pokemon, lapseType); return super.lapse(pokemon, lapseType);
} }
@ -1218,10 +1215,7 @@ export class EncoreTag extends MoveRestrictionBattlerTag {
* @returns `true` if the move does not match with the moveId stored and as a result, restricted * @returns `true` if the move does not match with the moveId stored and as a result, restricted
*/ */
override isMoveRestricted(move: MoveId, _user?: Pokemon): boolean { override isMoveRestricted(move: MoveId, _user?: Pokemon): boolean {
if (move !== this.moveId) { return move !== this.moveId;
return true;
}
return false;
} }
override selectionDeniedText(_pokemon: Pokemon, move: MoveId): string { override selectionDeniedText(_pokemon: Pokemon, move: MoveId): string {
@ -2768,10 +2762,7 @@ export class HealBlockTag extends MoveRestrictionBattlerTag {
* @returns `true` if the move has a TRIAGE_MOVE flag and is a status move * @returns `true` if the move has a TRIAGE_MOVE flag and is a status move
*/ */
override isMoveRestricted(move: MoveId): boolean { override isMoveRestricted(move: MoveId): boolean {
if (allMoves[move].hasFlag(MoveFlags.TRIAGE_MOVE) && allMoves[move].category === MoveCategory.STATUS) { return allMoves[move].hasFlag(MoveFlags.TRIAGE_MOVE) && allMoves[move].category === MoveCategory.STATUS;
return true;
}
return false;
} }
/** /**
@ -2785,10 +2776,7 @@ export class HealBlockTag extends MoveRestrictionBattlerTag {
override isMoveTargetRestricted(move: MoveId, user: Pokemon, target: Pokemon) { override isMoveTargetRestricted(move: MoveId, user: Pokemon, target: Pokemon) {
const moveCategory = new NumberHolder(allMoves[move].category); const moveCategory = new NumberHolder(allMoves[move].category);
applyMoveAttrs(StatusCategoryOnAllyAttr, user, target, allMoves[move], moveCategory); applyMoveAttrs(StatusCategoryOnAllyAttr, user, target, allMoves[move], moveCategory);
if (allMoves[move].hasAttr(HealOnAllyAttr) && moveCategory.value === MoveCategory.STATUS) { return allMoves[move].hasAttr(HealOnAllyAttr) && moveCategory.value === MoveCategory.STATUS;
return true;
}
return false;
} }
/** /**
@ -3126,10 +3114,7 @@ export class TormentTag extends MoveRestrictionBattlerTag {
const moveObj = allMoves[lastMove.move]; const moveObj = allMoves[lastMove.move];
const isUnaffected = moveObj.hasAttr(ConsecutiveUseDoublePowerAttr) || user.getTag(BattlerTagType.FRENZY); const isUnaffected = moveObj.hasAttr(ConsecutiveUseDoublePowerAttr) || user.getTag(BattlerTagType.FRENZY);
const validLastMoveResult = lastMove.result === MoveResult.SUCCESS || lastMove.result === MoveResult.MISS; const validLastMoveResult = lastMove.result === MoveResult.SUCCESS || lastMove.result === MoveResult.MISS;
if (lastMove.move === move && validLastMoveResult && lastMove.move !== MoveId.STRUGGLE && !isUnaffected) { return lastMove.move === move && validLastMoveResult && lastMove.move !== MoveId.STRUGGLE && !isUnaffected;
return true;
}
return false;
} }
override selectionDeniedText(pokemon: Pokemon, _move: MoveId): string { override selectionDeniedText(pokemon: Pokemon, _move: MoveId): string {

View File

@ -5472,13 +5472,6 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
this.failOnOverlap = !!failOnOverlap; this.failOnOverlap = !!failOnOverlap;
} }
canApply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!super.canApply(user, target, move, args)) {
return false;
}
return true;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!super.apply(user, target, move, args)) { if (!super.apply(user, target, move, args)) {
return false; return false;
@ -6832,7 +6825,7 @@ export class RandomMovesetMoveAttr extends CallMoveAttr {
return false; return false;
} }
this.moveId = moves[user.randBattleSeedInt(moves.length)]!.moveId; this.moveId = moves[user.randBattleSeedInt(moves.length)].moveId;
return true; return true;
}; };
} }
@ -7367,11 +7360,7 @@ export class SketchAttr extends MoveEffectAttr {
return false; return false;
} }
if (user.getMoveset().find(m => m.moveId === targetMove.move)) { return !user.getMoveset().some(m => m.moveId === targetMove.move);
return false;
}
return true;
}; };
} }
} }

View File

@ -275,15 +275,11 @@ export class TimeOfDayRequirement extends EncounterSceneRequirement {
override meetsRequirement(): boolean { override meetsRequirement(): boolean {
const timeOfDay = globalScene.arena?.getTimeOfDay(); const timeOfDay = globalScene.arena?.getTimeOfDay();
if ( return !(
!isNullOrUndefined(timeOfDay) && !isNullOrUndefined(timeOfDay) &&
this.requiredTimeOfDay?.length > 0 && this.requiredTimeOfDay?.length > 0 &&
!this.requiredTimeOfDay.includes(timeOfDay) !this.requiredTimeOfDay.includes(timeOfDay)
) { );
return false;
}
return true;
} }
override getDialogueToken(_pokemon?: PlayerPokemon): [string, string] { override getDialogueToken(_pokemon?: PlayerPokemon): [string, string] {
@ -301,15 +297,11 @@ export class WeatherRequirement extends EncounterSceneRequirement {
override meetsRequirement(): boolean { override meetsRequirement(): boolean {
const currentWeather = globalScene.arena.weather?.weatherType; const currentWeather = globalScene.arena.weather?.weatherType;
if ( return !(
!isNullOrUndefined(currentWeather) && !isNullOrUndefined(currentWeather) &&
this.requiredWeather?.length > 0 && this.requiredWeather?.length > 0 &&
!this.requiredWeather.includes(currentWeather!) !this.requiredWeather.includes(currentWeather!)
) { );
return false;
}
return true;
} }
override getDialogueToken(_pokemon?: PlayerPokemon): [string, string] { override getDialogueToken(_pokemon?: PlayerPokemon): [string, string] {
@ -803,7 +795,7 @@ export class CanFormChangeWithItemRequirement extends EncounterPokemonRequiremen
} }
filterByForm(pokemon, formChangeItem) { filterByForm(pokemon, formChangeItem) {
if ( return (
pokemonFormChanges.hasOwnProperty(pokemon.species.speciesId) && pokemonFormChanges.hasOwnProperty(pokemon.species.speciesId) &&
// Get all form changes for this species with an item trigger, including any compound triggers // Get all form changes for this species with an item trigger, including any compound triggers
pokemonFormChanges[pokemon.species.speciesId] pokemonFormChanges[pokemon.species.speciesId]
@ -812,10 +804,7 @@ export class CanFormChangeWithItemRequirement extends EncounterPokemonRequiremen
.flatMap(fc => fc.findTrigger(SpeciesFormChangeItemTrigger) as SpeciesFormChangeItemTrigger) .flatMap(fc => fc.findTrigger(SpeciesFormChangeItemTrigger) as SpeciesFormChangeItemTrigger)
.flatMap(fc => fc.item) .flatMap(fc => fc.item)
.includes(formChangeItem) .includes(formChangeItem)
) { );
return true;
}
return false;
} }
override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] { override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] {
@ -873,17 +862,15 @@ export class CanEvolveWithItemRequirement extends EncounterPokemonRequirement {
) { ) {
return true; return true;
} }
if (
return (
pokemon.isFusion() && pokemon.isFusion() &&
pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) && pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) &&
pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter( pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter(
e => e.item === evolutionItem && (!e.condition || e.condition.predicate(pokemon)), e => e.item === evolutionItem && (!e.condition || e.condition.predicate(pokemon)),
).length && ).length &&
pokemon.getFusionFormKey() !== SpeciesFormKey.GIGANTAMAX pokemon.getFusionFormKey() !== SpeciesFormKey.GIGANTAMAX
) { );
return true;
}
return false;
} }
override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] { override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] {

View File

@ -186,11 +186,7 @@ export class SpeciesFormChange {
} }
} }
if (!this.trigger.canChange(pokemon)) { return this.trigger.canChange(pokemon);
return false;
}
return true;
} }
findTrigger(triggerType: Constructor<SpeciesFormChangeTrigger>): SpeciesFormChangeTrigger | nil { findTrigger(triggerType: Constructor<SpeciesFormChangeTrigger>): SpeciesFormChangeTrigger | nil {

View File

@ -1281,10 +1281,6 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
}; };
} }
isObtainable() {
return super.isObtainable();
}
hasVariants() { hasVariants() {
let variantDataIndex: string | number = this.speciesId; let variantDataIndex: string | number = this.speciesId;
if (this.forms.length > 0) { if (this.forms.length > 0) {

View File

@ -1292,19 +1292,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
*/ */
isOffsetBySubstitute(): boolean { isOffsetBySubstitute(): boolean {
const substitute = this.getTag(SubstituteTag); const substitute = this.getTag(SubstituteTag);
if (substitute) { if (!substitute || substitute.sprite === undefined) {
if (substitute.sprite === undefined) { return false;
return false;
}
// During the Pokemon's MoveEffect phase, the offset is removed to put the Pokemon "in focus"
const currentPhase = globalScene.getCurrentPhase();
if (currentPhase?.is("MoveEffectPhase") && currentPhase.getPokemon() === this) {
return false;
}
return true;
} }
return false; // During the Pokemon's MoveEffect phase, the offset is removed to put the Pokemon "in focus"
const currentPhase = globalScene.getCurrentPhase();
return !(currentPhase?.is("MoveEffectPhase") && currentPhase.getPokemon() === this);
} }
/** If this Pokemon has a Substitute on the field, removes its sprite from the field. */ /** If this Pokemon has a Substitute on the field, removes its sprite from the field. */
@ -2241,10 +2234,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (this.getAbility(ignoreOverride).id === ability && (!canApply || this.canApplyAbility())) { if (this.getAbility(ignoreOverride).id === ability && (!canApply || this.canApplyAbility())) {
return true; return true;
} }
if (this.getPassiveAbility().id === ability && this.hasPassive() && (!canApply || this.canApplyAbility(true))) { return this.getPassiveAbility().id === ability && this.hasPassive() && (!canApply || this.canApplyAbility(true));
return true;
}
return false;
} }
/** /**
@ -2261,10 +2251,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if ((!canApply || this.canApplyAbility()) && this.getAbility(ignoreOverride).hasAttr(attrType)) { if ((!canApply || this.canApplyAbility()) && this.getAbility(ignoreOverride).hasAttr(attrType)) {
return true; return true;
} }
if (this.hasPassive() && (!canApply || this.canApplyAbility(true)) && this.getPassiveAbility().hasAttr(attrType)) { return this.hasPassive() && (!canApply || this.canApplyAbility(true)) && this.getPassiveAbility().hasAttr(attrType);
return true;
}
return false;
} }
/** /**
@ -5464,10 +5451,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if ((ownedAbilityAttrs & 2) > 0 && this.hasSameAbilityInRootForm(1)) { if ((ownedAbilityAttrs & 2) > 0 && this.hasSameAbilityInRootForm(1)) {
return true; return true;
} }
if ((ownedAbilityAttrs & 4) > 0 && this.hasSameAbilityInRootForm(2)) { return (ownedAbilityAttrs & 4) > 0 && this.hasSameAbilityInRootForm(2);
return true;
}
return false;
} }
/** /**

View File

@ -1090,10 +1090,6 @@ export class PokemonIncrementingStatModifier extends PokemonHeldItemModifier {
return new PokemonIncrementingStatModifier(this.type, this.pokemonId, this.stackCount); return new PokemonIncrementingStatModifier(this.type, this.pokemonId, this.stackCount);
} }
getArgs(): any[] {
return super.getArgs();
}
/** /**
* Checks if the {@linkcode PokemonIncrementingStatModifier} should be applied to the {@linkcode Pokemon}. * Checks if the {@linkcode PokemonIncrementingStatModifier} should be applied to the {@linkcode Pokemon}.
* @param pokemon The {@linkcode Pokemon} that holds the item * @param pokemon The {@linkcode Pokemon} that holds the item
@ -1216,10 +1212,6 @@ export class StatBoosterModifier extends PokemonHeldItemModifier {
* @see {@linkcode apply} * @see {@linkcode apply}
*/ */
export class EvolutionStatBoosterModifier extends StatBoosterModifier { export class EvolutionStatBoosterModifier extends StatBoosterModifier {
clone() {
return super.clone() as EvolutionStatBoosterModifier;
}
matchType(modifier: Modifier): boolean { matchType(modifier: Modifier): boolean {
return modifier instanceof EvolutionStatBoosterModifier; return modifier instanceof EvolutionStatBoosterModifier;
} }

View File

@ -21,8 +21,5 @@ export function hasExpSprite(key: string): boolean {
if (keyMatch[5]) { if (keyMatch[5]) {
k += keyMatch[5]; k += keyMatch[5];
} }
if (!expSpriteKeys.has(k)) { return expSpriteKeys.has(k);
return false;
}
return true;
} }