Advertisement
Pikachuun

colorchange

Jul 23rd, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. "colorchange": {
  2.     desc: "This Pokemon's secondary type changes according to it's most powerful attack.",
  3.     shortDesc: "This Pokemon's secondary type changes according to it's most powerful attack.",
  4.     onStart: function (pokemon) {
  5.         var secelt = [0, 0];
  6.         for (var i in pokemon.moves) {
  7.             var bp = this.getMove(pokemon.moves[i]).basePower;
  8.             if (bp > secelt[0]) secelt = [bp, i];
  9.         }
  10.         var type = this.getMove(pokemon.moves[secelt[1]]).type;
  11.         var pTypes = pokemon.types;
  12.         if (pTypes[0] !== type && (!pTypes[1] || pTypes[1] !== type)) {
  13.             pTypes[1] = type;
  14.             this.add('-start', pokemon, 'typechange', pTypes.join('/'));
  15.             pokemon.typesData = [
  16.                 {type: pTypes[0], suppressed: false, isAdded: false},
  17.                 {type: pTypes[1], suppressed: false, isAdded: false}
  18.             ];
  19.         }
  20.     },
  21.     id: "colorchange",
  22.     name: "Color Change",
  23.     rating: 4,
  24.     num: 16
  25. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement