Skip to content

Commit

Permalink
Animate detailschange
Browse files Browse the repository at this point in the history
  • Loading branch information
Slayer95 committed May 10, 2014
1 parent e3d5ada commit 8cf6726
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4977,6 +4977,18 @@ function Battle(frame, logFrame, noPreload) {
case 'detailschange':
if (self.waitForResult()) return;
var poke = self.getPokemon(args[1]);
var newSpecies;
var commaIndex = args[2].indexOf(',');
if (commaIndex === -1) {
newSpecies = args[2];
} else {
newSpecies = args[2].substr(0, commaIndex);
}
var template = Tools.getTemplate(newSpecies);
if (poke.sprite.sp.shiny) template.shiny = true;
poke.sprite.animTransform(template);
poke.removeVolatile('typechange');
poke.side.updateStatbar();
poke.searchid = args[1].substr(0, 2) + args[1].substr(3) + '|' + args[2];
break;
case 'teampreview':
Expand Down

0 comments on commit 8cf6726

Please sign in to comment.