mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 14:59:26 +02:00
adding new AbAttr in abiliity.ts for posterity
This commit is contained in:
parent
5bc36ba5a9
commit
902d8ba3f3
@ -3579,24 +3579,22 @@ export class MoodyAbAttr extends PostTurnAbAttr {
|
||||
}
|
||||
}
|
||||
|
||||
export class PostTurnStatStageChangeAbAttr extends PostTurnAbAttr {
|
||||
export class SpeedBoostAbAttr extends PostTurnAbAttr {
|
||||
private stats: BattleStat[];
|
||||
private stages: number;
|
||||
|
||||
constructor(stats: BattleStat[], stages: number) {
|
||||
constructor() {
|
||||
super(true);
|
||||
|
||||
this.stats = Array.isArray(stats)
|
||||
? stats
|
||||
: [ stats ];
|
||||
this.stages = stages;
|
||||
this.stats = Array.isArray([ Stat.SPD ])
|
||||
? [ Stat.SPD ]
|
||||
: [ Stat.SPD ];
|
||||
this.stages = 1;
|
||||
}
|
||||
|
||||
applyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean {
|
||||
if (!simulated) {
|
||||
if (!pokemon.hasAbility(Abilities.SPEED_BOOST)) {
|
||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages));
|
||||
} else if (pokemon.hasAbility(Abilities.SPEED_BOOST) && !pokemon.turnData.switchedInThisTurn && !pokemon.turnData.failedRunAway) {
|
||||
if (!pokemon.turnData.switchedInThisTurn && !pokemon.turnData.failedRunAway) {
|
||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages));
|
||||
} else {
|
||||
return false;
|
||||
@ -4865,7 +4863,7 @@ export function initAbilities() {
|
||||
.attr(PostSummonWeatherChangeAbAttr, WeatherType.RAIN)
|
||||
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.RAIN),
|
||||
new Ability(Abilities.SPEED_BOOST, 3)
|
||||
.attr(PostTurnStatStageChangeAbAttr, [ Stat.SPD ], 1),
|
||||
.attr(SpeedBoostAbAttr),
|
||||
new Ability(Abilities.BATTLE_ARMOR, 3)
|
||||
.attr(BlockCritAbAttr)
|
||||
.ignorable(),
|
||||
|
@ -10,13 +10,14 @@ import { NewBattlePhase } from "./new-battle-phase";
|
||||
import { PokemonPhase } from "./pokemon-phase";
|
||||
|
||||
export class AttemptRunPhase extends PokemonPhase {
|
||||
constructor(scene: BattleScene, fieldIndex: number) {
|
||||
super(scene, fieldIndex);
|
||||
}
|
||||
|
||||
/** For testing purposes: this is to force the pokemon to fail and escape */
|
||||
public forceFailEscape = false;
|
||||
|
||||
constructor(scene: BattleScene, fieldIndex: number) {
|
||||
super(scene, fieldIndex);
|
||||
}
|
||||
|
||||
start() {
|
||||
super.start();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user