mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-18 15:00:55 +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
@ -2764,8 +2764,12 @@ export class PostDancingMoveAbAttr extends PostMoveUsedAbAttr {
|
||||
* @return true if the Dancer ability was resolved
|
||||
*/
|
||||
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
|
||||
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 (move.getMove() instanceof AttackMove || move.getMove() instanceof StatusMove) {
|
||||
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
|
||||
dancer.scene.unshiftPhase(new MovePhase(dancer.scene, dancer, [dancer.getBattlerIndex()], move, true));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the correct targets of Dancer ability
|
||||
|
@ -2583,7 +2583,7 @@ export class MovePhase extends BattlePhase {
|
||||
this.scene.getPlayerField().forEach(pokemon => {
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user