diff --git a/src/data/ability.ts b/src/data/ability.ts index 6e977372137..b4215b683cd 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1790,7 +1790,7 @@ export class BattlerTagImmunityAbAttr extends PreApplyBattlerTagAbAttr { } getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { - return getPokemonMessage(pokemon, `'s ${abilityName}\nprevents ${(args[0] as BattlerTag).getDescriptor()}!`); + return getPokemonMessage(pokemon, `'s ${abilityName}\nprevents ${(args[0] as BattlerTag)[0].getDescriptor()}!`); } } @@ -3450,6 +3450,7 @@ export function initAbilities() { .attr(PostSummonMessageAbAttr, (pokemon: Pokemon) => getPokemonMessage(pokemon, ' is radiating a bursting aura!')) .attr(MoveAbilityBypassAbAttr), new Ability(Abilities.AROMA_VEIL, 6) + .attr(BattlerTagImmunityAbAttr, BattlerTagType.TORMENT) .ignorable() .partial(), new Ability(Abilities.FLOWER_VEIL, 6) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 152a23f43ce..1950d933cf8 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -496,13 +496,11 @@ export class TormentTag extends BattlerTag { super(BattlerTagType.TORMENT, BattlerTagLapseType.TURN_END, -1, Moves.TORMENT); } - // redundant due to TormentAttr (MoveEffectAttr) performing these checks before adding the tag - canAdd(pokemon: Pokemon): boolean { - const hasAromaVeil = (pokemon.getAbility().id === Abilities.AROMA_VEIL) || (pokemon.getPassiveAbility().id === Abilities.AROMA_VEIL); - return !hasAromaVeil && !pokemon.isMax(); + canAdd(pokemon: Pokemon) { + return !pokemon.isMax(); } - onAdd(pokemon: Pokemon): void { + onAdd(pokemon: Pokemon) { pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' was subjected to torment!')); } @@ -510,6 +508,10 @@ export class TormentTag extends BattlerTag { pokemon.summonData.tormented = true; return true; } + + getDescriptor(): string { + return 'torment'; + } } export class HelpingHandTag extends BattlerTag { diff --git a/src/data/move.ts b/src/data/move.ts index 309256e3012..8db1e0975f2 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -3274,56 +3274,6 @@ export class DisableMoveAttr extends MoveEffectAttr { } } -export class TormentAttr extends MoveEffectAttr { - constructor() { - super(false); - } - - canApply(user: Pokemon, target: Pokemon, move: Move, args: any[]) { - const hasAromaVeil = (target.getAbility().id === Abilities.AROMA_VEIL) || (target.getPassiveAbility().id === Abilities.AROMA_VEIL); - return super.canApply(user, target, move, args) && !hasAromaVeil && !target.isMax(); - } - - apply(user: Pokemon, target: Pokemon, move: Move, args: any[]) { - const ret = this.canApply(user, target, move, args); - const hasAromaVeil = (target.getAbility().id === Abilities.AROMA_VEIL); - const hasAromaVeilPassive = (target.getPassiveAbility().id === Abilities.AROMA_VEIL) - - if (ret) { - target.addTag(BattlerTagType.TORMENT); - } else if (hasAromaVeil || hasAromaVeilPassive) { - target.scene.abilityBar.showAbility(target, hasAromaVeilPassive); - target.scene.queueMessage(getPokemonMessage(target, ' is protected by an aromatic veil!')); - } - - return ret; - } - - // modified from disable, score of -5 is target is not already tormented - getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { - const isTormented = target.summonData.tormented && (target.findTag(t => t instanceof TormentTag) !== undefined); - return isTormented ? 0 : -5; - } -} - -export class TauntAttr extends MoveEffectAttr { - constructor() { - super(false); - } - - apply(user: Pokemon, target: Pokemon, move: Move, args: any[]) { - const ret = this.canApply(user, target, move, args); - - if (ret) { - target.summonData.justTaunted = true; - target.summonData.taunted = true; - target.summonData.tauntedTurns = 4; - user.scene.queueMessage(getPokemonMessage(target, ' fell for the taunt!')); - } - return ret; - } -} - export class FrenzyAttr extends MoveEffectAttr { constructor() { super(true, MoveEffectTrigger.HIT); @@ -3382,7 +3332,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr { const chance = this.getTagChance(user, target, move); if (chance < 0 || chance === 100 || user.randSeedInt(100) < chance) - return (this.selfTarget ? user : target).addTag(this.tagType, user.randSeedInt(this.turnCountMax - this.turnCountMin, this.turnCountMin), move.id, user.id); + return (this.selfTarget ? user : target).addTag(this.tagType, user.randSeedInt(this.turnCountMax - this.turnCountMin, this.turnCountMin), move.id, user.id); return false; } @@ -3408,6 +3358,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr { case BattlerTagType.NIGHTMARE: case BattlerTagType.DROWSY: case BattlerTagType.NO_CRIT: + case BattlerTagType.TORMENT: return -5; case BattlerTagType.SEEDED: case BattlerTagType.SALT_CURED: @@ -5510,8 +5461,9 @@ export function initMoves() { .attr(WeatherChangeAttr, WeatherType.HAIL) .target(MoveTarget.BOTH_SIDES), new StatusMove(Moves.TORMENT, Type.DARK, 100, 15, -1, 0, 3) - .attr(TormentAttr) + .attr(AddBattlerTagAttr, BattlerTagType.TORMENT) .condition((user, target, move) => (!target.summonData.tormented && (target.findTag(t => t instanceof TormentTag) === undefined))) + .condition((user, target, move) => (!target.isMax())) .partial(), new StatusMove(Moves.FLATTER, Type.DARK, 100, 15, -1, 0, 3) .attr(StatChangeAttr, BattleStat.SPATK, 1) @@ -5541,7 +5493,7 @@ export function initMoves() { .attr(StatChangeAttr, BattleStat.SPDEF, 1, true) .attr(AddBattlerTagAttr, BattlerTagType.CHARGED, true, false), new StatusMove(Moves.TAUNT, Type.DARK, 100, 20, -1, 0, 3) - .attr(TauntAttr) + // .attr(TauntAttr) .condition((user, target, move) => (!target.summonData.taunted)) .partial(), new StatusMove(Moves.HELPING_HAND, Type.NORMAL, -1, 20, -1, 5, 3) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 4690cffade0..a4808c1da05 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1768,7 +1768,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const newTag = getBattlerTag(tagType, turnCount, sourceMove, sourceId); const cancelled = new Utils.BooleanHolder(false); - applyPreApplyBattlerTagAbAttrs(PreApplyBattlerTagAbAttr, this, newTag, cancelled); + applyPreApplyBattlerTagAbAttrs(PreApplyBattlerTagAbAttr, this, newTag, cancelled, newTag); if (!cancelled.value && newTag.canAdd(this)) { this.summonData.tags.push(newTag);