mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-18 23:11:11 +00:00
[Bug] Fix for Dancer activating when enemy in not on field / using a 2 steps charging move (#1708)
* Fixes !1686 and !1450 * Added forbidden tags * Restored original import indentations * Restored missing import
This commit is contained in:
parent
b532a6b2d0
commit
e614aec8ca
@ -23,7 +23,7 @@ import { Command } from "../ui/command-ui-handler";
|
|||||||
import { BerryModifierType } from "#app/modifier/modifier-type";
|
import { BerryModifierType } from "#app/modifier/modifier-type";
|
||||||
import { getPokeballName } from "./pokeball";
|
import { getPokeballName } from "./pokeball";
|
||||||
import { Species } from "./enums/species";
|
import { Species } from "./enums/species";
|
||||||
import {BattlerIndex} from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
|
||||||
export class Ability implements Localizable {
|
export class Ability implements Localizable {
|
||||||
public id: Abilities;
|
public id: Abilities;
|
||||||
@ -2764,8 +2764,12 @@ export class PostDancingMoveAbAttr extends PostMoveUsedAbAttr {
|
|||||||
* @return true if the Dancer ability was resolved
|
* @return true if the Dancer ability was resolved
|
||||||
*/
|
*/
|
||||||
applyPostMoveUsed(dancer: Pokemon, move: PokemonMove, source: Pokemon, targets: BattlerIndex[], args: any[]): boolean | Promise<boolean> {
|
applyPostMoveUsed(dancer: Pokemon, move: PokemonMove, source: Pokemon, targets: BattlerIndex[], args: any[]): boolean | Promise<boolean> {
|
||||||
|
// List of tags that prevent the Dancer from replicating the move
|
||||||
|
const forbiddenTags = [BattlerTagType.FLYING, BattlerTagType.UNDERWATER,
|
||||||
|
BattlerTagType.UNDERGROUND, BattlerTagType.HIDDEN];
|
||||||
// The move to replicate cannot come from the Dancer
|
// The move to replicate cannot come from the Dancer
|
||||||
if (source.getBattlerIndex() !== dancer.getBattlerIndex()) {
|
if (source.getBattlerIndex() !== dancer.getBattlerIndex()
|
||||||
|
&& !dancer.summonData.tags.some(tag => forbiddenTags.includes(tag.tagType))) {
|
||||||
// If the move is an AttackMove or a StatusMove the Dancer must replicate the move on the source of the Dance
|
// If the move is an AttackMove or a StatusMove the Dancer must replicate the move on the source of the Dance
|
||||||
if (move.getMove() instanceof AttackMove || move.getMove() instanceof StatusMove) {
|
if (move.getMove() instanceof AttackMove || move.getMove() instanceof StatusMove) {
|
||||||
const target = this.getTarget(dancer, source, targets);
|
const target = this.getTarget(dancer, source, targets);
|
||||||
@ -2774,9 +2778,10 @@ export class PostDancingMoveAbAttr extends PostMoveUsedAbAttr {
|
|||||||
// If the move is a SelfStatusMove (ie. Swords Dance) the Dancer should replicate it on itself
|
// If the move is a SelfStatusMove (ie. Swords Dance) the Dancer should replicate it on itself
|
||||||
dancer.scene.unshiftPhase(new MovePhase(dancer.scene, dancer, [dancer.getBattlerIndex()], move, true));
|
dancer.scene.unshiftPhase(new MovePhase(dancer.scene, dancer, [dancer.getBattlerIndex()], move, true));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the correct targets of Dancer ability
|
* Get the correct targets of Dancer ability
|
||||||
|
@ -2583,7 +2583,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
this.scene.getPlayerField().forEach(pokemon => {
|
this.scene.getPlayerField().forEach(pokemon => {
|
||||||
applyPostMoveUsedAbAttrs(PostMoveUsedAbAttr, pokemon, this.move, this.pokemon, this.targets);
|
applyPostMoveUsedAbAttrs(PostMoveUsedAbAttr, pokemon, this.move, this.pokemon, this.targets);
|
||||||
});
|
});
|
||||||
this.scene.getEnemyParty().forEach(pokemon => {
|
this.scene.getEnemyField().forEach(pokemon => {
|
||||||
applyPostMoveUsedAbAttrs(PostMoveUsedAbAttr, pokemon, this.move, this.pokemon, this.targets);
|
applyPostMoveUsedAbAttrs(PostMoveUsedAbAttr, pokemon, this.move, this.pokemon, this.targets);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user