Issue/smack down should cancel fly (#407)
* Smack down and thousand arrows should cancel charging fly * Remove console log * Update interruptible check to use flying tag instead of move history * Remove extra commapull/409/head
parent
6011794732
commit
fbc0800571
|
@ -163,6 +163,29 @@ 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 {
|
||||
return !!pokemon.getTag(BattlerTagType.FLYING)
|
||||
}
|
||||
|
||||
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 +1104,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:
|
||||
|
|
|
@ -3,6 +3,7 @@ export enum BattlerTagType {
|
|||
NONE = "NONE",
|
||||
RECHARGING = "RECHARGING",
|
||||
FLINCHED = "FLINCHED",
|
||||
INTERRUPTED = "INTERRUPTED",
|
||||
CONFUSED = "CONFUSED",
|
||||
INFATUATED = "INFATUATED",
|
||||
SEEDED = "SEEDED",
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue