diff --git a/test/sim/abilities/illusion.js b/test/sim/abilities/illusion.js index 94fdd8e59b..a402c3983d 100644 --- a/test/sim/abilities/illusion.js +++ b/test/sim/abilities/illusion.js @@ -57,19 +57,6 @@ describe('Illusion', function () { assert(battle.log.every(line => !line.includes('Gmax'))); }); - it.skip(`should instantly wear off when Neutralizing Gas enters the field`, function () { - battle = common.createBattle([[ - {species: "Zoroark", ability: 'illusion', moves: ['sleeptalk']}, - {species: "Eternatus", moves: ['sleeptalk']}, - ], [ - {species: "Wynaut", moves: ['sleeptalk']}, - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, - ]]); - - battle.makeChoices('auto', 'switch 2'); - assert(battle.log.some(line => line.includes('|-end|p1a: Zoroark|Illusion'))); - }); - it(`should instantly wear off before using a Z-move`, function () { battle = common.gen(7).createBattle([[ {species: "Zoroark", ability: 'illusion', item: 'fightiniumz', moves: ['machpunch', 'sleeptalk']}, diff --git a/test/sim/abilities/imposter.js b/test/sim/abilities/imposter.js index 0e8e769caf..0744ee8086 100644 --- a/test/sim/abilities/imposter.js +++ b/test/sim/abilities/imposter.js @@ -43,19 +43,4 @@ describe('Imposter', function () { battle.makeChoices('move skillswap', 'switch greninja'); assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); }); - - it('should not activate if Neutralizing Gas leaves the field', function () { - battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Weezing", ability: 'neutralizinggas', moves: ['snore']}, - {species: "Greninja", ability: 'torrent', moves: ['teleport']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Ditto", ability: 'imposter', moves: ['sleeptalk']}, - ]}); - assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); - battle.makeChoices('switch greninja', 'move sleeptalk'); - assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); - assert.notEqual(battle.p1.pokemon[1].species, battle.p2.active[0].species); - }); }); diff --git a/test/sim/abilities/neutralizinggas.js b/test/sim/abilities/neutralizinggas.js index 3f6223a52a..ab6fe68e01 100644 --- a/test/sim/abilities/neutralizinggas.js +++ b/test/sim/abilities/neutralizinggas.js @@ -82,6 +82,114 @@ describe('Neutralizing Gas', function () { assert.fullHP(battle.p1.active[0]); }); + it('should not activate if Neutralizing Gas leaves the field', function () { + battle = common.createBattle(); + battle.setPlayer('p1', {team: [ + {species: "Weezing", ability: 'neutralizinggas', moves: ['snore']}, + {species: "Greninja", ability: 'torrent', moves: ['teleport']}, + ]}); + battle.setPlayer('p2', {team: [ + {species: "Ditto", ability: 'imposter', moves: ['sleeptalk']}, + ]}); + assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); + battle.makeChoices('switch greninja', 'move sleeptalk'); + assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); + assert.notEqual(battle.p1.pokemon[1].species, battle.p2.active[0].species); + }); + + it(`should prevent Unburden's activation when it is active on the field`, function () { + battle = common.createBattle([[ + {species: "Wynaut", ability: 'unburden', item: 'sitrusberry', evs: {hp: 4}, moves: ['bellydrum']}, + ], [ + {species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk']}, + {species: "Whismur", moves: ['sleeptalk']}, + ]]); + + const wynaut = battle.p1.active[0]; + const originalSpeed = wynaut.getStat('spe'); + battle.makeChoices(); + assert.equal(wynaut.getStat('spe'), originalSpeed); + + //The chance to trigger Unburden is gone, so it missed the timing and doesn't gain the speed post-NGas removal + battle.makeChoices('auto', 'switch 2'); + assert.equal(wynaut.getStat('spe'), originalSpeed); + }); + + it.skip(`should negate Unburden when Neutralizing Gas enters the field`, function () { + battle = common.createBattle([[ + {species: "Wynaut", ability: 'unburden', item: 'sitrusberry', evs: {hp: 4}, moves: ['bellydrum']}, + ], [ + {species: "Whismur", moves: ['sleeptalk']}, + {species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk']}, + ]]); + + const wynaut = battle.p1.active[0]; + const originalSpeed = wynaut.getStat('spe'); + battle.makeChoices(); + assert.equal(wynaut.getStat('spe'), originalSpeed * 2); + + battle.makeChoices('auto', 'switch 2'); + assert.equal(wynaut.getStat('spe'), originalSpeed); + + battle.makeChoices('auto', 'switch 2'); + assert.equal(wynaut.getStat('spe'), originalSpeed * 2); + }); + + it.skip(`should cause Illusion to instantly wear off when Neutralizing Gas enters the field`, function () { + battle = common.createBattle([[ + {species: "Zoroark", ability: 'illusion', moves: ['sleeptalk']}, + {species: "Eternatus", moves: ['sleeptalk']}, + ], [ + {species: "Wynaut", moves: ['sleeptalk']}, + {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, + ]]); + + battle.makeChoices('auto', 'switch 2'); + assert(battle.log.some(line => line.includes('|-end|p1a: Zoroark|Illusion'))); + }); + + it.skip(`should cause Slow Start to instantly wear off/restart when Neutralizing Gas leaves/enters the field`, function () { + battle = common.createBattle([[ + {species: "Regigigas", ability: 'slowstart', moves: ['sleeptalk']}, + {species: "Eternatus", moves: ['sleeptalk']}, + ], [ + {species: "Wynaut", moves: ['sleeptalk']}, + {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, + ]]); + + const regigigas = battle.p1.active[0]; + const slowStartSpeed = regigigas.getStat('spe'); + + //Slow Start should be negated, so it should have its original, non-Slow Start speed + battle.makeChoices('auto', 'switch 2'); + assert.equal(regigigas.getStat('spe'), slowStartSpeed * 2); + + //Slow Start should be turned back on, so it should have its Slow Start speed again + battle.makeChoices('auto', 'switch 2'); + assert.equal(regigigas.getStat('spe'), slowStartSpeed); + }); + + it.skip(`should not cause Gluttony to instantly eat Berries when Neutralizing Gas leaves the field`, function () { + battle = common.createBattle([[ + {species: "Wynaut", ability: 'gluttony', item: 'aguavberry', evs: {hp: 4}, moves: ['bellydrum']}, + ], [ + {species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk']}, + {species: "Whismur", level: 1, moves: ['seismictoss']}, + ]]); + + const wynaut = battle.p1.active[0]; + battle.makeChoices(); + assert.equal(wynaut.hp, Math.floor(wynaut.maxhp / 2)); + + // Gluttony doesn't activate because it missed the timing + battle.makeChoices('auto', 'switch 2'); + assert.equal(wynaut.hp, Math.floor(wynaut.maxhp / 2)); + + // Gluttony now has the opportunity to activate the Aguav Berry again on taking damage + battle.makeChoices(); + assert.equal(wynaut.hp, Math.floor(wynaut.maxhp / 2) - 1 + Math.floor(wynaut.maxhp * 0.33)); + }); + it.skip(`should not trigger twice if negated then replaced`, function () { battle = common.createBattle([[ {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, diff --git a/test/sim/abilities/unburden.js b/test/sim/abilities/unburden.js index 1119d1165e..4254cc3dba 100644 --- a/test/sim/abilities/unburden.js +++ b/test/sim/abilities/unburden.js @@ -68,42 +68,4 @@ describe('Unburden', function () { battle.makeChoices('move machpunch', 'move bestow'); assert.equal(battle.p1.active[0].getStat('spe'), originalSpeed); }); - - it(`should not trigger when Neutralizing Gas is active on the field`, function () { - battle = common.createBattle([[ - {species: "Wynaut", ability: 'unburden', item: 'sitrusberry', evs: {hp: 4}, moves: ['bellydrum']}, - ], [ - {species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: "Whismur", moves: ['sleeptalk']}, - ]]); - - const wynaut = battle.p1.active[0]; - const originalSpeed = wynaut.getStat('spe'); - battle.makeChoices(); - assert.equal(wynaut.getStat('spe'), originalSpeed); - - //The chance to trigger Unburden is gone, so it missed the timing and doesn't gain the speed post-NGas removal - battle.makeChoices('auto', 'switch 2'); - assert.equal(wynaut.getStat('spe'), originalSpeed); - }); - - it.skip(`should be negated while Neutralizing Gas is active on the field`, function () { - battle = common.createBattle([[ - {species: "Wynaut", ability: 'unburden', item: 'sitrusberry', evs: {hp: 4}, moves: ['bellydrum']}, - ], [ - {species: "Whismur", moves: ['sleeptalk']}, - {species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk']}, - ]]); - - const wynaut = battle.p1.active[0]; - const originalSpeed = wynaut.getStat('spe'); - battle.makeChoices(); - assert.equal(wynaut.getStat('spe'), originalSpeed * 2); - - battle.makeChoices('auto', 'switch 2'); - assert.equal(wynaut.getStat('spe'), originalSpeed); - - battle.makeChoices('auto', 'switch 2'); - assert.equal(wynaut.getStat('spe'), originalSpeed * 2); - }); });