Spaces:
Running
Running
File size: 10,670 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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Commander', () => {
afterEach(() => {
battle.destroy();
});
it(`should skip Tatsugiri's action while commanding`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'wynaut', moves: ['sleeptalk'] },
{ species: 'wobbuffet', moves: ['sleeptalk'] },
], [
{ species: 'tatsugiri', ability: 'commander', moves: ['swordsdance'] },
{ species: 'dondozo', moves: ['sleeptalk'] },
]]);
assert.cantMove(() => battle.p2.choose('move swordsdance', 'move sleeptalk'));
});
it(`should not work if another Pokemon is Transformed into Dondozo`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'wynaut', moves: ['sleeptalk'] },
{ species: 'dondozo', moves: ['sleeptalk'] },
], [
{ species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] },
{ species: 'mew', moves: ['transform'] },
]]);
battle.makeChoices('auto', 'move sleeptalk, move transform 2');
const mewDondozo = battle.p2.active[1];
assert.false(!!mewDondozo.volatiles['commanded']);
});
it(`should not work if another Pokemon is Transformed into Tatsugiri`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'wynaut', moves: ['sleeptalk'] },
{ species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] },
], [
{ species: 'roggenrola', moves: ['sleeptalk'] },
{ species: 'sunkern', ability: 'commander', moves: ['transform'] },
{ species: 'dondozo', moves: ['transform'] },
]]);
battle.makeChoices('auto', 'move sleeptalk, move transform 2');
battle.makeChoices('auto', 'switch 3, move sleeptalk');
const dondozo = battle.p2.active[0];
assert.false(!!dondozo.volatiles['commanded'], `Transformed Sunkern into another Tatsugiri should not trigger Commander`);
});
it(`should work if Tatsugiri is Transformed into another Pokemon with Commander`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'wynaut', moves: ['sleeptalk'] },
{ species: 'sunkern', ability: 'commander', moves: ['sleeptalk'] },
], [
{ species: 'roggenrola', moves: ['sleeptalk'] },
{ species: 'tatsugiri', ability: 'commander', moves: ['transform'] },
{ species: 'dondozo', moves: ['transform'] },
]]);
battle.makeChoices('auto', 'move sleeptalk, move transform 2');
battle.makeChoices('auto', 'switch 3, move sleeptalk');
const dondozo = battle.p2.active[0];
assert(!!dondozo.volatiles['commanded']);
});
it(`should work if Dondozo is Transformed`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'wynaut', moves: ['sleeptalk'] },
{ species: 'diglett', moves: ['sleeptalk'] },
], [
{ species: 'dondozo', moves: ['transform'] },
{ species: 'roggenrola', moves: ['sleeptalk'] },
{ species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] },
]]);
battle.makeChoices('auto', 'move transform 2, move sleeptalk');
battle.makeChoices('auto', 'move sleeptalk, switch 3');
const dondozo = battle.p2.active[0];
assert(!!dondozo.volatiles['commanded']);
});
it(`should cause Tatsugiri to dodge all moves, including moves which normally bypass semi-invulnerability`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'machamp', ability: 'noguard', moves: ['closecombat'] },
{ species: 'seviper', moves: ['toxic'] },
], [
{ species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] },
{ species: 'dondozo', moves: ['sleeptalk'] },
]]);
battle.makeChoices('move closecombat 1, move toxic 1', 'auto');
// Tatsugiri shouldn't be damaged from No Guard CC or Toxic
assert.fullHP(battle.p2.active[0]);
// It shouldn't redirect to Dondozo either
assert.fullHP(battle.p2.active[1]);
});
it(`should prevent all kinds of switchouts`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'wynaut', item: 'redcard', ability: 'noguard', moves: ['sleeptalk', 'tackle', 'dragontail'] },
{ species: 'gyarados', item: 'ejectbutton', ability: 'intimidate', moves: ['sleeptalk', 'trick', 'roar'] },
], [
{ species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] },
{ species: 'dondozo', moves: ['sleeptalk', 'peck'] },
{ species: 'rufflet', moves: ['sleeptalk'] },
]]);
// const tatsugiri = battle.p2.active[0];
const dondozo = battle.p2.active[1];
battle.makeChoices('move tackle 2, move trick 2', 'auto');
assert.holdsItem(dondozo);
assert.equal(battle.requestState, 'move', 'It should not have switched out on Eject Button');
battle.makeChoices('auto', 'move peck 1');
assert.false.holdsItem(battle.p1.active[0]);
assert.equal(battle.requestState, 'move', 'It should not have switched out on Red Card');
battle.makeChoices('move dragontail 2, move roar 2', 'auto');
assert.equal(battle.requestState, 'move', 'It should not have switched out on standard phazing moves');
});
it.skip(`should prevent Eject Pack switchouts`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'wynaut', item: 'redcard', ability: 'noguard', moves: ['sleeptalk', 'tackle', 'dragontail'] },
{ species: 'gyarados', item: 'ejectbutton', ability: 'intimidate', moves: ['sleeptalk', 'trick', 'roar'] },
], [
{ species: 'tatsugiri', ability: 'commander', item: 'ejectpack', moves: ['sleeptalk'] },
{ species: 'dondozo', item: 'ejectpack', moves: ['sleeptalk', 'peck'] },
{ species: 'rufflet', moves: ['sleeptalk'] },
]]);
const tatsugiri = battle.p2.active[0];
const dondozo = battle.p2.active[1];
assert.statStage(tatsugiri, 'atk', -1);
assert.equal(battle.requestState, 'move', 'It should not have switched out on Eject Pack');
assert.holdsItem(tatsugiri);
assert.statStage(dondozo, 'atk', 1);
assert.holdsItem(dondozo);
});
it(`should cause Dondozo to stay commanded even if Tatsugiri faints`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'hypno', moves: ['sleeptalk'] },
{ species: 'shuckle', moves: ['sleeptalk'] },
], [
{ species: 'tatsugiri', ability: 'commander', item: 'toxicorb', moves: ['sleeptalk'] },
{ species: 'dondozo', moves: ['sleeptalk', 'orderup'] },
{ species: 'teddiursa', moves: ['sleeptalk'] },
{ species: 'tatsugiridroopy', ability: 'commander', moves: ['sleeptalk'] },
]]);
// Kill turns for Toxic Orb to KO Tatsugiri
for (let i = 0; i < 7; i++) battle.makeChoices();
battle.makeChoices('', 'switch teddiursa');
assert.cantMove(() => battle.p2.choose('move sleeptalk, switch tatsugiri'));
battle.makeChoices('auto', 'switch tatsugiridroopy, move orderup 1');
assert.statStage(battle.p2.pokemon[1], 'atk', 3);
});
it(`should allow one Tatsugiri to occupy multiple Dondozo`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'wynaut', ability: 'noguard', moves: ['sheercold'] },
{ species: 'shuckle', moves: ['sleeptalk'] },
], [
{ species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] },
{ species: 'dondozo', moves: ['sleeptalk'] },
{ species: 'dondozo', moves: ['sleeptalk'] },
]]);
battle.makeChoices('move sheercold 2, move sleeptalk', 'auto');
battle.makeChoices('', 'switch 3');
const secondDondozo = battle.p2.active[1];
assert(!!secondDondozo.volatiles['commanded']);
});
it(`should not work in Multi Battles`, () => {
battle = common.createBattle({ gameType: 'multi' }, [[
{ species: 'diggersby', moves: ['sleeptalk'] },
], [
{ species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] },
], [
{ species: 'cubone', moves: ['sleeptalk'] },
], [
{ species: 'dondozo', moves: ['sleeptalk'] },
]]);
const dondozo = battle.p4.active[0];
assert.false(!!dondozo.volatiles['commanded']);
});
it(`should prevent Dondozo and Tatsugiri from combining if Commander is suppressed`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'shuckle', moves: ['sleeptalk'] },
{ species: 'weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] },
{ species: 'wynaut', moves: ['sleeptalk'] },
], [
{ species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] },
{ species: 'dondozo', moves: ['sleeptalk'] },
]]);
const dondozo = battle.p2.active[1];
assert.false(!!dondozo.volatiles['commanded']);
battle.makeChoices('move sleeptalk, switch 3', 'auto');
assert(!!dondozo.volatiles['commanded']);
});
it(`should not split apart Dondozo and Tatsugiri if Neutralizing Gas switches in`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'shuckle', moves: ['sleeptalk'] },
{ species: 'wynaut', moves: ['sleeptalk'] },
{ species: 'weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] },
], [
{ species: 'tatsugiri', ability: 'commander', moves: ['dazzlinggleam'] },
{ species: 'dondozo', moves: ['sleeptalk'] },
]]);
battle.makeChoices('switch 3, move sleeptalk', 'auto');
battle.makeChoices();
const dondozo = battle.p2.active[1];
assert(!!dondozo.volatiles['commanded']);
const shuckle = battle.p1.active[0];
assert.fullHP(shuckle, `Shuckle should have never taken damage from Dazzling Gleam`);
});
it(`should allow Tatsugiri to move again if Dondozo faints while Neutralizing Gas is active`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'shuckle', moves: ['sleeptalk'] },
{ species: 'wynaut', moves: ['sleeptalk'] },
{ species: 'weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] },
], [
{ species: 'tatsugiri', ability: 'commander', moves: ['dazzlinggleam'] },
{ species: 'dondozo', moves: ['memento'] },
]]);
battle.makeChoices('switch 3, move sleeptalk', 'auto');
battle.makeChoices();
const tatsugiri = battle.p2.pokemon[0];
assert.false(!!tatsugiri.volatiles['commanding']);
battle.makeChoices();
const shuckle = battle.p1.active[0];
assert.false.fullHP(shuckle, `Shuckle should have taken damage from Dazzling Gleam`);
});
it(`should activate after hazards run`, () => {
battle = common.createBattle({ gameType: 'doubles' }, [[
{ species: 'regieleki', moves: ['toxicspikes'] },
{ species: 'registeel', moves: ['sleeptalk'] },
], [
{ species: 'shuckle', moves: ['uturn'] },
{ species: 'dondozo', moves: ['sleeptalk'] },
{ species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] },
]]);
battle.makeChoices();
battle.makeChoices();
const tatsugiri = battle.p2.pokemon[0];
assert.equal(tatsugiri.status, 'psn');
});
});
|