mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-05 21:17:43 -05:00
Add a source parameter to BattlePokemon#transformInto
This allows it to send a proper [from] tag to the client.
This commit is contained in:
parent
489fe131ce
commit
002ea198f7
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user