Fix Commander with Neutralizing Gas after Dondozo faints

This commit is contained in:
Leonard Craft III 2023-09-26 19:02:29 -05:00
parent 82f840e4cb
commit ba2a5e31f2
2 changed files with 22 additions and 1 deletions

View File

@ -824,7 +824,7 @@ export class Pokemon {
for (const pokemon of this.battle.getAllActive()) {
// can't use hasAbility because it would lead to infinite recursion
if (pokemon.ability === ('neutralizinggas' as ID) && !pokemon.volatiles['gastroacid'] &&
!pokemon.transformed && !pokemon.abilityState.ending) {
!pokemon.transformed && !pokemon.abilityState.ending && !this.volatiles['commanding']) {
return true;
}
}

View File

@ -192,6 +192,27 @@ describe('Commander', function () {
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`, function () {
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.skip(`should activate after hazards run`, function () {
battle = common.createBattle({gameType: 'doubles'}, [[
{species: 'regieleki', moves: ['toxicspikes']},