Pokemon_server / test /sim /misc /fainted-forme-regression.js
Jofthomas's picture
Jofthomas HF staff
Upload 4781 files
5c2ed06 verified
'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe(`Fainted forme regression`, () => {
afterEach(() => {
battle.destroy();
});
it('[Hackmons] should be able to revert between different mega evolutions', () => {
battle = common.createBattle([[
{ species: 'charizardmegay', ability: 'drought', item: 'charizarditex', moves: ['memento'] },
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices('move memento mega', 'auto');
assert.species(pokemon, 'Charizard-Mega-Y');
assert.hasAbility(pokemon, 'Drought');
});
it(`should revert Mega Evolutions`, () => {
battle = common.createBattle([[
{ species: 'alakazam', ability: 'synchronize', item: 'alakazite', moves: ['memento'] },
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices('move memento mega', 'auto');
assert.species(pokemon, 'Alakazam');
assert.hasAbility(pokemon, 'Synchronize');
});
it(`should revert Rayquaza-Mega`, () => {
battle = common.gen(7).createBattle([[
{ species: 'rayquaza', ability: 'airlock', moves: ['memento', 'dragonascent'] },
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices('move memento mega', 'auto');
assert.species(pokemon, 'Rayquaza');
assert.hasAbility(pokemon, 'Air Lock');
});
it(`should revert Primal forms`, () => {
battle = common.createBattle([[
{ species: 'kyogre', ability: 'drizzle', moves: ['memento'] },
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices();
assert.species(pokemon, 'Kyogre');
assert.hasAbility(pokemon, 'Drizzle');
});
it(`shouldn't revert Arceus-forms to base Arceus`, () => {
battle = common.createBattle([[
{ species: 'arceusfire', ability: 'multitype', item: 'flameplate', moves: ['memento'] },
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices();
assert.species(pokemon, 'Arceus-Fire');
assert.hasAbility(pokemon, 'Multitype');
});
it("should revert Terastallized Morpeko-Hangry to base Morpeko", () => {
battle = common.gen(9).createBattle([[
{ species: 'Morpeko', ability: 'hungerswitch', moves: ['memento', 'sleeptalk'] },
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices('move sleeptalk', 'auto');
assert.species(pokemon, 'Morpeko-Hangry');
battle.makeChoices('move memento terastallize', 'auto');
assert.species(pokemon, 'Morpeko');
assert.hasAbility(pokemon, 'Hunger Switch');
});
it(`shouldn't revert Palafin-Hero to base Palafin`, () => {
battle = common.createBattle([[
{ species: 'palafin', ability: 'zerotohero', moves: ['memento'] },
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices('switch 2', 'auto');
battle.makeChoices('switch 2', 'auto');
assert.species(pokemon, 'Palafin-Hero');
battle.makeChoices('move memento', 'auto');
assert.species(pokemon, 'Palafin-Hero');
assert.hasAbility(pokemon, 'Zero to Hero');
});
it(`should revert Ogerpon-Tera to base Ogerpon`, () => {
battle = common.gen(9).createBattle([[
{
species: 'ogerponwellspring', ability: 'waterabsorb', item: 'wellspring mask',
moves: ['memento'], teraType: 'Water',
},
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices('move memento terastallize', 'auto');
assert.species(pokemon, 'Ogerpon-Wellspring');
assert.hasAbility(pokemon, 'Water Absorb');
});
it(`shouldn't revert Terapagos-Terastal to base Terapagos`, () => {
battle = common.createBattle([[
{ species: 'terapagos', ability: 'terashift', moves: ['memento'] },
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices();
assert.species(pokemon, 'Terapagos-Terastal');
assert.hasAbility(pokemon, 'Tera Shell');
});
it(`should revert Terapagos-Stellar to base Terapagos`, () => {
battle = common.gen(9).createBattle([[
{ species: 'terapagos', ability: 'terashift', moves: ['memento'], teraType: 'Stellar' },
{ species: 'darkrai', moves: ['darkpulse'] },
], [
{ species: 'mareep', ability: 'static', moves: ['sleeptalk'] },
]]);
const pokemon = battle.p1.active[0];
battle.makeChoices('move memento terastallize', 'auto');
assert.species(pokemon, 'Terapagos');
assert.hasAbility(pokemon, 'Tera Shift');
});
});