Guest User

Untitled

a guest
Aug 26th, 2017
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.55 KB | None | 0 0
  1. 'use strict';
  2.  
  3. exports.BattleMovedex = {
  4. "pollinatedterrain": {
  5. accuracy: true,
  6. basePower: 0,
  7. category: "Status",
  8. id: "pollinatedterrain",
  9. name: "Pollinated Terrain",
  10. pp: 10,
  11. priority: 0,
  12. flags: {nonsky: 1},
  13. terrain: 'pollinatedterrain',
  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, 'Pollinated Terrain');
  32. return false;
  33. }
  34. },
  35. onStart: function (battle, source, effect) {
  36. if (effect && effect.effectType === 'Ability') {
  37. this.add('-fieldstart', 'move: Pollinated Terrain', '[from] ability: ' + effect, '[of] ' + source);
  38. } else {
  39. this.add('-fieldstart', 'move: Pollinated Terrain');
  40. }
  41. },
  42. onResidualOrder: 21,
  43. onResidualSubOrder: 2,
  44. onEnd: function () {
  45. this.add('-fieldend', 'move: Pollinated 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', 'move: 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. onNegateImmunity: function (pokemon, type) {
  132. if (pokemon.isGrounded()) return false;
  133. },
  134. onStart: function (battle, source, effect) {
  135. if (effect && effect.effectType === 'Ability') {
  136. this.add('-fieldstart', 'move: Regal Terrain', '[from] ability: ' + effect, '[of] ' + source);
  137. } else {
  138. this.add('-fieldstart', 'move: Regal Terrain');
  139. }
  140. },
  141. onResidualOrder: 21,
  142. onResidualSubOrder: 2,
  143. onEnd: function () {
  144. this.add('-fieldend', 'move: Regal Terrain');
  145. },
  146. },
  147. secondary: false,
  148. target: "all",
  149. type: "Dragon",
  150. zMoveBoost: {spa: 1},
  151. },
  152. "fieryterrain": {
  153. accuracy: true,
  154. basePower: 0,
  155. category: "Status",
  156. id: "fieryterrain",
  157. name: "Fiery Terrain",
  158. pp: 10,
  159. priority: 0,
  160. flags: {nonsky: 1},
  161. terrain: 'fieryterrain',
  162. effect: {
  163. duration: 5,
  164. durationCallback: function (source, effect) {
  165. if (source && source.hasItem('terrainextender')) {
  166. return 8;
  167. }
  168. return 5;
  169. },
  170. onBasePower: function (basePower, attacker, defender, move) {
  171. if (move.type === 'Fire' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  172. this.debug('terrain boost');
  173. return this.chainModify(1.5);
  174. }
  175. },
  176. onResidualOrder: 5,
  177. onResidualSubOrder: 2,
  178. onResidual: function () {
  179. this.eachEvent('Terrain');
  180. },
  181. onTerrain: function (pokemon) {
  182. if (pokemon.isGrounded() && pokemon.types.indexOf('Fire') < 0 && !pokemon.isSemiInvulnerable()) {
  183. this.damage(pokemon.maxhp / 8, pokemon, pokemon, 'Fiery Terrain');
  184. }
  185. },
  186. onTrapPokemon: function (pokemon) {
  187. if (pokemon.isGrounded() && pokemon.types.indexOf('Fire') < 0) {
  188. if (this.effectData.source && this.effectData.source.isActive) pokemon.tryTrap();
  189. }
  190. },
  191. onStart: function (battle, source, effect) {
  192. if (effect && effect.effectType === 'Ability') {
  193. this.add('-fieldstart', 'move: Fiery Terrain', '[from] ability: ' + effect, '[of] ' + source);
  194. } else {
  195. this.add('-fieldstart', 'move: Fiery Terrain');
  196. }
  197. },
  198. onEnd: function () {
  199. this.add('-fieldend', 'move: Fiery Terrain');
  200. },
  201. },
  202. secondary: false,
  203. target: "all",
  204. type: "Fiery",
  205. zMoveBoost: {atk: 1},
  206. },
  207. "chakraterrain": {
  208. accuracy: true,
  209. basePower: 0,
  210. category: "Status",
  211. id: "chakraterrain",
  212. name: "Chakra Terrain",
  213. pp: 10,
  214. priority: 0,
  215. flags: {nonsky: 1},
  216. terrain: 'chakraterrain',
  217. effect: {
  218. duration: 5,
  219. durationCallback: function (source, effect) {
  220. if (source && source.hasItem('terrainextender')) {
  221. return 8;
  222. }
  223. return 5;
  224. },
  225. onBasePower: function (basePower, attacker, defender, move) {
  226. if (move.type === 'Fighting' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  227. this.debug('terrain boost');
  228. return this.chainModify(1.5);
  229. }
  230. },
  231. onNegateImmunity: function (pokemon, type) {
  232. if (pokemon.isGrounded() && pokemon.hasType('Dark') && type === 'Psychic') return false;
  233. },
  234. onStart: function (battle, source, effect) {
  235. if (effect && effect.effectType === 'Ability') {
  236. this.add('-fieldstart', 'move: Chakra Terrain', '[from] ability: ' + effect, '[of] ' + source);
  237. } else {
  238. this.add('-fieldstart', 'move: Chakra Terrain');
  239. }
  240. },
  241. onResidualOrder: 21,
  242. onResidualSubOrder: 2,
  243. onEnd: function () {
  244. this.add('-fieldend', 'move: Chakra Terrain');
  245. },
  246. },
  247. secondary: false,
  248. target: "all",
  249. type: "Fighting",
  250. zMoveBoost: {atk: 1},
  251. },
  252. "gustyterrain": {
  253. accuracy: true,
  254. basePower: 0,
  255. category: "Status",
  256. id: "gustyterrain",
  257. name: "Gusty Terrain",
  258. pp: 10,
  259. priority: 0,
  260. flags: {},
  261. terrain: 'gustyterrain',
  262. effect: {
  263. duration: 5,
  264. durationCallback: function (source, effect) {
  265. if (source && source.hasItem('terrainextender')) {
  266. return 8;
  267. }
  268. return 5;
  269. },
  270. onBasePower: function (basePower, attacker, defender, move) {
  271. if (move.type === 'Flying' && !attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  272. this.debug('terrain boost');
  273. return this.chainModify(1.5);
  274. }
  275. },
  276. onBoost: function (boost, target, source, effect) {
  277. if (source && (!effect.infiltrates || target.side === source.side) && !target.isGrounded()) {
  278. let showMsg = false;
  279. if (boost['spe'] != 0) {
  280. delete boost['spe'];
  281. showMsg = true;
  282. }
  283. if (showMsg && !effect.secondaries) this.add('-activate', target, 'move: Gusty Terrain');
  284. }
  285. },
  286. onStart: function (battle, source, effect) {
  287. if (effect && effect.effectType === 'Ability') {
  288. this.add('-fieldstart', 'move: Gusty Terrain', '[from] ability: ' + effect, '[of] ' + source);
  289. } else {
  290. this.add('-fieldstart', 'move: Gusty Terrain');
  291. }
  292. for (let i = 0; i < this.sides.length; i++) {
  293. for (let j = 0; j < this.sides[i].active.length; j++) {
  294. if (this.sides[i].active[j] && this.sides[i].active[j].isActive && !this.sides[i].active[j].isGrounded() && this.sides[i].active[j].boosts['spe'] !== 0) {
  295. this.add('-clearallboost');
  296. this.sides[i].active[j].setBoost({spe: 0});
  297. }
  298. }
  299. }
  300. },
  301. onResidualOrder: 21,
  302. onResidualSubOrder: 2,
  303. onEnd: function () {
  304. this.add('-fieldend', 'move: Gusty Terrain');
  305. },
  306. },
  307. secondary: false,
  308. target: "all",
  309. type: "Flying",
  310. zMoveBoost: {spe: 1},
  311. },
  312. "ominousterrain": {
  313. accuracy: true,
  314. basePower: 0,
  315. category: "Status",
  316. id: "ominousterrain",
  317. name: "Ominous Terrain",
  318. pp: 10,
  319. priority: 0,
  320. flags: {nonsky: 1},
  321. terrain: 'ominousterrain',
  322. effect: {
  323. duration: 5,
  324. durationCallback: function (source, effect) {
  325. if (source && source.hasItem('terrainextender')) {
  326. return 8;
  327. }
  328. return 5;
  329. },
  330. onBasePower: function (basePower, attacker, defender, move) {
  331. if (move.type === 'Ghost' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  332. this.debug('terrain boost');
  333. return this.chainModify(1.5);
  334. }
  335. },
  336. onDisableMove: function (pokemon) {
  337. if (pokemon.isGrounded()) {
  338. for (let i = 0; i < pokemon.moveset.length; i++) {
  339. if (this.getMove(pokemon.moveset[i].id).flags['heal']) {
  340. pokemon.disableMove(pokemon.moveset[i].id);
  341. }
  342. }
  343. }
  344. },
  345. onBeforeMovePriority: 6,
  346. onBeforeMove: function (pokemon, target, move) {
  347. if (pokemon.isGrounded() && move.flags['heal']) {
  348. this.add('cant', pokemon, 'move: Ominous Terrain', move);
  349. return false;
  350. }
  351. },
  352. onStart: function (battle, source, effect) {
  353. if (effect && effect.effectType === 'Ability') {
  354. this.add('-fieldstart', 'move: Ominous Terrain', '[from] ability: ' + effect, '[of] ' + source);
  355. } else {
  356. this.add('-fieldstart', 'move: Ominous Terrain');
  357. }
  358. },
  359. onResidualOrder: 21,
  360. onResidualSubOrder: 2,
  361. onEnd: function () {
  362. this.add('-fieldend', 'move: Ominous Terrain');
  363. },
  364. },
  365. secondary: false,
  366. target: "all",
  367. type: "Ghost",
  368. zMoveBoost: {spe: 1},
  369. },
  370. "sandyterrain": {
  371. accuracy: true,
  372. basePower: 0,
  373. category: "Status",
  374. id: "sandyterrain",
  375. name: "Sandy Terrain",
  376. pp: 10,
  377. priority: 0,
  378. flags: {nonsky: 1},
  379. terrain: 'sandyterrain',
  380. effect: {
  381. duration: 5,
  382. durationCallback: function (source, effect) {
  383. if (source && source.hasItem('terrainextender')) {
  384. return 8;
  385. }
  386. return 5;
  387. },
  388. onBasePower: function (basePower, attacker, defender, move) {
  389. if ((move.type === 'Ground' || move.type === 'Rock' || move.type === 'Steel') && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  390. this.debug('terrain boost');
  391. return this.chainModify(1.3);
  392. }
  393. },
  394. onTryHit: function (target, pokemon, move) {
  395. if (target.isGrounded() && target.types.indexOf('Ground') >= 0 && pokemon !== target && move.category === 'Status') {
  396. this.add('-immune', target, '[msg]', '[from] move: Sandy Terrain');
  397. return null;
  398. }
  399. },
  400. onStart: function (battle, source, effect) {
  401. if (effect && effect.effectType === 'Ability') {
  402. this.add('-fieldstart', 'move: Sandy Terrain', '[from] ability: ' + effect, '[of] ' + source);
  403. } else {
  404. this.add('-fieldstart', 'move: Sandy Terrain');
  405. }
  406. },
  407. onResidualOrder: 21,
  408. onResidualSubOrder: 2,
  409. onEnd: function () {
  410. this.add('-fieldend', 'move: Sandy Terrain');
  411. },
  412. },
  413. secondary: false,
  414. target: "all",
  415. type: "Ground",
  416. zMoveBoost: {def: 1},
  417. },
  418. "frostyterrain": {
  419. accuracy: true,
  420. basePower: 0,
  421. category: "Status",
  422. id: "frostyterrain",
  423. name: "Frosty Terrain",
  424. pp: 10,
  425. priority: 0,
  426. flags: {nonsky: 1},
  427. terrain: 'frostyterrain',
  428. effect: {
  429. duration: 5,
  430. durationCallback: function (source, effect) {
  431. if (source && source.hasItem('terrainextender')) {
  432. return 8;
  433. }
  434. return 5;
  435. },
  436. onBasePower: function (basePower, attacker, defender, move) {
  437. if (move.type === 'Ice' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  438. this.debug('terrain boost');
  439. return this.chainModify(1.5);
  440. }
  441. },
  442. onDisableMove: function (pokemon) {
  443. if (pokemon.isGrounded()) {
  444. for (let i = 0; i < pokemon.moveset.length; i++) {
  445. if (this.getMove(pokemon.moveset[i].id).type === 'Water' && !(pokemon.moveset[i].id in {'scald':1, 'steameruption':1})) {
  446. pokemon.disableMove(pokemon.moveset[i].id);
  447. }
  448. }
  449. }
  450. },
  451. onBeforeMovePriority: 6,
  452. onBeforeMove: function (pokemon, target, move) {
  453. if (pokemon.isGrounded() && move.type === 'Water' && !(move.id in {'scald':1, 'steameruption':1})) {
  454. this.add('cant', pokemon, 'move: Frosty Terrain', move);
  455. return false;
  456. }
  457. },
  458. onStart: function (battle, source, effect) {
  459. if (effect && effect.effectType === 'Ability') {
  460. this.add('-fieldstart', 'move: Frosty Terrain', '[from] ability: ' + effect, '[of] ' + source);
  461. } else {
  462. this.add('-fieldstart', 'move: Frosty Terrain');
  463. }
  464. },
  465. onResidualOrder: 21,
  466. onResidualSubOrder: 2,
  467. onEnd: function () {
  468. this.add('-fieldend', 'move: Frosty Terrain');
  469. },
  470. },
  471. secondary: false,
  472. target: "all",
  473. type: "Ice",
  474. zMoveBoost: {spa: 1},
  475. },
  476. "cloudyterrain": {
  477. num: 604,
  478. accuracy: true,
  479. basePower: 0,
  480. category: "Status",
  481. id: "cloudyterrain",
  482. name: "Cloudy Terrain",
  483. pp: 10,
  484. priority: 0,
  485. flags: {nonsky: 1},
  486. terrain: 'cloudyterrain',
  487. effect: {
  488. duration: 5,
  489. durationCallback: function (source, effect) {
  490. if (source && source.hasItem('terrainextender')) {
  491. return 8;
  492. }
  493. return 5;
  494. },
  495. onBasePower: function (basePower, attacker, defender, move) {
  496. if (move.type === 'Normal' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  497. this.debug('terrain boost');
  498. return this.chainModify(1.5);
  499. }
  500. if (move.type !== 'Normal' && defender.isGrounded() && !defender.isSemiInvulnerable()) {
  501. this.debug('terrain weaken');
  502. return this.chainModify(0.75);
  503. }
  504. },
  505. onStart: function (battle, source, effect) {
  506. if (effect && effect.effectType === 'Ability') {
  507. this.add('-fieldstart', 'move: Cloudy Terrain', '[from] ability: ' + effect, '[of] ' + source);
  508. } else {
  509. this.add('-fieldstart', 'move: Cloudy Terrain');
  510. }
  511. },
  512. onResidualOrder: 21,
  513. onResidualSubOrder: 2,
  514. onEnd: function () {
  515. this.add('-fieldend', 'move: Cloudy Terrain');
  516. },
  517. },
  518. secondary: false,
  519. target: "all",
  520. type: "Normal",
  521. zMoveBoost: {spd: 1},
  522. },
  523. "rockyterrain": {
  524. num: 604,
  525. accuracy: true,
  526. basePower: 0,
  527. category: "Status",
  528. id: "rockyterrain",
  529. name: "Rocky Terrain",
  530. pp: 10,
  531. priority: 0,
  532. flags: {nonsky: 1},
  533. terrain: 'rockyterrain',
  534. effect: {
  535. duration: 5,
  536. durationCallback: function (source, effect) {
  537. if (source && source.hasItem('terrainextender')) {
  538. return 8;
  539. }
  540. return 5;
  541. },
  542. onBasePower: function (basePower, attacker, defender, move) {
  543. if (move.type === 'Rock' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  544. this.debug('terrain boost');
  545. return this.chainModify(1.5);
  546. }
  547. },
  548. onModifyAccuracy: function (accuracy, target, source, move) {
  549. if (source.isGrounded()) {
  550. if (typeof accuracy !== 'number') return;
  551. return accuracy * 4 / 3;
  552. }
  553. },
  554. onStart: function (battle, source, effect) {
  555. if (effect && effect.effectType === 'Ability') {
  556. this.add('-fieldstart', 'move: Rocky Terrain', '[from] ability: ' + effect, '[of] ' + source);
  557. } else {
  558. this.add('-fieldstart', 'move: Rocky Terrain');
  559. }
  560. },
  561. onResidualOrder: 21,
  562. onResidualSubOrder: 2,
  563. onEnd: function () {
  564. this.add('-fieldend', 'move: Rocky Terrain');
  565. },
  566. },
  567. secondary: false,
  568. target: "all",
  569. type: "Rock",
  570. zMoveBoost: {att: 1},
  571. },
  572. "corrosiveterrain": {
  573. accuracy: true,
  574. basePower: 0,
  575. category: "Status",
  576. id: "corrosiveterrain",
  577. name: "Corrosive Terrain",
  578. pp: 10,
  579. priority: 0,
  580. flags: {nonsky: 1},
  581. terrain: 'corrosiveterrain',
  582. effect: {
  583. duration: 5,
  584. durationCallback: function (source, effect) {
  585. if (source && source.hasItem('terrainextender')) {
  586. return 8;
  587. }
  588. return 5;
  589. },
  590. onBasePower: function (basePower, attacker, defender, move) {
  591. if (move.type === 'Poison' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  592. this.debug('terrain boost');
  593. return this.chainModify(1.5);
  594. }
  595. },
  596. onNegateImmunity: function (pokemon, type) {
  597. if (pokemon.isGrounded() && pokemon.hasType('Steel') && type === 'Poison') return false;
  598. },
  599. onStart: function (battle, source, effect) {
  600. if (effect && effect.effectType === 'Ability') {
  601. this.add('-fieldstart', 'move: Corrosive Terrain', '[from] ability: ' + effect, '[of] ' + source);
  602. } else {
  603. this.add('-fieldstart', 'move: Corrosive Terrain');
  604. }
  605. },
  606. onResidualOrder: 21,
  607. onResidualSubOrder: 2,
  608. onEnd: function () {
  609. this.add('-fieldend', 'move: Corrosive Terrain');
  610. },
  611. },
  612. secondary: false,
  613. target: "all",
  614. type: "Poison",
  615. zMoveBoost: {spe: 1},
  616. },
  617. "steelstrewnterrain": {
  618. accuracy: true,
  619. basePower: 0,
  620. category: "Status",
  621. id: "steelstrewnterrain",
  622. name: "Steelstrewn Terrain",
  623. pp: 10,
  624. priority: 0,
  625. flags: {nonsky: 1},
  626. terrain: 'steelstrewnterrain',
  627. effect: {
  628. duration: 5,
  629. durationCallback: function (source, effect) {
  630. if (source && source.hasItem('terrainextender')) {
  631. return 8;
  632. }
  633. return 5;
  634. },
  635. onBasePower: function (basePower, attacker, defender, move) {
  636. if (move.type === 'Steel' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  637. this.debug('terrain boost');
  638. return this.chainModify(1.5);
  639. }
  640. },
  641. onStart: function (battle, source, effect) {
  642. if (effect && effect.effectType === 'Ability') {
  643. this.add('-fieldstart', 'move: Steelstrewn Terrain', '[from] ability: ' + effect, '[of] ' + source);
  644. } else {
  645. this.add('-fieldstart', 'move: Steelstrewn Terrain');
  646. }
  647. },
  648. onResidualOrder: 21,
  649. onResidualSubOrder: 2,
  650. onEnd: function () {
  651. this.add('-fieldend', 'move: Steelstrewn Terrain');
  652. },
  653. },
  654. secondary: false,
  655. target: "all",
  656. type: "Steel",
  657. zMoveEffect: 'crit2',
  658. },
  659. "aquaticterrain": {
  660. accuracy: true,
  661. basePower: 0,
  662. category: "Status",
  663. id: "aquaticterrain",
  664. name: "Aquatic Terrain",
  665. pp: 10,
  666. priority: 0,
  667. flags: {nonsky: 1},
  668. terrain: 'aquaticterrain',
  669. effect: {
  670. duration: 5,
  671. durationCallback: function (source, effect) {
  672. if (source && source.hasItem('terrainextender')) {
  673. return 8;
  674. }
  675. return 5;
  676. },
  677. onBasePower: function (basePower, attacker, defender, move) {
  678. if (move.type === 'Water' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
  679. this.debug('terrain boost');
  680. return this.chainModify(1.5);
  681. }
  682. },
  683. onModifySpe: function (spe, pokemon) {
  684. if (pokemon.isGrounded()) {
  685. if (pokemon.types.indexOf('Water') >= 0) return this.chainModify(1.5);
  686. else return this.chainModify(0.5);
  687. }
  688. },
  689. onStart: function (battle, source, effect) {
  690. if (effect && effect.effectType === 'Ability') {
  691. this.add('-fieldstart', 'move: Aquatic Terrain', '[from] ability: ' + effect, '[of] ' + source);
  692. } else {
  693. this.add('-fieldstart', 'move: Aquatic Terrain');
  694. }
  695. },
  696. onResidualOrder: 21,
  697. onResidualSubOrder: 2,
  698. onEnd: function () {
  699. this.add('-fieldend', 'move: Steelstrewn Terrain');
  700. },
  701. },
  702. secondary: false,
  703. target: "all",
  704. type: "Water",
  705. zMoveBoost: {spe: 1},
  706. },
  707.  
  708. "camouflage": {
  709. inherit: true,
  710. onHit: function (target) {
  711. let newType = 'Normal';
  712. if (this.isTerrain('electricterrain')) {
  713. newType = 'Electric';
  714. } else if (this.isTerrain('grassyterrain')) {
  715. newType = 'Grass';
  716. } else if (this.isTerrain('mistyterrain')) {
  717. newType = 'Fairy';
  718. } else if (this.isTerrain('psychicterrain')) {
  719. newType = 'Psychic';
  720. } else if (this.isTerrain('pollinatedterrain')) {
  721. newType = 'Bug';
  722. } else if (this.isTerrain('murkyterrain')) {
  723. newType = 'Dark';
  724. } else if (this.isTerrain('regalterrain')) {
  725. newType = 'Dragon';
  726. } else if (this.isTerrain('fieryterrain')) {
  727. newType = 'Fire';
  728. } else if (this.isTerrain('chakraterrain')) {
  729. newType = 'Fighting';
  730. } else if (this.isTerrain('gustyterrain')) {
  731. newType = 'Flying';
  732. } else if (this.isTerrain('ominousterrain')) {
  733. newType = 'Ghost';
  734. } else if (this.isTerrain('sandyterrain')) {
  735. newType = 'Ground';
  736. } else if (this.isTerrain('frostyterrain')) {
  737. newType = 'Ice';
  738. } else if (this.isTerrain('rockyterrain')) {
  739. newType = 'Rock';
  740. } else if (this.isTerrain('corrosiveterrain')) {
  741. newType = 'Poison';
  742. } else if (this.isTerrain('steelstrewnterrain')) {
  743. newType = 'Steel';
  744. } else if (this.isTerrain('aquaticterrain')) {
  745. newType = 'Water';
  746. }
  747. if (!target.setType(newType)) return false;
  748. this.add('-start', target, 'typechange', newType);
  749. },
  750. },
  751. "naturepower": {
  752. inherit: true,
  753. onTryHit: function (target, pokemon) {
  754. let move = 'triattack';
  755. if (this.isTerrain('electricterrain')) {
  756. move = 'thunderbolt';
  757. } else if (this.isTerrain('grassyterrain')) {
  758. move = 'energyball';
  759. } else if (this.isTerrain('mistyterrain')) {
  760. move = 'moonblast';
  761. } else if (this.isTerrain('psychicterrain')) {
  762. move = 'psychic';
  763. } else if (this.isTerrain('pollinatedterrain')) {
  764. move = 'pollenpuff';
  765. } else if (this.isTerrain('murkyterrain')) {
  766. move = 'darkpulse';
  767. } else if (this.isTerrain('regalterrain')) {
  768. move = 'dragonpulse';
  769. } else if (this.isTerrain('fieryterrain')) {
  770. move = 'lavaplume';
  771. } else if (this.isTerrain('chakraterrain')) {
  772. move = 'aurasphere';
  773. } else if (this.isTerrain('gustyterrain')) {
  774. move = 'airslash';
  775. } else if (this.isTerrain('ominousterrain')) {
  776. move = 'shadowball';
  777. } else if (this.isTerrain('sandyterrain')) {
  778. move = 'earthpower';
  779. } else if (this.isTerrain('frostyterrain')) {
  780. move = 'icebeam';
  781. } else if (this.isTerrain('rockyterrain')) {
  782. move = 'powergem';
  783. } else if (this.isTerrain('corrosiveterrain')) {
  784. move = 'sludgebomb';
  785. } else if (this.isTerrain('steelstrewnterrain')) {
  786. move = 'mirrorshot';
  787. } else if (this.isTerrain('aquaticterrain')) {
  788. move = 'surf';
  789. }
  790. this.useMove(move, pokemon, target);
  791. return null;
  792. },
  793. },
  794. "secretpower": {
  795. inherit: true,
  796. onModifyMove: function (move, pokemon) {
  797. if (this.isTerrain('') || this.isTerrain('chakraterrain') || this.isTerrain('cloudyterrain')) return;
  798. move.secondaries = [];
  799. if (this.isTerrain('electricterrain')) {
  800. move.secondaries.push({
  801. chance: 30,
  802. status: 'par',
  803. });
  804. } else if (this.isTerrain('grassyterrain')) {
  805. move.secondaries.push({
  806. chance: 30,
  807. status: 'slp',
  808. });
  809. } else if (this.isTerrain('mistyterrain')) {
  810. move.secondaries.push({
  811. chance: 30,
  812. boosts: {
  813. spa: -1,
  814. },
  815. });
  816. } else if (this.isTerrain('psychicterrain')) {
  817. move.secondaries.push({
  818. chance: 30,
  819. boosts: {
  820. spe: -1,
  821. },
  822. });
  823. } else if (this.isTerrain('pollinatedterrain')) {
  824. move.secondaries.push({
  825. chance: 30,
  826. boosts: {
  827. spd: -1,
  828. },
  829. });
  830. } else if (this.isTerrain('murkyterrain')) {
  831. move.secondaries.push({
  832. chance: 30,
  833. volatileStatus: 'torment',
  834. });
  835. } else if (this.isTerrain('regalterrain')) {
  836. move.secondaries.push({
  837. chance: 30,
  838. volatileStatus: 'flinch',
  839. });
  840. } else if (this.isTerrain('fieryterrain')) {
  841. move.secondaries.push({
  842. chance: 30,
  843. status: 'brn',
  844. });
  845. } else if (this.isTerrain('gustyterrain')) {
  846. move.secondaries.push({
  847. chance: 30,
  848. volatileStatus: 'telekinesis',
  849. });
  850. } else if (this.isTerrain('ominousterrain')) {
  851. move.secondaries.push({
  852. chance: 30,
  853. boosts: {
  854. def: -1,
  855. },
  856. });
  857. } else if (this.isTerrain('sandyterrain')) {
  858. move.secondaries.push({
  859. chance: 30,
  860. boosts: {
  861. def: -1,
  862. },
  863. });
  864. } else if (this.isTerrain('frostyterrain')) {
  865. move.secondaries.push({
  866. chance: 30,
  867. status: 'frz',
  868. });
  869. } else if (this.isTerrain('rockyterrain')) {
  870. move.secondaries.push({
  871. chance: 30,
  872. volatileStatus: 'flinch',
  873. });
  874. } else if (this.isTerrain('corrosiveterrain')) {
  875. move.secondaries.push({
  876. chance: 30,
  877. status: 'tox',
  878. });
  879. } else if (this.isTerrain('steelstrewnterrain')) {
  880. move.secondaries.push({
  881. chance: 30,
  882. self: {
  883. boosts: {
  884. atk: 1,
  885. },
  886. },
  887. });
  888. } else if (this.isTerrain('aquaticterrain')) {
  889. move.secondaries.push({
  890. chance: 30,
  891. boosts: {
  892. atk: -1,
  893. },
  894. });
  895. }
  896. },
  897. secondary: {
  898. chance: 30,
  899. status: 'par',
  900. },
  901. },
  902. };
Add Comment
Please, Sign In to add comment