Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect ability message from Gen 1 Transform #5518

Merged
merged 1 commit into from
Jun 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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|')));
});
});