Advertisement
Pikachuun

clockmons/moves.js

Sep 14th, 2014
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.78 KB | None | 0 0
  1. exports.BattleMovedex = {
  2. "doomdesire": {
  3. inherit: true,
  4. desc: "Deals damage to one adjacent target one turn after this move is used. At the end of that turn, the damage is calculated at that time and dealt to the Pokemon at the position the target had when the move was used. If the user is no longer active at the time, damage is calculated based on the user's natural Special Attack stat, types, and level, with no boosts from its held item or Ability. Fails if this move or Future Sight is already in effect for the target's position. This move ignores Protect and Detect.",
  5. shortDesc: "Hits one turn after being used.",
  6. onTryHit: function (target, source) {
  7. source.side.addSideCondition('futuremove');
  8. if (source.side.sideConditions['futuremove'].positions[source.position]) {
  9. return false;
  10. }
  11. source.side.sideConditions['futuremove'].positions[source.position] = {
  12. duration: 2,
  13. move: 'doomdesire',
  14. targetPosition: target.position,
  15. source: source,
  16. moveData: {
  17. basePower: 140,
  18. category: "Special",
  19. type: 'Steel'
  20. }
  21. };
  22. this.add('-start', source, 'Doom Desire');
  23. return null;
  24. }
  25. },
  26. "electricterrain": {
  27. inherit: true,
  28. desc: "For ten turns, Pokemon on the ground cannot fall asleep. Their Electric-type moves are powered up by 50%.",
  29. effect: {
  30. duration: 10,
  31. onSetStatus: function (status, target, source, effect) {
  32. if (status.id === 'slp' && target.runImmunity('Ground')) {
  33. this.debug('Interrupting sleep from Electric Terrain');
  34. return false;
  35. }
  36. },
  37. onBasePower: function (basePower, attacker, defender, move) {
  38. if (move.type === 'Electric' && attacker.runImmunity('Ground')) {
  39. this.debug('electric terrain boost');
  40. return this.chainModify(1.5);
  41. }
  42. },
  43. onStart: function () {
  44. this.add('-fieldstart', 'move: Electric Terrain');
  45. },
  46. onResidualOrder: 21,
  47. onResidualSubOrder: 2,
  48. onEnd: function () {
  49. this.add('-fieldend', 'move: Electric Terrain');
  50. }
  51. }
  52. },
  53. "futuresight": {
  54. inherit: true,
  55. desc: "Deals damage to one adjacent target one turn after this move is used. At the end of that turn, the damage is dealt to the Pokemon at the position the target had when the move was used. If the user is no longer active at the time, damage is calculated based on the user's natural Special Attack stat, types, and level, with no boosts from its held item or Ability. Fails if this move or Doom Desire is already in effect for the target's position. This move ignores Protect and Detect.",
  56. shortDesc: "Hits one turn after being used.",
  57. onTryHit: function (target, source) {
  58. source.side.addSideCondition('futuremove');
  59. if (source.side.sideConditions['futuremove'].positions[source.position]) {
  60. return false;
  61. }
  62. source.side.sideConditions['futuremove'].positions[source.position] = {
  63. duration: 2,
  64. move: 'futuresight',
  65. targetPosition: target.position,
  66. source: source,
  67. moveData: {
  68. basePower: 120,
  69. category: "Special",
  70. affectedByImmunities: true,
  71. type: 'Psychic'
  72. }
  73. };
  74. this.add('-start', source, 'move: Future Sight');
  75. return null;
  76. }
  77. },
  78. "grassyterrain": {
  79. inherit: true,
  80. desc: "For ten turns, Pokemon on the ground restore 1/16 of their HP each turn. Their Grass-type moves are powered up by 50%. Damage caused by Earthquake, Bulldoze or Magnitude is halved.",
  81. effect: {
  82. duration: 10,
  83. onBasePower: function (basePower, attacker, defender, move) {
  84. var weakenedMoves = {'earthquake':1, 'bulldoze':1, 'magnitude':1};
  85. if (move.id in weakenedMoves) {
  86. this.debug('move weakened by grassy terrain');
  87. return this.chainModify(0.5);
  88. }
  89. if (move.type === 'Grass' && attacker.runImmunity('Ground')) {
  90. this.debug('grassy terrain boost');
  91. return this.chainModify(1.5);
  92. }
  93. },
  94. onStart: function (target, source) {
  95. this.add('-fieldstart', 'move: Grassy Terrain');
  96. },
  97. onResidualOrder: 5,
  98. onResidualSubOrder: 2,
  99. onResidual: function (battle) {
  100. this.debug('onResidual battle');
  101. for (var s in battle.sides) {
  102. for (var p in battle.sides[s].active) {
  103. if (battle.sides[s].active[p].runImmunity('Ground')) {
  104. this.debug('Pokémon is grounded, healing through Grassy Terrain.');
  105. this.heal(battle.sides[s].active[p].maxhp / 16, battle.sides[s].active[p], battle.sides[s].active[p]);
  106. }
  107. }
  108. }
  109. },
  110. onEnd: function () {
  111. this.add('-fieldend', 'move: Grassy Terrain');
  112. }
  113. }
  114. },
  115. "gravity": {
  116. inherit: true,
  117. desc: "For 10 turns, the evasion of all active Pokemon is 0.6x. At the time of use, Bounce, Fly, Magnet Rise, Sky Drop, and Telekinesis end immediately for all active Pokemon. During the effect, Bounce, Fly, High Jump Kick, Jump Kick, Magnet Rise, Sky Drop, Splash, and Telekinesis are prevented from being used by all active Pokemon. Ground-type attacks, Spikes, Toxic Spikes, and the Ability Arena Trap can affect Flying-types or Pokemon with the Ability Levitate. Fails if this move is already in effect.",
  118. shortDesc: "For 10 turns, negates all Ground immunities.",
  119. effect: {
  120. duration: 10,
  121. durationCallback: function (source, effect) {
  122. if (source && source.hasAbility('persistent')) {
  123. return 13;
  124. }
  125. return 10;
  126. },
  127. onStart: function () {
  128. this.add('-fieldstart', 'move: Gravity');
  129. },
  130. onAccuracy: function (accuracy) {
  131. if (typeof accuracy !== 'number') return;
  132. return accuracy * 5 / 3;
  133. },
  134. onModifyPokemonPriority: 100,
  135. onModifyPokemon: function (pokemon) {
  136. pokemon.negateImmunity['Ground'] = true;
  137. var disabledMoves = {bounce:1, fly:1, highjumpkick:1, jumpkick:1, magnetrise:1, skydrop:1, splash:1, telekinesis:1};
  138. for (var m in disabledMoves) {
  139. pokemon.disabledMoves[m] = true;
  140. }
  141. var applies = false;
  142. if (pokemon.removeVolatile('bounce') || pokemon.removeVolatile('fly') || pokemon.removeVolatile('skydrop')) {
  143. applies = true;
  144. this.cancelMove(pokemon);
  145. }
  146. if (pokemon.volatiles['magnetrise']) {
  147. applies = true;
  148. delete pokemon.volatiles['magnetrise'];
  149. }
  150. if (pokemon.volatiles['telekinesis']) {
  151. applies = true;
  152. delete pokemon.volatiles['telekinesis'];
  153. }
  154. if (applies) this.add('-activate', pokemon, 'Gravity');
  155. },
  156. onBeforeMove: function (pokemon, target, move) {
  157. var disabledMoves = {bounce:1, fly:1, highjumpkick:1, jumpkick:1, magnetrise:1, skydrop:1, splash:1, telekinesis:1};
  158. if (disabledMoves[move.id]) {
  159. this.add('cant', pokemon, 'move: Gravity', move);
  160. return false;
  161. }
  162. },
  163. onResidualOrder: 22,
  164. onEnd: function () {
  165. this.add('-fieldend', 'move: Gravity');
  166. }
  167. }
  168. },
  169. "hail": {
  170. inherit: true,
  171. desc: "For 10 turns, the weather becomes Hail. At the end of each turn except the last, all active Pokemon lose 1/16 of their maximum HP, rounded down, unless they are an Ice-type, or have the Abilities Ice Body, Magic Guard, Overcoat, or Snow Cloak. Lasts for 13 turns if the user is holding Icy Rock. Fails if the current weather is Hail.",
  172. shortDesc: "For 10 turns, hail crashes down."
  173. },
  174. "magicroom": {
  175. inherit: true,
  176. desc: "For 10 turns, the held items of all active Pokemon have no effect. During the effect, Fling and Natural Gift are prevented from being used by all active Pokemon. If this move is used during the effect, the effect ends.",
  177. shortDesc: "For 10 turns, all held items have no effect.",
  178. effect: {
  179. duration: 10,
  180. /*durationCallback: function (source, effect) {
  181. // Persistent isn't updated for BW moves
  182. if (source && source.hasAbility('Persistent')) {
  183. return 7;
  184. }
  185. return 5;
  186. },*/
  187. onStart: function (target, source) {
  188. this.add('-fieldstart', 'move: Magic Room', '[of] ' + source);
  189. },
  190. onModifyPokemonPriority: 1,
  191. onModifyPokemon: function (pokemon) {
  192. if (pokemon.getItem().megaEvolves) return;
  193. pokemon.ignore['Item'] = true;
  194. },
  195. onResidualOrder: 25,
  196. onEnd: function () {
  197. this.add('-fieldend', 'move: Magic Room', '[of] ' + this.effectData.source);
  198. }
  199. }
  200. },
  201. "mistyterrain": {
  202. inherit: true,
  203. desc: "For ten turns, Grounded Pokemon cannot have major status problem inflicted on them by other Pokemon. Dragon-type moves used against them are weakened by 50%.",
  204. effect: {
  205. duration: 10,
  206. onSetStatus: function (status, target, source, effect) {
  207. if (!target.runImmunity('Ground')) return;
  208. if (source && source !== target || (effect && effect.id === 'toxicspikes')) {
  209. this.debug('misty terrain preventing status');
  210. return false;
  211. }
  212. },
  213. onTryHit: function (target, source, move) {
  214. if (!target.runImmunity('Ground')) return;
  215. if (move && move.id === 'yawn') {
  216. this.debug('misty terrain blocking yawn');
  217. return false;
  218. }
  219. },
  220. onBasePower: function (basePower, attacker, defender, move) {
  221. if (move.type === 'Dragon' && defender.runImmunity('Ground')) {
  222. this.debug('misty terrain weaken');
  223. return this.chainModify(0.5);
  224. }
  225. },
  226. onStart: function (side) {
  227. this.add('-fieldstart', 'Misty Terrain');
  228. },
  229. onResidualOrder: 21,
  230. onResidualSubOrder: 2,
  231. onEnd: function (side) {
  232. this.add('-fieldend', 'Misty Terrain');
  233. }
  234. }
  235. },
  236. "raindance": {
  237. inherit: true,
  238. desc: "For 10 turns, the weather becomes Rain Dance. The power of Water-type attacks is 1.5x and the power of Fire-type attacks is 0.5x during the effect. Lasts for 13 turns if the user is holding Damp Rock. Fails if the current weather is Rain Dance.",
  239. shortDesc: "For 10 turns, heavy rain powers Water moves."
  240. },
  241. "reflect": {
  242. inherit: true,
  243. desc: "For 10 turns, the user and its party members take 0.5x damage from physical attacks, or 0.66x damage if in a double or triple battle. Critical hits ignore this protection. It is removed from the user's side if the user or an ally is successfully hit by Brick Break or Defog. Brick Break removes the effect before damage is calculated. Lasts for 13 turns if the user is holding Light Clay.",
  244. shortDesc: "For 10 turns, physical damage to allies is halved.",
  245. effect: {
  246. duration: 10,
  247. durationCallback: function (target, source, effect) {
  248. if (source && source.hasItem('lightclay')) {
  249. return 13;
  250. }
  251. return 10;
  252. },
  253. onFoeModifyDamage: function (damage, source, target, move) {
  254. if (this.getCategory(move) === 'Physical' && target.side === this.effectData.target) {
  255. if (!move.crit && !move.ignoreScreens) {
  256. this.debug('Reflect weaken');
  257. if (source.side.active.length > 1) return this.chainModify(0.66);
  258. return this.chainModify(0.5);
  259. }
  260. }
  261. },
  262. onStart: function (side) {
  263. this.add('-sidestart', side, 'Reflect');
  264. },
  265. onResidualOrder: 21,
  266. onEnd: function (side) {
  267. this.add('-sideend', side, 'Reflect');
  268. }
  269. }
  270. },
  271. "sandstorm": {
  272. inherit: true,
  273. desc: "For 10 turns, the weather becomes Sandstorm. At the end of each turn except the last, all active Pokemon lose 1/16 of their maximum HP, rounded down, unless they are a Ground, Rock, or Steel-type, or have the Abilities Magic Guard, Overcoat, Sand Force, Sand Rush, or Sand Veil. The Special Defense of Rock-types is 1.5x during the effect. Lasts for 13 turns if the user is holding Smooth Rock. Fails if the current weather is Sandstorm.",
  274. shortDesc: "For 10 turns, a sandstorm rages."
  275. },
  276. "spikes": {
  277. num: 191,
  278. accuracy: true,
  279. basePower: 0,
  280. category: "Status",
  281. desc: "Sets up a hazard on the foe's side of the field, damaging each foe that switches in, unless it is a Flying-type or has the Ability Levitate. Can be used up to three times before failing. Foes lose 1/8 of their maximum HP with one layer, 1/6 of their maximum HP with two layers, and 1/4 of their maximum HP with three layers, all rounded down. Can be removed from the foe's side if any foe uses Rapid Spin or is hit by Defog. Pokemon protected by Magic Coat or the Ability Magic Bounce are unaffected and instead use this move themselves.",
  282. shortDesc: "Hurts grounded foes on switch-in. Max 3 layers.",
  283. id: "spikes",
  284. isViable: true,
  285. name: "Spikes",
  286. pp: 20,
  287. priority: 0,
  288. isBounceable: true,
  289. sideCondition: 'spikes',
  290. effect: {
  291. duration: 9,
  292. // this is a side condition
  293. onStart: function (side) {
  294. this.add('-sidestart', side, 'Spikes');
  295. this.add('-sidestart', side, 'Spikes');
  296. this.effectData.layers = 2;
  297. },
  298. onRestart: function (side) {
  299. if (this.effectData.layers >= 3) return false;
  300. this.add('-sidestart', side, 'Spikes');
  301. if (this.effectData.layers === 2) {
  302. this.effectData.layers++;
  303. } else {
  304. this.add('-sidestart', side, 'Spikes');
  305. this.effectData.layers = this.effectData.layers + 2;
  306. }
  307. },
  308. onSwitchIn: function (pokemon) {
  309. var side = pokemon.side;
  310. if (!pokemon.runImmunity('Ground')) return;
  311. var damageAmounts = [0, 3, 4, 6]; // 1/8, 1/6, 1/4
  312. var damage = this.damage(damageAmounts[this.effectData.layers] * pokemon.maxhp / 24);
  313. },
  314. onEnd: function (side) {
  315. this.add('-sideend', side, 'Spikes');
  316. }
  317. },
  318. secondary: false,
  319. target: "foeSide",
  320. type: "Ground"
  321. },
  322. "stealthrock": {
  323. inherit: true,
  324. desc: "Sets up a hazard on the foe's side of the field, damaging each foe that switches in. Can be used only once before failing. Foes lose 1/32, 1/16, 1/8, 1/4, or 1/2 of their maximum HP, rounded down, based on their weakness to the Rock-type; 0.25x, 0.5x, neutral, 2x, or 4x, respectively. Can be removed from the foe's side if any foe uses Rapid Spin, is hit by Defog, or 8 turns after the first successful instance of the move was used. Pokemon protected by Magic Coat or the Ability Magic Bounce are unaffected and instead use this move themselves.(CAP: Pokemon with the Ability Mountaineer are immune.)",
  325. effect: {
  326. duration: 9,
  327. // this is a side condition
  328. onStart: function (side) {
  329. this.add('-sidestart', side, 'move: Stealth Rock');
  330. },
  331. onSwitchIn: function (pokemon) {
  332. var typeMod = this.getEffectiveness('Rock', pokemon);
  333. var factor = 8;
  334. if (typeMod === 1) factor = 4;
  335. if (typeMod >= 2) factor = 2;
  336. if (typeMod === -1) factor = 16;
  337. if (typeMod <= -2) factor = 32;
  338. var damage = this.damage(pokemon.maxhp / factor);
  339. },
  340. onEnd: function (side) {
  341. this.add('-sideend', side, 'move: Stealth Rock');
  342. }
  343. }
  344. },
  345. "stickyweb": {
  346. inherit: true,
  347. desc: "Lowers the Speed stat of the opposing team's Pokemon upon switching into battle. Disappears after 8 turns.",
  348. effect: {
  349. duration: 9,
  350. onStart: function (side) {
  351. this.add('-sidestart', side, 'move: Sticky Web');
  352. },
  353. onSwitchIn: function (pokemon) {
  354. if (!pokemon.runImmunity('Ground')) return;
  355. this.add('-activate', pokemon, 'move: Sticky Web');
  356. this.boost({spe: -1}, pokemon, pokemon.side.foe.active[0], this.getMove('stickyweb'));
  357. },
  358. onEnd: function (side) {
  359. this.add('-sideend', side, 'move: Sticky Web');
  360. }
  361. }
  362. },
  363. "sunnyday": {
  364. inherit: true,
  365. desc: "For 10 turns, the weather becomes Sunny Day. The power of Fire-type attacks is 1.5x and the power of Water-type attacks is 0.5x during the effect. Lasts for 13 turns if the user is holding Heat Rock. Fails if the current weather is Sunny Day.",
  366. shortDesc: "For 10 turns, intense sunlight powers Fire moves."
  367. },
  368. "toxicspikes": {
  369. inherit: true,
  370. desc: "Sets up a hazard on the foe's side of the field, poisoning each foe that switches in, unless it is a Flying-type or has the Ability Levitate. Can be used up to two times before failing. Foes become poisoned with one layer and badly poisoned with two layers. Can be removed from the foe's side if any foe uses Rapid Spin, is hit by Defog, a grounded Poison-type switches in, or 8 turns after the first successful instance of the move was used. Safeguard prevents the foe's party from being poisoned on switch-in, but Substitute does not. Pokemon protected by Magic Coat or the Ability Magic Bounce are unaffected and instead use this move themselves.",
  371. effect: {
  372. duration: 9,
  373. // this is a side condition
  374. onStart: function (side) {
  375. this.add('-sidestart', side, 'move: Toxic Spikes');
  376. this.effectData.layers = 1;
  377. },
  378. onRestart: function (side) {
  379. if (this.effectData.layers >= 2) return false;
  380. this.add('-sidestart', side, 'move: Toxic Spikes');
  381. this.effectData.layers++;
  382. },
  383. onSwitchIn: function (pokemon) {
  384. if (!pokemon.runImmunity('Ground')) return;
  385. if (!pokemon.runImmunity('Poison')) return;
  386. if (pokemon.hasType('Poison')) {
  387. this.add('-sideend', pokemon.side, 'move: Toxic Spikes', '[of] ' + pokemon);
  388. pokemon.side.removeSideCondition('toxicspikes');
  389. } else if (this.effectData.layers >= 2) {
  390. pokemon.trySetStatus('tox');
  391. } else {
  392. pokemon.trySetStatus('psn');
  393. }
  394. },
  395. onEnd: function (side) {
  396. this.add('-sideend', side, 'move: Toxic Spikes');
  397. }
  398. }
  399. },
  400. "trickroom": {
  401. inherit: true,
  402. desc: "For 10 turns, all active Pokemon with lower Speed will move before those with higher Speed, within their priority brackets. If this move is used during the effect, the effect ends. Priority -7.",
  403. shortDesc: "For 10 turns, slower Pokemon move first.",
  404. effect: {
  405. duration: 10,
  406. durationCallback: function (source, effect) {
  407. if (source && source.hasAbility('persistent')) {
  408. return 13;
  409. }
  410. return 10;
  411. },
  412. onStart: function (target, source) {
  413. this.add('-fieldstart', 'move: Trick Room', '[of] ' + source);
  414. this.getStatCallback = function (stat, statName) {
  415. // If stat is speed and does not overflow (Trick Room Glitch) return negative speed.
  416. if (statName === 'spe' && stat <= 1809) return -stat;
  417. return stat;
  418. };
  419. },
  420. onResidualOrder: 23,
  421. onEnd: function () {
  422. this.add('-fieldend', 'move: Trick Room');
  423. this.getStatCallback = null;
  424. }
  425. }
  426. },
  427. "wonderroom": {
  428. inherit: true,
  429. desc: "For 10 turns, all active Pokemon have their Defense and Special Defense stats swapped. Stat stage changes are unaffected. If this move is used during the effect, the effect ends.",
  430. shortDesc: "For 10 turns, all Defense and Sp. Def stats switch.",
  431. effect: {
  432. duration: 10,
  433. onStart: function (side, source) {
  434. this.add('-fieldstart', 'move: WonderRoom', '[of] ' + source);
  435. },
  436. onModifyMovePriority: -100,
  437. onModifyMove: function (move) {
  438. move.defensiveCategory = ((move.defensiveCategory || this.getCategory(move)) === 'Physical' ? 'Special' : 'Physical');
  439. this.debug('Defensive Category: ' + move.defensiveCategory);
  440. },
  441. onResidualOrder: 24,
  442. onEnd: function () {
  443. this.add('-fieldend', 'move: Wonder Room');
  444. }
  445. }
  446. }
  447. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement