diff --git a/battle-engine.js b/battle-engine.js index 9bc459d259..84d8462b62 100644 --- a/battle-engine.js +++ b/battle-engine.js @@ -744,7 +744,7 @@ BattlePokemon = (function () { this.battle.singleEvent('Copy', this.getVolatile(i), this.volatiles[i], this); } }; - BattlePokemon.prototype.transformInto = function (pokemon, user) { + BattlePokemon.prototype.transformInto = function (pokemon, user, effect) { var template = pokemon.template; if (pokemon.fainted || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5)) { return false; @@ -793,7 +793,11 @@ BattlePokemon = (function () { for (var j in pokemon.boosts) { this.boosts[j] = pokemon.boosts[j]; } - this.battle.add('-transform', this, pokemon); + if (effect) { + this.battle.add('-transform', this, pokemon, '[from] ' + effect); + } else { + this.battle.add('-transform', this, pokemon); + } this.setAbility(pokemon.ability); this.update(); return true; diff --git a/data/abilities.js b/data/abilities.js index c0aa238f26..602400a556 100644 --- a/data/abilities.js +++ b/data/abilities.js @@ -1175,8 +1175,7 @@ exports.BattleAbilities = { onStart: function (pokemon) { var target = pokemon.side.foe.active[pokemon.side.foe.active.length - 1 - pokemon.position]; if (target) { - this.add('-ability', pokemon, 'Imposter'); - pokemon.transformInto(target, pokemon); + pokemon.transformInto(target, pokemon, this.getAbility('imposter')); } }, id: "imposter",