Skip to content

Commit

Permalink
Fix Counter/Mirror Coat to respect redirection (#5212)
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibo authored and Zarel committed Feb 26, 2019
1 parent 623b349 commit 6ddb714
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions sim/battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2433,6 +2433,7 @@ class Battle extends Dex.ModdedDex {

switch (targetType) {
case 'randomNormal':
case 'scripted':
case 'normal':
return isAdjacent;
case 'adjacentAlly':
Expand Down
12 changes: 6 additions & 6 deletions test/simulator/moves/counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Counter', function () {
assert.false.fullHP(battle.p2.active[1]);
});

it('should bypass Follow Me', function () {
it('should respect Follow Me', function () {
battle = common.createBattle({gameType: 'doubles'});
battle.join('p1', 'Guest 1', 1, [
{species: 'Bastiodon', ability: 'sturdy', moves: ['counter']},
Expand All @@ -68,8 +68,8 @@ describe('Counter', function () {
{species: 'Clefable', ability: 'unaware', moves: ['followme']},
]);
battle.makeChoices('move counter, move splash', 'move acrobatics 1, move followme');
assert.fullHP(battle.p2.active[1]);
assert.false.fullHP(battle.p2.active[0]);
assert.false.fullHP(battle.p2.active[1]);
assert.fullHP(battle.p2.active[0]);
});
});

Expand Down Expand Up @@ -123,7 +123,7 @@ describe('Mirror Coat', function () {
assert.false.fullHP(battle.p2.active[1]);
});

it('should bypass Follow Me', function () {
it('should respect Follow Me', function () {
battle = common.createBattle({gameType: 'doubles'});
battle.join('p1', 'Guest 1', 1, [
{species: 'Mew', ability: 'synchronize', moves: ['mirrorcoat']},
Expand All @@ -134,7 +134,7 @@ describe('Mirror Coat', function () {
{species: 'Clefable', ability: 'unaware', moves: ['followme']},
]);
battle.makeChoices('move mirrorcoat, move splash', 'move venoshock 1, move followme');
assert.fullHP(battle.p2.active[1]);
assert.false.fullHP(battle.p2.active[0]);
assert.false.fullHP(battle.p2.active[1]);
assert.fullHP(battle.p2.active[0]);
});
});

0 comments on commit 6ddb714

Please sign in to comment.