diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 3b6e005d7e8..946ef35bf57 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -1902,6 +1902,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source case BattlerTagType.GULP_MISSILE_ARROKUDA: case BattlerTagType.GULP_MISSILE_PIKACHU: return new GulpMissileTag(tagType, sourceMove); + case BattlerTagType.STATS_BOOSTED: + return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount, sourceMove); case BattlerTagType.NONE: default: return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); diff --git a/src/data/move.ts b/src/data/move.ts index 0b0af00a370..1adc01e017a 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -5854,6 +5854,59 @@ export class DestinyBondAttr extends MoveEffectAttr { } } +/** + * Attribute to apply a battler tag to the target if they have had their stats boosted this turn. + * + * @extends AddBattlerTagAttr + */ +export class AddBattlerTagIfBoostedAttr extends AddBattlerTagAttr { + constructor(tag: BattlerTagType) { + super(tag, false, false, 2, 5); + } + + /** + * @param user {@linkcode Pokemon} using this move + * @param target {@linkcode Pokemon} target of this move + * @param move {@linkcode Move} being used + * @param {any[]} args N/A + * @returns true + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (user.getTag(BattlerTagType.STATS_BOOSTED)) { + super.apply(user, target, move, args); + } + return true; + } +} + +/** + * Attribute to apply a status effect to the target if they have had their stats boosted this turn. + * + * @extends MoveEffectAttr + */ +export class StatusIfBoostedAttr extends MoveEffectAttr { + public effect: StatusEffect; + + constructor(effect: StatusEffect) { + super(true, MoveEffectTrigger.HIT); + this.effect = effect; + } + + /** + * @param user {@linkcode Pokemon} using this move + * @param target {@linkcode Pokemon} target of this move + * @param move {@linkcode Move} being used + * @param {any[]} args N/A + * @returns true + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (target.getTag(BattlerTagType.STATS_BOOSTED)) { + target.trySetStatus(this.effect, true, user); + } + return true; + } +} + export class LastResortAttr extends MoveAttr { getCondition(): MoveConditionFunc { return (user: Pokemon, target: Pokemon, move: Move) => { @@ -8479,8 +8532,8 @@ export function initMoves() { new AttackMove(Moves.SKITTER_SMACK, Type.BUG, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8) .attr(StatChangeAttr, BattleStat.SPATK, -1), new AttackMove(Moves.BURNING_JEALOUSY, Type.FIRE, MoveCategory.SPECIAL, 70, 100, 5, 100, 0, 8) - .target(MoveTarget.ALL_NEAR_ENEMIES) - .partial(), + .attr(StatusIfBoostedAttr, StatusEffect.BURN) + .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.LASH_OUT, Type.DARK, MoveCategory.PHYSICAL, 75, 100, 5, -1, 0, 8) .partial(), new AttackMove(Moves.POLTERGEIST, Type.GHOST, MoveCategory.PHYSICAL, 110, 90, 5, -1, 0, 8) @@ -8928,8 +8981,8 @@ export function initMoves() { .target(MoveTarget.NEAR_ALLY) .partial(), new AttackMove(Moves.ALLURING_VOICE, Type.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 9) - .soundBased() - .partial(), + .attr(AddBattlerTagIfBoostedAttr, BattlerTagType.CONFUSED) + .soundBased(), new AttackMove(Moves.TEMPER_FLARE, Type.FIRE, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 9) .attr(MovePowerMultiplierAttr, (user, target, move) => user.getLastXMoves(2)[1]?.result === MoveResult.MISS || user.getLastXMoves(2)[1]?.result === MoveResult.FAIL ? 2 : 1), new AttackMove(Moves.SUPERCELL_SLAM, Type.ELECTRIC, MoveCategory.PHYSICAL, 100, 95, 15, -1, 0, 9) diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index fd1455eab6c..574f7238ace 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -60,6 +60,7 @@ export enum BattlerTagType { DESTINY_BOND = "DESTINY_BOND", CENTER_OF_ATTENTION = "CENTER_OF_ATTENTION", ICE_FACE = "ICE_FACE", + STATS_BOOSTED = "STATS_BOOSTED", STOCKPILING = "STOCKPILING", RECEIVE_DOUBLE_DAMAGE = "RECEIVE_DOUBLE_DAMAGE", ALWAYS_GET_HIT = "ALWAYS_GET_HIT", diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 588b6839d70..dc0ff4d3225 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4235,6 +4235,7 @@ export class PokemonBattleData { public berriesEaten: BerryType[] = []; public abilitiesApplied: Abilities[] = []; public abilityRevealed: boolean = false; + public statsBoostedFirstTurn: boolean = false; } export class PokemonBattleSummonData { @@ -4245,8 +4246,8 @@ export class PokemonBattleSummonData { } export class PokemonTurnData { - public flinched: boolean; - public acted: boolean; + public flinched: boolean = false; + public acted: boolean = false; public hitCount: integer; public hitsLeft: integer; public damageDealt: integer = 0; diff --git a/src/phases.ts b/src/phases.ts index 73413b248a4..1c24cf0acb3 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -3512,6 +3512,10 @@ export class StatChangePhase extends PokemonPhase { } for (const stat of filteredStats) { + if (levels.value > 0 && pokemon.summonData.battleStats[stat] + levels.value <= 6) { + pokemon.addTag(BattlerTagType.STATS_BOOSTED, 1); + } + pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6); }