pokemon-showdown/test/sim/abilities/soulheart.js
Leonard Craft III bed1f4ac99
Add various mechanics tests (#7857)
* Improve Volcalith tests readability

* Add G-Max Volcalith recoil damage order test

* Add 1 HP priority tests

* Add charge move targeting test

* Correct assertions of Ripen / Sturdy

* Skip failing tests

* Add Volcalith Black Sludge test

* Add Pressure Max / Z-move tests

* Add Pressure submove test

* Add NGas speed test

* Skip NGas speed test

* Add White Herb double Intimidate test

* Remove debug log

* Remove duplicate Pressure test

* Improve White Herb Intimidate test title

* Add Rollout Storage tests

* Add spread move Rollout storage test

* Add Magician Weakness Policy test

* Add Sleep tests

* Add Shell Bell spread move test

* Add Synchronize Lum Berry test

* oh yeah it doesn't work

* Remove duplicate test

* Add Sunsteel Strike tests

* Add Leech Seed ally switch test

* Add Primal weather Natural Gift test

* Add Emergency Exit hazards test

* Add generic hazards tests

* Add and standardize Arceus tests

* Add Transform ability test

* Add and standardize Parting Shot tests

* Add Memento tests

* Add Me First test

* Add Cursed Body Z-move test

* Add Assurance targeting test

* Clarify Assurance test description

* Add double faint switch test

* Add Receiver KO boost ability

* Add double Unnerve test

* Add Dynamax Eject Pack test

* Improve Dynamax forced switchout test

* Add Protective Pads Perish Body test

* Add Sticky Web Pressure test

* Add Speed modifier lower bound test

* Add Cloud Nine Hydration test

* Correct Cursed Body test

* Add Grassy Terrain Leftovers test

* Remove leftover debug

* Add additional Receiver and Soul-Heart tests

* Add Spite tests

* mish

* Add Shell Bell multihit test

* Add WP Dragon Tail test

Co-authored-by: The Immortal <the_immortal123@live.com>
2021-01-04 23:47:10 -08:00

61 lines
2.2 KiB
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Soul-Heart', function () {
afterEach(function () {
battle.destroy();
});
it(`should activate on each individual KO`, function () {
battle = common.createBattle({gameType: 'doubles'}, [[
{species: 'Toxapex', moves: ['sleeptalk']},
{species: 'Victini', moves: ['finalgambit']},
], [
{species: 'Magearna', ability: 'soulheart', moves: ['sleeptalk']},
{species: 'Wynaut', moves: ['sleeptalk']},
]]);
const magearna = battle.p2.active[0];
battle.makeChoices('move sleeptalk, move finalgambit 2', 'auto');
assert.statStage(magearna, 'spa', 2);
const log = battle.getDebugLog();
const soulHeartFirstIndex = log.indexOf('|Soul-Heart');
const soulHeartSecondIndex = log.lastIndexOf('|Soul-Heart');
assert.notEqual(soulHeartFirstIndex, soulHeartSecondIndex, 'Soul-Heart should have activated twice.');
});
it(`should not activate if two Soul-Hearts are KOed on the same side`, function () {
battle = common.createBattle({gameType: 'doubles'}, [[
{species: 'Gengar', moves: ['astralbarrage']},
{species: 'Aron', moves: ['sleeptalk']},
], [
{species: 'Magearna', ability: 'soulheart', level: 1, moves: ['sleeptalk']},
{species: 'Wynaut', ability: 'soulheart', level: 1, moves: ['sleeptalk']},
{species: 'Roggenrola', moves: ['sleeptalk']},
]]);
const log = battle.getDebugLog();
const soulHeartIndex = log.indexOf('|Soul-Heart');
assert.equal(soulHeartIndex, -1, 'Soul-Heart should not have activated.');
});
it.skip(`should activate an opposing Soul-Heart if the attacker's ally was first KOed in a spread move`, function () {
battle = common.createBattle({gameType: 'doubles'}, [[
{species: 'Landorus', moves: ['earthquake']},
{species: 'Aron', moves: ['sleeptalk']},
], [
{species: 'Magearna', ability: 'soulheart', level: 1, moves: ['sleeptalk']},
{species: 'Lugia', moves: ['sleeptalk']},
]]);
const log = battle.getDebugLog();
const soulHeartIndex = log.indexOf('|Soul-Heart');
assert.notEqual(soulHeartIndex, -1, 'Soul-Heart should have activated, despite being KOed right after.');
});
});