Guest User

Untitled

a guest
Mar 15th, 2018
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.56 KB | None | 0 0
  1. 'use strict';
  2.  
  3. exports.BattleMovedex = {
  4. "pollenterrain": {
  5. accuracy: true,
  6. basePower: 0,
  7. category: "Status",
  8. id: "pollenterrain",
  9. name: "Pollen Terrain",
  10. pp: 10,
  11. priority: 0,
  12. flags: {nonsky: 1},
  13. terrain: 'pollenterrain',
  14. effect: {
  15. duration: 5,
  16. durationCallback: function (source, effect) {
  17. if (source && source.hasItem('terrainextender')) {
  18. return 8;
  19. }
  20. return 5;
  21. },
  22. onBasePower: function (basePower, attacker, defender, move) {
  23. if (move.type === 'Bug' && defender.isGrounded() && !attacker.isSemiInvulnerable()) {
  24. this.debug('terrain boost');
  25. return this.chainModify(1.5);
  26. }
  27. },
  28. onTryMovePriority: -1,
  29. onTryMove: function (pokemon, target, move) {
  30. if (move.flags.bullet && target.isGrounded()) {
  31. this.damage(this.clampIntRange(Math.round(pokemon.maxhp / 8), 1), pokemon, pokemon, 'Pollen Terrain');
  32. return false;
  33. }
  34. },
  35. onStart: function (battle, source, effect) {
  36. if (effect && effect.effectType === 'Ability') {
  37. this.add('-fieldstart', 'move: Pollen Terrain', '[from] ability: ' + effect, '[of] ' + source);
  38. } else {
  39. this.add('-fieldstart', 'move: Pollen Terrain');
  40. }
  41. },
  42. onResidualOrder: 21,
  43. onResidualSubOrder: 2,
  44. onEnd: function () {
  45. this.add('-fieldend', 'Pollen Terrain');
  46. },
  47. },
  48. secondary: false,
  49. target: "all",
  50. type: "Bug",
  51. zMoveBoost: {spd: 1},
  52. },
  53. "murkyterrain": {
  54. accuracy: true,
  55. basePower: 0,
  56. category: "Status",
  57. id: "murkyterrain",
  58. name: "Murky Terrain",
  59. pp: 10,
  60. priority: 0,
  61. flags: {nonsky: 1},
  62. terrain: 'murkyterrain',
  63. effect: {
  64. duration: 5,
  65. durationCallback: function (source, effect) {
  66. if (source && source.hasItem('terrainextender')) {
  67. return 8;
  68. }
  69. return 5;
  70. },
  71. onBasePower: function (basePower, attacker, defender, move) {
  72. if (move.type === 'Psychic' && defender.isGrounded() && !defender.isSemiInvulnerable()) {
  73. this.debug('terrain weaken');
  74. return this.chainModify(0.5);
  75. }
  76. },
  77. onBoost: function (boost, target, source, effect) {
  78. if (source && (!effect.infiltrates || target.side === source.side) && target.isGrounded()) {
  79. let showMsg = false;
  80. for (let i in boost) {
  81. if (target !== source || boost[i] > 0) {
  82. delete boost[i];
  83. showMsg = true;
  84. }
  85. }
  86. if (showMsg && !effect.secondaries) this.add('-activate', target, 'move: Murky Terrain');
  87. }
  88. },
  89. onStart: function (battle, source, effect) {
  90. if (effect && effect.effectType === 'Ability') {
  91. this.add('-fieldstart', 'move: Murky Terrain', '[from] ability: ' + effect, '[of] ' + source);
  92. } else {
  93. this.add('-fieldstart', 'move: Murky Terrain');
  94. }
  95. },
  96. onResidualOrder: 21,
  97. onResidualSubOrder: 2,
  98. onEnd: function () {
  99. this.add('-fieldend', 'Murky Terrain');
  100. },
  101. },
  102. secondary: false,
  103. target: "all",
  104. type: "Dark",
  105. zMoveBoost: {def: 1},
  106. },
  107. "regalterrain": {
  108. accuracy: true,
  109. basePower: 0,
  110. category: "Status",
  111. id: "regalterrain",
  112. name: "Regal Terrain",
  113. pp: 10,
  114. priority: 0,
  115. flags: {nonsky: 1},
  116. terrain: 'regalterrain',
  117. effect: {
  118. duration: 5,
  119. durationCallback: function (source, effect) {
  120. if (source && source.hasItem('terrainextender')) {
  121. return 8;
  122. }
  123. return 5;
  124. },
  125. onBasePower: function (basePower, attacker, defender, move) {
  126. if (move.type === 'Dragon' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  127. this.debug('terrain boost');
  128. return this.chainModify(1.5);
  129. }
  130. },
  131. onModifyMove: function (move, pokemon) {
  132. if (!pokemon.isGrounded()) return;
  133. move.ignoreImmunity = true;
  134. },
  135. onStart: function (battle, source, effect) {
  136. if (effect && effect.effectType === 'Ability') {
  137. this.add('-fieldstart', 'move: Regal Terrain', '[from] ability: ' + effect, '[of] ' + source);
  138. } else {
  139. this.add('-fieldstart', 'move: Regal Terrain');
  140. }
  141. },
  142. onResidualOrder: 21,
  143. onResidualSubOrder: 2,
  144. onEnd: function () {
  145. this.add('-fieldend', 'Regal Terrain');
  146. },
  147. },
  148. secondary: false,
  149. target: "all",
  150. type: "Dragon",
  151. zMoveBoost: {spa: 1},
  152. },
  153. "mistyterrain": {
  154. inherit: true,
  155. effect: {
  156. duration: 5,
  157. durationCallback: function (source, effect) {
  158. if (source && source.hasItem('terrainextender')) {
  159. return 8;
  160. }
  161. return 5;
  162. },
  163. onSetStatus: function (status, target, source, effect) {
  164. if (!target.isGrounded() || target.isSemiInvulnerable() || source.ability === 'magicessence') return;
  165. if (effect && effect.status) {
  166. this.add('-activate', target, 'move: Misty Terrain');
  167. }
  168. return false;
  169. },
  170. onTryAddVolatile: function (status, target, source, effect) {
  171. if (!target.isGrounded() || target.isSemiInvulnerable() || source.ability === 'magicessence') return;
  172. if (status.id === 'confusion') {
  173. if (effect.effectType === 'Move' && !effect.secondaries) this.add('-activate', target, 'move: Misty Terrain');
  174. return null;
  175. }
  176. },
  177. onBasePower: function (basePower, attacker, defender, move) {
  178. if (move.type === 'Dragon' && defender.isGrounded() && !defender.isSemiInvulnerable()) {
  179. this.debug('misty terrain weaken');
  180. return this.chainModify(0.5);
  181. }
  182. },
  183. onStart: function (battle, source, effect) {
  184. if (effect && effect.effectType === 'Ability') {
  185. this.add('-fieldstart', 'move: Misty Terrain', '[from] ability: ' + effect, '[of] ' + source);
  186. } else {
  187. this.add('-fieldstart', 'move: Misty Terrain');
  188. }
  189. },
  190. onResidualOrder: 21,
  191. onResidualSubOrder: 2,
  192. onEnd: function (side) {
  193. this.add('-fieldend', 'Misty Terrain');
  194. },
  195. },
  196. },
  197. "fieryterrain": {
  198. accuracy: true,
  199. basePower: 0,
  200. category: "Status",
  201. id: "fieryterrain",
  202. name: "Fiery Terrain",
  203. pp: 10,
  204. priority: 0,
  205. flags: {nonsky: 1},
  206. terrain: 'fieryterrain',
  207. effect: {
  208. duration: 5,
  209. durationCallback: function (source, effect) {
  210. if (source && source.hasItem('terrainextender')) {
  211. return 8;
  212. }
  213. return 5;
  214. },
  215. onBasePower: function (basePower, attacker, defender, move) {
  216. if (move.type === 'Fire' && attacker.isGrounded() && !this.isWeather(['sunnyday', 'desolateland']) && !attacker.isSemiInvulnerable()) {
  217. this.debug('terrain boost');
  218. return this.chainModify(1.5);
  219. }
  220. },
  221. onResidualOrder: 1,
  222. onResidual: function () {
  223. this.eachEvent('Terrain');
  224. },
  225. onTerrain: function (pokemon) {
  226. if (pokemon.isGrounded() && pokemon.types.indexOf('Fire') < 0 && !pokemon.isSemiInvulnerable()) {
  227. this.damage(pokemon.maxhp / 8, pokemon, pokemon, 'Fiery Terrain');
  228. }
  229. },
  230. // Scorched Earth implementation
  231. onDisableMove: function (pokemon) {
  232. let foeactive = pokemon.side.foe.active;
  233. let scorchedEarth = false;
  234. for (let i = 0; i < foeactive.length; i++) {
  235. if (foeactive[i].ability === 'scorchedearth') scorchedEarth = true;
  236. }
  237. for (const moveSlot of pokemon.moveSlots) {
  238. if (scorchedEarth && this.getMove(moveSlot.id).terrain) {
  239. pokemon.disableMove(moveSlot.id);
  240. }
  241. }
  242. },
  243. onBeforeMovePriority: 5,
  244. onBeforeMove: function (attacker, defender, move) {
  245. let foeactive = attacker.side.foe.active;
  246. let scorchedEarth = false;
  247. for (let i = 0; i < foeactive.length; i++) {
  248. if (foeactive[i].ability === 'scorchedearth') scorchedEarth = true;
  249. }
  250. if (scorchedEarth && move.terrain) {
  251. this.add('cant', attacker, 'ability: Scorched Earth', move);
  252. return false;
  253. }
  254. },
  255. // ends here
  256. onStart: function (battle, source, effect) {
  257. if (effect && effect.effectType === 'Ability') {
  258. this.add('-fieldstart', 'move: Fiery Terrain', '[from] ability: ' + effect, '[of] ' + source);
  259. } else {
  260. this.add('-fieldstart', 'move: Fiery Terrain');
  261. }
  262. },
  263. onEnd: function () {
  264. this.add('-fieldend', 'Fiery Terrain');
  265. },
  266. },
  267. secondary: false,
  268. target: "all",
  269. type: "Fiery",
  270. zMoveBoost: {atk: 1},
  271. },
  272. "chakraterrain": {
  273. accuracy: true,
  274. basePower: 0,
  275. category: "Status",
  276. id: "chakraterrain",
  277. name: "Chakra Terrain",
  278. pp: 10,
  279. priority: 0,
  280. flags: {nonsky: 1},
  281. terrain: 'chakraterrain',
  282. effect: {
  283. duration: 5,
  284. durationCallback: function (source, effect) {
  285. if (source && source.hasItem('terrainextender')) {
  286. return 8;
  287. }
  288. return 5;
  289. },
  290. onModifyAccuracy: function (accuracy, target, source, move) {
  291. if (move.type === 'Fighting' && source.isGrounded()) return true;
  292. },
  293. onModifyMove: function (move, pokemon) {
  294. if (!pokemon.isGrounded()) return;
  295. if (!move.ignoreImmunity) move.ignoreImmunity = {};
  296. if (move.ignoreImmunity !== true) move.ignoreImmunity['Psychic'] = true;
  297. },
  298. onStart: function (battle, source, effect) {
  299. if (effect && effect.effectType === 'Ability') {
  300. this.add('-fieldstart', 'move: Chakra Terrain', '[from] ability: ' + effect, '[of] ' + source);
  301. } else {
  302. this.add('-fieldstart', 'move: Chakra Terrain');
  303. }
  304. },
  305. onResidualOrder: 21,
  306. onResidualSubOrder: 2,
  307. onEnd: function () {
  308. this.add('-fieldend', 'Chakra Terrain');
  309. },
  310. },
  311. secondary: false,
  312. target: "all",
  313. type: "Fighting",
  314. zMoveBoost: {atk: 1},
  315. },
  316. "elevatedterrain": {
  317. accuracy: true,
  318. basePower: 0,
  319. category: "Status",
  320. id: "elevatedterrain",
  321. name: "Elevated Terrain",
  322. pp: 10,
  323. priority: 0,
  324. flags: {},
  325. terrain: 'elevatedterrain',
  326. effect: {
  327. duration: 5,
  328. durationCallback: function (source, effect) {
  329. if (source && source.hasItem('terrainextender')) {
  330. return 8;
  331. }
  332. return 5;
  333. },
  334. onChargeMove: function (pokemon, target, move) {
  335. if (!pokemon.isGrounded()) {
  336. this.debug('elevated terrain - remove charge turn for ' + move.id);
  337. return false; // skip charge turn
  338. }
  339. },
  340. onDamage: function (damage, target, source, effect) {
  341. if (!effect) return;
  342. if (effect.id in {'leechseed':1, 'spikes':1, 'stealthrock':1,}) {
  343. return false;
  344. }
  345. },
  346. onBoost: function (boost, target, source, effect) {
  347. if (!effect) return;
  348. if (effect.id === 'stickyweb') delete boost['spe'];
  349. },
  350. onSetStatus: function (status, target, source, effect) {
  351. if (!effect) return false;
  352. if (effect.id === 'toxicspikes') return false;
  353. },
  354. onStart: function (battle, source, effect) {
  355. if (effect && effect.effectType === 'Ability') {
  356. this.add('-fieldstart', 'move: Elevated Terrain', '[from] ability: ' + effect, '[of] ' + source);
  357. } else {
  358. this.add('-fieldstart', 'move: Elevated Terrain');
  359. }
  360. },
  361. onResidualOrder: 21,
  362. onResidualSubOrder: 2,
  363. onEnd: function () {
  364. this.add('-fieldend', 'Elevated Terrain');
  365. },
  366. },
  367. secondary: false,
  368. target: "all",
  369. type: "Flying",
  370. zMoveBoost: {atk: 1},
  371. },
  372. "ominousterrain": {
  373. accuracy: true,
  374. basePower: 0,
  375. category: "Status",
  376. id: "ominousterrain",
  377. name: "Ominous Terrain",
  378. pp: 10,
  379. priority: 0,
  380. flags: {nonsky: 1},
  381. terrain: 'ominousterrain',
  382. effect: {
  383. duration: 5,
  384. durationCallback: function (source, effect) {
  385. if (source && source.hasItem('terrainextender')) {
  386. return 8;
  387. }
  388. return 5;
  389. },
  390. onBasePower: function (basePower, attacker, defender, move) {
  391. if (move.type === 'Ghost' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  392. this.debug('terrain boost');
  393. return this.chainModify(1.5);
  394. }
  395. },
  396. onDisableMove: function (pokemon) {
  397. if (pokemon.isGrounded()) {
  398. for (const moveSlot of pokemon.moveSlots) {
  399. if (this.getMove(moveSlot.id).flags['heal']) {
  400. pokemon.disableMove(moveSlot.id);
  401. }
  402. }
  403. }
  404. },
  405. onBeforeMovePriority: 6,
  406. onBeforeMove: function (pokemon, target, move) {
  407. if (pokemon.isGrounded() && move.flags['heal']) {
  408. this.add('cant', pokemon, 'move: Ominous Terrain', move);
  409. return false;
  410. }
  411. },
  412. onStart: function (battle, source, effect) {
  413. if (effect && effect.effectType === 'Ability') {
  414. this.add('-fieldstart', 'move: Ominous Terrain', '[from] ability: ' + effect, '[of] ' + source);
  415. } else {
  416. this.add('-fieldstart', 'move: Ominous Terrain');
  417. }
  418. },
  419. onResidualOrder: 21,
  420. onResidualSubOrder: 2,
  421. onEnd: function () {
  422. this.add('-fieldend', 'Ominous Terrain');
  423. },
  424. onTryHeal: false,
  425. },
  426. secondary: false,
  427. target: "all",
  428. type: "Ghost",
  429. zMoveBoost: {spe: 1},
  430. },
  431. "sandyterrain": {
  432. accuracy: true,
  433. basePower: 0,
  434. category: "Status",
  435. id: "sandyterrain",
  436. name: "Sandy Terrain",
  437. pp: 10,
  438. priority: 0,
  439. flags: {nonsky: 1},
  440. terrain: 'sandyterrain',
  441. effect: {
  442. duration: 5,
  443. durationCallback: function (source, effect) {
  444. if (source && source.hasItem('terrainextender')) {
  445. return 8;
  446. }
  447. return 5;
  448. },
  449. onBasePower: function (basePower, attacker, defender, move) {
  450. if ((move.type === 'Ground' || move.type === 'Rock' || move.type === 'Steel') && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  451. this.debug('terrain boost');
  452. return this.chainModify(1.3);
  453. }
  454. },
  455. onSetStatus: function (status, target, source, effect) {
  456. if (!target.isGrounded() || target.types.indexOf('Ground') < 0 || target.isSemiInvulnerable()) return;
  457. if (effect && effect.status) {
  458. this.add('-activate', target, 'move: Sandy Terrain');
  459. }
  460. return false;
  461. },
  462. onStart: function (battle, source, effect) {
  463. if (effect && effect.effectType === 'Ability') {
  464. this.add('-fieldstart', 'move: Sandy Terrain', '[from] ability: ' + effect, '[of] ' + source);
  465. } else {
  466. this.add('-fieldstart', 'move: Sandy Terrain');
  467. }
  468. },
  469. onResidualOrder: 21,
  470. onResidualSubOrder: 2,
  471. onEnd: function () {
  472. this.add('-fieldend', 'Sandy Terrain');
  473. },
  474. },
  475. secondary: false,
  476. target: "all",
  477. type: "Ground",
  478. zMoveBoost: {def: 1},
  479. },
  480. "frostyterrain": {
  481. accuracy: true,
  482. basePower: 0,
  483. category: "Status",
  484. id: "frostyterrain",
  485. name: "Frosty Terrain",
  486. pp: 10,
  487. priority: 0,
  488. flags: {nonsky: 1},
  489. terrain: 'frostyterrain',
  490. effect: {
  491. duration: 5,
  492. durationCallback: function (source, effect) {
  493. if (source && source.hasItem('terrainextender')) {
  494. return 8;
  495. }
  496. return 5;
  497. },
  498. onBasePower: function (basePower, attacker, defender, move) {
  499. if (move.type === 'Ice' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  500. this.debug('terrain boost');
  501. return this.chainModify(1.5);
  502. }
  503. },
  504. onDisableMove: function (pokemon) {
  505. if (pokemon.isGrounded()) {
  506. for (const moveSlot of pokemon.moveSlots) {
  507. if (this.getMove(moveSlot.id).type === 'Water' && !(this.getMove(moveSlot.id).id in {'scald':1, 'steameruption':1})) {
  508. pokemon.disableMove(moveSlot.id);
  509. }
  510. }
  511. }
  512. },
  513. onBeforeMovePriority: 6,
  514. onBeforeMove: function (pokemon, target, move) {
  515. if (pokemon.isGrounded() && move.type === 'Water' && !(move.id in {'scald':1, 'steameruption':1})) {
  516. this.add('cant', pokemon, 'move: Frosty Terrain', move);
  517. return false;
  518. }
  519. },
  520. onStart: function (battle, source, effect) {
  521. if (effect && effect.effectType === 'Ability') {
  522. this.add('-fieldstart', 'move: Frosty Terrain', '[from] ability: ' + effect, '[of] ' + source);
  523. } else {
  524. this.add('-fieldstart', 'move: Frosty Terrain');
  525. }
  526. },
  527. onResidualOrder: 21,
  528. onResidualSubOrder: 2,
  529. onEnd: function () {
  530. this.add('-fieldend', 'Frosty Terrain');
  531. },
  532. },
  533. secondary: false,
  534. target: "all",
  535. type: "Ice",
  536. zMoveBoost: {spa: 1},
  537. },
  538. "cloudyterrain": {
  539. num: 604,
  540. accuracy: true,
  541. basePower: 0,
  542. category: "Status",
  543. id: "cloudyterrain",
  544. name: "Cloudy Terrain",
  545. pp: 10,
  546. priority: 0,
  547. flags: {nonsky: 1},
  548. terrain: 'cloudyterrain',
  549. effect: {
  550. duration: 5,
  551. durationCallback: function (source, effect) {
  552. if (source && source.hasItem('terrainextender')) {
  553. return 8;
  554. }
  555. return 5;
  556. },
  557. onBasePower: function (basePower, attacker, defender, move) {
  558. if (move.type === 'Normal' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  559. this.debug('terrain boost');
  560. return this.chainModify(1.5);
  561. }
  562. if (move.type !== 'Normal' && defender.isGrounded() && !defender.isSemiInvulnerable()) {
  563. this.debug('terrain weaken');
  564. return this.chainModify(0.75);
  565. }
  566. },
  567. onStart: function (battle, source, effect) {
  568. if (effect && effect.effectType === 'Ability') {
  569. this.add('-fieldstart', 'move: Cloudy Terrain', '[from] ability: ' + effect, '[of] ' + source);
  570. } else {
  571. this.add('-fieldstart', 'move: Cloudy Terrain');
  572. }
  573. },
  574. onResidualOrder: 21,
  575. onResidualSubOrder: 2,
  576. onEnd: function () {
  577. this.add('-fieldend', 'Cloudy Terrain');
  578. },
  579. },
  580. secondary: false,
  581. target: "all",
  582. type: "Normal",
  583. zMoveBoost: {spd: 1},
  584. },
  585. "rockyterrain": {
  586. num: 604,
  587. accuracy: true,
  588. basePower: 0,
  589. category: "Status",
  590. id: "rockyterrain",
  591. name: "Rocky Terrain",
  592. pp: 10,
  593. priority: 0,
  594. flags: {nonsky: 1},
  595. terrain: 'rockyterrain',
  596. effect: {
  597. duration: 5,
  598. durationCallback: function (source, effect) {
  599. let duration = 5;
  600. if (source && source.hasItem('terrainextender')) duration += 3;
  601. if (source && source.hasAbility('gemenergy')) duration += 2;
  602. return duration;
  603. },
  604. onBasePower: function (basePower, attacker, defender, move) {
  605. if (move.type === 'Rock' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  606. this.debug('terrain boost');
  607. return this.chainModify(1.5);
  608. }
  609. },
  610. onModifyAccuracy: function (accuracy, target, source, move) {
  611. if (source.isGrounded()) {
  612. if (typeof accuracy !== 'number') return;
  613. return accuracy * 4 / 3;
  614. }
  615. },
  616. // Metal Crush implenentation
  617. onEffectiveness: function (typeMod, target, type, move) {
  618. if (move && move.effectType === 'Move' && move.metalCrush && move.type === 'Rock' && type === 'Steel') {
  619. return 1;
  620. }
  621. },
  622. onStart: function (battle, source, effect) {
  623. if (effect && effect.effectType === 'Ability') {
  624. this.add('-fieldstart', 'move: Rocky Terrain', '[from] ability: ' + effect, '[of] ' + source);
  625. } else {
  626. this.add('-fieldstart', 'move: Rocky Terrain');
  627. }
  628. },
  629. onResidualOrder: 21,
  630. onResidualSubOrder: 2,
  631. onEnd: function () {
  632. this.add('-fieldend', 'Rocky Terrain');
  633. },
  634. },
  635. secondary: false,
  636. target: "all",
  637. type: "Rock",
  638. zMoveBoost: {atk: 1},
  639. },
  640. "corrosiveterrain": {
  641. accuracy: true,
  642. basePower: 0,
  643. category: "Status",
  644. id: "corrosiveterrain",
  645. name: "Corrosive Terrain",
  646. pp: 10,
  647. priority: 0,
  648. flags: {nonsky: 1},
  649. terrain: 'corrosiveterrain',
  650. effect: {
  651. duration: 5,
  652. durationCallback: function (source, effect) {
  653. if (source && source.hasItem('terrainextender')) {
  654. return 8;
  655. }
  656. return 5;
  657. },
  658. onBasePower: function (basePower, attacker, defender, move) {
  659. if (move.type === 'Poison' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  660. this.debug('terrain boost');
  661. return this.chainModify(1.5);
  662. }
  663. },
  664. onNegateImmunity: function (pokemon, type) {
  665. if (pokemon.isGrounded() && pokemon.hasType('Steel') && type === 'Poison') return false;
  666. },
  667. onStart: function (battle, source, effect) {
  668. if (effect && effect.effectType === 'Ability') {
  669. this.add('-fieldstart', 'move: Corrosive Terrain', '[from] ability: ' + effect, '[of] ' + source);
  670. } else {
  671. this.add('-fieldstart', 'move: Corrosive Terrain');
  672. }
  673. },
  674. onResidualOrder: 21,
  675. onResidualSubOrder: 2,
  676. onEnd: function () {
  677. this.add('-fieldend', 'Corrosive Terrain');
  678. },
  679. },
  680. secondary: false,
  681. target: "all",
  682. type: "Poison",
  683. zMoveBoost: {spe: 1},
  684. },
  685. "metallicterrain": {
  686. accuracy: true,
  687. basePower: 0,
  688. category: "Status",
  689. id: "metallicterrain",
  690. name: "Metallic Terrain",
  691. pp: 10,
  692. priority: 0,
  693. flags: {nonsky: 1},
  694. terrain: 'metallicterrain',
  695. effect: {
  696. duration: 5,
  697. durationCallback: function (source, effect) {
  698. if (source && source.hasItem('terrainextender')) {
  699. return 8;
  700. }
  701. return 5;
  702. },
  703. onBasePower: function (basePower, attacker, defender, move) {
  704. if (move.type === 'Steel' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  705. this.debug('terrain boost');
  706. return this.chainModify(1.5);
  707. }
  708. },
  709. onBoost: function (boost, target, source, effect) {
  710. if ((source && target === source) || !target.isGrounded()) return;
  711. let showMsg = false;
  712. for (let i in boost) {
  713. if (boost[i] < 0) {
  714. delete boost[i];
  715. showMsg = true;
  716. }
  717. }
  718. if (showMsg && !effect.secondaries) this.add("-fail", target, "unboost", "[from] ability: Clear Body", "[of] " + target);
  719. },
  720. onStart: function (battle, source, effect) {
  721. if (effect && effect.effectType === 'Ability') {
  722. this.add('-fieldstart', 'move: Metallic Terrain', '[from] ability: ' + effect, '[of] ' + source);
  723. } else {
  724. this.add('-fieldstart', 'move: Metallic Terrain');
  725. }
  726. },
  727. onResidualOrder: 21,
  728. onResidualSubOrder: 2,
  729. onEnd: function () {
  730. this.add('-fieldend', 'Metallic Terrain');
  731. },
  732. },
  733. secondary: false,
  734. target: "all",
  735. type: "Steel",
  736. zMoveBoost: {spe: 1},
  737. },
  738. "seaterrain": {
  739. accuracy: true,
  740. basePower: 0,
  741. category: "Status",
  742. id: "seaterrain",
  743. name: "Sea Terrain",
  744. pp: 10,
  745. priority: 0,
  746. flags: {nonsky: 1},
  747. terrain: 'seaterrain',
  748. effect: {
  749. duration: 5,
  750. durationCallback: function (source, effect) {
  751. if (source && source.hasItem('terrainextender')) {
  752. return 8;
  753. }
  754. return 5;
  755. },
  756. onBasePower: function (basePower, attacker, defender, move) {
  757. if (move.type === 'Ground' && defender.isGrounded() && !defender.isSemiInvulnerable()) {
  758. this.debug('terrain weaken');
  759. return this.chainModify(0.5);
  760. }
  761. },
  762. onUpdate: function (pokemon) {
  763. if (pokemon.status === 'brn' && pokemon.isGrounded()) {
  764. this.add('-activate', pokemon, 'move: Sea Terrain');
  765. pokemon.cureStatus();
  766. }
  767. },
  768. onSetStatus: function (status, target, source, effect) {
  769. if (status.id !== 'brn') return;
  770. if (!target.isGrounded() || target.isSemiInvulnerable()) return;
  771. if (!effect || !effect.status) return false;
  772. this.add('-activate', target, 'move: Sea Terrain');
  773. return false;
  774. },
  775. onStart: function (battle, source, effect) {
  776. if (effect && effect.effectType === 'Ability') {
  777. this.add('-fieldstart', 'move: Sea Terrain', '[from] ability: ' + effect, '[of] ' + source);
  778. } else {
  779. this.add('-fieldstart', 'move: Sea Terrain');
  780. }
  781. },
  782. onResidualOrder: 21,
  783. onResidualSubOrder: 2,
  784. onEnd: function () {
  785. this.add('-fieldend', 'Sea Terrain');
  786. },
  787. },
  788. secondary: false,
  789. target: "all",
  790. type: "Water",
  791. zMoveBoost: {spe: 1},
  792. },
  793.  
  794. "camouflage": {
  795. inherit: true,
  796. onHit: function (target) {
  797. let newType = 'Normal';
  798. if (this.isTerrain('electricterrain')) {
  799. newType = 'Electric';
  800. } else if (this.isTerrain('grassyterrain')) {
  801. newType = 'Grass';
  802. } else if (this.isTerrain('mistyterrain')) {
  803. newType = 'Fairy';
  804. } else if (this.isTerrain('psychicterrain')) {
  805. newType = 'Psychic';
  806. } else if (this.isTerrain('pollenterrain')) {
  807. newType = 'Bug';
  808. } else if (this.isTerrain('murkyterrain')) {
  809. newType = 'Dark';
  810. } else if (this.isTerrain('regalterrain')) {
  811. newType = 'Dragon';
  812. } else if (this.isTerrain('fieryterrain')) {
  813. newType = 'Fire';
  814. } else if (this.isTerrain('chakraterrain')) {
  815. newType = 'Fighting';
  816. } else if (this.isTerrain('elevatedterrain')) {
  817. newType = 'Flying';
  818. } else if (this.isTerrain('ominousterrain')) {
  819. newType = 'Ghost';
  820. } else if (this.isTerrain('sandyterrain')) {
  821. newType = 'Ground';
  822. } else if (this.isTerrain('frostyterrain')) {
  823. newType = 'Ice';
  824. } else if (this.isTerrain('rockyterrain')) {
  825. newType = 'Rock';
  826. } else if (this.isTerrain('corrosiveterrain')) {
  827. newType = 'Poison';
  828. } else if (this.isTerrain('metallicterrain')) {
  829. newType = 'Steel';
  830. } else if (this.isTerrain('seaterrain')) {
  831. newType = 'Water';
  832. }
  833. if (!target.setType(newType)) return false;
  834. this.add('-start', target, 'typechange', newType);
  835. },
  836. },
  837. "naturepower": {
  838. inherit: true,
  839. onTryHit: function (target, pokemon) {
  840. let move = 'triattack';
  841. if (this.isTerrain('electricterrain')) {
  842. move = 'thunderbolt';
  843. } else if (this.isTerrain('grassyterrain')) {
  844. move = 'energyball';
  845. } else if (this.isTerrain('mistyterrain')) {
  846. move = 'moonblast';
  847. } else if (this.isTerrain('psychicterrain')) {
  848. move = 'psychic';
  849. } else if (this.isTerrain('pollenterrain')) {
  850. move = 'pollenpuff';
  851. } else if (this.isTerrain('murkyterrain')) {
  852. move = 'darkpulse';
  853. } else if (this.isTerrain('regalterrain')) {
  854. move = 'dragonpulse';
  855. } else if (this.isTerrain('fieryterrain')) {
  856. move = 'lavaplume';
  857. } else if (this.isTerrain('chakraterrain')) {
  858. move = 'aurasphere';
  859. } else if (this.isTerrain('elevatedterrain')) {
  860. move = 'airslash';
  861. } else if (this.isTerrain('ominousterrain')) {
  862. move = 'shadowball';
  863. } else if (this.isTerrain('sandyterrain')) {
  864. move = 'earthpower';
  865. } else if (this.isTerrain('frostyterrain')) {
  866. move = 'icebeam';
  867. } else if (this.isTerrain('rockyterrain')) {
  868. move = 'powergem';
  869. } else if (this.isTerrain('corrosiveterrain')) {
  870. move = 'sludgebomb';
  871. } else if (this.isTerrain('metallicterrain')) {
  872. move = 'flashcannon';
  873. } else if (this.isTerrain('seaterrain')) {
  874. move = 'hydropump';
  875. }
  876. this.useMove(move, pokemon, target);
  877. return null;
  878. },
  879. },
  880. "secretpower": {
  881. inherit: true,
  882. onModifyMove: function (move, pokemon) {
  883. if (this.isTerrain('') || this.isTerrain('chakraterrain') || this.isTerrain('cloudyterrain')) return;
  884. move.secondaries = [];
  885. if (this.isTerrain('electricterrain')) {
  886. move.secondaries.push({
  887. chance: 30,
  888. status: 'par',
  889. });
  890. } else if (this.isTerrain('grassyterrain')) {
  891. move.secondaries.push({
  892. chance: 30,
  893. status: 'slp',
  894. });
  895. } else if (this.isTerrain('mistyterrain')) {
  896. move.secondaries.push({
  897. chance: 30,
  898. boosts: {
  899. spa: -1,
  900. },
  901. });
  902. } else if (this.isTerrain('psychicterrain')) {
  903. move.secondaries.push({
  904. chance: 30,
  905. boosts: {
  906. spe: -1,
  907. },
  908. });
  909. } else if (this.isTerrain('pollenterrain')) {
  910. move.secondaries.push({
  911. chance: 30,
  912. boosts: {
  913. spd: -1,
  914. },
  915. });
  916. } else if (this.isTerrain('murkyterrain')) {
  917. move.secondaries.push({
  918. chance: 30,
  919. volatileStatus: 'torment',
  920. });
  921. } else if (this.isTerrain('regalterrain')) {
  922. move.secondaries.push({
  923. chance: 30,
  924. volatileStatus: 'flinch',
  925. });
  926. } else if (this.isTerrain('fieryterrain')) {
  927. move.secondaries.push({
  928. chance: 30,
  929. status: 'brn',
  930. });
  931. } else if (this.isTerrain('elevatedterrain')) {
  932. move.secondaries.push({
  933. chance: 30,
  934. volatileStatus: 'telekinesis',
  935. });
  936. } else if (this.isTerrain('ominousterrain')) {
  937. move.secondaries.push({
  938. chance: 30,
  939. boosts: {
  940. def: -1,
  941. },
  942. });
  943. } else if (this.isTerrain('sandyterrain')) {
  944. move.secondaries.push({
  945. chance: 30,
  946. boosts: {
  947. def: -1,
  948. },
  949. });
  950. } else if (this.isTerrain('frostyterrain')) {
  951. move.secondaries.push({
  952. chance: 30,
  953. status: 'frz',
  954. });
  955. } else if (this.isTerrain('rockyterrain')) {
  956. move.secondaries.push({
  957. chance: 30,
  958. volatileStatus: 'flinch',
  959. });
  960. } else if (this.isTerrain('corrosiveterrain')) {
  961. move.secondaries.push({
  962. chance: 30,
  963. status: 'tox',
  964. });
  965. } else if (this.isTerrain('metallicterrain')) {
  966. move.secondaries.push({
  967. chance: 30,
  968. volatileStatus: 'confusion',
  969. });
  970. } else if (this.isTerrain('seaterrain')) {
  971. move.secondaries.push({
  972. chance: 30,
  973. boosts: {
  974. atk: -1,
  975. },
  976. });
  977. }
  978. },
  979. secondary: {
  980. chance: 30,
  981. status: 'par',
  982. },
  983. },
  984.  
  985. // Toxic Waste
  986. "toxicspikes": {
  987. inherit: true,
  988. effect: {
  989. // this is a side condition
  990. onStart: function (side) {
  991. this.add('-sidestart', side, 'move: Toxic Spikes');
  992. this.effectData.layers = 1;
  993. // Toxic Waste implementation
  994. let foeactive = side.foe.active;
  995. let toxicWaste = false;
  996. for (let i = 0; i < foeactive.length; i++) {
  997. if (foeactive[i].ability === 'toxicwaste') toxicWaste = true;
  998. }
  999. if (this.isTerrain('corrosiveterrain') && toxicWaste) this.effectData.layers++;
  1000. },
  1001. onRestart: function (side) {
  1002. if (this.effectData.layers >= 2) return false;
  1003. this.add('-sidestart', side, 'move: Toxic Spikes');
  1004. this.effectData.layers++;
  1005. },
  1006. onSwitchIn: function (pokemon) {
  1007. if (!pokemon.isGrounded()) return;
  1008. if (!pokemon.runImmunity('Poison')) return;
  1009. if (pokemon.hasType('Poison')) {
  1010. this.add('-sideend', pokemon.side, 'move: Toxic Spikes', '[of] ' + pokemon);
  1011. pokemon.side.removeSideCondition('toxicspikes');
  1012. } else if (this.effectData.layers >= 2) {
  1013. pokemon.trySetStatus('tox', pokemon.side.foe.active[0]);
  1014. } else {
  1015. pokemon.trySetStatus('psn', pokemon.side.foe.active[0]);
  1016. }
  1017. },
  1018. },
  1019. },
  1020.  
  1021. // Gem Energy
  1022. "auroraveil": {
  1023. inherit: true,
  1024. effect: {
  1025. duration: 5,
  1026. durationCallback: function (target, source, effect) {
  1027. let duration = 5;
  1028. if (source && source.hasItem('lightclay')) duration += 3;
  1029. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) duration += 2;
  1030. return duration;
  1031. },
  1032. onAnyModifyDamage: function (damage, source, target, move) {
  1033. if (target !== source && target.side === this.effectData.target) {
  1034. if ((target.side.sideConditions['reflect'] && this.getCategory(move) === 'Physical') ||
  1035. (target.side.sideConditions['lightscreen'] && this.getCategory(move) === 'Special')) {
  1036. return;
  1037. }
  1038. if (!move.crit && !move.infiltrates) {
  1039. this.debug('Aurora Veil weaken');
  1040. if (target.side.active.length > 1) return this.chainModify([0xAAC, 0x1000]);
  1041. return this.chainModify(0.5);
  1042. }
  1043. }
  1044. },
  1045. onStart: function (side) {
  1046. this.add('-sidestart', side, 'move: Aurora Veil');
  1047. },
  1048. onResidualOrder: 21,
  1049. onResidualSubOrder: 1,
  1050. onEnd: function (side) {
  1051. this.add('-sideend', side, 'move: Aurora Veil');
  1052. },
  1053. },
  1054. },
  1055. "gravity": {
  1056. inherit: true,
  1057. effect: {
  1058. duration: 5,
  1059. durationCallback: function (source, effect) {
  1060. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) {
  1061. return 7;
  1062. }
  1063. return 5;
  1064. },
  1065. onStart: function () {
  1066. this.add('-fieldstart', 'move: Gravity');
  1067. const allActivePokemon = this.sides[0].active.concat(this.sides[1].active);
  1068. for (let pokemon of allActivePokemon) {
  1069. let applies = false;
  1070. if (pokemon.removeVolatile('bounce') || pokemon.removeVolatile('fly')) {
  1071. applies = true;
  1072. this.cancelMove(pokemon);
  1073. pokemon.removeVolatile('twoturnmove');
  1074. }
  1075. if (pokemon.volatiles['skydrop']) {
  1076. applies = true;
  1077. this.cancelMove(pokemon);
  1078.  
  1079. if (pokemon.volatiles['skydrop'].source) {
  1080. this.add('-end', pokemon.volatiles['twoturnmove'].source, 'Sky Drop', '[interrupt]');
  1081. }
  1082. pokemon.removeVolatile('skydrop');
  1083. pokemon.removeVolatile('twoturnmove');
  1084. }
  1085. if (pokemon.volatiles['magnetrise']) {
  1086. applies = true;
  1087. delete pokemon.volatiles['magnetrise'];
  1088. }
  1089. if (pokemon.volatiles['telekinesis']) {
  1090. applies = true;
  1091. delete pokemon.volatiles['telekinesis'];
  1092. }
  1093. if (applies) this.add('-activate', pokemon, 'move: Gravity');
  1094. }
  1095. },
  1096. onModifyAccuracy: function (accuracy) {
  1097. if (typeof accuracy !== 'number') return;
  1098. return accuracy * 5 / 3;
  1099. },
  1100. onDisableMove: function (pokemon) {
  1101. for (const moveSlot of pokemon.moveSlots) {
  1102. if (this.getMove(moveSlot.id).flags['gravity']) {
  1103. pokemon.disableMove(moveSlot.id);
  1104. }
  1105. }
  1106. },
  1107. // groundedness implemented in battle.engine.js:BattlePokemon#isGrounded
  1108. onBeforeMovePriority: 6,
  1109. onBeforeMove: function (pokemon, target, move) {
  1110. if (move.flags['gravity']) {
  1111. this.add('cant', pokemon, 'move: Gravity', move);
  1112. return false;
  1113. }
  1114. },
  1115. onResidualOrder: 22,
  1116. onEnd: function () {
  1117. this.add('-fieldend', 'move: Gravity');
  1118. },
  1119. },
  1120. },
  1121. "lightscreen": {
  1122. inherit: true,
  1123. effect: {
  1124. duration: 5,
  1125. durationCallback: function (target, source, effect) {
  1126. let duration = 5;
  1127. if (source && source.hasItem('lightclay')) duration += 3;
  1128. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) duration += 2;
  1129. return duration;
  1130. },
  1131. onAnyModifyDamage: function (damage, source, target, move) {
  1132. if (target !== source && target.side === this.effectData.target && this.getCategory(move) === 'Special') {
  1133. if (!move.crit && !move.infiltrates) {
  1134. this.debug('Light Screen weaken');
  1135. if (target.side.active.length > 1) return this.chainModify([0xAAC, 0x1000]);
  1136. return this.chainModify(0.5);
  1137. }
  1138. }
  1139. },
  1140. onStart: function (side) {
  1141. this.add('-sidestart', side, 'move: Light Screen');
  1142. },
  1143. onResidualOrder: 21,
  1144. onResidualSubOrder: 1,
  1145. onEnd: function (side) {
  1146. this.add('-sideend', side, 'move: Light Screen');
  1147. },
  1148. },
  1149. },
  1150. "magicroom": {
  1151. inherit: true,
  1152. effect: {
  1153. duration: 5,
  1154. durationCallback: function (source, effect) {
  1155. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) {
  1156. return 7;
  1157. }
  1158. return 5;
  1159. },
  1160. onStart: function (target, source) {
  1161. this.add('-fieldstart', 'move: Magic Room', '[of] ' + source);
  1162. },
  1163. onRestart: function (target, source) {
  1164. this.removePseudoWeather('magicroom');
  1165. },
  1166. // Item suppression implemented in Pokemon.ignoringItem() within sim/pokemon.js
  1167. onResidualOrder: 25,
  1168. onEnd: function () {
  1169. this.add('-fieldend', 'move: Magic Room', '[of] ' + this.effectData.source);
  1170. },
  1171. },
  1172. },
  1173. "mist": {
  1174. inherit: true,
  1175. effect: {
  1176. duration: 5,
  1177. durationCallback: function (target, source, effect) {
  1178. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) {
  1179. return 7;
  1180. }
  1181. return 5;
  1182. },
  1183. onBoost: function (boost, target, source, effect) {
  1184. if (source && target !== source && (!effect.infiltrates || target.side === source.side)) {
  1185. let showMsg = false;
  1186. for (let i in boost) {
  1187. if (boost[i] < 0) {
  1188. delete boost[i];
  1189. showMsg = true;
  1190. }
  1191. }
  1192. if (showMsg && !effect.secondaries) this.add('-activate', target, 'move: Mist');
  1193. }
  1194. },
  1195. onStart: function (side) {
  1196. this.add('-sidestart', side, 'Mist');
  1197. },
  1198. onResidualOrder: 21,
  1199. onResidualSubOrder: 3,
  1200. onEnd: function (side) {
  1201. this.add('-sideend', side, 'Mist');
  1202. },
  1203. },
  1204. },
  1205. "mudsport": {
  1206. inherit: true,
  1207. effect: {
  1208. duration: 5,
  1209. durationCallback: function (source, effect) {
  1210. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) {
  1211. return 7;
  1212. }
  1213. return 5;
  1214. },
  1215. onStart: function (side, source) {
  1216. this.add('-fieldstart', 'move: Mud Sport', '[of] ' + source);
  1217. },
  1218. onBasePowerPriority: 1,
  1219. onBasePower: function (basePower, attacker, defender, move) {
  1220. if (move.type === 'Electric') {
  1221. this.debug('mud sport weaken');
  1222. return this.chainModify([0x548, 0x1000]);
  1223. }
  1224. },
  1225. onResidualOrder: 21,
  1226. onEnd: function () {
  1227. this.add('-fieldend', 'move: Mud Sport');
  1228. },
  1229. },
  1230. },
  1231. "reflect": {
  1232. inherit: true,
  1233. effect: {
  1234. duration: 5,
  1235. durationCallback: function (target, source, effect) {
  1236. let duration = 5;
  1237. if (source && source.hasItem('lightclay')) duration += 3;
  1238. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) duration += 2;
  1239. return duration;
  1240. },
  1241. onAnyModifyDamage: function (damage, source, target, move) {
  1242. if (target !== source && target.side === this.effectData.target && this.getCategory(move) === 'Physical') {
  1243. if (!move.crit && !move.infiltrates) {
  1244. this.debug('Reflect weaken');
  1245. if (target.side.active.length > 1) return this.chainModify([0xAAC, 0x1000]);
  1246. return this.chainModify(0.5);
  1247. }
  1248. }
  1249. },
  1250. onStart: function (side) {
  1251. this.add('-sidestart', side, 'Reflect');
  1252. },
  1253. onResidualOrder: 21,
  1254. onEnd: function (side) {
  1255. this.add('-sideend', side, 'Reflect');
  1256. },
  1257. },
  1258. },
  1259. "safeguard": {
  1260. inherit: true,
  1261. effect: {
  1262. duration: 5,
  1263. durationCallback: function (target, source, effect) {
  1264. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) {
  1265. return 7;
  1266. }
  1267. return 5;
  1268. },
  1269. onSetStatus: function (status, target, source, effect) {
  1270. if (source && target !== source && effect && (!effect.infiltrates || target.side === source.side)) {
  1271. this.debug('interrupting setStatus');
  1272. if (effect.id === 'synchronize' || (effect.effectType === 'Move' && !effect.secondaries)) {
  1273. this.add('-activate', target, 'move: Safeguard');
  1274. }
  1275. return null;
  1276. }
  1277. },
  1278. onTryAddVolatile: function (status, target, source, effect) {
  1279. if ((status.id === 'confusion' || status.id === 'yawn') && source && target !== source && effect && (!effect.infiltrates || target.side === source.side)) {
  1280. if (effect.effectType === 'Move' && !effect.secondaries) this.add('-activate', target, 'move: Safeguard');
  1281. return null;
  1282. }
  1283. },
  1284. onStart: function (side) {
  1285. this.add('-sidestart', side, 'Safeguard');
  1286. },
  1287. onResidualOrder: 21,
  1288. onResidualSubOrder: 2,
  1289. onEnd: function (side) {
  1290. this.add('-sideend', side, 'Safeguard');
  1291. },
  1292. },
  1293. },
  1294. "tailwind": {
  1295. inherit: true,
  1296. effect: {
  1297. duration: 4,
  1298. durationCallback: function (target, source, effect) {
  1299. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) {
  1300. return 6;
  1301. }
  1302. return 4;
  1303. },
  1304. onStart: function (side) {
  1305. this.add('-sidestart', side, 'move: Tailwind');
  1306. },
  1307. onModifySpe: function (spe, pokemon) {
  1308. return this.chainModify(2);
  1309. },
  1310. onResidualOrder: 21,
  1311. onResidualSubOrder: 4,
  1312. onEnd: function (side) {
  1313. this.add('-sideend', side, 'move: Tailwind');
  1314. },
  1315. },
  1316. },
  1317. "trickroom": {
  1318. inherit: true,
  1319. effect: {
  1320. duration: 5,
  1321. durationCallback: function (source, effect) {
  1322. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) {
  1323. return 7;
  1324. }
  1325. return 5;
  1326. },
  1327. onStart: function (target, source) {
  1328. this.add('-fieldstart', 'move: Trick Room', '[of] ' + source);
  1329. },
  1330. onRestart: function (target, source) {
  1331. this.removePseudoWeather('trickroom');
  1332. },
  1333. // Speed modification is changed in Pokemon.getActionSpeed() in sim/pokemon.js
  1334. onResidualOrder: 23,
  1335. onEnd: function () {
  1336. this.add('-fieldend', 'move: Trick Room');
  1337. },
  1338. },
  1339. },
  1340. "watersport": {
  1341. inherit: true,
  1342. effect: {
  1343. duration: 5,
  1344. durationCallback: function (source, effect) {
  1345. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) {
  1346. return 7;
  1347. }
  1348. return 5;
  1349. },
  1350. onStart: function (side, source) {
  1351. this.add('-fieldstart', 'move: Water Sport', '[of] ' + source);
  1352. },
  1353. onBasePowerPriority: 1,
  1354. onBasePower: function (basePower, attacker, defender, move) {
  1355. if (move.type === 'Fire') {
  1356. this.debug('water sport weaken');
  1357. return this.chainModify([0x548, 0x1000]);
  1358. }
  1359. },
  1360. onResidualOrder: 21,
  1361. onEnd: function () {
  1362. this.add('-fieldend', 'move: Water Sport');
  1363. },
  1364. },
  1365. },
  1366. "wonderroom": {
  1367. inherit: true,
  1368. effect: {
  1369. duration: 5,
  1370. durationCallback: function (source, effect) {
  1371. if (this.isTerrain('rockyterrain') && source && source.hasAbility('gemenergy')) {
  1372. return 7;
  1373. }
  1374. return 5;
  1375. },
  1376. onStart: function (side, source) {
  1377. this.add('-fieldstart', 'move: Wonder Room', '[of] ' + source);
  1378. },
  1379. onRestart: function (target, source) {
  1380. this.removePseudoWeather('wonderroom');
  1381. },
  1382. // Swapping defenses implemented in sim/pokemon.js:Pokemon#calculateStat and Pokemon#getStat
  1383. onResidualOrder: 24,
  1384. onEnd: function () {
  1385. this.add('-fieldend', 'move: Wonder Room');
  1386. },
  1387. },
  1388. },
  1389. };
Add Comment
Please, Sign In to add comment