Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't skip residuals after fainting in Gen2.
The original code was wrong, as all it did was skipping residuals. Skipping moves is handled by `faintMessages`.
- Loading branch information
1 parent
222b64f
commit 815909e
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var assert = require('assert'); | ||
var battle; | ||
|
||
describe('Leftovers - GSC', function () { | ||
afterEach(function () { | ||
battle.destroy(); | ||
}); | ||
|
||
it('should heal after switch', function () { | ||
battle = BattleEngine.Battle.construct('battle-leftovers-gsc', 'gen2customgame'); | ||
battle.join('p1', 'Guest 1', 1, [ | ||
{species: 'Blissey', item: 'leftovers', moves: ['healbell']}, | ||
{species: 'Magikarp', level: 1, moves: ['splash']} | ||
]); | ||
battle.join('p2', 'Guest 2', 1, [ | ||
{species: "Miltank", moves: ['seismictoss']} | ||
]); | ||
battle.commitDecisions(); | ||
assert.strictEqual(battle.p1.active[0].hp, 614); | ||
|
||
battle.choose('p1', 'switch 2'); | ||
battle.commitDecisions(); | ||
|
||
battle.choose('p1', 'switch 2'); | ||
assert.strictEqual(battle.p1.active[0].hp, 656); | ||
}); | ||
}); |
815909e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test btw