Implement Pressure ability
parent
3e092876ad
commit
179d1bcb13
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue