Spaces:
Sleeping
Sleeping
File size: 5,084 Bytes
5c2ed06 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Knock Off', () => {
afterEach(() => {
battle.destroy();
});
it('should remove most items', () => {
battle = common.createBattle();
battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] });
battle.setPlayer('p2', { team: [{ species: "Blissey", ability: 'naturalcure', item: 'shedshell', moves: ['softboiled'] }] });
battle.makeChoices('move knockoff', 'move softboiled');
assert.equal(battle.p2.active[0].item, '');
});
it('should not remove items when hitting Sub', () => {
battle = common.createBattle();
battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'noability', moves: ['knockoff'] }] });
battle.setPlayer('p2', { team: [{ species: "Ninjask", ability: 'noability', item: 'shedshell', moves: ['substitute'] }] });
battle.makeChoices();
assert.equal(battle.p2.active[0].item, 'shedshell');
});
it('should not remove plates from Arceus', () => {
battle = common.createBattle();
battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] });
battle.setPlayer('p2', { team: [{ species: "Arceus", ability: 'download', item: 'flameplate', moves: ['swordsdance'] }] });
battle.makeChoices('move knockoff', 'move swordsdance');
assert.equal(battle.p2.active[0].item, 'flameplate');
});
it('should not remove drives from Genesect', () => {
battle = common.createBattle();
battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] });
battle.setPlayer('p2', { team: [{ species: "Genesect", ability: 'download', item: 'dousedrive', moves: ['shiftgear'] }] });
battle.makeChoices('move knockoff', 'move shiftgear');
assert.equal(battle.p2.active[0].item, 'dousedrive');
});
it('should not remove correctly held mega stones', () => {
battle = common.createBattle();
battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] });
battle.setPlayer('p2', { team: [{ species: "Scizor", ability: 'technician', item: 'scizorite', moves: ['swordsdance'] }] });
battle.makeChoices('move knockoff', 'move swordsdance');
assert.equal(battle.p2.active[0].item, 'scizorite');
});
it('should remove wrong mega stones', () => {
battle = common.createBattle();
battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] });
battle.setPlayer('p2', { team: [{ species: "Scizor", ability: 'technician', item: 'audinite', moves: ['swordsdance'] }] });
battle.makeChoices('move knockoff', 'move swordsdance');
assert.equal(battle.p2.active[0].item, '');
});
it('should not remove items if the user faints mid-move', () => {
battle = common.createBattle();
battle.setPlayer('p1', { team: [{ species: "Shedinja", ability: 'wonderguard', moves: ['knockoff'] }] });
battle.setPlayer('p2', { team: [{ species: "Ferrothorn", ability: 'ironbarbs', item: 'rockyhelmet', moves: ['curse'] }] });
battle.makeChoices('move knockoff', 'move curse');
assert.equal(battle.p2.active[0].item, 'rockyhelmet');
});
});
describe('Knock Off [Gen 4]', () => {
afterEach(() => {
battle.destroy();
});
it('should only make the held item unusable, not actually remove it', () => {
battle = common.gen(4).createBattle([[
{ species: 'Wynaut', moves: ['knockoff'] },
], [
{ species: 'Aggron', item: 'leftovers', moves: ['sleeptalk'] },
]]);
battle.makeChoices();
assert.holdsItem(battle.p2.active[0]);
assert.false.fullHP(battle.p2.active[0], 'Aggron should not have been healed by Leftovers.');
});
it('should make the target unable to gain a new item', () => {
battle = common.gen(4).createBattle([[
{ species: 'Wynaut', item: 'pokeball', moves: ['knockoff', 'trick'] },
], [
{ species: 'Blissey', item: 'leftovers', moves: ['sleeptalk', 'thief'] },
]]);
battle.makeChoices();
assert.equal(battle.p1.active[0].item, 'pokeball');
assert.equal(battle.p2.active[0].item, 'leftovers');
battle.makeChoices('move trick', 'move thief');
assert.equal(battle.p1.active[0].item, 'pokeball');
assert.equal(battle.p2.active[0].item, 'leftovers');
});
it(`should not knock off the target's item if the target's ability is Sticky Hold or Multitype`, () => {
battle = common.gen(4).createBattle([[
{ species: 'Wynaut', moves: ['knockoff'] },
], [
{ species: 'Aggron', ability: 'stickyhold', item: 'leftovers', moves: ['sleeptalk'] },
]]);
battle.makeChoices();
assert.holdsItem(battle.p2.active[0]);
assert.fullHP(battle.p2.active[0], 'Aggron should have been healed by Leftovers.');
battle.destroy();
battle = common.gen(4).createBattle([[
{ species: 'Wynaut', moves: ['knockoff'] },
], [
{ species: 'Arceus', ability: 'multitype', item: 'leftovers', moves: ['sleeptalk'] },
]]);
battle.makeChoices();
assert.holdsItem(battle.p2.active[0]);
assert.fullHP(battle.p2.active[0], 'Arceus should have been healed by Leftovers.');
});
});
|