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 stats: BattleStat[];
|
||||||
private stages: number;
|
private stages: number;
|
||||||
|
|
||||||
constructor(stats: BattleStat[], stages: number) {
|
constructor() {
|
||||||
super(true);
|
super(true);
|
||||||
|
|
||||||
this.stats = Array.isArray(stats)
|
this.stats = Array.isArray([ Stat.SPD ])
|
||||||
? stats
|
? [ Stat.SPD ]
|
||||||
: [ stats ];
|
: [ Stat.SPD ];
|
||||||
this.stages = stages;
|
this.stages = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
applyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean {
|
applyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean {
|
||||||
if (!simulated) {
|
if (!simulated) {
|
||||||
if (!pokemon.hasAbility(Abilities.SPEED_BOOST)) {
|
if (!pokemon.turnData.switchedInThisTurn && !pokemon.turnData.failedRunAway) {
|
||||||
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) {
|
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages));
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -4865,7 +4863,7 @@ export function initAbilities() {
|
|||||||
.attr(PostSummonWeatherChangeAbAttr, WeatherType.RAIN)
|
.attr(PostSummonWeatherChangeAbAttr, WeatherType.RAIN)
|
||||||
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.RAIN),
|
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.RAIN),
|
||||||
new Ability(Abilities.SPEED_BOOST, 3)
|
new Ability(Abilities.SPEED_BOOST, 3)
|
||||||
.attr(PostTurnStatStageChangeAbAttr, [ Stat.SPD ], 1),
|
.attr(SpeedBoostAbAttr),
|
||||||
new Ability(Abilities.BATTLE_ARMOR, 3)
|
new Ability(Abilities.BATTLE_ARMOR, 3)
|
||||||
.attr(BlockCritAbAttr)
|
.attr(BlockCritAbAttr)
|
||||||
.ignorable(),
|
.ignorable(),
|
||||||
|
@ -10,13 +10,14 @@ import { NewBattlePhase } from "./new-battle-phase";
|
|||||||
import { PokemonPhase } from "./pokemon-phase";
|
import { PokemonPhase } from "./pokemon-phase";
|
||||||
|
|
||||||
export class AttemptRunPhase extends PokemonPhase {
|
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 */
|
/** For testing purposes: this is to force the pokemon to fail and escape */
|
||||||
public forceFailEscape = false;
|
public forceFailEscape = false;
|
||||||
|
|
||||||
|
constructor(scene: BattleScene, fieldIndex: number) {
|
||||||
|
super(scene, fieldIndex);
|
||||||
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user