diff --git a/src/battle-phases.ts b/src/battle-phases.ts index 925d574e9..445ca8632 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -25,7 +25,7 @@ import { Gender } from "./data/gender"; import { Weather, WeatherType, getRandomWeatherType, getWeatherDamageMessage, getWeatherLapseMessage } from "./data/weather"; import { TempBattleStat } from "./data/temp-battle-stat"; import { ArenaTagType, ArenaTrapTag, TrickRoomTag } from "./data/arena-tag"; -import { CheckTrappedAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, SuppressWeatherEffectAbAttr, applyCheckTrappedAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreWeatherEffectAbAttrs } from "./data/ability"; +import { Abilities, CheckTrappedAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, SuppressWeatherEffectAbAttr, applyCheckTrappedAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreWeatherEffectAbAttrs } from "./data/ability"; import { Unlockables, getUnlockableName } from "./system/unlockables"; import { getBiomeKey } from "./arena"; import { BattleType, BattlerIndex, TurnCommand } from "./battle"; @@ -1407,8 +1407,15 @@ export class MovePhase extends BattlePhase { } this.scene.queueMessage(getPokemonMessage(this.pokemon, ` used\n${this.move.getName()}!`), 500); - if (!moveQueue.length || !moveQueue.shift().ignorePP) + if (!moveQueue.length || !moveQueue.shift().ignorePP) { this.move.ppUsed++; + for (let opponent of this.pokemon.getOpponents()) { + if (this.move.ppUsed === this.move.getMove().pp) + break; + if (opponent.getAbility().id === Abilities.PRESSURE) + this.move.ppUsed++; + } + } if (!allMoves[this.move.moveId].getAttrs(CopyMoveAttr).length) this.scene.currentBattle.lastMove = this.move.moveId; diff --git a/src/data/ability.ts b/src/data/ability.ts index cec369536..751a2ba2b 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -419,6 +419,22 @@ export class PostSummonAbAttr extends AbAttr { } } +export class PostSummonMessageAbAttr extends PostSummonAbAttr { + private messageFunc: (pokemon: Pokemon) => string; + + constructor(messageFunc: (pokemon: Pokemon) => string) { + super(true); + + this.messageFunc = messageFunc; + } + + applyPostSummon(pokemon: Pokemon, args: any[]): boolean { + pokemon.scene.queueMessage(this.messageFunc(pokemon)); + + return true; + } +} + export class PostSummonAddBattlerTagAbAttr extends PostSummonAbAttr { private tagType: BattlerTagType; private turnCount: integer; @@ -1332,7 +1348,8 @@ export function initAbilities() { new Ability(Abilities.PLUS, "Plus (N)", "Ups Sp. Atk if another Pokémon has PLUS or MINUS.", 3), new Ability(Abilities.POISON_POINT, "Poison Point", "Contact with the Pokémon may poison the attacker.", 3) .attr(PostDefendContactApplyStatusEffectAbAttr, StatusEffect.POISON), - new Ability(Abilities.PRESSURE, "Pressure (N)", "The Pokémon raises the foe's PP usage.", 3), + new Ability(Abilities.PRESSURE, "Pressure", "The Pokémon raises the foe's PP usage.", 3) + .attr(PostSummonMessageAbAttr, (pokemon: Pokemon) => getPokemonMessage(pokemon, 'is\nexerting its Pressure!')), new Ability(Abilities.PURE_POWER, "Pure Power", "Raises the Pokémon's Attack stat.", 3) .attr(PostSummonStatChangeAbAttr, BattleStat.ATK, 2, true), new Ability(Abilities.RAIN_DISH, "Rain Dish", "The Pokémon gradually regains HP in rain.", 3)