Smack down and thousand arrows should cancel charging fly

This commit is contained in:
Matthew Ross 2024-05-02 21:31:19 -07:00
parent fec8771830
commit d918990d7c
4 changed files with 37 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import { CommonAnim, CommonBattleAnim } from "./battle-anims";
import { CommonAnimPhase, MoveEffectPhase, MovePhase, PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from "../phases";
import { getPokemonMessage, getPokemonPrefix } from "../messages";
import Pokemon, { MoveResult, HitResult } from "../field/pokemon";
import Pokemon, { MoveResult, HitResult, TurnMove } from "../field/pokemon";
import { Stat, getStatName } from "./pokemon-stat";
import { StatusEffect } from "./status-effect";
import * as Utils from "../utils";
@ -163,6 +163,34 @@ export class FlinchedTag extends BattlerTag {
}
}
export class InterruptedTag extends BattlerTag {
constructor(sourceMove: Moves){
super(BattlerTagType.INTERRUPTED, BattlerTagLapseType.PRE_MOVE, 0, sourceMove)
}
canAdd(pokemon: Pokemon): boolean {
console.log(pokemon.getLastXMoves())
const prevMove = pokemon.getLastXMoves(1)
return prevMove.length && prevMove[0].move === (Moves.FLY || Moves.BOUNCE)
}
onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
pokemon.getMoveQueue().shift()
pokemon.pushMoveHistory({move: Moves.NONE, result: MoveResult.OTHER})
}
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
super.lapse(pokemon, lapseType);
(pokemon.scene.getCurrentPhase() as MovePhase).cancel();
return true
}
}
export class ConfusedTag extends BattlerTag {
constructor(turnCount: integer, sourceMove: Moves) {
super(BattlerTagType.CONFUSED, BattlerTagLapseType.MOVE, turnCount, sourceMove);
@ -1081,6 +1109,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
return new RechargingTag(sourceMove);
case BattlerTagType.FLINCHED:
return new FlinchedTag(sourceMove);
case BattlerTagType.INTERRUPTED:
return new InterruptedTag(sourceMove);
case BattlerTagType.CONFUSED:
return new ConfusedTag(turnCount, sourceMove);
case BattlerTagType.INFATUATED:

View File

@ -3,6 +3,7 @@ export enum BattlerTagType {
NONE = "NONE",
RECHARGING = "RECHARGING",
FLINCHED = "FLINCHED",
INTERRUPTED = "INTERRUPTED",
CONFUSED = "CONFUSED",
INFATUATED = "INFATUATED",
SEEDED = "SEEDED",

View File

@ -5106,6 +5106,8 @@ export function initMoves() {
.unimplemented(),
new AttackMove(Moves.SMACK_DOWN, Type.ROCK, MoveCategory.PHYSICAL, 50, 100, 15, 100, 0, 5)
.attr(AddBattlerTagAttr, BattlerTagType.IGNORE_FLYING, false, false, 5)
.attr(AddBattlerTagAttr, BattlerTagType.INTERRUPTED)
.attr(RemoveBattlerTagAttr, [BattlerTagType.FLYING])
.attr(HitsTagAttr, BattlerTagType.FLYING, false)
.makesContact(false),
new AttackMove(Moves.STORM_THROW, Type.FIGHTING, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 5)
@ -5469,6 +5471,8 @@ export function initMoves() {
new AttackMove(Moves.THOUSAND_ARROWS, Type.GROUND, MoveCategory.PHYSICAL, 90, 100, 10, 100, 0, 6)
.attr(NeutralDamageAgainstFlyingTypeMultiplierAttr)
.attr(HitsTagAttr, BattlerTagType.FLYING, false)
.attr(AddBattlerTagAttr, BattlerTagType.INTERRUPTED)
.attr(RemoveBattlerTagAttr, [BattlerTagType.FLYING])
.makesContact(false)
.target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.THOUSAND_WAVES, Type.GROUND, MoveCategory.PHYSICAL, 90, 100, 10, -1, 0, 6)

View File

@ -2333,7 +2333,7 @@ export class MovePhase extends BattlePhase {
return;
}
if (this.pokemon.getTag(BattlerTagType.RECHARGING))
if (this.pokemon.getTag(BattlerTagType.RECHARGING|| BattlerTagType.INTERRUPTED))
return;
this.scene.queueMessage(getPokemonMessage(this.pokemon, ` used\n${this.move.getName()}!`), 500);