Skip to content

Commit

Permalink
Fix incorrect ability message from Gen 1 Transform
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibo committed Jun 2, 2019
1 parent 19bc39b commit 27a9964
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sim/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ export class Pokemon {
} else {
this.battle.add('-transform', this, pokemon);
}
this.setAbility(pokemon.ability, this, true);
if (this.battle.gen > 2) this.setAbility(pokemon.ability, this, true);

// Change formes based on held items (for Transform)
// Only ever relevant in Generation 4 since Generation 3 didn't have item-based forme changes
Expand Down
15 changes: 15 additions & 0 deletions test/sim/moves/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,18 @@ describe('Transform [Gen 4]', function () {
assert.strictEqual(battle.p1.active[0].template, battle.p2.active[0].template);
});
});

describe('Transform [Gen 1]', function () {
afterEach(function () {
battle.destroy();
});

it("should not send |-endability|", function () {
battle = common.gen(1).createBattle();
battle.setPlayer('p1', {team: [{species: "Ditto", moves: ['transform']}]});
battle.setPlayer('p2', {team: [{species: "Gengar", moves: ['lick']}]});
battle.makeChoices('move transform', 'move lick');

assert.ok(battle.log.every(line => !line.startsWith('|-endability|')));
});
});

0 comments on commit 27a9964

Please sign in to comment.