Advertisement
Pikachuun

Mix and Mega Coad

Apr 16th, 2015
713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.86 KB | None | 0 0
  1. {
  2. name: "Mix and Mega",
  3. section: "Other Metagames" //"OM of the Month",
  4. //column: 2,
  5.  
  6. mod: 'mixandmega', //Forcibly prevent Knock Off + Trick
  7. ruleset: ['Pokemon', 'Standard', 'Swagger Clause', 'Team Preview'],
  8. banlist: ['Shadow Tag', 'Gengarite'],
  9. validateTeam: function (team, format) {
  10. var itemTable = {};
  11. for (var i = 0; i < team.length; i++) {
  12. var item = this.getItem(team[i].item);
  13. if (!item) continue;
  14. if (itemTable[item] && item.megaStone) {
  15. return ["You are limited to one of each Mega Stone.", "(You have more than one " + this.getItem(item).name + ")"];
  16. } else if (itemTable[item] && (item.id === "redorb" || item.name === "blueorb")) {
  17. return ["You are limited to one of each Primal Orb.", "(You have more than one " + this.getItem(item).name + ")"];
  18. }
  19. itemTable[item] = true;
  20. }
  21. },
  22. onBegin: function () {
  23. var allPokemon = this.p1.pokemon.concat(this.p2.pokemon);
  24. for (var i = 0, len = allPokemon.length; i < len; i++) {
  25. var pokemon = allPokemon[i];
  26. pokemon.baseSpecies = pokemon.baseTemplate.species; //Storage
  27. }
  28. },
  29. //Prepare Mega-Evolutions/Devolutions
  30. onSwitchInPriority: -6,
  31. onSwitchIn: function (pokemon) {
  32. if (!pokemon.template.isMega && !pokemon.template.isPrimal && !pokemon.canMegaEvo) {
  33. if (!pokemon.baseStatStorage) pokemon.baseStatStorage = {atk: pokemon.baseTemplate.baseStats.atk, def: pokemon.baseTemplate.baseStats.def, spa: pokemon.baseTemplate.baseStats.spa, spd: pokemon.baseTemplate.baseStats.spd, spe: pokemon.baseTemplate.baseStats.spe};
  34. if (!pokemon.typeStorage) pokemon.typeStorage = [pokemon.baseTemplate.types[0]];
  35. if (pokemon.baseTemplate.types[1]) pokemon.typeStorage[1] = pokemon.baseTemplate.types[1];
  36. if (!pokemon.weightStorage) pokemon.weightStorage = pokemon.baseTemplate.weightkg;
  37. var megaEvo = false;
  38. var item = (pokemon.item) ? this.getItem(pokemon.item) : false;
  39. var spec = pokemon.baseTemplate.species;
  40.  
  41. //Primal Devolution
  42. if (item && (item.id === 'redorb' || item.id === 'blueorb')) {
  43. //If you're an uber or uber-like Pokemon, don't [Gdon + Ogre will work as normal due to items.js]
  44. if (pokemon.baseTemplate.tier !== 'Uber' && spec !== 'Kyurem-Black' && spec !== 'Slaking' && spec !== 'Regigigas' && spec !== 'Cresselia' && !(pokemon.baseTemplate.evos && pokemon.baseTemplate.evos[0])) {
  45. var pstr = (item.id === 'redorb') ? 'Groudon-Primal' : 'Kyogre-Primal';
  46. var template = this.getTemplate(pstr);
  47. pokemon.formeChange(template);
  48. pokemon.baseTemplate = template;
  49. pokemon.details = template.species + (pokemon.level === 100 ? '' : ', L' + pokemon.level) + (pokemon.gender === '' ? '' : ', ' + pokemon.gender) + (pokemon.set.shiny ? ', shiny' : '');
  50. this.add('detailschange', pokemon, pokemon.details);
  51. this.add('message', pokemon.name + "'s Primal Reversion! It reverted to its primal form!");
  52. pokemon.setAbility(template.abilities['0']);
  53. pokemon.baseAbility = pokemon.ability;
  54. }
  55. }
  56.  
  57. //Mega Evolution
  58. //If you're an uber, don't.
  59. if (pokemon.baseTemplate.tier === 'Uber' && (spec !== 'Mewtwo' || (item.id !== 'mewtwonitex' && item.id !== 'mewtwonitey'))) return pokemon.canMegaEvo = false;
  60. //If you don't have a mega stone, you can't mega-evolve, except if you have Dragon Ascent.
  61. if ((!item || !item.megaStone) && pokemon.moves.indexOf('dragonascent') === -1) return pokemon.canMegaEvo = false;
  62. if (item && item.megaStone) megaEvo = item.megaStone;
  63. //Mega stones have priority over Rayquaza-Mega.
  64. if (!megaEvo && pokemon.moves.indexOf('dragonascent') > -1 && spec !== 'Rayquaza') megaEvo = 'Rayquaza-Mega'; //Prevent Rayquaza from Mega Evolving, but allow Smeargle to Mega-Evolve
  65. //If you aren't fully evolved, due to flavor reasons, you can't mega-evolve regardless.
  66. //I feel bad about this too, Mega-Pikachu would've been sick [Albeit Light Ball Pikachu still would be better]
  67. if (pokemon.baseTemplate.evos && pokemon.baseTemplate.evos[0]) return pokemon.canMegaEvo = false;
  68. var ab = [pokemon.baseTemplate.abilities[0], pokemon.baseTemplate.abilities[1], pokemon.baseTemplate.abilities['H']];
  69.  
  70. //Species-Based Mega-Evolutions
  71. if (spec === 'Kyurem-Black' || spec === 'Slaking' || spec === 'Regigigas' || spec === 'Cresselia') return pokemon.canMegaEvo = false;
  72. if (item.id === 'beedrillite' && spec !== 'Beedrill') return pokemon.canMegaEvo = false;
  73. if (item.id === 'kangaskhanite' && spec !== 'Kangaskhan') return pokemon.canMegaEvo = false;
  74. //Ability-Based Mega-Evolutions
  75. if (item.id === 'medichamite' && spec !== 'Medicham' && spec !== 'Mawile' && ab.indexOf('Huge Power') === -1 && ab.indexOf('Pure Power') === -1) return pokemon.canMegaEvo = false;
  76. if (item.id === 'mawilite' && spec !== 'Mawile' && ab.indexOf('Huge Power') === -1 && ab.indexOf('Pure Power') === -1) return pokemon.canMegaEvo = false;
  77. if (item.id === 'gengarite' && spec !== 'Gengar' && ab.indexOf('Shadow Tag') === -1) return pokemon.canMegaEvo = false;
  78. if (item.id === 'blazikenite' && spec !== 'Blaziken' && ab.indexOf('Speed Boost') === -1) return pokemon.canMegaEvo = false;
  79. //Stat-based Mega-Evolutions
  80. if ((item.id === 'ampharosite' || item.id === 'heracronite' || item.id === 'garchompite') && pokemon.baseStatStorage.spe < 10) return pokemon.canMegaEvo = false;
  81. if (item.id === 'cameruptite' && pokemon.baseStatStorage.spe < 20) return pokemon.canMegaEvo = false;
  82. if ((item.id === 'abomasite' || item.id === 'sablenite') && pokemon.baseStatStorage.spe < 30) return pokemon.canMegaEvo = false;
  83. if (item.id === 'beedrillite' && pokemon.baseStatStorage.spa < 30) return pokemon.canMegaEvo = false; //Doesn't matter
  84. if (item.id === 'diancite' && (pokemon.baseStatStorage.def < 40 || pokemon.baseStatStorage.spd < 40)) return pokemon.canMegaEvo = false;
  85. if (item.id === 'lopunnite' && pokemon.weightStorage < 5) return pokemon.canMegaEvo = false;
  86. if (item.id === 'mewtwonitey' && (pokemon.weightStorage < 89 || pokemon.baseStatStorage.def < 20)) return pokemon.canMegaEvo = false;
  87. //Overflow Limiter [SHUCKLE, Steelix, Regirock]
  88. if (spec === 'Shuckle' && ['abomasite', 'aggronite', 'audinite', 'cameruptite', 'charizarditex', 'charizarditey', 'galladite', 'gyaradosite', 'heracronite', 'houndoominite', 'latiasite', 'mewtwonitey', 'sablenite', 'salamencite', 'scizorite', 'sharpedonite', 'slowbronite', 'steelixite', 'tyranitarite', 'venusaurite'].indexOf(item.id) > -1) return pokemon.canMegaEvo = false;
  89. if ((spec === 'Steelix' || spec === 'Regirock') && item.id === 'slowbronite') return pokemon.canMegaEvo = false;
  90.  
  91. return pokemon.canMegaEvo = megaEvo;
  92. }
  93. },
  94. onModifyPokemon: function (pokemon) {
  95. for (var q in pokemon.side.pokemon) {
  96. var p = pokemon.side.pokemon[q];
  97. if ((p.baseTemplate.isMega || p.baseTemplate.isPrimal) && p.baseSpecies !== 'Kyogre' && p.baseSpecies !== 'Groudon') {
  98. if (!p.statCalc && !p.newBaseStats) {
  99. var spec = p.baseTemplate.species;
  100. p.megaBaseStats = {atk: p.baseStatStorage.atk, def: p.baseStatStorage.def, spa: p.baseStatStorage.spa, spd: p.baseStatStorage.spd, spe: p.baseStatStorage.spe};
  101. if (!p.megaTypes) p.megaTypes = [p.typeStorage[0]];
  102. if (p.typeStorage[1]) p.megaTypes[1] = p.typeStorage[1];
  103. p.megaWeight = p.weightStorage;
  104. if (spec === 'Abomasnow-Mega') {
  105. p.megaBaseStats.atk += 40;
  106. p.megaBaseStats.def += 30;
  107. p.megaBaseStats.spa += 40;
  108. p.megaBaseStats.spd += 20;
  109. p.megaBaseStats.spe -= 30;
  110. p.megaWeight += 2;
  111. } else if (spec === 'Absol-Mega') {
  112. p.megaBaseStats.atk += 20;
  113. p.megaBaseStats.spa += 40;
  114. p.megaBaseStats.spe += 40;
  115. } else if (spec === 'Aerodactyl-Mega') {
  116. p.megaBaseStats.atk += 30;
  117. p.megaBaseStats.def += 20;
  118. p.megaBaseStats.spa += 10;
  119. p.megaBaseStats.spd += 20;
  120. p.megaBaseStats.spe += 20;
  121. p.megaWeight += 20;
  122. } else if (spec === 'Aggron-Mega') {
  123. p.megaBaseStats.atk += 30;
  124. p.megaBaseStats.def += 50;
  125. p.megaBaseStats.spd += 20;
  126. p.megaWeight += 35;
  127. if (p.megaTypes[0] === 'Steel') p.megaTypes = ['Steel'];
  128. else p.megaTypes[1] = 'Steel';
  129. } else if (spec === 'Alakazam-Mega') {
  130. p.megaBaseStats.def += 20;
  131. p.megaBaseStats.spa += 40;
  132. p.megaBaseStats.spe += 30;
  133. } else if (spec === 'Altaria-Mega') {
  134. p.megaBaseStats.atk += 40;
  135. p.megaBaseStats.def += 20;
  136. p.megaBaseStats.spa += 40;
  137. if (p.megaTypes[0] === 'Fairy') p.megaTypes = ['Fairy'];
  138. else p.megaTypes[1] = 'Fairy';
  139. } else if (spec === 'Ampharos-Mega') {
  140. p.megaBaseStats.atk += 20;
  141. p.megaBaseStats.def += 20;
  142. p.megaBaseStats.spa += 50;
  143. p.megaBaseStats.spd += 20;
  144. p.megaBaseStats.spe -= 10;
  145. if (p.megaTypes[0] === 'Dragon') p.megaTypes = ['Dragon'];
  146. else p.megaTypes[1] = 'Dragon';
  147. } else if (spec === 'Audino-Mega') {
  148. p.megaBaseStats.def += 40;
  149. p.megaBaseStats.spa += 20;
  150. p.megaBaseStats.spd += 40;
  151. p.megaWeight += 1;
  152. if (p.megaTypes[0] === 'Fairy') p.megaTypes = ['Fairy'];
  153. else p.megaTypes[1] = 'Fairy';
  154. } else if (spec === 'Banette-Mega') {
  155. p.megaBaseStats.atk += 50;
  156. p.megaBaseStats.def += 10;
  157. p.megaBaseStats.spa += 10;
  158. p.megaBaseStats.spd += 20;
  159. p.megaBaseStats.spe += 10;
  160. p.megaWeight += .5;
  161. } else if (spec === 'Beedrill-Mega') { //Doesn't matter, but eehhhhhhhhhhhh
  162. p.megaBaseStats.atk += 60;
  163. p.megaBaseStats.spa -= 30;
  164. p.megaBaseStats.spe += 70;
  165. } else if (spec === 'Blastoise-Mega') {
  166. p.megaBaseStats.atk += 20;
  167. p.megaBaseStats.def += 20;
  168. p.megaBaseStats.spa += 50;
  169. p.megaBaseStats.spd += 10;
  170. p.megaWeight += 15.6;
  171. } else if (spec === 'Blaziken-Mega') {
  172. p.megaBaseStats.atk += 40;
  173. p.megaBaseStats.def += 10;
  174. p.megaBaseStats.spa += 20;
  175. p.megaBaseStats.spd += 10;
  176. p.megaBaseStats.spe += 20;
  177. } else if (spec === 'Camerupt-Mega') {
  178. p.megaBaseStats.atk += 20;
  179. p.megaBaseStats.def += 30;
  180. p.megaBaseStats.spa += 40;
  181. p.megaBaseStats.spd += 30;
  182. p.megaBaseStats.spe -= 20;
  183. p.megaWeight += 100.5;
  184. } else if (spec === 'Charizard-Mega-X') {
  185. p.megaBaseStats.atk += 46;
  186. p.megaBaseStats.def += 33;
  187. p.megaBaseStats.spa += 21;
  188. p.megaWeight += 20;
  189. if (p.megaTypes[0] === 'Dragon') p.megaTypes = ['Dragon'];
  190. else p.megaTypes[1] = 'Dragon';
  191. } else if (spec === 'Charizard-Mega-Y') {
  192. p.megaBaseStats.atk += 20;
  193. p.megaBaseStats.spa += 50;
  194. p.megaBaseStats.spd += 30;
  195. p.megaWeight += 10;
  196. } else if (spec === 'Diancie-Mega') {
  197. p.megaBaseStats.atk += 60;
  198. p.megaBaseStats.def -= 40;
  199. p.megaBaseStats.spa += 60;
  200. p.megaBaseStats.spd -= 40;
  201. p.megaBaseStats.spe += 60;
  202. p.megaWeight += 19;
  203. } else if (spec === 'Gallade-Mega') {
  204. p.megaBaseStats.atk += 40;
  205. p.megaBaseStats.def += 30;
  206. p.megaBaseStats.spe += 30;
  207. p.megaWeight += 4.4;
  208. } else if (spec === 'Garchomp-Mega') {
  209. p.megaBaseStats.atk += 40;
  210. p.megaBaseStats.def += 20;
  211. p.megaBaseStats.spa += 40;
  212. p.megaBaseStats.spd += 10;
  213. p.megaBaseStats.spe -= 10;
  214. } else if (spec === 'Gardevoir-Mega') {
  215. p.megaBaseStats.atk += 20;
  216. p.megaBaseStats.spa += 40;
  217. p.megaBaseStats.spd += 20;
  218. p.megaBaseStats.spe += 20;
  219. } else if (spec === 'Gengar-Mega') {
  220. p.megaBaseStats.def += 20;
  221. p.megaBaseStats.spa += 40;
  222. p.megaBaseStats.spd += 20;
  223. p.megaBaseStats.spe += 20;
  224. } else if (spec === 'Glalie-Mega') {
  225. p.megaBaseStats.atk += 40;
  226. p.megaBaseStats.spa += 40;
  227. p.megaBaseStats.spe += 20;
  228. p.megaWeight += 93.7;
  229. } else if (spec === 'Groudon-Primal') {
  230. p.megaBaseStats.atk += 30;
  231. p.megaBaseStats.def += 20;
  232. p.megaBaseStats.spa += 50;
  233. p.megaWeight += 49.7;
  234. if (p.megaTypes[0] === 'Fire') p.megaTypes = ['Fire'];
  235. else p.megaTypes[1] = 'Fire';
  236. } else if (spec === 'Gyarados-Mega') {
  237. p.megaBaseStats.atk += 30;
  238. p.megaBaseStats.def += 30;
  239. p.megaBaseStats.spa += 10;
  240. p.megaBaseStats.spd += 30;
  241. p.megaWeight += 70;
  242. if (p.megaTypes[0] === 'Dark') p.megaTypes = ['Dark'];
  243. else p.megaTypes[1] = 'Dark';
  244. } else if (spec === 'Heracross-Mega') {
  245. p.megaBaseStats.atk += 60;
  246. p.megaBaseStats.def += 40;
  247. p.megaBaseStats.spd += 10;
  248. p.megaBaseStats.spe -= 10;
  249. p.megaWeight += 8.5;
  250. } else if (spec === 'Houndoom-Mega') {
  251. p.megaBaseStats.def += 40;
  252. p.megaBaseStats.spa += 30;
  253. p.megaBaseStats.spd += 10;
  254. p.megaBaseStats.spe += 20;
  255. p.megaWeight += 14.5;
  256. } else if (spec === 'Kangaskhan-Mega') { //hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
  257. p.megaBaseStats.atk += 30;
  258. p.megaBaseStats.def += 20;
  259. p.megaBaseStats.spa += 20;
  260. p.megaBaseStats.spd += 20;
  261. p.megaBaseStats.spe += 10;
  262. } else if (spec === 'Kyogre-Primal') {
  263. p.megaBaseStats.atk += 50;
  264. p.megaBaseStats.spa += 30;
  265. p.megaBaseStats.spd += 20;
  266. p.megaWeight += 78;
  267. } else if (spec === 'Latias-Mega') {
  268. p.megaBaseStats.atk += 20;
  269. p.megaBaseStats.def += 30;
  270. p.megaBaseStats.spa += 30;
  271. p.megaBaseStats.spd += 20;
  272. p.megaWeight += 12;
  273. } else if (spec === 'Latios-Mega') {
  274. p.megaBaseStats.atk += 40;
  275. p.megaBaseStats.def += 20;
  276. p.megaBaseStats.spa += 30;
  277. p.megaBaseStats.spd += 10;
  278. p.megaWeight += 10;
  279. } else if (spec === 'Lopunny-Mega') {
  280. p.megaBaseStats.atk += 60;
  281. p.megaBaseStats.def += 10;
  282. p.megaBaseStats.spe += 30;
  283. p.megaWeight -= 5;
  284. if (p.megaTypes[0] === 'Fighting') p.megaTypes = ['Fighting'];
  285. else p.megaTypes[1] = 'Fighting';
  286. } else if (spec === 'Lucario-Mega') {
  287. p.megaBaseStats.atk += 35;
  288. p.megaBaseStats.def += 18;
  289. p.megaBaseStats.spa += 25;
  290. p.megaBaseStats.spe += 22;
  291. p.megaWeight += 3.5;
  292. } else if (spec === 'Manectric-Mega') {
  293. p.megaBaseStats.def += 20;
  294. p.megaBaseStats.spa += 30;
  295. p.megaBaseStats.spd += 20;
  296. p.megaBaseStats.spe += 30;
  297. p.megaWeight += 3.8;
  298. } else if (spec === 'Mawile-Mega') {
  299. p.megaBaseStats.atk += 20;
  300. p.megaBaseStats.def += 40;
  301. p.megaBaseStats.spd += 40;
  302. p.megaWeight += 12;
  303. } else if (spec === 'Medicham-Mega') {
  304. p.megaBaseStats.atk += 40;
  305. p.megaBaseStats.def += 10;
  306. p.megaBaseStats.spa += 20;
  307. p.megaBaseStats.spd += 10;
  308. p.megaBaseStats.spe += 20;
  309. } else if (spec === 'Metagross-Mega') {
  310. p.megaBaseStats.atk += 10;
  311. p.megaBaseStats.def += 20;
  312. p.megaBaseStats.spa += 10;
  313. p.megaBaseStats.spd += 20;
  314. p.megaBaseStats.spe += 40;
  315. p.megaWeight += 392.9;
  316. } else if (spec === 'Mewtwo-Mega-X') {
  317. p.megaBaseStats.atk += 80;
  318. p.megaBaseStats.def += 10;
  319. p.megaBaseStats.spd += 10;
  320. p.megaWeight += 5;
  321. if (p.megaTypes[0] === 'Fighting') p.megaTypes = ['Fighting'];
  322. else p.megaTypes[1] = 'Fighting';
  323. } else if (spec === 'Mewtwo-Mega-Y') {
  324. p.megaBaseStats.atk += 40;
  325. p.megaBaseStats.def -= 20;
  326. p.megaBaseStats.spa += 40;
  327. p.megaBaseStats.spd += 30;
  328. p.megaBaseStats.spe += 10;
  329. p.megaWeight -= 89;
  330. } else if (spec === 'Pidgeot-Mega') {
  331. p.megaBaseStats.def += 5;
  332. p.megaBaseStats.spa += 65;
  333. p.megaBaseStats.spd += 10;
  334. p.megaBaseStats.spe += 20;
  335. p.megaWeight += 11;
  336. } else if (spec === 'Pinsir-Mega') {
  337. p.megaBaseStats.atk += 30;
  338. p.megaBaseStats.def += 20;
  339. p.megaBaseStats.spa += 10;
  340. p.megaBaseStats.spd += 20;
  341. p.megaBaseStats.spe += 20;
  342. p.megaWeight += 4;
  343. if (p.megaTypes[0] === 'Flying') p.megaTypes = ['Flying'];
  344. else p.megaTypes[1] = 'Flying';
  345. } else if (spec === 'Rayquaza-Mega') {
  346. p.megaBaseStats.atk += 30;
  347. p.megaBaseStats.def += 10;
  348. p.megaBaseStats.spa += 30;
  349. p.megaBaseStats.spd += 10;
  350. p.megaBaseStats.spe += 20;
  351. p.megaWeight += 185.5;
  352. } else if (spec === 'Sableye-Mega') {
  353. p.megaBaseStats.atk += 10;
  354. p.megaBaseStats.def += 50;
  355. p.megaBaseStats.spa += 20;
  356. p.megaBaseStats.spd += 50;
  357. p.megaBaseStats.spe -= 30;
  358. p.megaWeight += 150;
  359. } else if (spec === 'Salamence-Mega') {
  360. p.megaBaseStats.atk += 10;
  361. p.megaBaseStats.def += 50;
  362. p.megaBaseStats.spa += 10;
  363. p.megaBaseStats.spd += 10;
  364. p.megaBaseStats.spe += 20;
  365. p.megaWeight += 10;
  366. } else if (spec === 'Sceptile-Mega') {
  367. p.megaBaseStats.atk += 25;
  368. p.megaBaseStats.def += 10;
  369. p.megaBaseStats.spa += 40;
  370. p.megaBaseStats.spe += 25;
  371. p.megaWeight += 3;
  372. if (p.megaTypes[0] === 'Dragon') p.megaTypes = ['Dragon'];
  373. else p.megaTypes[1] = 'Dragon';
  374. } else if (spec === 'Scizor-Mega') {
  375. p.megaBaseStats.atk += 20;
  376. p.megaBaseStats.def += 40;
  377. p.megaBaseStats.spa += 10;
  378. p.megaBaseStats.spd += 20;
  379. p.megaBaseStats.spe += 10;
  380. p.megaWeight += 7;
  381. } else if (spec === 'Sharpedo-Mega') {
  382. p.megaBaseStats.atk += 20;
  383. p.megaBaseStats.def += 30;
  384. p.megaBaseStats.spa += 15;
  385. p.megaBaseStats.spd += 25;
  386. p.megaBaseStats.spe += 10;
  387. p.megaWeight += 41.5;
  388. } else if (spec === 'Slowbro-Mega') {
  389. p.megaBaseStats.def += 70;
  390. p.megaBaseStats.spa += 30;
  391. p.megaWeight += 31.5;
  392. } else if (spec === 'Steelix-Mega') {
  393. p.megaBaseStats.atk += 40;
  394. p.megaBaseStats.def += 30;
  395. p.megaBaseStats.spd += 30;
  396. p.megaWeight += 340;
  397. } else if (spec === 'Swampert-Mega') {
  398. p.megaBaseStats.atk += 40;
  399. p.megaBaseStats.def += 20;
  400. p.megaBaseStats.spa += 10;
  401. p.megaBaseStats.spd += 20;
  402. p.megaBaseStats.spe += 10;
  403. p.megaWeight += 20.1;
  404. } else if (spec === 'Tyranitar-Mega') {
  405. p.megaBaseStats.atk += 30;
  406. p.megaBaseStats.def += 40;
  407. p.megaBaseStats.spd += 20;
  408. p.megaBaseStats.spe += 10;
  409. p.megaWeight += 53;
  410. } else if (spec === 'Venusaur-Mega') {
  411. p.megaBaseStats.atk += 18;
  412. p.megaBaseStats.def += 40;
  413. p.megaBaseStats.spa += 22;
  414. p.megaBaseStats.spd += 20;
  415. p.megaWeight += 55;
  416. }
  417. p.statCalc = true;
  418. }
  419. p.newBaseStats = {};
  420. for (var statName in p.megaBaseStats) {
  421. var stat = p.megaBaseStats[statName];
  422. stat = Math.floor(Math.floor(2 * stat + p.set.ivs[statName] + Math.floor(p.set.evs[statName] / 4)) * p.level / 100 + 5);
  423. var nature = p.battle.getNature(p.set.nature);
  424. if (statName === nature.plus) stat *= 1.1;
  425. if (statName === nature.minus) stat *= 0.9;
  426. p.newBaseStats[statName] = Math.floor(stat);
  427. }
  428. p.baseStats = p.stats = p.newBaseStats;
  429. if (!p.typestr) {
  430. p.typestr = p.megaTypes[0];
  431. if (p.megaTypes[1]) p.typestr += '/' + p.megaTypes[1];
  432. }
  433. if (!p.typechange && p.isActive) {
  434. this.add('-start', pokemon, 'typechange', p.typestr);
  435. p.typechange = true;
  436. p.typesData = [{type: p.megaTypes[0], suppressed: false, isAdded: false}];
  437. if (p.megaTypes[1]) p.typesData[1] = {type: p.megaTypes[1], suppressed: false, isAdded: false};
  438. this.add('-message', p.name + ' is a ' + p.baseSpecies + '!');
  439. } else if (p.typechange && !p.isActive) {
  440. p.typechange = false;
  441. }
  442. }
  443. }
  444. }
  445. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement