Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Counter/Mirror Coat to respect redirection #5212

Merged
merged 2 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sim/battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2435,6 +2435,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]);
});
});